@spear-ai/spectral 1.11.2 → 1.12.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 +4 -0
- package/dist/.js +124 -121
- package/dist/{Accordion-CDXdSAST.js → Accordion-Cyrb2byI.js} +1 -1
- package/dist/Accordion.js +1 -1
- package/dist/Alert/AlertBase.js +1 -1
- package/dist/Alert.js +3 -3
- package/dist/{AnimatePresence-D-9jXfgI.js → AnimatePresence-D9FLxIGV.js} +1 -1
- package/dist/Avatar.js +46 -48
- package/dist/Badge.js +1 -1
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +1 -1
- package/dist/ButtonGroup.js +1 -1
- package/dist/ButtonIcon.js +1 -1
- package/dist/{Calendar-s4lyijkn.js → Calendar-Cnh_PTbQ.js} +4 -4
- package/dist/Checkbox/CheckboxBase.js +1 -1
- package/dist/Checkbox.d.ts +10 -3
- package/dist/Checkbox.js +55 -35
- package/dist/Combobox/ComboboxBase.js +1 -1
- package/dist/Combobox.d.ts +5 -3
- package/dist/Combobox.js +91 -92
- package/dist/{ComboboxBase-qX-mQhT6.js → ComboboxBase-BzDGK36x.js} +1 -1
- package/dist/ControlGroup/ControlGroupSelect.d.ts +5 -2
- package/dist/ControlGroup/ControlGroupSelect.js +33 -30
- package/dist/ControlGroup.d.ts +3 -2
- package/dist/ControlGroup.js +41 -33
- package/dist/DataCard/Card.js +1 -1
- package/dist/DataCard.js +1 -1
- package/dist/DateTimePicker/Calendar.js +1 -1
- package/dist/DateTimePicker/DateTimeDisplayInput.js +84 -83
- package/dist/DateTimePicker/DateTimeInput.js +2 -2
- package/dist/DateTimePicker/DateTimeUtils.js +1 -1
- package/dist/DateTimePicker/TimePeriodSelect.js +32 -35
- package/dist/DateTimePicker/TimePicker.js +2 -2
- package/dist/DateTimePicker.d.ts +1 -1
- package/dist/DateTimePicker.js +55 -52
- package/dist/{DateTimeUtils-DVvG6H-p.js → DateTimeUtils-BJUAMuot.js} +1 -1
- package/dist/Dialog.js +1 -1
- package/dist/DropdownMenu.d.ts +61 -0
- package/dist/DropdownMenu.js +869 -0
- package/dist/{HoverCard-CYDsIiVK.js → HoverCard-DERasp0v.js} +1 -1
- package/dist/HoverCard.js +1 -1
- package/dist/Icons/AdjustmentsIcon.d.ts +5 -0
- package/dist/Icons/AdjustmentsIcon.js +78 -0
- package/dist/Icons/MenuDotsIcon.d.ts +5 -0
- package/dist/Icons/MenuDotsIcon.js +36 -0
- package/dist/Icons/MenuIcon.d.ts +5 -0
- package/dist/Icons/MenuIcon.js +36 -0
- package/dist/Icons/index.d.ts +3 -0
- package/dist/Icons.js +81 -78
- package/dist/IconsAnimated/PanelLeftCloseIcon.js +3 -3
- package/dist/IconsAnimated/PanelLeftOpenIcon.js +3 -3
- package/dist/Input.js +1 -1
- package/dist/InputNumeric.js +1 -1
- package/dist/{InputOTP-cVn5Bzyp.js → InputOTP-BkSw_KIB.js} +12 -10
- package/dist/InputOTP.js +1 -1
- package/dist/Kbd.js +1 -1
- package/dist/Label.js +1 -1
- package/dist/MultiSelect/MultiSelectBase.d.ts +6 -4
- package/dist/MultiSelect/MultiSelectBase.js +235 -209
- package/dist/MultiSelect.d.ts +2 -1
- package/dist/MultiSelect.js +14 -12
- package/dist/Popover.js +1 -1
- package/dist/RadioButton.js +1 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
- package/dist/RadioButtonGroup.js +1 -1
- package/dist/RadioGroup-DqKggFnI.js +328 -0
- package/dist/RadioGroup.d.ts +7 -0
- package/dist/RadioGroup.js +1 -1
- package/dist/Select.d.ts +5 -2
- package/dist/Select.js +100 -85
- package/dist/Separator.js +1 -1
- package/dist/Skeleton.js +1 -1
- package/dist/{Slider-BzzZT3Zm.js → Slider-CfUFkWU4.js} +1 -1
- package/dist/Slider.js +1 -1
- package/dist/Switch-Wj_zov--.js +144 -0
- package/dist/Switch.d.ts +12 -3
- package/dist/Switch.js +1 -1
- package/dist/Tabs/TabsBase.js +4 -4
- package/dist/Tabs.js +1 -1
- package/dist/Textarea.d.ts +3 -2
- package/dist/Textarea.js +50 -45
- package/dist/{Toast-9zqXxKKO.js → Toast-CJvzLlMD.js} +1 -1
- package/dist/Toast.js +1 -1
- package/dist/Toggle.js +1 -1
- package/dist/ToggleGroup.js +1 -1
- package/dist/{Tooltip-D1K8kY1y.js → Tooltip-BR0tdif4.js} +2 -2
- package/dist/Tooltip.js +1 -1
- package/dist/Tray.js +4 -4
- package/dist/{chunk-h9knIhTc.js → chunk-C4rFPcKS.js} +1 -1
- package/dist/dist-DcUGLq_y.js +149 -0
- package/dist/main.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/input-group.js +1 -1
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/popover.js +1 -1
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +56 -53
- package/dist/primitives/textarea.js +1 -1
- package/dist/{proxy-Dn10Pl_g.js → proxy-CCB7C4Pu.js} +10 -10
- package/dist/styles/spectral.css +1 -1
- package/dist/{twUtils-VNWgstKL.js → twUtils-D_qzdiwM.js} +1 -1
- package/dist/{use-animation-CBUDycyW.js → use-animation-C-qL83hj.js} +1 -1
- package/dist/utils/dropdownPositioning.d.ts +13 -0
- package/dist/utils/dropdownPositioning.d.ts.map +1 -0
- package/dist/utils/dropdownPositioning.js +43 -0
- package/dist/utils/dropdownPositioning.test.d.ts +2 -0
- package/dist/utils/dropdownPositioning.test.d.ts.map +1 -0
- package/dist/utils/dropdownPositioning.test.js +21 -0
- package/dist/utils/formFieldUtils.d.ts +15 -1
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +35 -19
- package/dist/utils/twUtils.js +1 -1
- package/package.json +26 -22
- package/dist/RadioGroup-w_q6RGEK.js +0 -447
- package/dist/Switch-CVzRJ-0n.js +0 -126
- /package/dist/{dist-B4FgboI8.js → dist-Cujfuel1.js} +0 -0
|
@@ -1,447 +0,0 @@
|
|
|
1
|
-
import "./styles/main.css";
|
|
2
|
-
import { a as e, d as t, l as n, r, t as i } from "./dist-7HRQ5IKN.js";
|
|
3
|
-
import { n as a, t as o } from "./dist-CGzgmYB9.js";
|
|
4
|
-
import { t as s } from "./dist-Bft31cJh.js";
|
|
5
|
-
import { t as c } from "./dist-Dtvmk11N.js";
|
|
6
|
-
import { t as l } from "./twUtils-VNWgstKL.js";
|
|
7
|
-
import { Label as u } from "./Label.js";
|
|
8
|
-
import { t as d } from "./dist-ClmepHp4.js";
|
|
9
|
-
import { t as f } from "./dist-BK1K0g9W.js";
|
|
10
|
-
import { t as p } from "./dist-s1uWaZYZ.js";
|
|
11
|
-
import { a as m, i as h, o as g, t as _, u as v } from "./proxy-Dn10Pl_g.js";
|
|
12
|
-
import { t as y } from "./AnimatePresence-D-9jXfgI.js";
|
|
13
|
-
import * as b from "react";
|
|
14
|
-
import { createContext as ee, memo as x, useContext as S, useId as C, useMemo as w, useState as T } from "react";
|
|
15
|
-
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
16
|
-
//#region node_modules/.pnpm/@radix-ui+react-roving-focus@1.1.11_@types+react-dom@19.2.3_@types+react@19.2.14__@type_201cfa283d5b26fb84e6cfb74449149c/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
17
|
-
var O = "rovingFocusGroup.onEntryFocus", te = {
|
|
18
|
-
bubbles: !1,
|
|
19
|
-
cancelable: !0
|
|
20
|
-
}, k = "RovingFocusGroup", [A, j, M] = a(k), [N, P] = t(k, [M]), [ne, re] = N(k), ie = b.forwardRef((e, t) => /* @__PURE__ */ E(A.Provider, {
|
|
21
|
-
scope: e.__scopeRovingFocusGroup,
|
|
22
|
-
children: /* @__PURE__ */ E(A.Slot, {
|
|
23
|
-
scope: e.__scopeRovingFocusGroup,
|
|
24
|
-
children: /* @__PURE__ */ E(ae, {
|
|
25
|
-
...e,
|
|
26
|
-
ref: t
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
}));
|
|
30
|
-
ie.displayName = k;
|
|
31
|
-
var ae = b.forwardRef((t, a) => {
|
|
32
|
-
let { __scopeRovingFocusGroup: s, orientation: c, loop: l = !1, dir: u, currentTabStopId: f, defaultCurrentTabStopId: p, onCurrentTabStopIdChange: m, onEntryFocus: h, preventScrollOnEntryFocus: g = !1, ..._ } = t, v = b.useRef(null), y = n(a, v), ee = o(u), [x, S] = r({
|
|
33
|
-
prop: f,
|
|
34
|
-
defaultProp: p ?? null,
|
|
35
|
-
onChange: m,
|
|
36
|
-
caller: k
|
|
37
|
-
}), [C, w] = b.useState(!1), T = d(h), D = j(s), A = b.useRef(!1), [M, N] = b.useState(0);
|
|
38
|
-
return b.useEffect(() => {
|
|
39
|
-
let e = v.current;
|
|
40
|
-
if (e) return e.addEventListener(O, T), () => e.removeEventListener(O, T);
|
|
41
|
-
}, [T]), /* @__PURE__ */ E(ne, {
|
|
42
|
-
scope: s,
|
|
43
|
-
orientation: c,
|
|
44
|
-
dir: ee,
|
|
45
|
-
loop: l,
|
|
46
|
-
currentTabStopId: x,
|
|
47
|
-
onItemFocus: b.useCallback((e) => S(e), [S]),
|
|
48
|
-
onItemShiftTab: b.useCallback(() => w(!0), []),
|
|
49
|
-
onFocusableItemAdd: b.useCallback(() => N((e) => e + 1), []),
|
|
50
|
-
onFocusableItemRemove: b.useCallback(() => N((e) => e - 1), []),
|
|
51
|
-
children: /* @__PURE__ */ E(i.div, {
|
|
52
|
-
tabIndex: C || M === 0 ? -1 : 0,
|
|
53
|
-
"data-orientation": c,
|
|
54
|
-
..._,
|
|
55
|
-
ref: y,
|
|
56
|
-
style: {
|
|
57
|
-
outline: "none",
|
|
58
|
-
...t.style
|
|
59
|
-
},
|
|
60
|
-
onMouseDown: e(t.onMouseDown, () => {
|
|
61
|
-
A.current = !0;
|
|
62
|
-
}),
|
|
63
|
-
onFocus: e(t.onFocus, (e) => {
|
|
64
|
-
let t = !A.current;
|
|
65
|
-
if (e.target === e.currentTarget && t && !C) {
|
|
66
|
-
let t = new CustomEvent(O, te);
|
|
67
|
-
if (e.currentTarget.dispatchEvent(t), !t.defaultPrevented) {
|
|
68
|
-
let e = D().filter((e) => e.focusable);
|
|
69
|
-
L([
|
|
70
|
-
e.find((e) => e.active),
|
|
71
|
-
e.find((e) => e.id === x),
|
|
72
|
-
...e
|
|
73
|
-
].filter(Boolean).map((e) => e.ref.current), g);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
A.current = !1;
|
|
77
|
-
}),
|
|
78
|
-
onBlur: e(t.onBlur, () => w(!1))
|
|
79
|
-
})
|
|
80
|
-
});
|
|
81
|
-
}), F = "RovingFocusGroupItem", I = b.forwardRef((t, n) => {
|
|
82
|
-
let { __scopeRovingFocusGroup: r, focusable: a = !0, active: o = !1, tabStopId: s, children: l, ...u } = t, d = c(), f = s || d, p = re(F, r), m = p.currentTabStopId === f, h = j(r), { onFocusableItemAdd: g, onFocusableItemRemove: _, currentTabStopId: v } = p;
|
|
83
|
-
return b.useEffect(() => {
|
|
84
|
-
if (a) return g(), () => _();
|
|
85
|
-
}, [
|
|
86
|
-
a,
|
|
87
|
-
g,
|
|
88
|
-
_
|
|
89
|
-
]), /* @__PURE__ */ E(A.ItemSlot, {
|
|
90
|
-
scope: r,
|
|
91
|
-
id: f,
|
|
92
|
-
focusable: a,
|
|
93
|
-
active: o,
|
|
94
|
-
children: /* @__PURE__ */ E(i.span, {
|
|
95
|
-
tabIndex: m ? 0 : -1,
|
|
96
|
-
"data-orientation": p.orientation,
|
|
97
|
-
...u,
|
|
98
|
-
ref: n,
|
|
99
|
-
onMouseDown: e(t.onMouseDown, (e) => {
|
|
100
|
-
a ? p.onItemFocus(f) : e.preventDefault();
|
|
101
|
-
}),
|
|
102
|
-
onFocus: e(t.onFocus, () => p.onItemFocus(f)),
|
|
103
|
-
onKeyDown: e(t.onKeyDown, (e) => {
|
|
104
|
-
if (e.key === "Tab" && e.shiftKey) {
|
|
105
|
-
p.onItemShiftTab();
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (e.target !== e.currentTarget) return;
|
|
109
|
-
let t = ce(e, p.orientation, p.dir);
|
|
110
|
-
if (t !== void 0) {
|
|
111
|
-
if (e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
let n = h().filter((e) => e.focusable).map((e) => e.ref.current);
|
|
114
|
-
if (t === "last") n.reverse();
|
|
115
|
-
else if (t === "prev" || t === "next") {
|
|
116
|
-
t === "prev" && n.reverse();
|
|
117
|
-
let r = n.indexOf(e.currentTarget);
|
|
118
|
-
n = p.loop ? le(n, r + 1) : n.slice(r + 1);
|
|
119
|
-
}
|
|
120
|
-
setTimeout(() => L(n));
|
|
121
|
-
}
|
|
122
|
-
}),
|
|
123
|
-
children: typeof l == "function" ? l({
|
|
124
|
-
isCurrentTabStop: m,
|
|
125
|
-
hasTabStop: v != null
|
|
126
|
-
}) : l
|
|
127
|
-
})
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
I.displayName = F;
|
|
131
|
-
var oe = {
|
|
132
|
-
ArrowLeft: "prev",
|
|
133
|
-
ArrowUp: "prev",
|
|
134
|
-
ArrowRight: "next",
|
|
135
|
-
ArrowDown: "next",
|
|
136
|
-
PageUp: "first",
|
|
137
|
-
Home: "first",
|
|
138
|
-
PageDown: "last",
|
|
139
|
-
End: "last"
|
|
140
|
-
};
|
|
141
|
-
function se(e, t) {
|
|
142
|
-
return t === "rtl" ? e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e : e;
|
|
143
|
-
}
|
|
144
|
-
function ce(e, t, n) {
|
|
145
|
-
let r = se(e.key, n);
|
|
146
|
-
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r))) return oe[r];
|
|
147
|
-
}
|
|
148
|
-
function L(e, t = !1) {
|
|
149
|
-
let n = document.activeElement;
|
|
150
|
-
for (let r of e) if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
151
|
-
}
|
|
152
|
-
function le(e, t) {
|
|
153
|
-
return e.map((n, r) => e[(t + r) % e.length]);
|
|
154
|
-
}
|
|
155
|
-
var ue = ie, de = I, R = "Radio", [fe, z] = t(R), [pe, me] = fe(R), B = b.forwardRef((t, r) => {
|
|
156
|
-
let { __scopeRadio: a, name: o, checked: s = !1, required: c, disabled: l, value: u = "on", onCheck: d, form: f, ...p } = t, [m, h] = b.useState(null), g = n(r, (e) => h(e)), _ = b.useRef(!1), v = m ? f || !!m.closest("form") : !0;
|
|
157
|
-
return /* @__PURE__ */ D(pe, {
|
|
158
|
-
scope: a,
|
|
159
|
-
checked: s,
|
|
160
|
-
disabled: l,
|
|
161
|
-
children: [/* @__PURE__ */ E(i.button, {
|
|
162
|
-
type: "button",
|
|
163
|
-
role: "radio",
|
|
164
|
-
"aria-checked": s,
|
|
165
|
-
"data-state": W(s),
|
|
166
|
-
"data-disabled": l ? "" : void 0,
|
|
167
|
-
disabled: l,
|
|
168
|
-
value: u,
|
|
169
|
-
...p,
|
|
170
|
-
ref: g,
|
|
171
|
-
onClick: e(t.onClick, (e) => {
|
|
172
|
-
s || d?.(), v && (_.current = e.isPropagationStopped(), _.current || e.stopPropagation());
|
|
173
|
-
})
|
|
174
|
-
}), v && /* @__PURE__ */ E(U, {
|
|
175
|
-
control: m,
|
|
176
|
-
bubbles: !_.current,
|
|
177
|
-
name: o,
|
|
178
|
-
value: u,
|
|
179
|
-
checked: s,
|
|
180
|
-
required: c,
|
|
181
|
-
disabled: l,
|
|
182
|
-
form: f,
|
|
183
|
-
style: { transform: "translateX(-100%)" }
|
|
184
|
-
})]
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
B.displayName = R;
|
|
188
|
-
var V = "RadioIndicator", H = b.forwardRef((e, t) => {
|
|
189
|
-
let { __scopeRadio: n, forceMount: r, ...a } = e, o = me(V, n);
|
|
190
|
-
return /* @__PURE__ */ E(s, {
|
|
191
|
-
present: r || o.checked,
|
|
192
|
-
children: /* @__PURE__ */ E(i.span, {
|
|
193
|
-
"data-state": W(o.checked),
|
|
194
|
-
"data-disabled": o.disabled ? "" : void 0,
|
|
195
|
-
...a,
|
|
196
|
-
ref: t
|
|
197
|
-
})
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
H.displayName = V;
|
|
201
|
-
var he = "RadioBubbleInput", U = b.forwardRef(({ __scopeRadio: e, control: t, checked: r, bubbles: a = !0, ...o }, s) => {
|
|
202
|
-
let c = b.useRef(null), l = n(c, s), u = p(r), d = f(t);
|
|
203
|
-
return b.useEffect(() => {
|
|
204
|
-
let e = c.current;
|
|
205
|
-
if (!e) return;
|
|
206
|
-
let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
|
|
207
|
-
if (u !== r && n) {
|
|
208
|
-
let t = new Event("click", { bubbles: a });
|
|
209
|
-
n.call(e, r), e.dispatchEvent(t);
|
|
210
|
-
}
|
|
211
|
-
}, [
|
|
212
|
-
u,
|
|
213
|
-
r,
|
|
214
|
-
a
|
|
215
|
-
]), /* @__PURE__ */ E(i.input, {
|
|
216
|
-
type: "radio",
|
|
217
|
-
"aria-hidden": !0,
|
|
218
|
-
defaultChecked: r,
|
|
219
|
-
...o,
|
|
220
|
-
tabIndex: -1,
|
|
221
|
-
ref: l,
|
|
222
|
-
style: {
|
|
223
|
-
...o.style,
|
|
224
|
-
...d,
|
|
225
|
-
position: "absolute",
|
|
226
|
-
pointerEvents: "none",
|
|
227
|
-
opacity: 0,
|
|
228
|
-
margin: 0
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
U.displayName = he;
|
|
233
|
-
function W(e) {
|
|
234
|
-
return e ? "checked" : "unchecked";
|
|
235
|
-
}
|
|
236
|
-
var ge = [
|
|
237
|
-
"ArrowUp",
|
|
238
|
-
"ArrowDown",
|
|
239
|
-
"ArrowLeft",
|
|
240
|
-
"ArrowRight"
|
|
241
|
-
], G = "RadioGroup", [_e, ve] = t(G, [P, z]), K = P(), q = z(), [ye, be] = _e(G), J = b.forwardRef((e, t) => {
|
|
242
|
-
let { __scopeRadioGroup: n, name: a, defaultValue: s, value: c, required: l = !1, disabled: u = !1, orientation: d, dir: f, loop: p = !0, onValueChange: m, ...h } = e, g = K(n), _ = o(f), [v, y] = r({
|
|
243
|
-
prop: c,
|
|
244
|
-
defaultProp: s ?? null,
|
|
245
|
-
onChange: m,
|
|
246
|
-
caller: G
|
|
247
|
-
});
|
|
248
|
-
return /* @__PURE__ */ E(ye, {
|
|
249
|
-
scope: n,
|
|
250
|
-
name: a,
|
|
251
|
-
required: l,
|
|
252
|
-
disabled: u,
|
|
253
|
-
value: v,
|
|
254
|
-
onValueChange: y,
|
|
255
|
-
children: /* @__PURE__ */ E(ue, {
|
|
256
|
-
asChild: !0,
|
|
257
|
-
...g,
|
|
258
|
-
orientation: d,
|
|
259
|
-
dir: _,
|
|
260
|
-
loop: p,
|
|
261
|
-
children: /* @__PURE__ */ E(i.div, {
|
|
262
|
-
role: "radiogroup",
|
|
263
|
-
"aria-required": l,
|
|
264
|
-
"aria-orientation": d,
|
|
265
|
-
"data-disabled": u ? "" : void 0,
|
|
266
|
-
dir: _,
|
|
267
|
-
...h,
|
|
268
|
-
ref: t
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
});
|
|
272
|
-
});
|
|
273
|
-
J.displayName = G;
|
|
274
|
-
var Y = "RadioGroupItem", X = b.forwardRef((t, r) => {
|
|
275
|
-
let { __scopeRadioGroup: i, disabled: a, ...o } = t, s = be(Y, i), c = s.disabled || a, l = K(i), u = q(i), d = b.useRef(null), f = n(r, d), p = s.value === o.value, m = b.useRef(!1);
|
|
276
|
-
return b.useEffect(() => {
|
|
277
|
-
let e = (e) => {
|
|
278
|
-
ge.includes(e.key) && (m.current = !0);
|
|
279
|
-
}, t = () => m.current = !1;
|
|
280
|
-
return document.addEventListener("keydown", e), document.addEventListener("keyup", t), () => {
|
|
281
|
-
document.removeEventListener("keydown", e), document.removeEventListener("keyup", t);
|
|
282
|
-
};
|
|
283
|
-
}, []), /* @__PURE__ */ E(de, {
|
|
284
|
-
asChild: !0,
|
|
285
|
-
...l,
|
|
286
|
-
focusable: !c,
|
|
287
|
-
active: p,
|
|
288
|
-
children: /* @__PURE__ */ E(B, {
|
|
289
|
-
disabled: c,
|
|
290
|
-
required: s.required,
|
|
291
|
-
checked: p,
|
|
292
|
-
...u,
|
|
293
|
-
...o,
|
|
294
|
-
name: s.name,
|
|
295
|
-
ref: f,
|
|
296
|
-
onCheck: () => s.onValueChange(o.value),
|
|
297
|
-
onKeyDown: e((e) => {
|
|
298
|
-
e.key === "Enter" && e.preventDefault();
|
|
299
|
-
}),
|
|
300
|
-
onFocus: e(o.onFocus, () => {
|
|
301
|
-
m.current && d.current?.click();
|
|
302
|
-
})
|
|
303
|
-
})
|
|
304
|
-
});
|
|
305
|
-
});
|
|
306
|
-
X.displayName = Y;
|
|
307
|
-
var xe = "RadioGroupIndicator", Z = b.forwardRef((e, t) => {
|
|
308
|
-
let { __scopeRadioGroup: n, ...r } = e;
|
|
309
|
-
return /* @__PURE__ */ E(H, {
|
|
310
|
-
...q(n),
|
|
311
|
-
...r,
|
|
312
|
-
ref: t
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
Z.displayName = xe;
|
|
316
|
-
var Se = J, Q = X, Ce = Z;
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region node_modules/.pnpm/framer-motion@12.38.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.mjs
|
|
319
|
-
function we() {
|
|
320
|
-
!m.current && h();
|
|
321
|
-
let [e] = T(g.current);
|
|
322
|
-
return process.env.NODE_ENV !== "production" && v(e !== !0, "You have Reduced Motion enabled on your device. Animations may not appear as expected.", "reduced-motion-disabled"), e;
|
|
323
|
-
}
|
|
324
|
-
//#endregion
|
|
325
|
-
//#region src/components/RadioGroup/RadioGroup.tsx
|
|
326
|
-
var Te = ee({
|
|
327
|
-
disabledValues: [],
|
|
328
|
-
groupDisabled: !1,
|
|
329
|
-
orientation: "vertical",
|
|
330
|
-
variant: "default"
|
|
331
|
-
}), $ = "pointer-events-none opacity-60", Ee = (e) => {
|
|
332
|
-
let t = "selected" in e, { className: n, disabled: r, itemClassName: i, onValueChange: a, orientation: o = "vertical", ref: s, selected: c, variant: u = "default", ...d } = e, f = t ? c ?? "" : c, p = w(() => ({
|
|
333
|
-
disabledValues: Array.isArray(r) ? r : [],
|
|
334
|
-
groupDisabled: typeof r == "boolean" ? r : !1,
|
|
335
|
-
itemClassName: i,
|
|
336
|
-
orientation: o,
|
|
337
|
-
selected: f,
|
|
338
|
-
variant: u
|
|
339
|
-
}), [
|
|
340
|
-
o,
|
|
341
|
-
u,
|
|
342
|
-
r,
|
|
343
|
-
i,
|
|
344
|
-
f
|
|
345
|
-
]);
|
|
346
|
-
return /* @__PURE__ */ E(Te.Provider, {
|
|
347
|
-
value: p,
|
|
348
|
-
children: /* @__PURE__ */ E(Se, {
|
|
349
|
-
className: l("flex w-full text-text-primary", o === "vertical" ? "gap-4 flex-col" : "gap-5 flex-row", u === "unstyled" && "gap-2.5 w-fit", n),
|
|
350
|
-
"data-testid": "spectral-radio-group",
|
|
351
|
-
disabled: p.groupDisabled,
|
|
352
|
-
onValueChange: a,
|
|
353
|
-
ref: s,
|
|
354
|
-
value: f,
|
|
355
|
-
...d
|
|
356
|
-
})
|
|
357
|
-
});
|
|
358
|
-
};
|
|
359
|
-
Ee.displayName = "RadioGroup";
|
|
360
|
-
var De = {
|
|
361
|
-
type: "spring",
|
|
362
|
-
stiffness: 200,
|
|
363
|
-
damping: 16
|
|
364
|
-
}, Oe = x(({ className: e, id: t, isDisabled: n, ref: r, transition: i = De, value: a, ...o }) => we() ? /* @__PURE__ */ E(Q, {
|
|
365
|
-
className: l("h-4.5 w-4.5 border-border-subtle ring-black relative aspect-square cursor-pointer rounded-full border-2 bg-radio-bg transition-colors", "hover:border-radio-border--hover focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-accent", "data-[state=checked]:border-radio-border--selected data-[state=checked]:bg-radio-bg", n && $, e),
|
|
366
|
-
"data-testid": "spectral-radio-group-item",
|
|
367
|
-
disabled: n,
|
|
368
|
-
id: t,
|
|
369
|
-
ref: r,
|
|
370
|
-
value: a,
|
|
371
|
-
...o,
|
|
372
|
-
children: /* @__PURE__ */ E(Ce, { className: l("after:inset-0 after:h-2.5 after:w-2.5 after:absolute after:m-auto after:rounded-full after:bg-radio-bg--selected after:content-['']", n && $) })
|
|
373
|
-
}) : /* @__PURE__ */ E(Q, {
|
|
374
|
-
value: a,
|
|
375
|
-
id: t,
|
|
376
|
-
disabled: n,
|
|
377
|
-
asChild: !0,
|
|
378
|
-
...o,
|
|
379
|
-
children: /* @__PURE__ */ E(_.button, {
|
|
380
|
-
className: l("h-4.5 w-4.5 border-border-subtle ring-black relative aspect-square cursor-pointer rounded-full border-2 bg-radio-bg transition-colors", "hover:border-radio-border--hover focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-accent", "data-[state=checked]:border-radio-border--selected data-[state=checked]:bg-radio-bg", n && $, e),
|
|
381
|
-
"data-testid": "spectral-radio-group-item",
|
|
382
|
-
ref: r,
|
|
383
|
-
whileHover: { scale: 1.05 },
|
|
384
|
-
whileTap: { scale: .95 },
|
|
385
|
-
children: /* @__PURE__ */ E(Ce, {
|
|
386
|
-
className: "relative flex items-center justify-center",
|
|
387
|
-
children: /* @__PURE__ */ E(y, { children: /* @__PURE__ */ E(_.div, {
|
|
388
|
-
animate: {
|
|
389
|
-
opacity: 1,
|
|
390
|
-
scale: 1
|
|
391
|
-
},
|
|
392
|
-
className: "h-2.5 w-2.5 absolute rounded-full bg-radio-bg--selected",
|
|
393
|
-
exit: {
|
|
394
|
-
opacity: 0,
|
|
395
|
-
scale: 0
|
|
396
|
-
},
|
|
397
|
-
initial: {
|
|
398
|
-
opacity: 0,
|
|
399
|
-
scale: 0
|
|
400
|
-
},
|
|
401
|
-
transition: i
|
|
402
|
-
}, "radio-indicator") })
|
|
403
|
-
})
|
|
404
|
-
})
|
|
405
|
-
}));
|
|
406
|
-
Oe.displayName = "RadioButton";
|
|
407
|
-
var ke = ({ children: e, className: t, disabled: n, ref: r, value: i, ...a }) => {
|
|
408
|
-
let { disabledValues: o, groupDisabled: s, itemClassName: c, variant: d, orientation: f } = S(Te), p = C(), m = i.toString(), h = a.id?.toString() ?? `${m}-${p}`, g = s || o.includes(m) || !!n;
|
|
409
|
-
return d === "unstyled" ? /* @__PURE__ */ E(Q, {
|
|
410
|
-
asChild: !0,
|
|
411
|
-
"data-testid": "spectral-radio-group-item",
|
|
412
|
-
disabled: g,
|
|
413
|
-
id: h,
|
|
414
|
-
ref: r,
|
|
415
|
-
value: m,
|
|
416
|
-
...a,
|
|
417
|
-
children: /* @__PURE__ */ E(u, {
|
|
418
|
-
className: l("rounded flex h-fit w-fit border-2 border-transparent data-[state=checked]:border-radio-border--selected", g && $, c, t),
|
|
419
|
-
"data-testid": "spectral-radio-group-item-label",
|
|
420
|
-
htmlFor: h,
|
|
421
|
-
children: e
|
|
422
|
-
})
|
|
423
|
-
}) : /* @__PURE__ */ D("div", {
|
|
424
|
-
className: l("flex items-center", g && $, c, t, f),
|
|
425
|
-
children: [/* @__PURE__ */ E(Oe, {
|
|
426
|
-
ref: r,
|
|
427
|
-
value: m,
|
|
428
|
-
id: h,
|
|
429
|
-
isDisabled: g,
|
|
430
|
-
...a
|
|
431
|
-
}), e && /* @__PURE__ */ E(u, {
|
|
432
|
-
className: l("text-md font-normal cursor-pointer", f === "vertical" ? "ml-2" : "ml-1"),
|
|
433
|
-
htmlFor: h,
|
|
434
|
-
children: e
|
|
435
|
-
})]
|
|
436
|
-
});
|
|
437
|
-
};
|
|
438
|
-
ke.displayName = "RadioGroup.Item";
|
|
439
|
-
var Ae = ({ ref: e, className: t, ...n }) => /* @__PURE__ */ E(u, {
|
|
440
|
-
ref: e,
|
|
441
|
-
"data-testid": "spectral-radio-group-label",
|
|
442
|
-
className: l("text-md font-medium block", t),
|
|
443
|
-
...n
|
|
444
|
-
});
|
|
445
|
-
Ae.displayName = "RadioGroup.Label";
|
|
446
|
-
//#endregion
|
|
447
|
-
export { ke as n, Ae as r, Ee as t };
|
package/dist/Switch-CVzRJ-0n.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import "./styles/main.css";
|
|
2
|
-
import { t as e } from "./twUtils-VNWgstKL.js";
|
|
3
|
-
import { Label as t } from "./Label.js";
|
|
4
|
-
import { Switch as n, SwitchThumb as r } from "./Switch/SwitchBase.js";
|
|
5
|
-
import { createElement as i, forwardRef as a } from "react";
|
|
6
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
//#region node_modules/.pnpm/lucide-react@0.562.0_react@19.2.3/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
8
|
-
var c = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), l = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), u = (e) => {
|
|
9
|
-
let t = l(e);
|
|
10
|
-
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
11
|
-
}, d = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), f = (e) => {
|
|
12
|
-
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
13
|
-
}, p = {
|
|
14
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
-
width: 24,
|
|
16
|
-
height: 24,
|
|
17
|
-
viewBox: "0 0 24 24",
|
|
18
|
-
fill: "none",
|
|
19
|
-
stroke: "currentColor",
|
|
20
|
-
strokeWidth: 2,
|
|
21
|
-
strokeLinecap: "round",
|
|
22
|
-
strokeLinejoin: "round"
|
|
23
|
-
}, m = a(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => i("svg", {
|
|
24
|
-
ref: l,
|
|
25
|
-
...p,
|
|
26
|
-
width: t,
|
|
27
|
-
height: t,
|
|
28
|
-
stroke: e,
|
|
29
|
-
strokeWidth: r ? Number(n) * 24 / Number(t) : n,
|
|
30
|
-
className: d("lucide", a),
|
|
31
|
-
...!o && !f(c) && { "aria-hidden": "true" },
|
|
32
|
-
...c
|
|
33
|
-
}, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]])), h = (e, t) => {
|
|
34
|
-
let n = a(({ className: n, ...r }, a) => i(m, {
|
|
35
|
-
ref: a,
|
|
36
|
-
iconNode: t,
|
|
37
|
-
className: d(`lucide-${c(u(e))}`, `lucide-${e}`, n),
|
|
38
|
-
...r
|
|
39
|
-
}));
|
|
40
|
-
return n.displayName = u(e), n;
|
|
41
|
-
}, g = h("check", [["path", {
|
|
42
|
-
d: "M20 6 9 17l-5-5",
|
|
43
|
-
key: "1gmf2c"
|
|
44
|
-
}]]), _ = h("x", [["path", {
|
|
45
|
-
d: "M18 6 6 18",
|
|
46
|
-
key: "1bl5f8"
|
|
47
|
-
}], ["path", {
|
|
48
|
-
d: "m6 6 12 12",
|
|
49
|
-
key: "d8bk6v"
|
|
50
|
-
}]]), v = "bg-switch-thumb--checked data-[state=checked]:bg-switch-thumb pointer-events-none block rounded-full ring-0 transition-transform motion-reduce:transition-none", y = ({ className: i, disabled: a, hideLabel: c = !1, id: l, labelPosition: u = "right", labelText: d, name: f, onChange: p, ref: m, required: h, value: y, variant: b, ...x }) => {
|
|
51
|
-
let S = b === "squared", C = b === "permanent-indicator";
|
|
52
|
-
return /* @__PURE__ */ s("div", {
|
|
53
|
-
className: "flex items-center",
|
|
54
|
-
"data-testid": "spectral-switch-container",
|
|
55
|
-
children: [
|
|
56
|
-
u === "left" && !c && /* @__PURE__ */ o(t, {
|
|
57
|
-
className: "mr-2",
|
|
58
|
-
"data-testid": "spectral-switch-label-left",
|
|
59
|
-
htmlFor: l,
|
|
60
|
-
children: d
|
|
61
|
-
}),
|
|
62
|
-
C ? /* @__PURE__ */ s("div", {
|
|
63
|
-
className: "h-7 text-sm font-medium relative inline-grid grid-cols-[1fr_1fr] items-center",
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ o(n, {
|
|
66
|
-
"aria-required": h,
|
|
67
|
-
className: e("peer inset-0 w-14 focus-visible:ring-ring absolute inline-flex h-[inherit] items-center focus-visible:ring-offset-background data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg/50", "shadow-2xs cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", i),
|
|
68
|
-
"data-testid": "spectral-switch",
|
|
69
|
-
disabled: a,
|
|
70
|
-
id: l,
|
|
71
|
-
name: f,
|
|
72
|
-
onCheckedChange: p,
|
|
73
|
-
ref: m,
|
|
74
|
-
required: h,
|
|
75
|
-
value: y,
|
|
76
|
-
...x,
|
|
77
|
-
children: /* @__PURE__ */ o(r, { className: e(v, "size-6.5 shadow-xs relative z-10 duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] data-[state=checked]:translate-x-[26px] motion-reduce:duration-0 data-[state=checked]:rtl:-translate-x-[26px]") })
|
|
78
|
-
}),
|
|
79
|
-
/* @__PURE__ */ o("span", {
|
|
80
|
-
className: "ml-0.5 min-w-8 peer-data-[state=unchecked]:translate-x-6 peer-data-[state=unchecked]:rtl:-translate-x-6 motion-reduce:translate-x-0 pointer-events-none relative flex items-center justify-center text-center transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] peer-data-[state=checked]:invisible motion-reduce:transition-none motion-reduce:duration-0",
|
|
81
|
-
children: /* @__PURE__ */ o(_, {
|
|
82
|
-
"aria-hidden": "true",
|
|
83
|
-
className: "size-4"
|
|
84
|
-
})
|
|
85
|
-
}),
|
|
86
|
-
/* @__PURE__ */ o("span", {
|
|
87
|
-
className: "min-w-8 motion-reduce:translate-x-0 pointer-events-none relative flex items-center justify-center text-center transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] peer-data-[state=checked]:-translate-x-full peer-data-[state=checked]:text-background peer-data-[state=unchecked]:invisible motion-reduce:transition-none motion-reduce:duration-0 peer-data-[state=checked]:rtl:translate-x-full",
|
|
88
|
-
children: /* @__PURE__ */ o(g, {
|
|
89
|
-
"aria-hidden": "true",
|
|
90
|
-
className: "size-4"
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
]
|
|
94
|
-
}) : /* @__PURE__ */ o(n, {
|
|
95
|
-
"aria-required": h,
|
|
96
|
-
className: e(S ? "peer h-6 w-10 rounded-sm focus-visible:ring-black inline-flex shrink-0 items-center border-2 border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg [&_span]:rounded-[4px]" : "focus-visible:ring-ring peer h-6 w-10 shadow-2xs inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-switch-bg--checked data-[state=unchecked]:bg-switch-bg", i),
|
|
97
|
-
"data-testid": "spectral-switch",
|
|
98
|
-
disabled: a,
|
|
99
|
-
id: l,
|
|
100
|
-
name: f,
|
|
101
|
-
onCheckedChange: p,
|
|
102
|
-
ref: m,
|
|
103
|
-
required: h,
|
|
104
|
-
value: y,
|
|
105
|
-
...x,
|
|
106
|
-
children: /* @__PURE__ */ o(r, { className: e(v, S ? "size-5 shadow-xs data-[state=checked]:translate-x-4 data-[state=checked]:rtl:-translate-x-4" : "h-5 w-5 shadow-lg data-[state=checked]:translate-x-4") })
|
|
107
|
-
}),
|
|
108
|
-
u === "right" && !c && /* @__PURE__ */ o(t, {
|
|
109
|
-
className: "ml-2",
|
|
110
|
-
"data-testid": "spectral-switch-label-right",
|
|
111
|
-
htmlFor: l,
|
|
112
|
-
id: `${l}-label`,
|
|
113
|
-
children: d
|
|
114
|
-
}),
|
|
115
|
-
c && /* @__PURE__ */ o(t, {
|
|
116
|
-
className: "sr-only",
|
|
117
|
-
"data-testid": "spectral-switch-label-hidden",
|
|
118
|
-
htmlFor: l,
|
|
119
|
-
children: d
|
|
120
|
-
})
|
|
121
|
-
]
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
y.displayName = "Switch";
|
|
125
|
-
//#endregion
|
|
126
|
-
export { y as t };
|
|
File without changes
|