{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"select","title":"Select","author":"brijr","description":"A dropdown for choosing one option, built on UI SDK.","dependencies":["@ui-sdk/react","@ui-sdk/core","cn","lucide-react"],"files":[{"path":"components/ui/select.tsx","content":"import * as React from \"react\"\nimport {\n  Select,\n  SelectContent as SelectContentPrimitive,\n  SelectGroup,\n  SelectGroupLabel as SelectGroupLabelPrimitive,\n  SelectItem as SelectItemPrimitive,\n  SelectItemIcon,\n  SelectItemIndicator,\n  SelectLabel as SelectLabelPrimitive,\n  SelectSeparator as SelectSeparatorPrimitive,\n  SelectTrigger as SelectTriggerPrimitive,\n  SelectValue,\n  SelectValueIcon,\n  type ListData,\n} from \"@ui-sdk/react/select\"\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\"\nimport { cn } from \"cn\"\n\nfunction SelectFieldLabel({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof SelectLabelPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <SelectLabelPrimitive\n      className={cn(\n        \"text-sm leading-snug font-medium select-none data-disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SelectTrigger({\n  className,\n  size = \"default\",\n  children,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof SelectTriggerPrimitive>,\n  \"className\" | \"children\"\n> & {\n  className?: string\n  children?: React.ReactNode\n  size?: \"sm\" | \"default\"\n}) {\n  return (\n    <SelectTriggerPrimitive\n      data-size={size}\n      className={cn(\n        \"relative flex w-fit max-w-full items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-3 py-1 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:ring-destructive/60 data-placeholder:text-muted-foreground data-readonly:bg-muted/50 data-[size=default]:h-9 data-[size=sm]:h-8 data-[size=sm]:px-2.5 *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:flex-1 *:data-[slot=select-value]:truncate *:data-[slot=select-value]:text-left dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:focus-visible:ring-destructive/70 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-1.25 pointer-coarse:data-[size=sm]:after:-inset-y-1.75 data-disabled:cursor-not-allowed data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <ChevronDownIcon aria-hidden=\"true\" className=\"size-4 opacity-50\" />\n    </SelectTriggerPrimitive>\n  )\n}\n\nfunction SelectContent({\n  className,\n  sideOffset = 4,\n  ...props\n}: Omit<React.ComponentProps<typeof SelectContentPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <SelectContentPrimitive\n      sideOffset={sideOffset}\n      className={cn(\n        \"max-h-(--available-height) min-w-[var(--anchor-width)] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1 text-popover-foreground shadow-(--elevation-popup) transition-[opacity,scale] duration-(--duration-popup) ease-(--easing-enter) outline-none data-ending-style:scale-95 data-ending-style:opacity-0 data-ending-style:duration-(--duration-popup-exit) data-starting-style:scale-95 data-starting-style:opacity-0 motion-reduce:transition-none\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction SelectLabel({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof SelectGroupLabelPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <SelectGroupLabelPrimitive\n      className={cn(\"px-2 py-1.5 text-xs text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\n/** The old name of `SelectLabel`, a group's label. */\nconst SelectGroupLabel = SelectLabel\n\nfunction SelectItem<T = string>({\n  className,\n  children,\n  ...props\n}: Omit<\n  React.ComponentProps<typeof SelectItemPrimitive<T>>,\n  \"className\" | \"children\"\n> & {\n  className?: string\n  children?: React.ReactNode\n}) {\n  return (\n    <SelectItemPrimitive<T>\n      className={cn(\n        \"relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-none select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground pointer-coarse:py-3 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n        className\n      )}\n      {...props}\n    >\n      {children}\n      <SelectItemIndicator className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n        <CheckIcon aria-hidden=\"true\" className=\"size-4\" />\n      </SelectItemIndicator>\n    </SelectItemPrimitive>\n  )\n}\n\nfunction SelectSeparator({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof SelectSeparatorPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <SelectSeparatorPrimitive\n      className={cn(\"pointer-events-none -mx-1 my-1 h-px bg-border\", className)}\n      {...props}\n    />\n  )\n}\n\nexport {\n  Select,\n  SelectFieldLabel,\n  SelectGroup,\n  SelectLabel,\n  SelectGroupLabel,\n  SelectValue,\n  SelectValueIcon,\n  SelectTrigger,\n  SelectContent,\n  SelectItem,\n  SelectItemIcon,\n  SelectSeparator,\n  type ListData,\n}\n","type":"registry:ui"}],"type":"registry:ui"}