{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-shell",
  "type": "registry:item",
  "title": "Dashboard Shell",
  "description": "An app's frame: a sidebar of sections, a top bar with the page title and a user menu, and the page in the middle. In a narrow space it folds the sidebar behind a Menu button, measuring itself rather than the screen.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "block"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json",
    "https://zubra-js.github.io/zubra-ui/r/dropdown-menu.json"
  ],
  "files": [
    {
      "path": "components/dashboard-shell.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/dashboard-shell.js",
      "content": "// Generated by zubra from dashboard-shell.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { emit, hasSlot, id } from '@zubra/runtime';\nimport \"./dropdown-menu.js\";\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"dashboard-shell\";\n\nexport default $define(tag, {\n  props: {\n    \"product\": { attribute: \"product\", default: \"\", required: false },\n    \"heading\": { attribute: \"heading\", default: \"\", required: false },\n    \"nav\": { attribute: \"nav\", default: [], required: false },\n    \"current\": { attribute: \"current\", default: \"\", required: false, model: true },\n    \"menu\": { attribute: \"menu\", default: [], required: false },\n    \"user\": { attribute: \"user\", default: \"Account\", required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [\"actions\", \"default\"],\n  events: [\"currentchange\", \"menuselect\"],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (dashboard-shell) to ([data-zb-slotted=\\\"dashboard-shell\\\"]) {\\n  :scope { display: block; container-type: inline-size; }\\n  .shell { display: grid; grid-template: \\\"nav main\\\" 1fr / 14rem 1fr; height: var(--shell-height, 32rem); border: 1px solid var(--border, #e4e4e7); border-radius: calc(var(--radius, 0.625rem) + 4px); overflow: hidden; background: var(--background, #fff); color: var(--foreground, #09090b); }\\n  nav { grid-area: nav; display: flex; flex-direction: column; gap: 0.25rem; min-height: 0; padding: 1rem 0.75rem; overflow-y: auto; border-right: 1px solid var(--border, #e4e4e7); background: var(--muted, #f4f4f5); }\\n  .shell-brand { margin: 0 0 0.75rem; padding: 0 0.5rem; font-weight: 750; font-size: 1.05rem; }\\n  nav ul { display: grid; gap: 0.15rem; margin: 0; padding: 0; list-style: none; }\\n  nav a, nav button { display: block; width: 100%; box-sizing: border-box; padding: 0.5rem 0.65rem; border: 0; border-radius: calc(var(--radius, 0.625rem) - 2px); background: none; color: inherit; font: inherit; font-size: 0.925rem; text-align: left; text-decoration: none; cursor: pointer; }\\n  nav a:hover, nav button:hover { background: color-mix(in oklab, var(--foreground, #09090b) 7%, transparent); }\\n  nav [aria-current=page] { background: var(--background, #fff); font-weight: 650; box-shadow: 0 1px 2px #0000001a; }\\n  nav :focus-visible, .shell-menu-button:focus-visible { outline: 2px solid var(--ring, #18181b); outline-offset: 1px; }\\n  .shell-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; }\\n  header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border, #e4e4e7); }\\n  h1 { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 1.15rem; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }\\n  .shell-actions { display: flex; align-items: center; gap: 0.5rem; }\\n  dropdown-menu { display: block; flex-shrink: 1; min-width: 0; max-width: 10rem; white-space: nowrap; }\\n  /* A long name shortens with an ellipsis rather than pushing the menu out of the shell. */\\n  header dropdown-menu .trigger { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }\\n  .shell-menu-button { display: none; padding: 0.4rem 0.7rem; border: 1px solid var(--border, #e4e4e7); border-radius: calc(var(--radius, 0.625rem) - 2px); background: var(--background, #fff); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }\\n  .shell-content { flex: 1; min-height: 0; padding: 1.25rem; overflow: auto; }\\n  @container (max-width: 40rem) {\\n    /* Folded: the header, the sidebar opening under it (no space while closed), then the page. */\\n    .shell { grid-template: \\\"header\\\" auto \\\"nav\\\" auto \\\"main\\\" minmax(0, 1fr) / minmax(0, 1fr); }\\n    .shell-main { display: contents; }\\n    header { grid-area: header; }\\n    .shell-content { grid-area: main; }\\n    nav { display: none; max-height: 14rem; border-right: 0; border-bottom: 1px solid var(--border, #e4e4e7); }\\n    .shell-open nav { display: flex; }\\n    .shell-menu-button { display: inline-block; }\\n    dropdown-menu { max-width: 7.5rem; }\\n  }\\n}\\n}\\n\",\n  template: \"\\n  <div class=\\\"shell\\\">\\n    <nav>\\n      <!--[--><!--]-->\\n      <ul>\\n        <!--[--><!--]-->\\n      </ul>\\n    </nav>\\n    <div class=\\\"shell-main\\\">\\n      <header>\\n        <!--[--><!--]-->\\n        <h1></h1>\\n        <!--[--><!--]-->\\n        <!--[--><!--]-->\\n      </header>\\n      <div class=\\\"shell-content\\\"><!--[--><!--]--></div>\\n    </div>\\n  </div>\\n\",\n  setup($p, $emit) {\n    const emit = $emit;\nfunction __zubraAssign(signal, value) { signal.set(value); return value }\nfunction __zubraUpdate(signal, delta, prefix) { const old = signal.get(); signal.set(old + delta); return prefix ? old + delta : old }\n                                                    \n                             \n\n  const navId = id()\n  const hasActions = hasSlot('actions')\n  const menuOpen = __zubraState(false)\n  const menuButton = __zubraState(null)\n  const section = __zubraComputed(() => ($p.nav.find((item) => item.id === $p.current)))\n  // Folded: the Menu button is showing (the container query decides that, not the script).\n  const folded = () => Boolean(menuButton.get() && menuButton.get().offsetParent)\n\n  function choose(event, item) {\n    if (!item.href) event.preventDefault()\n    $p.current = item.id\n    // The folded sidebar closes: focus goes back to the button that opened it, not the page.\n    if (folded() && menuOpen.get()) {\n      __zubraAssign(menuOpen, false)\n      menuButton.get().focus()\n    }\n  }\n  function closeMenu() {\n    if (!menuOpen.get()) return\n    __zubraAssign(menuOpen, false)\n    menuButton.get()?.focus()\n  }\n    return [\n      { path: [0], toggle: \"shell-open\", value: () => $r(menuOpen) },\n      { path: [0], on: \"keydown\", handler: () => $r(closeMenu), modifiers: { keys: [\"Escape\"] } },\n      { path: [0, 0], attribute: \"id\", value: () => $r(navId) },\n      { path: [0, 0], attribute: \"aria-label\", value: () => ($p.product || \"Sections\") },\n      { path: [0, 0, 0], when: () => $p.product, blocks: [{ template: \"<p class=\\\"shell-brand\\\"></p>\", parts: () => [{ path: [0], text: () => $t($p.product) }] }, null] },\n      { path: [0, 0, 1, 0], each: () => $p.nav, key: (item, $index) => $r(item).id, block: { template: \"\\n          <li>\\n            <!--[--><!--]-->\\n          </li>\\n        \", parts: (item, $index) => [{ path: [0, 0], when: () => $r(item).href, blocks: [{ template: \"\\n              <a></a>\\n              \", parts: () => [{ path: [0], attribute: \"href\", url: true, value: () => $r(item).href }, { path: [0], attribute: \"aria-current\", value: () => (($r(item).id === $p.current) ? \"page\" : null) }, { path: [0], on: \"click\", handler: () => ((event) => choose(event, $r(item))) }, { path: [0], text: () => $t($r(item).label) }] }, { template: \"\\n                <button type=\\\"button\\\"></button>\\n              \", parts: () => [{ path: [0], attribute: \"aria-current\", value: () => (($r(item).id === $p.current) ? \"page\" : null) }, { path: [0], on: \"click\", handler: () => ((event) => choose(event, $r(item))) }, { path: [0], text: () => $t($r(item).label) }] }] }] } },\n      { path: [0, 1, 0, 0], when: () => $p.nav.length, blocks: [{ template: \"<button type=\\\"button\\\" class=\\\"shell-menu-button\\\">Menu</button>\", parts: () => [{ path: [0], ref: () => (($el) => (__zubraAssign(menuButton, $el))) }, { path: [0], attribute: \"aria-controls\", value: () => $r(navId) }, { path: [0], attribute: \"aria-expanded\", value: () => ($r(menuOpen) ? \"true\" : \"false\") }, { path: [0], on: \"click\", handler: () => (() => (__zubraAssign(menuOpen, !menuOpen.get()))) }] }, null] },\n      { path: [0, 1, 0, 1], text: () => $t((($p.heading || $r(section)?.label) || \"\")) },\n      { path: [0, 1, 0, 2], when: () => $r(hasActions), blocks: [{ template: \"<div class=\\\"shell-actions\\\"><!--[--><!--]--></div>\", parts: () => [{ path: [0, 0], slot: \"actions\", fallback: null }] }, null] },\n      { path: [0, 1, 0, 3], when: () => $p.menu.length, blocks: [{ template: \"<dropdown-menu></dropdown-menu>\", parts: () => [{ path: [0], property: \"label\", value: () => $p.user }, { path: [0], property: \"items\", value: () => $p.menu }, { path: [0], on: \"itemselect\", handler: () => ((event) => emit('menuselect', event.detail)) }] }, null] },\n      { path: [0, 1, 1, 0], slot: \"default\", fallback: null },\n    ];\n  },\n});\n"
    }
  ]
}
