{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "select",
  "dependencies": [
    "lucide-react",
    "react-aria-components"
  ],
  "registryDependencies": [
    "https://taki-ui.com/r/button.json",
    "https://taki-ui.com/r/field.json",
    "https://taki-ui.com/r/list-box.json",
    "https://taki-ui.com/r/popover.json",
    "https://taki-ui.com/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/select.tsx",
      "content": "\"use client\"\n\nimport React from \"react\"\nimport { ChevronDown } from \"lucide-react\"\nimport {\n  Select as AriaSelect,\n  SelectProps as AriaSelectProps,\n  composeRenderProps,\n  SelectValue,\n  ValidationResult,\n  type ListBoxItemProps,\n} from \"react-aria-components\"\n\nimport { cn } from \"../lib/utils\"\nimport { Button, ButtonProps } from \"./button\"\nimport { FieldDescription, FieldError, FieldLabel } from \"./field\"\nimport {\n  DropdownItem,\n  DropdownSection,\n  DropdownSectionProps,\n  ListBox,\n} from \"./list-box\"\nimport { Popover } from \"./popover\"\n\nexport interface SelectProps<T extends object>\n  extends Omit<AriaSelectProps<T>, \"children\"> {\n  label?: string\n  description?: string\n  errorMessage?: string | ((validation: ValidationResult) => string)\n  items?: Iterable<T>\n  children: React.ReactNode | ((item: T) => React.ReactNode)\n  size?: ButtonProps[\"size\"]\n  enableSearch?: boolean\n  filterBehavior?: \"contains\" | \"startsWith\"\n  variant?: ButtonProps[\"variant\"]\n}\n\nexport function SelectRoot<T extends object>(props: AriaSelectProps<T>) {\n  return (\n    <AriaSelect<T>\n      {...props}\n      className={composeRenderProps(props.className, (className) =>\n        cn(\"group relative flex flex-col gap-1\", className)\n      )}\n    >\n      {props.children}\n    </AriaSelect>\n  )\n}\n\nexport function Select<T extends object>({\n  label,\n  description,\n  errorMessage,\n  children,\n  items,\n  size = \"default\",\n  variant = \"outline\",\n  ...props\n}: SelectProps<T>) {\n  return (\n    <SelectRoot {...props}>\n      {label && <FieldLabel>{label}</FieldLabel>}\n      <Button\n        size={size}\n        variant={variant}\n        data-slot=\"select-trigger\"\n        className=\"text-start\"\n      >\n        <SelectValue\n          data-slot=\"select-value\"\n          className=\"placeholder-shown:text-muted-foreground flex-1 text-sm\"\n        >\n          {({ selectedText, defaultChildren }) =>\n            selectedText || defaultChildren\n          }\n        </SelectValue>\n        <ChevronDown aria-hidden />\n      </Button>\n      {description && <FieldDescription>{description}</FieldDescription>}\n      <FieldError>{errorMessage}</FieldError>\n      <Popover className=\"w-56 min-w-(--trigger-width)\">\n        <ListBox\n          items={items}\n          className=\"max-h-[inherit] overflow-auto border-none p-1 outline-hidden [clip-path:inset(0_0_0_0_round_.75rem)]\"\n        >\n          {children}\n        </ListBox>\n      </Popover>\n    </SelectRoot>\n  )\n}\n\nexport function SelectItem(props: ListBoxItemProps) {\n  return <DropdownItem {...props} />\n}\n\nexport function SelectSection<T extends object>(\n  props: DropdownSectionProps<T>\n) {\n  return <DropdownSection {...props} />\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}