{
  "$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 { splitProps, type JSX, type Component } from \"solid-js\";\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<JSX.ButtonHTMLAttributes<HTMLButtonElement>, \"class\" | \"className\" | \"children\" | \"checked\" | \"disabled\"> & {\n  checked?: boolean;\n  disabled?: boolean;\n  class?: string;\n  className?: string;\n  children?: JSX.Element;\n};\n\nexport const Switch: Component<SwitchProps> = (props) => {\n  const [local, rest] = splitProps(props, [\"checked\", \"disabled\", \"class\", \"className\", \"children\"]);\n  const cls = () => switchClasses({ className: local.class ?? local.className });\n  return (\n    <button type=\"button\" role=\"switch\" aria-checked={boolStr(local.checked)} data-state={boolStr(local.checked)} {...(cls() ? { class: cls() } : {})} disabled={local.disabled || undefined} {...safeRest(rest, { blank: [\"id\", \"name\", \"aria-label\", \"aria-labelledby\"] })}>\n      {local.children}\n    </button>\n  );\n};\n",
      "path": "kit/ui/switch/switch.solid.tsx",
      "target": "kit/ui/switch/switch.solid.tsx"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "solid",
      "primitive"
    ]
  },
  "name": "kit-switch",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "solid",
  "title": "Kit Switch",
  "type": "registry:ui"
}
