"use client"; import * as SelectPrimitive from "@radix-ui/react-select"; import { Check, ChevronDown } from "lucide-react"; import * as React from "react"; import { cn } from "~/utils/cn"; const sizes = { "secondary/small": "text-xs h-6 bg-tertiary border border-tertiary group-hover:text-text-bright hover:border-border-bright pr-2 pl-1.5", medium: "text-sm h-8 bg-tertiary border border-tertiary hover:border-border-bright px-2.5", minimal: "text-xs h-6 bg-transparent hover:bg-tertiary pl-1.5 pr-2", }; export type SelectProps = { size?: keyof typeof sizes; width?: "content" | "full"; }; const Select = SelectPrimitive.Root; const SelectGroup = SelectPrimitive.Group; const SelectValue = SelectPrimitive.Value; const SelectTrigger = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & SelectProps >(({ className, children, width = "content", size = "secondary/small", ...props }, ref) => { const sizeClassName = sizes[size]; return ( {children} ); }); SelectTrigger.displayName = SelectPrimitive.Trigger.displayName; const SelectContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, children, position = "popper", ...props }, ref) => ( {children} )); SelectContent.displayName = SelectPrimitive.Content.displayName; const SelectLabel = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SelectLabel.displayName = SelectPrimitive.Label.displayName; type SelectItemProps = React.ComponentPropsWithoutRef & { contentClassName?: string; }; const SelectItem = React.forwardRef, SelectItemProps>( ({ className, children, contentClassName, ...props }, ref) => ( {children} ) ); SelectItem.displayName = SelectPrimitive.Item.displayName; const SelectSeparator = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); SelectSeparator.displayName = SelectPrimitive.Separator.displayName; export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, };