@uibot/registry 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "path": "components/uibot/layout.tsx",
15
15
  "target": "components/uibot/layout.tsx",
16
- "content": "import { PREVIEW_SCOPE_CSS, SCROLLBAR_CSS } from \"./preview-scope\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { AdminFrame } from \"./admin-shell\";\nimport { LiveDrawer, LiveModal, SidebarDrawer } from \"./overlay\";\nimport { emit, type BlockContext } from \"./interaction\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\n\nconst GAP: Record<string, string> = {\n none: \"gap-0\",\n xs: \"gap-1\",\n sm: \"gap-2\",\n md: \"gap-4\",\n lg: \"gap-6\",\n xl: \"gap-8\",\n};\nconst PAD: Record<string, string> = {\n none: \"p-0\",\n xs: \"p-1\",\n sm: \"p-2\",\n md: \"p-4\",\n lg: \"p-6\",\n xl: \"p-8\",\n};\n\n/** Flexible container box */\nexport const Box: RendererComponent = (props, ctx) => {\n const dir =\n props.direction === \"col\" ? \"flex-col\" : props.direction === \"row\" ? \"flex-row\" : \"flex-col\";\n const gap = GAP[typeof props.gap === \"string\" ? props.gap : \"\"] ?? \"\";\n const pad = PAD[typeof props.padding === \"string\" ? props.padding : \"\"] ?? \"\";\n const align = typeof props.align === \"string\" ? `items-${props.align}` : \"\";\n const justify = typeof props.justify === \"string\" ? `justify-${props.justify}` : \"\";\n const wrap = props.wrap === true ? \"flex-wrap\" : \"\";\n const full = props.full === true ? \"w-full\" : \"\";\n const userCls = typeof props.className === \"string\" ? props.className : \"\";\n\n return (\n <div\n className={cn(\"uibot-box flex\", dir, gap, pad, align, justify, wrap, full, userCls)}\n data-uibot-type=\"Box\"\n >\n {ctx.children as ReactNode[]}\n </div>\n );\n};\n\nfunction pageLayoutVariant(value: unknown): \"sidebar\" | \"inset\" | \"floating\" {\n if (value === \"inset\" || value === \"floating\") return value;\n return \"sidebar\";\n}\n\nfunction pageLayoutCollapsible(value: unknown): \"none\" | \"icon\" | \"offcanvas\" {\n if (value === \"icon\" || value === \"offcanvas\") return value;\n return \"none\";\n}\n\nconst ICON_SIDEBAR_CSS = `\n.uibot-icon-sidebar:is(:hover,:focus-within){width:14rem}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-link{justify-content:center;gap:0;padding-inline:0}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-label,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-badge,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-sider-full-title,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-group-title{display:none}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-fallback,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-sider-abbreviation{display:block}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-sider-title{padding-inline:0;text-align:center}\n.uibot-icon-sidebar .uibot-menu-link{min-width:0}\n.uibot-icon-sidebar .uibot-menu-label{overflow-wrap:anywhere}\n`;\n\n/** Full-page layout with optional header, sidebar, and footer */\nexport const PageLayout: RendererComponent = (props, ctx) => {\n if (props.appearance === \"admin\") return <AdminFrame props={props} ctx={ctx} />;\n return <PageLayoutView props={props} ctx={ctx} />;\n};\n\nfunction PageLayoutView({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const variant = pageLayoutVariant(props.variant);\n const collapsible = pageLayoutCollapsible(props.collapsible);\n const hasSidebar = Boolean(ctx.slots.sidebar);\n const offcanvas = collapsible === \"offcanvas\";\n const [smallScreen, setSmallScreen] = useState(false);\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const sidebarTrigger = useRef<HTMLButtonElement>(null);\n const sidebarId = useId();\n useEffect(() => {\n if (!offcanvas || !hasSidebar) {\n setSmallScreen(false);\n setSidebarOpen(false);\n return;\n }\n const media = window.matchMedia(\"(max-width:767px)\");\n const sync = () => {\n setSmallScreen(media.matches);\n if (!media.matches) setSidebarOpen(false);\n };\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, [offcanvas, hasSidebar]);\n\n const asideWidth = collapsible === \"icon\" ? \"w-16\" : \"w-56\";\n const showSidebar = hasSidebar && (!offcanvas || !smallScreen);\n const showHeader =\n typeof props.title === \"string\" || ctx.slots.headerActions || (offcanvas && hasSidebar);\n\n return (\n <div\n className={cn(\n \"uibot-page-layout flex h-dvh flex-col overflow-hidden bg-background text-foreground\",\n variant === \"inset\" && \"uibot-page-layout-inset\",\n variant === \"floating\" && \"uibot-page-layout-floating\",\n )}\n data-uibot-type=\"PageLayout\"\n data-variant={variant}\n data-collapsible={collapsible}\n >\n <style>{PREVIEW_SCOPE_CSS + SCROLLBAR_CSS}</style>\n {collapsible === \"icon\" && <style>{ICON_SIDEBAR_CSS}</style>}\n {showHeader && (\n <header className=\"sticky top-0 z-10 flex h-14 shrink-0 items-center justify-between gap-4 border-b bg-background/95 px-6 backdrop-blur supports-[backdrop-filter]:bg-background/80\">\n {offcanvas && hasSidebar && (\n <button\n ref={sidebarTrigger}\n id={`${sidebarId}-trigger`}\n type=\"button\"\n className=\"inline-flex shrink-0 items-center justify-center rounded-md border px-3 py-2 text-sm focus-visible:ring-2 md:hidden\"\n aria-label=\"Open navigation\"\n aria-haspopup=\"dialog\"\n aria-controls={sidebarId}\n aria-expanded={smallScreen && sidebarOpen}\n onClick={() => setSidebarOpen(true)}\n >\n Menu\n </button>\n )}\n <span className=\"text-base font-semibold tracking-tight\">\n {typeof props.title === \"string\" ? props.title : \"\"}\n </span>\n {ctx.slots.headerActions && (\n <div className=\"flex items-center gap-2\">\n {ctx.slots.headerActions as ReactNode[]}\n </div>\n )}\n </header>\n )}\n <div className={cn(\"flex min-w-0 flex-1 overflow-hidden\", variant === \"inset\" && \"p-2\")}>\n {showSidebar && (\n <aside\n className={cn(\n \"shrink-0 overflow-y-auto bg-muted/30\",\n asideWidth,\n collapsible === \"icon\" && \"uibot-icon-sidebar\",\n offcanvas && \"hidden md:block\",\n variant === \"floating\" ? \"m-2 rounded-xl border shadow-sm\" : \"border-r\",\n )}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </aside>\n )}\n <main\n className={cn(\n \"min-w-0 flex-1 overflow-auto px-6 py-6 [&>*+*]:mt-5\",\n variant === \"inset\" && \"rounded-xl border bg-background shadow-sm\",\n )}\n >\n {ctx.children as ReactNode[]}\n </main>\n </div>\n {offcanvas && hasSidebar && (\n <SidebarDrawer\n id={sidebarId}\n open={smallScreen && sidebarOpen}\n onClose={() => setSidebarOpen(false)}\n triggerRef={sidebarTrigger}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </SidebarDrawer>\n )}\n {ctx.slots.footer && (\n <footer className=\"shrink-0 border-t px-6 py-3 text-sm text-muted-foreground\">\n {ctx.slots.footer as ReactNode[]}\n </footer>\n )}\n </div>\n );\n}\n\n/** Card container with optional title, description, and actions slot */\nexport const Card: RendererComponent = (props, ctx) => {\n const hasHeader =\n typeof props.title === \"string\" ||\n typeof props.description === \"string\" ||\n Boolean(ctx.slots.actions);\n\n return (\n <div\n className=\"uibot-card bg-card text-card-foreground rounded-xl border shadow-sm\"\n data-uibot-type=\"Card\"\n >\n {hasHeader && (\n <div className=\"flex items-start justify-between px-6 pt-6\">\n <div className=\"flex flex-col gap-1\">\n {typeof props.title === \"string\" && (\n <h3 className=\"text-base font-semibold leading-none tracking-tight\">{props.title}</h3>\n )}\n {typeof props.description === \"string\" && (\n <p className=\"text-sm text-muted-foreground\">{props.description}</p>\n )}\n </div>\n {ctx.slots.actions && (\n <div className=\"ml-4 flex items-center gap-2\">\n {ctx.slots.actions as ReactNode[]}\n </div>\n )}\n </div>\n )}\n <div className={cn(\"px-6 pb-6\", hasHeader ? \"pt-4\" : \"pt-6\")}>\n {ctx.children as ReactNode[]}\n {ctx.slots.default as ReactNode[]}\n </div>\n </div>\n );\n};\n\n/** Parse tabs prop — accepts string[] or comma-separated string */\nfunction parseTabs(raw: unknown): string[] {\n if (Array.isArray(raw)) return raw.map(String);\n if (typeof raw === \"string\" && raw.trim())\n return raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n return [];\n}\n\nfunction TabsView({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const tabs = parseTabs(props.tabs);\n const [local, setLocal] = useState(Number(props.defaultTab) || 0);\n const disabled = new Set(Array.isArray(props.disabledTabs) ? props.disabledTabs.map(Number) : []);\n const enabled = tabs.map((_, i) => i).filter((i) => !disabled.has(i));\n const segmented = props.variant === \"segmented\";\n const requested = Math.max(\n 0,\n Math.min(tabs.length - 1, typeof props.value === \"number\" ? props.value : local),\n );\n const active = disabled.has(requested) ? (enabled[0] ?? 0) : requested;\n const id = useId();\n const activate = (index: number) => {\n if (disabled.has(index)) return;\n setLocal(index);\n emit(ctx, \"onChange\", { index }, index);\n };\n return (\n <div\n className=\"uibot-tabs\"\n data-uibot-type=\"Tabs\"\n data-variant={segmented ? \"segmented\" : \"underline\"}\n >\n <div\n className={\n segmented\n ? \"inline-flex max-w-full overflow-x-auto rounded-lg bg-muted p-1 gap-1\"\n : \"flex max-w-full overflow-x-auto gap-4 border-b\"\n }\n role=\"tablist\"\n aria-label={String(props.label ?? \"Tabs\")}\n >\n {tabs.map((tab, i) => (\n <button\n key={tab}\n type=\"button\"\n id={`${id}-${i}`}\n role=\"tab\"\n aria-controls={`${id}-panel-${i}`}\n disabled={disabled.has(i)}\n aria-selected={active === i}\n tabIndex={active === i ? 0 : -1}\n onClick={() => activate(i)}\n onKeyDown={(event) => {\n const next =\n event.key === \"ArrowRight\"\n ? (enabled[(enabled.indexOf(i) + 1) % enabled.length] ?? -1)\n : event.key === \"ArrowLeft\"\n ? (enabled[(enabled.indexOf(i) + enabled.length - 1) % enabled.length] ?? -1)\n : event.key === \"Home\"\n ? (enabled[0] ?? -1)\n : event.key === \"End\"\n ? (enabled.at(-1) ?? -1)\n : -1;\n if (next < 0) return;\n event.preventDefault();\n activate(next);\n event.currentTarget.parentElement\n ?.querySelectorAll<HTMLButtonElement>(\"button\")\n [next]?.focus();\n }}\n className={cn(\n \"text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed\",\n segmented ? \"rounded-md px-3 py-1\" : \"border-b-2 px-1 py-2\",\n active === i\n ? segmented\n ? \"bg-background shadow-sm\"\n : \"border-foreground\"\n : \"border-transparent text-muted-foreground\",\n )}\n >\n {tab}\n </button>\n ))}\n </div>\n <div\n role=\"tabpanel\"\n id={`${id}-panel-${active}`}\n aria-labelledby={`${id}-${active}`}\n tabIndex={0}\n className={segmented ? \"pt-4\" : \"pt-6\"}\n >\n {ctx.children[active] as ReactNode}\n </div>\n </div>\n );\n}\nexport const Tabs: RendererComponent = (props, ctx) => <TabsView props={props} ctx={ctx} />;\n\n/** Drawer (off-canvas side panel) — rendered inline in preview */\nconst InlineDrawer: RendererComponent = (props, ctx) => (\n <div\n className=\"uibot-drawer bg-background rounded-lg border shadow-xl\"\n data-uibot-type=\"Drawer\"\n role=\"dialog\"\n aria-label={typeof props.title === \"string\" ? props.title : \"Drawer\"}\n >\n {typeof props.title === \"string\" && (\n <div className=\"flex items-center border-b px-5 py-4\">\n <h2 className=\"text-base font-semibold\">{props.title}</h2>\n </div>\n )}\n <div className=\"px-5 py-4\">{ctx.children as ReactNode[]}</div>\n </div>\n);\n\n/** Modal dialog — rendered inline in preview */\nconst InlineModal: RendererComponent = (props, ctx) => (\n <div\n className=\"uibot-modal\"\n role=\"dialog\"\n data-uibot-type=\"Modal\"\n aria-modal=\"true\"\n aria-label={typeof props.title === \"string\" ? props.title : \"Modal\"}\n >\n <div className=\"bg-background text-foreground mx-auto w-full max-w-md rounded-xl border p-6 shadow-xl\">\n {typeof props.title === \"string\" && (\n <h2 className=\"mb-1 text-lg font-semibold tracking-tight\">{props.title}</h2>\n )}\n {typeof props.description === \"string\" && (\n <p className=\"mb-4 text-sm text-muted-foreground\">{props.description}</p>\n )}\n {ctx.children as ReactNode[]}\n </div>\n </div>\n);\n\n/** Horizontal or vertical separator */\nexport const Divider: RendererComponent = (props) => {\n const vertical = props.orientation === \"vertical\";\n return (\n <hr\n data-uibot-type=\"Divider\"\n aria-orientation={vertical ? \"vertical\" : \"horizontal\"}\n className={cn(\n \"uibot-divider shrink-0 border-0 bg-border\",\n vertical ? \"mx-3 w-px self-stretch\" : \"my-4 h-px w-full\",\n )}\n />\n );\n};\n\nexport const Drawer: RendererComponent = (props, ctx) =>\n props.open === undefined ? InlineDrawer(props, ctx) : LiveDrawer(props, ctx);\nexport const Modal: RendererComponent = (props, ctx) =>\n props.open === undefined ? InlineModal(props, ctx) : LiveModal(props, ctx);\n",
16
+ "content": "import { PREVIEW_SCOPE_CSS, SCROLLBAR_CSS } from \"./preview-scope\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport { AdminFrame } from \"./admin-shell\";\nimport { STANDARD_CONTAINER_CSS } from \"./layout-container\";\nimport { LiveDrawer, LiveModal, SidebarDrawer } from \"./overlay\";\nimport { emit, type BlockContext } from \"./interaction\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\n\nconst GAP: Record<string, string> = {\n none: \"gap-0\",\n xs: \"gap-1\",\n sm: \"gap-2\",\n md: \"gap-4\",\n lg: \"gap-6\",\n xl: \"gap-8\",\n};\nconst PAD: Record<string, string> = {\n none: \"p-0\",\n xs: \"p-1\",\n sm: \"p-2\",\n md: \"p-4\",\n lg: \"p-6\",\n xl: \"p-8\",\n};\n\n/** Flexible container box */\nexport const Box: RendererComponent = (props, ctx) => {\n const dir =\n props.direction === \"col\" ? \"flex-col\" : props.direction === \"row\" ? \"flex-row\" : \"flex-col\";\n const gap = GAP[typeof props.gap === \"string\" ? props.gap : \"\"] ?? \"\";\n const pad = PAD[typeof props.padding === \"string\" ? props.padding : \"\"] ?? \"\";\n const align = typeof props.align === \"string\" ? `items-${props.align}` : \"\";\n const justify = typeof props.justify === \"string\" ? `justify-${props.justify}` : \"\";\n const wrap = props.wrap === true ? \"flex-wrap\" : \"\";\n const full = props.full === true ? \"w-full\" : \"\";\n const userCls = typeof props.className === \"string\" ? props.className : \"\";\n\n return (\n <div\n className={cn(\"uibot-box flex\", dir, gap, pad, align, justify, wrap, full, userCls)}\n data-uibot-type=\"Box\"\n >\n {ctx.children as ReactNode[]}\n </div>\n );\n};\n\nfunction pageLayoutVariant(value: unknown): \"sidebar\" | \"inset\" | \"floating\" {\n if (value === \"inset\" || value === \"floating\") return value;\n return \"sidebar\";\n}\n\nfunction pageLayoutCollapsible(value: unknown): \"none\" | \"icon\" | \"offcanvas\" {\n if (value === \"icon\" || value === \"offcanvas\") return value;\n return \"none\";\n}\n\nconst ICON_SIDEBAR_CSS = `\n.uibot-icon-sidebar:is(:hover,:focus-within){width:14rem}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-link{justify-content:center;gap:0;padding-inline:0}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-label,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-badge,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-sider-full-title,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-group-title{display:none}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-menu-fallback,\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-sider-abbreviation{display:block}\n.uibot-icon-sidebar:not(:hover):not(:focus-within) .uibot-sider-title{padding-inline:0;text-align:center}\n.uibot-icon-sidebar .uibot-menu-link{min-width:0}\n.uibot-icon-sidebar .uibot-menu-label{overflow-wrap:anywhere}\n`;\n\n/** Full-page layout with optional header, sidebar, and footer */\nexport const PageLayout: RendererComponent = (props, ctx) => {\n if (props.appearance === \"standalone\") {\n const layout = props.layout as { container?: string } | undefined;\n return (\n <div\n data-uibot-type=\"PageLayout\"\n className=\"uibot-standalone-layout\"\n data-container={layout?.container}\n >\n <style>\n {PREVIEW_SCOPE_CSS +\n SCROLLBAR_CSS +\n STANDARD_CONTAINER_CSS +\n `.uibot-standalone-layout{height:100dvh;min-height:0;overflow:auto;background:var(--background);color:var(--foreground)}.uibot-standalone-layout>div{height:100%;min-height:100%;margin-inline:auto}.uibot-standalone-layout>div>.min-h-dvh{min-height:100%}.uibot-standalone-layout[data-container=boxed]{padding:16px;background:var(--muted)}.uibot-standalone-layout[data-container=boxed]>div{max-width:1120px;background:var(--background);border:1px solid var(--border);border-radius:12px;overflow:hidden}`}\n </style>\n <div>{ctx.children as ReactNode[]}</div>\n </div>\n );\n }\n if (props.appearance === \"admin\" || props.layout) return <AdminFrame props={props} ctx={ctx} />;\n return <PageLayoutView props={props} ctx={ctx} />;\n};\n\nfunction PageLayoutView({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const variant = pageLayoutVariant(props.variant);\n const collapsible = pageLayoutCollapsible(props.collapsible);\n const hasSidebar = Boolean(ctx.slots.sidebar);\n const offcanvas = collapsible === \"offcanvas\";\n const [smallScreen, setSmallScreen] = useState(false);\n const [sidebarOpen, setSidebarOpen] = useState(false);\n const sidebarTrigger = useRef<HTMLButtonElement>(null);\n const sidebarId = useId();\n useEffect(() => {\n if (!offcanvas || !hasSidebar) {\n setSmallScreen(false);\n setSidebarOpen(false);\n return;\n }\n const media = window.matchMedia(\"(max-width:767px)\");\n const sync = () => {\n setSmallScreen(media.matches);\n if (!media.matches) setSidebarOpen(false);\n };\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, [offcanvas, hasSidebar]);\n\n const asideWidth = collapsible === \"icon\" ? \"w-16\" : \"w-56\";\n const showSidebar = hasSidebar && (!offcanvas || !smallScreen);\n const showHeader =\n typeof props.title === \"string\" || ctx.slots.headerActions || (offcanvas && hasSidebar);\n\n return (\n <div\n className={cn(\n \"uibot-page-layout flex h-dvh flex-col overflow-hidden bg-background text-foreground\",\n variant === \"inset\" && \"uibot-page-layout-inset\",\n variant === \"floating\" && \"uibot-page-layout-floating\",\n )}\n data-uibot-type=\"PageLayout\"\n data-variant={variant}\n data-collapsible={collapsible}\n >\n <style>{PREVIEW_SCOPE_CSS + SCROLLBAR_CSS}</style>\n {collapsible === \"icon\" && <style>{ICON_SIDEBAR_CSS}</style>}\n {showHeader && (\n <header className=\"sticky top-0 z-10 flex h-14 shrink-0 items-center justify-between gap-4 border-b bg-background/95 px-6 backdrop-blur supports-[backdrop-filter]:bg-background/80\">\n {offcanvas && hasSidebar && (\n <button\n ref={sidebarTrigger}\n id={`${sidebarId}-trigger`}\n type=\"button\"\n className=\"inline-flex shrink-0 items-center justify-center rounded-md border px-3 py-2 text-sm focus-visible:ring-2 md:hidden\"\n aria-label=\"Open navigation\"\n aria-haspopup=\"dialog\"\n aria-controls={sidebarId}\n aria-expanded={smallScreen && sidebarOpen}\n onClick={() => setSidebarOpen(true)}\n >\n Menu\n </button>\n )}\n <span className=\"text-base font-semibold tracking-tight\">\n {typeof props.title === \"string\" ? props.title : \"\"}\n </span>\n {ctx.slots.headerActions && (\n <div className=\"flex items-center gap-2\">\n {ctx.slots.headerActions as ReactNode[]}\n </div>\n )}\n </header>\n )}\n <div className={cn(\"flex min-w-0 flex-1 overflow-hidden\", variant === \"inset\" && \"p-2\")}>\n {showSidebar && (\n <aside\n className={cn(\n \"shrink-0 overflow-y-auto bg-muted/30\",\n asideWidth,\n collapsible === \"icon\" && \"uibot-icon-sidebar\",\n offcanvas && \"hidden md:block\",\n variant === \"floating\" ? \"m-2 rounded-xl border shadow-sm\" : \"border-r\",\n )}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </aside>\n )}\n <main\n className={cn(\n \"min-w-0 flex-1 overflow-auto px-6 py-6 [&>*+*]:mt-5\",\n variant === \"inset\" && \"rounded-xl border bg-background shadow-sm\",\n )}\n >\n {ctx.children as ReactNode[]}\n </main>\n </div>\n {offcanvas && hasSidebar && (\n <SidebarDrawer\n id={sidebarId}\n open={smallScreen && sidebarOpen}\n onClose={() => setSidebarOpen(false)}\n triggerRef={sidebarTrigger}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </SidebarDrawer>\n )}\n {ctx.slots.footer && (\n <footer className=\"shrink-0 border-t px-6 py-3 text-sm text-muted-foreground\">\n {ctx.slots.footer as ReactNode[]}\n </footer>\n )}\n </div>\n );\n}\n\n/** Card container with optional title, description, and actions slot */\nexport const Card: RendererComponent = (props, ctx) => {\n const hasHeader =\n typeof props.title === \"string\" ||\n typeof props.description === \"string\" ||\n Boolean(ctx.slots.actions);\n\n return (\n <div\n className={cn(\n \"uibot-card bg-card text-card-foreground rounded-xl border shadow-sm\",\n typeof props.className === \"string\" ? props.className : \"\",\n )}\n data-uibot-type=\"Card\"\n >\n {hasHeader && (\n <div className=\"flex items-start justify-between px-6 pt-6\">\n <div className=\"flex flex-col gap-1\">\n {typeof props.title === \"string\" && (\n <h3 className=\"text-base font-semibold leading-none tracking-tight\">{props.title}</h3>\n )}\n {typeof props.description === \"string\" && (\n <p className=\"text-sm text-muted-foreground\">{props.description}</p>\n )}\n </div>\n {ctx.slots.actions && (\n <div className=\"ml-4 flex items-center gap-2\">\n {ctx.slots.actions as ReactNode[]}\n </div>\n )}\n </div>\n )}\n <div className={cn(\"px-6 pb-6\", hasHeader ? \"pt-4\" : \"pt-6\")}>\n {ctx.children as ReactNode[]}\n {ctx.slots.default as ReactNode[]}\n </div>\n </div>\n );\n};\n\n/** Parse tabs prop — accepts string[] or comma-separated string */\nfunction parseTabs(raw: unknown): string[] {\n if (Array.isArray(raw)) return raw.map(String);\n if (typeof raw === \"string\" && raw.trim())\n return raw\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n return [];\n}\n\nfunction TabsView({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const tabs = parseTabs(props.tabs);\n const [local, setLocal] = useState(Number(props.defaultTab) || 0);\n const disabled = new Set(Array.isArray(props.disabledTabs) ? props.disabledTabs.map(Number) : []);\n const enabled = tabs.map((_, i) => i).filter((i) => !disabled.has(i));\n const segmented = props.variant === \"segmented\";\n const requested = Math.max(\n 0,\n Math.min(tabs.length - 1, typeof props.value === \"number\" ? props.value : local),\n );\n const active = disabled.has(requested) ? (enabled[0] ?? 0) : requested;\n const id = useId();\n const activate = (index: number) => {\n if (disabled.has(index)) return;\n setLocal(index);\n emit(ctx, \"onChange\", { index }, index);\n };\n return (\n <div\n className=\"uibot-tabs\"\n data-uibot-type=\"Tabs\"\n data-variant={segmented ? \"segmented\" : \"underline\"}\n >\n <div\n className={\n segmented\n ? \"inline-flex max-w-full overflow-x-auto rounded-lg bg-muted p-1 gap-1\"\n : \"flex max-w-full overflow-x-auto gap-4 border-b\"\n }\n role=\"tablist\"\n aria-label={String(props.label ?? \"Tabs\")}\n >\n {tabs.map((tab, i) => (\n <button\n key={tab}\n type=\"button\"\n id={`${id}-${i}`}\n role=\"tab\"\n aria-controls={`${id}-panel-${i}`}\n disabled={disabled.has(i)}\n aria-selected={active === i}\n tabIndex={active === i ? 0 : -1}\n onClick={() => activate(i)}\n onKeyDown={(event) => {\n const next =\n event.key === \"ArrowRight\"\n ? (enabled[(enabled.indexOf(i) + 1) % enabled.length] ?? -1)\n : event.key === \"ArrowLeft\"\n ? (enabled[(enabled.indexOf(i) + enabled.length - 1) % enabled.length] ?? -1)\n : event.key === \"Home\"\n ? (enabled[0] ?? -1)\n : event.key === \"End\"\n ? (enabled.at(-1) ?? -1)\n : -1;\n if (next < 0) return;\n event.preventDefault();\n activate(next);\n event.currentTarget.parentElement\n ?.querySelectorAll<HTMLButtonElement>(\"button\")\n [next]?.focus();\n }}\n className={cn(\n \"text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed\",\n segmented ? \"rounded-md px-3 py-1\" : \"border-b-2 px-1 py-2\",\n active === i\n ? segmented\n ? \"bg-background shadow-sm\"\n : \"border-foreground\"\n : \"border-transparent text-muted-foreground\",\n )}\n >\n {tab}\n </button>\n ))}\n </div>\n <div\n role=\"tabpanel\"\n id={`${id}-panel-${active}`}\n aria-labelledby={`${id}-${active}`}\n tabIndex={0}\n className={segmented ? \"pt-4\" : \"pt-6\"}\n >\n {ctx.children[active] as ReactNode}\n </div>\n </div>\n );\n}\nexport const Tabs: RendererComponent = (props, ctx) => <TabsView props={props} ctx={ctx} />;\n\n/** Drawer (off-canvas side panel) — rendered inline in preview */\nconst InlineDrawer: RendererComponent = (props, ctx) => (\n <div\n className=\"uibot-drawer bg-background rounded-lg border shadow-xl\"\n data-uibot-type=\"Drawer\"\n role=\"dialog\"\n aria-label={typeof props.title === \"string\" ? props.title : \"Drawer\"}\n >\n {typeof props.title === \"string\" && (\n <div className=\"flex items-center border-b px-5 py-4\">\n <h2 className=\"text-base font-semibold\">{props.title}</h2>\n </div>\n )}\n <div className=\"px-5 py-4\">{ctx.children as ReactNode[]}</div>\n </div>\n);\n\n/** Modal dialog — rendered inline in preview */\nconst InlineModal: RendererComponent = (props, ctx) => (\n <div\n className=\"uibot-modal\"\n role=\"dialog\"\n data-uibot-type=\"Modal\"\n aria-modal=\"true\"\n aria-label={typeof props.title === \"string\" ? props.title : \"Modal\"}\n >\n <div className=\"bg-background text-foreground mx-auto w-full max-w-md rounded-xl border p-6 shadow-xl\">\n {typeof props.title === \"string\" && (\n <h2 className=\"mb-1 text-lg font-semibold tracking-tight\">{props.title}</h2>\n )}\n {typeof props.description === \"string\" && (\n <p className=\"mb-4 text-sm text-muted-foreground\">{props.description}</p>\n )}\n {ctx.children as ReactNode[]}\n </div>\n </div>\n);\n\n/** Horizontal or vertical separator */\nexport const Divider: RendererComponent = (props) => {\n const vertical = props.orientation === \"vertical\";\n return (\n <hr\n data-uibot-type=\"Divider\"\n aria-orientation={vertical ? \"vertical\" : \"horizontal\"}\n className={cn(\n \"uibot-divider shrink-0 border-0 bg-border\",\n vertical ? \"mx-3 w-px self-stretch\" : \"my-4 h-px w-full\",\n )}\n />\n );\n};\n\nexport const Drawer: RendererComponent = (props, ctx) =>\n props.open === undefined ? InlineDrawer(props, ctx) : LiveDrawer(props, ctx);\nexport const Modal: RendererComponent = (props, ctx) =>\n props.open === undefined ? InlineModal(props, ctx) : LiveModal(props, ctx);\n",
17
17
  "type": "registry:ui"
