/* global React, Icon, IconBtn, Avatar, Kbd, Pill, Badge, Popover, PopoverItem */ /* App shell: StatusStrip, Sidebar, TopBar, CommandPalette */ const { useState, useEffect, useRef, useMemo } = React; function StatusStrip() { const [p, setP] = useState(8); useEffect(() => { const onScroll = () => { const h = document.documentElement; const max = h.scrollHeight - h.clientHeight; setP(Math.max(2, Math.min(100, (h.scrollTop / Math.max(1, max)) * 100))); }; window.addEventListener("scroll", onScroll, true); onScroll(); return () => window.removeEventListener("scroll", onScroll, true); }, []); return
; } function Wordmark({ collapsed }) { if (collapsed) { return (
BG
); } return (
BNMR GLVZ Catalyst · v4.1
); } function NavItem({ icon, label, active, onClick, badge, collapsed, danger }) { return ( ); } function NavSection({ title, children, collapsed }) { return (
{!collapsed && title && (
{title}
)} {children}
); } function Sidebar({ route, onRoute, sidebar, onPalette }) { const collapsed = sidebar === "icon"; const hidden = sidebar === "hidden"; if (hidden) return null; const sections = [ { title: null, items: [ { id: "analytics", icon: , label: "Overview" }, { id: "inbox", icon: , label: "Inbox", badge: "12" }, { id: "table", icon: , label: "Audits" }, ], }, { title: "Intelligence Suite", items: [ { id: "brandlens", icon: , label: "BrandLens" }, { id: "catalyst", icon: , label: "Catalyst" }, { id: "bigsights", icon: , label: "BIGSights" }, { id: "hive", icon: , label: "HIVE" }, { id: "milton", icon: , label: "Milton.AI" }, ], }, { title: "Workspace", items: [ { id: "workflow", icon: , label: "New audit" }, { id: "empty", icon: , label: "Projects" }, { id: "settings", icon: , label: "Settings" }, ], }, ]; return ( ); } /* ---------- TopBar ---------- */ function TopBar({ breadcrumb, title, eyebrow, actions, onSidebarToggle, onPalette }) { return (
} onClick={onSidebarToggle} label="Toggle sidebar" size={32}/> {breadcrumb}
} label="Notifications" size={32}/> {actions} MIA · 09:42
); } /* ---------- Command Palette ---------- */ function CommandPalette({ open, onClose, onRoute }) { const [q, setQ] = useState(""); const inputRef = useRef(); useEffect(() => { if (!open) return; setTimeout(() => inputRef.current && inputRef.current.focus(), 50); setQ(""); const onKey = (e) => { if (e.key === "Escape") onClose && onClose(); }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, [open, onClose]); const all = useMemo(() => [ { group: "Pages", items: [ { id: "analytics", icon: , label: "Overview", hint: "Catalyst summary" }, { id: "inbox", icon: , label: "Inbox", hint: "12 new" }, { id: "table", icon: , label: "Audits", hint: "All audits" }, { id: "settings", icon: , label: "Settings", hint: "Account, billing, team" }, { id: "workflow", icon: , label: "New audit", hint: "Start a paid audit · 2–3 weeks" }, { id: "empty", icon: , label: "Projects (empty)", hint: "Onboarding state" }, { id: "gallery", icon: , label: "Component gallery", hint: "All primitives" }, { id: "auth", icon: , label: "Auth screens", hint: "Login · signup · reset" }, ]}, { group: "Suite", items: [ { id: "brandlens", icon: , label: "BrandLens", hint: "Brand diagnostic" }, { id: "catalyst", icon: , label: "Catalyst Intelligence", hint: "Decision OS" }, { id: "hive", icon: , label: "HIVE", hint: "Agent orchestration" }, { id: "milton", icon: , label: "Milton.AI", hint: "Knowledge agent" }, ]}, { group: "Quick actions", items: [ { id: "_run-audit", icon: , label: "Run last audit", hint: "Re-execute Loop 14" }, { id: "_invite", icon: , label: "Invite teammate", hint: "Send by email" }, { id: "_export", icon: , label: "Export current view", hint: "CSV · JSON" }, ]}, ], []); const filtered = useMemo(() => { if (!q.trim()) return all; const s = q.toLowerCase(); return all.map(g => ({ ...g, items: g.items.filter(it => it.label.toLowerCase().includes(s) || (it.hint || "").toLowerCase().includes(s)) })) .filter(g => g.items.length); }, [q, all]); if (!open) return null; return (
e.stopPropagation()} style={{ width: "100%", maxWidth: 600, background: "var(--bg)", border: "1px solid var(--ink)", borderRadius: "var(--r-sharp)", overflow: "hidden", animation: "popIn 220ms cubic-bezier(.2,.7,.2,1)", }}>
setQ(e.target.value)} placeholder="Type a command, jump to a page, or run a query…" style={{ flex: 1, border: 0, outline: 0, background: "transparent", fontFamily: "var(--sans)", fontSize: 16, color: "var(--ink)", }}/> ESC
{filtered.length === 0 ? (
No matches for "{q}"
) : ( filtered.map((g, gi) => (
{g.group}
{g.items.map((it) => ( ))}
)) )}
↑↓ navigate · ↵ select · ⌘K toggle Catalyst v4.1
); } Object.assign(window, { StatusStrip, Wordmark, NavItem, NavSection, Sidebar, TopBar, CommandPalette });