{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A segmented switcher: a tab list whose items (SwitcherItem) share size and layout. Canary handed these down through context; here each item takes the same two props. Arrow keys: attach `moveFocus` to the keydown (horizontal, activate).",
  "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 * A segmented switcher: a tab list whose items (SwitcherItem) share size and layout. Canary handed these down\n * through context; here each item takes the same two props. Arrow keys: attach `moveFocus` to the keydown\n * (horizontal, activate).\n */\nimport { type JSX } from \"solid-js\";\nimport { Box } from \"../compose\";\nimport { cn, variants } from \"../utils\";\n\n/** Switcher: the classes of each value (shadcn/cva style). */\nexport const switcherVariants = variants({\n  base: \"inline-flex max-w-full items-center gap-1 overflow-x-auto bg-muted inset-ring inset-ring-border rounded\",\n  variants: {\n    size: {\n      sm: \"h-8 p-1\",\n      default: \"h-10 p-1\",\n      lg: \"h-12 p-1\",\n    },\n    layout: {\n      text: \"\",\n      icon: \"gap-0\",\n    },\n  },\n  defaultVariants: { size: \"default\", layout: \"text\" },\n});\n\nexport type SwitcherProps = {\n  size?: \"sm\" | \"default\" | \"lg\";\n  layout?: \"text\" | \"icon\";\n  label?: string;\n  class?: string;\n  children?: JSX.Element;\n};\n\nexport function Switcher({\n  size = \"default\",\n  layout = \"text\",\n  label,\n  class: className,\n  children,\n}: SwitcherProps) {\n  return (\n    <Box\n      class={cn(switcherVariants({ size: size, layout: layout }), className)}\n      role=\"tablist\"\n      aria-label={label}\n      data-slot=\"switcher\"\n    >\n      {children}\n    </Box>\n  );\n}\n",
      "path": "components/switcher.tsx",
      "target": "components/switcher.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "switcher",
  "registryDependencies": [
    "compose",
    "utils"
  ],
  "runtime": "solid",
  "title": "Switcher",
  "type": "registry:component"
}
