{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "An editor file tab (40 px high): a file icon, the label and a close button. `preview` marks a tab that is not pinned yet. Keyboard (Enter and Space activate, Delete closes) is the programmer's behind the click and close events.",
  "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 * An editor file tab (40 px high): a file icon, the label and a close button. `preview` marks a tab that is not\n * pinned yet. Keyboard (Enter and Space activate, Delete closes) is the programmer's behind the click and close\n * events.\n */\nimport { type JSX } from \"solid-js\";\nimport { Box, Button, Inline } from \"../compose\";\nimport { LucideIcon } from \"../icons/LucideIcon\";\nimport { cn } from \"../utils\";\n\nexport type EditorTabProps = {\n  label: string;\n  closeLabel: string;\n  active?: boolean;\n  preview?: boolean;\n  class?: string;\n  icon?: JSX.Element;\n  onClick?: () => void;\n  onClose?: () => void;\n};\n\nexport function EditorTab({\n  label,\n  closeLabel,\n  active = false,\n  preview = false,\n  class: className,\n  icon,\n  onClick,\n  onClose,\n}: EditorTabProps) {\n  return (\n    <Box\n      class={cn(\n        \"flex h-10 shrink-0 cursor-pointer flex-col justify-center data-[state=active]:bg-card \" +\n          \"[&_svg]:text-muted-foreground\",\n        \"border-r border-border\",\n        className\n      )}\n      role=\"tab\"\n      aria-selected={active}\n      tabindex={(active ? 0 : -1)}\n      data-slot=\"editor-tab\"\n      data-state={(active ? \"active\" : \"default\")}\n      onClick={() => onClick?.()}\n    >\n      <Inline class=\"flex h-10 items-center gap-2 px-3\" data-slot=\"editor-tab-content\">\n        {icon}\n        <Inline\n          class={cn(\"text-xs text-foreground\", (preview ? \"font-semibold italic\" : \"font-bold\"))}\n          data-slot=\"editor-tab-label\"\n        >\n          {label}\n        </Inline>\n        <Button\n          variant=\"ghost\"\n          size=\"sm\"\n          layout=\"icon\"\n          class={\"p-0 [&>svg]:size-4\"}\n          aria-label={closeLabel}\n          tabindex={-1}\n          data-slot=\"editor-tab-close\"\n          onClick={() => onClose?.()}\n        >\n          <LucideIcon name=\"x\" size={16} />\n        </Button>\n      </Inline>\n    </Box>\n  );\n}\n",
      "path": "components/editor-tab.tsx",
      "target": "components/editor-tab.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "editor-tab",
  "registryDependencies": [
    "compose",
    "lucide-icon",
    "utils"
  ],
  "runtime": "solid",
  "title": "Editor Tab",
  "type": "registry:component"
}
