{
  "$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// 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"
    },
    {
      "content": "// Code generated by @ui8kit/codegen. DO NOT EDIT.\n/**\n * Select is a native dropdown. Flat options come from the Options list;\n * SelectOption / SelectOptGroup children cover grouped or custom markup.\n */\n\nimport { forwardRef, type ReactNode, type OptgroupHTMLAttributes, type OptionHTMLAttributes, type SelectHTMLAttributes } from \"react\";\nimport { selectClasses, type SelectOptionItem } from \"./select.shared\";\nimport { safeRest } from \"../../utils/expr\";\n\n/**\n * Select renders option children from Options, then manual children.\n */\nexport type SelectProps = Omit<SelectHTMLAttributes<HTMLSelectElement>, \"className\" | \"children\" | \"value\" | \"multiple\" | \"required\" | \"disabled\" | \"options\"> & {\n  value?: string;\n  multiple?: boolean;\n  required?: boolean;\n  disabled?: boolean;\n  options?: SelectOptionItem[];\n  className?: string;\n  children?: ReactNode;\n};\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n  { value, multiple, required, disabled, options, className, children, ...rawRest },\n  ref\n) {\n  const rest = safeRest(rawRest, { blank: [\"id\", \"name\", \"aria-invalid\", \"aria-describedby\"] });\n  const cls = selectClasses({ className });\n  return (\n    <select ref={ref} className={cls || undefined} multiple={multiple} required={required} disabled={disabled} {...(value === undefined ? {} : { [rest.onChange ? \"value\" : \"defaultValue\"]: multiple ? [value] : value })} {...rest}>\n      {(options ?? []).map((item, index) => (\n        <option key={index} value={(item.value) ?? \"\"} disabled={item.disabled}>\n          {item.label}\n        </option>\n      ))}\n      {children}\n    </select>\n  );\n});\nSelect.displayName = \"Select\";\n\n/**\n * SelectOption renders a native option.\n */\nexport type SelectOptionProps = Omit<OptionHTMLAttributes<HTMLOptionElement>, \"className\" | \"children\" | \"selected\" | \"disabled\"> & {\n  selected?: boolean;\n  disabled?: boolean;\n  className?: string;\n  children?: ReactNode;\n};\n\nexport const SelectOption = forwardRef<HTMLOptionElement, SelectOptionProps>(function SelectOption(\n  { selected, disabled, className, children, ...rawRest },\n  ref\n) {\n  const rest = safeRest(rawRest);\n  return (\n    <option ref={ref} selected={selected} disabled={disabled} {...rest}>\n      {children}\n    </option>\n  );\n});\nSelectOption.displayName = \"SelectOption\";\n\n/**\n * SelectOptGroup renders a native optgroup around option children.\n */\nexport type SelectOptGroupProps = Omit<OptgroupHTMLAttributes<HTMLOptGroupElement>, \"className\" | \"children\" | \"disabled\"> & {\n  disabled?: boolean;\n  className?: string;\n  children?: ReactNode;\n};\n\nexport const SelectOptGroup = forwardRef<HTMLOptGroupElement, SelectOptGroupProps>(function SelectOptGroup(\n  { disabled, className, children, ...rawRest },\n  ref\n) {\n  const rest = safeRest(rawRest, { blank: [\"label\"] });\n  return (\n    <optgroup ref={ref} disabled={disabled} {...rest}>\n      {children}\n    </optgroup>\n  );\n});\nSelectOptGroup.displayName = \"SelectOptGroup\";\n",
      "path": "kit/ui/select/select.tsx",
      "target": "kit/ui/select/select.tsx"
    }
  ],
  "meta": {
    "category": "kit",
    "kind": "primitive",
    "tags": [
      "react",
      "primitive"
    ]
  },
  "name": "kit-select",
  "registryDependencies": [
    "utils"
  ],
  "runtime": "react",
  "title": "Kit Select",
  "type": "registry:ui"
}
