{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "One item of a Switcher (default or active). Pass the same size and layout as the Switcher.",
  "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/** One item of a Switcher (default or active). Pass the same size and layout as the Switcher. */\nimport { type JSX } from \"solid-js\";\nimport { ButtonPlain } from \"../compose\";\nimport { cn, variants } from \"../utils\";\n\n/** SwitcherItem: the classes of each value (shadcn/cva style). */\nexport const switcherItemVariants = variants({\n  base:\n    \"inline-flex shrink-0 items-center justify-center whitespace-nowrap font-bold text-muted-foreground inset-ring \" +\n    \"inset-ring-transparent rounded\",\n  variants: {\n    size: {\n      sm: \"h-6 gap-1 px-3 text-xs\",\n      default: \"h-8 gap-2 px-4 text-sm\",\n      lg: \"h-10 gap-2 px-5 text-sm\",\n    },\n    state: {\n      default: \"\",\n      active: \"bg-background text-foreground inset-ring-border\",\n    },\n    layout: {\n      text: \"\",\n      icon: \"[&>svg]:size-4\",\n    },\n  },\n  defaultVariants: { size: \"default\", state: \"default\", layout: \"text\" },\n  compoundVariants: [\n    { layout: \"icon\", size: \"sm\", class: \"w-6 px-0\" },\n    { layout: \"icon\", size: \"default\", class: \"w-8 px-0\" },\n    { layout: \"icon\", size: \"lg\", class: \"w-10 px-0\" },\n  ],\n});\n\nexport type SwitcherItemProps = {\n  active?: boolean;\n  size?: \"sm\" | \"default\" | \"lg\";\n  layout?: \"text\" | \"icon\";\n  class?: string;\n  children?: JSX.Element;\n  onClick?: () => void;\n};\n\nexport function SwitcherItem({\n  active = false,\n  size = \"default\",\n  layout = \"text\",\n  class: className,\n  children,\n  onClick,\n}: SwitcherItemProps) {\n  return (\n    <ButtonPlain\n      type=\"button\"\n      role=\"tab\"\n      class={cn(\n        switcherItemVariants({ size: size, layout: layout, state: (active ? \"active\" : \"default\") }),\n        className\n      )}\n      aria-selected={active}\n      tabindex={(active ? 0 : -1)}\n      data-slot=\"switcher-item\"\n      data-state={(active ? \"active\" : \"default\")}\n      onClick={() => onClick?.()}\n    >\n      {children}\n    </ButtonPlain>\n  );\n}\n",
      "path": "components/switcher-item.tsx",
      "target": "components/switcher-item.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "switcher-item",
  "registryDependencies": [
    "compose",
    "utils"
  ],
  "runtime": "solid",
  "title": "Switcher Item",
  "type": "registry:component"
}
