{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "UI8Kit 3 Select primitive (unstyled), from @ui8kit/registry",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "<!-- Code generated by @ui8kit/codegen. DO NOT EDIT. -->\n<!--\n  Select renders option children from Options, then manual children.\n-->\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { selectClasses, type SelectOptionItem } from \"./select.shared\";\nimport { eqStr, safeRest } from \"../../utils/expr\";\n\ndefineOptions({ name: \"Select\", inheritAttrs: false });\n\nconst props = defineProps<{\n  value?: string;\n  multiple?: boolean;\n  required?: boolean;\n  disabled?: boolean;\n  options?: SelectOptionItem[];\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-invalid\", \"aria-describedby\"] });\n});\nconst cls = computed(() => selectClasses({ className: callerClass.value }));\n</script>\n\n<template>\n  <select :class=\"cls || undefined\" :multiple=\"props.multiple || undefined\" :required=\"props.required || undefined\" :disabled=\"props.disabled || undefined\" v-bind=\"{ ...(props.value === undefined ? {} : { '.value': props.value }), ...restAttrs }\">\n    <option v-for=\"(item, index) in (props.options ?? [])\" :key=\"index\" :value=\"(item.value) ?? ''\" :selected=\"eqStr(item.value, props.value) || undefined\" :disabled=\"item.disabled || undefined\">\n      {{ item.label }}\n    </option>\n    <slot />\n  </select>\n</template>\n",
      "path": "kit/ui/select/Select.vue",
      "target": "kit/ui/select/Select.vue"
    },
    {
      "content": "<!-- Code generated by @ui8kit/codegen. DO NOT EDIT. -->\n<!--\n  SelectOptGroup renders a native optgroup around option children.\n-->\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { safeRest } from \"../../utils/expr\";\n\ndefineOptions({ name: \"SelectOptGroup\", inheritAttrs: false });\n\nconst props = defineProps<{\n  disabled?: boolean;\n}>();\n\nconst attrs = useAttrs();\nconst restAttrs = computed(() => {\n  const { class: _class, ...restEntries } = attrs;\n  return safeRest(restEntries, { blank: [\"label\"] });\n});\n</script>\n\n<template>\n  <optgroup :disabled=\"props.disabled || undefined\" v-bind=\"restAttrs\">\n    <slot />\n  </optgroup>\n</template>\n",
      "path": "kit/ui/select/SelectOptGroup.vue",
      "target": "kit/ui/select/SelectOptGroup.vue"
    },
    {
      "content": "<!-- Code generated by @ui8kit/codegen. DO NOT EDIT. -->\n<!--\n  SelectOption renders a native option.\n-->\n<script setup lang=\"ts\">\nimport { computed, useAttrs } from \"vue\";\nimport { safeRest } from \"../../utils/expr\";\n\ndefineOptions({ name: \"SelectOption\", inheritAttrs: false });\n\nconst props = defineProps<{\n  selected?: boolean;\n  disabled?: boolean;\n}>();\n\nconst attrs = useAttrs();\nconst restAttrs = computed(() => {\n  const { class: _class, ...restEntries } = attrs;\n  return safeRest(restEntries);\n});\n</script>\n\n<template>\n  <option :selected=\"props.selected || undefined\" :disabled=\"props.disabled || undefined\" v-bind=\"restAttrs\">\n    <slot />\n  </option>\n</template>\n",
      "path": "kit/ui/select/SelectOption.vue",
      "target": "kit/ui/select/SelectOption.vue"
    },
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n// ui.select — shared TypeScript contract (types + classes helpers)\n\nimport { cn } from \"../../utils\";\n\nexport type SelectOptionItem = {\n  value?: string;\n  label?: string;\n  disabled?: boolean;\n};\n\n/** Select renders option children from Options, then manual children. */\nexport type SelectBaseProps = {\n  value?: string;\n  multiple?: boolean;\n  required?: boolean;\n  disabled?: boolean;\n  options?: SelectOptionItem[];\n};\n\nexport type SelectClassesInput = {\n  className?: string;\n};\n\n/** Compose Select classes without rendering — the cross-runtime `asChild` substitute. */\nexport function selectClasses(input: SelectClassesInput = {}): string {\n  return cn(\"pr-2\", input.className);\n}\n\n/** SelectOption renders a native option. */\nexport type SelectOptionBaseProps = {\n  selected?: boolean;\n  disabled?: boolean;\n};\n\n/** SelectOptGroup renders a native optgroup around option children. */\nexport type SelectOptGroupBaseProps = {\n  disabled?: boolean;\n};\n",
      "path": "kit/ui/select/select.shared.ts",
      "target": "kit/ui/select/select.shared.ts"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "vue",
      "primitive"
    ]
  },
  "name": "kit-select",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "vue",
  "title": "Kit Select",
  "type": "registry:ui"
}
