@spear-ai/spectral 1.4.2 → 1.4.4

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 (130) hide show
  1. package/dist/Accordion.d.ts +7 -7
  2. package/dist/Accordion.js +53 -51
  3. package/dist/Alert/AlertBase.js +7 -7
  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 +22 -15
  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 +23 -15
  13. package/dist/ButtonIcon.d.ts +1 -1
  14. package/dist/ButtonIcon.js +5 -5
  15. package/dist/Card.d.ts +2 -7
  16. package/dist/Card.js +9 -20
  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/DataCard.d.ts +11 -0
  21. package/dist/DataCard.js +18 -0
  22. package/dist/Dialog/DialogBase.d.ts +37 -25
  23. package/dist/Dialog/DialogBase.js +130 -104
  24. package/dist/Dialog.d.ts +8 -8
  25. package/dist/Dialog.js +46 -36
  26. package/dist/Drawer.js +17 -17
  27. package/dist/HoverCard.d.ts +4 -4
  28. package/dist/HoverCard.js +34 -33
  29. package/dist/Input.js +58 -58
  30. package/dist/InputOTP.d.ts +1 -1
  31. package/dist/InputOTP.js +113 -112
  32. package/dist/MultiSelect/MultiSelectBase.d.ts +16 -16
  33. package/dist/MultiSelect/MultiSelectBase.js +236 -177
  34. package/dist/MultiSelect/MutiSelect.d.ts +6 -4
  35. package/dist/MultiSelect/MutiSelect.js +13 -12
  36. package/dist/Popover.js +2 -1
  37. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +18 -17
  38. package/dist/RadioGroup.js +5 -3
  39. package/dist/Select.js +70 -51
  40. package/dist/Slider.js +8 -4
  41. package/dist/Switch/SwitchBase.d.ts +6 -6
  42. package/dist/Switch/SwitchBase.js +39 -38
  43. package/dist/Switch.js +17 -16
  44. package/dist/Tabs/TabsBase.js +40 -25
  45. package/dist/Tabs.js +18 -21
  46. package/dist/Textarea.d.ts +1 -0
  47. package/dist/Textarea.js +33 -33
  48. package/dist/Toggle.js +4 -4
  49. package/dist/ToggleGroup/ToggleGroupBase.d.ts +7 -7
  50. package/dist/ToggleGroup/ToggleGroupBase.js +64 -64
  51. package/dist/ToggleGroup.js +19 -17
  52. package/dist/Tooltip/TooltipBase.d.ts +8 -8
  53. package/dist/Tooltip/TooltipBase.js +76 -74
  54. package/dist/Tooltip.d.ts +1 -1
  55. package/dist/Tooltip.js +12 -11
  56. package/dist/Tray.d.ts +1 -1
  57. package/dist/Tray.js +4910 -117
  58. package/dist/primitives/input.js +4 -4
  59. package/dist/primitives/select.d.ts +11 -11
  60. package/dist/primitives/select.d.ts.map +1 -1
  61. package/dist/primitives/select.js +28 -21
  62. package/dist/styles/base-colors.css +12 -12
  63. package/dist/styles/main.css +1 -1
  64. package/dist/utils/{refs.d.ts → createForwardRef.d.ts} +1 -1
  65. package/dist/utils/createForwardRef.d.ts.map +1 -0
  66. package/dist/utils/formFieldUtils.d.ts +22 -18
  67. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  68. package/dist/utils/formFieldUtils.js +46 -46
  69. package/package.json +9 -3
  70. package/dist/analyzer/list.yml.webp +0 -0
  71. package/dist/analyzer/network.webp +0 -0
  72. package/dist/analyzer/sunburst.webp +0 -0
  73. package/dist/analyzer/visual.webp +0 -0
  74. package/dist/auth-background.json +0 -90
  75. package/dist/favicon-invert.svg +0 -5
  76. package/dist/favicon.svg +0 -5
  77. package/dist/features/AuthCard/AuthCard.d.ts +0 -3
  78. package/dist/features/AuthCard/AuthCard.d.ts.map +0 -1
  79. package/dist/features/AuthCard/AuthToggle.d.ts +0 -9
  80. package/dist/features/AuthCard/AuthToggle.d.ts.map +0 -1
  81. package/dist/features/AuthCard/AuthToggle.js +0 -20
  82. package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts +0 -11
  83. package/dist/features/AuthCard/ForgotPasswordEmailForm.d.ts.map +0 -1
  84. package/dist/features/AuthCard/ForgotPasswordEmailForm.js +0 -86
  85. package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts +0 -11
  86. package/dist/features/AuthCard/ForgotPasswordResetForm.d.ts.map +0 -1
  87. package/dist/features/AuthCard/ForgotPasswordResetForm.js +0 -21
  88. package/dist/features/AuthCard/OTPInput.d.ts +0 -12
  89. package/dist/features/AuthCard/OTPInput.d.ts.map +0 -1
  90. package/dist/features/AuthCard/OTPInput.js +0 -12
  91. package/dist/features/AuthCard/PasswordInput.d.ts +0 -13
  92. package/dist/features/AuthCard/PasswordInput.d.ts.map +0 -1
  93. package/dist/features/AuthCard/PasswordInput.js +0 -93
  94. package/dist/features/AuthCard/SignInForm.d.ts +0 -9
  95. package/dist/features/AuthCard/SignInForm.d.ts.map +0 -1
  96. package/dist/features/AuthCard/SignInForm.js +0 -86
  97. package/dist/features/AuthCard/SignUpForm.d.ts +0 -8
  98. package/dist/features/AuthCard/SignUpForm.d.ts.map +0 -1
  99. package/dist/features/AuthCard/SignUpForm.js +0 -100
  100. package/dist/features/AuthCard.js +0 -202
  101. package/dist/features/ClearDialog/ClearDialog.d.ts +0 -2
  102. package/dist/features/ClearDialog/ClearDialog.d.ts.map +0 -1
  103. package/dist/features/ClearDialog.js +0 -31
  104. package/dist/features/LabelingToolbar/LabelingToolbar.d.ts +0 -8
  105. package/dist/features/LabelingToolbar/LabelingToolbar.d.ts.map +0 -1
  106. package/dist/features/LabelingToolbar.js +0 -13
  107. package/dist/features/LabelingTools/LabelingTools.d.ts +0 -2
  108. package/dist/features/LabelingTools/LabelingTools.d.ts.map +0 -1
  109. package/dist/features/LabelingTools.js +0 -134
  110. package/dist/features/SensorMetadata/SensorMetadata.d.ts +0 -2
  111. package/dist/features/SensorMetadata/SensorMetadata.d.ts.map +0 -1
  112. package/dist/features/SensorMetadata.js +0 -117
  113. package/dist/features/SettingsPopover/SettingsPopover.d.ts +0 -2
  114. package/dist/features/SettingsPopover/SettingsPopover.d.ts.map +0 -1
  115. package/dist/features/SettingsPopover.js +0 -204
  116. package/dist/index-BIpuW_o8.js +0 -146
  117. package/dist/linear-cursor-small.png +0 -0
  118. package/dist/loader-circle-CdRVlFhN.js +0 -11
  119. package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
  120. package/dist/logo/wordmark-light-side-by-side.svg +0 -6
  121. package/dist/message-alert-matte-glass-gradient.webp +0 -0
  122. package/dist/proxy-C9AqCss6.js +0 -4670
  123. package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
  124. package/dist/themes/grayscale-theme.webp +0 -0
  125. package/dist/themes/green-black-theme.webp +0 -0
  126. package/dist/themes/reverse-grayscale-theme.webp +0 -0
  127. package/dist/themes/viridis-theme.webp +0 -0
  128. package/dist/utils/refs.d.ts.map +0 -1
  129. package/dist/x-Dl66o_vF.js +0 -14
  130. /package/dist/utils/{refs.js → createForwardRef.js} +0 -0
