@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.
Files changed (127) hide show
  1. package/dist/Accordion.d.ts +7 -7
  2. package/dist/Accordion.js +53 -51
  3. package/dist/Alert/AlertBase.js +6 -6
  4. package/dist/Alert.js +1 -1
  5. package/dist/Avatar.d.ts +2 -2
  6. package/dist/Avatar.js +46 -46
  7. package/dist/Badge.js +3 -3
  8. package/dist/Button.js +19 -12
  9. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  10. package/dist/ButtonGroup/ButtonGroupButton.js +10 -10
  11. package/dist/ButtonGroup.d.ts +8 -5
  12. package/dist/ButtonGroup.js +22 -14
  13. package/dist/ButtonIcon.d.ts +1 -1
  14. package/dist/ButtonIcon.js +5 -5
  15. package/dist/Card.d.ts +1 -1
  16. package/dist/Card.js +10 -10
  17. package/dist/Checkbox/CheckboxBase.d.ts +6 -6
  18. package/dist/Checkbox/CheckboxBase.js +65 -63
  19. package/dist/Checkbox.js +16 -14
  20. package/dist/Dialog/DialogBase.d.ts +37 -25
  21. package/dist/Dialog/DialogBase.js +130 -104
  22. package/dist/Dialog.d.ts +8 -8
  23. package/dist/Dialog.js +46 -36
  24. package/dist/Drawer.js +17 -17
  25. package/dist/HoverCard.d.ts +4 -4
  26. package/dist/HoverCard.js +34 -33
  27. package/dist/Input.js +58 -58
  28. package/dist/InputOTP.d.ts +1 -1
  29. package/dist/InputOTP.js +113 -112
  30. package/dist/MultiSelect/MultiSelectBase.d.ts +16 -16
  31. package/dist/MultiSelect/MultiSelectBase.js +236 -177
  32. package/dist/MultiSelect/MutiSelect.d.ts +6 -4
  33. package/dist/MultiSelect/MutiSelect.js +13 -12
  34. package/dist/Popover.js +2 -1
  35. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +18 -17
  36. package/dist/RadioGroup.js +5 -3
  37. package/dist/Select.js +70 -51
  38. package/dist/Slider.js +8 -4
  39. package/dist/Switch/SwitchBase.d.ts +6 -6
  40. package/dist/Switch/SwitchBase.js +39 -38
  41. package/dist/Switch.js +17 -16
  42. package/dist/Tabs/TabsBase.js +40 -25
  43. package/dist/Tabs.js +18 -21
  44. package/dist/Textarea.d.ts +1 -0
  45. package/dist/Textarea.js +33 -33
  46. package/dist/Toggle.js +4 -4
  47. package/dist/ToggleGroup/ToggleGroupBase.d.ts +7 -7
  48. package/dist/ToggleGroup/ToggleGroupBase.js +64 -64
  49. package/dist/ToggleGroup.js +19 -17
  50. package/dist/Tooltip/TooltipBase.d.ts +8 -8
  51. package/dist/Tooltip/TooltipBase.js +76 -74
  52. package/dist/Tooltip.d.ts +1 -1
  53. package/dist/Tooltip.js +12 -11
  54. package/dist/Tray.d.ts +1 -1
  55. package/dist/Tray.js +4910 -117
  56. package/dist/primitives/input.js +4 -4
  57. package/dist/primitives/select.d.ts +11 -11
  58. package/dist/primitives/select.d.ts.map +1 -1
  59. package/dist/primitives/select.js +28 -21
  60. package/dist/styles/main.css +1 -1
  61. package/dist/utils/{refs.d.ts → createForwardRef.d.ts} +1 -1
  62. package/dist/utils/createForwardRef.d.ts.map +1 -0
  63. package/dist/utils/formFieldUtils.d.ts +22 -18
  64. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  65. package/dist/utils/formFieldUtils.js +46 -46
  66. package/package.json +9 -3
  67. package/dist/analyzer/list.yml.webp +0 -0
  68. package/dist/analyzer/network.webp +0 -0
  69. package/dist/analyzer/sunburst.webp +0 -0
  70. package/dist/analyzer/visual.webp +0 -0
  71. package/dist/auth-background.json +0 -90
  72. package/dist/favicon-invert.svg +0 -5
  73. package/dist/favicon.svg +0 -5
  74. package/dist/features/AuthCard/AuthCard.d.ts +0 -3
  75. package/dist/features/AuthCard/AuthCard.d.ts.map +0 -1
  76. package/dist/features/AuthCard/AuthToggle.d.ts +0 -9
  77. package/dist/features/AuthCard/AuthToggle.d.ts.map +0 -1
  78. package/dist/features/AuthCard/AuthToggle.js +0 -20
  79. package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +0 -11
  80. package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +0 -1
  81. package/dist/features/AuthCard/ForgotPasswordEmailForm.js +0 -86
  82. package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +0 -11
  83. package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +0 -1
  84. package/dist/features/AuthCard/ForgotPasswordResetForm.js +0 -21
  85. package/dist/features/AuthCard/OTPInput.d.ts +0 -12
  86. package/dist/features/AuthCard/OTPInput.d.ts.map +0 -1
  87. package/dist/features/AuthCard/OTPInput.js +0 -12
  88. package/dist/features/AuthCard/PasswordInput.d.ts +0 -13
  89. package/dist/features/AuthCard/PasswordInput.d.ts.map +0 -1
  90. package/dist/features/AuthCard/PasswordInput.js +0 -93
  91. package/dist/features/AuthCard/SignInForm.d.ts +0 -9
  92. package/dist/features/AuthCard/SignInForm.d.ts.map +0 -1
  93. package/dist/features/AuthCard/SignInForm.js +0 -86
  94. package/dist/features/AuthCard/SignUpForm.d.ts +0 -8
  95. package/dist/features/AuthCard/SignUpForm.d.ts.map +0 -1
  96. package/dist/features/AuthCard/SignUpForm.js +0 -100
  97. package/dist/features/AuthCard.js +0 -202
  98. package/dist/features/ClearDialog/ClearDialog.d.ts +0 -2
  99. package/dist/features/ClearDialog/ClearDialog.d.ts.map +0 -1
  100. package/dist/features/ClearDialog.js +0 -31
  101. package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +0 -8
  102. package/dist/features/LabelingToolbar/LabelingToolbar.d.ts.map +0 -1
  103. package/dist/features/LabelingToolbar.js +0 -13
  104. package/dist/features/LabelingTools/LabelingTools.d.ts +0 -2
  105. package/dist/features/LabelingTools/LabelingTools.d.ts.map +0 -1
  106. package/dist/features/LabelingTools.js +0 -134
  107. package/dist/features/SensorMetadata/SensorMetadata.d.ts +0 -2
  108. package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +0 -1
  109. package/dist/features/SensorMetadata.js +0 -117
  110. package/dist/features/SettingsPopover/SettingsPopover.d.ts +0 -2
  111. package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +0 -1
  112. package/dist/features/SettingsPopover.js +0 -204
  113. package/dist/index-BIpuW_o8.js +0 -146
  114. package/dist/linear-cursor-small.png +0 -0
  115. package/dist/loader-circle-CdRVlFhN.js +0 -11
  116. package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
  117. package/dist/logo/wordmark-light-side-by-side.svg +0 -6
  118. package/dist/message-alert-matte-glass-gradient.webp +0 -0
  119. package/dist/proxy-C9AqCss6.js +0 -4670
  120. package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
  121. package/dist/themes/grayscale-theme.webp +0 -0
  122. package/dist/themes/green-black-theme.webp +0 -0
  123. package/dist/themes/reverse-grayscale-theme.webp +0 -0
  124. package/dist/themes/viridis-theme.webp +0 -0
  125. package/dist/utils/refs.d.ts.map +0 -1
  126. package/dist/x-Dl66o_vF.js +0 -14
  127. /package/dist/utils/{refs.js → createForwardRef.js} +0 -0