18
18
  },
19
19
  {
@@ -25,7 +25,7 @@
25
25
  {
26
26
  "path": "components/uibot/admin-shell.tsx",
27
27
  "target": "components/uibot/admin-shell.tsx",
28
- "content": "import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { Icon } from \"./icons\";\nimport { emit, records, text, type BlockContext } from \"./interaction\";\nimport { PREVIEW_SCOPE_CSS, SCROLLBAR_CSS } from \"./preview-scope\";\n\nconst shellStyle = `\n.uibot-admin{font-family:var(--nui-font,Inter,ui-sans-serif,system-ui,sans-serif);display:flex;height:100dvh;overflow:hidden;background:var(--nui-sidebar,#fafafa);color:var(--nui-foreground,#171717);font-size:14px;line-height:1.5}.uibot-admin.dark{background:#141414;color:#fafafa}.uibot-admin *{box-sizing:border-box}.uibot-admin button,.uibot-admin a,.uibot-admin summary{touch-action:manipulation}.uibot-admin button:focus-visible,.uibot-admin a:focus-visible,.uibot-admin summary:focus-visible{outline:2px solid #737373;outline-offset:3px}.nui-sidebar{width:256px;flex:none;padding:8px;position:sticky;top:0;height:100dvh;overflow:auto;display:flex;flex-direction:column}.nui-main{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden;margin:8px;margin-inline-start:0;border:1px solid var(--nui-border,#e5e5e5);border-radius:12px;background:var(--nui-surface,#fff);box-shadow:0 1px 2px #00000005}.dark .nui-main{background:#0a0a0a;border-color:#262626}.nui-header{flex:none;height:64px;display:flex;gap:20px;align-items:center;padding:0 24px}.nui-header-links{display:flex;gap:24px;font-weight:500;font-size:14px}.nui-header-links a{color:#737373;text-decoration:none}.nui-header-links a[aria-current=page]{color:inherit}.nui-toolbar{display:flex;gap:12px;align-items:center;margin-inline-start:auto}.nui-icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;background:transparent;border:0;color:inherit;cursor:pointer}.nui-icon-button:hover{background:#88888815}.nui-search{display:flex;align-items:center;gap:9px;border:1px solid #e5e5e5;background:transparent;color:#737373;border-radius:6px;padding:5px 10px;width:240px;text-align:start}.nui-search kbd{margin-inline-start:auto;background:#88888810;border-radius:4px;padding:0 4px;font-size:11px}.nui-avatar{width:32px;height:32px;border-radius:50%;background:#eaeaea;color:#353535;display:grid;place-items:center;font-size:12px;font-weight:500}.nui-content{flex:1;min-height:0;overflow:auto;padding:20px 24px 28px}.nui-content>*+*{margin-top:20px}.nui-no-sidebar .nui-main{margin-inline-start:8px}.nui-brand{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:14px;text-align:start;width:100%;border:0;background:transparent;color:inherit}.nui-brand-mark{width:32px;height:32px;border-radius:8px;background:#171717;color:white;display:grid;place-items:center}.dark .nui-brand-mark{background:#fafafa;color:#171717}.nui-brand-copy{display:flex;flex:1;flex-direction:column;font-size:14px;line-height:19px}.nui-brand-copy small{font-size:12px;color:#737373}.nui-nav-group{margin:12px 0}.nui-nav-label{font-size:12px;font-weight:500;color:#737373;padding:0 8px;margin-bottom:6px}.nui-nav-link{display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:6px;font-size:14px;color:inherit;text-decoration:none;white-space:nowrap}.nui-nav-link:hover{background:#88888810}.nui-nav-link[aria-current=page]{background:var(--nui-accent,#e9e9e9);color:var(--nui-accent-foreground,inherit);font-weight:500}.dark .nui-nav-link[aria-current=page]{background:var(--nui-accent,#272727)}.dark .nui-nav-link .nui-badge{background:#fafafa;color:#171717}.nui-nav-link .nui-badge{margin-inline-start:auto;border-radius:5px;background:#171717;color:#fff;font-size:11px;padding:0 6px}.nui-nav-section summary{cursor:pointer;list-style:none}.nui-nav-section summary>svg:last-child{margin-inline-start:auto}.nui-nav-section[open] summary>svg:last-child{transform:rotate(90deg)}.nui-rail .nui-nav-section>div{display:none}.nui-nav-footer{margin-top:auto;padding-top:24px}.nui-rail .nui-sidebar{width:64px}.nui-rail .nui-nav-label,.nui-rail .nui-nav-text,.nui-rail .nui-brand-copy,.nui-rail .nui-badge,.nui-rail .nui-brand-chevron{display:none}.nui-rail .nui-nav-link{justify-content:center;padding:10px 0}.nui-command{border:1px solid #ddd;border-radius:10px;width:500px;max-width:calc(100vw - 32px);padding:0;margin:auto;background:inherit;color:inherit;box-shadow:0 20px 80px #0003}.nui-command::backdrop,.nui-mobile::backdrop{background:#0008}.nui-command input{width:100%;padding:16px;border:0;border-bottom:1px solid #8883;background:transparent;outline:none}.nui-command nav{padding:8px;max-height:360px;overflow:auto}.nui-mobile{margin:0;padding:8px;width:280px;max-width:85vw;height:100dvh;max-height:100dvh;border:0;background:#fafafa;color:#171717}.nui-mobile .nui-nav-footer{margin-top:24px}.nui-user-menu{position:relative}.nui-user-menu summary{list-style:none;cursor:pointer}.nui-user-menu nav{position:absolute;inset-inline-end:0;top:40px;min-width:190px;border:1px solid #8883;background:var(--nui-surface,#fff);border-radius:8px;padding:8px;z-index:40;box-shadow:0 4px 12px #0002}.nui-user-menu a{display:block;padding:8px;color:inherit;text-decoration:none}.dark .nui-user-menu nav,.dark .nui-command,.dark .nui-mobile{background:var(--nui-surface,#171717);color:#fafafa}.nui-mobile-close{float:right}.nui-brand-picker summary{list-style:none;cursor:pointer}.nui-brand-picker nav{padding:4px 8px;margin-bottom:12px}.nui-brand-picker a{display:block;padding:4px;color:inherit}\n@media(max-width:1024px){.nui-header-links{display:none}.nui-search{width:200px}}@media(max-width:767px){.nui-sidebar{display:none}.nui-main{margin:0;border:0;border-radius:0}.nui-header{padding:0 16px;gap:8px;height:60px}.nui-content{padding:16px}.nui-search{width:150px;font-size:12px}.nui-search kbd{display:none}.nui-toolbar{gap:5px}.uibot-admin table{min-width:680px}.uibot-admin h1{font-size:24px}}\n${PREVIEW_SCOPE_CSS}${SCROLLBAR_CSS}`;\nexport const AppNavigation: RendererComponent = (props, ctx) => (\n <>\n <style>{shellStyle}</style>\n <Navigation props={props} ctx={ctx} />\n </>\n);\nfunction Navigation({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n return (\n <>\n <details className=\"nui-brand-picker\">\n <summary aria-label={text(props.brand, \"Shadcn Admin\")}>\n <div className=\"nui-brand\">\n {typeof props.logoSrc === \"string\" && props.logoSrc ? (\n <img\n src={props.logoSrc}\n alt={text(props.brand, \"Brand\")}\n width={32}\n height={32}\n style={{ objectFit: \"contain\", flexShrink: 0 }}\n />\n ) : (\n <span className=\"nui-brand-mark\">\n <Icon name=\"command\" />\n </span>\n )}\n <span className=\"nui-brand-copy\">\n <strong>{text(props.brand, \"Shadcn Admin\")}</strong>\n <small>{text(props.subtitle, \"Vite + ShadcnUI\")}</small>\n </span>\n <span className=\"nui-brand-chevron\">\n <Icon name=\"chevrons-up-down\" size={16} />\n </span>\n </div>\n </summary>\n <nav aria-label=\"Workspaces\">\n {records(props.workspaces).map((w) => (\n <a\n key={text(w.href)}\n href={text(w.href)}\n onClick={() => emit(ctx, \"onNavigate\", { href: text(w.href) })}\n >\n {text(w.label)}\n </a>\n ))}\n </nav>\n </details>\n <nav aria-label=\"Main navigation\">\n {records(props.groups).map((group) => (\n <div className=\"nui-nav-group\" key={text(group.label)}>\n <div className=\"nui-nav-label\">{text(group.label)}</div>\n {records(group.items).map((item) =>\n records(item.children).length ? (\n <details\n key={text(item.label)}\n className=\"nui-nav-section\"\n open={\n records(item.children).some((child) => child.href === props.activePath) ||\n undefined\n }\n >\n <summary\n className=\"nui-nav-link\"\n aria-label={text(item.label)}\n title={text(item.label)}\n >\n <Icon name={text(item.icon, \"boxes\")} />\n <span className=\"nui-nav-text\">{text(item.label)}</span>\n <Icon name=\"chevron-right\" size={16} />\n </summary>\n <div className=\"ms-4 border-s ps-3\">\n {records(item.children).map((child) => (\n <a\n className=\"nui-nav-link\"\n key={text(child.href)}\n href={text(child.href)}\n aria-current={child.href === props.activePath ? \"page\" : undefined}\n onClick={() => emit(ctx, \"onNavigate\", { href: text(child.href) })}\n >\n {text(child.label)}\n </a>\n ))}\n </div>\n </details>\n ) : (\n <a\n key={text(item.href)}\n className=\"nui-nav-link\"\n title={text(item.label)}\n href={text(item.href)}\n aria-current={\n item.active === true || item.href === props.activePath ? \"page\" : undefined\n }\n onClick={() => emit(ctx, \"onNavigate\", { href: text(item.href) })}\n >\n <Icon name={text(item.icon, \"boxes\")} />\n <span className=\"nui-nav-text\">{text(item.label)}</span>\n {Boolean(item.badge) && <span className=\"nui-badge\">{text(item.badge)}</span>}\n </a>\n ),\n )}\n </div>\n ))}\n </nav>\n <div className=\"nui-nav-footer\">\n <a className=\"nui-nav-link\" href={text(props.profileHref, \"/settings/profile\")}>\n <span className=\"nui-avatar\">{text(props.initials, \"SN\")}</span>\n <span className=\"nui-brand-copy\">\n <strong>{text(props.userName, \"shadcn\")}</strong>\n <small>{text(props.email, \"m@example.com\")}</small>\n </span>\n <Icon name=\"chevrons-up-down\" size={16} />\n </a>\n </div>\n </>\n );\n}\nexport function AdminFrame({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const [rail, setRail] = useState(false),\n [localDark, setDark] = useState(props.theme === \"dark\"),\n [query, setQuery] = useState(\"\");\n const [systemDark, setSystemDark] = useState(false);\n const [smallScreen, setSmallScreen] = useState(false);\n const [mobileOpen, setMobileOpen] = useState(false);\n useEffect(() => {\n const media = window.matchMedia(\"(max-width:767px)\");\n const sync = () => setSmallScreen(media.matches);\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, []);\n useEffect(() => {\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const sync = () => setSystemDark(media.matches);\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, []);\n const dark =\n props.theme === \"system\"\n ? systemDark\n : typeof props.theme === \"string\"\n ? props.theme === \"dark\"\n : localDark;\n const root = useRef<HTMLDivElement>(null);\n // A page without sidebar content gets no empty navigation rail, toggle or drawer.\n const hasSidebarSlot: unknown = ctx.slots.sidebar;\n const hasSidebar = Array.isArray(hasSidebarSlot)\n ? hasSidebarSlot.length > 0\n : Boolean(hasSidebarSlot);\n const mobile = useRef<HTMLDialogElement>(null),\n command = useRef<HTMLDialogElement>(null),\n trigger = useRef<HTMLElement | null>(null);\n const close = (dialog: HTMLDialogElement | null) => {\n dialog?.close();\n trigger.current?.focus();\n };\n const show = useCallback((dialog: HTMLDialogElement | null) => {\n trigger.current = document.activeElement as HTMLElement;\n dialog?.showModal();\n }, []);\n useEffect(() => {\n const key = (e: KeyboardEvent) => {\n if (root.current?.closest(\"[inert]\")) return;\n if (\n document.activeElement !== document.body &&\n !root.current?.contains(document.activeElement)\n )\n return;\n if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"k\") {\n e.preventDefault();\n show(command.current);\n }\n };\n document.addEventListener(\"keydown\", key);\n return () => document.removeEventListener(\"keydown\", key);\n }, [show]);\n useEffect(() => {\n const menus = () =>\n Array.from(\n root.current?.querySelectorAll<HTMLDetailsElement>(\n \".nui-user-menu[open],.nui-brand-picker[open]\",\n ) ?? [],\n );\n const dismissOutside = (event: PointerEvent) => {\n for (const menu of menus()) if (!menu.contains(event.target as Node)) menu.open = false;\n };\n const dismissEscape = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || root.current?.querySelector(\"dialog[open]\")) return;\n for (const menu of menus()) {\n if (!menu.contains(document.activeElement)) continue;\n event.preventDefault();\n menu.open = false;\n menu.querySelector<HTMLElement>(\"summary\")?.focus();\n }\n };\n document.addEventListener(\"pointerdown\", dismissOutside);\n document.addEventListener(\"keydown\", dismissEscape);\n return () => {\n document.removeEventListener(\"pointerdown\", dismissOutside);\n document.removeEventListener(\"keydown\", dismissEscape);\n };\n }, []);\n useEffect(() => {\n if (!smallScreen) mobile.current?.close();\n }, [smallScreen]);\n const activePath = props.activePath ?? ctx.resolve?.getState?.(\"currentPath\");\n const routes = records(props.routes).filter((r) =>\n text(r.label).toLowerCase().includes(query.toLowerCase()),\n );\n return (\n <div\n ref={root}\n style={\n {\n fontFamily:\n props.font === \"System\"\n ? \"system-ui,sans-serif\"\n : props.font === \"Manrope\"\n ? \"Manrope,system-ui,sans-serif\"\n : undefined,\n ...Object.fromEntries(\n Object.entries(\n (props.tokens && typeof props.tokens === \"object\" ? props.tokens : {}) as Record<\n string,\n unknown\n >,\n )\n .filter(\n ([key, value]) =>\n [\n \"sidebar\",\n \"surface\",\n \"foreground\",\n \"accent\",\n \"accent-foreground\",\n \"primary\",\n \"primary-foreground\",\n \"border\",\n \"font\",\n ].includes(key) && typeof value === \"string\",\n )\n .map(([key, value]) => [\n key === \"primary\" || key === \"primary-foreground\" ? `--${key}` : `--nui-${key}`,\n value,\n ]),\n ),\n } as CSSProperties\n }\n data-uibot-type=\"PageLayout\"\n data-appearance=\"admin\"\n dir={props.direction === \"rtl\" ? \"rtl\" : \"ltr\"}\n className={`uibot-admin ${rail && !smallScreen ? \"nui-rail\" : \"\"} ${dark ? \"dark\" : \"\"} ${hasSidebar ? \"\" : \"nui-no-sidebar\"}`}\n onClickCapture={(event) => {\n if (rail && (event.target as HTMLElement).closest(\".nui-sidebar summary\")) setRail(false);\n }}\n >\n <style>{shellStyle}</style>\n {hasSidebar && <aside className=\"nui-sidebar\">{ctx.slots.sidebar as ReactNode[]}</aside>}\n <div className=\"nui-main\">\n <header className=\"nui-header\">\n {hasSidebar && (\n <button\n type=\"button\"\n className=\"nui-icon-button\"\n aria-label=\"Toggle sidebar\"\n aria-expanded={smallScreen ? mobileOpen : !rail}\n onClick={() => {\n if (smallScreen) {\n setMobileOpen(true);\n show(mobile.current);\n } else setRail(!rail);\n }}\n >\n <Icon name=\"panel-left\" />\n </button>\n )}\n <nav className=\"nui-header-links\" aria-label=\"Workspace\">\n {records(props.headerLinks).map((link) => (\n <a\n href={text(link.href)}\n key={text(link.label)}\n aria-current={\n link.href === activePath ||\n (link.href === \"/settings/profile\" &&\n typeof activePath === \"string\" &&\n activePath.startsWith(\"/settings/\"))\n ? \"page\"\n : undefined\n }\n >\n {text(link.label)}\n </a>\n ))}\n </nav>\n <div className=\"nui-toolbar\">\n <button type=\"button\" className=\"nui-search\" onClick={() => show(command.current)}>\n <Icon name=\"search\" size={16} />\n Search<kbd>⌘ K</kbd>\n </button>\n <button\n type=\"button\"\n className=\"nui-icon-button\"\n aria-label={dark ? \"Use light theme\" : \"Use dark theme\"}\n onClick={() => {\n setDark(!dark);\n emit(\n ctx,\n \"onThemeChange\",\n { theme: dark ? \"light\" : \"dark\" },\n dark ? \"light\" : \"dark\",\n );\n }}\n >\n <Icon name={dark ? \"moon\" : \"sun\"} />\n </button>\n <details className=\"nui-user-menu\">\n <summary aria-label=\"Open account menu\">\n <span className=\"nui-avatar\">{text(props.initials, \"SN\")}</span>\n </summary>\n <nav aria-label=\"Account\">\n {records(\n props.accountLinks ?? [\n { href: \"/settings/profile\", label: \"Profile\" },\n { href: \"/settings/account\", label: \"Account\" },\n { href: \"/settings/notifications\", label: \"Notifications\" },\n { href: \"/sign-in\", label: \"Sign in\" },\n ],\n ).map((link) => (\n <a key={text(link.href)} href={text(link.href)}>\n {text(link.label)}\n </a>\n ))}\n </nav>\n </details>\n {ctx.slots.headerActions as ReactNode[]}\n </div>\n </header>\n <main className=\"nui-content\">{ctx.children as ReactNode[]}</main>\n {ctx.slots.footer as ReactNode[]}\n </div>\n {hasSidebar && (\n <dialog\n ref={mobile}\n className=\"nui-mobile\"\n aria-label=\"Navigation\"\n onClose={() => {\n setMobileOpen(false);\n trigger.current?.focus();\n }}\n >\n <button\n type=\"button\"\n className=\"nui-icon-button nui-mobile-close\"\n aria-label=\"Close navigation\"\n onClick={() => close(mobile.current)}\n >\n <Icon name=\"x\" />\n </button>\n <div\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"a\")) close(mobile.current);\n }}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </div>\n </dialog>\n )}\n <dialog\n ref={command}\n className=\"nui-command\"\n aria-label=\"Search pages\"\n onClose={() => {\n setQuery(\"\");\n trigger.current?.focus();\n }}\n onKeyDown={(event) => {\n if (\n ![\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(event.key) ||\n event.target instanceof HTMLInputElement\n )\n return;\n const links = Array.from(\n command.current?.querySelectorAll<HTMLAnchorElement>(\"nav a\") ?? [],\n );\n if (!links.length) return;\n event.preventDefault();\n const index = links.indexOf(document.activeElement as HTMLAnchorElement);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? links.length - 1\n : (index + (event.key === \"ArrowDown\" ? 1 : -1) + links.length) % links.length;\n links[next]?.focus();\n }}\n >\n <input\n aria-label=\"Search pages\"\n autoComplete=\"off\"\n placeholder=\"Type a command or search...\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n const links = command.current?.querySelectorAll<HTMLAnchorElement>(\"nav a\");\n if (!links?.length) return;\n e.preventDefault();\n links[e.key === \"ArrowDown\" ? 0 : links.length - 1]?.focus();\n }\n }}\n />\n <nav>\n {routes.map((route) => (\n <a\n className=\"nui-nav-link\"\n href={text(route.href)}\n key={text(route.href)}\n onClick={() => close(command.current)}\n >\n <Icon name={text(route.icon, \"chevron-right\")} />\n {text(route.label)}\n </a>\n ))}\n {!routes.length && <p className=\"p-4 text-sm\">No results found.</p>}\n </nav>\n </dialog>\n </div>\n );\n}\n",
28
+ "content": "import {\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { Icon } from \"./icons\";\nimport { emit, records, text, type BlockContext } from \"./interaction\";\nimport { PREVIEW_SCOPE_CSS, SCROLLBAR_CSS } from \"./preview-scope\";\nimport { STANDARD_CONTAINER_CSS } from \"./layout-container\";\n\nconst layoutStyle = `\n.uibot-admin{position:relative}.nui-sidebar-space{width:256px;flex:none;min-height:0;position:relative}.nui-sidebar-space>.nui-sidebar{width:100%;height:100%}.nui-rail .nui-sidebar-space{width:64px}.nui-content-inner{min-height:100%}.nui-content-inner>*+*{margin-top:20px}\n.uibot-admin[data-container=boxed]>.nui-main{max-width:1120px;margin:0;flex-basis:0}.uibot-admin[data-container=boxed]{padding:16px;gap:16px;justify-content:center;background:var(--nui-sidebar,var(--muted,#eee))}\n.uibot-admin[data-navigation-style=attached]:not([data-container=boxed])>.nui-main{margin:0;border-radius:0;border-block:0;border-inline-end:0;box-shadow:none}\n.uibot-admin[data-navigation-style=floating]>.nui-sidebar-space{padding:8px}.uibot-admin[data-navigation-style=floating]>.nui-sidebar-space>.nui-sidebar{border:1px solid var(--nui-border,#e5e5e5);border-radius:12px;background:var(--nui-surface,#fff);height:100%}\n.uibot-admin[data-sidebar=hover]>.nui-sidebar-space{width:64px;z-index:30}.uibot-admin[data-sidebar=hover]>.nui-sidebar-space>.nui-sidebar{position:absolute;inset-inline-start:0;background:var(--nui-sidebar,#fafafa);width:64px}.uibot-admin[data-sidebar=hover]:not(.nui-rail)>.nui-sidebar-space>.nui-sidebar{width:256px;box-shadow:8px 0 25px #0002}\n.uibot-admin[data-offcanvas=floating]>.nui-mobile{margin:8px;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border:1px solid var(--nui-border,#ddd);border-radius:12px}\n@media(min-width:768px){\n.uibot-admin[data-navigation=navbar]{flex-direction:column}.uibot-admin[data-navigation=navbar]>.nui-sidebar-space{width:100%;z-index:31}.uibot-admin[data-navigation=navbar]>.nui-sidebar-space>.nui-sidebar{position:relative;display:flex;flex-direction:row;align-items:center;gap:24px;height:auto;width:100%;overflow:visible;padding:8px 16px;border-bottom:1px solid var(--nui-border,#ddd)}\n.uibot-admin[data-navigation=navbar] .nui-sidebar>.nui-brand-picker{flex:none}.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-brand{margin:0}.uibot-admin[data-navigation=navbar] .nui-sidebar>nav{display:flex;flex-wrap:wrap;gap:8px 20px}.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-nav-group{display:flex;align-items:center;gap:4px;margin:0}.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-nav-label,.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-nav-footer,.uibot-admin[data-navigation=navbar] .nui-header-links{display:none}\n.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-nav-section,.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-brand-picker{position:relative}.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-nav-section>div,.uibot-admin[data-navigation=navbar] .nui-sidebar .nui-brand-picker>nav{position:absolute;inset-block-start:100%;inset-inline-start:0;min-width:190px;max-height:60dvh;overflow:auto;margin:0;padding:8px;border:1px solid var(--nui-border,#ddd);border-radius:8px;background:var(--nui-surface,#fff);box-shadow:0 8px 20px #0002}\n.uibot-admin[data-navigation=navbar]>.nui-main{width:100%;flex-basis:0;margin-inline:0}.uibot-admin[data-navigation=navbar][data-navigation-style=floating]>.nui-sidebar-space{padding:8px}.uibot-admin[data-navigation=navbar][data-navigation-style=floating]>.nui-main{width:calc(100% - 16px);margin-inline:8px}\n.uibot-admin[data-navigation=navbar][data-container=boxed]{justify-content:flex-start}.uibot-admin[data-navigation=navbar][data-container=boxed]>.nui-sidebar-space{width:100%;max-width:1120px;padding:0;align-self:center}.uibot-admin[data-navigation=navbar][data-container=boxed]>.nui-main{width:100%;margin-inline:auto}\n}\n@media(min-width:768px){.uibot-admin[data-navigation=navbar] .nui-sidebar .uibot-sider-menu{flex-direction:row;height:auto;align-items:center;gap:16px}.uibot-admin[data-navigation=navbar] .uibot-sider-menu>ul,.uibot-admin[data-navigation=navbar] .uibot-menu-group>ul{display:flex;flex-wrap:wrap;gap:4px;overflow:visible}.uibot-admin[data-navigation=navbar] .uibot-menu-group-title{display:none}.uibot-admin[data-navigation=navbar] .uibot-sider-title{border:0;padding:8px}}\n.nui-rail .uibot-menu-label,.nui-rail .uibot-menu-badge,.nui-rail .uibot-sider-full-title,.nui-rail .uibot-menu-group-title{display:none}.nui-rail .uibot-menu-fallback,.nui-rail .uibot-sider-abbreviation{display:block}.nui-rail .uibot-menu-link{justify-content:center;padding-inline:0;gap:0}\n@media(max-width:767px){.nui-sidebar-space{display:none}.uibot-admin[data-container=boxed]{padding:8px;gap:0}.uibot-admin[data-container=boxed]>.nui-main{width:100%}}\n`;\nconst shellStyle = `\n.uibot-admin{font-family:var(--nui-font,Inter,ui-sans-serif,system-ui,sans-serif);display:flex;height:100dvh;overflow:hidden;background:var(--nui-sidebar,#fafafa);color:var(--nui-foreground,#171717);font-size:14px;line-height:1.5}.uibot-admin.dark{background:#141414;color:#fafafa}.uibot-admin *{box-sizing:border-box}.uibot-admin button,.uibot-admin a,.uibot-admin summary{touch-action:manipulation}.uibot-admin button:focus-visible,.uibot-admin a:focus-visible,.uibot-admin summary:focus-visible{outline:2px solid #737373;outline-offset:3px}.nui-sidebar{width:256px;flex:none;padding:8px;position:sticky;top:0;height:100dvh;overflow:auto;display:flex;flex-direction:column}.nui-main{min-width:0;min-height:0;flex:1;display:flex;flex-direction:column;overflow:hidden;margin:8px;margin-inline-start:0;border:1px solid var(--nui-border,#e5e5e5);border-radius:12px;background:var(--nui-surface,#fff);box-shadow:0 1px 2px #00000005}.dark .nui-main{background:#0a0a0a;border-color:#262626}.nui-header{flex:none;height:64px;display:flex;gap:20px;align-items:center;padding:0 24px}.nui-header-links{display:flex;gap:24px;font-weight:500;font-size:14px}.nui-header-links a{color:#737373;text-decoration:none}.nui-header-links a[aria-current=page]{color:inherit}.nui-toolbar{display:flex;gap:12px;align-items:center;margin-inline-start:auto}.nui-icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;background:transparent;border:0;color:inherit;cursor:pointer}.nui-icon-button:hover{background:#88888815}.nui-search{display:flex;align-items:center;gap:9px;border:1px solid #e5e5e5;background:transparent;color:#737373;border-radius:6px;padding:5px 10px;width:240px;text-align:start}.nui-search kbd{margin-inline-start:auto;background:#88888810;border-radius:4px;padding:0 4px;font-size:11px}.nui-avatar{width:32px;height:32px;border-radius:50%;background:#eaeaea;color:#353535;display:grid;place-items:center;font-size:12px;font-weight:500}.nui-content{flex:1;min-height:0;overflow:auto;padding:20px 24px 28px}.nui-content>*+*{margin-top:20px}.nui-no-sidebar .nui-main{margin-inline-start:8px}.nui-brand{display:flex;align-items:center;gap:10px;padding:8px;margin-bottom:14px;text-align:start;width:100%;border:0;background:transparent;color:inherit}.nui-brand-mark{width:32px;height:32px;border-radius:8px;background:#171717;color:white;display:grid;place-items:center}.dark .nui-brand-mark{background:#fafafa;color:#171717}.nui-brand-copy{display:flex;flex:1;flex-direction:column;font-size:14px;line-height:19px}.nui-brand-copy small{font-size:12px;color:#737373}.nui-nav-group{margin:12px 0}.nui-nav-label{font-size:12px;font-weight:500;color:#737373;padding:0 8px;margin-bottom:6px}.nui-nav-link{display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:6px;font-size:14px;color:inherit;text-decoration:none;white-space:nowrap}.nui-nav-link:hover{background:#88888810}.nui-nav-link[aria-current=page]{background:var(--nui-accent,#e9e9e9);color:var(--nui-accent-foreground,inherit);font-weight:500}.dark .nui-nav-link[aria-current=page]{background:var(--nui-accent,#272727)}.dark .nui-nav-link .nui-badge{background:#fafafa;color:#171717}.nui-nav-link .nui-badge{margin-inline-start:auto;border-radius:5px;background:#171717;color:#fff;font-size:11px;padding:0 6px}.nui-nav-section summary{cursor:pointer;list-style:none}.nui-nav-section summary>svg:last-child{margin-inline-start:auto}.nui-nav-section[open] summary>svg:last-child{transform:rotate(90deg)}.nui-rail .nui-nav-section>div{display:none}.nui-nav-footer{margin-top:auto;padding-top:24px}.nui-rail .nui-sidebar{width:64px}.nui-rail .nui-nav-label,.nui-rail .nui-nav-text,.nui-rail .nui-brand-copy,.nui-rail .nui-badge,.nui-rail .nui-brand-chevron{display:none}.nui-rail .nui-nav-link{justify-content:center;padding:10px 0}.nui-command{border:1px solid #ddd;border-radius:10px;width:500px;max-width:calc(100vw - 32px);padding:0;margin:auto;background:inherit;color:inherit;box-shadow:0 20px 80px #0003}.nui-command::backdrop,.nui-mobile::backdrop{background:#0008}.nui-command input{width:100%;padding:16px;border:0;border-bottom:1px solid #8883;background:transparent;outline:none}.nui-command nav{padding:8px;max-height:360px;overflow:auto}.nui-mobile{margin:0;padding:8px;width:280px;max-width:85vw;height:100dvh;max-height:100dvh;border:0;background:#fafafa;color:#171717}.nui-mobile .nui-nav-footer{margin-top:24px}.nui-user-menu{position:relative}.nui-user-menu summary{list-style:none;cursor:pointer}.nui-user-menu nav{position:absolute;inset-inline-end:0;top:40px;min-width:190px;border:1px solid #8883;background:var(--nui-surface,#fff);border-radius:8px;padding:8px;z-index:40;box-shadow:0 4px 12px #0002}.nui-user-menu a{display:block;padding:8px;color:inherit;text-decoration:none}.dark .nui-user-menu nav,.dark .nui-command,.dark .nui-mobile{background:var(--nui-surface,#171717);color:#fafafa}.nui-mobile-close{float:right}.nui-brand-picker summary{list-style:none;cursor:pointer}.nui-brand-picker nav{padding:4px 8px;margin-bottom:12px}.nui-brand-picker a{display:block;padding:4px;color:inherit}\n@media(max-width:1024px){.nui-header-links{display:none}.nui-search{width:200px}}@media(max-width:767px){.nui-sidebar{display:none}.nui-main{margin:0;border:0;border-radius:0}.nui-header{padding:0 16px;gap:8px;height:60px}.nui-content{padding:16px}.nui-search{width:150px;font-size:12px}.nui-search kbd{display:none}.nui-toolbar{gap:5px}.uibot-admin table{min-width:680px}.uibot-admin h1{font-size:24px}}\n${PREVIEW_SCOPE_CSS}${SCROLLBAR_CSS}${layoutStyle}${STANDARD_CONTAINER_CSS}`;\nexport const AppNavigation: RendererComponent = (props, ctx) => (\n <>\n <style>{shellStyle}</style>\n <Navigation props={props} ctx={ctx} />\n </>\n);\nfunction Navigation({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n return (\n <>\n <details className=\"nui-brand-picker\">\n <summary aria-label={text(props.brand, \"Shadcn Admin\")}>\n <div className=\"nui-brand\">\n {typeof props.logoSrc === \"string\" && props.logoSrc ? (\n <img\n src={props.logoSrc}\n alt={text(props.brand, \"Brand\")}\n width={32}\n height={32}\n style={{ objectFit: \"contain\", flexShrink: 0 }}\n />\n ) : (\n <span className=\"nui-brand-mark\">\n <Icon name=\"command\" />\n </span>\n )}\n <span className=\"nui-brand-copy\">\n <strong>{text(props.brand, \"Shadcn Admin\")}</strong>\n <small>{text(props.subtitle, \"Vite + ShadcnUI\")}</small>\n </span>\n <span className=\"nui-brand-chevron\">\n <Icon name=\"chevrons-up-down\" size={16} />\n </span>\n </div>\n </summary>\n <nav aria-label=\"Workspaces\">\n {records(props.workspaces).map((w) => (\n <a\n key={text(w.href)}\n href={text(w.href)}\n onClick={() => emit(ctx, \"onNavigate\", { href: text(w.href) })}\n >\n {text(w.label)}\n </a>\n ))}\n </nav>\n </details>\n <nav aria-label=\"Main navigation\">\n {records(props.groups).map((group) => (\n <div className=\"nui-nav-group\" key={text(group.label)}>\n <div className=\"nui-nav-label\">{text(group.label)}</div>\n {records(group.items).map((item) =>\n records(item.children).length ? (\n <details\n key={text(item.label)}\n className=\"nui-nav-section\"\n open={\n records(item.children).some((child) => child.href === props.activePath) ||\n undefined\n }\n >\n <summary\n className=\"nui-nav-link\"\n aria-label={text(item.label)}\n title={text(item.label)}\n >\n <Icon name={text(item.icon, \"boxes\")} />\n <span className=\"nui-nav-text\">{text(item.label)}</span>\n <Icon name=\"chevron-right\" size={16} />\n </summary>\n <div className=\"ms-4 border-s ps-3\">\n {records(item.children).map((child) => (\n <a\n className=\"nui-nav-link\"\n key={text(child.href)}\n href={text(child.href)}\n aria-current={child.href === props.activePath ? \"page\" : undefined}\n onClick={() => emit(ctx, \"onNavigate\", { href: text(child.href) })}\n >\n {text(child.label)}\n </a>\n ))}\n </div>\n </details>\n ) : (\n <a\n key={text(item.href)}\n className=\"nui-nav-link\"\n title={text(item.label)}\n href={text(item.href)}\n aria-current={\n item.active === true || item.href === props.activePath ? \"page\" : undefined\n }\n onClick={() => emit(ctx, \"onNavigate\", { href: text(item.href) })}\n >\n <Icon name={text(item.icon, \"boxes\")} />\n <span className=\"nui-nav-text\">{text(item.label)}</span>\n {Boolean(item.badge) && <span className=\"nui-badge\">{text(item.badge)}</span>}\n </a>\n ),\n )}\n </div>\n ))}\n </nav>\n <div className=\"nui-nav-footer\">\n <a className=\"nui-nav-link\" href={text(props.profileHref, \"/settings/profile\")}>\n <span className=\"nui-avatar\">{text(props.initials, \"SN\")}</span>\n <span className=\"nui-brand-copy\">\n <strong>{text(props.userName, \"shadcn\")}</strong>\n <small>{text(props.email, \"m@example.com\")}</small>\n </span>\n <Icon name=\"chevrons-up-down\" size={16} />\n </a>\n </div>\n </>\n );\n}\nexport function AdminFrame({ props, ctx }: { props: Record<string, unknown>; ctx: BlockContext }) {\n const layout =\n props.layout && typeof props.layout === \"object\"\n ? (props.layout as Record<string, unknown>)\n : {};\n const [hovered, setHovered] = useState(false);\n const [focused, setFocused] = useState(false);\n const [rail, setRail] = useState(layout.sidebar === \"folded\"),\n [localDark, setDark] = useState(props.theme === \"dark\"),\n [query, setQuery] = useState(\"\");\n useEffect(() => {\n setRail(layout.sidebar === \"folded\");\n setHovered(false);\n setFocused(false);\n }, [layout.sidebar]);\n const [systemDark, setSystemDark] = useState(false);\n const [smallScreen, setSmallScreen] = useState(false);\n const [mobileOpen, setMobileOpen] = useState(false);\n const collapsed =\n layout.navigation !== \"navbar\" &&\n !smallScreen &&\n (layout.sidebar === \"hover\" ? !(hovered || focused) : rail);\n useEffect(() => {\n const media = window.matchMedia(\"(max-width:767px)\");\n const sync = () => setSmallScreen(media.matches);\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, []);\n useEffect(() => {\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const sync = () => setSystemDark(media.matches);\n sync();\n media.addEventListener(\"change\", sync);\n return () => media.removeEventListener(\"change\", sync);\n }, []);\n const dark =\n props.theme === \"system\"\n ? systemDark\n : typeof props.theme === \"string\"\n ? props.theme === \"dark\"\n : localDark;\n const root = useRef<HTMLDivElement>(null);\n // A page without sidebar content gets no empty navigation rail, toggle or drawer.\n const hasSidebarSlot: unknown = ctx.slots.sidebar;\n const hasSidebar = Array.isArray(hasSidebarSlot)\n ? hasSidebarSlot.length > 0\n : Boolean(hasSidebarSlot);\n const mobile = useRef<HTMLDialogElement>(null),\n command = useRef<HTMLDialogElement>(null),\n trigger = useRef<HTMLElement | null>(null);\n const close = (dialog: HTMLDialogElement | null) => {\n dialog?.close();\n trigger.current?.focus();\n };\n const show = useCallback((dialog: HTMLDialogElement | null) => {\n trigger.current = document.activeElement as HTMLElement;\n dialog?.showModal();\n }, []);\n useEffect(() => {\n const key = (e: KeyboardEvent) => {\n if (root.current?.closest(\"[inert]\")) return;\n if (\n document.activeElement !== document.body &&\n !root.current?.contains(document.activeElement)\n )\n return;\n if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"k\") {\n e.preventDefault();\n show(command.current);\n }\n };\n document.addEventListener(\"keydown\", key);\n return () => document.removeEventListener(\"keydown\", key);\n }, [show]);\n useEffect(() => {\n const menus = () =>\n Array.from(\n root.current?.querySelectorAll<HTMLDetailsElement>(\n `.nui-user-menu[open],.nui-brand-picker[open]${layout.navigation === \"navbar\" ? \",.nui-nav-section[open]\" : \"\"}`,\n ) ?? [],\n );\n const dismissOutside = (event: PointerEvent) => {\n for (const menu of menus()) if (!menu.contains(event.target as Node)) menu.open = false;\n };\n const dismissEscape = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || root.current?.querySelector(\"dialog[open]\")) return;\n for (const menu of menus()) {\n if (!menu.contains(document.activeElement)) continue;\n event.preventDefault();\n menu.open = false;\n menu.querySelector<HTMLElement>(\"summary\")?.focus();\n }\n };\n document.addEventListener(\"pointerdown\", dismissOutside);\n document.addEventListener(\"keydown\", dismissEscape);\n return () => {\n document.removeEventListener(\"pointerdown\", dismissOutside);\n document.removeEventListener(\"keydown\", dismissEscape);\n };\n }, [layout.navigation]);\n useEffect(() => {\n if (!smallScreen) mobile.current?.close();\n }, [smallScreen]);\n const activePath = props.activePath ?? ctx.resolve?.getState?.(\"currentPath\");\n const routes = records(props.routes).filter((r) =>\n text(r.label).toLowerCase().includes(query.toLowerCase()),\n );\n return (\n <div\n ref={root}\n style={\n {\n fontFamily:\n props.font === \"System\"\n ? \"system-ui,sans-serif\"\n : props.font === \"Manrope\"\n ? \"Manrope,system-ui,sans-serif\"\n : undefined,\n ...Object.fromEntries(\n Object.entries(\n (props.tokens && typeof props.tokens === \"object\" ? props.tokens : {}) as Record<\n string,\n unknown\n >,\n )\n .filter(\n ([key, value]) =>\n [\n \"sidebar\",\n \"surface\",\n \"foreground\",\n \"accent\",\n \"accent-foreground\",\n \"primary\",\n \"primary-foreground\",\n \"border\",\n \"font\",\n ].includes(key) && typeof value === \"string\",\n )\n .map(([key, value]) => [\n key === \"primary\" || key === \"primary-foreground\" ? `--${key}` : `--nui-${key}`,\n value,\n ]),\n ),\n } as CSSProperties\n }\n data-uibot-type=\"PageLayout\"\n data-appearance=\"admin\"\n data-navigation={layout.navigation as string | undefined}\n data-container={layout.container as string | undefined}\n data-navigation-style={layout.navigationStyle as string | undefined}\n data-offcanvas={layout.offcanvas as string | undefined}\n data-sidebar={\n layout.navigation === \"navbar\" ? undefined : (layout.sidebar as string | undefined)\n }\n dir={props.direction === \"rtl\" ? \"rtl\" : \"ltr\"}\n className={`uibot-admin ${collapsed ? \"nui-rail\" : \"\"} ${dark ? \"dark\" : \"\"} ${hasSidebar ? \"\" : \"nui-no-sidebar\"}`}\n onClickCapture={(event) => {\n if (rail && (event.target as HTMLElement).closest(\".nui-sidebar summary\")) setRail(false);\n }}\n >\n <style>{shellStyle}</style>\n {hasSidebar && (\n <div\n className=\"nui-sidebar-space\"\n onPointerEnter={() => setHovered(true)}\n onPointerLeave={() => setHovered(false)}\n onFocusCapture={() => setFocused(true)}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node)) setFocused(false);\n }}\n >\n <aside className=\"nui-sidebar\">{ctx.slots.sidebar as ReactNode[]}</aside>\n </div>\n )}\n <div className=\"nui-main\">\n <header className=\"nui-header\">\n {hasSidebar && (smallScreen || layout.navigation !== \"navbar\") && (\n <button\n type=\"button\"\n className=\"nui-icon-button\"\n aria-label=\"Toggle sidebar\"\n aria-expanded={smallScreen ? mobileOpen : !collapsed}\n onClick={() => {\n if (smallScreen) {\n setMobileOpen(true);\n show(mobile.current);\n } else if (layout.sidebar === \"hover\") setHovered(!hovered);\n else setRail(!rail);\n }}\n >\n <Icon name=\"panel-left\" />\n </button>\n )}\n {props.appearance !== \"admin\" && typeof props.title === \"string\" && (\n <strong>{props.title}</strong>\n )}\n <nav className=\"nui-header-links\" aria-label=\"Workspace\">\n {records(props.headerLinks).map((link) => (\n <a\n href={text(link.href)}\n key={text(link.label)}\n aria-current={\n link.href === activePath ||\n (link.href === \"/settings/profile\" &&\n typeof activePath === \"string\" &&\n activePath.startsWith(\"/settings/\"))\n ? \"page\"\n : undefined\n }\n >\n {text(link.label)}\n </a>\n ))}\n </nav>\n <div className=\"nui-toolbar\">\n <button type=\"button\" className=\"nui-search\" onClick={() => show(command.current)}>\n <Icon name=\"search\" size={16} />\n Search<kbd>⌘ K</kbd>\n </button>\n <button\n type=\"button\"\n className=\"nui-icon-button\"\n aria-label={dark ? \"Use light theme\" : \"Use dark theme\"}\n onClick={() => {\n setDark(!dark);\n emit(\n ctx,\n \"onThemeChange\",\n { theme: dark ? \"light\" : \"dark\" },\n dark ? \"light\" : \"dark\",\n );\n }}\n >\n <Icon name={dark ? \"moon\" : \"sun\"} />\n </button>\n <details className=\"nui-user-menu\">\n <summary aria-label=\"Open account menu\">\n <span className=\"nui-avatar\">{text(props.initials, \"SN\")}</span>\n </summary>\n <nav aria-label=\"Account\">\n {records(\n props.accountLinks ?? [\n { href: \"/settings/profile\", label: \"Profile\" },\n { href: \"/settings/account\", label: \"Account\" },\n { href: \"/settings/notifications\", label: \"Notifications\" },\n { href: \"/sign-in\", label: \"Sign in\" },\n ],\n ).map((link) => (\n <a key={text(link.href)} href={text(link.href)}>\n {text(link.label)}\n </a>\n ))}\n </nav>\n </details>\n {ctx.slots.headerActions as ReactNode[]}\n </div>\n </header>\n <main className=\"nui-content\">\n <div className=\"nui-content-inner\">{ctx.children as ReactNode[]}</div>\n </main>\n {ctx.slots.footer as ReactNode[]}\n </div>\n {hasSidebar && (\n <dialog\n ref={mobile}\n className=\"nui-mobile\"\n aria-label=\"Navigation\"\n onClose={() => {\n setMobileOpen(false);\n trigger.current?.focus();\n }}\n >\n <button\n type=\"button\"\n className=\"nui-icon-button nui-mobile-close\"\n aria-label=\"Close navigation\"\n onClick={() => close(mobile.current)}\n >\n <Icon name=\"x\" />\n </button>\n <div\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"a\")) close(mobile.current);\n }}\n >\n {ctx.slots.sidebar as ReactNode[]}\n </div>\n </dialog>\n )}\n <dialog\n ref={command}\n className=\"nui-command\"\n aria-label=\"Search pages\"\n onClose={() => {\n setQuery(\"\");\n trigger.current?.focus();\n }}\n onKeyDown={(event) => {\n if (\n ![\"ArrowDown\", \"ArrowUp\", \"Home\", \"End\"].includes(event.key) ||\n event.target instanceof HTMLInputElement\n )\n return;\n const links = Array.from(\n command.current?.querySelectorAll<HTMLAnchorElement>(\"nav a\") ?? [],\n );\n if (!links.length) return;\n event.preventDefault();\n const index = links.indexOf(document.activeElement as HTMLAnchorElement);\n const next =\n event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? links.length - 1\n : (index + (event.key === \"ArrowDown\" ? 1 : -1) + links.length) % links.length;\n links[next]?.focus();\n }}\n >\n <input\n aria-label=\"Search pages\"\n autoComplete=\"off\"\n placeholder=\"Type a command or search...\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === \"ArrowDown\" || e.key === \"ArrowUp\") {\n const links = command.current?.querySelectorAll<HTMLAnchorElement>(\"nav a\");\n if (!links?.length) return;\n e.preventDefault();\n links[e.key === \"ArrowDown\" ? 0 : links.length - 1]?.focus();\n }\n }}\n />\n <nav>\n {routes.map((route) => (\n <a\n className=\"nui-nav-link\"\n href={text(route.href)}\n key={text(route.href)}\n onClick={() => close(command.current)}\n >\n <Icon name={text(route.icon, \"chevron-right\")} />\n {text(route.label)}\n </a>\n ))}\n {!routes.length && <p className=\"p-4 text-sm\">No results found.</p>}\n </nav>\n </dialog>\n </div>\n );\n}\n",
29
29
  "type": "registry:ui"
30
30
  },
31
31
  {
@@ -40,16 +40,22 @@
40
40
  "content": "import type { RendererComponent } from \"@/lib/uibot-renderer\";\nexport type BlockContext = Parameters<RendererComponent>[1];\nexport type Chain = Parameters<NonNullable<BlockContext[\"dispatch\"]>>[0];\nexport type EventValue = string | number | boolean | null;\nexport function emit(\n ctx: BlockContext,\n name: string,\n values: Record<string, EventValue | EventValue[]> = {},\n value?: EventValue,\n): void {\n const element = ctx.element as { events?: Record<string, Chain> };\n const chain = element.events?.[name];\n if (chain?.length)\n void ctx.dispatch?.(chain, {\n event: { type: name, values, ...(value !== undefined ? { value } : {}) },\n });\n}\nexport function text(value: unknown, fallback = \"\"): string {\n return value == null ? fallback : String(value);\n}\nexport function records(value: unknown): Record<string, unknown>[] {\n return Array.isArray(value)\n ? value.filter(\n (v): v is Record<string, unknown> => !!v && typeof v === \"object\" && !Array.isArray(v),\n )\n : [];\n}\n\nconst submissions = new WeakMap<object, { payload: string; key: string }>();\n/** A new owner represents a new user intent; an unchanged failed submission keeps its key. */\nexport function submissionKey(owner: object, values: unknown): string {\n const payload = JSON.stringify(values);\n const previous = submissions.get(owner);\n if (previous?.payload === payload) return previous.key;\n const key = crypto.randomUUID();\n submissions.set(owner, { payload, key });\n return key;\n}\n",
41
41
  "type": "registry:ui"
42
42
  },
43
+ {
44
+ "path": "components/uibot/layout-container.ts",
45
+ "target": "components/uibot/layout-container.ts",
46
+ "content": "/** Responsive to the content area, including when hosted beside an editor or sidebar. */\nexport const STANDARD_CONTAINER_CSS = `\n.uibot-admin[data-container=default] .nui-content,.uibot-standalone-layout[data-container=default]{container:uibot-content / inline-size}\n.uibot-admin[data-container=default] .nui-content-inner,.uibot-standalone-layout[data-container=default]>div{width:100%;max-width:1280px;margin-inline:auto}\n@container uibot-content (min-width:576px){.uibot-admin[data-container=default] .nui-content-inner,.uibot-standalone-layout[data-container=default]>div{max-width:540px}}\n@container uibot-content (min-width:768px){.uibot-admin[data-container=default] .nui-content-inner,.uibot-standalone-layout[data-container=default]>div{max-width:720px}}\n@container uibot-content (min-width:992px){.uibot-admin[data-container=default] .nui-content-inner,.uibot-standalone-layout[data-container=default]>div{max-width:960px}}\n@container uibot-content (min-width:1200px){.uibot-admin[data-container=default] .nui-content-inner,.uibot-standalone-layout[data-container=default]>div{max-width:1140px}}\n@container uibot-content (min-width:1400px){.uibot-admin[data-container=default] .nui-content-inner,.uibot-standalone-layout[data-container=default]>div{max-width:1280px}}\n`;\n",
47
+ "type": "registry:ui"
48
+ },
43
49
  {
44
50
  "path": "components/uibot/overlay.tsx",
45
51
  "target": "components/uibot/overlay.tsx",
46
- "content": "import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { emit, text, type BlockContext } from \"./interaction\";\n\nfunction useNativeDialogLifecycle(\n ref: { current: HTMLDialogElement | null },\n open: boolean,\n triggerRef?: { current: HTMLElement | null },\n) {\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog || !open) return;\n const trigger = triggerRef\n ? triggerRef.current\n : document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n dialog.showModal();\n return () => {\n if (dialog.open) dialog.close();\n if (trigger?.isConnected) trigger.focus();\n };\n }, [open, ref, triggerRef]);\n}\n\nfunction Overlay({\n props,\n ctx,\n drawer,\n}: {\n props: Record<string, unknown>;\n ctx: BlockContext;\n drawer: boolean;\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n const titleId = useId(),\n descriptionId = useId();\n const open = props.open === true;\n const close = () => emit(ctx, \"onClose\", { open: false }, false);\n useNativeDialogLifecycle(ref, open);\n if (!open) return null;\n return (\n <dialog\n ref={ref}\n aria-labelledby={titleId}\n aria-describedby={props.description ? descriptionId : undefined}\n data-uibot-type={drawer ? \"Drawer\" : \"Modal\"}\n className={`uibot-overlay bg-background text-foreground p-0 shadow-xl backdrop:bg-black/50 ${drawer ? \"fixed inset-y-0 start-auto end-0 m-0 h-dvh max-h-dvh w-full max-w-md border-s\" : \"m-auto w-[calc(100%-2rem)] max-w-lg rounded-xl border\"}`}\n onCancel={(e) => {\n e.preventDefault();\n if (props.pending !== true) close();\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && props.pending !== true) {\n const r = e.currentTarget.getBoundingClientRect();\n if (\n e.clientX < r.left ||\n e.clientX > r.right ||\n e.clientY < r.top ||\n e.clientY > r.bottom\n )\n close();\n }\n }}\n >\n <div className=\"flex h-full max-h-dvh flex-col\">\n <header className=\"flex items-start justify-between gap-4 border-b p-6\">\n <div>\n <h2 id={titleId} className=\"text-lg font-semibold\">\n {text(props.title, drawer ? \"Edit record\" : \"Confirm\")}\n </h2>\n {Boolean(props.description) && (\n <p id={descriptionId} className=\"mt-1 text-sm text-muted-foreground\">\n {text(props.description)}\n </p>\n )}\n </div>\n <button\n type=\"button\"\n disabled={props.pending === true}\n className=\"rounded px-2 py-1 text-sm hover:bg-muted focus-visible:ring-2\"\n aria-label=\"Close dialog\"\n onClick={close}\n >\n Close\n </button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-auto p-6\">{ctx.children as ReactNode[]}</div>\n {ctx.slots.footer && (\n <footer className=\"flex justify-end gap-2 border-t p-6\">\n {ctx.slots.footer as ReactNode[]}\n </footer>\n )}\n </div>\n </dialog>\n );\n}\nexport const LiveDrawer: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer />\n);\nexport const LiveModal: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} />\n);\n\n/** Internal mobile navigation drawer shared by renderer blocks, not a Spec component. */\nexport function SidebarDrawer({\n id,\n open,\n onClose,\n triggerRef,\n children,\n}: {\n id: string;\n open: boolean;\n onClose: () => void;\n triggerRef: { current: HTMLButtonElement | null };\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n useNativeDialogLifecycle(ref, open, triggerRef);\n\n if (!open) return null;\n return (\n <dialog\n id={id}\n ref={ref}\n aria-label=\"Navigation\"\n className=\"fixed inset-y-0 start-0 z-50 m-0 h-dvh max-h-dvh w-72 max-w-[85vw] border-r bg-background p-0 text-foreground shadow-xl backdrop:bg-black/50\"\n onCancel={(event) => {\n event.preventDefault();\n onClose();\n }}\n onClick={(event) => {\n if (event.target === event.currentTarget) {\n const bounds = event.currentTarget.getBoundingClientRect();\n if (\n event.clientX < bounds.left ||\n event.clientX > bounds.right ||\n event.clientY < bounds.top ||\n event.clientY > bounds.bottom\n )\n onClose();\n }\n if (event.target instanceof Element && event.target.closest(\"a\")) onClose();\n }}\n >\n <button\n type=\"button\"\n className=\"m-3 rounded border px-3 py-2 text-sm focus-visible:ring-2\"\n aria-label=\"Close navigation\"\n onClick={onClose}\n >\n Close\n </button>\n <div className=\"max-h-[calc(100dvh-4rem)] overflow-y-auto\">{children}</div>\n </dialog>\n );\n}\n",
52
+ "content": "import { useEffect, useId, useRef, type ReactNode } from \"react\";\nimport type { RendererComponent } from \"@/lib/uibot-renderer\";\nimport { emit, text, type BlockContext } from \"./interaction\";\n\nfunction useNativeDialogLifecycle(\n ref: { current: HTMLDialogElement | null },\n open: boolean,\n triggerRef?: { current: HTMLElement | null },\n) {\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog || !open) return;\n const trigger = triggerRef\n ? triggerRef.current\n : document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n dialog.showModal();\n return () => {\n if (dialog.open) dialog.close();\n if (trigger?.isConnected) trigger.focus();\n };\n }, [open, ref, triggerRef]);\n}\n\nfunction Overlay({\n props,\n ctx,\n drawer,\n blockType,\n}: {\n props: Record<string, unknown>;\n ctx: BlockContext;\n drawer: boolean;\n blockType?: \"Dialog\";\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n const titleId = useId(),\n descriptionId = useId();\n const open = props.open === true;\n const close = () => emit(ctx, \"onClose\", { open: false }, false);\n useNativeDialogLifecycle(ref, open);\n if (!open) return null;\n return (\n <dialog\n ref={ref}\n aria-labelledby={titleId}\n aria-describedby={props.description ? descriptionId : undefined}\n aria-busy={props.pending === true || undefined}\n data-uibot-type={blockType ?? (drawer ? \"Drawer\" : \"Modal\")}\n className={`uibot-overlay bg-background text-foreground p-0 shadow-xl backdrop:bg-black/50 ${drawer ? \"fixed inset-y-0 start-auto end-0 m-0 h-dvh max-h-dvh w-full max-w-md border-s\" : \"m-auto w-[calc(100%-2rem)] max-w-lg rounded-xl border\"}`}\n onCancel={(e) => {\n e.preventDefault();\n if (props.pending !== true) close();\n }}\n onClick={(e) => {\n if (e.target === e.currentTarget && props.pending !== true) {\n const r = e.currentTarget.getBoundingClientRect();\n if (\n e.clientX < r.left ||\n e.clientX > r.right ||\n e.clientY < r.top ||\n e.clientY > r.bottom\n )\n close();\n }\n }}\n >\n <div className=\"flex h-full max-h-dvh flex-col\">\n <header className=\"flex items-start justify-between gap-4 border-b p-6\">\n <div>\n <h2 id={titleId} className=\"text-lg font-semibold\">\n {text(props.title, drawer ? \"Edit record\" : \"Confirm\")}\n </h2>\n {Boolean(props.description) && (\n <p id={descriptionId} className=\"mt-1 text-sm text-muted-foreground\">\n {text(props.description)}\n </p>\n )}\n </div>\n <button\n type=\"button\"\n disabled={props.pending === true}\n className=\"rounded px-2 py-1 text-sm hover:bg-muted focus-visible:ring-2\"\n aria-label=\"Close dialog\"\n onClick={close}\n >\n Close\n </button>\n </header>\n <div className=\"min-h-0 flex-1 overflow-auto p-6\">{ctx.children as ReactNode[]}</div>\n {ctx.slots.footer && (\n <footer className=\"flex justify-end gap-2 border-t p-6\">\n {ctx.slots.footer as ReactNode[]}\n </footer>\n )}\n </div>\n </dialog>\n );\n}\nexport const LiveDrawer: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer />\n);\nexport const LiveModal: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} />\n);\nexport const LiveConfirmationDialog: RendererComponent = (props, ctx) => (\n <Overlay props={props} ctx={ctx} drawer={false} blockType=\"Dialog\" />\n);\n\n/** Internal mobile navigation drawer shared by renderer blocks, not a Spec component. */\nexport function SidebarDrawer({\n id,\n open,\n onClose,\n triggerRef,\n children,\n}: {\n id: string;\n open: boolean;\n onClose: () => void;\n triggerRef: { current: HTMLButtonElement | null };\n children: ReactNode;\n}) {\n const ref = useRef<HTMLDialogElement>(null);\n useNativeDialogLifecycle(ref, open, triggerRef);\n\n if (!open) return null;\n return (\n <dialog\n id={id}\n ref={ref}\n aria-label=\"Navigation\"\n className=\"fixed inset-y-0 start-0 z-50 m-0 h-dvh max-h-dvh w-72 max-w-[85vw] border-r bg-background p-0 text-foreground shadow-xl backdrop:bg-black/50\"\n onCancel={(event) => {\n event.preventDefault();\n onClose();\n }}\n onClick={(event) => {\n if (event.target === event.currentTarget) {\n const bounds = event.currentTarget.getBoundingClientRect();\n if (\n event.clientX < bounds.left ||\n event.clientX > bounds.right ||\n event.clientY < bounds.top ||\n event.clientY > bounds.bottom\n )\n onClose();\n }\n if (event.target instanceof Element && event.target.closest(\"a\")) onClose();\n }}\n >\n <button\n type=\"button\"\n className=\"m-3 rounded border px-3 py-2 text-sm focus-visible:ring-2\"\n aria-label=\"Close navigation\"\n onClick={onClose}\n >\n Close\n </button>\n <div className=\"max-h-[calc(100dvh-4rem)] overflow-y-auto\">{children}</div>\n </dialog>\n );\n}\n",
47
53
  "type": "registry:ui"
48
54
  },
49
55
  {
50
56
  "path": "components/uibot/layout.uibot.json",
51
57
  "target": "components/uibot/layout.uibot.json",
52
- "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"layout\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"Box\",\n \"export\": \"Box\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Box\",\n \"description\": \"Flex container for composing layout. Use as a row or column spacer between other blocks.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"container\",\n \"layout\"\n ],\n \"props\": {\n \"direction\": {\n \"type\": \"string\",\n \"enum\": [\n \"col\",\n \"row\"\n ],\n \"default\": \"col\",\n \"description\": \"Flex direction\"\n },\n \"gap\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"xs\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\"\n ],\n \"default\": \"md\"\n },\n \"padding\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"xs\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\"\n ]\n },\n \"align\": {\n \"type\": \"string\",\n \"enum\": [\n \"start\",\n \"center\",\n \"end\",\n \"stretch\"\n ]\n },\n \"justify\": {\n \"type\": \"string\",\n \"enum\": [\n \"start\",\n \"center\",\n \"end\",\n \"between\",\n \"around\"\n ]\n },\n \"wrap\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"full\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"usageScenarios\": [\n \"Horizontal row of action buttons\",\n \"Vertical stack of form fields\",\n \"Two-column grid using two Box[direction=row] with flex-1 children\"\n ],\n \"constraints\": [\n \"Do not use Box as a semantic section; prefer Card or PageLayout for major layout regions\"\n ]\n }\n },\n {\n \"name\": \"Card\",\n \"export\": \"Card\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Card\",\n \"description\": \"Surface container with rounded border and optional header (title + description + actions slot).\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"card\",\n \"surface\"\n ],\n \"props\": {\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Card heading\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"Supporting subtitle text\"\n }\n },\n \"slots\": {\n \"actions\": {\n \"description\": \"Action buttons rendered in the top-right of the card header\"\n },\n \"default\": {\n \"description\": \"Card body content\"\n }\n },\n \"usageScenarios\": [\n \"Stats overview section\",\n \"User profile panel\",\n \"Settings form container\"\n ],\n \"constraints\": [\n \"Avoid nesting Card directly inside another Card\"\n ]\n }\n },\n {\n \"name\": \"Divider\",\n \"export\": \"Divider\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Divider\",\n \"description\": \"Thin horizontal (default) or vertical separator line.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"separator\"\n ],\n \"props\": {\n \"orientation\": {\n \"type\": \"string\",\n \"enum\": [\n \"horizontal\",\n \"vertical\"\n ],\n \"default\": \"horizontal\"\n }\n },\n \"usageScenarios\": [\n \"Visual break between form sections\",\n \"Vertical separator between two columns\"\n ],\n \"constraints\": []\n }\n },\n {\n \"name\": \"Drawer\",\n \"export\": \"Drawer\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Drawer\",\n \"description\": \"Off-canvas side panel for secondary context (filters, details, comments). Rendered inline in preview.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"drawer\",\n \"overlay\"\n ],\n \"events\": {\n \"onClose\": {\n \"description\": \"Close requested; set controlled open false\"\n }\n },\n \"props\": {\n \"open\": {\n \"type\": \"boolean\"\n },\n \"pending\": {\n \"type\": \"boolean\"\n },\n \"title\": {\n \"type\": \"string\"\n }\n },\n \"usageScenarios\": [\n \"Filter panel for a table\",\n \"Item detail side sheet\"\n ],\n \"constraints\": [\n \"Drawer is always visible in static preview — use conditionally in production via state\"\n ]\n }\n },\n {\n \"name\": \"Modal\",\n \"export\": \"Modal\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Modal\",\n \"description\": \"Centered overlay dialog for focused tasks or confirmations. Rendered inline in preview.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"modal\",\n \"overlay\"\n ],\n \"events\": {\n \"onClose\": {\n \"description\": \"Close requested; set controlled open false\"\n }\n },\n \"props\": {\n \"open\": {\n \"type\": \"boolean\"\n },\n \"pending\": {\n \"type\": \"boolean\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n }\n },\n \"usageScenarios\": [\n \"Create / edit form dialog\",\n \"Image preview lightbox\"\n ],\n \"constraints\": [\n \"Modal is always visible in static preview — drive open/close state from actions in production\"\n ]\n }\n },\n {\n \"name\": \"PageLayout\",\n \"export\": \"PageLayout\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"PageLayout\",\n \"description\": \"Top-level page scaffold: sticky header, optional sidebar, scrollable main area, optional footer.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"page\",\n \"layout\"\n ],\n \"props\": {\n \"appearance\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"admin\"\n ]\n },\n \"routes\": {\n \"type\": \"array\"\n },\n \"headerLinks\": {\n \"type\": \"array\"\n },\n \"accountLinks\": {\n \"type\": \"array\"\n },\n \"tokens\": {\n \"type\": \"object\",\n \"description\": \"Admin frame sidebar/surface/foreground/accent/accent-foreground/border/font and primary/primary-foreground CSS tokens\"\n },\n \"theme\": {\n \"type\": \"string\"\n },\n \"font\": {\n \"type\": \"string\"\n },\n \"direction\": {\n \"type\": \"string\"\n },\n \"initials\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"App or page title shown in the sticky header\"\n },\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"sidebar\",\n \"inset\",\n \"floating\"\n ],\n \"default\": \"sidebar\",\n \"description\": \"Frame: flush sidebar, inset main, or floating sidebar card\"\n },\n \"collapsible\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"icon\",\n \"offcanvas\"\n ],\n \"default\": \"none\",\n \"description\": \"How the sidebar collapses; default none keeps v2.40 width\"\n }\n },\n \"events\": {\n \"onThemeChange\": {\n \"description\": \"Selected theme in event.value\"\n }\n },\n \"slots\": {\n \"headerActions\": {\n \"description\": \"Buttons or links placed in the top-right of the header\"\n },\n \"sidebar\": {\n \"description\": \"Left sidebar content, e.g. PageSiderMenu\"\n },\n \"footer\": {\n \"description\": \"Bottom footer strip\"\n }\n },\n \"usageScenarios\": [\n \"Admin dashboard shell\",\n \"Settings page with left navigation\",\n \"Landing page with header and main content\"\n ],\n \"constraints\": [\n \"Use at most one PageLayout per page\",\n \"Do not nest PageLayout inside another PageLayout\"\n ]\n }\n },\n {\n \"name\": \"Tabs\",\n \"export\": \"Tabs\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Tabs\",\n \"description\": \"Tab switcher. Each child maps to the tab at the same index. Supports up to 6 tabs.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"tabs\",\n \"navigation\"\n ],\n \"props\": {\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"underline\",\n \"segmented\"\n ]\n },\n \"disabledTabs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"integer\"\n }\n },\n \"value\": {\n \"type\": \"integer\"\n },\n \"tabs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Tab label list, e.g. [Overview, Details, Activity]\"\n },\n \"defaultTab\": {\n \"type\": \"integer\",\n \"default\": 0,\n \"description\": \"0-based index of the initially active tab\"\n }\n },\n \"usageScenarios\": [\n \"Split view of Overview / Settings / Logs\",\n \"Mobile-friendly section switcher\"\n ],\n \"constraints\": [\n \"Children count must equal tabs array length\",\n \"Do not use more than 6 tabs\"\n ]\n }\n }\n ]\n}\n",
58
+ "content": "{\n \"schema\": \"uibot.registry.item.v1\",\n \"item\": \"layout\",\n \"channel\": \"public\",\n \"components\": [\n {\n \"name\": \"Box\",\n \"export\": \"Box\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Box\",\n \"description\": \"Flex container for composing layout. Use as a row or column spacer between other blocks.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"container\",\n \"layout\"\n ],\n \"props\": {\n \"className\": {\n \"type\": \"string\",\n \"description\": \"Additional Tailwind utility classes\"\n },\n \"direction\": {\n \"type\": \"string\",\n \"enum\": [\n \"col\",\n \"row\"\n ],\n \"default\": \"col\",\n \"description\": \"Flex direction\"\n },\n \"gap\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"xs\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\"\n ],\n \"default\": \"md\"\n },\n \"padding\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"xs\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\"\n ]\n },\n \"align\": {\n \"type\": \"string\",\n \"enum\": [\n \"start\",\n \"center\",\n \"end\",\n \"stretch\"\n ]\n },\n \"justify\": {\n \"type\": \"string\",\n \"enum\": [\n \"start\",\n \"center\",\n \"end\",\n \"between\",\n \"around\"\n ]\n },\n \"wrap\": {\n \"type\": \"boolean\",\n \"default\": false\n },\n \"full\": {\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"usageScenarios\": [\n \"Horizontal row of action buttons\",\n \"Vertical stack of form fields\",\n \"Two-column grid using two Box[direction=row] with flex-1 children\"\n ],\n \"constraints\": [\n \"Do not use Box as a semantic section; prefer Card or PageLayout for major layout regions\"\n ]\n }\n },\n {\n \"name\": \"Card\",\n \"export\": \"Card\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Card\",\n \"description\": \"Surface container with rounded border and optional header (title + description + actions slot).\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"card\",\n \"surface\"\n ],\n \"props\": {\n \"className\": {\n \"type\": \"string\",\n \"description\": \"Additional Tailwind utility classes\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Card heading\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"Supporting subtitle text\"\n }\n },\n \"slots\": {\n \"actions\": {\n \"description\": \"Action buttons rendered in the top-right of the card header\"\n },\n \"default\": {\n \"description\": \"Card body content\"\n }\n },\n \"usageScenarios\": [\n \"Stats overview section\",\n \"User profile panel\",\n \"Settings form container\"\n ],\n \"constraints\": [\n \"Avoid nesting Card directly inside another Card\"\n ]\n }\n },\n {\n \"name\": \"Divider\",\n \"export\": \"Divider\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Divider\",\n \"description\": \"Thin horizontal (default) or vertical separator line.\",\n \"category\": \"primitive\",\n \"level\": \"L1\",\n \"tags\": [\n \"separator\"\n ],\n \"props\": {\n \"orientation\": {\n \"type\": \"string\",\n \"enum\": [\n \"horizontal\",\n \"vertical\"\n ],\n \"default\": \"horizontal\"\n }\n },\n \"usageScenarios\": [\n \"Visual break between form sections\",\n \"Vertical separator between two columns\"\n ],\n \"constraints\": []\n }\n },\n {\n \"name\": \"Drawer\",\n \"export\": \"Drawer\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Drawer\",\n \"description\": \"Off-canvas side panel for secondary context (filters, details, comments). Rendered inline in preview.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"drawer\",\n \"overlay\"\n ],\n \"events\": {\n \"onClose\": {\n \"description\": \"Close requested; set controlled open false\"\n }\n },\n \"props\": {\n \"description\": {\n \"type\": \"string\"\n },\n \"open\": {\n \"type\": \"boolean\"\n },\n \"pending\": {\n \"type\": \"boolean\"\n },\n \"title\": {\n \"type\": \"string\"\n }\n },\n \"usageScenarios\": [\n \"Filter panel for a table\",\n \"Item detail side sheet\"\n ],\n \"constraints\": [\n \"Drawer is always visible in static preview — use conditionally in production via state\"\n ]\n }\n },\n {\n \"name\": \"Modal\",\n \"export\": \"Modal\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Modal\",\n \"description\": \"Centered overlay dialog for focused tasks or confirmations. Rendered inline in preview.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"modal\",\n \"overlay\"\n ],\n \"events\": {\n \"onClose\": {\n \"description\": \"Close requested; set controlled open false\"\n }\n },\n \"props\": {\n \"open\": {\n \"type\": \"boolean\"\n },\n \"pending\": {\n \"type\": \"boolean\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n }\n },\n \"usageScenarios\": [\n \"Create / edit form dialog\",\n \"Image preview lightbox\"\n ],\n \"constraints\": [\n \"Modal is always visible in static preview — drive open/close state from actions in production\"\n ]\n }\n },\n {\n \"name\": \"PageLayout\",\n \"export\": \"PageLayout\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"PageLayout\",\n \"description\": \"Application scaffold with header, navigation, scrollable content and footer.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"page\",\n \"layout\"\n ],\n \"props\": {\n \"appearance\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"admin\",\n \"standalone\"\n ]\n },\n \"layout\": {\n \"type\": \"object\",\n \"properties\": {\n \"navigation\": {\n \"type\": \"string\",\n \"enum\": [\n \"sidebar\",\n \"navbar\"\n ]\n },\n \"container\": {\n \"type\": \"string\",\n \"enum\": [\n \"default\",\n \"fluid\",\n \"boxed\"\n ]\n },\n \"navigationStyle\": {\n \"type\": \"string\",\n \"enum\": [\n \"attached\",\n \"floating\"\n ]\n },\n \"offcanvas\": {\n \"type\": \"string\",\n \"enum\": [\n \"attached\",\n \"floating\"\n ]\n },\n \"sidebar\": {\n \"type\": \"string\",\n \"enum\": [\n \"expanded\",\n \"folded\",\n \"hover\"\n ]\n }\n }\n },\n \"routes\": {\n \"type\": \"array\"\n },\n \"headerLinks\": {\n \"type\": \"array\"\n },\n \"accountLinks\": {\n \"type\": \"array\"\n },\n \"tokens\": {\n \"type\": \"object\",\n \"description\": \"Local CSS tokens.\"\n },\n \"theme\": {\n \"type\": \"string\"\n },\n \"font\": {\n \"type\": \"string\"\n },\n \"direction\": {\n \"type\": \"string\"\n },\n \"initials\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\",\n \"description\": \"Header title.\"\n },\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"sidebar\",\n \"inset\",\n \"floating\"\n ],\n \"default\": \"sidebar\"\n },\n \"collapsible\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"icon\",\n \"offcanvas\"\n ],\n \"default\": \"none\"\n }\n },\n \"events\": {\n \"onThemeChange\": {\n \"description\": \"Selected theme: event.value.\"\n }\n },\n \"slots\": {\n \"headerActions\": {\n \"description\": \"Header action controls.\"\n },\n \"sidebar\": {\n \"description\": \"Navigation content.\"\n },\n \"footer\": {\n \"description\": \"Footer content.\"\n }\n },\n \"usageScenarios\": [\n \"Admin dashboard shell\",\n \"Settings page with left navigation\",\n \"Landing page with header and main content\"\n ],\n \"constraints\": [\n \"Use at most one PageLayout per page\",\n \"Do not nest PageLayout inside another PageLayout\"\n ]\n }\n },\n {\n \"name\": \"Tabs\",\n \"export\": \"Tabs\",\n \"module\": \"layout.tsx\",\n \"catalog\": {\n \"name\": \"Tabs\",\n \"description\": \"Tab switcher. Each child maps to the tab at the same index. Supports up to 6 tabs.\",\n \"category\": \"composite\",\n \"level\": \"L2\",\n \"tags\": [\n \"tabs\",\n \"navigation\"\n ],\n \"props\": {\n \"variant\": {\n \"type\": \"string\",\n \"enum\": [\n \"underline\",\n \"segmented\"\n ]\n },\n \"disabledTabs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"integer\"\n }\n },\n \"value\": {\n \"type\": \"integer\"\n },\n \"tabs\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Tab label list, e.g. [Overview, Details, Activity]\"\n },\n \"defaultTab\": {\n \"type\": \"integer\",\n \"default\": 0,\n \"description\": \"0-based index of the initially active tab\"\n }\n },\n \"usageScenarios\": [\n \"Split view of Overview / Settings / Logs\",\n \"Mobile-friendly section switcher\"\n ],\n \"constraints\": [\n \"Children count must equal tabs array length\",\n \"Do not use more than 6 tabs\"\n ]\n }\n }\n ]\n}\n",
53
59
  "type": "registry:ui"
54
60
  }
55
61
  ],
