{
  "$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-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { NavLink } from \"./nav-bar.types\";\n\n  export 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</script>\n\n<script lang=\"ts\">\n  import Block from \"../compose/Block.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import Inline from \"../compose/Inline.svelte\";\n  import List from \"../compose/List.svelte\";\n  import ListItem from \"../compose/ListItem.svelte\";\n  import LucideIcon from \"../icons/LucideIcon.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import Text from \"../compose/Text.svelte\";\n  import MediaFrame from \"../components/media-frame.svelte\";\n  import MenuEntry from \"../components/menu-entry.svelte\";\n  import NavBlock from \"../components/nav-block.svelte\";\n  import { cn, tpl, uniqLabel } from \"../utils\";\n\n  let {\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 = $props();\n</script>\n\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  {#if ((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        {#each links as l (l.id)}\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        {/each}\n      </List>\n    </NavBlock>\n  {/if}\n  {#if ((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  {/if}\n</Block>\n",
      "path": "blocks/sidebar-nav.svelte",
      "target": "blocks/sidebar-nav.svelte"
    }
  ],
  "meta": {
    "category": "dashboard",
    "group": "navigation",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "sidebar-nav",
  "registryDependencies": [
    "block",
    "group",
    "inline",
    "list",
    "list-item",
    "lucide-icon",
    "media-frame",
    "menu-entry",
    "nav-bar",
    "nav-block",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Sidebar Nav",
  "type": "registry:block"
}
