{
  "$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/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/** A row of a file tree: a folder with a disclosure chevron, or a file. The glyphs are Lucide. */\nimport { type ReactNode } from \"react\";\nimport { ButtonPlain, Inline } from \"../compose\";\nimport { LucideIcon } from \"../icons/LucideIcon\";\nimport { cn, variants } from \"../utils\";\n\n/** FileTreeItem: the classes of each value (shadcn/cva style). */\nexport const fileTreeItemVariants = variants({\n  base: \"flex h-6 w-full items-center gap-4 text-xs font-bold text-muted-foreground data-[state=selected]:bg-muted\",\n  variants: {\n    kind: {\n      folder: \"\",\n      file: \"px-8\",\n    },\n  },\n  defaultVariants: { kind: \"file\" },\n});\n\nexport type FileTreeItemProps = {\n  kind?: \"folder\" | \"file\";\n  label: string;\n  selected?: boolean;\n  expanded?: boolean;\n  className?: string;\n  onClick?: () => void;\n};\n\nexport function FileTreeItem({\n  kind = \"file\",\n  label,\n  selected = false,\n  expanded = false,\n  className,\n  onClick,\n}: FileTreeItemProps) {\n  return (\n    <ButtonPlain\n      type=\"button\"\n      role=\"treeitem\"\n      className={cn(fileTreeItemVariants({ kind: kind }), className)}\n      aria-selected={selected}\n      tabIndex={(selected ? 0 : -1)}\n      aria-expanded={(((kind as string) === \"folder\") ? expanded : undefined)}\n      data-slot=\"file-tree-item\"\n      data-kind={kind}\n      data-state={(selected ? \"selected\" : \"default\")}\n      onClick={() => onClick?.()}\n    >\n      {((kind as string) === \"folder\") ? (\n        <>\n          <LucideIcon name={(expanded ? \"chevron-down\" : \"chevron-right\")} size={16} />\n          <LucideIcon name=\"folder-open\" size={16} />\n        </>\n      ) : (\n        <LucideIcon name=\"file\" size={16} />\n      )}\n      <Inline className=\"whitespace-nowrap\" data-slot=\"file-tree-label\">\n        {label}\n      </Inline>\n    </ButtonPlain>\n  );\n}\n",
      "path": "components/file-tree-item.tsx",
      "target": "components/file-tree-item.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "react",
      "component"
    ]
  },
  "name": "file-tree-item",
  "registryDependencies": [
    "compose",
    "lucide-icon",
    "utils"
  ],
  "runtime": "react",
  "title": "File Tree Item",
  "type": "registry:component"
}