@@ -57,6 +63,10 @@
57
63
  "category": "primitive",
58
64
  "level": "L1",
59
65
  "props": {
66
+ "className": {
67
+ "type": "string",
68
+ "description": "Additional Tailwind utility classes"
69
+ },
60
70
  "direction": {
61
71
  "type": "string",
62
72
  "enum": [
@@ -153,6 +163,10 @@
153
163
  "layout"
154
164
  ],
155
165
  "props": {
166
+ "className": {
167
+ "type": "string",
168
+ "description": "Additional Tailwind utility classes"
169
+ },
156
170
  "direction": {
157
171
  "type": "string",
158
172
  "enum": [
@@ -237,6 +251,10 @@
237
251
  "surface"
238
252
  ],
239
253
  "props": {
254
+ "className": {
255
+ "type": "string",
256
+ "description": "Additional Tailwind utility classes"
257
+ },
240
258
  "title": {
241
259
  "type": "string",
242
260
  "description": "Card heading"
@@ -312,6 +330,9 @@
312
330
  }
313
331
  },
314
332
  "props": {
333
+ "description": {
334
+ "type": "string"
335
+ },
315
336
  "open": {
316
337
  "type": "boolean"
317
338
  },
@@ -378,7 +399,7 @@
378
399
  "module": "layout.tsx",
379
400
  "catalog": {
380
401
  "name": "PageLayout",
381
- "description": "Top-level page scaffold: sticky header, optional sidebar, scrollable main area, optional footer.",
402
+ "description": "Application scaffold with header, navigation, scrollable content and footer.",
382
403
  "category": "composite",
383
404
  "level": "L2",
384
405
  "tags": [
@@ -390,9 +411,52 @@
390
411
  "type": "string",
391
412
  "enum": [
392
413
  "default",
393
- "admin"
414
+ "admin",
415
+ "standalone"
394
416
  ]
395
417
  },
418
+ "layout": {
419
+ "type": "object",
420
+ "properties": {
421
+ "navigation": {
422
+ "type": "string",
423
+ "enum": [
424
+ "sidebar",
425
+ "navbar"
426
+ ]
427
+ },
428
+ "container": {
429
+ "type": "string",
430
+ "enum": [
431
+ "default",
432
+ "fluid",
433
+ "boxed"
434
+ ]
435
+ },
436
+ "navigationStyle": {
437
+ "type": "string",
438
+ "enum": [
439
+ "attached",
440
+ "floating"
441
+ ]
442
+ },
443
+ "offcanvas": {
444
+ "type": "string",
445
+ "enum": [
446
+ "attached",
447
+ "floating"
448
+ ]
449
+ },
450
+ "sidebar": {
451
+ "type": "string",
452
+ "enum": [
453
+ "expanded",
454
+ "folded",
455
+ "hover"
456
+ ]
457
+ }
458
+ }
459
+ },
396
460
  "routes": {
397
461
  "type": "array"
398
462
  },
@@ -404,7 +468,7 @@
404
468
  },
405
469
  "tokens": {
406
470
  "type": "object",
407
- "description": "Admin frame sidebar/surface/foreground/accent/accent-foreground/border/font and primary/primary-foreground CSS tokens"
471
+ "description": "Local CSS tokens."
408
472
  },
409
473
  "theme": {
410
474
  "type": "string"
@@ -420,7 +484,7 @@
420
484
  },
421
485
  "title": {
422
486
  "type": "string",
423
- "description": "App or page title shown in the sticky header"
487
+ "description": "Header title."
424
488
  },
425
489
  "variant": {
426
490
  "type": "string",
@@ -429,8 +493,7 @@
429
493
  "inset",
430
494
  "floating"
431
495
  ],
432
- "default": "sidebar",
433
- "description": "Frame: flush sidebar, inset main, or floating sidebar card"
496
+ "default": "sidebar"
434
497
  },
435
498
  "collapsible": {
436
499
  "type": "string",
@@ -439,24 +502,23 @@
439
502
  "icon",
440
503
  "offcanvas"
441
504
  ],
442
- "default": "none",
443
- "description": "How the sidebar collapses; default none keeps v2.40 width"
505
+ "default": "none"
444
506
  }
445
507
  },
446
508
  "events": {
447
509
  "onThemeChange": {
448
- "description": "Selected theme in event.value"
510
+ "description": "Selected theme: event.value."
449
511
  }
450
512
  },
451
513
  "slots": {
452
514
  "headerActions": {
453
- "description": "Buttons or links placed in the top-right of the header"
515
+ "description": "Header action controls."
454
516
  },
455
517
  "sidebar": {
456
- "description": "Left sidebar content, e.g. PageSiderMenu"
518
+ "description": "Navigation content."
457
519
  },
458
520
  "footer": {
459
- "description": "Bottom footer strip"
521
+ "description": "Footer content."
460
522
  }
461
523
  },
462
524
  "usageScenarios": [
@@ -11,7 +11,7 @@
11
11
  {
12
12
  "path": "lib/uibot/templates/shadcn-admin-shell.uibot.yaml",
13
13
  "target": "lib/uibot/templates/shadcn-admin-shell.uibot.yaml",
14
- "content": "version: \"2.0\"\npages:\n - id: shadcn-admin-shell\n path: /\n blocks:\n - type: PageLayout\n props:\n appearance: admin\n routes:\n - label: Dashboard\n href: /\n icon: layout-dashboard\n - label: Tasks\n href: /tasks\n icon: list-todo\n - label: Apps\n href: /apps\n icon: boxes\n - label: Chats\n href: /chats\n icon: message-circle\n badge: \"3\"\n - label: Users\n href: /users\n icon: users\n - label: Auth\n href: /sign-in\n icon: shield\n - label: Errors\n href: /errors/500\n icon: circle-help\n - label: Settings\n href: /settings/profile\n icon: settings\n - label: Help Center\n href: /help-center\n icon: circle-help\n - label: Account\n href: /settings/account\n - label: Appearance\n href: /settings/appearance\n - label: Notifications\n href: /settings/notifications\n - label: Display\n href: /settings/display\n headerLinks:\n - label: Overview\n href: /\n - label: Customers\n href: /users\n - label: Products\n href: /apps\n - label: Settings\n href: /settings/profile\n font:\n _state: font\n theme:\n _state: theme\n direction:\n _state: direction\n slots:\n sidebar:\n - type: AppNavigation\n props:\n brand: Shadcn Admin\n subtitle: Vite + ShadcnUI\n groups:\n - label: General\n items:\n - label: Dashboard\n href: /\n icon: layout-dashboard\n - label: Tasks\n href: /tasks\n icon: list-todo\n - label: Apps\n href: /apps\n icon: boxes\n - label: Chats\n href: /chats\n icon: message-circle\n badge: \"3\"\n - label: Users\n href: /users\n icon: users\n - label: Pages\n items:\n - label: Auth\n href: /sign-in\n icon: shield\n children:\n - label: Sign in\n href: /sign-in\n - label: Sign in (split)\n href: /sign-in-2\n - label: Sign up\n href: /sign-up\n - label: Forgot password\n href: /forgot-password\n - label: OTP\n href: /otp\n - label: Errors\n href: /errors/500\n icon: circle-help\n children:\n - label: \"401\"\n href: /errors/401\n - label: \"403\"\n href: /errors/403\n - label: \"404\"\n href: /errors/404\n - label: \"500\"\n href: /errors/500\n - label: \"503\"\n href: /errors/503\n - label: Other\n items:\n - label: Settings\n href: /settings/profile\n icon: settings\n children:\n - label: Profile\n href: /settings/profile\n - label: Account\n href: /settings/account\n - label: Appearance\n href: /settings/appearance\n - label: Notifications\n href: /settings/notifications\n - label: Display\n href: /settings/display\n - label: Help Center\n href: /help-center\n icon: circle-help\n activePath:\n _state: currentPath\n userName: satnaing\n email: satnaingdev@gmail.com\n initials: SN\n workspaces:\n - label: Personal workspace\n href: /\n - label: Team workspace\n href: /users\n events:\n onThemeChange:\n - action: SetState\n params:\n path: theme\n value:\n _event: value\n",
14
+ "content": "version: \"2.0\"\npages:\n - id: shadcn-admin-shell\n state:\n currentPath: \"/\"\n direction: \"ltr\"\n font: \"Inter\"\n theme: \"light\"\n path: /\n blocks:\n - type: PageLayout\n props:\n appearance: admin\n routes:\n - label: Dashboard\n href: /\n icon: layout-dashboard\n - label: Tasks\n href: /tasks\n icon: list-todo\n - label: Apps\n href: /apps\n icon: boxes\n - label: Chats\n href: /chats\n icon: message-circle\n badge: \"3\"\n - label: Users\n href: /users\n icon: users\n - label: Auth\n href: /sign-in\n icon: shield\n - label: Errors\n href: /errors/500\n icon: circle-help\n - label: Settings\n href: /settings/profile\n icon: settings\n - label: Help Center\n href: /help-center\n icon: circle-help\n - label: Account\n href: /settings/account\n - label: Appearance\n href: /settings/appearance\n - label: Notifications\n href: /settings/notifications\n - label: Display\n href: /settings/display\n headerLinks:\n - label: Overview\n href: /\n - label: Customers\n href: /users\n - label: Products\n href: /apps\n - label: Settings\n href: /settings/profile\n font:\n _state: font\n theme:\n _state: theme\n direction:\n _state: direction\n slots:\n sidebar:\n - type: AppNavigation\n props:\n brand: UiBot Admin\n subtitle: Vite + ShadcnUI\n groups:\n - label: General\n items:\n - label: Dashboard\n href: /\n icon: layout-dashboard\n - label: Tasks\n href: /tasks\n icon: list-todo\n - label: Apps\n href: /apps\n icon: boxes\n - label: Chats\n href: /chats\n icon: message-circle\n badge: \"3\"\n - label: Users\n href: /users\n icon: users\n - label: Pages\n items:\n - label: Auth\n href: /sign-in\n icon: shield\n children:\n - label: Sign in\n href: /sign-in\n - label: Sign in (split)\n href: /sign-in-2\n - label: Sign up\n href: /sign-up\n - label: Forgot password\n href: /forgot-password\n - label: OTP\n href: /otp\n - label: Errors\n href: /errors/500\n icon: circle-help\n children:\n - label: \"401\"\n href: /errors/401\n - label: \"403\"\n href: /errors/403\n - label: \"404\"\n href: /errors/404\n - label: \"500\"\n href: /errors/500\n - label: \"503\"\n href: /errors/503\n - label: Other\n items:\n - label: Settings\n href: /settings/profile\n icon: settings\n children:\n - label: Profile\n href: /settings/profile\n - label: Account\n href: /settings/account\n - label: Appearance\n href: /settings/appearance\n - label: Notifications\n href: /settings/notifications\n - label: Display\n href: /settings/display\n - label: Help Center\n href: /help-center\n icon: circle-help\n activePath:\n _state: currentPath\n userName: satnaing\n email: satnaingdev@gmail.com\n initials: SN\n workspaces:\n - label: Personal workspace\n href: /\n - label: Team workspace\n href: /users\n events:\n onThemeChange:\n - action: SetState\n params:\n path: theme\n value:\n _event: value\n",
15
15
  "type": "registry:lib"
16
16
  },
17
17
  {