@spear-ai/spectral 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Accordion.d.ts +7 -7
- package/dist/Accordion.js +53 -51
- package/dist/Alert/AlertBase.js +6 -6
- package/dist/Alert.js +1 -1
- package/dist/Avatar.d.ts +2 -2
- package/dist/Avatar.js +46 -46
- package/dist/Badge.js +3 -3
- package/dist/Button.js +19 -12
- package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroupButton.js +10 -10
- package/dist/ButtonGroup.d.ts +8 -5
- package/dist/ButtonGroup.js +22 -14
- package/dist/ButtonIcon.d.ts +1 -1
- package/dist/ButtonIcon.js +5 -5
- package/dist/Card.d.ts +1 -1
- package/dist/Card.js +10 -10
- package/dist/Checkbox/CheckboxBase.d.ts +6 -6
- package/dist/Checkbox/CheckboxBase.js +65 -63
- package/dist/Checkbox.js +16 -14
- package/dist/Dialog/DialogBase.d.ts +37 -25
- package/dist/Dialog/DialogBase.js +130 -104
- package/dist/Dialog.d.ts +8 -8
- package/dist/Dialog.js +46 -36
- package/dist/Drawer.js +17 -17
- package/dist/HoverCard.d.ts +4 -4
- package/dist/HoverCard.js +34 -33
- package/dist/Input.js +58 -58
- package/dist/InputOTP.d.ts +1 -1
- package/dist/InputOTP.js +113 -112
- package/dist/MultiSelect/MultiSelectBase.d.ts +16 -16
- package/dist/MultiSelect/MultiSelectBase.js +236 -177
- package/dist/MultiSelect/MutiSelect.d.ts +6 -4
- package/dist/MultiSelect/MutiSelect.js +13 -12
- package/dist/Popover.js +2 -1
- package/dist/RadioButtonGroup/RadioButtonGroupBase.js +18 -17
- package/dist/RadioGroup.js +5 -3
- package/dist/Select.js +70 -51
- package/dist/Slider.js +8 -4
- package/dist/Switch/SwitchBase.d.ts +6 -6
- package/dist/Switch/SwitchBase.js +39 -38
- package/dist/Switch.js +17 -16
- package/dist/Tabs/TabsBase.js +40 -25
- package/dist/Tabs.js +18 -21
- package/dist/Textarea.d.ts +1 -0
- package/dist/Textarea.js +33 -33
- package/dist/Toggle.js +4 -4
- package/dist/ToggleGroup/ToggleGroupBase.d.ts +7 -7
- package/dist/ToggleGroup/ToggleGroupBase.js +64 -64
- package/dist/ToggleGroup.js +19 -17
- package/dist/Tooltip/TooltipBase.d.ts +8 -8
- package/dist/Tooltip/TooltipBase.js +76 -74
- package/dist/Tooltip.d.ts +1 -1
- package/dist/Tooltip.js +12 -11
- package/dist/Tray.d.ts +1 -1
- package/dist/Tray.js +4910 -117
- package/dist/primitives/input.js +4 -4
- package/dist/primitives/select.d.ts +11 -11
- package/dist/primitives/select.d.ts.map +1 -1
- package/dist/primitives/select.js +28 -21
- package/dist/styles/main.css +1 -1
- package/dist/utils/{refs.d.ts → createForwardRef.d.ts} +1 -1
- package/dist/utils/createForwardRef.d.ts.map +1 -0
- package/dist/utils/formFieldUtils.d.ts +22 -18
- package/dist/utils/formFieldUtils.d.ts.map +1 -1
- package/dist/utils/formFieldUtils.js +46 -46
- package/package.json +9 -3
- package/dist/analyzer/list.yml.webp +0 -0
- package/dist/analyzer/network.webp +0 -0
- package/dist/analyzer/sunburst.webp +0 -0
- package/dist/analyzer/visual.webp +0 -0
- package/dist/auth-background.json +0 -90
- package/dist/favicon-invert.svg +0 -5
- package/dist/favicon.svg +0 -5
- package/dist/features/AuthCard/AuthCard.d.ts +0 -3
- package/dist/features/AuthCard/AuthCard.d.ts.map +0 -1
- package/dist/features/AuthCard/AuthToggle.d.ts +0 -9
- package/dist/features/AuthCard/AuthToggle.d.ts.map +0 -1
- package/dist/features/AuthCard/AuthToggle.js +0 -20
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +0 -11
- package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +0 -1
- package/dist/features/AuthCard/ForgotPasswordEmailForm.js +0 -86
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +0 -11
- package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +0 -1
- package/dist/features/AuthCard/ForgotPasswordResetForm.js +0 -21
- package/dist/features/AuthCard/OTPInput.d.ts +0 -12
- package/dist/features/AuthCard/OTPInput.d.ts.map +0 -1
- package/dist/features/AuthCard/OTPInput.js +0 -12
- package/dist/features/AuthCard/PasswordInput.d.ts +0 -13
- package/dist/features/AuthCard/PasswordInput.d.ts.map +0 -1
- package/dist/features/AuthCard/PasswordInput.js +0 -93
- package/dist/features/AuthCard/SignInForm.d.ts +0 -9
- package/dist/features/AuthCard/SignInForm.d.ts.map +0 -1
- package/dist/features/AuthCard/SignInForm.js +0 -86
- package/dist/features/AuthCard/SignUpForm.d.ts +0 -8
- package/dist/features/AuthCard/SignUpForm.d.ts.map +0 -1
- package/dist/features/AuthCard/SignUpForm.js +0 -100
- package/dist/features/AuthCard.js +0 -202
- package/dist/features/ClearDialog/ClearDialog.d.ts +0 -2
- package/dist/features/ClearDialog/ClearDialog.d.ts.map +0 -1
- package/dist/features/ClearDialog.js +0 -31
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +0 -8
- package/dist/features/LabelingToolbar/LabelingToolbar.d.ts.map +0 -1
- package/dist/features/LabelingToolbar.js +0 -13
- package/dist/features/LabelingTools/LabelingTools.d.ts +0 -2
- package/dist/features/LabelingTools/LabelingTools.d.ts.map +0 -1
- package/dist/features/LabelingTools.js +0 -134
- package/dist/features/SensorMetadata/SensorMetadata.d.ts +0 -2
- package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +0 -1
- package/dist/features/SensorMetadata.js +0 -117
- package/dist/features/SettingsPopover/SettingsPopover.d.ts +0 -2
- package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +0 -1
- package/dist/features/SettingsPopover.js +0 -204
- package/dist/index-BIpuW_o8.js +0 -146
- package/dist/linear-cursor-small.png +0 -0
- package/dist/loader-circle-CdRVlFhN.js +0 -11
- package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
- package/dist/logo/wordmark-light-side-by-side.svg +0 -6
- package/dist/message-alert-matte-glass-gradient.webp +0 -0
- package/dist/proxy-C9AqCss6.js +0 -4670
- package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
- package/dist/themes/grayscale-theme.webp +0 -0
- package/dist/themes/green-black-theme.webp +0 -0
- package/dist/themes/reverse-grayscale-theme.webp +0 -0
- package/dist/themes/viridis-theme.webp +0 -0
- package/dist/utils/refs.d.ts.map +0 -1
- package/dist/x-Dl66o_vF.js +0 -14
- /package/dist/utils/{refs.js → createForwardRef.js} +0 -0
package/dist/Accordion.d.ts
CHANGED
|
@@ -2,29 +2,29 @@ import { ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
|
|
|
2
2
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
3
3
|
export type AutoScrollBehavior = 'never' | 'mobile' | 'always';
|
|
4
4
|
type BaseAccordionProps = {
|
|
5
|
-
children?: ReactNode;
|
|
6
5
|
autoScroll?: AutoScrollBehavior;
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
scrollPadding?: number;
|
|
8
8
|
variant?: 'default' | 'contained' | 'separated';
|
|
9
9
|
};
|
|
10
10
|
export type AccordionSingleProps = BaseAccordionProps & {
|
|
11
|
-
|
|
12
|
-
value?: string;
|
|
11
|
+
collapsible?: boolean;
|
|
13
12
|
defaultValue?: string;
|
|
14
13
|
onValueChange?: (value: string) => void;
|
|
15
|
-
|
|
14
|
+
type: 'single';
|
|
15
|
+
value?: string;
|
|
16
16
|
};
|
|
17
17
|
export type AccordionMultipleProps = BaseAccordionProps & {
|
|
18
|
-
type: 'multiple';
|
|
19
|
-
value?: string[];
|
|
20
18
|
defaultValue?: string[];
|
|
21
19
|
onValueChange?: (value: string[]) => void;
|
|
20
|
+
type: 'multiple';
|
|
21
|
+
value?: string[];
|
|
22
22
|
};
|
|
23
23
|
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
24
24
|
export type AccordionComponent = ForwardRefExoticComponent<AccordionProps & RefAttributes<HTMLDivElement>> & {
|
|
25
|
+
Content: typeof AccordionContent;
|
|
25
26
|
Item: typeof AccordionItem;
|
|
26
27
|
Trigger: typeof AccordionTrigger;
|
|
27
|
-
Content: typeof AccordionContent;
|
|
28
28
|
};
|
|
29
29
|
export declare const Accordion: ForwardRefExoticComponent<AccordionProps & RefAttributes<HTMLDivElement>>;
|
|
30
30
|
export declare const AccordionItem: ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
package/dist/Accordion.js
CHANGED
|
@@ -60,7 +60,7 @@ import "./Icons/ZoomXIcon.js";
|
|
|
60
60
|
import "./Icons/ZoomYIcon.js";
|
|
61
61
|
import { useAccordionAutoScroll as ue } from "./hooks/useAccordionAutoScroll.js";
|
|
62
62
|
import * as u from "react";
|
|
63
|
-
import m, { createContext as fe, forwardRef as w, Children as ve, isValidElement as Ce, cloneElement as
|
|
63
|
+
import m, { createContext as fe, forwardRef as w, Children as ve, isValidElement as Ce, cloneElement as ge, useContext as be, useRef as Ae, useCallback as he } from "react";
|
|
64
64
|
import { c as z, u as V, P as R, b as B, a as U, d as xe } from "./index-BhufZRa2.js";
|
|
65
65
|
import { c as Ie, u as Re } from "./index-UEFPWH8U.js";
|
|
66
66
|
import { P as ye } from "./index-6Abv_Flm.js";
|
|
@@ -74,8 +74,8 @@ var P = "Collapsible", [Ne, J] = z(P), [we, $] = Ne(P), Y = u.forwardRef(
|
|
|
74
74
|
defaultOpen: r,
|
|
75
75
|
disabled: n,
|
|
76
76
|
onOpenChange: c,
|
|
77
|
-
...
|
|
78
|
-
} = e, [
|
|
77
|
+
...s
|
|
78
|
+
} = e, [l, p] = V({
|
|
79
79
|
prop: t,
|
|
80
80
|
defaultProp: r ?? !1,
|
|
81
81
|
onChange: c,
|
|
@@ -87,14 +87,14 @@ var P = "Collapsible", [Ne, J] = z(P), [we, $] = Ne(P), Y = u.forwardRef(
|
|
|
87
87
|
scope: o,
|
|
88
88
|
disabled: n,
|
|
89
89
|
contentId: q(),
|
|
90
|
-
open:
|
|
90
|
+
open: l,
|
|
91
91
|
onOpenToggle: u.useCallback(() => p((f) => !f), [p]),
|
|
92
92
|
children: /* @__PURE__ */ i(
|
|
93
93
|
R.div,
|
|
94
94
|
{
|
|
95
|
-
"data-state": L(
|
|
95
|
+
"data-state": L(l),
|
|
96
96
|
"data-disabled": n ? "" : void 0,
|
|
97
|
-
...
|
|
97
|
+
...s,
|
|
98
98
|
ref: a
|
|
99
99
|
}
|
|
100
100
|
)
|
|
@@ -131,7 +131,7 @@ var H = "CollapsibleContent", X = u.forwardRef(
|
|
|
131
131
|
);
|
|
132
132
|
X.displayName = H;
|
|
133
133
|
var _e = u.forwardRef((e, a) => {
|
|
134
|
-
const { __scopeCollapsible: o, present: t, children: r, ...n } = e, c = $(H, o), [
|
|
134
|
+
const { __scopeCollapsible: o, present: t, children: r, ...n } = e, c = $(H, o), [s, l] = u.useState(t), p = u.useRef(null), f = U(a, p), v = u.useRef(0), x = v.current, g = u.useRef(0), y = g.current, b = c.open || s, A = u.useRef(b), h = u.useRef(void 0);
|
|
135
135
|
return u.useEffect(() => {
|
|
136
136
|
const d = requestAnimationFrame(() => A.current = !1);
|
|
137
137
|
return () => cancelAnimationFrame(d);
|
|
@@ -143,7 +143,7 @@ var _e = u.forwardRef((e, a) => {
|
|
|
143
143
|
animationName: d.style.animationName
|
|
144
144
|
}, d.style.transitionDuration = "0s", d.style.animationName = "none";
|
|
145
145
|
const I = d.getBoundingClientRect();
|
|
146
|
-
v.current = I.height,
|
|
146
|
+
v.current = I.height, g.current = I.width, A.current || (d.style.transitionDuration = h.current.transitionDuration, d.style.animationName = h.current.animationName), l(t);
|
|
147
147
|
}
|
|
148
148
|
}, [c.open, t]), /* @__PURE__ */ i(
|
|
149
149
|
R.div,
|
|
@@ -151,7 +151,7 @@ var _e = u.forwardRef((e, a) => {
|
|
|
151
151
|
"data-state": L(c.open),
|
|
152
152
|
"data-disabled": c.disabled ? "" : void 0,
|
|
153
153
|
id: c.contentId,
|
|
154
|
-
hidden: !
|
|
154
|
+
hidden: !b,
|
|
155
155
|
...n,
|
|
156
156
|
ref: f,
|
|
157
157
|
style: {
|
|
@@ -159,7 +159,7 @@ var _e = u.forwardRef((e, a) => {
|
|
|
159
159
|
"--radix-collapsible-content-width": y ? `${y}px` : void 0,
|
|
160
160
|
...e.style
|
|
161
161
|
},
|
|
162
|
-
children:
|
|
162
|
+
children: b && r
|
|
163
163
|
}
|
|
164
164
|
);
|
|
165
165
|
});
|
|
@@ -188,7 +188,7 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
188
188
|
},
|
|
189
189
|
collapsible: n = !1,
|
|
190
190
|
...c
|
|
191
|
-
} = e, [
|
|
191
|
+
} = e, [s, l] = V({
|
|
192
192
|
prop: o,
|
|
193
193
|
defaultProp: t ?? "",
|
|
194
194
|
onChange: r,
|
|
@@ -198,9 +198,9 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
198
198
|
ee,
|
|
199
199
|
{
|
|
200
200
|
scope: e.__scopeAccordion,
|
|
201
|
-
value: m.useMemo(() =>
|
|
202
|
-
onItemOpen:
|
|
203
|
-
onItemClose: m.useCallback(() => n &&
|
|
201
|
+
value: m.useMemo(() => s ? [s] : [], [s]),
|
|
202
|
+
onItemOpen: l,
|
|
203
|
+
onItemClose: m.useCallback(() => n && l(""), [n, l]),
|
|
204
204
|
children: /* @__PURE__ */ i(oe, { scope: e.__scopeAccordion, collapsible: n, children: /* @__PURE__ */ i(te, { ...c, ref: a }) })
|
|
205
205
|
}
|
|
206
206
|
);
|
|
@@ -212,42 +212,42 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
212
212
|
onValueChange: r = () => {
|
|
213
213
|
},
|
|
214
214
|
...n
|
|
215
|
-
} = e, [c,
|
|
215
|
+
} = e, [c, s] = V({
|
|
216
216
|
prop: o,
|
|
217
217
|
defaultProp: t ?? [],
|
|
218
218
|
onChange: r,
|
|
219
219
|
caller: C
|
|
220
|
-
}),
|
|
221
|
-
(f) =>
|
|
222
|
-
[
|
|
220
|
+
}), l = m.useCallback(
|
|
221
|
+
(f) => s((v = []) => [...v, f]),
|
|
222
|
+
[s]
|
|
223
223
|
), p = m.useCallback(
|
|
224
|
-
(f) =>
|
|
225
|
-
[
|
|
224
|
+
(f) => s((v = []) => v.filter((x) => x !== f)),
|
|
225
|
+
[s]
|
|
226
226
|
);
|
|
227
227
|
return /* @__PURE__ */ i(
|
|
228
228
|
ee,
|
|
229
229
|
{
|
|
230
230
|
scope: e.__scopeAccordion,
|
|
231
231
|
value: c,
|
|
232
|
-
onItemOpen:
|
|
232
|
+
onItemOpen: l,
|
|
233
233
|
onItemClose: p,
|
|
234
234
|
children: /* @__PURE__ */ i(oe, { scope: e.__scopeAccordion, collapsible: !0, children: /* @__PURE__ */ i(te, { ...n, ref: a }) })
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
237
|
}), [He, S] = E(C), te = m.forwardRef(
|
|
238
238
|
(e, a) => {
|
|
239
|
-
const { __scopeAccordion: o, disabled: t, dir: r, orientation: n = "vertical", ...c } = e,
|
|
240
|
-
if (!Oe.includes(
|
|
241
|
-
const y =
|
|
239
|
+
const { __scopeAccordion: o, disabled: t, dir: r, orientation: n = "vertical", ...c } = e, s = m.useRef(null), l = U(s, a), p = Te(o), v = Re(r) === "ltr", x = B(e.onKeyDown, (g) => {
|
|
240
|
+
if (!Oe.includes(g.key)) return;
|
|
241
|
+
const y = g.target, b = p().filter((D) => !D.ref.current?.disabled), A = b.findIndex((D) => D.ref.current === y), h = b.length;
|
|
242
242
|
if (A === -1) return;
|
|
243
|
-
|
|
243
|
+
g.preventDefault();
|
|
244
244
|
let d = A;
|
|
245
245
|
const I = 0, O = h - 1, T = () => {
|
|
246
246
|
d = A + 1, d > O && (d = I);
|
|
247
247
|
}, k = () => {
|
|
248
248
|
d = A - 1, d < I && (d = O);
|
|
249
249
|
};
|
|
250
|
-
switch (
|
|
250
|
+
switch (g.key) {
|
|
251
251
|
case "Home":
|
|
252
252
|
d = I;
|
|
253
253
|
break;
|
|
@@ -268,7 +268,7 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
268
268
|
break;
|
|
269
269
|
}
|
|
270
270
|
const pe = d % h;
|
|
271
|
-
|
|
271
|
+
b[pe].ref.current?.focus();
|
|
272
272
|
});
|
|
273
273
|
return /* @__PURE__ */ i(
|
|
274
274
|
He,
|
|
@@ -282,7 +282,7 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
282
282
|
{
|
|
283
283
|
...c,
|
|
284
284
|
"data-orientation": n,
|
|
285
|
-
ref:
|
|
285
|
+
ref: l,
|
|
286
286
|
onKeyDown: t ? void 0 : x
|
|
287
287
|
}
|
|
288
288
|
) })
|
|
@@ -291,20 +291,20 @@ var [ee, De] = E(C), [oe, Me] = E(
|
|
|
291
291
|
}
|
|
292
292
|
), N = "AccordionItem", [Le, j] = E(N), re = m.forwardRef(
|
|
293
293
|
(e, a) => {
|
|
294
|
-
const { __scopeAccordion: o, value: t, ...r } = e, n = S(N, o), c = De(N, o),
|
|
294
|
+
const { __scopeAccordion: o, value: t, ...r } = e, n = S(N, o), c = De(N, o), s = K(o), l = q(), p = t && c.value.includes(t) || !1, f = n.disabled || e.disabled;
|
|
295
295
|
return /* @__PURE__ */ i(
|
|
296
296
|
Le,
|
|
297
297
|
{
|
|
298
298
|
scope: o,
|
|
299
299
|
open: p,
|
|
300
300
|
disabled: f,
|
|
301
|
-
triggerId:
|
|
301
|
+
triggerId: l,
|
|
302
302
|
children: /* @__PURE__ */ i(
|
|
303
303
|
Pe,
|
|
304
304
|
{
|
|
305
305
|
"data-orientation": n.orientation,
|
|
306
|
-
"data-state":
|
|
307
|
-
...
|
|
306
|
+
"data-state": le(p),
|
|
307
|
+
...s,
|
|
308
308
|
...r,
|
|
309
309
|
ref: a,
|
|
310
310
|
disabled: f,
|
|
@@ -326,7 +326,7 @@ var ne = "AccordionHeader", ae = m.forwardRef(
|
|
|
326
326
|
R.h3,
|
|
327
327
|
{
|
|
328
328
|
"data-orientation": r.orientation,
|
|
329
|
-
"data-state":
|
|
329
|
+
"data-state": le(n.open),
|
|
330
330
|
"data-disabled": n.disabled ? "" : void 0,
|
|
331
331
|
...t,
|
|
332
332
|
ref: a
|
|
@@ -337,14 +337,14 @@ var ne = "AccordionHeader", ae = m.forwardRef(
|
|
|
337
337
|
ae.displayName = ne;
|
|
338
338
|
var M = "AccordionTrigger", ie = m.forwardRef(
|
|
339
339
|
(e, a) => {
|
|
340
|
-
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(M, o), c = Me(M, o),
|
|
340
|
+
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(M, o), c = Me(M, o), s = K(o);
|
|
341
341
|
return /* @__PURE__ */ i(G.ItemSlot, { scope: o, children: /* @__PURE__ */ i(
|
|
342
342
|
Ee,
|
|
343
343
|
{
|
|
344
344
|
"aria-disabled": n.open && !c.collapsible || void 0,
|
|
345
345
|
"data-orientation": r.orientation,
|
|
346
346
|
id: n.triggerId,
|
|
347
|
-
...
|
|
347
|
+
...s,
|
|
348
348
|
...t,
|
|
349
349
|
ref: a
|
|
350
350
|
}
|
|
@@ -352,7 +352,7 @@ var M = "AccordionTrigger", ie = m.forwardRef(
|
|
|
352
352
|
}
|
|
353
353
|
);
|
|
354
354
|
ie.displayName = M;
|
|
355
|
-
var ce = "AccordionContent",
|
|
355
|
+
var ce = "AccordionContent", se = m.forwardRef(
|
|
356
356
|
(e, a) => {
|
|
357
357
|
const { __scopeAccordion: o, ...t } = e, r = S(C, o), n = j(ce, o), c = K(o);
|
|
358
358
|
return /* @__PURE__ */ i(
|
|
@@ -373,11 +373,11 @@ var ce = "AccordionContent", le = m.forwardRef(
|
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
375
|
);
|
|
376
|
-
|
|
377
|
-
function
|
|
376
|
+
se.displayName = ce;
|
|
377
|
+
function le(e) {
|
|
378
378
|
return e ? "open" : "closed";
|
|
379
379
|
}
|
|
380
|
-
var Ge = Z, Ke = re, je = ae, Fe = ie, ze =
|
|
380
|
+
var Ge = Z, Ke = re, je = ae, Fe = ie, ze = se;
|
|
381
381
|
const Be = {
|
|
382
382
|
default: "shadow-none",
|
|
383
383
|
contained: "rounded-md border border-level-four",
|
|
@@ -387,45 +387,47 @@ const Be = {
|
|
|
387
387
|
contained: "last:border-b-0",
|
|
388
388
|
separated: "rounded-md"
|
|
389
389
|
}, de = fe({ variant: "default" }), qe = w(({ variant: e = "default", ...a }, o) => {
|
|
390
|
-
const { autoScroll: t = "never", scrollPadding: r = -20, children: n, ...c } = a,
|
|
390
|
+
const { autoScroll: t = "never", scrollPadding: r = -20, children: n, ...c } = a, s = {
|
|
391
391
|
autoScroll: t,
|
|
392
392
|
scrollPadding: r
|
|
393
|
-
},
|
|
393
|
+
}, l = {
|
|
394
394
|
...c,
|
|
395
395
|
ref: o
|
|
396
396
|
};
|
|
397
397
|
return /* @__PURE__ */ i(de.Provider, { value: { variant: e }, children: /* @__PURE__ */ i(
|
|
398
398
|
Ge,
|
|
399
399
|
{
|
|
400
|
-
...
|
|
400
|
+
...l,
|
|
401
401
|
"data-slot": "accordion",
|
|
402
|
-
"data-
|
|
402
|
+
"data-testid": "spectral-accordion",
|
|
403
|
+
"data-scroll-options": JSON.stringify(s),
|
|
403
404
|
"data-auto-scroll": t,
|
|
404
405
|
"data-scroll-padding": r,
|
|
405
406
|
...a.type === "single" ? { collapsible: !0 } : {},
|
|
406
407
|
className: _("flex flex-col accordion-wrapper", Be[e]),
|
|
407
|
-
children: ve.map(n, (p) => Ce(p) ?
|
|
408
|
+
children: ve.map(n, (p) => Ce(p) ? ge(p, { variant: e }) : p)
|
|
408
409
|
}
|
|
409
410
|
) });
|
|
410
411
|
});
|
|
411
412
|
qe.displayName = "Accordion";
|
|
412
413
|
const Je = w(({ className: e, ...a }, o) => {
|
|
413
|
-
const { variant: t = "default" } =
|
|
414
|
-
return /* @__PURE__ */ i(Ke, { ref: o, "data-slot": "accordion-item", className: _("w-full border-b border-level-four p-4", Ue[t], e), ...a });
|
|
414
|
+
const { variant: t = "default" } = be(de);
|
|
415
|
+
return /* @__PURE__ */ i(Ke, { ref: o, "data-slot": "accordion-item", "data-testid": "spectral-accordion-item", className: _("w-full border-b border-level-four p-4", Ue[t], e), ...a });
|
|
415
416
|
});
|
|
416
417
|
Je.displayName = "AccordionItem";
|
|
417
418
|
const Ye = w(({ className: e, title: a, subtitle: o, ...t }, r) => {
|
|
418
|
-
const n = Ae(null), c = ue(n),
|
|
419
|
-
(
|
|
420
|
-
typeof r == "function" ? r(
|
|
419
|
+
const n = Ae(null), c = ue(n), s = he(
|
|
420
|
+
(l) => {
|
|
421
|
+
typeof r == "function" ? r(l) : r && (r.current = l), n.current = l;
|
|
421
422
|
},
|
|
422
423
|
[r]
|
|
423
424
|
);
|
|
424
425
|
return /* @__PURE__ */ i(je, { className: "m-0 flex", children: /* @__PURE__ */ F(
|
|
425
426
|
Fe,
|
|
426
427
|
{
|
|
427
|
-
ref:
|
|
428
|
+
ref: s,
|
|
428
429
|
"data-slot": "accordion-trigger",
|
|
430
|
+
"data-testid": "spectral-accordion-trigger",
|
|
429
431
|
className: _("flex flex-1 items-center justify-between text-sm font-normal text-text-primary transition-all hover:no-underline", "disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180", e),
|
|
430
432
|
onClick: c,
|
|
431
433
|
...t,
|
|
@@ -440,7 +442,7 @@ const Ye = w(({ className: e, title: a, subtitle: o, ...t }, r) => {
|
|
|
440
442
|
) });
|
|
441
443
|
});
|
|
442
444
|
Ye.displayName = "AccordionTrigger";
|
|
443
|
-
const Qe = w(({ className: e, children: a, ...o }, t) => /* @__PURE__ */ i(ze, { ref: t, "data-slot": "accordion-content", className: _("overflow-hidden pt-4 text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", e), ...o, children: /* @__PURE__ */ i("div", { className: "px-1 pb-4 pt-0", "data-slot": "accordion-content-inner", children: a }) }));
|
|
445
|
+
const Qe = w(({ className: e, children: a, ...o }, t) => /* @__PURE__ */ i(ze, { ref: t, "data-slot": "accordion-content", "data-testid": "spectral-accordion-content", className: _("overflow-hidden pt-4 text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", e), ...o, children: /* @__PURE__ */ i("div", { className: "px-1 pb-4 pt-0", "data-slot": "accordion-content-inner", children: a }) }));
|
|
444
446
|
Qe.displayName = "AccordionContent";
|
|
445
447
|
export {
|
|
446
448
|
qe as Accordion,
|
package/dist/Alert/AlertBase.js
CHANGED
|
@@ -4,8 +4,8 @@ import { jsx as l } from "react/jsx-runtime";
|
|
|
4
4
|
import { cn as s } from "../utils/twUtils.js";
|
|
5
5
|
import { c as n } from "../index-D29mdTf5.js";
|
|
6
6
|
import { forwardRef as i, useState as o, useEffect as d } from "react";
|
|
7
|
-
import { createPortal as
|
|
8
|
-
const
|
|
7
|
+
import { createPortal as c } from "react-dom";
|
|
8
|
+
const g = n(
|
|
9
9
|
`fixed top-2 left-1/2 -translate-x-1/2 z-50 w-full max-w-md rounded-md border px-4 py-3 text-sm flex has-[>svg]:grid-cols-[6_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-2 gap-y-0.5
|
|
10
10
|
items-start [&>svg]:size-6 [&>svg]:translate-y-0.5 transform transition-all duration-300 ease-in-out translate-y-0 opacity-100 scale-100 animate-in slide-in-from-top-full fade-in duration-300`,
|
|
11
11
|
{
|
|
@@ -28,15 +28,15 @@ const c = n(
|
|
|
28
28
|
danger: "text-alert-danger-text",
|
|
29
29
|
info: "text-alert-info-text",
|
|
30
30
|
default: "text-alert-text"
|
|
31
|
-
}, f = i(({ className: t, variant: e, ...r }, a) => /* @__PURE__ */ l("div", {
|
|
31
|
+
}, f = i(({ className: t, variant: e, ...r }, a) => /* @__PURE__ */ l("div", { className: s(g({ variant: e }), t), "data-slot": "alert", ref: a, role: "alert", ...r }));
|
|
32
32
|
f.displayName = "AlertBase";
|
|
33
|
-
const m = i(({ className: t, variant: e, ...r }, a) => /* @__PURE__ */ l("div", {
|
|
33
|
+
const m = i(({ className: t, variant: e, ...r }, a) => /* @__PURE__ */ l("div", { className: s(x[e], "col-start-2 line-clamp-1 min-h-4 font-semibold text-base tracking-tight h-6 flex items-center", t), "data-slot": "alert-title", "data-testid": "spectral-alert-title", ref: a, ...r }));
|
|
34
34
|
m.displayName = "AlertTitle";
|
|
35
|
-
const u = i(({ className: t, ...e }, r) => /* @__PURE__ */ l("div", {
|
|
35
|
+
const u = i(({ className: t, ...e }, r) => /* @__PURE__ */ l("div", { className: s("text-primary-inverse col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", t), "data-slot": "alert-description", "data-testid": "spectral-alert-description", ref: r, ...e }));
|
|
36
36
|
u.displayName = "AlertDescription";
|
|
37
37
|
function A({ children: t, container: e }) {
|
|
38
38
|
const [r, a] = o(!1);
|
|
39
|
-
return d(() => (a(!0), () => a(!1)), []), r ?
|
|
39
|
+
return d(() => (a(!0), () => a(!1)), []), r ? c(t, e ?? document.body) : null;
|
|
40
40
|
}
|
|
41
41
|
export {
|
|
42
42
|
f as AlertBase,
|
package/dist/Alert.js
CHANGED
|
@@ -96,7 +96,7 @@ const Vt = ({ id: n, description: a, onClose: s, icon: l, title: c, className: d
|
|
|
96
96
|
"aria-label": "Close alert",
|
|
97
97
|
className: "close-icon-wrapper absolute right-2 top-2 cursor-pointer focus-visible:outline-1 outline-transparent focus-visible:outline-text-secondary focus-visible:outline-offset-1 rounded",
|
|
98
98
|
"data-slot": "close-icon",
|
|
99
|
-
"data-testid": "alert-close-button",
|
|
99
|
+
"data-testid": "spectral-alert-close-button",
|
|
100
100
|
onClick: f,
|
|
101
101
|
size: 20,
|
|
102
102
|
tabIndex: 0
|
package/dist/Avatar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
type AvatarSize = '
|
|
2
|
+
type AvatarSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface AvatarProps {
|
|
4
4
|
userFullName?: string;
|
|
5
5
|
imageSource?: string;
|
|
@@ -9,6 +9,6 @@ export interface AvatarProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
alt?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const Avatar: ({
|
|
12
|
+
export declare const Avatar: ({ alt, className, icon, imageSource, fallback, size, userFullName }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=Avatar.d.ts.map
|
package/dist/Avatar.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useState as x, useEffect as
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { cn as s } from "./utils/twUtils.js";
|
|
5
|
+
import { useState as x, useEffect as v, isValidElement as w, cloneElement as p } from "react";
|
|
6
6
|
const y = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
if (!
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
|
|
7
|
+
sm: "h-8 w-8",
|
|
8
|
+
md: "h-10 w-10",
|
|
9
|
+
lg: "h-12 w-12"
|
|
10
|
+
}, f = {
|
|
11
|
+
sm: "text-sm",
|
|
12
|
+
md: "text-lg",
|
|
13
|
+
lg: "text-2xl"
|
|
14
|
+
}, b = {
|
|
15
|
+
sm: 24,
|
|
16
|
+
md: 32,
|
|
17
|
+
lg: 40
|
|
18
|
+
}, j = (l) => {
|
|
19
|
+
const i = l.trim();
|
|
20
|
+
if (!i) return "?";
|
|
21
|
+
const t = i.split(/\s+/).filter(Boolean);
|
|
22
|
+
return t.length === 0 ? "?" : t.length === 1 ? t[0].charAt(0).toUpperCase() : (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase();
|
|
23
|
+
}, k = ({ alt: l, className: i, icon: t, imageSource: a, fallback: o, size: n = "md", userFullName: c }) => {
|
|
24
|
+
const [m, d] = x("loading");
|
|
25
|
+
v(() => {
|
|
26
|
+
if (!a) return;
|
|
27
|
+
d("loading");
|
|
28
|
+
const e = new Image();
|
|
29
|
+
return e.src = a, e.onload = () => d("loaded"), e.onerror = () => d("error"), () => {
|
|
30
|
+
e.onload = null, e.onerror = null;
|
|
31
31
|
};
|
|
32
|
-
}, [
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
const
|
|
40
|
-
className:
|
|
32
|
+
}, [a]);
|
|
33
|
+
const h = () => {
|
|
34
|
+
if (c)
|
|
35
|
+
return /* @__PURE__ */ r("span", { "aria-label": `${c} avatar`, className: s("flex items-center justify-center w-full h-full font-bold text-text-primary tracking-tighter", f[n]), "data-testid": "spectral-avatar-initials", children: j(c) });
|
|
36
|
+
if (t) {
|
|
37
|
+
const e = b[n];
|
|
38
|
+
return /* @__PURE__ */ r("span", { className: "flex items-center justify-center w-full h-full", children: w(t) ? (() => {
|
|
39
|
+
const u = {
|
|
40
|
+
className: s("shrink-0", t.props.className),
|
|
41
41
|
"aria-hidden": "true"
|
|
42
42
|
};
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
...
|
|
46
|
-
size:
|
|
43
|
+
if (t.type.displayName?.includes("Icon") ?? !1) {
|
|
44
|
+
const g = {
|
|
45
|
+
...u,
|
|
46
|
+
size: e
|
|
47
47
|
};
|
|
48
|
-
return
|
|
48
|
+
return p(t, g);
|
|
49
49
|
}
|
|
50
|
-
return
|
|
51
|
-
})() :
|
|
50
|
+
return p(t, u);
|
|
51
|
+
})() : t });
|
|
52
52
|
}
|
|
53
|
-
return
|
|
53
|
+
return a && m === "loaded" ? /* @__PURE__ */ r("img", { alt: l || "Avatar", "aria-label": l || "Avatar", className: "absolute inset-0 w-full h-full object-cover rounded-full", "data-testid": "spectral-avatar-image", role: "img", src: a }) : a && m === "error" && o ? /* @__PURE__ */ r("span", { className: "flex items-center justify-center w-full h-full", "data-testid": "spectral-avatar-img-error-fallback", children: o }) : o ? /* @__PURE__ */ r("span", { className: s("flex items-center justify-center w-full h-full text-text-primary", f[n]), "data-testid": "spectral-avatar-fallback", children: o }) : /* @__PURE__ */ r("span", { className: s("flex items-center justify-center w-full h-full font-bold border-2 border-danger-400 text-danger-400 rounded-full font-bold", f[n]), "data-testid": "spectral-avatar-last-resort", children: "?" });
|
|
54
54
|
};
|
|
55
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ r("div", { className: s("relative inline-flex items-center justify-center overflow-hidden rounded-full shrink-0 bg-level-two", y[n], i), "data-slot": "avatar", "data-testid": "spectral-avatar", children: h() });
|
|
56
56
|
};
|
|
57
57
|
export {
|
|
58
|
-
|
|
58
|
+
k as Avatar
|
|
59
59
|
};
|
package/dist/Badge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./styles/main.css";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Slot as
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
import { Slot as o } from "./primitives/slot.js";
|
|
4
4
|
import { cn as n } from "./utils/twUtils.js";
|
|
5
5
|
import { c as d } from "./index-D29mdTf5.js";
|
|
6
6
|
const s = d(
|
|
@@ -20,7 +20,7 @@ const s = d(
|
|
|
20
20
|
variant: "default"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
), m = ({ className: e, variant: r, asChild: a = !1, ...t }) => /* @__PURE__ */
|
|
23
|
+
), m = ({ className: e, variant: r, asChild: a = !1, ...t }) => /* @__PURE__ */ i(a ? o : "span", { "data-slot": "badge", "data-testid": "spectral-badge", className: n(s({ variant: r }), e), ...t });
|
|
24
24
|
export {
|
|
25
25
|
m as Badge
|
|
26
26
|
};
|
package/dist/Button.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "./styles/main.css";
|
|
3
3
|
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
4
|
+
import { ErrorMessage as y } from "./utils/formFieldUtils.js";
|
|
4
5
|
import { cn as u } from "./utils/twUtils.js";
|
|
5
|
-
import { c as
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { c as h } from "./index-D29mdTf5.js";
|
|
7
|
+
import { forwardRef as f } from "react";
|
|
8
|
+
import { c as N } from "./createLucideIcon-B_8CJpcQ.js";
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v0.546.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
const w = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], _ = N("loader-circle", w), j = h(
|
|
9
16
|
`
|
|
10
17
|
!font-sans flex relative items-center justify-center gap-2 whitespace-nowrap transition-colors cursor-pointer rounded-lg border font-semibold focus:outline-none focus:outline-none
|
|
11
18
|
focus-visible:outline-1 focus-visible:outline-offset-2 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
|
|
@@ -38,7 +45,7 @@ const N = y(
|
|
|
38
45
|
size: "default"
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
|
-
),
|
|
48
|
+
), z = f(({ className: l, dataTestId: c, disabled: n, endIcon: b, errorMessage: d, label: g, size: r, startIcon: a, state: t, type: p = "button", variant: e, ...x }, m) => {
|
|
42
49
|
const i = {
|
|
43
50
|
error: {
|
|
44
51
|
primary: "bg-button-danger border-button-danger text-button-primary-text pointer-events-none",
|
|
@@ -54,18 +61,18 @@ const N = y(
|
|
|
54
61
|
ghost: "bg-transparent text-button-ghost-text--disabled pointer-events-none",
|
|
55
62
|
card: "bg-button-card-bg--disabled border-button-card-border--disabled text-button-card-text--disabled pointer-events-none"
|
|
56
63
|
}
|
|
57
|
-
},
|
|
64
|
+
}, v = u(j({ variant: e, state: t, size: r }), t === "error" && i.error[e || "primary"], t === "loading" && i.loading[e || "primary"], r, l);
|
|
58
65
|
return /* @__PURE__ */ s("div", { className: u("flex flex-col justify-items-center", r), children: [
|
|
59
|
-
/* @__PURE__ */ s("button", { "aria-disabled": n, className:
|
|
66
|
+
/* @__PURE__ */ s("button", { "aria-disabled": n, className: v, "data-state": t, "data-testid": c || `spectral-button-${e}`, disabled: n, ref: m, type: p, ...x, children: [
|
|
60
67
|
a && /* @__PURE__ */ o("span", { className: "flex pr-2", "aria-hidden": !0, children: a }),
|
|
61
|
-
t === "loading" && /* @__PURE__ */ o(
|
|
68
|
+
t === "loading" && /* @__PURE__ */ o(_, { className: "ml-2 animate-spin", size: 16 }),
|
|
62
69
|
b && t !== "loading" && /* @__PURE__ */ o("span", { className: "flex pl-2", "aria-hidden": !0, children: b }),
|
|
63
|
-
|
|
70
|
+
g
|
|
64
71
|
] }),
|
|
65
|
-
t === "error" && d && /* @__PURE__ */ o(
|
|
72
|
+
t === "error" && d && /* @__PURE__ */ o(y, { message: d, dataTestId: "spectral-button-error-message", id: "button-error" })
|
|
66
73
|
] });
|
|
67
74
|
});
|
|
68
|
-
|
|
75
|
+
z.displayName = "Button";
|
|
69
76
|
export {
|
|
70
|
-
|
|
77
|
+
z as Button
|
|
71
78
|
};
|
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
export declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "outline" | null | undefined;
|
|
5
|
-
size?: "
|
|
5
|
+
size?: "sm" | "md" | "lg" | "icon-md" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export declare const ButtonGroupButton: {
|
|
8
8
|
({ className, variant, size, asChild, ...props }: ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|