@spear-ai/spectral 1.6.16 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/.js +196 -191
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +172 -165
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +23 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +32 -30
  8. package/dist/Avatar.d.ts +2 -2
  9. package/dist/Avatar.js +30 -22
  10. package/dist/Badge.d.ts +1 -1
  11. package/dist/Badge.js +3 -2
  12. package/dist/Button.d.ts +3 -3
  13. package/dist/Button.js +108 -46
  14. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  15. package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
  16. package/dist/ButtonGroup.d.ts +5 -5
  17. package/dist/ButtonGroup.js +21 -21
  18. package/dist/ButtonIcon.d.ts +2 -2
  19. package/dist/ButtonIcon.js +31 -30
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +16 -18
  23. package/dist/DataCard/Card.d.ts +1 -1
  24. package/dist/DataCard/Card.js +1 -1
  25. package/dist/DataCard.js +1 -1
  26. package/dist/DateTimePicker/Calendar.d.ts +4 -4
  27. package/dist/DateTimePicker/Calendar.js +4 -2
  28. package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
  29. package/dist/DateTimePicker/DateTimeInput.js +4 -4
  30. package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
  31. package/dist/DateTimePicker/DateTimeUtils.js +139 -197
  32. package/dist/DateTimePicker/TimePicker.d.ts +4 -4
  33. package/dist/DateTimePicker/TimePicker.js +3 -3
  34. package/dist/DateTimePicker.d.ts +5 -5
  35. package/dist/DateTimePicker.js +96 -74
  36. package/dist/Dialog.d.ts +13 -13
  37. package/dist/Dialog.js +57 -84
  38. package/dist/Drawer.d.ts +2 -2
  39. package/dist/Drawer.js +8 -8
  40. package/dist/HoverCard.d.ts +6 -5
  41. package/dist/HoverCard.js +64 -64
  42. package/dist/Icons/LineToolIcon.js +37 -10
  43. package/dist/Icons/MeasureIcon.d.ts +5 -0
  44. package/dist/Icons/MeasureIcon.js +26 -0
  45. package/dist/Icons/SearchIcon.d.ts +5 -0
  46. package/dist/Icons/SearchIcon.js +10 -0
  47. package/dist/Icons/index.d.ts +2 -0
  48. package/dist/Icons.js +76 -72
  49. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  50. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  51. package/dist/Input/InputUtils.d.ts +2 -2
  52. package/dist/Input/InputUtils.js +4 -4
  53. package/dist/Input.d.ts +1 -1
  54. package/dist/Input.js +31 -29
  55. package/dist/InputOTP.d.ts +10 -10
  56. package/dist/InputOTP.js +125 -123
  57. package/dist/Kbd.d.ts +8 -5
  58. package/dist/Kbd.js +85 -20
  59. package/dist/Label.d.ts +4 -2
  60. package/dist/Label.js +3 -3
  61. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  62. package/dist/MultiSelect/MultiSelectBase.js +278 -200
  63. package/dist/MultiSelect.d.ts +6 -6
  64. package/dist/MultiSelect.js +9 -9
  65. package/dist/Popover.js +22 -237
  66. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  67. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  68. package/dist/RadioButtonGroup.d.ts +1 -1
  69. package/dist/RadioGroup.d.ts +15 -15
  70. package/dist/RadioGroup.js +253 -236
  71. package/dist/Select.d.ts +3 -1
  72. package/dist/Select.js +92 -87
  73. package/dist/Separator.js +4 -4
  74. package/dist/Skeleton.d.ts +1 -2
  75. package/dist/Skeleton.js +2 -4
  76. package/dist/Slider.d.ts +6 -6
  77. package/dist/Slider.js +78 -78
  78. package/dist/Switch/SwitchBase.d.ts +4 -4
  79. package/dist/Switch/SwitchBase.js +68 -68
  80. package/dist/Switch.d.ts +3 -3
  81. package/dist/Switch.js +9 -9
  82. package/dist/Tabs/TabsBase.js +39 -38
  83. package/dist/Tabs/tabsUtils.js +7 -7
  84. package/dist/Tabs.d.ts +0 -4
  85. package/dist/Tabs.js +62 -66
  86. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  87. package/dist/Textarea/TextareaUtils.js +13 -13
  88. package/dist/Textarea.js +34 -22
  89. package/dist/Toast.d.ts +43 -0
  90. package/dist/Toast.js +883 -0
  91. package/dist/Toggle/ToggleBase.d.ts +4 -4
  92. package/dist/Toggle/ToggleBase.js +32 -33
  93. package/dist/Toggle.d.ts +1 -1
  94. package/dist/Toggle.js +7 -12
  95. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  96. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  97. package/dist/ToggleGroup.d.ts +1 -1
  98. package/dist/ToggleGroup.js +27 -30
  99. package/dist/Tooltip.d.ts +1 -1
  100. package/dist/Tooltip.js +97 -97
  101. package/dist/Tray.d.ts +9 -9
  102. package/dist/Tray.js +77 -74
  103. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  104. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  105. package/dist/hooks/useControllableState.d.ts +2 -2
  106. package/dist/hooks/useControllableState.d.ts.map +1 -1
  107. package/dist/hooks/useControllableState.js +2 -2
  108. package/dist/index-C12FUuIW.js +13 -0
  109. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  110. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  111. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  112. package/dist/index-DEYs15GP.js +66 -0
  113. package/dist/index-DdFoGvON.js +146 -0
  114. package/dist/index-Q3N6lgwg.js +225 -0
  115. package/dist/index.d.ts +3 -3
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/primitives/button.d.ts +1 -1
  118. package/dist/primitives/button.js +4 -4
  119. package/dist/primitives/input.d.ts.map +1 -1
  120. package/dist/primitives/input.js +8 -5
  121. package/dist/primitives/select.d.ts +12 -13
  122. package/dist/primitives/select.d.ts.map +1 -1
  123. package/dist/primitives/select.js +68 -95
  124. package/dist/primitives/slot.d.ts +5 -5
  125. package/dist/primitives/slot.d.ts.map +1 -1
  126. package/dist/primitives/slot.js +24 -33
  127. package/dist/primitives/textarea.d.ts.map +1 -1
  128. package/dist/primitives/textarea.js +4 -3
  129. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  130. package/dist/styles/base-colors.css +30 -30
  131. package/dist/styles/horizon/base-colors.css +30 -30
  132. package/dist/styles/horizon/colors.css +40 -11
  133. package/dist/styles/horizon/utilities.css +26 -3
  134. package/dist/styles/main.css +1 -1
  135. package/dist/styles/spectral.css +1 -1
  136. package/dist/styles/theme.css +96 -44
  137. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  138. package/dist/utils/formFieldUtils.d.ts +2 -2
  139. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  140. package/dist/utils/formFieldUtils.js +14 -11
  141. package/dist/utils/sharedUtils.d.ts +3 -3
  142. package/dist/utils/sharedUtils.d.ts.map +1 -1
  143. package/dist/utils/sharedUtils.js +1 -4
  144. package/dist/utils/twUtils.d.ts +1 -1
  145. package/dist/utils/twUtils.d.ts.map +1 -1
  146. package/dist/utils/twUtils.js +1 -4
  147. package/package.json +5 -1
  148. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  149. package/dist/index-CeP1E2kK.js +0 -209
  150. package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/Input.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
