@betterinternship/components 3.5.2 → 3.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -54,7 +54,9 @@ const SelectTrigger = React.forwardRef(({ className, children, onPointerDown, on
|
|
|
54
54
|
pressedRef.current = false;
|
|
55
55
|
if (fromLabel && !event.defaultPrevented && !open && !props.disabled)
|
|
56
56
|
setOpen(true);
|
|
57
|
-
}, className: cn(
|
|
57
|
+
}, className: cn(
|
|
58
|
+
// text-left: a <button> centres its text, which pushes a cut-off value right.
|
|
59
|
+
'group text-left bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue', fieldInteractionClassName, className), ...props, children: [children, jsx(SelectPrimitive.Icon, { asChild: true, children: jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none" }) })] }));
|
|
58
60
|
});
|
|
59
61
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
60
62
|
const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) => (jsx(SelectPrimitive.ScrollUpButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: jsx(ChevronUp, { className: "h-4 w-4" }) })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../src/components/select.tsx"],"sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport * as SelectPrimitive from '@radix-ui/react-select';\r\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\r\n\r\nimport { cn } from '@/utils';\r\nimport { fieldInteractionClassName } from '@/hooks/use-field-focus';\r\nimport { useMobile } from '@/hooks/use-mobile';\r\nimport { useMobileSheetViewport } from '@/hooks/use-mobile-sheet-viewport';\r\nimport { useFormField, useFormFieldControl } from './form-field';\r\n\r\nconst SelectContext = React.createContext({ open: false, setOpen: (_open: boolean) => {} });\r\n\r\nfunction Select({ open: controlledOpen, defaultOpen = false, onOpenChange, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = controlledOpen ?? internalOpen;\r\n const setOpen = (next: boolean) => {\r\n if (controlledOpen === undefined) setInternalOpen(next);\r\n onOpenChange?.(next);\r\n };\r\n\r\n return (\r\n <SelectContext.Provider value={{ open, setOpen }}>\r\n <SelectPrimitive.Root {...props} open={open} onOpenChange={setOpen}>\r\n {children}\r\n </SelectPrimitive.Root>\r\n </SelectContext.Provider>\r\n );\r\n}\r\n\r\nconst SelectGroup = SelectPrimitive.Group;\r\n\r\nconst SelectValue = SelectPrimitive.Value;\r\n\r\nconst SelectTrigger = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Trigger>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\r\n>(({ className, children, onPointerDown, onClick, ...ownProps }, ref) => {\r\n const props = useFormFieldControl(ownProps);\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n // Radix opens on a mouse press on the trigger itself, so a click that arrives\r\n // without one (from the field's label) would only focus it. Open it here.\r\n // A press on the trigger stops counting once anything else is pressed: when\r\n // Radix opens on the press, the release lands on the menu, not the trigger.\r\n const pressedRef = React.useRef(false);\r\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\r\n React.useEffect(() => {\r\n const onPointerDownAnywhere = (event: PointerEvent) => {\r\n if (!(event.target instanceof Node) || !triggerRef.current?.contains(event.target)) pressedRef.current = false;\r\n };\r\n document.addEventListener('pointerdown', onPointerDownAnywhere, true);\r\n return () => document.removeEventListener('pointerdown', onPointerDownAnywhere, true);\r\n }, []);\r\n return (\r\n <SelectPrimitive.Trigger\r\n ref={(node) => {\r\n triggerRef.current = node;\r\n if (typeof ref === 'function') ref(node);\r\n else if (ref) ref.current = node;\r\n }}\r\n onPointerDown={(event) => {\r\n pressedRef.current = true;\r\n onPointerDown?.(event);\r\n }}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n const fromLabel = !pressedRef.current;\r\n pressedRef.current = false;\r\n if (fromLabel && !event.defaultPrevented && !open && !props.disabled) setOpen(true);\r\n }}\r\n className={cn(\r\n 'group bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\r\n 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue',\r\n fieldInteractionClassName,\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <SelectPrimitive.Icon asChild>\r\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none\" />\r\n </SelectPrimitive.Icon>\r\n </SelectPrimitive.Trigger>\r\n );\r\n});\r\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\r\n\r\nconst SelectScrollUpButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollUpButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronUp className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollUpButton>\r\n));\r\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\r\n\r\nconst SelectScrollDownButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollDownButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollDownButton>\r\n));\r\nSelectScrollDownButton.displayName =\r\n SelectPrimitive.ScrollDownButton.displayName;\r\n\r\nconst SelectContent = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & { title?: string }\r\n>(({ className, children, position = 'popper', title: ownTitle, style, ...props }, ref) => {\r\n // The phone sheet's title: an explicit title, else the field's label.\r\n const title = ownTitle ?? useFormField()?.labelText ?? 'Choose an option';\r\n const mobile = useMobile();\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n const viewport = useMobileSheetViewport(open && mobile);\r\n\r\n return (\r\n <SelectPrimitive.Portal>\r\n <div\r\n className={mobile ? '[&>[data-radix-popper-content-wrapper]]:!fixed [&>[data-radix-popper-content-wrapper]]:!inset-x-0 [&>[data-radix-popper-content-wrapper]]:!top-auto [&>[data-radix-popper-content-wrapper]]:!bottom-[var(--select-sheet-bottom)] [&>[data-radix-popper-content-wrapper]]:!transform-none [&>[data-radix-popper-content-wrapper]]:!z-(--z-popover) [&>[data-radix-popper-content-wrapper]]:!min-w-0' : undefined}\r\n style={{ '--select-sheet-bottom': `${viewport?.bottom ?? 0}px` } as React.CSSProperties}\r\n >\r\n {mobile && open && (\r\n <div aria-hidden=\"true\" className=\"fixed inset-0 z-(--z-popover-overlay) bg-black/25 backdrop-blur-[1px]\" />\r\n )}\r\n <SelectPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n 'relative flex flex-col overflow-hidden border border-border bg-background text-sm text-foreground shadow-card duration-interactive ease-out-strong motion-reduce:animate-none',\r\n mobile\r\n ? 'w-full rounded-t-control-lg border-b-0 pb-[env(safe-area-inset-bottom)]'\r\n : 'z-(--z-popover) max-h-[400px] min-w-[8rem] rounded-control-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\r\n className,\r\n )}\r\n position={mobile ? 'popper' : position}\r\n sideOffset={4}\r\n style={{\r\n ...(mobile ? { maxHeight: viewport ? Math.min(viewport.height, 640) : '80dvh' } : {}),\r\n ...style,\r\n }}\r\n {...props}\r\n >\r\n {mobile && (\r\n <div role=\"presentation\" className=\"flex shrink-0 items-center justify-between gap-4 px-4 pb-3 pt-4\">\r\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\r\n <button\r\n type=\"button\"\r\n aria-label=\"Close options\"\r\n className=\"-mr-3 flex h-11 w-11 shrink-0 items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted\"\r\n onPointerDown={(event) => event.stopPropagation()}\r\n onClick={() => setOpen(false)}\r\n >\r\n <X className=\"h-5 w-5\" aria-hidden=\"true\" />\r\n </button>\r\n </div>\r\n )}\r\n {!mobile && <SelectScrollUpButton />}\r\n <SelectPrimitive.Viewport\r\n className={cn(\r\n 'flex min-h-0 flex-col gap-option-gap overflow-y-auto overscroll-contain p-option-inset',\r\n mobile ? 'w-full flex-1' : position === 'popper' && 'w-full min-w-[var(--radix-select-trigger-width)]',\r\n )}\r\n >\r\n {children}\r\n </SelectPrimitive.Viewport>\r\n {!mobile && <SelectScrollDownButton />}\r\n </SelectPrimitive.Content>\r\n </div>\r\n </SelectPrimitive.Portal>\r\n );\r\n});\r\nSelectContent.displayName = SelectPrimitive.Content.displayName;\r\n\r\nconst SelectLabel = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Label\r\n ref={ref}\r\n className={cn('px-option-x py-2 text-sm font-semibold text-foreground', className)}\r\n {...props}\r\n />\r\n));\r\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\r\n\r\nconst SelectItem = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\r\n>(({ className, children, ...props }, ref) => (\r\n <SelectPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n 'relative flex min-h-option-row w-full cursor-pointer items-center gap-2 rounded-control-sm px-option-x py-2 pr-9 text-sm text-muted-foreground outline-none select-none transition-colors duration-interactive ease-out-strong focus:bg-muted data-[state=checked]:bg-primary-tint data-[disabled]:pointer-events-none data-[disabled]:opacity-50 motion-reduce:transition-none max-md:min-h-12',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute right-option-x flex h-4 w-4 items-center justify-center\">\r\n <SelectPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </SelectPrimitive.ItemIndicator>\r\n </span>\r\n\r\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\r\n </SelectPrimitive.Item>\r\n));\r\nSelectItem.displayName = SelectPrimitive.Item.displayName;\r\n\r\nconst SelectSeparator = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Separator\r\n ref={ref}\r\n className={cn('bg-border h-px', className)}\r\n {...props}\r\n />\r\n));\r\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\r\n\r\nexport {\r\n Select,\r\n SelectGroup,\r\n SelectValue,\r\n SelectTrigger,\r\n SelectContent,\r\n SelectLabel,\r\n SelectItem,\r\n SelectSeparator,\r\n SelectScrollUpButton,\r\n SelectScrollDownButton,\r\n};\r\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;AAEA;AACE;AACA;AACA;;;AAEE;AACF;AAEA;AAOF;AAEA;AAEA;AAEA;AAIE;AACA;;;;;;;AAOA;AACE;AACE;AAAoF;AACtF;;AAEA;;;AAKE;;;AAEK;AAAS;AAChB;AAEE;AACA;AACF;AAEE;AACA;AACA;AACA;;AACF;AAeJ;AACA;AAEA;AAeA;AAEA;AAeA;AACE;AAEF;;;AAME;AACA;;AAGA;AAcQ;;AAOF;AACA;;AAgCR;AACA;AAEA;AAUA;AAEA;AAqBA;AAEA;AAUA;;"}
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../src/components/select.tsx"],"sourcesContent":["'use client';\r\n\r\nimport * as React from 'react';\r\nimport * as SelectPrimitive from '@radix-ui/react-select';\r\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\r\n\r\nimport { cn } from '@/utils';\r\nimport { fieldInteractionClassName } from '@/hooks/use-field-focus';\r\nimport { useMobile } from '@/hooks/use-mobile';\r\nimport { useMobileSheetViewport } from '@/hooks/use-mobile-sheet-viewport';\r\nimport { useFormField, useFormFieldControl } from './form-field';\r\n\r\nconst SelectContext = React.createContext({ open: false, setOpen: (_open: boolean) => {} });\r\n\r\nfunction Select({ open: controlledOpen, defaultOpen = false, onOpenChange, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\r\n const [internalOpen, setInternalOpen] = React.useState(defaultOpen);\r\n const open = controlledOpen ?? internalOpen;\r\n const setOpen = (next: boolean) => {\r\n if (controlledOpen === undefined) setInternalOpen(next);\r\n onOpenChange?.(next);\r\n };\r\n\r\n return (\r\n <SelectContext.Provider value={{ open, setOpen }}>\r\n <SelectPrimitive.Root {...props} open={open} onOpenChange={setOpen}>\r\n {children}\r\n </SelectPrimitive.Root>\r\n </SelectContext.Provider>\r\n );\r\n}\r\n\r\nconst SelectGroup = SelectPrimitive.Group;\r\n\r\nconst SelectValue = SelectPrimitive.Value;\r\n\r\nconst SelectTrigger = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Trigger>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\r\n>(({ className, children, onPointerDown, onClick, ...ownProps }, ref) => {\r\n const props = useFormFieldControl(ownProps);\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n // Radix opens on a mouse press on the trigger itself, so a click that arrives\r\n // without one (from the field's label) would only focus it. Open it here.\r\n // A press on the trigger stops counting once anything else is pressed: when\r\n // Radix opens on the press, the release lands on the menu, not the trigger.\r\n const pressedRef = React.useRef(false);\r\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\r\n React.useEffect(() => {\r\n const onPointerDownAnywhere = (event: PointerEvent) => {\r\n if (!(event.target instanceof Node) || !triggerRef.current?.contains(event.target)) pressedRef.current = false;\r\n };\r\n document.addEventListener('pointerdown', onPointerDownAnywhere, true);\r\n return () => document.removeEventListener('pointerdown', onPointerDownAnywhere, true);\r\n }, []);\r\n return (\r\n <SelectPrimitive.Trigger\r\n ref={(node) => {\r\n triggerRef.current = node;\r\n if (typeof ref === 'function') ref(node);\r\n else if (ref) ref.current = node;\r\n }}\r\n onPointerDown={(event) => {\r\n pressedRef.current = true;\r\n onPointerDown?.(event);\r\n }}\r\n onClick={(event) => {\r\n onClick?.(event);\r\n const fromLabel = !pressedRef.current;\r\n pressedRef.current = false;\r\n if (fromLabel && !event.defaultPrevented && !open && !props.disabled) setOpen(true);\r\n }}\r\n className={cn(\r\n // text-left: a <button> centres its text, which pushes a cut-off value right.\r\n 'group text-left bg-background text-foreground placeholder:text-muted-foreground/40 data-[placeholder]:text-muted-foreground/40 border-input enabled:hover:border-input-hover flex h-form-control min-h-form-control max-h-form-control w-full cursor-pointer items-center justify-between gap-2 rounded-control-lg border px-field-padding-x py-0 text-base font-normal outline-none aria-invalid:border-destructive disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1',\r\n 'focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-landing-blue',\r\n fieldInteractionClassName,\r\n className,\r\n )}\r\n {...props}\r\n >\r\n {children}\r\n <SelectPrimitive.Icon asChild>\r\n <ChevronDown className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-interactive ease-out-strong group-data-[state=open]:rotate-180 motion-reduce:transition-none\" />\r\n </SelectPrimitive.Icon>\r\n </SelectPrimitive.Trigger>\r\n );\r\n});\r\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\r\n\r\nconst SelectScrollUpButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollUpButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronUp className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollUpButton>\r\n));\r\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\r\n\r\nconst SelectScrollDownButton = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.ScrollDownButton\r\n ref={ref}\r\n className={cn(\r\n 'flex cursor-default items-center justify-center py-1',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </SelectPrimitive.ScrollDownButton>\r\n));\r\nSelectScrollDownButton.displayName =\r\n SelectPrimitive.ScrollDownButton.displayName;\r\n\r\nconst SelectContent = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & { title?: string }\r\n>(({ className, children, position = 'popper', title: ownTitle, style, ...props }, ref) => {\r\n // The phone sheet's title: an explicit title, else the field's label.\r\n const title = ownTitle ?? useFormField()?.labelText ?? 'Choose an option';\r\n const mobile = useMobile();\r\n const { open, setOpen } = React.useContext(SelectContext);\r\n const viewport = useMobileSheetViewport(open && mobile);\r\n\r\n return (\r\n <SelectPrimitive.Portal>\r\n <div\r\n className={mobile ? '[&>[data-radix-popper-content-wrapper]]:!fixed [&>[data-radix-popper-content-wrapper]]:!inset-x-0 [&>[data-radix-popper-content-wrapper]]:!top-auto [&>[data-radix-popper-content-wrapper]]:!bottom-[var(--select-sheet-bottom)] [&>[data-radix-popper-content-wrapper]]:!transform-none [&>[data-radix-popper-content-wrapper]]:!z-(--z-popover) [&>[data-radix-popper-content-wrapper]]:!min-w-0' : undefined}\r\n style={{ '--select-sheet-bottom': `${viewport?.bottom ?? 0}px` } as React.CSSProperties}\r\n >\r\n {mobile && open && (\r\n <div aria-hidden=\"true\" className=\"fixed inset-0 z-(--z-popover-overlay) bg-black/25 backdrop-blur-[1px]\" />\r\n )}\r\n <SelectPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n 'relative flex flex-col overflow-hidden border border-border bg-background text-sm text-foreground shadow-card duration-interactive ease-out-strong motion-reduce:animate-none',\r\n mobile\r\n ? 'w-full rounded-t-control-lg border-b-0 pb-[env(safe-area-inset-bottom)]'\r\n : 'z-(--z-popover) max-h-[400px] min-w-[8rem] rounded-control-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\r\n className,\r\n )}\r\n position={mobile ? 'popper' : position}\r\n sideOffset={4}\r\n style={{\r\n ...(mobile ? { maxHeight: viewport ? Math.min(viewport.height, 640) : '80dvh' } : {}),\r\n ...style,\r\n }}\r\n {...props}\r\n >\r\n {mobile && (\r\n <div role=\"presentation\" className=\"flex shrink-0 items-center justify-between gap-4 px-4 pb-3 pt-4\">\r\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\r\n <button\r\n type=\"button\"\r\n aria-label=\"Close options\"\r\n className=\"-mr-3 flex h-11 w-11 shrink-0 items-center justify-center rounded-control-lg text-muted-foreground hover:bg-muted\"\r\n onPointerDown={(event) => event.stopPropagation()}\r\n onClick={() => setOpen(false)}\r\n >\r\n <X className=\"h-5 w-5\" aria-hidden=\"true\" />\r\n </button>\r\n </div>\r\n )}\r\n {!mobile && <SelectScrollUpButton />}\r\n <SelectPrimitive.Viewport\r\n className={cn(\r\n 'flex min-h-0 flex-col gap-option-gap overflow-y-auto overscroll-contain p-option-inset',\r\n mobile ? 'w-full flex-1' : position === 'popper' && 'w-full min-w-[var(--radix-select-trigger-width)]',\r\n )}\r\n >\r\n {children}\r\n </SelectPrimitive.Viewport>\r\n {!mobile && <SelectScrollDownButton />}\r\n </SelectPrimitive.Content>\r\n </div>\r\n </SelectPrimitive.Portal>\r\n );\r\n});\r\nSelectContent.displayName = SelectPrimitive.Content.displayName;\r\n\r\nconst SelectLabel = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Label\r\n ref={ref}\r\n className={cn('px-option-x py-2 text-sm font-semibold text-foreground', className)}\r\n {...props}\r\n />\r\n));\r\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\r\n\r\nconst SelectItem = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\r\n>(({ className, children, ...props }, ref) => (\r\n <SelectPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n 'relative flex min-h-option-row w-full cursor-pointer items-center gap-2 rounded-control-sm px-option-x py-2 pr-9 text-sm text-muted-foreground outline-none select-none transition-colors duration-interactive ease-out-strong focus:bg-muted data-[state=checked]:bg-primary-tint data-[disabled]:pointer-events-none data-[disabled]:opacity-50 motion-reduce:transition-none max-md:min-h-12',\r\n className,\r\n )}\r\n {...props}\r\n >\r\n <span className=\"absolute right-option-x flex h-4 w-4 items-center justify-center\">\r\n <SelectPrimitive.ItemIndicator>\r\n <Check className=\"h-4 w-4\" />\r\n </SelectPrimitive.ItemIndicator>\r\n </span>\r\n\r\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\r\n </SelectPrimitive.Item>\r\n));\r\nSelectItem.displayName = SelectPrimitive.Item.displayName;\r\n\r\nconst SelectSeparator = React.forwardRef<\r\n React.ElementRef<typeof SelectPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\r\n>(({ className, ...props }, ref) => (\r\n <SelectPrimitive.Separator\r\n ref={ref}\r\n className={cn('bg-border h-px', className)}\r\n {...props}\r\n />\r\n));\r\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\r\n\r\nexport {\r\n Select,\r\n SelectGroup,\r\n SelectValue,\r\n SelectTrigger,\r\n SelectContent,\r\n SelectLabel,\r\n SelectItem,\r\n SelectSeparator,\r\n SelectScrollUpButton,\r\n SelectScrollDownButton,\r\n};\r\n"],"names":[],"mappings":";;;;;;;;;;;AAYA;AAEA;AACE;AACA;AACA;;;AAEE;AACF;AAEA;AAOF;AAEA;AAEA;AAEA;AAIE;AACA;;;;;;;AAOA;AACE;AACE;AAAoF;AACtF;;AAEA;;;AAKE;;;AAEK;AAAS;AAChB;AAEE;AACA;AACF;AAEE;AACA;AACA;AACA;;;;AAIA;AAaN;AACA;AAEA;AAeA;AAEA;AAeA;AACE;AAEF;;;AAME;AACA;;AAGA;AAcQ;;AAOF;AACA;;AAgCR;AACA;AAEA;AAUA;AAEA;AAqBA;AAEA;AAUA;;"}
|