{
  "$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<!--\n  Switch renders button[type=button][role=switch]; children render the thumb.\n-->\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { switchClasses } from \"./switch.shared\";\nimport { boolStr, safeRest } from \"../../utils/expr\";\n\ndefineOptions({ name: \"Switch\", inheritAttrs: false });\n\nconst props = defineProps<{\n  checked?: boolean;\n  disabled?: boolean;\n}>();\n\nconst attrs = useAttrs();\nconst callerClass = computed(() => attrs.class as string | undefined);\nconst restAttrs = computed(() => {\n  const { class: _class, ...restEntries } = attrs;\n  return safeRest(restEntries, { blank: [\"id\", \"name\", \"aria-label\", \"aria-labelledby\"] });\n});\nconst cls = computed(() => switchClasses({ className: callerClass.value }));\n</script>\n\n<template>\n  <button type=\"button\" role=\"switch\" :aria-checked=\"boolStr(props.checked)\" :data-state=\"boolStr(props.checked)\" :class=\"cls || undefined\" :disabled=\"props.disabled || undefined\" v-bind=\"restAttrs\">\n    <slot />\n  </button>\n</template>\n",
      "path": "kit/ui/switch/Switch.vue",
      "target": "kit/ui/switch/Switch.vue"
    },
    {
      "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"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "vue",
      "primitive"
    ]
  },
  "name": "kit-switch",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "vue",
  "title": "Kit Switch",
  "type": "registry:ui"
}
