@alfadocs/ui-kit-debug 0.84.0 → 0.84.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"select-BW5ecXlX.js","sources":["../../src/components/select/select.agent.ts","../../src/components/select/select.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — Select. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { SelectHandle } from './select';\n\nexport const selectAgent: AgentAdapter<SelectHandle> = {\n id: 'select',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus open/close of the option list.\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.select.state.value',\n description:\n 'Currently selected option value, or empty string when none.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.select.state.isOpen',\n description: 'Whether the option list is open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the chosen option — reversible by selecting another value.\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: { type: 'string', description: 'Option value to select.' },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.setValue',\n description: 'Select the option with the given value.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.clear',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'select',\n description: 'Marks the Select trigger.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description:\n 'Stable opaque option value emitted on each rendered option.',\n },\n },\n};\n","import {\n forwardRef,\n useContext,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type MutableRefObject,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useAgentRegistration } from '../../agent';\nimport { selectAgent } from './select.agent';\n\n/** Agent-readiness curated handle for Select. */\nexport interface SelectHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n isOpen: () => boolean;\n}\nimport * as RadixSelect from '@radix-ui/react-select';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { groupOptions } from '../_shared/group-options';\nimport { useDirection } from '../_shared/use-direction';\n\nconst selectTriggerVariants = cva(\n [\n 'ds:group ds:inline-flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-input',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:data-[placeholder]:text-muted-foreground',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n tone: {\n default: '',\n error: 'ds:border-destructive ds:focus-visible:outline-destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst selectContentVariants = cva(\n [\n 'ds:z-[var(--z-dropdown)] ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst selectItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n 'ds:data-[highlighted]:bg-muted ds:data-[highlighted]:text-foreground',\n 'ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-10 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst selectLabelClasses = [\n 'ds:ps-8 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n 'ds:sticky ds:top-0 ds:bg-background',\n].join(' ');\n\nconst iconSizeByItemSize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\nconst itemIndicatorStartByItemSize = {\n sm: 'ds:start-2',\n md: 'ds:start-2',\n lg: 'ds:start-3',\n} as const;\n\nfunction composeRefs<T>(\n ...refs: Array<Ref<T> | undefined | null>\n): (node: T | null) => void {\n return (node: T | null) => {\n for (const r of refs) {\n if (!r) continue;\n if (typeof r === 'function') {\n r(node);\n } else {\n (r as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Compound sub-components — thin `forwardRef` wrappers over Radix parts.\n// ---------------------------------------------------------------------------\n\ntype SelectRootProps = ComponentPropsWithoutRef<typeof RadixSelect.Root>;\n\nconst SelectRoot = (props: SelectRootProps) => <RadixSelect.Root {...props} />;\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = ElementRef<typeof RadixSelect.Trigger>;\ntype SelectTriggerProps = ComponentPropsWithoutRef<typeof RadixSelect.Trigger> &\n VariantProps<typeof selectTriggerVariants>;\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ size, tone, className, children, ...props }, ref) => (\n <RadixSelect.Trigger\n ref={ref}\n className={selectTriggerVariants({ size, tone, className })}\n {...props}\n >\n {children}\n </RadixSelect.Trigger>\n ),\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof RadixSelect.Value>;\n\nconst SelectValue = forwardRef<\n ElementRef<typeof RadixSelect.Value>,\n SelectValueProps\n>((props, ref) => <RadixSelect.Value ref={ref} {...props} />);\nSelectValue.displayName = 'Select.Value';\n\ntype SelectContentProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Content\n> & {\n container?: HTMLElement | null;\n};\n\nconst SelectContent = forwardRef<\n ElementRef<typeof RadixSelect.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = 'popper',\n sideOffset = 4,\n container,\n ...props\n },\n ref,\n ) => (\n <RadixSelect.Portal container={container ?? undefined}>\n <RadixSelect.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n data-component=\"select-content\"\n className={selectContentVariants({ className })}\n {...props}\n >\n <RadixSelect.ScrollUpButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronUp aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollUpButton>\n {children}\n <RadixSelect.ScrollDownButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronDown aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollDownButton>\n </RadixSelect.Content>\n </RadixSelect.Portal>\n ),\n);\nSelectContent.displayName = 'Select.Content';\n\ntype SelectViewportProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Viewport\n>;\n\nconst SelectViewport = forwardRef<\n ElementRef<typeof RadixSelect.Viewport>,\n SelectViewportProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Viewport\n ref={ref}\n className={['ds:p-1', className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectViewport.displayName = 'Select.Viewport';\n\ntype SelectItemProps = ComponentPropsWithoutRef<typeof RadixSelect.Item> &\n VariantProps<typeof selectItemVariants> & {\n /** Optional leading visual rendered before the item text (e.g. a Flag). */\n startAdornment?: ReactNode;\n };\n\nconst SelectItem = forwardRef<\n ElementRef<typeof RadixSelect.Item>,\n SelectItemProps\n>(({ size = 'md', className, children, startAdornment, ...props }, ref) => {\n const indicatorStart = itemIndicatorStartByItemSize[size ?? 'md'];\n const iconSize = iconSizeByItemSize[size ?? 'md'];\n return (\n <RadixSelect.Item\n ref={ref}\n className={selectItemVariants({ size, className })}\n {...props}\n >\n <span\n className={`ds:absolute ${indicatorStart} ds:inline-flex ds:items-center ds:justify-center`}\n aria-hidden=\"true\"\n >\n <RadixSelect.ItemIndicator>\n <Check className={iconSize} />\n </RadixSelect.ItemIndicator>\n </span>\n {startAdornment ? (\n // Decorative by contract — accessible name comes from the item text.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)]\"\n >\n {startAdornment}\n </span>\n ) : null}\n <RadixSelect.ItemText>{children}</RadixSelect.ItemText>\n </RadixSelect.Item>\n );\n});\nSelectItem.displayName = 'Select.Item';\n\ntype SelectItemTextProps = ComponentPropsWithoutRef<\n typeof RadixSelect.ItemText\n>;\n\nconst SelectItemText = forwardRef<\n ElementRef<typeof RadixSelect.ItemText>,\n SelectItemTextProps\n>((props, ref) => <RadixSelect.ItemText ref={ref} {...props} />);\nSelectItemText.displayName = 'Select.ItemText';\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof RadixSelect.Group>;\n\nconst SelectGroup = forwardRef<\n ElementRef<typeof RadixSelect.Group>,\n SelectGroupProps\n>((props, ref) => <RadixSelect.Group ref={ref} {...props} />);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof RadixSelect.Label>;\n\nconst SelectLabel = forwardRef<\n ElementRef<typeof RadixSelect.Label>,\n SelectLabelProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Label\n ref={ref}\n className={[selectLabelClasses, className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Separator\n>;\n\nconst SelectSeparator = forwardRef<\n ElementRef<typeof RadixSelect.Separator>,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Separator\n ref={ref}\n className={['ds:my-1 ds:h-px ds:bg-border', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nSelectSeparator.displayName = 'Select.Separator';\n\n// ---------------------------------------------------------------------------\n// Convenience form — `<Select options={[{value, label, group?}]} />`.\n// ---------------------------------------------------------------------------\n\nexport type SelectOption<T extends string = string> = OptionShape<T>;\n\nexport interface SelectProps<T extends string = string> {\n options: SelectOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n 'aria-label'?: string;\n className?: string;\n /**\n * Portal target for the listbox. Defaults to `document.body`. Set this to a\n * parent overlay's content element (e.g. a Popover) when the Select is nested\n * inside one, so the listbox shares that stacking context and renders above\n * it instead of behind it (the global z-scale puts `--z-dropdown` below\n * `--z-popover`).\n */\n container?: HTMLElement | null;\n}\n\nconst SelectImpl = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n className,\n container,\n 'aria-label': ariaLabel,\n },\n ref,\n) {\n const { t } = useTranslation();\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [internalValue, setInternalValue] = useState<string>(\n value ?? defaultValue ?? '',\n );\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internalValue;\n\n const [openState, setOpenState] = useState<boolean>(false);\n const currentValueRef = useRef<string>(currentValue);\n currentValueRef.current = currentValue;\n\n const triggerId = id ?? (inFormField ? ctx.id : undefined);\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : false;\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : undefined;\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const composedTriggerRef = composeRefs(ref, triggerRef);\n const dir = useDirection(triggerRef);\n\n const emitValue = onValueChange as ((value: string) => void) | undefined;\n\n const handleValueChange = (next: string) => {\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n };\n\n const handleClear: React.MouseEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n event.stopPropagation();\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n triggerRef.current?.focus();\n };\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.select.placeholder', 'Select…');\n\n const showClear = clearable && !!currentValue && !effectiveDisabled;\n\n const groups = groupOptions(options);\n\n const agentHandle = useMemo<SelectHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (next) => {\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n },\n clear: () => {\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n },\n open: () => setOpenState(true),\n close: () => setOpenState(false),\n isOpen: () => openState,\n }),\n [emitValue, isControlled, openState],\n );\n useAgentRegistration(selectAgent, agentHandle, id);\n\n return (\n <RadixSelect.Root\n value={currentValue === '' ? undefined : currentValue}\n onValueChange={handleValueChange}\n open={openState}\n onOpenChange={setOpenState}\n disabled={effectiveDisabled}\n required={effectiveRequired}\n name={name}\n dir={dir}\n >\n <RadixSelect.Trigger\n ref={composedTriggerRef}\n id={triggerId}\n aria-label={\n ariaLabel ?? (!inFormField ? resolvedPlaceholder : undefined)\n }\n aria-labelledby={\n !ariaLabel && inFormField ? `${ctx.id}-label` : undefined\n }\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n data-component=\"select\"\n data-component-id={id}\n className={selectTriggerVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n >\n {/* min-w-0 lets the flex child shrink; truncate clips long values\n to one line with an ellipsis instead of wrapping the trigger. */}\n <span className=\"ds:min-w-0 ds:truncate ds:text-start\">\n <RadixSelect.Value placeholder={resolvedPlaceholder} />\n </span>\n <span className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.select.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.stopPropagation();\n }\n }}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4',\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n <RadixSelect.Icon asChild>\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n 'ds:size-4 ds:shrink-0 ds:text-muted-foreground',\n 'ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:group-data-[state=open]:rotate-180',\n ].join(' ')}\n />\n </RadixSelect.Icon>\n </span>\n </RadixSelect.Trigger>\n <SelectContent container={container}>\n <SelectViewport>\n {options.length === 0 ? (\n <div className=\"ds:ps-8 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground\">\n {t('inputs.select.noOptions', 'No options')}\n </div>\n ) : (\n groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n size={size}\n data-option-id={option.value}\n startAdornment={option.startAdornment}\n >\n {option.label}\n </SelectItem>\n ));\n if (!group) {\n return (\n <RadixSelect.Group key={`group-${groupIndex}`}>\n {body}\n </RadixSelect.Group>\n );\n }\n return (\n <RadixSelect.Group key={`group-${group}`}>\n <SelectLabel>{group}</SelectLabel>\n {body}\n </RadixSelect.Group>\n );\n })\n )}\n </SelectViewport>\n </SelectContent>\n </RadixSelect.Root>\n );\n});\nSelectImpl.displayName = 'Select';\n\ninterface SelectComponent {\n <T extends string = string>(\n props: SelectProps<T> & { ref?: Ref<HTMLButtonElement> },\n ): ReactElement | null;\n displayName?: string;\n Root: typeof SelectRoot;\n Trigger: typeof SelectTrigger;\n Value: typeof SelectValue;\n Content: typeof SelectContent;\n Viewport: typeof SelectViewport;\n Item: typeof SelectItem;\n ItemText: typeof SelectItemText;\n Group: typeof SelectGroup;\n Label: typeof SelectLabel;\n Separator: typeof SelectSeparator;\n}\n\nconst SelectWithStatics = Object.assign(SelectImpl, {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Content: SelectContent,\n Viewport: SelectViewport,\n Item: SelectItem,\n ItemText: SelectItemText,\n Group: SelectGroup,\n Label: SelectLabel,\n Separator: SelectSeparator,\n}) as unknown as SelectComponent;\n\nexport const Select = SelectWithStatics;\n\nexport {\n SelectRoot,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectViewport,\n SelectItem,\n SelectItemText,\n SelectGroup,\n SelectLabel,\n SelectSeparator,\n};\n\nexport { selectTriggerVariants, selectContentVariants, selectItemVariants };\n\nexport type {\n SelectTriggerProps,\n SelectContentProps,\n SelectItemProps,\n SelectLabelProps,\n SelectRootProps,\n};\n\nexport type { ReactNode };\n"],"names":["selectAgent","handle","args","selectTriggerVariants","cva","selectContentVariants","selectItemVariants","selectLabelClasses","iconSizeByItemSize","itemIndicatorStartByItemSize","composeRefs","refs","node","r","SelectRoot","props","jsx","RadixSelect","SelectTrigger","forwardRef","size","tone","className","children","ref","SelectValue","SelectContent","position","sideOffset","container","jsxs","ChevronUp","ChevronDown","SelectViewport","SelectItem","startAdornment","indicatorStart","iconSize","Check","SelectItemText","SelectGroup","SelectLabel","SelectSeparator","SelectImpl","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","required","name","id","ariaLabel","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","internalValue","setInternalValue","useState","isControlled","currentValue","openState","setOpenState","currentValueRef","useRef","triggerId","effectiveDisabled","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","triggerRef","composedTriggerRef","dir","useDirection","emitValue","handleValueChange","next","handleClear","event","_a","resolvedPlaceholder","showClear","groups","groupOptions","agentHandle","useMemo","useAgentRegistration","X","group","items","groupIndex","body","option","SelectWithStatics","Select"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,KAA0C;AAAA,EACrD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,EAClC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA;AAAA,MAET,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO,EAAE,MAAM,UAAU,aAAa,0BAAA;AAAA,QAA0B;AAAA,QAElE,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,QAAQ,MAAM,2BAA2B;AAAA,MACrE,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA;AAAA,MAEL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aA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AMyD,KAAoB,OAAO,OAAOzD,GAAY;AAAA,EAClD,MAAM7B;AAAA,EACN,SAASI;AAAA,EACT,OAAOO;AAAA,EACP,SAASC;AAAA,EACT,UAAUO;AAAA,EACV,MAAMC;AAAA,EACN,UAAUK;AAAA,EACV,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,WAAWC;AACb,CAAC,GAEY2D,KAASD;"}
1
+ {"version":3,"file":"select-BW5ecXlX.js","sources":["../../src/components/select/select.agent.ts","../../src/components/select/select.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — Select. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { SelectHandle } from './select';\n\nexport const selectAgent: AgentAdapter<SelectHandle> = {\n id: 'select',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus open/close of the option list.\n capabilities: ['select_single', 'set_value', 'open', 'close'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.select.state.value',\n description:\n 'Currently selected option value, or empty string when none.',\n read: (handle) => handle.getValue(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.select.state.isOpen',\n description: 'Whether the option list is open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the chosen option — reversible by selecting another value.\n safety: 'write',\n argsType: '{ value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n value: { type: 'string', description: 'Option value to select.' },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.setValue',\n description: 'Select the option with the given value.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.clear',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.select.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'select',\n description: 'Marks the Select trigger.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description:\n 'Stable opaque option value emitted on each rendered option.',\n },\n },\n};\n","import {\n forwardRef,\n useContext,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ElementRef,\n type MutableRefObject,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { useAgentRegistration } from '../../agent';\nimport { selectAgent } from './select.agent';\n\n/** Agent-readiness curated handle for Select. */\nexport interface SelectHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n isOpen: () => boolean;\n}\nimport * as RadixSelect from '@radix-ui/react-select';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, ChevronDown, ChevronUp, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { groupOptions } from '../_shared/group-options';\nimport { useDirection } from '../_shared/use-direction';\n\nconst selectTriggerVariants = cva(\n [\n 'ds:group ds:inline-flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:w-full',\n 'ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-input',\n 'ds:shadow-[var(--shadow-input)]',\n 'ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:data-[placeholder]:text-muted-foreground',\n 'ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n tone: {\n default: '',\n error: 'ds:border-destructive ds:focus-visible:outline-destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst selectContentVariants = cva(\n [\n 'ds:z-[var(--z-dropdown)] ds:overflow-hidden',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst selectItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n 'ds:data-[highlighted]:bg-muted ds:data-[highlighted]:text-foreground',\n 'ds:data-[disabled]:pointer-events-none ds:data-[disabled]:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-8 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-10 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst selectLabelClasses = [\n 'ds:ps-8 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n 'ds:sticky ds:top-0 ds:bg-background',\n].join(' ');\n\nconst iconSizeByItemSize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\nconst itemIndicatorStartByItemSize = {\n sm: 'ds:start-2',\n md: 'ds:start-2',\n lg: 'ds:start-3',\n} as const;\n\nfunction composeRefs<T>(\n ...refs: Array<Ref<T> | undefined | null>\n): (node: T | null) => void {\n return (node: T | null) => {\n for (const r of refs) {\n if (!r) continue;\n if (typeof r === 'function') {\n r(node);\n } else {\n (r as MutableRefObject<T | null>).current = node;\n }\n }\n };\n}\n\n// ---------------------------------------------------------------------------\n// Compound sub-components — thin `forwardRef` wrappers over Radix parts.\n// ---------------------------------------------------------------------------\n\ntype SelectRootProps = ComponentPropsWithoutRef<typeof RadixSelect.Root>;\n\nconst SelectRoot = (props: SelectRootProps) => <RadixSelect.Root {...props} />;\nSelectRoot.displayName = 'Select.Root';\n\ntype SelectTriggerElement = ElementRef<typeof RadixSelect.Trigger>;\ntype SelectTriggerProps = ComponentPropsWithoutRef<typeof RadixSelect.Trigger> &\n VariantProps<typeof selectTriggerVariants>;\n\nconst SelectTrigger = forwardRef<SelectTriggerElement, SelectTriggerProps>(\n ({ size, tone, className, children, ...props }, ref) => (\n <RadixSelect.Trigger\n ref={ref}\n className={selectTriggerVariants({ size, tone, className })}\n {...props}\n >\n {children}\n </RadixSelect.Trigger>\n ),\n);\nSelectTrigger.displayName = 'Select.Trigger';\n\ntype SelectValueProps = ComponentPropsWithoutRef<typeof RadixSelect.Value>;\n\nconst SelectValue = forwardRef<\n ElementRef<typeof RadixSelect.Value>,\n SelectValueProps\n>((props, ref) => <RadixSelect.Value ref={ref} {...props} />);\nSelectValue.displayName = 'Select.Value';\n\ntype SelectContentProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Content\n> & {\n container?: HTMLElement | null;\n};\n\nconst SelectContent = forwardRef<\n ElementRef<typeof RadixSelect.Content>,\n SelectContentProps\n>(\n (\n {\n className,\n children,\n position = 'popper',\n sideOffset = 4,\n container,\n ...props\n },\n ref,\n ) => (\n <RadixSelect.Portal container={container ?? undefined}>\n <RadixSelect.Content\n ref={ref}\n position={position}\n sideOffset={sideOffset}\n data-component=\"select-content\"\n className={selectContentVariants({ className })}\n {...props}\n >\n <RadixSelect.ScrollUpButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronUp aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollUpButton>\n {children}\n <RadixSelect.ScrollDownButton className=\"ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default\">\n <ChevronDown aria-hidden=\"true\" className=\"ds:size-4\" />\n </RadixSelect.ScrollDownButton>\n </RadixSelect.Content>\n </RadixSelect.Portal>\n ),\n);\nSelectContent.displayName = 'Select.Content';\n\ntype SelectViewportProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Viewport\n>;\n\nconst SelectViewport = forwardRef<\n ElementRef<typeof RadixSelect.Viewport>,\n SelectViewportProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Viewport\n ref={ref}\n className={['ds:p-1', className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectViewport.displayName = 'Select.Viewport';\n\ntype SelectItemProps = ComponentPropsWithoutRef<typeof RadixSelect.Item> &\n VariantProps<typeof selectItemVariants> & {\n /** Optional leading visual rendered before the item text (e.g. a Flag). */\n startAdornment?: ReactNode;\n };\n\nconst SelectItem = forwardRef<\n ElementRef<typeof RadixSelect.Item>,\n SelectItemProps\n>(({ size = 'md', className, children, startAdornment, ...props }, ref) => {\n const indicatorStart = itemIndicatorStartByItemSize[size ?? 'md'];\n const iconSize = iconSizeByItemSize[size ?? 'md'];\n return (\n <RadixSelect.Item\n ref={ref}\n className={selectItemVariants({ size, className })}\n {...props}\n >\n <span\n className={`ds:absolute ${indicatorStart} ds:inline-flex ds:items-center ds:justify-center`}\n aria-hidden=\"true\"\n >\n <RadixSelect.ItemIndicator>\n <Check className={iconSize} />\n </RadixSelect.ItemIndicator>\n </span>\n {startAdornment ? (\n // Decorative by contract — accessible name comes from the item text.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0 ds:me-[var(--spacing-xs)]\"\n >\n {startAdornment}\n </span>\n ) : null}\n <RadixSelect.ItemText>{children}</RadixSelect.ItemText>\n </RadixSelect.Item>\n );\n});\nSelectItem.displayName = 'Select.Item';\n\ntype SelectItemTextProps = ComponentPropsWithoutRef<\n typeof RadixSelect.ItemText\n>;\n\nconst SelectItemText = forwardRef<\n ElementRef<typeof RadixSelect.ItemText>,\n SelectItemTextProps\n>((props, ref) => <RadixSelect.ItemText ref={ref} {...props} />);\nSelectItemText.displayName = 'Select.ItemText';\n\ntype SelectGroupProps = ComponentPropsWithoutRef<typeof RadixSelect.Group>;\n\nconst SelectGroup = forwardRef<\n ElementRef<typeof RadixSelect.Group>,\n SelectGroupProps\n>((props, ref) => <RadixSelect.Group ref={ref} {...props} />);\nSelectGroup.displayName = 'Select.Group';\n\ntype SelectLabelProps = ComponentPropsWithoutRef<typeof RadixSelect.Label>;\n\nconst SelectLabel = forwardRef<\n ElementRef<typeof RadixSelect.Label>,\n SelectLabelProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Label\n ref={ref}\n className={[selectLabelClasses, className].filter(Boolean).join(' ')}\n {...props}\n />\n));\nSelectLabel.displayName = 'Select.Label';\n\ntype SelectSeparatorProps = ComponentPropsWithoutRef<\n typeof RadixSelect.Separator\n>;\n\nconst SelectSeparator = forwardRef<\n ElementRef<typeof RadixSelect.Separator>,\n SelectSeparatorProps\n>(({ className, ...props }, ref) => (\n <RadixSelect.Separator\n ref={ref}\n className={['ds:my-1 ds:h-px ds:bg-border', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nSelectSeparator.displayName = 'Select.Separator';\n\n// ---------------------------------------------------------------------------\n// Convenience form — `<Select options={[{value, label, group?}]} />`.\n// ---------------------------------------------------------------------------\n\nexport type SelectOption<T extends string = string> = OptionShape<T>;\n\nexport interface SelectProps<T extends string = string> {\n options: SelectOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n 'aria-label'?: string;\n className?: string;\n /**\n * Portal target for the listbox. Defaults to `document.body`, which is\n * almost always correct.\n *\n * You do not need this to fix stacking. `--z-dropdown` and `--z-popover`\n * are one layer, so a Select nested inside a Popover already paints over it\n * by portal order (the listbox mounts last). Only pass a container when the\n * listbox must live inside a specific subtree — e.g. a shadow root, or a\n * scroll container that would otherwise clip it.\n */\n container?: HTMLElement | null;\n}\n\nconst SelectImpl = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n className,\n container,\n 'aria-label': ariaLabel,\n },\n ref,\n) {\n const { t } = useTranslation();\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [internalValue, setInternalValue] = useState<string>(\n value ?? defaultValue ?? '',\n );\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internalValue;\n\n const [openState, setOpenState] = useState<boolean>(false);\n const currentValueRef = useRef<string>(currentValue);\n currentValueRef.current = currentValue;\n\n const triggerId = id ?? (inFormField ? ctx.id : undefined);\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : false;\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : undefined;\n\n const triggerRef = useRef<HTMLButtonElement>(null);\n const composedTriggerRef = composeRefs(ref, triggerRef);\n const dir = useDirection(triggerRef);\n\n const emitValue = onValueChange as ((value: string) => void) | undefined;\n\n const handleValueChange = (next: string) => {\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n };\n\n const handleClear: React.MouseEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n event.stopPropagation();\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n triggerRef.current?.focus();\n };\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.select.placeholder', 'Select…');\n\n const showClear = clearable && !!currentValue && !effectiveDisabled;\n\n const groups = groupOptions(options);\n\n const agentHandle = useMemo<SelectHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (next) => {\n if (!isControlled) setInternalValue(next);\n emitValue?.(next);\n },\n clear: () => {\n if (!isControlled) setInternalValue('');\n emitValue?.('');\n },\n open: () => setOpenState(true),\n close: () => setOpenState(false),\n isOpen: () => openState,\n }),\n [emitValue, isControlled, openState],\n );\n useAgentRegistration(selectAgent, agentHandle, id);\n\n return (\n <RadixSelect.Root\n value={currentValue === '' ? undefined : currentValue}\n onValueChange={handleValueChange}\n open={openState}\n onOpenChange={setOpenState}\n disabled={effectiveDisabled}\n required={effectiveRequired}\n name={name}\n dir={dir}\n >\n <RadixSelect.Trigger\n ref={composedTriggerRef}\n id={triggerId}\n aria-label={\n ariaLabel ?? (!inFormField ? resolvedPlaceholder : undefined)\n }\n aria-labelledby={\n !ariaLabel && inFormField ? `${ctx.id}-label` : undefined\n }\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n data-component=\"select\"\n data-component-id={id}\n className={selectTriggerVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n >\n {/* min-w-0 lets the flex child shrink; truncate clips long values\n to one line with an ellipsis instead of wrapping the trigger. */}\n <span className=\"ds:min-w-0 ds:truncate ds:text-start\">\n <RadixSelect.Value placeholder={resolvedPlaceholder} />\n </span>\n <span className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.select.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.stopPropagation();\n }\n }}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4',\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n <RadixSelect.Icon asChild>\n <ChevronDown\n aria-hidden=\"true\"\n className={[\n 'ds:size-4 ds:shrink-0 ds:text-muted-foreground',\n 'ds:transition-transform ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:group-data-[state=open]:rotate-180',\n ].join(' ')}\n />\n </RadixSelect.Icon>\n </span>\n </RadixSelect.Trigger>\n <SelectContent container={container}>\n <SelectViewport>\n {options.length === 0 ? (\n <div className=\"ds:ps-8 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground\">\n {t('inputs.select.noOptions', 'No options')}\n </div>\n ) : (\n groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => (\n <SelectItem\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n size={size}\n data-option-id={option.value}\n startAdornment={option.startAdornment}\n >\n {option.label}\n </SelectItem>\n ));\n if (!group) {\n return (\n <RadixSelect.Group key={`group-${groupIndex}`}>\n {body}\n </RadixSelect.Group>\n );\n }\n return (\n <RadixSelect.Group key={`group-${group}`}>\n <SelectLabel>{group}</SelectLabel>\n {body}\n </RadixSelect.Group>\n );\n })\n )}\n </SelectViewport>\n </SelectContent>\n </RadixSelect.Root>\n );\n});\nSelectImpl.displayName = 'Select';\n\ninterface SelectComponent {\n <T extends string = string>(\n props: SelectProps<T> & { ref?: Ref<HTMLButtonElement> },\n ): ReactElement | null;\n displayName?: string;\n Root: typeof SelectRoot;\n Trigger: typeof SelectTrigger;\n Value: typeof SelectValue;\n Content: typeof SelectContent;\n Viewport: typeof SelectViewport;\n Item: typeof SelectItem;\n ItemText: typeof SelectItemText;\n Group: typeof SelectGroup;\n Label: typeof SelectLabel;\n Separator: typeof SelectSeparator;\n}\n\nconst SelectWithStatics = Object.assign(SelectImpl, {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Content: SelectContent,\n Viewport: SelectViewport,\n Item: SelectItem,\n ItemText: SelectItemText,\n Group: SelectGroup,\n Label: SelectLabel,\n Separator: SelectSeparator,\n}) as unknown as SelectComponent;\n\nexport const Select = SelectWithStatics;\n\nexport {\n SelectRoot,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectViewport,\n SelectItem,\n SelectItemText,\n SelectGroup,\n SelectLabel,\n SelectSeparator,\n};\n\nexport { selectTriggerVariants, selectContentVariants, selectItemVariants };\n\nexport type {\n SelectTriggerProps,\n SelectContentProps,\n SelectItemProps,\n SelectLabelProps,\n SelectRootProps,\n};\n\nexport type { ReactNode };\n"],"names":["selectAgent","handle","args","selectTriggerVariants","cva","selectContentVariants","selectItemVariants","selectLabelClasses","iconSizeByItemSize","itemIndicatorStartByItemSize","composeRefs","refs","node","r","SelectRoot","props","jsx","RadixSelect","SelectTrigger","forwardRef","size","tone","className","children","ref","SelectValue","SelectContent","position","sideOffset","container","jsxs","ChevronUp","ChevronDown","SelectViewport","SelectItem","startAdornment","indicatorStart","iconSize","Check","SelectItemText","SelectGroup","SelectLabel","SelectSeparator","SelectImpl","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","required","name","id","ariaLabel","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","internalValue","setInternalValue","useState","isControlled","currentValue","openState","setOpenState","currentValueRef","useRef","triggerId","effectiveDisabled","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","triggerRef","composedTriggerRef","dir","useDirection","emitValue","handleValueChange","next","handleClear","event","_a","resolvedPlaceholder","showClear","groups","groupOptions","agentHandle","useMemo","useAgentRegistration","X","group","items","groupIndex","body","option","SelectWithStatics","Select"],"mappings":";;;;;;;;;;;;;AASO,MAAMA,KAA0C;AAAA,EACrD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,QAAQ,OAAO;AAAA,EAC5D,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,EAClC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA;AAAA,MAET,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,OAAO,EAAE,MAAM,UAAU,aAAa,0BAAA;AAAA,QAA0B;AAAA,QAElE,UAAU,CAAC,OAAO;AAAA,MAAA;AAAA,MAEpB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU,CAAC,EAAE,MAAM,EAAE,OAAO,QAAQ,MAAM,2BAA2B;AAAA,MACrE,QAAQ,CAACA,GAAQC,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