@@ -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
- type: 'single';
12
- value?: string;
11
+ collapsible?: boolean;
13
12
  defaultValue?: string;
14
13
  onValueChange?: (value: string) => void;
15
- collapsible?: boolean;
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 be, useContext as ge, useRef as Ae, useCallback as he } from "react";
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
- ...l
78
- } = e, [s, p] = V({
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: s,
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(s),
95
+ "data-state": L(l),
96
96
  "data-disabled": n ? "" : void 0,
97
- ...l,
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), [l, s] = u.useState(t), p = u.useRef(null), f = U(a, p), v = u.useRef(0), x = v.current, b = u.useRef(0), y = b.current, g = c.open || l, A = u.useRef(g), h = u.useRef(void 0);
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, b.current = I.width, A.current || (d.style.transitionDuration = h.current.transitionDuration, d.style.animationName = h.current.animationName), s(t);
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: !g,
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: g && r
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, [l, s] = V({
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(() => l ? [l] : [], [l]),
202
- onItemOpen: s,
203
- onItemClose: m.useCallback(() => n && s(""), [n, s]),
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, l] = V({
215
+ } = e, [c, s] = V({
216
216
  prop: o,
217
217
  defaultProp: t ?? [],
218
218
  onChange: r,
219
219
  caller: C
220
- }), s = m.useCallback(
221
- (f) => l((v = []) => [...v, f]),
222
- [l]
220
+ }), l = m.useCallback(
221
+ (f) => s((v = []) => [...v, f]),
222
+ [s]
223
223
  ), p = m.useCallback(
224
- (f) => l((v = []) => v.filter((x) => x !== f)),
225
- [l]
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: s,
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, l = m.useRef(null), s = U(l, a), p = Te(o), v = Re(r) === "ltr", x = B(e.onKeyDown, (b) => {
240
- if (!Oe.includes(b.key)) return;
241
- const y = b.target, g = p().filter((D) => !D.ref.current?.disabled), A = g.findIndex((D) => D.ref.current === y), h = g.length;
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
- b.preventDefault();
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 (b.key) {
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
- g[pe].ref.current?.focus();
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: s,
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), l = K(o), s = q(), p = t && c.value.includes(t) || !1, f = n.disabled || e.disabled;
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: s,
301
+ triggerId: l,
302
302
  children: /* @__PURE__ */ i(
303
303
  Pe,
304
304
  {
305
305
  "data-orientation": n.orientation,
306
- "data-state": se(p),
307
- ...l,
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": se(n.open),
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), l = K(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
- ...l,
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", le = m.forwardRef(
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
- le.displayName = ce;
377
- function se(e) {
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 = le;
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, l = {
390
+ const { autoScroll: t = "never", scrollPadding: r = -20, children: n, ...c } = a, s = {
391
391
  autoScroll: t,
392
392
  scrollPadding: r
393
- }, s = {
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
- ...s,
400
+ ...l,
401
401
  "data-slot": "accordion",
402
- "data-scroll-options": JSON.stringify(l),
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) ? be(p, { variant: e }) : 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" } = ge(de);
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), l = he(
419
- (s) => {
420
- typeof r == "function" ? r(s) : r && (r.current = s), n.current = s;
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: l,
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,
@@ -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 g } from "react-dom";
8
- const c = n(
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", { "data-slot": "alert", role: "alert", className: s(c({ variant: e }), t), ref: a, ...r }));
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", { "data-slot": "alert-title", ref: a, 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), ...r }));
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", { "data-slot": "alert-description", className: s("text-primary-inverse col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", t), ref: r, ...e }));
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 ? g(t, e ?? document.body) : null;
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 = 'small' | 'medium' | 'large';
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: ({ userFullName, imageSource, icon, fallback, size, className, alt }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
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 n } from "react/jsx-runtime";
4
- import { cn as i } from "./utils/twUtils.js";
5
- import { useState as x, useEffect as g, isValidElement as w, cloneElement as u } from "react";
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
- small: "h-8 w-8",
8
- medium: "h-10 w-10",
9
- large: "h-12 w-12"
10
- }, v = {
11
- small: "text-sm",
12
- medium: "text-lg",
13
- large: "text-2xl"
14
- }, j = {
15
- small: 24,
16
- medium: 32,
17
- large: 40
18
- }, N = (l) => {
19
- const t = l.trim();
20
- if (!t) return "?";
21
- const e = t.split(/\s+/).filter(Boolean);
22
- return e.length === 0 ? "?" : e.length === 1 ? e[0].charAt(0).toUpperCase() : (e[0].charAt(0) + e[e.length - 1].charAt(0)).toUpperCase();
23
- }, E = ({ userFullName: l, imageSource: t, icon: e, fallback: s, size: a = "medium", className: d, alt: c }) => {
24
- const [f, o] = x("loading");
25
- g(() => {
26
- if (!t) return;
27
- o("loading");
28
- const r = new Image();
29
- return r.src = t, r.onload = () => o("loaded"), r.onerror = () => o("error"), () => {
30
- r.onload = null, r.onerror = null;
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
- }, [t]);
33
- const p = () => {
34
- if (l)
35
- return /* @__PURE__ */ n("span", { className: i("flex items-center justify-center w-full h-full font-bold text-text-primary tracking-tighter", v[a]), "aria-label": `${l} avatar`, children: N(l) });
36
- if (e) {
37
- const r = j[a];
38
- return /* @__PURE__ */ n("span", { className: "flex items-center justify-center w-full h-full", children: w(e) ? (() => {
39
- const m = {
40
- className: i("shrink-0", e.props.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 (e.type.displayName?.includes("Icon") ?? !1) {
44
- const h = {
45
- ...m,
46
- size: r
43
+ if (t.type.displayName?.includes("Icon") ?? !1) {
44
+ const g = {
45
+ ...u,
46
+ size: e
47
47
  };
48
- return u(e, h);
48
+ return p(t, g);
49
49
  }
50
- return u(e, m);
51
- })() : e });
50
+ return p(t, u);
51
+ })() : t });
52
52
  }
53
- return t && f === "loaded" ? /* @__PURE__ */ n("img", { src: t, "aria-label": c || "Avatar", alt: c || "Avatar", className: "absolute inset-0 w-full h-full object-cover rounded-full" }) : t && f === "error" && s ? /* @__PURE__ */ n("span", { className: "flex items-center justify-center w-full h-full", children: s }) : s ? /* @__PURE__ */ n("span", { className: "flex items-center justify-center w-full h-full text-text-primary", children: s }) : /* @__PURE__ */ n("span", { className: "flex items-center justify-center w-full h-full font-bold border-2 border-danger-300 text-danger-300 rounded-full", children: "?" });
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__ */ n("span", { className: i("relative inline-flex items-center justify-center overflow-hidden rounded-full shrink-0 bg-level-two", y[a], d), "data-slot": "avatar", children: p() });
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
- E as Avatar
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 o } from "react/jsx-runtime";
3
- import { Slot as i } from "./primitives/slot.js";
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__ */ o(a ? i : "span", { "data-slot": "badge", className: n(s({ variant: r }), e), ...t });
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 y } from "./index-D29mdTf5.js";
6
- import { forwardRef as h } from "react";
7
- import { L as f } from "./loader-circle-CdRVlFhN.js";
8
- const N = y(
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
- ), w = h(({ className: l, dataTestId: g, disabled: n, endIcon: b, errorMessage: d, label: c, size: r, startIcon: a, state: t, type: p = "button", variant: e, ...x }, v) => {
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
- }, m = u(N({ variant: e, state: t, size: r }), t === "error" && i.error[e || "primary"], t === "loading" && i.loading[e || "primary"], r, l);
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: m, "data-state": t, "data-testid": g || `button-${e}`, disabled: n, ref: v, type: p, ...x, children: [
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(f, { className: "ml-2 animate-spin", size: 16 }),
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
- c
70
+ g
64
71
  ] }),
65
- t === "error" && d && /* @__PURE__ */ o("p", { className: "text-danger-100 mt-2 text-xs", role: "alert", "aria-live": "assertive", children: d })
72
+ t === "error" && d && /* @__PURE__ */ o(y, { message: d, dataTestId: "spectral-button-error-message", id: "button-error" })
66
73
  ] });
67
74
  });
68
- w.displayName = "Button";
75
+ z.displayName = "Button";
69
76
  export {
70
- w as Button
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?: "default" | "icon" | "sm" | "lg" | "icon-sm" | "icon-lg" | null | undefined;
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> & {