3
  import { jsxs as f, jsx as t } from "react/jsx-runtime";
4
- import { usePasswordVisibility as tt, usePrefixWidth as et, useClearOnFocus as rt } from "./Input/InputUtils.js";
4
+ import { usePasswordVisibility as tt, usePrefixWidth as rt, useClearOnFocus as et } from "./Input/InputUtils.js";
5
5
  import "./Icons/AnalyzeIcon.js";
6
6
  import "./Icons/AnnotationsIcon.js";
7
7
  import "./Icons/ApprovedIcon.js";
@@ -40,6 +40,7 @@ import "./Icons/LiveViewIcon.js";
40
40
  import { LoaderIcon as nt } from "./Icons/LoaderIcon.js";
41
41
  import "./Icons/LocationIcon.js";
42
42
  import "./Icons/LogoutIcon.js";
43
+ import "./Icons/MeasureIcon.js";
43
44
  import "./Icons/MessagesIcon.js";
44
45
  import "./Icons/MetadataIcon.js";
45
46
  import "./Icons/MinusIcon.js";
@@ -51,6 +52,7 @@ import "./Icons/PlusIcon.js";
51
52
  import "./Icons/ResetIcon.js";
52
53
  import "./Icons/ReviewedIcon.js";
53
54
  import "./Icons/ScissorsIcon.js";
55
+ import "./Icons/SearchIcon.js";
54
56
  import "./Icons/SettingsIcon.js";
55
57
  import "./Icons/SortAscendingIcon.js";
56
58
  import "./Icons/SortAtoZIcon.js";
@@ -75,30 +77,30 @@ const gt = (...a) => (p) => {
75
77
  i && (typeof i == "function" ? i(p) : i.current = p);
76
78
  });
