{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "UI8Kit 3 Switch primitive (unstyled), from @ui8kit/registry",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n// ui.switch — shared TypeScript contract (types + classes helpers)\n\nimport { cn } from \"../../utils\";\n\n/** Switch renders button[type=button][role=switch]; children render the thumb. */\nexport type SwitchBaseProps = {\n  checked?: boolean;\n  disabled?: boolean;\n};\n\nexport type SwitchClassesInput = {\n  className?: string;\n};\n\n/** Compose Switch classes without rendering — the cross-runtime `asChild` substitute. */\nexport function switchClasses(input: SwitchClassesInput = {}): string {\n  return cn(input.className);\n}\n",
      "path": "kit/ui/switch/switch.shared.ts",
      "target": "kit/ui/switch/switch.shared.ts"
    },
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n/**\n * Switch is an on/off toggle: button[role=switch] with aria-checked.\n * State changes are the consumer's (onClick via attrs/rest).\n */\n\nimport { forwardRef, type ReactNode, type ButtonHTMLAttributes } from \"react\";\nimport { switchClasses } from \"./switch.shared\";\nimport { boolStr, safeRest } from \"../../utils/expr\";\n\n/**\n * Switch renders button[type=button][role=switch]; children render the thumb.\n */\nexport type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"className\" | \"children\" | \"checked\" | \"disabled\"> & {\n  checked?: boolean;\n  disabled?: boolean;\n  className?: string;\n  children?: ReactNode;\n};\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n  { checked, disabled, className, children, ...rawRest },\n  ref\n) {\n  const rest = safeRest(rawRest, { blank: [\"id\", \"name\", \"aria-label\", \"aria-labelledby\"] });\n  const cls = switchClasses({ className });\n  return (\n    <button ref={ref} type=\"button\" role=\"switch\" aria-checked={boolStr(checked)} data-state={boolStr(checked)} className={cls || undefined} disabled={disabled} {...rest}>\n      {children}\n    </button>\n  );\n});\nSwitch.displayName = \"Switch\";\n",
      "path": "kit/ui/switch/switch.tsx",
      "target": "kit/ui/switch/switch.tsx"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "react",
      "primitive"
    ]
  },
  "name": "kit-switch",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "react",
  "title": "Kit Switch",
  "type": "registry:ui"
}
