{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A row of a file tree: a folder with a disclosure chevron, or a file. The glyphs are Lucide.",
  "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/file-tree-item.json\n\npackage blocks\n\nimport (\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/icons\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// FileTreeItemProps are the props of FileTreeItem; the values are the JSON shapes of the TypeScript props.\ntype FileTreeItemProps struct {\n\tKind any `json:\"kind\"`\n\tLabel any `json:\"label\"`\n\tSelected any `json:\"selected\"`\n\tExpanded any `json:\"expanded\"`\n\tClass string `json:\"className\"`\n}\n\n// A row of a file tree: a folder with a disclosure chevron, or a file. The glyphs are Lucide.\ntempl FileTreeItem(p FileTreeItemProps) {\n\t{{ vKind := uiutils.Def(p.Kind, \"file\") }}\n\t{{ vLabel := p.Label }}\n\t{{ vSelected := uiutils.Def(p.Selected, false) }}\n\t{{ vExpanded := uiutils.Def(p.Expanded, false) }}\n\t@compose.ButtonPlain(compose.ButtonPlainProps{ButtonProps: button.ButtonProps{Type: \"button\", Class: uiutils.S(uiutils.Cnv(recipeFileTreeItem.Of(map[string]any{\"kind\": vKind}), p.Class)), Attrs: uiutils.Attrs(\"role\", \"treeitem\", \"aria-selected\", vSelected, \"tabindex\", uiutils.Cond(uiutils.T(vSelected), float64(0), float64(-1)), \"aria-expanded\", uiutils.Cond(uiutils.T(uiutils.Eq(vKind, \"folder\")), vExpanded, nil), \"data-slot\", \"file-tree-item\", \"data-kind\", vKind, \"data-state\", uiutils.Cond(uiutils.T(vSelected), \"selected\", \"default\"))}}) {\n\t\tif uiutils.Eq(vKind, \"folder\") {\n\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Cond(uiutils.T(vExpanded), \"chevron-down\", \"chevron-right\")), Size: 16})\n\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"folder-open\", Size: 16})\n\t\t} else {\n\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"file\", Size: 16})\n\t\t}\n\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"whitespace-nowrap\", Attrs: uiutils.Attrs(\"data-slot\", \"file-tree-label\")}}) {\n\t\t\t{ uiutils.Text(vLabel) }\n\t\t}\n\t}\n}\n",
      "path": "blocks/file-tree-item.templ",
      "target": "blocks/file-tree-item.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "file-tree-item",
  "registryDependencies": [
    "button-plain",
    "inline",
    "kit-button",
    "kit-text",
    "lucide-icon",
    "presets",
    "utils"
  ],
  "runtime": "templ",
  "title": "File Tree Item",
  "type": "registry:component"
}