77
79
  }, xt = (a) => ({
80
+ date: "off",
78
81
  email: "email",
82
+ number: "off",
79
83
  password: "current-password",
80
84
  tel: "tel",
81
- url: "url",
82
85
  text: "off",
83
- number: "off",
84
- date: "off",
86
+ url: "url",
85
87
  "datetime-local": "off"
86
88
  })[a] || "off", Ct = ({
87
- ref: a,
88
- className: p,
89
- clearOnFocus: i = !1,
90
- disabled: k,
89
+ className: a,
90
+ clearOnFocus: p = !1,
91
+ disabled: i,
91
92
  endIcon: b,
92
93
  errorMessage: g,
93
- id: P,
94
- label: r,
95
- labelClassName: R,
94
+ id: k,
95
+ label: e,
96
+ labelClassName: P,
96
97
  name: x,
97
98
  onBlur: C,
98
99
  onChange: n,
99
100
  onFocus: w,
100
- placeholder: V,
101
+ placeholder: R,
101
102
  prefix: l,
103
+ ref: V,
102
104
  required: v,
103
105
  showClearButton: $ = !1,
104
106
  startIcon: y,
@@ -110,37 +112,37 @@ const gt = (...a) => (p) => {
110
112
  "aria-describedby": O,
111
113
  ...j
112
114
  }) => {
113
- const m = ct(P, x), N = `${m}-error`, { isDisabled: F, isLoading: A, isInvalid: B } = mt(k, s), H = dt(s, O, v, N), E = bt(null), T = gt(a, E), { isVisible: u, toggleVisibility: W, inputType: D } = tt(), { prefixWidth: G, prefixRef: J } = et(l), { handleFocus: z } = rt(i, n ? (e) => n(e.target.value) : void 0), K = d(
114
- (e) => {
115
- C?.(e);
115
+ const m = ct(k, x), N = `${m}-error`, { isDisabled: F, isLoading: A, isInvalid: B } = mt(i, s), H = dt(s, O, v, N), E = bt(null), T = gt(V, E), { isVisible: u, toggleVisibility: W, inputType: D } = tt(), { prefixWidth: G, prefixRef: J } = rt(l), { handleFocus: z } = et(p, n ? (r) => n(r.target.value) : void 0), K = d(
116
+ (r) => {
117
+ C?.(r);
116
118
  },
117
119
  [C]
118
120
  ), Q = d(
119
- (e) => {
120
- z(e, w);
121
+ (r) => {
122
+ z(r, w);
121
123
  },
122
124
  [z, w]
123
125
  ), U = d(
124
- (e) => {
125
- const o = e.target.value;
126
+ (r) => {
127
+ const o = r.target.value;
126
128
  n?.(o);
127
129
  },
128
130
  [n]
129
131
  ), X = d(() => {
130
- const e = E.current;
131
- e && (e.value = "", e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus());
132
+ const r = E.current;
133
+ r && (r.value = "", r.dispatchEvent(new Event("input", { bubbles: !0 })), r.focus());
132
134
  }, []), S = $ && I.length > 0, Y = () => {
133
- const e = "absolute right-4 top-1/2 -translate-y-1/2 text-input-icon hover:text-input-icon--hover focus:outline-none cursor-pointer", o = {
134
- password: () => /* @__PURE__ */ t("button", { "aria-controls": m, "aria-label": u ? `Hide ${r || "password"}` : `Show ${r || "password"}`, "aria-pressed": u, className: e, "data-testid": "spectral-input-password-toggle", onClick: W, type: "button", children: u ? /* @__PURE__ */ t(at, { size: 22 }) : /* @__PURE__ */ t(pt, { size: 22 }) }),
135
- clear: () => /* @__PURE__ */ t("button", { "aria-label": `Clear ${r || "input"}`, className: e, "data-testid": "spectral-input-clear-button", onClick: X, type: "button", children: /* @__PURE__ */ t(it, { size: 24 }) }),
135
+ const r = "absolute right-4 top-1/2 -translate-y-1/2 text-input-icon hover:text-input-icon--hover focus:outline-none cursor-pointer", o = {
136
+ password: () => /* @__PURE__ */ t("button", { "aria-controls": m, "aria-label": u ? `Hide ${e ?? "password"}` : `Show ${e ?? "password"}`, "aria-pressed": u, className: r, "data-testid": "spectral-input-password-toggle", onClick: W, type: "button", children: u ? /* @__PURE__ */ t(at, { size: 22 }) : /* @__PURE__ */ t(pt, { size: 22 }) }),
137
+ clear: () => /* @__PURE__ */ t("button", { "aria-label": `Clear ${e ?? "input"}`, className: r, "data-testid": "spectral-input-clear-button", onClick: X, type: "button", children: /* @__PURE__ */ t(it, { size: 24 }) }),
136
138
  loading: () => /* @__PURE__ */ t("div", { className: "text-input-icon absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "spectral-input-loading-icon", children: /* @__PURE__ */ t(nt, { size: 24 }) }),
137
139
  error: () => /* @__PURE__ */ t("div", { className: "text-danger-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "spectral-input-error-icon", children: /* @__PURE__ */ t(st, { size: 24 }) }),
138
140
  success: () => /* @__PURE__ */ t("div", { className: "text-success-400 absolute top-1/2 right-4 -translate-y-1/2", "data-testid": "spectral-input-success-icon", children: /* @__PURE__ */ t(ot, { size: 24 }) })
139
141
  };
140
142
  return b ? /* @__PURE__ */ t("div", { className: "text-input-icon absolute top-1/2 right-4 -translate-y-1/2", children: b }) : c === "password" ? o.password() : S ? o.clear() : A ? o.loading() : s === "success" ? o.success() : s === "error" ? o.error() : null;
141
- }, Z = () => y || null, _ = h(ut(s, p), "[text-indent:var(--prefix-width)]", S && "pr-10"), q = h("pointer-events-none absolute inset-y-0 left-4 flex items-center text-base text-input-text-prefix opacity-100 peer-disabled:opacity-50");
143
+ }, Z = () => y || null, _ = h(ut(s, a), "[text-indent:var(--prefix-width)]", S && "pr-10"), q = h("pointer-events-none absolute inset-y-0 left-4 flex items-center text-base text-input-text-prefix opacity-100 peer-disabled:opacity-50");
142
144
  return /* @__PURE__ */ f("div", { className: "w-full space-y-1.5", "data-testid": "spectral-input-container", children: [
143
- r && /* @__PURE__ */ t(lt, { className: h("mb-2 block", R, F && "text-input-text--disabled placeholder:text-input-text-placeholder cursor-not-allowed"), "data-testid": "spectral-input-label", htmlFor: m, children: r }),
145
+ e && /* @__PURE__ */ t(lt, { className: h("mb-2 block", P, F && "text-input-text--disabled placeholder:text-input-text-placeholder cursor-not-allowed"), "data-testid": "spectral-input-label", htmlFor: m, children: e }),
144
146
  /* @__PURE__ */ f("div", { className: "relative", "data-testid": "spectral-input-wrapper", children: [
145
147
  /* @__PURE__ */ f("div", { className: "relative", children: [
146
148
  Z(),
@@ -148,7 +150,7 @@ const gt = (...a) => (p) => {
148
150
  /* @__PURE__ */ t(
149
151
  "input",
150
152
  {
151
- "aria-label": M || r,
153
+ "aria-label": M ?? e,
152
154
  autoComplete: xt(c),
153
155
  className: _,
154
156
  "data-state": s,
@@ -159,11 +161,11 @@ const gt = (...a) => (p) => {
159
161
  onBlur: K,
160
162
  onChange: U,
161
163
  onFocus: Q,
162
- placeholder: V || r,
164
+ placeholder: R ?? e,
163
165
  ref: T,
164
166
  required: v,
165
167
  style: ft({
166
- "--prefix-width": l ? `${G}px` : "0px"
168
+ "--prefix-width": l ? `${G}px` : "0"
167
169
  }),
168
170
  suppressHydrationWarning: L,
169
171
  type: c === "password" ? D : c,
@@ -1,7 +1,7 @@
1
1
  import { FormFieldState } from './utils/formFieldUtils';
2
2
  import { OTPInput, OTPInputProps } from 'input-otp';
3
3
  import { ComponentPropsWithoutRef, ComponentRef, Ref } from 'react';
4
- type InputOTPRootProps = Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerStrategy' | 'pasteTransformer' | 'noScriptCSSFallback' | 'placeholder' | 'containerClassName' | 'render' | 'pattern'> & {
4
+ export interface InputOTPBaseProps extends Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerStrategy' | 'pasteTransformer' | 'noScriptCSSFallback' | 'placeholder' | 'containerClassName' | 'render' | 'pattern'> {
5
5
  onComplete?: (...args: unknown[]) => void;
6
6
  className?: string;
7
7
  errorMessage?: string | undefined;
@@ -15,21 +15,21 @@ type InputOTPRootProps = Omit<OTPInputProps, 'textAlign' | 'pushPasswordManagerS
15
15
  separator?: boolean;
16
16
  state?: FormFieldState;
17
17
  variant?: 'outlined' | 'filled';
18
- };
19
- export type InputOTPProps = InputOTPRootProps & ({
18
+ }
19
+ type InputOTPProps = InputOTPBaseProps & ({
20
20
  value: number | string;
21
21
  onChange: (newValue: number | string) => void;
22
22
  } | {
23
23
  value?: never;
24
24
  onChange?: never;
25
25
  });
26
- type SlotsProps = {
27
- start?: number;
28
- count?: number;
26
+ interface SlotsProps {
29
27
  className?: string;
30
- };
28
+ count?: number;
29
+ start?: number;
30
+ }
31
31
  export declare const InputOTP: {
32
- ({ ref, autoFocus, children, className, errorMessage, id, inputMode, maxLength, name, onChange, onComplete, pattern, state, value, variant, ...props }: InputOTPProps & {
32
+ ({ autoFocus, children, className, errorMessage, id, inputMode, maxLength, name, onChange, onComplete, pattern, ref, state, value, variant, ...props }: InputOTPProps & {
33
33
  ref?: Ref<ComponentRef<typeof OTPInput>>;
34
34
  }): import("react/jsx-runtime").JSX.Element;
35
35
  displayName: string;
@@ -41,9 +41,9 @@ export declare const InputOTP: {
41
41
  displayName: string;
42
42
  };
43
43
  Slot: {
44
- ({ ref, index, className, ...props }: ComponentPropsWithoutRef<"div"> & {
45
- ref?: Ref<ComponentRef<"div">>;
44
+ ({ className, index, ref, ...props }: ComponentPropsWithoutRef<"div"> & {
46
45
  index: number;
46
+ ref?: Ref<ComponentRef<"div">>;
47
47
  }): import("react/jsx-runtime").JSX.Element;
48
48
  displayName: string;
49
49
  };
package/dist/InputOTP.js CHANGED
@@ -39,6 +39,7 @@ import "./Icons/LiveViewIcon.js";
39
39
  import "./Icons/LoaderIcon.js";
40
40
  import "./Icons/LocationIcon.js";
41
41
  import "./Icons/LogoutIcon.js";
42
+ import "./Icons/MeasureIcon.js";
42
43
  import "./Icons/MessagesIcon.js";
43
44
  import "./Icons/MetadataIcon.js";
44
45
  import { MinusIcon as Ht } from "./Icons/MinusIcon.js";
@@ -50,6 +51,7 @@ import "./Icons/PlusIcon.js";
50
51
  import "./Icons/ResetIcon.js";
51
52
  import "./Icons/ReviewedIcon.js";
52
53
  import "./Icons/ScissorsIcon.js";
54
+ import "./Icons/SearchIcon.js";
53
55
  import "./Icons/SettingsIcon.js";
54
56
  import "./Icons/SortAscendingIcon.js";
55
57
  import "./Icons/SortAtoZIcon.js";
@@ -75,13 +77,13 @@ var Vt = Object.defineProperty, qt = Object.defineProperties, Kt = Object.getOwn
75
77
  return t;
76
78
  }, Jt = (t, e) => qt(t, Kt(e)), Qt = (t, e) => {
77
79
  var o = {};
78
- for (var i in t) Pt.call(t, i) && e.indexOf(i) < 0 && (o[i] = t[i]);
79
- if (t != null && X) for (var i of X(t)) e.indexOf(i) < 0 && xt.call(t, i) && (o[i] = t[i]);
80
+ for (var l in t) Pt.call(t, l) && e.indexOf(l) < 0 && (o[l] = t[l]);
81
+ if (t != null && X) for (var l of X(t)) e.indexOf(l) < 0 && xt.call(t, l) && (o[l] = t[l]);
80
82
  return o;
81
83
  };
82
84
  function Ut(t) {
83
- let e = setTimeout(t, 0), o = setTimeout(t, 10), i = setTimeout(t, 50);
84
- return [e, o, i];
85
+ let e = setTimeout(t, 0), o = setTimeout(t, 10), l = setTimeout(t, 50);
86
+ return [e, o, l];
85
87
  }
86
88
  function Xt(t) {
87
89
  let e = n.useRef();
@@ -90,77 +92,77 @@ function Xt(t) {
90
92
  }), e.current;
91
93
  }
92
94
  var Yt = 18, Et = 40, te = `${Et}px`, ee = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
93
- function re({ containerRef: t, inputRef: e, pushPasswordManagerStrategy: o, isFocused: i }) {
94
- let [f, u] = n.useState(!1), [d, m] = n.useState(!1), [O, M] = n.useState(!1), j = n.useMemo(() => o === "none" ? !1 : (o === "increase-width" || o === "experimental-no-flickering") && f && d, [f, d, o]), T = n.useCallback(() => {
95
- let g = t.current, E = e.current;
96
- if (!g || !E || O || o === "none") return;
97
- let h = g, P = h.getBoundingClientRect().left + h.offsetWidth, k = h.getBoundingClientRect().top + h.offsetHeight / 2, l = P - Yt, F = k;
98
- document.querySelectorAll(ee).length === 0 && document.elementFromPoint(l, F) === g || (u(!0), M(!0));
99
- }, [t, e, O, o]);
95
+ function re({ containerRef: t, inputRef: e, pushPasswordManagerStrategy: o, isFocused: l }) {
96
+ let [v, i] = n.useState(!1), [d, m] = n.useState(!1), [E, D] = n.useState(!1), j = n.useMemo(() => o === "none" ? !1 : (o === "increase-width" || o === "experimental-no-flickering") && v && d, [v, d, o]), I = n.useCallback(() => {
97
+ let g = t.current, C = e.current;
98
+ if (!g || !C || E || o === "none") return;
99
+ let h = g, P = h.getBoundingClientRect().left + h.offsetWidth, T = h.getBoundingClientRect().top + h.offsetHeight / 2, s = P - Yt, F = T;
100
+ document.querySelectorAll(ee).length === 0 && document.elementFromPoint(s, F) === g || (i(!0), D(!0));
101
+ }, [t, e, E, o]);
100
102
  return n.useEffect(() => {
101
103
  let g = t.current;
102
104
  if (!g || o === "none") return;
103
- function E() {
105
+ function C() {
104
106
  let P = window.innerWidth - g.getBoundingClientRect().right;
105
107
  m(P >= Et);
106
108
  }
107
- E();
108
- let h = setInterval(E, 1e3);
109
+ C();
110
+ let h = setInterval(C, 1e3);
109
111
  return () => {
110
112
  clearInterval(h);
111
113
  };
112
114
  }, [t, o]), n.useEffect(() => {
113
- let g = i || document.activeElement === e.current;
115
+ let g = l || document.activeElement === e.current;
114
116
  if (o === "none" || !g) return;
115
- let E = setTimeout(T, 0), h = setTimeout(T, 2e3), P = setTimeout(T, 5e3), k = setTimeout(() => {
116
- M(!0);
117
+ let C = setTimeout(I, 0), h = setTimeout(I, 2e3), P = setTimeout(I, 5e3), T = setTimeout(() => {
118
+ D(!0);
117
119
  }, 6e3);
118
120
  return () => {
119
- clearTimeout(E), clearTimeout(h), clearTimeout(P), clearTimeout(k);
121
+ clearTimeout(C), clearTimeout(h), clearTimeout(P), clearTimeout(T);
120
122
  };
121
- }, [e, i, o, T]), { hasPWMBadge: f, willPushPWMBadge: j, PWM_BADGE_SPACE_WIDTH: te };
123
+ }, [e, l, o, I]), { hasPWMBadge: v, willPushPWMBadge: j, PWM_BADGE_SPACE_WIDTH: te };
122
124
  }
123
125
  var ne = n.createContext({}), Ct = n.forwardRef((t, e) => {
124
- var o = t, { value: i, onChange: f, maxLength: u, textAlign: d = "left", pattern: m, placeholder: O, inputMode: M = "numeric", onComplete: j, pushPasswordManagerStrategy: T = "increase-width", pasteTransformer: g, containerClassName: E, noScriptCSSFallback: h = oe, render: P, children: k } = o, l = Qt(o, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), F, J, R, W, st;
125
- let [Ot, Rt] = n.useState(typeof l.defaultValue == "string" ? l.defaultValue : ""), c = i ?? Ot, B = Xt(c), z = n.useCallback((r) => {
126
- f?.(r), Rt(r);
127
- }, [f]), C = n.useMemo(() => m ? typeof m == "string" ? new RegExp(m) : m : null, [m]), p = n.useRef(null), Y = n.useRef(null), tt = n.useRef({ value: c, onChange: z, isIOS: typeof window < "u" && ((J = (F = window?.CSS) == null ? void 0 : F.supports) == null ? void 0 : J.call(F, "-webkit-touch-callout", "none")) }), Q = n.useRef({ prev: [(R = p.current) == null ? void 0 : R.selectionStart, (W = p.current) == null ? void 0 : W.selectionEnd, (st = p.current) == null ? void 0 : st.selectionDirection] });
128
- n.useImperativeHandle(e, () => p.current, []), n.useEffect(() => {
129
- let r = p.current, a = Y.current;
126
+ var o = t, { value: l, onChange: v, maxLength: i, textAlign: d = "left", pattern: m, placeholder: E, inputMode: D = "numeric", onComplete: j, pushPasswordManagerStrategy: I = "increase-width", pasteTransformer: g, containerClassName: C, noScriptCSSFallback: h = oe, render: P, children: T } = o, s = Qt(o, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), F, J, O, W, st;
127
+ let [Ot, Rt] = n.useState(typeof s.defaultValue == "string" ? s.defaultValue : ""), p = l ?? Ot, B = Xt(p), z = n.useCallback((r) => {
128
+ v?.(r), Rt(r);
129
+ }, [v]), M = n.useMemo(() => m ? typeof m == "string" ? new RegExp(m) : m : null, [m]), c = n.useRef(null), Y = n.useRef(null), tt = n.useRef({ value: p, onChange: z, isIOS: typeof window < "u" && ((J = (F = window?.CSS) == null ? void 0 : F.supports) == null ? void 0 : J.call(F, "-webkit-touch-callout", "none")) }), Q = n.useRef({ prev: [(O = c.current) == null ? void 0 : O.selectionStart, (W = c.current) == null ? void 0 : W.selectionEnd, (st = c.current) == null ? void 0 : st.selectionDirection] });
130
+ n.useImperativeHandle(e, () => c.current, []), n.useEffect(() => {
131
+ let r = c.current, a = Y.current;
130
132
  if (!r || !a) return;
131
133
  tt.current.value !== r.value && tt.current.onChange(r.value), Q.current.prev = [r.selectionStart, r.selectionEnd, r.selectionDirection];
132
- function v() {
134
+ function f() {
133
135
  if (document.activeElement !== r) {
134
136
  q(null), K(null);
135
137
  return;
136
138
  }
137
- let s = r.selectionStart, b = r.selectionEnd, U = r.selectionDirection, x = r.maxLength, _ = r.value, I = Q.current.prev, A = -1, D = -1, H;
138
- if (_.length !== 0 && s !== null && b !== null) {
139
- let Wt = s === b, Bt = s === _.length && _.length < x;
139
+ let u = r.selectionStart, b = r.selectionEnd, U = r.selectionDirection, x = r.maxLength, _ = r.value, k = Q.current.prev, R = -1, A = -1, H;
140
+ if (_.length !== 0 && u !== null && b !== null) {
141
+ let Wt = u === b, Bt = u === _.length && _.length < x;
140
142
  if (Wt && !Bt) {
141
- let G = s;
142
- if (G === 0) A = 0, D = 1, H = "forward";
143
- else if (G === x) A = G - 1, D = G, H = "backward";
143
+ let G = u;
144
+ if (G === 0) R = 0, A = 1, H = "forward";
145
+ else if (G === x) R = G - 1, A = G, H = "backward";
144
146
  else if (x > 1 && _.length > 1) {
145
147
  let nt = 0;
146
- if (I[0] !== null && I[1] !== null) {
147
- H = G < I[1] ? "backward" : "forward";
148
- let Nt = I[0] === I[1] && I[0] < x;
148
+ if (k[0] !== null && k[1] !== null) {
149
+ H = G < k[1] ? "backward" : "forward";
150
+ let Nt = k[0] === k[1] && k[0] < x;
149
151
  H === "backward" && !Nt && (nt = -1);
150
152
  }
151
- A = nt + G, D = nt + G + 1;
153
+ R = nt + G, A = nt + G + 1;
152
154
  }
153
155
  }
154
- A !== -1 && D !== -1 && A !== D && p.current.setSelectionRange(A, D, H);
156
+ R !== -1 && A !== -1 && R !== A && c.current.setSelectionRange(R, A, H);
155
157
  }
156
- let vt = A !== -1 ? A : s, gt = D !== -1 ? D : b, Ft = H ?? U;
158
+ let vt = R !== -1 ? R : u, gt = A !== -1 ? A : b, Ft = H ?? U;
157
159
  q(vt), K(gt), Q.current.prev = [vt, gt, Ft];
158
160
  }
159
- if (document.addEventListener("selectionchange", v, { capture: !0 }), v(), document.activeElement === r && et(!0), !document.getElementById("input-otp-style")) {
160
- let s = document.createElement("style");
161
- if (s.id = "input-otp-style", document.head.appendChild(s), s.sheet) {
161
+ if (document.addEventListener("selectionchange", f, { capture: !0 }), f(), document.activeElement === r && et(!0), !document.getElementById("input-otp-style")) {
162
+ let u = document.createElement("style");
163
+ if (u.id = "input-otp-style", document.head.appendChild(u), u.sheet) {
162
164
  let b = "background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";
163
- Z(s.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), Z(s.sheet, `[data-input-otp]:autofill { ${b} }`), Z(s.sheet, `[data-input-otp]:-webkit-autofill { ${b} }`), Z(s.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), Z(s.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
165
+ Z(u.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), Z(u.sheet, `[data-input-otp]:autofill { ${b} }`), Z(u.sheet, `[data-input-otp]:-webkit-autofill { ${b} }`), Z(u.sheet, "@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"), Z(u.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
164
166
  }
165
167
  }
166
168
  let S = () => {
@@ -169,66 +171,66 @@ var ne = n.createContext({}), Ct = n.forwardRef((t, e) => {
169
171
  S();
170
172
  let y = new ResizeObserver(S);
171
173
  return y.observe(r), () => {
172
- document.removeEventListener("selectionchange", v, { capture: !0 }), y.disconnect();
174
+ document.removeEventListener("selectionchange", f, { capture: !0 }), y.disconnect();
173
175
  };
174
176
  }, []);
175
- let [ut, ct] = n.useState(!1), [V, et] = n.useState(!1), [N, q] = n.useState(null), [L, K] = n.useState(null);
177
+ let [ut, pt] = n.useState(!1), [V, et] = n.useState(!1), [N, q] = n.useState(null), [L, K] = n.useState(null);
176
178
  n.useEffect(() => {
177
179
  Ut(() => {
178
- var r, a, v, S;
179
- (r = p.current) == null || r.dispatchEvent(new Event("input"));
180
- let y = (a = p.current) == null ? void 0 : a.selectionStart, s = (v = p.current) == null ? void 0 : v.selectionEnd, b = (S = p.current) == null ? void 0 : S.selectionDirection;
181
- y !== null && s !== null && (q(y), K(s), Q.current.prev = [y, s, b]);
180
+ var r, a, f, S;
181
+ (r = c.current) == null || r.dispatchEvent(new Event("input"));
182
+ let y = (a = c.current) == null ? void 0 : a.selectionStart, u = (f = c.current) == null ? void 0 : f.selectionEnd, b = (S = c.current) == null ? void 0 : S.selectionDirection;
183
+ y !== null && u !== null && (q(y), K(u), Q.current.prev = [y, u, b]);
182
184
  });
183
- }, [c, V]), n.useEffect(() => {
184
- B !== void 0 && c !== B && B.length < u && c.length === u && j?.(c);
185
- }, [u, j, B, c]);
186
- let $ = re({ containerRef: Y, inputRef: p, pushPasswordManagerStrategy: T, isFocused: V }), pt = n.useCallback((r) => {
187
- let a = r.currentTarget.value.slice(0, u);
188
- if (a.length > 0 && C && !C.test(a)) {
185
+ }, [p, V]), n.useEffect(() => {
186
+ B !== void 0 && p !== B && B.length < i && p.length === i && j?.(p);
187
+ }, [i, j, B, p]);
188
+ let $ = re({ containerRef: Y, inputRef: c, pushPasswordManagerStrategy: I, isFocused: V }), ct = n.useCallback((r) => {
189
+ let a = r.currentTarget.value.slice(0, i);
190
+ if (a.length > 0 && M && !M.test(a)) {
189
191
  r.preventDefault();
190
192
  return;
191
193
  }
192
194
  typeof B == "string" && a.length < B.length && document.dispatchEvent(new Event("selectionchange")), z(a);
193
- }, [u, z, B, C]), dt = n.useCallback(() => {
195
+ }, [i, z, B, M]), dt = n.useCallback(() => {
194
196
  var r;
195
- if (p.current) {
196
- let a = Math.min(p.current.value.length, u - 1), v = p.current.value.length;
197
- (r = p.current) == null || r.setSelectionRange(a, v), q(a), K(v);
197
+ if (c.current) {
198
+ let a = Math.min(c.current.value.length, i - 1), f = c.current.value.length;
199
+ (r = c.current) == null || r.setSelectionRange(a, f), q(a), K(f);
198
200
  }
199
201
  et(!0);
200
- }, [u]), mt = n.useCallback((r) => {
201
- var a, v;
202
- let S = p.current;
202
+ }, [i]), mt = n.useCallback((r) => {
203
+ var a, f;
204
+ let S = c.current;
203
205
  if (!g && (!tt.current.isIOS || !r.clipboardData || !S)) return;
204
- let y = r.clipboardData.getData("text/plain"), s = g ? g(y) : y;
206
+ let y = r.clipboardData.getData("text/plain"), u = g ? g(y) : y;
205
207
  r.preventDefault();
206
- let b = (a = p.current) == null ? void 0 : a.selectionStart, U = (v = p.current) == null ? void 0 : v.selectionEnd, x = (b !== U ? c.slice(0, b) + s + c.slice(U) : c.slice(0, b) + s + c.slice(b)).slice(0, u);
207
- if (x.length > 0 && C && !C.test(x)) return;
208
+ let b = (a = c.current) == null ? void 0 : a.selectionStart, U = (f = c.current) == null ? void 0 : f.selectionEnd, x = (b !== U ? p.slice(0, b) + u + p.slice(U) : p.slice(0, b) + u + p.slice(b)).slice(0, i);
209
+ if (x.length > 0 && M && !M.test(x)) return;
208
210
  S.value = x, z(x);
209
- let _ = Math.min(x.length, u - 1), I = x.length;
210
- S.setSelectionRange(_, I), q(_), K(I);
211
- }, [u, z, C, c]), At = n.useMemo(() => ({ position: "relative", cursor: l.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [l.disabled]), ft = n.useMemo(() => ({ position: "absolute", inset: 0, width: $.willPushPWMBadge ? `calc(100% + ${$.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: $.willPushPWMBadge ? `inset(0 ${$.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: d, 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" }), [$.PWM_BADGE_SPACE_WIDTH, $.willPushPWMBadge, d]), Dt = n.useMemo(() => n.createElement("input", Jt(Zt({ 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": N, "data-input-otp-mse": L, inputMode: M, pattern: C?.source, "aria-placeholder": O, style: ft, maxLength: u, value: c, ref: p, onPaste: (r) => {
211
+ let _ = Math.min(x.length, i - 1), k = x.length;
212
+ S.setSelectionRange(_, k), q(_), K(k);
213
+ }, [i, z, M, p]), At = n.useMemo(() => ({ position: "relative", cursor: s.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [s.disabled]), ft = n.useMemo(() => ({ position: "absolute", inset: 0, width: $.willPushPWMBadge ? `calc(100% + ${$.PWM_BADGE_SPACE_WIDTH})` : "100%", clipPath: $.willPushPWMBadge ? `inset(0 ${$.PWM_BADGE_SPACE_WIDTH} 0 0)` : void 0, height: "100%", display: "flex", textAlign: d, 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" }), [$.PWM_BADGE_SPACE_WIDTH, $.willPushPWMBadge, d]), Dt = n.useMemo(() => n.createElement("input", Jt(Zt({ autoComplete: s.autoComplete || "one-time-code" }, s), { "data-input-otp": !0, "data-input-otp-placeholder-shown": p.length === 0 || void 0, "data-input-otp-mss": N, "data-input-otp-mse": L, inputMode: D, pattern: M?.source, "aria-placeholder": E, style: ft, maxLength: i, value: p, ref: c, onPaste: (r) => {
212
214
  var a;
213
- mt(r), (a = l.onPaste) == null || a.call(l, r);
214
- }, onChange: pt, onMouseOver: (r) => {
215
+ mt(r), (a = s.onPaste) == null || a.call(s, r);
216
+ }, onChange: ct, onMouseOver: (r) => {
215
217
  var a;
216
- ct(!0), (a = l.onMouseOver) == null || a.call(l, r);
218
+ pt(!0), (a = s.onMouseOver) == null || a.call(s, r);
217
219
  }, onMouseLeave: (r) => {
218
220
  var a;
219
- ct(!1), (a = l.onMouseLeave) == null || a.call(l, r);
221
+ pt(!1), (a = s.onMouseLeave) == null || a.call(s, r);
220
222
  }, onFocus: (r) => {
221
223
  var a;
222
- dt(), (a = l.onFocus) == null || a.call(l, r);
224
+ dt(), (a = s.onFocus) == null || a.call(s, r);
223
225
  }, onBlur: (r) => {
224
226
  var a;
225
- et(!1), (a = l.onBlur) == null || a.call(l, r);
226
- } })), [pt, dt, mt, M, ft, u, L, N, l, C?.source, c]), rt = n.useMemo(() => ({ slots: Array.from({ length: u }).map((r, a) => {
227
- var v;
228
- let S = V && N !== null && L !== null && (N === L && a === N || a >= N && a < L), y = c[a] !== void 0 ? c[a] : null, s = c[0] !== void 0 ? null : (v = O?.[a]) != null ? v : null;
229
- return { char: y, placeholderChar: s, isActive: S, hasFakeCaret: S && y === null };
230
- }), isFocused: V, isHovering: !l.disabled && ut }), [V, ut, u, L, N, l.disabled, c]), jt = n.useMemo(() => P ? P(rt) : n.createElement(ne.Provider, { value: rt }, k), [k, rt, P]);
231
- return n.createElement(n.Fragment, null, h !== null && n.createElement("noscript", null, n.createElement("style", null, h)), n.createElement("div", { ref: Y, "data-input-otp-container": !0, style: At, className: E }, jt, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Dt)));
227
+ et(!1), (a = s.onBlur) == null || a.call(s, r);
228
+ } })), [ct, dt, mt, D, ft, i, L, N, s, M?.source, p]), rt = n.useMemo(() => ({ slots: Array.from({ length: i }).map((r, a) => {
229
+ var f;
230
+ let S = V && N !== null && L !== null && (N === L && a === N || a >= N && a < L), y = p[a] !== void 0 ? p[a] : null, u = p[0] !== void 0 ? null : (f = E?.[a]) != null ? f : null;
231
+ return { char: y, placeholderChar: u, isActive: S, hasFakeCaret: S && y === null };
232
+ }), isFocused: V, isHovering: !s.disabled && ut }), [V, ut, i, L, N, s.disabled, p]), jt = n.useMemo(() => P ? P(rt) : n.createElement(ne.Provider, { value: rt }, T), [T, rt, P]);
233
+ return n.createElement(n.Fragment, null, h !== null && n.createElement("noscript", null, n.createElement("style", null, h)), n.createElement("div", { ref: Y, "data-input-otp-container": !0, style: At, className: C }, jt, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Dt)));
232
234
  });
233
235
  Ct.displayName = "Input";
234
236
  function Z(t, e) {
@@ -264,56 +266,56 @@ const Mt = St({}), Tt = St(null), ot = () => {
264
266
  throw new Error("useRoot must be used within an InputOTP");
265
267
  return t;
266
268
  }, kt = ({
267
- ref: t,
268
- autoFocus: e = !1,
269
- children: o,
270
- className: i,
271
- errorMessage: f,
272
- id: u,
273
- inputMode: d = "numeric",
274
- maxLength: m,
275
- name: O,
276
- onChange: M,
277
- onComplete: j,
278
- pattern: T,
269
+ autoFocus: t = !1,
270
+ children: e,
271
+ className: o,
272
+ errorMessage: l,
273
+ id: v,
274
+ inputMode: i = "numeric",
275
+ maxLength: d,
276
+ name: m,
277
+ onChange: E,
278
+ onComplete: D,
279
+ pattern: j,
280
+ ref: I,
279
281
  state: g = "default",
280
- value: E,
282
+ value: C,
281
283
  variant: h = "outlined",
282
284
  ...P
283
285
  }) => {
284
- const k = Gt(u, O), { isInvalid: l } = Lt(!1, g), F = T !== void 0 ? T : d === "numeric" ? ae : void 0, J = (R) => {
285
- let W = R.clipboardData.getData("text/plain").trim().replaceAll("-", "");
286
- d === "numeric" && (W = W.replace(/\D/g, "")), W.length === m && typeof M == "function" && M(W);
286
+ const T = Gt(v, m), { isInvalid: s } = Lt(!1, g), F = j ?? (i === "numeric" ? ae : void 0), J = (O) => {
287
+ let W = O.clipboardData.getData("text/plain").trim().replaceAll("-", "");
288
+ i === "numeric" && (W = W.replace(/\D/g, "")), W.length === d && typeof E == "function" && E(W);
287
289
  };
288
- return /* @__PURE__ */ w(Mt.Provider, { value: { isInvalid: l }, children: /* @__PURE__ */ bt("div", { className: "flex w-max flex-col gap-y-1", children: [
290
+ return /* @__PURE__ */ w(Mt.Provider, { value: { isInvalid: s }, children: /* @__PURE__ */ bt("div", { className: "flex w-max flex-col gap-y-1", children: [
289
291
  /* @__PURE__ */ w(
290
292
  Ct,
291
293
  {
292
- autoFocus: e,
293
- containerClassName: wt("flex items-center gap-2 has-[:disabled]:opacity-50 disabled:cursor-not-allowed", i),
294
+ autoFocus: t,
295
+ containerClassName: wt("flex items-center gap-2 has-disabled]:opacity-50 disabled:cursor-not-allowed", o),
294
296
  "data-1p-ignore": "true",
295
297
  "data-dashlane-disabled-on-field": "true",
296
298
  "data-lpignore": "true",
297
299
  "data-protonpass-ignore": "true",
298
300
  "data-testid": "spectral-input-otp",
299
- id: k,
300
- inputMode: d,
301
- maxLength: m,
302
- onChange: M,
303
- onComplete: j,
301
+ id: T,
302
+ inputMode: i,
303
+ maxLength: d,
304
+ onChange: E,
305
+ onComplete: D,
304
306
  onPaste: J,
305
- pasteTransformer: (R) => R.replaceAll("-", ""),
307
+ pasteTransformer: (O) => O.replaceAll("-", ""),
306
308
  pattern: F,
307
309
  pushPasswordManagerStrategy: "none",
308
- ref: t,
310
+ ref: I,
309
311
  role: "textbox",
310
312
  textAlign: "center",
311
- value: E,
313
+ value: C,
312
314
  ...P,
313
- render: ({ slots: R }) => /* @__PURE__ */ w(Tt.Provider, { value: { slots: R, variant: h, maxLength: m }, children: o ?? /* @__PURE__ */ w(at, { children: /* @__PURE__ */ w(it, {}) }) })
315
+ render: ({ slots: O }) => /* @__PURE__ */ w(Tt.Provider, { value: { slots: O, variant: h, maxLength: d }, children: e ?? /* @__PURE__ */ w(at, { children: /* @__PURE__ */ w(it, {}) }) })
314
316
  }
315
317
  ),
316
- l && f && /* @__PURE__ */ w($t, { dataTestId: "spectral-input-otp-error-message", id: zt(k), message: f })
318
+ s && l && /* @__PURE__ */ w($t, { dataTestId: "spectral-input-otp-error-message", id: zt(T), message: l })
317
319
  ] }) });
318
320
  };
319
321
  kt.displayName = "InputOTP";
@@ -323,40 +325,40 @@ const at = ({
323
325
  }) => /* @__PURE__ */ w("div", { className: "flex items-center justify-center gap-x-2", "data-testid": "spectral-input-otp-group", ref: t, ...e });
324
326
  at.displayName = "InputOTP.Group";
325
327
  const lt = ({
326
- ref: t,
328
+ className: t,
327
329
  index: e,
328
- className: o,
329
- ...i
330
+ ref: o,
331
+ ...l
330
332
  }) => {
331
- const { variant: f = "outlined", slots: u = [] } = ot(), { isInvalid: d } = yt(Mt), m = u[e] || { char: "", hasFakeCaret: !0, isActive: !1 };
333
+ const { variant: v = "outlined", slots: i = [] } = ot(), { isInvalid: d } = yt(Mt), m = i[e] || { char: "", hasFakeCaret: !0, isActive: !1 };
332
334
  return /* @__PURE__ */ bt(
333
335
  "div",
334
336
  {
335
337
  className: wt(
336
- "relative z-10 flex h-12 w-10 items-center justify-center rounded-[8px] border-1 transition duration-200 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
337
- f === "filled" ? "bg-level-one border-level-one" : "border-input-otp-border bg-transparent",
338
+ "relative z-10 flex h-12 w-10 items-center justify-center rounded-[8px] border transition duration-200 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
339
+ v === "filled" ? "bg-level-one border-level-one" : "border-input-otp-border bg-transparent",
338
340
  !d && "border",
339
341
  d && "border-danger-400 focus-visible:outline-danger-400 border-2",
340
342
  m.isActive && !d && "outline-input-otp-border--focus z-10 outline-2 outline-offset-2",
341
343
  m.isActive && d && "outline-danger-400 outline-2 outline-offset-2",
342
- o
344
+ t
343
345
  ),
344
346
  "data-index": e,
345
347
  "data-testid": "spectral-input-otp-slot",
346
- "data-variant": f,
347
- ref: t,
348
- ...i,
348
+ "data-variant": v,
349
+ ref: o,
350
+ ...l,
349
351
  children: [
350
352
  m.char,
351
- m.hasFakeCaret && /* @__PURE__ */ w("div", { className: "animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ w("div", { className: "bg-input-otp-caret h-8 w-px" }) })
353
+ m.hasFakeCaret && /* @__PURE__ */ w("div", { className: "motion-safe:animate-caret-blink pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ w("div", { className: "bg-input-otp-caret h-8 w-px" }) })
352
354
  ]
353
355
  }
354
356
  );
355
357
  };
356
358
  lt.displayName = "InputOTP.Slot";
357
359
  const it = ({ start: t = 0, count: e, className: o }) => {
358
- const { maxLength: i = 0 } = ot(), f = e !== void 0 ? t + e : i, u = Array.from({ length: f - t }, (d, m) => t + m);
359
- return /* @__PURE__ */ w(_t, { children: u.map((d) => /* @__PURE__ */ w(lt, { index: d, className: o }, d)) });
360
+ const { maxLength: l = 0 } = ot(), v = e !== void 0 ? t + e : l, i = Array.from({ length: v - t }, (d, m) => t + m);
361
+ return /* @__PURE__ */ w(_t, { children: i.map((d) => /* @__PURE__ */ w(lt, { index: d, className: o }, d)) });
360
362
  };
361
363
  it.displayName = "InputOTP.Slots";
362
364
  const It = ({
@@ -367,12 +369,12 @@ const It = ({
367
369
  return /* @__PURE__ */ w("div", { ref: t, role: "separator", ...e, "data-testid": "spectral-input-otp-separator", "data-variant": o, children: /* @__PURE__ */ w(Ht, { size: 24, color: o === "filled" ? "var(--color-input-otp-filled-separator)" : "var(--color-input-otp-border)" }) });
368
370
  };
369
371
  It.displayName = "InputOTP.Separator";
370
- const Sr = Object.assign(kt, {
372
+ const Pr = Object.assign(kt, {
371
373
  Group: at,
372
374
  Slot: lt,
373
375
  Slots: it,
374
376
  Separator: It
375
377
  });
376
378
  export {
377
- Sr as InputOTP
379
+ Pr as InputOTP
378
380
  };