{
  "$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/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/organisms/sidebar-nav.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/icons\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// SidebarNavProps are the props of SidebarNav; the values are the JSON shapes of the TypeScript props.\ntype SidebarNavProps struct {\n\tLabel any `json:\"label\"`\n\tBrand any `json:\"brand\"`\n\tLinks any `json:\"links\"`\n\tCurrent any `json:\"current\"`\n\tUserName any `json:\"userName\"`\n\tUserEmail any `json:\"userEmail\"`\n\tWidth any `json:\"width\"`\n\tUser any `json:\"user\"`\n\tDensity any `json:\"density\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A vertical navigation: the brand at the top, the links stacked, the user at the bottom. Axes: width (full: icon and name, compact: icons only with the name hidden), user (show, hide), density.\ntempl SidebarNav(p SidebarNavProps) {\n\t{{ vLabel := p.Label }}\n\t{{ vBrand := p.Brand }}\n\t{{ vLinks := p.Links }}\n\t{{ vCurrent := uiutils.Def(p.Current, \"\") }}\n\t{{ vUserName := p.UserName }}\n\t{{ vUserEmail := p.UserEmail }}\n\t{{ vWidth := uiutils.Def(p.Width, \"full\") }}\n\t{{ vUser := uiutils.Def(p.User, \"show\") }}\n\t{{ vDensity := uiutils.Def(p.Density, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: \"aside\", Class: uiutils.S(uiutils.Cnv(\"flex min-h-96 flex-col gap-6 rounded bg-card p-4 inset-ring inset-ring-border\", uiutils.Cond(uiutils.T(uiutils.Eq(vWidth, \"compact\")), \"w-20 items-center\", \"w-64\"))), Attrs: uiutils.Attrs(\"aria-label\", uiutils.Coalesce(vLandmarkLabel, vBrand), \"data-width\", vWidth, \"data-slot\", \"sidebar\")}}) {\n\t\t@compose.Group(compose.GroupProps{Gap: \"2\", Align: \"center\", BoxProps: box.BoxProps{}}) {\n\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"layers\", Size: 24})\n\t\t\t@compose.Text(compose.TextProps{Size: \"base\", Weight: \"bold\", TextProps: text.TextProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vWidth, \"compact\")), \"sr-only\", \"\"))}}) {\n\t\t\t\t{ uiutils.Text(vBrand) }\n\t\t\t}\n\t\t}\n\t\tif uiutils.Gt(uiutils.Len(vLinks), float64(0)) {\n\t\t\t@NavBlock(NavBlockProps{Label: uiutils.Cond(uiutils.T(vLandmarkLabel), uiutils.Uniq(uiutils.Tpl(\"{0}, {1}\", vLabel, vLandmarkLabel)), vLabel), Class: uiutils.Cnv(\"flex-1\")}) {\n\t\t\t\t@compose.List(compose.ListProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"m-0 flex list-none flex-col p-0\", uiutils.Cond(uiutils.T(uiutils.Eq(vDensity, \"compact\")), \"gap-0\", \"gap-2\"))), Attrs: uiutils.Attrs(\"data-slot\", \"items\")}}) {\n\t\t\t\t\tfor _, vL := range uiutils.L(vLinks) {\n\t\t\t\t\t\t@compose.ListItem(compose.ListItemProps{BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"links-row\")}}) {\n\t\t\t\t\t\t\t@MenuEntry(MenuEntryProps{Href: uiutils.Get(vL, \"href\"), Class: uiutils.Cnv(uiutils.Cnv(\"flex items-center gap-4 rounded px-4 text-sm\", \"py-2\", uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vL, \"id\"), vCurrent)), \"bg-muted font-semibold\", \"\"))), Current: uiutils.Eq(uiutils.Get(vL, \"id\"), vCurrent), Testid: \"item\"}) {\n\t\t\t\t\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Get(vL, \"icon\")), Size: 16})\n\t\t\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vWidth, \"compact\")), \"sr-only\", \"\"))}}) {\n\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vL, \"name\")) }\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif uiutils.Eq(vUser, \"show\") {\n\t\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", BoxProps: box.BoxProps{Class: \"border-t border-border pt-4\", Attrs: uiutils.Attrs(\"data-slot\", \"user\")}}) {\n\t\t\t\t@MediaFrame(MediaFrameProps{Alt: vUserName, Ratio: \"1/1\", Class: uiutils.Cnv(\"size-10 shrink-0 rounded-full\")})\n\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"0\", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(vWidth, \"compact\")), \"sr-only\", \"min-w-0\"))}}) {\n\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t{ uiutils.Text(vUserName) }\n\t\t\t\t\t}\n\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t\t{ uiutils.Text(vUserEmail) }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/sidebar-nav.templ",
      "target": "blocks/sidebar-nav.templ"
    }
  ],
  "meta": {
    "category": "dashboard",
    "group": "navigation",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "sidebar-nav",
  "registryDependencies": [
    "block",
    "group",
    "inline",
    "kit-box",
    "kit-text",
    "list",
    "list-item",
    "lucide-icon",
    "media-frame",
    "menu-entry",
    "nav-block",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Sidebar Nav",
  "type": "registry:block"
}
