{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "select",
  "type": "registry:ui",
  "title": "Select",
  "description": "A themed dropdown for choosing one value from a list, with groups, labels and separators. Never a native select.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "class-variance-authority",
    "lucide-react",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/select.tsx",
      "type": "registry:ui",
      "target": "components/ui/select.tsx",
      "content": "\"use client\";\n/**\n * @name select\n * @category ui\n * @description A themed dropdown for choosing one value from a list, with groups, labels and separators. Never a native select.\n * @when Picking one of more than about five options, or when space is tight. For two to five visible options use radio-group; for a short row of icons use toggle-group.\n * @example\n * <Select defaultValue=\"eur\">\n *   <SelectTrigger aria-label=\"Currency\" className=\"w-48\">\n *     <SelectValue placeholder=\"Currency\" />\n *   </SelectTrigger>\n *   <SelectContent>\n *     <SelectGroup>\n *       <SelectLabel>Europe</SelectLabel>\n *       <SelectItem value=\"eur\">Euro</SelectItem>\n *       <SelectItem value=\"sek\">Swedish krona</SelectItem>\n *     </SelectGroup>\n *     <SelectSeparator />\n *     <SelectGroup>\n *       <SelectLabel>Americas</SelectLabel>\n *       <SelectItem value=\"usd\">US dollar</SelectItem>\n *       <SelectItem value=\"cad\" disabled>Canadian dollar</SelectItem>\n *     </SelectGroup>\n *   </SelectContent>\n * </Select>\n */\nimport { Select as SelectPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\n/** Holds the value. Takes `value`/`defaultValue`/`onValueChange`, `name` for forms, `disabled`, `required`. */\nexport function Select(props: ComponentProps<typeof SelectPrimitive.Root>) {\n  return <SelectPrimitive.Root {...props} />;\n}\n\nexport function SelectGroup({ className, ...props }: ComponentProps<typeof SelectPrimitive.Group>) {\n  return <SelectPrimitive.Group data-slot=\"select-group\" className={cn(\"flex flex-col\", className)} {...props} />;\n}\n\n/** Shows the chosen item's text, or `placeholder` when nothing is chosen. */\nexport function SelectValue({ className, ...props }: ComponentProps<typeof SelectPrimitive.Value>) {\n  return <SelectPrimitive.Value data-slot=\"select-value\" className={cn(\"min-w-0 truncate\", className)} {...props} />;\n}\n\nexport const selectTriggerVariants = cva(\n  \"flex w-full min-w-0 items-center justify-between gap-2 rounded-control border border-input bg-background text-start text-sm whitespace-nowrap text-foreground transition-[border-color,opacity] duration-instant ease-out select-none disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive data-[placeholder]:text-muted-foreground motion-reduce:transition-none\",\n  {\n    variants: {\n      size: {\n        sm: \"h-control-sm px-2.5\",\n        md: \"h-control px-3\",\n        lg: \"h-control-lg px-4 text-base\",\n      },\n    },\n    defaultVariants: { size: \"md\" },\n  },\n);\n\nexport type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger> & VariantProps<typeof selectTriggerVariants>;\n\nexport function SelectTrigger({ className, size, children, ...props }: SelectTriggerProps) {\n  return (\n    <SelectPrimitive.Trigger data-slot=\"select-trigger\" className={cn(selectTriggerVariants({ size }), className)} {...props}>\n      {children}\n      <SelectPrimitive.Icon asChild>\n        <ChevronDown aria-hidden=\"true\" strokeWidth={1.5} className=\"size-4 shrink-0 text-muted-foreground\" />\n      </SelectPrimitive.Icon>\n    </SelectPrimitive.Trigger>\n  );\n}\n\nconst scrollButton = \"flex h-6 cursor-default items-center justify-center text-muted-foreground\";\n\n/** The list. `position=\"popper\"` (default) opens below the trigger at its width; \"item-aligned\" covers the trigger. */\nexport function SelectContent({ className, children, position = \"popper\", sideOffset = 4, ...props }: ComponentProps<typeof SelectPrimitive.Content>) {\n  return (\n    <SelectPrimitive.Portal>\n      <SelectPrimitive.Content\n        data-slot=\"select-content\"\n        position={position}\n        sideOffset={sideOffset}\n        className={cn(\n          \"relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-hidden rounded-surface border bg-popover text-popover-foreground animation-duration-[var(--duration-base)] ease-out data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 motion-reduce:animate-none\",\n          className,\n        )}\n        {...props}\n      >\n        <SelectPrimitive.ScrollUpButton data-slot=\"select-scroll-up\" className={scrollButton}>\n          <ChevronUp aria-hidden=\"true\" strokeWidth={1.5} className=\"size-4\" />\n        </SelectPrimitive.ScrollUpButton>\n        <SelectPrimitive.Viewport\n          className={cn(\"p-1\", position === \"popper\" && \"w-full min-w-(--radix-select-trigger-width) scroll-my-1\")}\n        >\n          {children}\n        </SelectPrimitive.Viewport>\n        <SelectPrimitive.ScrollDownButton data-slot=\"select-scroll-down\" className={scrollButton}>\n          <ChevronDown aria-hidden=\"true\" strokeWidth={1.5} className=\"size-4\" />\n        </SelectPrimitive.ScrollDownButton>\n      </SelectPrimitive.Content>\n    </SelectPrimitive.Portal>\n  );\n}\n\n/** A heading inside a SelectGroup. */\nexport function SelectLabel({ className, ...props }: ComponentProps<typeof SelectPrimitive.Label>) {\n  return <SelectPrimitive.Label data-slot=\"select-label\" className={cn(\"px-2 py-1.5 text-xs font-medium text-muted-foreground\", className)} {...props} />;\n}\n\n/** One option. The highlighted option is shown by its ground, which is its focus indicator. */\nexport function SelectItem({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>) {\n  return (\n    <SelectPrimitive.Item\n      data-slot=\"select-item\"\n      className={cn(\n        \"relative flex min-h-9 w-full cursor-default items-center rounded-control py-1.5 ps-2 pe-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground pointer-coarse:min-h-10\",\n        className,\n      )}\n      {...props}\n    >\n      <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n      <span className=\"absolute end-2 flex size-4 items-center justify-center\">\n        <SelectPrimitive.ItemIndicator>\n          <Check aria-hidden=\"true\" strokeWidth={1.5} className=\"size-4\" />\n        </SelectPrimitive.ItemIndicator>\n      </span>\n    </SelectPrimitive.Item>\n  );\n}\n\nexport function SelectSeparator({ className, ...props }: ComponentProps<typeof SelectPrimitive.Separator>) {\n  return <SelectPrimitive.Separator data-slot=\"select-separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props} />;\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "Picking one of more than about five options, or when space is tight. For two to five visible options use radio-group; for a short row of icons use toggle-group.",
    "example": "<Select defaultValue=\"eur\">\n  <SelectTrigger aria-label=\"Currency\" className=\"w-48\">\n    <SelectValue placeholder=\"Currency\" />\n  </SelectTrigger>\n  <SelectContent>\n    <SelectGroup>\n      <SelectLabel>Europe</SelectLabel>\n      <SelectItem value=\"eur\">Euro</SelectItem>\n      <SelectItem value=\"sek\">Swedish krona</SelectItem>\n    </SelectGroup>\n    <SelectSeparator />\n    <SelectGroup>\n      <SelectLabel>Americas</SelectLabel>\n      <SelectItem value=\"usd\">US dollar</SelectItem>\n      <SelectItem value=\"cad\" disabled>Canadian dollar</SelectItem>\n    </SelectGroup>\n  </SelectContent>\n</Select>",
    "client": true
  }
}
