{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "oods-select",
  "type": "registry:component",
  "title": "OODS Foundry Select",
  "description": "Vue adapter for OODS Select on shadcn-vue / Reka UI. Reka combobox keyboard interaction replaces native select interaction. Empty reset options retain their label and emit/submit an empty string.",
  "dependencies": [
    "@oods/components-vue@0.11.2"
  ],
  "registryDependencies": [
    "select",
    "label"
  ],
  "files": [
    {
      "path": "components/oods/select.vue",
      "type": "registry:component",
      "content": "<script lang=\"ts\">\nimport { defineComponent, h, ref, useId } from 'vue';\nimport { Select as Contract } from '@oods/components-vue';\nimport { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@/components/ui/select';\nimport { Label } from '@/components/ui/label';\n\n// Reuse the shipped Vue prop defaults and event vocabulary; the rendered parts belong to the team.\nexport default defineComponent({\n  name: 'OodsSelectAdapter',\n  inheritAttrs: false,\n  props: Contract.props,\n  emits: Array.isArray(Contract.emits) ? Contract.emits : Object.keys(Contract.emits ?? {}),\n  setup(props: any, { attrs, slots, emit }: any) {\n    const generated = useId(), local = ref(props.defaultValue ?? ''), native = ref<HTMLInputElement>();\n    return () => {\n      const id = props.id ?? `oods-select-${generated}`;\n      const status = false;\n      if (status && slots.default) return h('div', { ...attrs, 'data-oods-component': undefined, 'data-oods-adapter': 'Select' }, slots.default());\n      const choices = (props.options ?? props.states ?? (status ? ['draft','active','inactive'] : [])).map((option: any) => typeof option === 'object' ? { ...option, value: String(option.value ?? option.id ?? option.name ?? ''), label: option.label ?? option.name ?? String(option.value ?? option.id ?? '') } : { value: String(option), label: String(option) });\n      // Reka reserves ''; keep the public empty option and never leak the transport value into forms or events.\n      let empty = '__oods_empty_option__';\n      while (choices.some((option: any) => option.value === empty)) empty += '_';\n      const selected = String(props.modelValue ?? props.value ?? props.status ?? local.value);\n      const change = (value: unknown) => { const next = value === empty ? '' : String(value ?? ''); if (native.value) { native.value.value = next; native.value.dispatchEvent(new Event('change', { bubbles: true })); } if (props.modelValue === undefined && props.value === undefined) local.value = next; emit('update:modelValue', next); emit('change', next); };\n      const name = props.name ?? (status ? 'status' : undefined);\n      const label = slots.label?.() ?? props.label ?? props.title ?? (status ? 'Status' : undefined);\n      const help = slots.help?.() ?? props.help, validation = slots.validation?.() ?? props.validation?.message;\n      return h('div', { class: 'grid gap-2', 'data-oods-adapter': 'Select' }, [\n        label ? h(Label, { for: id + '-control' }, { default: () => label }) : null,\n        h('input', { id, ref: native, type: 'hidden', name, value: selected, disabled: props.disabled }),\n        h(Select, { modelValue: selected === '' && choices.some((option: any) => option.value === '') ? empty : selected, 'onUpdate:modelValue': change, disabled: props.disabled, required: props.required }, { default: () => [\n          h(SelectTrigger, { ...attrs, 'data-oods-component': undefined, id: id + '-control', 'aria-invalid': props.validation?.state === 'error' || undefined, 'aria-describedby': [attrs['aria-describedby'], help ? id + '-help' : '', validation ? id + '-validation' : ''].filter(Boolean).join(' ') || undefined }, { default: () => h(SelectValue, { placeholder: props.placeholder }, { default: () => choices.find((option: any) => option.value === selected)?.label ?? props.placeholder }) }),\n          h(SelectContent, {}, { default: () => choices.map((option: any) => h(SelectItem, { value: option.value === '' ? empty : option.value, disabled: option.disabled }, { default: () => slots.option?.({ option }) ?? option.label })) }),\n        ] }),\n        help ? h('p', { id: id + '-help', class: 'text-sm' }, help) : null,\n        validation ? h('p', { id: id + '-validation', role: props.validation?.state === 'error' ? 'alert' : undefined }, validation) : null,\n      ]);\n    };\n  },\n});\n</script>\n"
    }
  ]
}
