{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A vertical navigation with the brand on top and the user at the bottom: full, or icons only.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/**\n * A vertical navigation: the brand at the top, the links stacked, the user at the bottom. Axes: width (full:\n * icon and name, compact: icons only with the name hidden), user (show, hide), density.\n */\nimport { For, type JSX } from \"solid-js\";\nimport { Block, Group, Inline, List, ListItem, Stack, Text } from \"../compose\";\nimport { LucideIcon } from \"../icons/LucideIcon\";\nimport { MediaFrame } from \"../components/media-frame\";\nimport { MenuEntry } from \"../components/menu-entry\";\nimport { NavBlock } from \"../components/nav-block\";\nimport { cn, tpl, uniqLabel } from \"../utils\";\nimport type { NavLink } from \"./nav-bar.types\";\n\nexport type SidebarNavProps = {\n  label: string;\n  brand: string;\n  links: NavLink[];\n  current?: string;\n  userName: string;\n  userEmail: string;\n  width?: \"full\" | \"compact\";\n  user?: \"show\" | \"hide\";\n  density?: \"default\" | \"compact\";\n  landmarkLabel?: string;\n};\n\nexport function SidebarNav({\n  label,\n  brand,\n  links,\n  current = \"\",\n  userName,\n  userEmail,\n  width = \"full\",\n  user = \"show\",\n  density = \"default\",\n  landmarkLabel,\n}: SidebarNavProps) {\n  return (\n    <Block\n      tag=\"aside\"\n      class={cn(\n        \"flex min-h-96 flex-col gap-6 rounded bg-card p-4 inset-ring inset-ring-border\",\n        (((width as string) === \"compact\") ? \"w-20 items-center\" : \"w-64\")\n      )}\n      aria-label={(landmarkLabel ?? brand)}\n      data-width={width}\n      data-slot=\"sidebar\"\n    >\n      <Group gap=\"2\" align=\"center\">\n        <LucideIcon name=\"layers\" size={24} />\n        <Text size=\"base\" weight=\"bold\" class={(((width as string) === \"compact\") ? \"sr-only\" : \"\")}>\n          {brand}\n        </Text>\n      </Group>\n      {((links?.length ?? 0) > 0) ? (\n        <NavBlock label={(landmarkLabel ? uniqLabel(tpl(\"{0}, {1}\", label, landmarkLabel)) : label)} class=\"flex-1\">\n          <List\n            class={cn(\n              \"m-0 flex list-none flex-col p-0\",\n              (((density as string) === \"compact\") ? \"gap-0\" : \"gap-2\")\n            )}\n            data-slot=\"items\"\n          >\n            <For each={links ?? []}>{(l) => (\n              <ListItem data-slot=\"links-row\">\n                <MenuEntry\n                  href={l.href}\n                  class={cn(\n                    \"flex items-center gap-4 rounded px-4 text-sm\",\n                    \"py-2\",\n                    ((l.id === current) ? \"bg-muted font-semibold\" : \"\")\n                  )}\n                  current={(l.id === current)}\n                  testid=\"item\"\n                >\n                  <LucideIcon name={l.icon} size={16} />\n                  <Inline class={(((width as string) === \"compact\") ? \"sr-only\" : \"\")}>\n                    {l.name}\n                  </Inline>\n                </MenuEntry>\n              </ListItem>\n            )}</For>\n          </List>\n        </NavBlock>\n      ) : null}\n      {((user as string) === \"show\") ? (\n        <Group gap=\"4\" align=\"center\" class=\"border-t border-border pt-4\" data-slot=\"user\">\n          <MediaFrame alt={userName} ratio=\"1/1\" class=\"size-10 shrink-0 rounded-full\" />\n          <Stack gap=\"0\" class={(((width as string) === \"compact\") ? \"sr-only\" : \"min-w-0\")}>\n            <Text size=\"sm\" weight=\"semibold\">\n              {userName}\n            </Text>\n            <Text size=\"xs\" class=\"text-muted-foreground\">\n              {userEmail}\n            </Text>\n          </Stack>\n        </Group>\n      ) : null}\n    </Block>\n  );\n}\n",
      "path": "blocks/sidebar-nav.tsx",
      "target": "blocks/sidebar-nav.tsx"
    }
  ],
  "meta": {
    "category": "dashboard",
    "group": "navigation",
    "kind": "block",
    "tags": [
      "solid",
      "block"
    ]
  },
  "name": "sidebar-nav",
  "registryDependencies": [
    "compose",
    "lucide-icon",
    "media-frame",
    "menu-entry",
    "nav-bar",
    "nav-block",
    "utils"
  ],
  "runtime": "solid",
  "title": "Sidebar Nav",
  "type": "registry:block"
}