package/dist/InputOTP.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsx as k, jsxs as vt } from "react/jsx-runtime";
3
+ import { jsx as T, jsxs as vt } from "react/jsx-runtime";
4
4
  import "./Icons/AnalyzeIcon.js";
5
5
  import "./Icons/AnnotationsIcon.js";
6
6
  import "./Icons/ApprovedIcon.js";
@@ -60,66 +60,66 @@ import "./Icons/ZoomXIcon.js";
60
60
  import "./Icons/ZoomYIcon.js";
61
61
  import { useFormFieldId as Ht, ErrorMessage as Gt, getErrorMessageId as Lt } from "./utils/formFieldUtils.js";
62
62
  import { cn as gt } from "./utils/twUtils.js";
63
- import * as n from "react";
63
+ import * as r from "react";
64
64
  import { createContext as ht, forwardRef as Q, useContext as bt } from "react";
65
- var zt = Object.defineProperty, $t = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, K = Object.getOwnPropertySymbols, wt = Object.prototype.hasOwnProperty, yt = Object.prototype.propertyIsEnumerable, ft = (t, r, a) => r in t ? zt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a, qt = (t, r) => {
66
- for (var a in r || (r = {})) wt.call(r, a) && ft(t, a, r[a]);
67
- if (K) for (var a of K(r)) yt.call(r, a) && ft(t, a, r[a]);
65
+ var zt = Object.defineProperty, $t = Object.defineProperties, Vt = Object.getOwnPropertyDescriptors, K = Object.getOwnPropertySymbols, wt = Object.prototype.hasOwnProperty, yt = Object.prototype.propertyIsEnumerable, ft = (t, n, a) => n in t ? zt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a, qt = (t, n) => {
66
+ for (var a in n || (n = {})) wt.call(n, a) && ft(t, a, n[a]);
67
+ if (K) for (var a of K(n)) yt.call(n, a) && ft(t, a, n[a]);
68
68
  return t;
69
- }, Zt = (t, r) => $t(t, Vt(r)), Jt = (t, r) => {
69
+ }, Zt = (t, n) => $t(t, Vt(n)), Jt = (t, n) => {
70
70
  var a = {};
71
- for (var u in t) wt.call(t, u) && r.indexOf(u) < 0 && (a[u] = t[u]);
72
- if (t != null && K) for (var u of K(t)) r.indexOf(u) < 0 && yt.call(t, u) && (a[u] = t[u]);
71
+ for (var u in t) wt.call(t, u) && n.indexOf(u) < 0 && (a[u] = t[u]);
72
+ if (t != null && K) for (var u of K(t)) n.indexOf(u) < 0 && yt.call(t, u) && (a[u] = t[u]);
73
73
  return a;
74
74
  };
75
75
  function Kt(t) {
76
- let r = setTimeout(t, 0), a = setTimeout(t, 10), u = setTimeout(t, 50);
77
- return [r, a, u];
76
+ let n = setTimeout(t, 0), a = setTimeout(t, 10), u = setTimeout(t, 50);
77
+ return [n, a, u];
78
78
  }
79
79
  function Qt(t) {
80
- let r = n.useRef();
81
- return n.useEffect(() => {
82
- r.current = t;
83
- }), r.current;
80
+ let n = r.useRef();
81
+ return r.useEffect(() => {
82
+ n.current = t;
83
+ }), n.current;
84
84
  }
85
- var Ut = 18, Et = 40, Xt = `${Et}px`, Yt = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
86
- function te({ containerRef: t, inputRef: r, pushPasswordManagerStrategy: a, isFocused: u }) {
87
- let [v, s] = n.useState(!1), [b, d] = n.useState(!1), [T, S] = n.useState(!1), A = n.useMemo(() => a === "none" ? !1 : (a === "increase-width" || a === "experimental-no-flickering") && v && b, [v, b, a]), R = n.useCallback(() => {
88
- let f = t.current, x = r.current;
89
- if (!f || !x || T || a === "none") return;
90
- let g = f, w = g.getBoundingClientRect().left + g.offsetWidth, O = g.getBoundingClientRect().top + g.offsetHeight / 2, l = w - Ut, I = O;
91
- document.querySelectorAll(Yt).length === 0 && document.elementFromPoint(l, I) === f || (s(!0), S(!0));
92
- }, [t, r, T, a]);
93
- return n.useEffect(() => {
85
+ var Ut = 18, xt = 40, Xt = `${xt}px`, Yt = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
86
+ function te({ containerRef: t, inputRef: n, pushPasswordManagerStrategy: a, isFocused: u }) {
87
+ let [v, s] = r.useState(!1), [b, d] = r.useState(!1), [k, E] = r.useState(!1), A = r.useMemo(() => a === "none" ? !1 : (a === "increase-width" || a === "experimental-no-flickering") && v && b, [v, b, a]), R = r.useCallback(() => {
88
+ let f = t.current, P = n.current;
89
+ if (!f || !P || k || a === "none") return;
90
+ let g = f, w = g.getBoundingClientRect().left + g.offsetWidth, I = g.getBoundingClientRect().top + g.offsetHeight / 2, l = w - Ut, O = I;
91
+ document.querySelectorAll(Yt).length === 0 && document.elementFromPoint(l, O) === f || (s(!0), E(!0));
92
+ }, [t, n, k, a]);
93
+ return r.useEffect(() => {
94
94
  let f = t.current;
95
95
  if (!f || a === "none") return;
96
- function x() {
96
+ function P() {
97
97
  let w = window.innerWidth - f.getBoundingClientRect().right;
98
- d(w >= Et);
98
+ d(w >= xt);
99
99
  }
100
- x();
101
- let g = setInterval(x, 1e3);
100
+ P();
101
+ let g = setInterval(P, 1e3);
102
102
  return () => {
103
103
  clearInterval(g);
104
104
  };
105
- }, [t, a]), n.useEffect(() => {
106
- let f = u || document.activeElement === r.current;
105
+ }, [t, a]), r.useEffect(() => {
106
+ let f = u || document.activeElement === n.current;
107
107
  if (a === "none" || !f) return;
108
- let x = setTimeout(R, 0), g = setTimeout(R, 2e3), w = setTimeout(R, 5e3), O = setTimeout(() => {
109
- S(!0);
108
+ let P = setTimeout(R, 0), g = setTimeout(R, 2e3), w = setTimeout(R, 5e3), I = setTimeout(() => {
109
+ E(!0);
110
110
  }, 6e3);
111
111
  return () => {
112
- clearTimeout(x), clearTimeout(g), clearTimeout(w), clearTimeout(O);
112
+ clearTimeout(P), clearTimeout(g), clearTimeout(w), clearTimeout(I);
113
113
  };
114
- }, [r, u, a, R]), { hasPWMBadge: v, willPushPWMBadge: A, PWM_BADGE_SPACE_WIDTH: Xt };
114
+ }, [n, u, a, R]), { hasPWMBadge: v, willPushPWMBadge: A, PWM_BADGE_SPACE_WIDTH: Xt };
115
115
  }
116
- var ee = n.createContext({}), St = n.forwardRef((t, r) => {
117
- var a = t, { value: u, onChange: v, maxLength: s, textAlign: b = "left", pattern: d, placeholder: T, inputMode: S = "numeric", onComplete: A, pushPasswordManagerStrategy: R = "increase-width", pasteTransformer: f, containerClassName: x, noScriptCSSFallback: g = ne, render: w, children: O } = a, l = Jt(a, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), I, nt, rt, ot, at;
118
- let [Ot, It] = n.useState(typeof l.defaultValue == "string" ? l.defaultValue : ""), c = u ?? Ot, W = Qt(c), L = n.useCallback((e) => {
119
- v?.(e), It(e);
120
- }, [v]), C = n.useMemo(() => d ? typeof d == "string" ? new RegExp(d) : d : null, [d]), p = n.useRef(null), U = n.useRef(null), X = n.useRef({ value: c, onChange: L, isIOS: typeof window < "u" && ((nt = (I = window?.CSS) == null ? void 0 : I.supports) == null ? void 0 : nt.call(I, "-webkit-touch-callout", "none")) }), Z = n.useRef({ prev: [(rt = p.current) == null ? void 0 : rt.selectionStart, (ot = p.current) == null ? void 0 : ot.selectionEnd, (at = p.current) == null ? void 0 : at.selectionDirection] });
121
- n.useImperativeHandle(r, () => p.current, []), n.useEffect(() => {
122
- let e = p.current, o = U.current;
116
+ var ee = r.createContext({}), Et = r.forwardRef((t, n) => {
117
+ var a = t, { value: u, onChange: v, maxLength: s, textAlign: b = "left", pattern: d, placeholder: k, inputMode: E = "numeric", onComplete: A, pushPasswordManagerStrategy: R = "increase-width", pasteTransformer: f, containerClassName: P, noScriptCSSFallback: g = re, render: w, children: I } = a, l = Jt(a, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), O, rt, nt, ot, at;
118
+ let [It, Ot] = r.useState(typeof l.defaultValue == "string" ? l.defaultValue : ""), p = u ?? It, W = Qt(p), L = r.useCallback((e) => {
119
+ v?.(e), Ot(e);
120
+ }, [v]), C = r.useMemo(() => d ? typeof d == "string" ? new RegExp(d) : d : null, [d]), c = r.useRef(null), U = r.useRef(null), X = r.useRef({ value: p, onChange: L, isIOS: typeof window < "u" && ((rt = (O = window?.CSS) == null ? void 0 : O.supports) == null ? void 0 : rt.call(O, "-webkit-touch-callout", "none")) }), Z = r.useRef({ prev: [(nt = c.current) == null ? void 0 : nt.selectionStart, (ot = c.current) == null ? void 0 : ot.selectionEnd, (at = c.current) == null ? void 0 : at.selectionDirection] });
121
+ r.useImperativeHandle(n, () => c.current, []), r.useEffect(() => {
122
+ let e = c.current, o = U.current;
123
123
  if (!e || !o) return;
124
124
  X.current.value !== e.value && X.current.onChange(e.value), Z.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
125
125
  function m() {
@@ -127,24 +127,24 @@ var ee = n.createContext({}), St = n.forwardRef((t, r) => {
127
127
  $(null), V(null);
128
128
  return;
129
129
  }
130
- let i = e.selectionStart, h = e.selectionEnd, J = e.selectionDirection, P = e.maxLength, F = e.value, M = Z.current.prev, j = -1, D = -1, N;
130
+ let i = e.selectionStart, h = e.selectionEnd, J = e.selectionDirection, S = e.maxLength, F = e.value, M = Z.current.prev, j = -1, D = -1, N;
131
131
  if (F.length !== 0 && i !== null && h !== null) {
132
- let Bt = i === h, Ft = i === F.length && F.length < P;
132
+ let Bt = i === h, Ft = i === F.length && F.length < S;
133
133
  if (Bt && !Ft) {
134
134
  let _ = i;
135
135
  if (_ === 0) j = 0, D = 1, N = "forward";
136
- else if (_ === P) j = _ - 1, D = _, N = "backward";
137
- else if (P > 1 && F.length > 1) {
136
+ else if (_ === S) j = _ - 1, D = _, N = "backward";
137
+ else if (S > 1 && F.length > 1) {
138
138
  let et = 0;
139
139
  if (M[0] !== null && M[1] !== null) {
140
140
  N = _ < M[1] ? "backward" : "forward";
141
- let Nt = M[0] === M[1] && M[0] < P;
141
+ let Nt = M[0] === M[1] && M[0] < S;
142
142
  N === "backward" && !Nt && (et = -1);
143
143
  }
144
144
  j = et + _, D = et + _ + 1;
145
145
  }
146
146
  }
147
- j !== -1 && D !== -1 && j !== D && p.current.setSelectionRange(j, D, N);
147
+ j !== -1 && D !== -1 && j !== D && c.current.setSelectionRange(j, D, N);
148
148
  }
149
149
  let dt = j !== -1 ? j : i, mt = D !== -1 ? D : h, Wt = N ?? J;
150
150
  $(dt), V(mt), Z.current.prev = [dt, mt, Wt];
@@ -160,50 +160,50 @@ var ee = n.createContext({}), St = n.forwardRef((t, r) => {
160
160
  o && o.style.setProperty("--root-height", `${e.clientHeight}px`);
161
161
  };
162
162
  y();
163
- let E = new ResizeObserver(y);
164
- return E.observe(e), () => {
165
- document.removeEventListener("selectionchange", m, { capture: !0 }), E.disconnect();
163
+ let x = new ResizeObserver(y);
164
+ return x.observe(e), () => {
165
+ document.removeEventListener("selectionchange", m, { capture: !0 }), x.disconnect();
166
166
  };
167
167
  }, []);
168
- let [lt, it] = n.useState(!1), [z, Y] = n.useState(!1), [B, $] = n.useState(null), [H, V] = n.useState(null);
169
- n.useEffect(() => {
168
+ let [lt, it] = r.useState(!1), [z, Y] = r.useState(!1), [B, $] = r.useState(null), [H, V] = r.useState(null);
169
+ r.useEffect(() => {
170
170
  Kt(() => {
171
171
  var e, o, m, y;
172
- (e = p.current) == null || e.dispatchEvent(new Event("input"));
173
- let E = (o = p.current) == null ? void 0 : o.selectionStart, i = (m = p.current) == null ? void 0 : m.selectionEnd, h = (y = p.current) == null ? void 0 : y.selectionDirection;
174
- E !== null && i !== null && ($(E), V(i), Z.current.prev = [E, i, h]);
172
+ (e = c.current) == null || e.dispatchEvent(new Event("input"));
173
+ let x = (o = c.current) == null ? void 0 : o.selectionStart, i = (m = c.current) == null ? void 0 : m.selectionEnd, h = (y = c.current) == null ? void 0 : y.selectionDirection;
174
+ x !== null && i !== null && ($(x), V(i), Z.current.prev = [x, i, h]);
175
175
  });
176
- }, [c, z]), n.useEffect(() => {
177
- W !== void 0 && c !== W && W.length < s && c.length === s && A?.(c);
178
- }, [s, A, W, c]);
179
- let G = te({ containerRef: U, inputRef: p, pushPasswordManagerStrategy: R, isFocused: z }), ut = n.useCallback((e) => {
176
+ }, [p, z]), r.useEffect(() => {
177
+ W !== void 0 && p !== W && W.length < s && p.length === s && A?.(p);
178
+ }, [s, A, W, p]);
179
+ let G = te({ containerRef: U, inputRef: c, pushPasswordManagerStrategy: R, isFocused: z }), ut = r.useCallback((e) => {
180
180
  let o = e.currentTarget.value.slice(0, s);
181
181
  if (o.length > 0 && C && !C.test(o)) {
182
182
  e.preventDefault();
183
183
  return;
184
184
  }
185
185
  typeof W == "string" && o.length < W.length && document.dispatchEvent(new Event("selectionchange")), L(o);
186
- }, [s, L, W, C]), st = n.useCallback(() => {
186
+ }, [s, L, W, C]), st = r.useCallback(() => {
187
187
  var e;
188
- if (p.current) {
189
- let o = Math.min(p.current.value.length, s - 1), m = p.current.value.length;
190
- (e = p.current) == null || e.setSelectionRange(o, m), $(o), V(m);
188
+ if (c.current) {
189
+ let o = Math.min(c.current.value.length, s - 1), m = c.current.value.length;
190
+ (e = c.current) == null || e.setSelectionRange(o, m), $(o), V(m);
191
191
  }
192
192
  Y(!0);
193
- }, [s]), ct = n.useCallback((e) => {
193
+ }, [s]), pt = r.useCallback((e) => {
194
194
  var o, m;
195
- let y = p.current;
195
+ let y = c.current;
196
196
  if (!f && (!X.current.isIOS || !e.clipboardData || !y)) return;
197
- let E = e.clipboardData.getData("text/plain"), i = f ? f(E) : E;
197
+ let x = e.clipboardData.getData("text/plain"), i = f ? f(x) : x;
198
198
  e.preventDefault();
199
- let h = (o = p.current) == null ? void 0 : o.selectionStart, J = (m = p.current) == null ? void 0 : m.selectionEnd, P = (h !== J ? c.slice(0, h) + i + c.slice(J) : c.slice(0, h) + i + c.slice(h)).slice(0, s);
200
- if (P.length > 0 && C && !C.test(P)) return;
201
- y.value = P, L(P);
202
- let F = Math.min(P.length, s - 1), M = P.length;
199
+ let h = (o = c.current) == null ? void 0 : o.selectionStart, J = (m = c.current) == null ? void 0 : m.selectionEnd, S = (h !== J ? p.slice(0, h) + i + p.slice(J) : p.slice(0, h) + i + p.slice(h)).slice(0, s);
200
+ if (S.length > 0 && C && !C.test(S)) return;
201
+ y.value = S, L(S);
202
+ let F = Math.min(S.length, s - 1), M = S.length;
203
203
  y.setSelectionRange(F, M), $(F), V(M);
204
- }, [s, L, C, c]), jt = n.useMemo(() => ({ position: "relative", cursor: l.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [l.disabled]), pt = n.useMemo(() => ({ position: "absolute", inset: 0, width: G.willPushPWMBadge ? `calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: G.willPushPWMBadge ? `inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: b, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [G.PWM_BADGE_SPACE_WIDTH, G.willPushPWMBadge, b]), Dt = n.useMemo(() => n.createElement("input", Zt(qt({ autoComplete: l.autoComplete || "one-time-code" }, l), { "data-input-otp": !0, "data-input-otp-placeholder-shown": c.length === 0 || void 0, "data-input-otp-mss": B, "data-input-otp-mse": H, inputMode: S, pattern: C?.source, "aria-placeholder": T, style: pt, maxLength: s, value: c, ref: p, onPaste: (e) => {
204
+ }, [s, L, C, p]), jt = r.useMemo(() => ({ position: "relative", cursor: l.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [l.disabled]), ct = r.useMemo(() => ({ position: "absolute", inset: 0, width: G.willPushPWMBadge ? `calc(100% + ${G.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: G.willPushPWMBadge ? `inset(0 ${G.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: b, opacity: "1", color: "transparent", pointerEvents: "all", background: "transparent", caretColor: "transparent", border: "0 solid transparent", outline: "0 solid transparent", boxShadow: "none", lineHeight: "1", letterSpacing: "-.5em", fontSize: "var(--root-height)", fontFamily: "monospace", fontVariantNumeric: "tabular-nums" }), [G.PWM_BADGE_SPACE_WIDTH, G.willPushPWMBadge, b]), Dt = r.useMemo(() => r.createElement("input", Zt(qt({ autoComplete: l.autoComplete || "one-time-code" }, l), { "data-input-otp": !0, "data-input-otp-placeholder-shown": p.length === 0 || void 0, "data-input-otp-mss": B, "data-input-otp-mse": H, inputMode: E, pattern: C?.source, "aria-placeholder": k, style: ct, maxLength: s, value: p, ref: c, onPaste: (e) => {
205
205
  var o;
206
- ct(e), (o = l.onPaste) == null || o.call(l, e);
206
+ pt(e), (o = l.onPaste) == null || o.call(l, e);
207
207
  }, onChange: ut, onMouseOver: (e) => {
208
208
  var o;
209
209
  it(!0), (o = l.onMouseOver) == null || o.call(l, e);
@@ -216,22 +216,22 @@ var ee = n.createContext({}), St = n.forwardRef((t, r) => {
216
216
  }, onBlur: (e) => {
217
217
  var o;
218
218
  Y(!1), (o = l.onBlur) == null || o.call(l, e);
219
- } })), [ut, st, ct, S, pt, s, H, B, l, C?.source, c]), tt = n.useMemo(() => ({ slots: Array.from({ length: s }).map((e, o) => {
219
+ } })), [ut, st, pt, E, ct, s, H, B, l, C?.source, p]), tt = r.useMemo(() => ({ slots: Array.from({ length: s }).map((e, o) => {
220
220
  var m;
221
- let y = z && B !== null && H !== null && (B === H && o === B || o >= B && o < H), E = c[o] !== void 0 ? c[o] : null, i = c[0] !== void 0 ? null : (m = T?.[o]) != null ? m : null;
222
- return { char: E, placeholderChar: i, isActive: y, hasFakeCaret: y && E === null };
223
- }), isFocused: z, isHovering: !l.disabled && lt }), [z, lt, s, H, B, l.disabled, c]), At = n.useMemo(() => w ? w(tt) : n.createElement(ee.Provider, { value: tt }, O), [O, tt, w]);
224
- return n.createElement(n.Fragment, null, g !== null && n.createElement("noscript", null, n.createElement("style", null, g)), n.createElement("div", { ref: U, "data-input-otp-container": !0, style: jt, className: x }, At, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Dt)));
221
+ let y = z && B !== null && H !== null && (B === H && o === B || o >= B && o < H), x = p[o] !== void 0 ? p[o] : null, i = p[0] !== void 0 ? null : (m = k?.[o]) != null ? m : null;
222
+ return { char: x, placeholderChar: i, isActive: y, hasFakeCaret: y && x === null };
223
+ }), isFocused: z, isHovering: !l.disabled && lt }), [z, lt, s, H, B, l.disabled, p]), At = r.useMemo(() => w ? w(tt) : r.createElement(ee.Provider, { value: tt }, I), [I, tt, w]);
224
+ return r.createElement(r.Fragment, null, g !== null && r.createElement("noscript", null, r.createElement("style", null, g)), r.createElement("div", { ref: U, "data-input-otp-container": !0, style: jt, className: P }, At, r.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Dt)));
225
225
  });
226
- St.displayName = "Input";
227
- function q(t, r) {
226
+ Et.displayName = "Input";
227
+ function q(t, n) {
228
228
  try {
229
- t.insertRule(r);
229
+ t.insertRule(n);
230
230
  } catch {
231
- console.error("input-otp could not insert CSS rule:", r);
231
+ console.error("input-otp could not insert CSS rule:", n);
232
232
  }
233
233
  }
234
- var ne = `
234
+ var re = `
235
235
  [data-input-otp] {
236
236
  --nojs-bg: white !important;
237
237
  --nojs-fg: black !important;
@@ -251,21 +251,21 @@ var ne = `
251
251
  --nojs-fg: white !important;
252
252
  }
253
253
  }`;
254
- const Pt = ht({}), xt = ht(null), Ct = () => {
255
- const t = bt(xt);
254
+ const St = ht({}), Pt = ht(null), Ct = () => {
255
+ const t = bt(Pt);
256
256
  if (!t)
257
257
  throw new Error("useRoot must be used within an InputOTP");
258
258
  return t;
259
- }, Mt = Q(({ autoFocus: t = !1, children: r, className: a, errorMessage: u, hasError: v, id: s, inputMode: b = "numeric", maxLength: d, name: T, onChange: S, onComplete: A, value: R, variant: f = "outlined", ...x }, g) => {
260
- const w = Ht(s, T), O = (l) => {
261
- const I = l.clipboardData.getData("text/plain").trim();
262
- I.length === d && typeof S == "function" && (S(""), setTimeout(() => {
263
- typeof S == "function" && S(I);
259
+ }, Mt = Q(({ autoFocus: t = !1, children: n, className: a, errorMessage: u, hasError: v, id: s, inputMode: b = "numeric", maxLength: d, name: k, onChange: E, onComplete: A, value: R, variant: f = "outlined", ...P }, g) => {
260
+ const w = Ht(s, k), I = (l) => {
261
+ const O = l.clipboardData.getData("text/plain").trim();
262
+ O.length === d && typeof E == "function" && (E(""), setTimeout(() => {
263
+ typeof E == "function" && E(O);
264
264
  }, 0));
265
265
  };
266
- return /* @__PURE__ */ k(Pt.Provider, { value: { hasError: v }, children: /* @__PURE__ */ vt("div", { className: "flex w-max flex-col gap-y-1", children: [
267
- /* @__PURE__ */ k(
268
- St,
266
+ return /* @__PURE__ */ T(St.Provider, { value: { hasError: v }, children: /* @__PURE__ */ vt("div", { className: "flex w-max flex-col gap-y-1", children: [
267
+ /* @__PURE__ */ T(
268
+ Et,
269
269
  {
270
270
  autoFocus: t,
271
271
  containerClassName: gt("flex items-center gap-2 has-[:disabled]:opacity-50 disabled:cursor-not-allowed", a),
@@ -273,33 +273,33 @@ const Pt = ht({}), xt = ht(null), Ct = () => {
273
273
  "data-dashlane-disabled-on-field": "true",
274
274
  "data-lpignore": "true",
275
275
  "data-protonpass-ignore": "true",
276
- "data-testid": "input-otp",
276
+ "data-testid": "spectral-input-otp",
277
277
  id: w,
278
278
  inputMode: b,
279
279
  maxLength: d,
280
- onChange: S,
280
+ onChange: E,
281
281
  onComplete: A,
282
- onPaste: O,
282
+ onPaste: I,
283
283
  pushPasswordManagerStrategy: "none",
284
284
  ref: g,
285
+ role: "textbox",
285
286
  textAlign: "center",
286
287
  value: R,
287
- ...x,
288
- render: ({ slots: l }) => /* @__PURE__ */ k(xt.Provider, { value: { slots: l, variant: f }, children: r })
288
+ ...P,
289
+ render: ({ slots: l }) => /* @__PURE__ */ T(Pt.Provider, { value: { slots: l, variant: f }, children: n })
289
290
  }
290
291
  ),
291
- v && u && /* @__PURE__ */ k(Gt, { id: Lt(w), message: u })
292
+ v && u && /* @__PURE__ */ T(Gt, { dataTestId: "spectral-input-otp-error-message", id: Lt(w), message: u })
292
293
  ] }) });
293
294
  });
294
295
  Mt.displayName = "InputOTP";
295
- const kt = Q(({ ...t }, r) => /* @__PURE__ */ k("div", { ref: r, className: "flex items-center justify-between gap-x-2 justify-center", ...t, "data-testid": "input-otp-group" }));
296
- kt.displayName = "InputOTP.Group";
297
- const Tt = Q(({ index: t, className: r, ...a }, u) => {
298
- const { variant: v = "outlined", slots: s = [] } = Ct(), { hasError: b } = bt(Pt), d = s[t] || { char: "", hasFakeCaret: !0, isActive: !1 };
296
+ const Tt = Q(({ ...t }, n) => /* @__PURE__ */ T("div", { className: "flex items-center justify-between gap-x-2 justify-center", "data-testid": "spectral-input-otp-group", ref: n, ...t }));
297
+ Tt.displayName = "InputOTP.Group";
298
+ const kt = Q(({ index: t, className: n, ...a }, u) => {
299
+ const { variant: v = "outlined", slots: s = [] } = Ct(), { hasError: b } = bt(St), d = s[t] || { char: "", hasFakeCaret: !0, isActive: !1 };
299
300
  return /* @__PURE__ */ vt(
300
301
  "div",
301
302
  {
302
- ref: u,
303
303
  className: gt(
304
304
  "relative flex h-12 w-10 items-center justify-center rounded-[8px] border-1 transition duration-200 z-10 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
305
305
  v === "filled" ? "bg-level-one border-level-one" : "bg-transparent border-input-otp-border",
@@ -307,30 +307,31 @@ const Tt = Q(({ index: t, className: r, ...a }, u) => {
307
307
  b && "border-2 border-danger-400 focus-visible:outline-danger-400",
308
308
  d.isActive && !b && "z-10 outline-2 outline-input-otp-border--focus outline-offset-2",
309
309
  d.isActive && b && "outline-2 outline-offset-2 outline-danger-400",
310
- r
310
+ n
311
311
  ),
312
312
  "data-index": t,
313
- "data-testid": "input-otp-slot",
313
+ "data-testid": "spectral-input-otp-slot",
314
314
  "data-variant": v,
315
+ ref: u,
315
316
  ...a,
316
317
  children: [
317
318
  d.char,
318
- d.hasFakeCaret && /* @__PURE__ */ k("div", { className: "pointer-events-none absolute inset-0 flex animate-caret-blink items-center justify-center", children: /* @__PURE__ */ k("div", { className: "h-8 w-px bg-input-otp-caret" }) })
319
+ d.hasFakeCaret && /* @__PURE__ */ T("div", { className: "pointer-events-none absolute inset-0 flex animate-caret-blink items-center justify-center", children: /* @__PURE__ */ T("div", { className: "h-8 w-px bg-input-otp-caret" }) })
319
320
  ]
320
321
  }
321
322
  );
322
323
  });
323
- Tt.displayName = "InputOTP.Slot";
324
- const Rt = Q(({ ...t }, r) => {
324
+ kt.displayName = "InputOTP.Slot";
325
+ const Rt = Q(({ ...t }, n) => {
325
326
  const { variant: a = "outlined" } = Ct();
326
- return /* @__PURE__ */ k("div", { ref: r, role: "separator", ...t, "data-testid": "input-otp-separator", "data-variant": a, children: /* @__PURE__ */ k(_t, { size: 24, color: a === "filled" ? "var(--color-input-otp-filled-separator)" : "var(--color-input-otp-border)" }) });
327
+ return /* @__PURE__ */ T("div", { ref: n, role: "separator", ...t, "data-testid": "spectral-input-otp-separator", "data-variant": a, children: /* @__PURE__ */ T(_t, { size: 24, color: a === "filled" ? "var(--color-input-otp-filled-separator)" : "var(--color-input-otp-border)" }) });
327
328
  });
328
329
  Rt.displayName = "InputOTP.Separator";
329
- const pn = Object.assign(Mt, {
330
- Group: kt,
331
- Slot: Tt,
330
+ const pr = Object.assign(Mt, {
331
+ Group: Tt,
332
+ Slot: kt,
332
333
  Separator: Rt
333
334
  });
334
335
  export {
335
- pn as InputOTP
336
+ pr as InputOTP
336
337
  };
@@ -1,32 +1,32 @@
1
1
  import { ButtonHTMLAttributes } from 'react';
2
2
  export type MultiSelectState = 'default' | 'error' | 'disabled' | 'loading';
3
3
  export interface MultiSelectOption {
4
+ disabled?: boolean;
5
+ group?: string;
4
6
  label: string;
5
7
  value: string;
6
- group?: string;
7
- disabled?: boolean;
8
8
  }
9
9
  export interface MultiSelectBaseProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange'> {
10
- value: string[];
10
+ clearAllLabel?: string;
11
+ closeOnSelect?: boolean;
12
+ emptyMessage?: string;
13
+ errorMessage?: string;
14
+ id?: string;
15
+ label?: string;
16
+ loadingMessage?: string;
17
+ maxCount?: number;
18
+ name?: string;
11
19
  onChange: (value: string[]) => void;
12
20
  options: MultiSelectOption[];
13
21
  placeholder?: string;
14
- maxCount?: number;
15
- state?: MultiSelectState;
16
- errorMessage?: string;
17
- emptyMessage?: string;
18
- loadingMessage?: string;
19
22
  searchPlaceholder?: string;
20
- selectAllLabel?: string;
21
- clearAllLabel?: string;
22
- sortAlphabetically?: boolean;
23
- showSelectAll?: boolean;
24
23
  showClearAll?: boolean;
25
24
  showSearch?: boolean;
26
- closeOnSelect?: boolean;
27
- name?: string;
28
- id?: string;
29
- label?: string;
25
+ showSelectAll?: boolean;
26
+ selectAllLabel?: string;
27
+ sortAlphabetically?: boolean;
28
+ state?: MultiSelectState;
29
+ value: string[];
30
30
  'aria-label'?: string;
31
31
  'aria-describedby'?: string;
32
32
  }