/* Shell — Icon, the dual-register sidebar (host CRM + the 95 Forward add-on),
the context-aware topbar, and shared helpers. Exports to window.POC. */
const DS_SHELL = window.Ds95ForwardDesignSystem_31a0c4 || {};
/* Lucide icon wrapper — re-renders the SVG each paint. */
function Icon({ name, size = 18, stroke = 1.8, color = "currentColor", style }) {
const ref = React.useRef(null);
React.useEffect(() => {
if (window.lucide && ref.current) {
ref.current.innerHTML = "";
const i = document.createElement("i");
i.setAttribute("data-lucide", name);
ref.current.appendChild(i);
window.lucide.createIcons({ attrs: { width: size, height: size, "stroke-width": stroke } });
}
});
return ;
}
/* Which routes belong to the warm 95 Forward register. */
const F95_ROUTES = ["today", "mpl", "candidates", "prospect", "greensheet", "visit", "initiatives", "initiative", "settings95"];
function isF95(route) { return F95_ROUTES.indexOf(route) !== -1; }
/* ---- Sidebar -------------------------------------------------------- */
function NavRow({ icon, label, active, muted, onClick, indent, accent, trailing }) {
const [hover, setHover] = React.useState(false);
const bg = active ? (accent === "gold" ? "var(--gold-50)" : accent === "blue" ? "var(--blue-50)" : "var(--host-fill-2, #E2E8EC)")
: hover ? "rgba(120,135,148,0.10)" : "transparent";
const col = active ? (accent === "gold" ? "var(--gold-700)" : accent === "blue" ? "var(--blue-700)" : "var(--host-ink-strong, #2A3640)")
: "var(--host-ink, #46545F)";
return (
);
}
function GroupLabel({ children }) {
return
{children}
;
}
function Sidebar({ route, params, go }) {
const D = window.POC_DATA;
const [open95, setOpen95] = React.useState(isF95(route));
const [openMG, setOpenMG] = React.useState(route === "majorgiving");
React.useEffect(() => { if (isF95(route)) setOpen95(true); if (route === "majorgiving") setOpenMG(true); }, [route]);
const Chevron = ({ open }) => (
);
return (
);
}
/* ---- Topbar --------------------------------------------------------- */
function Topbar({ title, subtitle, register, addLabel, onAdd, copilotCount, go }) {
const f95 = register === "f95";
return (
{title}
{subtitle ?
{subtitle}
: null}
{f95 && copilotCount ? (
) : null}
{addLabel ? (
f95 ? (
DS_SHELL.Button ? }>{addLabel} : null
) : (
)
) : null}
);
}
/* ---- Shared bits ---------------------------------------------------- */
function Eyebrow({ children, color = "var(--text-muted)" }) {
return {children}
;
}
/* A flat host card (denser, cooler, low elevation). */
function HostCard({ children, style, ...rest }) {
return {children}
;
}
/* Neutral host action button — minimal brand color. */
function HostBtn({ children, icon, primary, onClick, style }) {
const [h, setH] = React.useState(false);
const base = primary
? { background: h ? "#3E4C57" : "#4A5965", color: "#fff", border: "1px solid transparent" }
: { background: h ? "var(--host-fill, #EDF1F3)" : "var(--surface-card)", color: "var(--host-ink-strong, #2A3640)", border: "1px solid var(--host-rule, #D5DCE1)" };
return (
);
}
function StubNote({ children }) {
const D = window.POC;
return (
{children || "Static in this PoC"}
);
}
/* A simple host-side stub page. */
function StubPage({ icon, title, lead, children }) {
return (
);
}
window.POC = Object.assign(window.POC || {}, { Icon, isF95, Sidebar, Topbar, Eyebrow, HostCard, HostBtn, StubNote, StubPage });