@spear-ai/spectral 1.9.0 → 1.10.0
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/README.md +6 -5
- package/dist/.js +112 -239
- package/dist/Accordion-CDXdSAST.js +363 -0
- package/dist/Accordion.js +3 -498
- package/dist/Alert/AlertBase.js +69 -152
- package/dist/Alert.js +58 -106
- package/dist/AnimatePresence-D-9jXfgI.js +178 -0
- package/dist/App.js +6 -6
- package/dist/Avatar.js +83 -65
- package/dist/Badge.d.ts +1 -3
- package/dist/Badge.js +21 -25
- package/dist/Button.js +102 -178
- package/dist/ButtonGroup/ButtonGroupButton.js +38 -40
- package/dist/ButtonGroup.js +55 -59
- package/dist/ButtonIcon.js +58 -134
- package/dist/Calendar-s4lyijkn.js +3109 -0
- package/dist/Checkbox/CheckboxBase.js +94 -126
- package/dist/Checkbox.d.ts +1 -1
- package/dist/Checkbox.js +40 -105
- package/dist/Combobox/ComboboxBase.js +2 -79
- package/dist/Combobox.js +106 -172
- package/dist/ComboboxBase-D8Nf4xC-.js +491 -0
- package/dist/ControlGroup/ControlGroupSelect.d.ts +1 -1
- package/dist/ControlGroup/ControlGroupSelect.js +85 -101
- package/dist/ControlGroup.js +45 -48
- package/dist/DataCard/Card.js +37 -12
- package/dist/DataCard.d.ts +1 -1
- package/dist/DataCard.js +36 -16
- package/dist/DateTimePicker/Calendar.js +2 -2967
- package/dist/DateTimePicker/DateTimeDisplayInput.d.ts +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +379 -274
- package/dist/DateTimePicker/DateTimeInput.d.ts +5 -3
- package/dist/DateTimePicker/DateTimeInput.js +133 -88
- package/dist/DateTimePicker/DateTimeUtils.js +2 -2193
- package/dist/DateTimePicker/TimePeriodSelect.d.ts +1 -1
- package/dist/DateTimePicker/TimePeriodSelect.js +45 -20
- package/dist/DateTimePicker/TimePicker.d.ts +1 -1
- package/dist/DateTimePicker/TimePicker.js +76 -60
- package/dist/DateTimePicker.d.ts +2 -2
- package/dist/DateTimePicker.js +87 -205
- package/dist/DateTimeUtils-DVvG6H-p.js +2098 -0
- package/dist/Dialog.js +74 -74
- package/dist/Drawer.js +67 -37
- package/dist/HoverCard-CYDsIiVK.js +201 -0
- package/dist/HoverCard.d.ts +1 -1
- package/dist/HoverCard.js +2 -218
- package/dist/Icons/AnalyzeIcon.js +50 -57
- package/dist/Icons/AnnotationsIcon.js +20 -15
- package/dist/Icons/ApprovedIcon.js +26 -18
- package/dist/Icons/ArrowDownIcon.js +20 -6
- package/dist/Icons/ArrowUpIcon.js +20 -6
- package/dist/Icons/BoxToolIcon.js +17 -12
- package/dist/Icons/CalendarIcon.js +43 -20
- package/dist/Icons/CheckCircleIcon.js +26 -10
- package/dist/Icons/CheckSquareIcon.js +26 -10
- package/dist/Icons/CheckmarkIcon.js +22 -9
- package/dist/Icons/ChevronDownIcon.js +22 -9
- package/dist/Icons/ChevronUpIcon.js +22 -9
- package/dist/Icons/ClockIcon.js +26 -18
- package/dist/Icons/CloseCircleIcon.js +26 -10
- package/dist/Icons/CloseIcon.js +18 -9
- package/dist/Icons/DashboardIcon.js +36 -10
- package/dist/Icons/DatabaseIcon.js +36 -19
- package/dist/Icons/DeleteIcon.js +36 -19
- package/dist/Icons/DurationIcon.js +57 -22
- package/dist/Icons/EditIcon.js +26 -27
- package/dist/Icons/EmailIcon.js +26 -10
- package/dist/Icons/EraserIcon.js +41 -25
- package/dist/Icons/ErrorIcon.js +27 -11
- package/dist/Icons/EyeClosedIcon.js +29 -13
- package/dist/Icons/EyeClosedIcon2.js +27 -11
- package/dist/Icons/EyeOpenIcon.js +22 -9
- package/dist/Icons/FileDownloadIcon.js +43 -20
- package/dist/Icons/GoToFirstIcon.js +26 -9
- package/dist/Icons/GoToLastIcon.js +26 -9
- package/dist/Icons/HarmonicCursorsIcon.js +23 -9
- package/dist/Icons/IconBase.d.ts +3 -3
- package/dist/Icons/IconBase.js +49 -23
- package/dist/Icons/InfoIcon.js +36 -10
- package/dist/Icons/KeyboardIcon.js +26 -27
- package/dist/Icons/LabelIcon.js +19 -14
- package/dist/Icons/LassoIcon.js +36 -28
- package/dist/Icons/LineToolIcon.js +48 -39
- package/dist/Icons/LiveViewIcon.js +50 -12
- package/dist/Icons/LoaderIcon.js +67 -27
- package/dist/Icons/LocationIcon.js +26 -27
- package/dist/Icons/LogoutIcon.js +20 -15
- package/dist/Icons/MeasureIcon.js +78 -25
- package/dist/Icons/MessagesIcon.js +33 -18
- package/dist/Icons/MetadataIcon.js +20 -15
- package/dist/Icons/MinusIcon.d.ts +1 -1
- package/dist/Icons/MinusIcon.js +18 -6
- package/dist/Icons/OntologyIcon.js +87 -71
- package/dist/Icons/PanelIconClose.js +28 -10
- package/dist/Icons/PanelIconOpen.js +28 -10
- package/dist/Icons/PlayIcon.js +20 -6
- package/dist/Icons/PlusIcon.js +20 -14
- package/dist/Icons/PolygonIcon.js +50 -39
- package/dist/Icons/ProgressCheckIcon.d.ts +5 -0
- package/dist/Icons/ProgressCheckIcon.js +58 -0
- package/dist/Icons/ResetIcon.js +17 -12
- package/dist/Icons/ReviewedIcon.js +36 -19
- package/dist/Icons/ScissorsIcon.js +22 -17
- package/dist/Icons/SearchIcon.js +26 -9
- package/dist/Icons/SettingsIcon.js +26 -27
- package/dist/Icons/SortAscendingIcon.js +50 -12
- package/dist/Icons/SortAtoZIcon.js +50 -12
- package/dist/Icons/SortDescendingIcon.js +50 -12
- package/dist/Icons/SortZtoAIcon.js +50 -12
- package/dist/Icons/StackIcon.js +26 -9
- package/dist/Icons/StarIcon.js +20 -6
- package/dist/Icons/TrashIcon.js +17 -12
- package/dist/Icons/UndoIcon.js +20 -15
- package/dist/Icons/User2Icon.js +26 -10
- package/dist/Icons/UserIcon.js +19 -14
- package/dist/Icons/WarningIcon.js +19 -14
- package/dist/Icons/ZoomAllIcon.js +71 -15
- package/dist/Icons/ZoomXIcon.js +36 -10
- package/dist/Icons/ZoomYIcon.js +36 -10
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons.js +68 -136
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +66 -36
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +66 -36
- package/dist/IconsAnimated.js +3 -6
- package/dist/Input/InputUtils.js +51 -52
- package/dist/Input.js +132 -185
- package/dist/InputOTP-XUWW9xcI.js +461 -0
- package/dist/InputOTP.js +2 -382
- package/dist/Kbd.d.ts +1 -1
- package/dist/Kbd.js +182 -86
- package/dist/Label.js +12 -14
- package/dist/MultiSelect/MultiSelectBase.js +331 -403
- package/dist/MultiSelect.d.ts +1 -1
- package/dist/MultiSelect.js +23 -23
- package/dist/Popover.js +28 -32
- package/dist/RadioButton.d.ts +17 -0
- package/dist/RadioButton.js +33 -0
- package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +3 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +49 -46
- package/dist/RadioButtonGroup.d.ts +1 -1
- package/dist/RadioButtonGroup.js +11 -8
- package/dist/RadioGroup-w_q6RGEK.js +447 -0
- package/dist/RadioGroup.js +2 -505
- package/dist/Select.js +163 -186
- package/dist/Separator.js +16 -19
- package/dist/Skeleton.js +10 -6
- package/dist/Slider-BzzZT3Zm.js +490 -0
- package/dist/Slider.js +2 -562
- package/dist/SpectralProvider.js +8 -5
- package/dist/Switch/SwitchBase.js +91 -95
- package/dist/Switch-CVzRJ-0n.js +126 -0
- package/dist/Switch.d.ts +1 -1
- package/dist/Switch.js +2 -134
- package/dist/Tabs/TabsBase.js +242 -250
- package/dist/Tabs/tabsUtils.js +65 -73
- package/dist/Tabs.d.ts +1 -1
- package/dist/Tabs.js +73 -103
- package/dist/Textarea/TextareaUtils.js +35 -46
- package/dist/Textarea.js +83 -160
- package/dist/Toast-9zqXxKKO.js +711 -0
- package/dist/Toast.js +2 -885
- package/dist/Toggle/ToggleBase.js +46 -56
- package/dist/Toggle.d.ts +1 -1
- package/dist/Toggle.js +52 -62
- package/dist/ToggleGroup/ToggleGroupBase.js +128 -104
- package/dist/ToggleGroup.d.ts +1 -1
- package/dist/ToggleGroup.js +52 -63
- package/dist/Tooltip-D1K8kY1y.js +389 -0
- package/dist/Tooltip.js +2 -365
- package/dist/Tray.js +174 -217
- package/dist/chunk-h9knIhTc.js +20 -0
- package/dist/clsx-jM1GlMvB.js +16 -0
- package/dist/dist-3Af8168y.js +913 -0
- package/dist/dist-7HRQ5IKN.js +249 -0
- package/dist/dist-B2k1iWFp.js +129 -0
- package/dist/dist-B4FgboI8.js +122 -0
- package/dist/dist-B4g6zpUF.js +33 -0
- package/dist/dist-B9tup-4O.js +216 -0
- package/dist/dist-BK1K0g9W.js +29 -0
- package/dist/dist-Bfjk-jx9.js +28 -0
- package/dist/dist-Bft31cJh.js +65 -0
- package/dist/dist-BtdmHAzK.js +190 -0
- package/dist/dist-C0Hifjgh.js +1287 -0
- package/dist/dist-CGzgmYB9.js +68 -0
- package/dist/dist-ClmepHp4.js +10 -0
- package/dist/dist-D8Wb_MX9.js +6 -0
- package/dist/dist-Dtvmk11N.js +12 -0
- package/dist/dist-fW81qjVl.js +677 -0
- package/dist/dist-s1uWaZYZ.js +11 -0
- package/dist/es2015-YHaMV-St.js +701 -0
- package/dist/hooks/useAccordionAutoScroll.js +66 -67
- package/dist/hooks/useControllableState.js +14 -13
- package/dist/hooks/useTheme.js +21 -17
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/main.js +18954 -27224
- package/dist/primitives/button.js +39 -41
- package/dist/primitives/input-group.js +57 -73
- package/dist/primitives/input.js +11 -20
- package/dist/primitives/popover.d.ts.map +1 -1
- package/dist/primitives/popover.js +34 -25
- package/dist/primitives/select.js +70 -138
- package/dist/primitives/slot.js +32 -31
- package/dist/primitives/textarea.js +10 -16
- package/dist/proxy-Dn10Pl_g.js +4920 -0
- package/dist/styles/main.css +2 -1
- package/dist/styles/spectral.css +1 -1
- package/dist/twUtils-VNWgstKL.js +1673 -0
- package/dist/use-animation-CBUDycyW.js +57 -0
- package/dist/utils/constants.js +4 -4
- package/dist/utils/formFieldUtils.js +136 -148
- package/dist/utils/sharedUtils.js +26 -7
- package/dist/utils/twUtils.js +2 -2919
- package/package.json +24 -28
- package/dist/ComboboxBase-CxNxYtdT.js +0 -408
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/index-0ioNhtNM.js +0 -10
- package/dist/index-6oYKCvIn.js +0 -677
- package/dist/index-BFOf48AQ.js +0 -69
- package/dist/index-BZPx6jYI.js +0 -8
- package/dist/index-BlHU_t18.js +0 -142
- package/dist/index-Bm1RbF6w.js +0 -1037
- package/dist/index-Bv2OIg5P.js +0 -225
- package/dist/index-CKEI0pDv.js +0 -56
- package/dist/index-CM_hWgfC.js +0 -32
- package/dist/index-C_YVr64u.js +0 -1538
- package/dist/index-Cl8VeY0o.js +0 -149
- package/dist/index-CwSyIPrv.js +0 -13
- package/dist/index-D29mdTf5.js +0 -34
- package/dist/index-DEYs15GP.js +0 -66
- package/dist/index-Dc0No4pV.js +0 -233
- package/dist/index-T6XEa11q.js +0 -822
- package/dist/index-pBCLb6Gr.js +0 -240
- package/dist/index-psiVrsnE.js +0 -27
- package/dist/index-rKs9bXHr.js +0 -6
- package/dist/proxy-CO_-Vget.js +0 -4975
- package/dist/use-animation-DhEPRwZ3.js +0 -62
package/dist/Combobox.js
CHANGED
|
@@ -1,175 +1,109 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "
|
|
11
|
-
import "
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
107
|
-
}, []), M = () => {
|
|
108
|
-
r || l || (v.current?.focus(), i(!0));
|
|
109
|
-
}, T = () => l ? /* @__PURE__ */ o("div", { id: p, role: "listbox", children: /* @__PURE__ */ o(no, { message: k }) }) : b.length === 0 ? /* @__PURE__ */ o("div", { id: p, role: "listbox", children: /* @__PURE__ */ o(mo, { message: g }) }) : /* @__PURE__ */ c($, { id: p, children: [
|
|
110
|
-
/* @__PURE__ */ o(H, { children: g }),
|
|
111
|
-
b.map((t) => /* @__PURE__ */ o(J, { "data-checked": a === t.value || void 0, disabled: t.disabled, onMouseDown: (q) => q.preventDefault(), onSelect: () => B(t.value), value: t.label, children: t.label }, t.value))
|
|
112
|
-
] });
|
|
113
|
-
return /* @__PURE__ */ c("div", { className: "w-full", ref: A, children: [
|
|
114
|
-
u && /* @__PURE__ */ o("input", { type: "hidden", name: u, value: a, disabled: r }),
|
|
115
|
-
e && /* @__PURE__ */ o(W, { className: n("text-text-primary mb-2 block", E, r && "text-text-secondary"), "data-testid": "spectral-combobox-label", htmlFor: s, children: e }),
|
|
116
|
-
/* @__PURE__ */ c(I, { ref: C, label: f ?? e, onKeyDown: G, className: n("relative w-full", S), children: [
|
|
117
|
-
/* @__PURE__ */ c(
|
|
118
|
-
X,
|
|
119
|
-
{
|
|
120
|
-
"data-slot": "combobox-content",
|
|
121
|
-
"data-state": m,
|
|
122
|
-
"data-testid": "spectral-combobox-trigger",
|
|
123
|
-
className: n(
|
|
124
|
-
"border-input-border bg-input-bg h-12 cursor-pointer border-2",
|
|
125
|
-
"hover:border-input-border--hover transition duration-200",
|
|
126
|
-
"focus-within:border-input-border--focus focus-within:outline-none",
|
|
127
|
-
"ring-0!",
|
|
128
|
-
eo(m),
|
|
129
|
-
d && "border-input-border--focus",
|
|
130
|
-
r && "pointer-events-none"
|
|
131
|
-
),
|
|
132
|
-
onClick: M,
|
|
133
|
-
style: ro(),
|
|
134
|
-
children: [
|
|
135
|
-
/* @__PURE__ */ o(
|
|
136
|
-
I.Input,
|
|
137
|
-
{
|
|
138
|
-
ref: v,
|
|
139
|
-
autoComplete: "off",
|
|
140
|
-
"data-slot": "input-group-control",
|
|
141
|
-
"aria-controls": p,
|
|
142
|
-
"aria-expanded": d,
|
|
143
|
-
"aria-label": f ?? e,
|
|
144
|
-
className: "placeholder:text-input-text-placeholder min-w-0 flex-1 border-0 bg-transparent px-3 py-1 text-base outline-hidden focus-visible:ring-0 focus-visible:outline-none",
|
|
145
|
-
disabled: r,
|
|
146
|
-
id: s,
|
|
147
|
-
onBlur: K,
|
|
148
|
-
onFocus: () => !r && !l && i(!0),
|
|
149
|
-
onValueChange: h,
|
|
150
|
-
placeholder: j?.label ?? L,
|
|
151
|
-
role: "combobox",
|
|
152
|
-
value: _,
|
|
153
|
-
...V
|
|
154
|
-
}
|
|
155
|
-
),
|
|
156
|
-
/* @__PURE__ */ o(Y, { align: "inline-end", children: l ? /* @__PURE__ */ o(U, { className: "text-muted-foreground size-5 motion-safe:animate-spin" }) : /* @__PURE__ */ o(Q, { className: n("text-muted-foreground size-5 shrink-0 transition-transform duration-200", d && "rotate-180") }) })
|
|
157
|
-
]
|
|
158
|
-
}
|
|
159
|
-
),
|
|
160
|
-
/* @__PURE__ */ o(
|
|
161
|
-
"div",
|
|
162
|
-
{
|
|
163
|
-
className: n("border-input-border bg-input-bg absolute top-full left-0 z-50 mt-1 w-full rounded-lg border p-1 shadow-md", "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:zoom-in-95 motion-safe:slide-in-from-top-2", !d && "hidden"),
|
|
164
|
-
"data-testid": "spectral-combobox-content",
|
|
165
|
-
children: T()
|
|
166
|
-
}
|
|
167
|
-
)
|
|
168
|
-
] }),
|
|
169
|
-
R && x && /* @__PURE__ */ o(io, { dataTestId: "spectral-combobox-error-message", id: w, message: x })
|
|
170
|
-
] });
|
|
171
|
-
};
|
|
172
|
-
po.displayName = "Combobox";
|
|
173
|
-
export {
|
|
174
|
-
po as Combobox
|
|
3
|
+
import { ChevronDownIcon as e } from "./Icons/ChevronDownIcon.js";
|
|
4
|
+
import { LoaderIcon as t } from "./Icons/LoaderIcon.js";
|
|
5
|
+
import { t as n } from "./twUtils-VNWgstKL.js";
|
|
6
|
+
import { EmptyState as ee, ErrorMessage as r, LoadingState as i, getAriaProps as a, getErrorMessageId as o, getFormFieldCSSProperties as s, getStateClasses as c, useFormFieldId as l, useFormFieldState as u } from "./utils/formFieldUtils.js";
|
|
7
|
+
import { Label as d } from "./Label.js";
|
|
8
|
+
import { InputGroup as f, InputGroupAddon as p } from "./primitives/input-group.js";
|
|
9
|
+
import { a as m, i as h, n as g, o as _ } from "./ComboboxBase-D8Nf4xC-.js";
|
|
10
|
+
import { useCallback as v, useRef as y, useState as b } from "react";
|
|
11
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
12
|
+
//#region src/components/Combobox/Combobox.tsx
|
|
13
|
+
var C = ({ className: C, disabled: w, emptyMessage: T = "No options found.", errorMessage: E, id: D, label: O, labelClassName: k, loadingMessage: A = "Loading…", name: j, onValueChange: M, options: N = [], placeholder: P = "Search…", ref: F, required: I, state: L = "default", value: R = "", "aria-describedby": z, "aria-label": B }) => {
|
|
14
|
+
process.env.NODE_ENV !== "production" && !O && !B && console.warn("Combobox: provide either `label` or `aria-label` for an accessible name.");
|
|
15
|
+
let V = y(null), H = y(null), U = l(D, j), W = `${U}-listbox`, G = o(U), { isDisabled: K, isLoading: q, isInvalid: J } = u(w, L), Y = a(L, z, I, G), [X, Z] = b(!1), [Q, $] = b(""), te = N.find((e) => e.value === R), ne = (e) => {
|
|
16
|
+
M?.(e === R ? "" : e), $(""), Z(!1);
|
|
17
|
+
}, re = (e) => {
|
|
18
|
+
e.key === "Escape" && Z(!1);
|
|
19
|
+
}, ie = v(() => {
|
|
20
|
+
requestAnimationFrame(() => {
|
|
21
|
+
H.current?.contains(document.activeElement) || (Z(!1), $(""));
|
|
22
|
+
});
|
|
23
|
+
}, []), ae = () => {
|
|
24
|
+
K || q || (V.current?.focus(), Z(!0));
|
|
25
|
+
}, oe = () => q ? /* @__PURE__ */ x("div", {
|
|
26
|
+
id: W,
|
|
27
|
+
role: "listbox",
|
|
28
|
+
children: /* @__PURE__ */ x(i, { message: A })
|
|
29
|
+
}) : N.length === 0 ? /* @__PURE__ */ x("div", {
|
|
30
|
+
id: W,
|
|
31
|
+
role: "listbox",
|
|
32
|
+
children: /* @__PURE__ */ x(ee, { message: T })
|
|
33
|
+
}) : /* @__PURE__ */ S(m, {
|
|
34
|
+
id: W,
|
|
35
|
+
children: [/* @__PURE__ */ x(g, { children: T }), N.map((e) => /* @__PURE__ */ x(h, {
|
|
36
|
+
"data-checked": R === e.value || void 0,
|
|
37
|
+
disabled: e.disabled,
|
|
38
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
39
|
+
onSelect: () => ne(e.value),
|
|
40
|
+
value: e.label,
|
|
41
|
+
children: e.label
|
|
42
|
+
}, e.value))]
|
|
43
|
+
});
|
|
44
|
+
return /* @__PURE__ */ S("div", {
|
|
45
|
+
className: "w-full",
|
|
46
|
+
ref: F,
|
|
47
|
+
children: [
|
|
48
|
+
j && /* @__PURE__ */ x("input", {
|
|
49
|
+
type: "hidden",
|
|
50
|
+
name: j,
|
|
51
|
+
value: R,
|
|
52
|
+
disabled: K
|
|
53
|
+
}),
|
|
54
|
+
O && /* @__PURE__ */ x(d, {
|
|
55
|
+
className: n("mb-2 block text-text-primary", k, K && "text-text-secondary"),
|
|
56
|
+
"data-testid": "spectral-combobox-label",
|
|
57
|
+
htmlFor: U,
|
|
58
|
+
children: O
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ S(_, {
|
|
61
|
+
ref: H,
|
|
62
|
+
label: B ?? O,
|
|
63
|
+
onKeyDown: re,
|
|
64
|
+
className: n("relative w-full", C),
|
|
65
|
+
children: [/* @__PURE__ */ S(f, {
|
|
66
|
+
"data-slot": "combobox-content",
|
|
67
|
+
"data-state": L,
|
|
68
|
+
"data-testid": "spectral-combobox-trigger",
|
|
69
|
+
className: n("h-12 cursor-pointer border-2 border-input-border bg-input-bg", "transition duration-200 hover:border-input-border--hover", "focus-within:border-input-border--focus focus-within:outline-none", "ring-0!", c(L), X && "border-input-border--focus", K && "pointer-events-none"),
|
|
70
|
+
onClick: ae,
|
|
71
|
+
style: s(),
|
|
72
|
+
children: [/* @__PURE__ */ x(_.Input, {
|
|
73
|
+
ref: V,
|
|
74
|
+
autoComplete: "off",
|
|
75
|
+
"data-slot": "input-group-control",
|
|
76
|
+
"aria-controls": W,
|
|
77
|
+
"aria-expanded": X,
|
|
78
|
+
"aria-label": B ?? O,
|
|
79
|
+
className: "min-w-0 px-3 py-1 text-base flex-1 border-0 bg-transparent outline-hidden placeholder:text-input-text-placeholder focus-visible:ring-0 focus-visible:outline-none",
|
|
80
|
+
disabled: K,
|
|
81
|
+
id: U,
|
|
82
|
+
onBlur: ie,
|
|
83
|
+
onFocus: () => !K && !q && Z(!0),
|
|
84
|
+
onValueChange: $,
|
|
85
|
+
placeholder: te?.label ?? P,
|
|
86
|
+
role: "combobox",
|
|
87
|
+
value: Q,
|
|
88
|
+
...Y
|
|
89
|
+
}), /* @__PURE__ */ x(p, {
|
|
90
|
+
align: "inline-end",
|
|
91
|
+
children: q ? /* @__PURE__ */ x(t, { className: "size-5 text-muted-foreground motion-safe:animate-spin" }) : /* @__PURE__ */ x(e, { className: n("size-5 text-muted-foreground shrink-0 transition-transform duration-200", X && "rotate-180") })
|
|
92
|
+
})]
|
|
93
|
+
}), /* @__PURE__ */ x("div", {
|
|
94
|
+
className: n("left-0 mt-1 rounded-lg p-1 shadow-md absolute top-full z-50 w-full border border-input-border bg-input-bg", "motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-top-2 motion-safe:zoom-in-95", !X && "hidden"),
|
|
95
|
+
"data-testid": "spectral-combobox-content",
|
|
96
|
+
children: oe()
|
|
97
|
+
})]
|
|
98
|
+
}),
|
|
99
|
+
J && E && /* @__PURE__ */ x(r, {
|
|
100
|
+
dataTestId: "spectral-combobox-error-message",
|
|
101
|
+
id: G,
|
|
102
|
+
message: E
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
});
|
|
175
106
|
};
|
|
107
|
+
C.displayName = "Combobox";
|
|
108
|
+
//#endregion
|
|
109
|
+
export { C as Combobox };
|