@alfadocs/ui-kit-debug 0.17.0 → 0.17.2
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.
- package/dist/_chunks/{accordion-DOmxGEWU.js → accordion-CNcodXuO.js} +6 -6
- package/dist/_chunks/{accordion-DOmxGEWU.js.map → accordion-CNcodXuO.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-DEiQwIMn.js → ai-prompt-input-B-w5Rx3V.js} +184 -181
- package/dist/_chunks/ai-prompt-input-B-w5Rx3V.js.map +1 -0
- package/dist/_chunks/{alert-pgdXrEO5.js → alert-DBnawbmf.js} +64 -59
- package/dist/_chunks/alert-DBnawbmf.js.map +1 -0
- package/dist/_chunks/{audio-recorder-CRh4uyFL.js → audio-recorder-DNkQLW1G.js} +3 -3
- package/dist/_chunks/{audio-recorder-CRh4uyFL.js.map → audio-recorder-DNkQLW1G.js.map} +1 -1
- package/dist/_chunks/{autocomplete-mOg7WLOh.js → autocomplete-BxfabhZ8.js} +167 -164
- package/dist/_chunks/autocomplete-BxfabhZ8.js.map +1 -0
- package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js → balance-cell-renderer-DJB6WDPe.js} +2 -2
- package/dist/_chunks/{balance-cell-renderer-DWWtX-VM.js.map → balance-cell-renderer-DJB6WDPe.js.map} +1 -1
- package/dist/_chunks/{carousel.agent-OTn-kMQg.js → carousel.agent-Xuw9LPZN.js} +14 -7
- package/dist/_chunks/{carousel.agent-OTn-kMQg.js.map → carousel.agent-Xuw9LPZN.js.map} +1 -1
- package/dist/_chunks/{chat-input-UK-bXU7u.js → chat-input-B3XmFGDw.js} +123 -122
- package/dist/_chunks/chat-input-B3XmFGDw.js.map +1 -0
- package/dist/_chunks/checkbox-group-Bwmt1ovQ.js +213 -0
- package/dist/_chunks/checkbox-group-Bwmt1ovQ.js.map +1 -0
- package/dist/_chunks/{checkbox-D5EHnB14.js → checkbox-mwbrPZDY.js} +75 -70
- package/dist/_chunks/checkbox-mwbrPZDY.js.map +1 -0
- package/dist/_chunks/{collapsible-CuxUBoHJ.js → collapsible-hHiyZp0b.js} +61 -63
- package/dist/_chunks/collapsible-hHiyZp0b.js.map +1 -0
- package/dist/_chunks/{color-picker-BPfcByHH.js → color-picker-Bm-gzpsh.js} +2 -2
- package/dist/_chunks/{color-picker-BPfcByHH.js.map → color-picker-Bm-gzpsh.js.map} +1 -1
- package/dist/_chunks/{combobox-D5tWe0t_.js → combobox-Da9eq00i.js} +214 -211
- package/dist/_chunks/combobox-Da9eq00i.js.map +1 -0
- package/dist/_chunks/{copy-field-BCHAZ8QV.js → copy-field-BAF4mt9h.js} +95 -132
- package/dist/_chunks/copy-field-BAF4mt9h.js.map +1 -0
- package/dist/_chunks/{date-picker-BlhtBhPo.js → date-picker-BIoSLRly.js} +222 -219
- package/dist/_chunks/{date-picker-BlhtBhPo.js.map → date-picker-BIoSLRly.js.map} +1 -1
- package/dist/_chunks/{date-range-picker-C2hRu_Ke.js → date-range-picker-9gANFNG9.js} +81 -78
- package/dist/_chunks/date-range-picker-9gANFNG9.js.map +1 -0
- package/dist/_chunks/{date-time-picker-B67mPZmP.js → date-time-picker-DG7BiGdb.js} +98 -95
- package/dist/_chunks/date-time-picker-DG7BiGdb.js.map +1 -0
- package/dist/_chunks/{dialog-DRp6Dejy.js → dialog-DUomPCRS.js} +69 -71
- package/dist/_chunks/dialog-DUomPCRS.js.map +1 -0
- package/dist/_chunks/{dropdown-menu-dyV7gHh_.js → dropdown-menu-DZxwF23X.js} +108 -110
- package/dist/_chunks/dropdown-menu-DZxwF23X.js.map +1 -0
- package/dist/_chunks/{freemium-paywall-BTEiVkes.js → freemium-paywall-DXc7XlGE.js} +98 -97
- package/dist/_chunks/freemium-paywall-DXc7XlGE.js.map +1 -0
- package/dist/_chunks/{leo-sidebar-D3TuyH5_.js → leo-sidebar-DIsiTju3.js} +2 -2
- package/dist/_chunks/{leo-sidebar-D3TuyH5_.js.map → leo-sidebar-DIsiTju3.js.map} +1 -1
- package/dist/_chunks/{list-DcjV0m5B.js → list-BdvDctBz.js} +184 -180
- package/dist/_chunks/list-BdvDctBz.js.map +1 -0
- package/dist/_chunks/{message-tray-Fsend-du.js → message-tray-BNAS8al4.js} +111 -111
- package/dist/_chunks/message-tray-BNAS8al4.js.map +1 -0
- package/dist/_chunks/{multi-select-DooDzQIp.js → multi-select-CyspR5ZF.js} +157 -154
- package/dist/_chunks/multi-select-CyspR5ZF.js.map +1 -0
- package/dist/_chunks/{navigation-menu-DdufF-_4.js → navigation-menu-CyS1fBJ7.js} +85 -87
- package/dist/_chunks/navigation-menu-CyS1fBJ7.js.map +1 -0
- package/dist/_chunks/{notification-tray-C3dYdLAF.js → notification-tray-D_69dXFY.js} +114 -114
- package/dist/_chunks/notification-tray-D_69dXFY.js.map +1 -0
- package/dist/_chunks/{number-input-DH00o0DN.js → number-input-BZXu6bPY.js} +92 -89
- package/dist/_chunks/number-input-BZXu6bPY.js.map +1 -0
- package/dist/_chunks/{otp-input-BBXYvLx5.js → otp-input-BDF_iNpa.js} +92 -93
- package/dist/_chunks/otp-input-BDF_iNpa.js.map +1 -0
- package/dist/_chunks/{pagination-F1ei4khE.js → pagination-BWaXF7W0.js} +194 -211
- package/dist/_chunks/pagination-BWaXF7W0.js.map +1 -0
- package/dist/_chunks/{patient-shell-BE0CdPOJ.js → patient-shell-BOOaWZA9.js} +3 -3
- package/dist/_chunks/{patient-shell-BE0CdPOJ.js.map → patient-shell-BOOaWZA9.js.map} +1 -1
- package/dist/_chunks/{payment-form-CI77oIx1.js → payment-form-BjkuQeqR.js} +2 -2
- package/dist/_chunks/{payment-form-CI77oIx1.js.map → payment-form-BjkuQeqR.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-CnEJvmXC.js → pdf-viewer-BG_nsFT5.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CnEJvmXC.js.map → pdf-viewer-BG_nsFT5.js.map} +1 -1
- package/dist/_chunks/{public-header.agent-sDi9N9su.js → public-header.agent-BIBQzkeV.js} +7 -12
- package/dist/_chunks/public-header.agent-BIBQzkeV.js.map +1 -0
- package/dist/_chunks/{radio-group-Cz1a4QCA.js → radio-group-BHZOxrIK.js} +4 -4
- package/dist/_chunks/{radio-group-Cz1a4QCA.js.map → radio-group-BHZOxrIK.js.map} +1 -1
- package/dist/_chunks/{select-Ca6ibiDL.js → select-C92AT_OZ.js} +7 -7
- package/dist/_chunks/{select-Ca6ibiDL.js.map → select-C92AT_OZ.js.map} +1 -1
- package/dist/_chunks/{sidebar-D8Lq065m.js → sidebar-BqzlRBvC.js} +271 -291
- package/dist/_chunks/sidebar-BqzlRBvC.js.map +1 -0
- package/dist/_chunks/{slider-CkR6CLun.js → slider-CfEzeseL.js} +4 -4
- package/dist/_chunks/{slider-CkR6CLun.js.map → slider-CfEzeseL.js.map} +1 -1
- package/dist/_chunks/{tabs-CRCyPpJo.js → tabs-aEQfQV3x.js} +8 -8
- package/dist/_chunks/{tabs-CRCyPpJo.js.map → tabs-aEQfQV3x.js.map} +1 -1
- package/dist/_chunks/{theme-toggle-B3meAb3y.js → theme-toggle-BswYl0Yp.js} +2 -2
- package/dist/_chunks/{theme-toggle-B3meAb3y.js.map → theme-toggle-BswYl0Yp.js.map} +1 -1
- package/dist/_chunks/use-controllable-state-BiY4xTzM.js +23 -0
- package/dist/_chunks/use-controllable-state-BiY4xTzM.js.map +1 -0
- package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js +43 -0
- package/dist/_chunks/use-copy-to-clipboard-Cyfc_dlv.js.map +1 -0
- package/dist/_chunks/use-debounced-callback-BisrB-Fq.js.map +1 -1
- package/dist/_chunks/use-direction-D6rvvG9G.js.map +1 -1
- package/dist/_chunks/use-persistent-state-i23OWy6G.js +24 -0
- package/dist/_chunks/use-persistent-state-i23OWy6G.js.map +1 -0
- package/dist/_chunks/{warning-stack-CeRihME9.js → warning-stack-CDH9TudY.js} +2 -2
- package/dist/_chunks/{warning-stack-CeRihME9.js.map → warning-stack-CDH9TudY.js.map} +1 -1
- package/dist/_chunks/{workflow-map-D3MvrsZV.js → workflow-map-BeKe23uw.js} +3 -3
- package/dist/_chunks/{workflow-map-D3MvrsZV.js.map → workflow-map-BeKe23uw.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/use-debounced-callback.d.ts +1 -5
- package/dist/components/_shared/use-debounced-callback.d.ts.map +1 -1
- package/dist/components/_shared/use-direction.d.ts +1 -18
- package/dist/components/_shared/use-direction.d.ts.map +1 -1
- package/dist/components/_shared/use-focus-trap.d.ts +1 -31
- package/dist/components/_shared/use-focus-trap.d.ts.map +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/ai-prompt-input/ai-prompt-input.d.ts.map +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/carousel/carousel.d.ts.map +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chat-input/chat-input.d.ts.map +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/collapsible/collapsible.d.ts.map +1 -1
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/date-time-picker.d.ts.map +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/dialog/dialog.d.ts.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/freemium-paywall/freemium-paywall.d.ts.map +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts +14 -14
- package/dist/components/list/index.js +1 -1
- package/dist/components/list/list.d.ts.map +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/message-tray/message-tray.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
- package/dist/components/number-input/index.js +1 -1
- package/dist/components/number-input/number-input.d.ts.map +1 -1
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts.map +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/public-header/public-header.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/sidebar/index.js +8 -7
- package/dist/components/sidebar/index.js.map +1 -1
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +98 -15
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-debounced-callback.d.ts +19 -0
- package/dist/hooks/use-debounced-callback.d.ts.map +1 -0
- package/dist/hooks/use-debounced-value.d.ts +16 -0
- package/dist/hooks/use-debounced-value.d.ts.map +1 -0
- package/dist/hooks/use-direction.d.ts +19 -0
- package/dist/hooks/use-direction.d.ts.map +1 -0
- package/dist/hooks/use-focus-trap.d.ts +32 -0
- package/dist/hooks/use-focus-trap.d.ts.map +1 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +13 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/hooks/use-persistent-state.d.ts +16 -0
- package/dist/hooks/use-persistent-state.d.ts.map +1 -0
- package/dist/index.js +493 -492
- package/dist/index.js.map +1 -1
- package/dist/patterns/leo-assistant/index.js +1 -1
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +4 -2
- package/dist/_chunks/ai-prompt-input-DEiQwIMn.js.map +0 -1
- package/dist/_chunks/alert-pgdXrEO5.js.map +0 -1
- package/dist/_chunks/autocomplete-mOg7WLOh.js.map +0 -1
- package/dist/_chunks/chat-input-UK-bXU7u.js.map +0 -1
- package/dist/_chunks/checkbox-D5EHnB14.js.map +0 -1
- package/dist/_chunks/checkbox-group-Qkm3Rg1S.js +0 -208
- package/dist/_chunks/checkbox-group-Qkm3Rg1S.js.map +0 -1
- package/dist/_chunks/collapsible-CuxUBoHJ.js.map +0 -1
- package/dist/_chunks/combobox-D5tWe0t_.js.map +0 -1
- package/dist/_chunks/copy-field-BCHAZ8QV.js.map +0 -1
- package/dist/_chunks/date-range-picker-C2hRu_Ke.js.map +0 -1
- package/dist/_chunks/date-time-picker-B67mPZmP.js.map +0 -1
- package/dist/_chunks/dialog-DRp6Dejy.js.map +0 -1
- package/dist/_chunks/dropdown-menu-dyV7gHh_.js.map +0 -1
- package/dist/_chunks/freemium-paywall-BTEiVkes.js.map +0 -1
- package/dist/_chunks/list-DcjV0m5B.js.map +0 -1
- package/dist/_chunks/message-tray-Fsend-du.js.map +0 -1
- package/dist/_chunks/multi-select-DooDzQIp.js.map +0 -1
- package/dist/_chunks/navigation-menu-DdufF-_4.js.map +0 -1
- package/dist/_chunks/notification-tray-C3dYdLAF.js.map +0 -1
- package/dist/_chunks/number-input-DH00o0DN.js.map +0 -1
- package/dist/_chunks/otp-input-BBXYvLx5.js.map +0 -1
- package/dist/_chunks/pagination-F1ei4khE.js.map +0 -1
- package/dist/_chunks/public-header.agent-sDi9N9su.js.map +0 -1
- package/dist/_chunks/sidebar-D8Lq065m.js.map +0 -1
|
@@ -3,8 +3,8 @@ import { forwardRef as D, useId as T, useMemo as I, useRef as k, useState as q }
|
|
|
3
3
|
import * as E from "@radix-ui/react-radio-group";
|
|
4
4
|
import { c as F } from "./index-D2ZczOXr.js";
|
|
5
5
|
import { a as z } from "./radio-DvF59ThA.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { c as J } from "./compose-refs-C0k0tdqF.js";
|
|
7
|
+
import { u as L } from "./use-direction-D6rvvG9G.js";
|
|
8
8
|
import { u as O } from "./registry-C9nwlNyL.js";
|
|
9
9
|
import { C as Q } from "./circle-alert-ChA9opNA.js";
|
|
10
10
|
const U = {
|
|
@@ -86,7 +86,7 @@ const U = {
|
|
|
86
86
|
/* @__PURE__ */ e("span", { children: s })
|
|
87
87
|
]
|
|
88
88
|
}
|
|
89
|
-
) : null, y = k(null), $ =
|
|
89
|
+
) : null, y = k(null), $ = J(B, y), H = L(y), r = p !== void 0, [K, M] = q(
|
|
90
90
|
m ?? ""
|
|
91
91
|
), N = r ? p ?? "" : K, b = k(N);
|
|
92
92
|
b.current = N;
|
|
@@ -149,4 +149,4 @@ X.displayName = "RadioGroup";
|
|
|
149
149
|
export {
|
|
150
150
|
X as R
|
|
151
151
|
};
|
|
152
|
-
//# sourceMappingURL=radio-group-
|
|
152
|
+
//# sourceMappingURL=radio-group-BHZOxrIK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group-Cz1a4QCA.js","sources":["../../src/components/radio-group/radio-group.agent.ts","../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — RadioGroup. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { RadioGroupHandle } from './radio-group';\n\nexport const radioGroupAgent: AgentAdapter<RadioGroupHandle> = {\n id: 'radio-group',\n capabilities: ['select_single'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.radioGroup.state.value',\n description: 'Currently selected radio value, or empty string when none.',\n read: (handle) => handle.getValue(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.radioGroup.actions.setValue',\n description: 'Select the radio with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'radio-group',\n description: 'Marks the RadioGroup root.',\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: 'Stable opaque value emitted on each rendered Radio child.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport * as RadixRadioGroup from '@radix-ui/react-radio-group';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { AlertCircle } from 'lucide-react';\nimport {\n RadioGroupInternalContext,\n type RadioGroupInternalContextShape,\n type RadioGroupVariant,\n} from './radio-group-context';\nimport { useDirection } from '../_shared/use-direction';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { radioGroupAgent } from './radio-group.agent';\n\n/** Agent-readiness curated handle for RadioGroup. */\nexport interface RadioGroupHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n}\n\nconst radioGroupVariants = cva('ds:flex', {\n variants: {\n variant: {\n vertical: 'ds:flex-col ds:gap-[var(--spacing-sm)]',\n horizontal: 'ds:flex-row ds:flex-wrap ds:gap-[var(--spacing-md)]',\n card: 'ds:flex-col ds:gap-[var(--spacing-md)]',\n },\n },\n defaultVariants: {\n variant: 'vertical',\n },\n});\n\ntype RadixRootProps = ComponentPropsWithoutRef<typeof RadixRadioGroup.Root>;\n\nexport interface RadioGroupProps\n extends\n Omit<RadixRootProps, 'children' | 'orientation'>,\n VariantProps<typeof radioGroupVariants> {\n children: React.ReactNode;\n variant?: RadioGroupVariant;\n label?: string;\n description?: string;\n error?: string;\n required?: boolean;\n}\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n children,\n variant = 'vertical',\n label,\n description,\n error,\n required,\n disabled,\n className,\n id,\n value,\n defaultValue,\n onValueChange,\n ...props\n },\n ref,\n ) => {\n const baseId = useId();\n const descriptionId = `${baseId}-description`;\n const errorId = `${baseId}-error`;\n\n const describedBy =\n [description ? descriptionId : null, error ? errorId : null]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const orientation: 'vertical' | 'horizontal' =\n variant === 'horizontal' ? 'horizontal' : 'vertical';\n\n const ctxValue: RadioGroupInternalContextShape = useMemo(\n () => ({ variant }),\n [variant],\n );\n\n const descriptionNode = description ? (\n <p id={descriptionId} className=\"type-body-sm ds:text-muted-foreground\">\n {description}\n </p>\n ) : null;\n\n const errorNode = error ? (\n <p\n id={errorId}\n role=\"alert\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <AlertCircle aria-hidden=\"true\" className=\"ds:size-4 ds:shrink-0\" />\n <span>{error}</span>\n </p>\n ) : null;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs(ref, rootRef);\n const dir = useDirection(rootRef);\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const currentValue = isControlled ? (value ?? '') : internalValue;\n const currentValueRef = useRef<string>(currentValue);\n currentValueRef.current = currentValue;\n\n const handleValueChange = (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n };\n\n const agentHandle = useMemo<RadioGroupHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (next) => handleValueChange(next),\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isControlled, onValueChange],\n );\n useAgentRegistration(radioGroupAgent, agentHandle, id);\n\n const root = (\n <RadixRadioGroup.Root\n ref={composedRef}\n id={id}\n orientation={orientation}\n dir={dir}\n disabled={disabled}\n required={required}\n value={isControlled ? value : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onValueChange={handleValueChange}\n aria-describedby={describedBy}\n aria-invalid={Boolean(error) || undefined}\n aria-required={required || undefined}\n className={radioGroupVariants({ variant, className })}\n data-component=\"radio-group\"\n data-component-id={id}\n {...props}\n >\n {children}\n </RadixRadioGroup.Root>\n );\n\n const outerClasses =\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-0';\n\n if (label) {\n return (\n <RadioGroupInternalContext.Provider value={ctxValue}>\n <fieldset className={`${outerClasses} ds:border-0 ds:p-0 ds:m-0`}>\n <legend className=\"type-label ds:text-foreground ds:p-0\">\n {label}\n {required ? (\n <span\n aria-hidden=\"true\"\n className=\"ds:text-destructive ds:ms-[var(--spacing-xs)]\"\n >\n *\n </span>\n ) : null}\n </legend>\n {descriptionNode}\n {root}\n {errorNode}\n </fieldset>\n </RadioGroupInternalContext.Provider>\n );\n }\n\n return (\n <RadioGroupInternalContext.Provider value={ctxValue}>\n <div className={outerClasses}>\n {descriptionNode}\n {root}\n {errorNode}\n </div>\n </RadioGroupInternalContext.Provider>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["radioGroupAgent","handle","args","radioGroupVariants","cva","RadioGroup","forwardRef","children","variant","label","description","error","required","disabled","className","id","value","defaultValue","onValueChange","props","ref","baseId","useId","descriptionId","errorId","describedBy","orientation","ctxValue","useMemo","descriptionNode","jsx","errorNode","jsxs","AlertCircle","rootRef","useRef","composedRef","composeRefs","dir","useDirection","isControlled","internalValue","setInternalValue","useState","currentValue","currentValueRef","handleValueChange","next","agentHandle","useAgentRegistration","root","RadixRadioGroup","outerClasses","RadioGroupInternalContext"],"mappings":";;;;;;;;;AASO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe;AAAA,EAC9B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCpBMC,IAAqBC,EAAI,WAAW;AAAA,EACxC,UAAU;AAAA,IACR,SAAS;AAAA,MACP,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,MAAM;AAAA,IAAA;A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A,YACC,eAAY;AAAA,YACZ,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA,IAGC;AAAA,MAAA,GACN;AAAA,MACCD;AAAA,MACAqB;AAAA,MACAnB;AAAA,IAAA,EAAA,CACH,EAAA,CACF,IAKF,gBAAAD,EAACuB,EAA0B,UAA1B,EAAmC,OAAO1B,GACzC,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWoB,GACb,UAAA;AAAA,MAAAvB;AAAA,MACAqB;AAAA,MACAnB;AAAA,IAAA,EAAA,CACH,EAAA,CACF;AAAA,EAEJ;AACF;AAEA1B,EAAW,cAAc;"}
|
|
1
|
+
{"version":3,"file":"radio-group-BHZOxrIK.js","sources":["../../src/components/radio-group/radio-group.agent.ts","../../src/components/radio-group/radio-group.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — RadioGroup. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { RadioGroupHandle } from './radio-group';\n\nexport const radioGroupAgent: AgentAdapter<RadioGroupHandle> = {\n id: 'radio-group',\n capabilities: ['select_single'],\n state: {\n value: {\n type: 'string',\n descriptionKey: 'ui.agent.radioGroup.state.value',\n description: 'Currently selected radio value, or empty string when none.',\n read: (handle) => handle.getValue(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.radioGroup.actions.setValue',\n description: 'Select the radio with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'radio-group',\n description: 'Marks the RadioGroup root.',\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: 'Stable opaque value emitted on each rendered Radio child.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport * as RadixRadioGroup from '@radix-ui/react-radio-group';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { AlertCircle } from 'lucide-react';\nimport {\n RadioGroupInternalContext,\n type RadioGroupInternalContextShape,\n type RadioGroupVariant,\n} from './radio-group-context';\nimport { useDirection } from '../_shared/use-direction';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { useAgentRegistration } from '../../agent';\nimport { radioGroupAgent } from './radio-group.agent';\n\n/** Agent-readiness curated handle for RadioGroup. */\nexport interface RadioGroupHandle {\n getValue: () => string;\n setValue: (value: string) => void;\n}\n\nconst radioGroupVariants = cva('ds:flex', {\n variants: {\n variant: {\n vertical: 'ds:flex-col ds:gap-[var(--spacing-sm)]',\n horizontal: 'ds:flex-row ds:flex-wrap ds:gap-[var(--spacing-md)]',\n card: 'ds:flex-col ds:gap-[var(--spacing-md)]',\n },\n },\n defaultVariants: {\n variant: 'vertical',\n },\n});\n\ntype RadixRootProps = ComponentPropsWithoutRef<typeof RadixRadioGroup.Root>;\n\nexport interface RadioGroupProps\n extends\n Omit<RadixRootProps, 'children' | 'orientation'>,\n VariantProps<typeof radioGroupVariants> {\n children: React.ReactNode;\n variant?: RadioGroupVariant;\n label?: string;\n description?: string;\n error?: string;\n required?: boolean;\n}\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n children,\n variant = 'vertical',\n label,\n description,\n error,\n required,\n disabled,\n className,\n id,\n value,\n defaultValue,\n onValueChange,\n ...props\n },\n ref,\n ) => {\n const baseId = useId();\n const descriptionId = `${baseId}-description`;\n const errorId = `${baseId}-error`;\n\n const describedBy =\n [description ? descriptionId : null, error ? errorId : null]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const orientation: 'vertical' | 'horizontal' =\n variant === 'horizontal' ? 'horizontal' : 'vertical';\n\n const ctxValue: RadioGroupInternalContextShape = useMemo(\n () => ({ variant }),\n [variant],\n );\n\n const descriptionNode = description ? (\n <p id={descriptionId} className=\"type-body-sm ds:text-muted-foreground\">\n {description}\n </p>\n ) : null;\n\n const errorNode = error ? (\n <p\n id={errorId}\n role=\"alert\"\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-destructive\"\n >\n <AlertCircle aria-hidden=\"true\" className=\"ds:size-4 ds:shrink-0\" />\n <span>{error}</span>\n </p>\n ) : null;\n\n const rootRef = useRef<HTMLDivElement>(null);\n const composedRef = composeRefs(ref, rootRef);\n const dir = useDirection(rootRef);\n\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState<string>(\n defaultValue ?? '',\n );\n const currentValue = isControlled ? (value ?? '') : internalValue;\n const currentValueRef = useRef<string>(currentValue);\n currentValueRef.current = currentValue;\n\n const handleValueChange = (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n };\n\n const agentHandle = useMemo<RadioGroupHandle>(\n () => ({\n getValue: () => currentValueRef.current,\n setValue: (next) => handleValueChange(next),\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isControlled, onValueChange],\n );\n useAgentRegistration(radioGroupAgent, agentHandle, id);\n\n const root = (\n <RadixRadioGroup.Root\n ref={composedRef}\n id={id}\n orientation={orientation}\n dir={dir}\n disabled={disabled}\n required={required}\n value={isControlled ? value : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onValueChange={handleValueChange}\n aria-describedby={describedBy}\n aria-invalid={Boolean(error) || undefined}\n aria-required={required || undefined}\n className={radioGroupVariants({ variant, className })}\n data-component=\"radio-group\"\n data-component-id={id}\n {...props}\n >\n {children}\n </RadixRadioGroup.Root>\n );\n\n const outerClasses =\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-0';\n\n if (label) {\n return (\n <RadioGroupInternalContext.Provider value={ctxValue}>\n <fieldset className={`${outerClasses} ds:border-0 ds:p-0 ds:m-0`}>\n <legend className=\"type-label ds:text-foreground ds:p-0\">\n {label}\n {required ? (\n <span\n aria-hidden=\"true\"\n className=\"ds:text-destructive ds:ms-[var(--spacing-xs)]\"\n >\n *\n </span>\n ) : null}\n </legend>\n {descriptionNode}\n {root}\n {errorNode}\n </fieldset>\n </RadioGroupInternalContext.Provider>\n );\n }\n\n return (\n <RadioGroupInternalContext.Provider value={ctxValue}>\n <div className={outerClasses}>\n {descriptionNode}\n {root}\n {errorNode}\n </div>\n </RadioGroupInternalContext.Provider>\n );\n },\n);\n\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["radioGroupAgent","handle","args","radioGroupVariants","cva","RadioGroup","forwardRef","children","variant","label","description","error","required","disabled","className","id","value","defaultValue","onValueChange","props","ref","baseId","useId","descriptionId","errorId","describedBy","orientation","ctxValue","useMemo","descriptionNode","jsx","errorNode","jsxs","AlertCircle","rootRef","useRef","composedRef","composeRefs","dir","useDirection","isControlled","internalValue","setInternalValue","useState","currentValue","currentValueRef","handleValueChange","next","agentHandle","useAgentRegistration","root","RadixRadioGroup","outerClasses","RadioGroupInternalContext"],"mappings":";;;;;;;;;AASO,MAAMA,IAAkD;AAAA,EAC7D,IAAI;AAAA,EACJ,cAAc,CAAC,eAAe;AAAA,EAC9B,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,EACpC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,GAAQC,MAA4B;AAC3C,QAAAD,EAAO,SAASC,EAAK,KAAK;AAAA,MAC5B;AAAA,IAAA;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MA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EF,WAAI3C,IAEA,gBAAAqB,EAACuB,EAA0B,UAA1B,EAAmC,OAAO1B,GACzC,UAAA,gBAAAK,EAAC,YAAA,EAAS,WAAW,GAAGoB,CAAY,8BAClC,UAAA;AAAA,MAAA,gBAAApB,EAAC,UAAA,EAAO,WAAU,wCACf,UAAA;AAAA,QAAAvB;AAAA,QACAG,IACC,gBAAAkB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAU;AAAA,YACX,UAAA;AAAA,UAAA;AAAA,QAAA,IAGC;AAAA,MAAA,GACN;AAAA,MACCD;AAAA,MACAqB;AAAA,MACAnB;AAAA,IAAA,EAAA,CACH,EAAA,CACF,IAKF,gBAAAD,EAACuB,EAA0B,UAA1B,EAAmC,OAAO1B,GACzC,UAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWoB,GACb,UAAA;AAAA,MAAAvB;AAAA,MACAqB;AAAA,MACAnB;AAAA,IAAA,EAAA,CACH,EAAA,CACF;AAAA,EAEJ;AACF;AAEA1B,EAAW,cAAc;"}
|
|
@@ -5,10 +5,10 @@ import { c as z } from "./index-D2ZczOXr.js";
|
|
|
5
5
|
import { useTranslation as ge } from "react-i18next";
|
|
6
6
|
import { u as he, F as ve } from "./form-field-context-B3APVHKx.js";
|
|
7
7
|
import { g as be } from "./group-options-BvKhQ3xb.js";
|
|
8
|
-
import {
|
|
9
|
-
import { C as Se } from "./chevron-up-zOEDrmBB.js";
|
|
8
|
+
import { C as ye } from "./chevron-up-zOEDrmBB.js";
|
|
10
9
|
import { C as q } from "./chevron-down-BX_NP2Yh.js";
|
|
11
|
-
import { C as
|
|
10
|
+
import { C as Se } from "./check-DPdL_Sm7.js";
|
|
11
|
+
import { u as xe } from "./use-direction-D6rvvG9G.js";
|
|
12
12
|
import { u as Ne } from "./registry-C9nwlNyL.js";
|
|
13
13
|
import { X as Ce } from "./x-CCcI3eJp.js";
|
|
14
14
|
const we = {
|
|
@@ -194,7 +194,7 @@ const I = a(
|
|
|
194
194
|
className: ze({ className: e }),
|
|
195
195
|
...c,
|
|
196
196
|
children: [
|
|
197
|
-
/* @__PURE__ */ t(o.ScrollUpButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ t(
|
|
197
|
+
/* @__PURE__ */ t(o.ScrollUpButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ t(ye, { "aria-hidden": "true", className: "ds:size-4" }) }),
|
|
198
198
|
s,
|
|
199
199
|
/* @__PURE__ */ t(o.ScrollDownButton, { className: "ds:flex ds:items-center ds:justify-center ds:h-6 ds:bg-background ds:cursor-default", children: /* @__PURE__ */ t(q, { "aria-hidden": "true", className: "ds:size-4" }) })
|
|
200
200
|
]
|
|
@@ -225,7 +225,7 @@ const V = a(({ size: e = "md", className: s, children: n, ...r }, l) => {
|
|
|
225
225
|
{
|
|
226
226
|
className: `ds:absolute ${c} ds:inline-flex ds:items-center ds:justify-center`,
|
|
227
227
|
"aria-hidden": "true",
|
|
228
|
-
children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(
|
|
228
|
+
children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(Se, { className: g }) })
|
|
229
229
|
}
|
|
230
230
|
),
|
|
231
231
|
/* @__PURE__ */ t(o.ItemText, { children: n })
|
|
@@ -276,7 +276,7 @@ const _ = a(function({
|
|
|
276
276
|
n ?? r ?? ""
|
|
277
277
|
), m = n !== void 0, h = m ? n : ee, [N, C] = P(!1), B = G(h);
|
|
278
278
|
B.current = h;
|
|
279
|
-
const te = S ?? (p ? u.id : void 0), O = (p ? u.disabled : !1) || !!E, se = (p ? u.required : !1) || !!X, D = p ? u.invalid : !1, oe = D ? "error" : Q, ne = p && u.describedBy ? u.describedBy : void 0, w = G(null), de = Te(Z, w), ie =
|
|
279
|
+
const te = S ?? (p ? u.id : void 0), O = (p ? u.disabled : !1) || !!E, se = (p ? u.required : !1) || !!X, D = p ? u.invalid : !1, oe = D ? "error" : Q, ne = p && u.describedBy ? u.describedBy : void 0, w = G(null), de = Te(Z, w), ie = xe(w), i = l, ae = (d) => {
|
|
280
280
|
m || b(d), i == null || i(d);
|
|
281
281
|
}, re = (d) => {
|
|
282
282
|
var y;
|
|
@@ -410,4 +410,4 @@ export {
|
|
|
410
410
|
H as i,
|
|
411
411
|
j
|
|
412
412
|
};
|
|
413
|
-
//# sourceMappingURL=select-
|
|
413
|
+
//# sourceMappingURL=select-C92AT_OZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-Ca6ibiDL.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 capabilities: ['select_single', '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 safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.select.actions.setValue',\n description: 'Select the option with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\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 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 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\nconst SelectItem = forwardRef<\n ElementRef<typeof RadixSelect.Item>,\n SelectItemProps\n>(({ size = 'md', className, children, ...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 <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\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 '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 <RadixSelect.Value placeholder={resolvedPlaceholder} />\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>\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 >\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","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,EACJ,cAAc,CAAC,iBAAiB,QAAQ,OAAO;AAAA,EAC/C,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,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AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AACDtD,EAAW,cAAc;AAmBzB,MAAMyD,KAAoB,OAAO,OAAOzD,GAAY;AAAA,EAClD,MAAM5B;AAAA,EACN,SAASI;AAAA,EACT,OAAOO;AAAA,EACP,SAASC;AAAA,EACT,UAAUO;AAAA,EACV,MAAMC;AAAA,EACN,UAAUI;AAAA,EACV,OAAOC;AAAA,EACP,OAAOC;AAAA,EACP,WAAWC;AACb,CAAC,GAEY2D,KAASD;"}
|
|
1
|
+
{"version":3,"file":"select-C92AT_OZ.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 capabilities: ['select_single', '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 safety: 'write',\n argsType: '{ value: string }',\n descriptionKey: 'ui.agent.select.actions.setValue',\n description: 'Select the option with the given value.',\n invoke: (handle, args: { value: string }) => {\n handle.setValue(args.value);\n },\n },\n clear: {\n safety: 'destructive',\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 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 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\nconst SelectItem = forwardRef<\n ElementRef<typeof RadixSelect.Item>,\n SelectItemProps\n>(({ size = 'md', className, children, ...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 <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\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 '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 <RadixSelect.Value placeholder={resolvedPlaceholder} />\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>\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 >\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","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,EACJ,cAAc,CAAC,iBAAiB,QAAQ,OAAO;AAAA,EAC/C,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,CAAC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