{
  "$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/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/editor-tab.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/icons\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// EditorTabProps are the props of EditorTab; the values are the JSON shapes of the TypeScript props.\ntype EditorTabProps struct {\n\tLabel any `json:\"label\"`\n\tCloseLabel any `json:\"closeLabel\"`\n\tActive any `json:\"active\"`\n\tPreview any `json:\"preview\"`\n\tClass string `json:\"className\"`\n\tIcon templ.Component `json:\"-\"`\n}\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 pinned yet. Keyboard (Enter and Space activate, Delete closes) is the programmer's behind the click and close events.\ntempl EditorTab(p EditorTabProps) {\n\t{{ vLabel := p.Label }}\n\t{{ vCloseLabel := p.CloseLabel }}\n\t{{ vActive := uiutils.Def(p.Active, false) }}\n\t{{ vPreview := uiutils.Def(p.Preview, false) }}\n\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv(\"flex h-10 shrink-0 cursor-pointer flex-col justify-center data-[state=active]:bg-card [&_svg]:text-muted-foreground\", \"border-r border-border\", p.Class)), Attrs: uiutils.Attrs(\"role\", \"tab\", \"aria-selected\", vActive, \"tabindex\", uiutils.Cond(uiutils.T(vActive), float64(0), float64(-1)), \"data-slot\", \"editor-tab\", \"data-state\", uiutils.Cond(uiutils.T(vActive), \"active\", \"default\"))}}) {\n\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"flex h-10 items-center gap-2 px-3\", Attrs: uiutils.Attrs(\"data-slot\", \"editor-tab-content\")}}) {\n\t\t\tif p.Icon != nil {\n\t\t\t\t@p.Icon\n\t\t\t}\n\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: uiutils.S(uiutils.Cnv(\"text-xs text-foreground\", uiutils.Cond(uiutils.T(vPreview), \"font-semibold italic\", \"font-bold\"))), Attrs: uiutils.Attrs(\"data-slot\", \"editor-tab-label\")}}) {\n\t\t\t\t{ uiutils.Text(vLabel) }\n\t\t\t}\n\t\t\t@compose.Button(compose.ButtonProps{Variant: \"ghost\", Size: \"sm\", Layout: \"icon\", ButtonProps: button.ButtonProps{Class: \"p-0 [&>svg]:size-4\", AriaLabel: uiutils.S(vCloseLabel), Attrs: uiutils.Attrs(\"tabindex\", float64(-1), \"data-slot\", \"editor-tab-close\")}}) {\n\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"x\", Size: 16})\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/editor-tab.templ",
      "target": "blocks/editor-tab.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "editor-tab",
  "registryDependencies": [
    "box",
    "button",
    "inline",
    "kit-box",
    "kit-button",
    "kit-text",
    "lucide-icon",
    "utils"
  ],
  "runtime": "templ",
  "title": "Editor Tab",
  "type": "registry:component"
}
