{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A sidebar list item: icon, label and an optional right slot. With `href` it is a link, with `interactive` a button, otherwise a static box.",
  "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/patterns/nav-item.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/button\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/link\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// NavItemProps are the props of NavItem; the values are the JSON shapes of the TypeScript props.\ntype NavItemProps struct {\n\tSelected any `json:\"selected\"`\n\tLevel any `json:\"level\"`\n\tHref any `json:\"href\"`\n\tInteractive any `json:\"interactive\"`\n\tReserveRight any `json:\"reserveRight\"`\n\tContentClass any `json:\"contentClass\"`\n\tClass string `json:\"className\"`\n\tIcon templ.Component `json:\"-\"`\n\tRight templ.Component `json:\"-\"`\n}\n\n// A sidebar list item: icon, label and an optional right slot. With `href` it is a link, with `interactive` a button, otherwise a static box.\ntempl NavItem(p NavItemProps) {\n\t{{ vSelected := uiutils.Def(p.Selected, false) }}\n\t{{ vLevel := p.Level }}\n\t{{ vHref := p.Href }}\n\t{{ vInteractive := uiutils.Def(p.Interactive, false) }}\n\t{{ vReserveRight := uiutils.Def(p.ReserveRight, false) }}\n\t{{ vContentClass := p.ContentClass }}\n\t{{ vState := any(uiutils.Cond(uiutils.T(vSelected), \"selected\", \"default\")) }}\n\t{{ vOuter := any(uiutils.Cnv(recipeNavItem.Of(map[string]any{\"level\": vLevel, \"state\": vState}), \"group in-data-[nav=collapsed]:justify-center\", p.Class)) }}\n\t{{ vInner := any(uiutils.Cnv(recipeNavItemContent.Of(map[string]any{\"level\": vLevel, \"state\": vState}), uiutils.And(!uiutils.T(vSelected), \"group-hover:bg-muted\"), \"in-data-[nav=collapsed]:w-10 in-data-[nav=collapsed]:flex-none in-data-[nav=collapsed]:justify-center in-data-[nav=collapsed]:px-0\", vContentClass)) }}\n\tif uiutils.T(vHref) {\n\t\t@compose.LinkPlain(compose.LinkPlainProps{LinkProps: link.LinkProps{Href: uiutils.URL(vHref, false), Class: uiutils.S(vOuter), AriaCurrent: uiutils.S(uiutils.Cond(uiutils.T(vSelected), \"page\", nil)), Attrs: uiutils.Attrs(\"data-slot\", \"nav-item\", \"data-state\", vState)}}) {\n\t\t\t@NavItemRow(NavItemRowProps{Inner: vInner, ReserveRight: vReserveRight, Icon: p.Icon, Right: p.Right}) {\n\t\t\t\t{ children... }\n\t\t\t}\n\t\t}\n\t} else if uiutils.T(vInteractive) {\n\t\t@compose.ButtonPlain(compose.ButtonPlainProps{ButtonProps: button.ButtonProps{Type: \"button\", Class: uiutils.S(uiutils.Cnv(vOuter, \"text-left\")), Attrs: uiutils.Attrs(\"aria-current\", uiutils.Cond(uiutils.T(vSelected), \"page\", nil), \"data-slot\", \"nav-item\", \"data-state\", vState)}}) {\n\t\t\t@NavItemRow(NavItemRowProps{Inner: vInner, ReserveRight: vReserveRight, Icon: p.Icon, Right: p.Right}) {\n\t\t\t\t{ children... }\n\t\t\t}\n\t\t}\n\t} else {\n\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(vOuter), Attrs: uiutils.Attrs(\"aria-current\", uiutils.Cond(uiutils.T(vSelected), \"page\", nil), \"data-slot\", \"nav-item\", \"data-state\", vState)}}) {\n\t\t\t@NavItemRow(NavItemRowProps{Inner: vInner, ReserveRight: vReserveRight, Icon: p.Icon, Right: p.Right}) {\n\t\t\t\t{ children... }\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/nav-item.templ",
      "target": "blocks/nav-item.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "nav-item",
  "registryDependencies": [
    "box",
    "button-plain",
    "kit-box",
    "kit-button",
    "kit-link",
    "link-plain",
    "nav-item-row",
    "presets",
    "utils"
  ],
  "runtime": "templ",
  "title": "Nav Item",
  "type": "registry:component"
}
