prometeo-design-system 2.5.1 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Icons.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { j as h } from "./jsx-runtime-DKDX3adD.js";
2
2
  import { memo as v } from "react";
3
- const l = (t) => v(t), w = l(({
3
+ const l = (t) => v(t), o = l(({
4
4
  size: t = 24,
5
5
  className: r,
6
6
  ...q
@@ -16,7 +16,7 @@ const l = (t) => v(t), w = l(({
16
16
  className: r,
17
17
  children: /* @__PURE__ */ h.jsx("path", { d: "M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm0-160q17 0 28.5-11.5T520-480q0-17-11.5-28.5T480-520q-17 0-28.5 11.5T440-480q0 17 11.5 28.5T480-440Zm0-160q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm320 440H160q-33 0-56.5-23.5T80-240v-160q33 0 56.5-23.5T160-480q0-33-23.5-56.5T80-560v-160q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v160q-33 0-56.5 23.5T800-480q0 33 23.5 56.5T880-400v160q0 33-23.5 56.5T800-160Zm0-80v-102q-37-22-58.5-58.5T720-480q0-43 21.5-79.5T800-618v-102H160v102q37 22 58.5 58.5T240-480q0 43-21.5 79.5T160-342v102h640ZM480-480Z" })
18
18
  }
19
- )), o = l(({
19
+ )), w = l(({
20
20
  size: t = 24,
21
21
  className: r,
22
22
  ...q
@@ -32,7 +32,7 @@ const l = (t) => v(t), w = l(({
32
32
  ...q,
33
33
  children: /* @__PURE__ */ h.jsx("path", { d: "M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm0-160q17 0 28.5-11.5T520-480q0-17-11.5-28.5T480-520q-17 0-28.5 11.5T440-480q0 17 11.5 28.5T480-440Zm0-160q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm320 440H160q-33 0-56.5-23.5T80-240v-160q33 0 56.5-23.5T160-480q0-33-23.5-56.5T80-560v-160q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v160q-33 0-56.5 23.5T800-480q0 33 23.5 56.5T880-400v160q0 33-23.5 56.5T800-160Z" })
34
34
  }
35
- )), T = l(({
35
+ )), s = l(({
36
36
  size: t = 24,
37
37
  className: r,
38
38
  ...q
@@ -48,7 +48,7 @@ const l = (t) => v(t), w = l(({
48
48
  className: r,
49
49
  children: /* @__PURE__ */ h.jsx("path", { d: "M240-200h120v-240h240v240h120v-360L480-740 240-560v360Zm-80 80v-480l320-240 320 240v480H520v-240h-80v240H160Zm320-350Z" })
50
50
  }
51
- )), s = l(({
51
+ )), T = l(({
52
52
  size: t = 24,
53
53
  className: r,
54
54
  ...q
@@ -144,7 +144,7 @@ const l = (t) => v(t), w = l(({
144
144
  className: r,
145
145
  children: /* @__PURE__ */ h.jsx("path", { d: "M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" })
146
146
  }
147
- )), Z = l(({
147
+ )), c = l(({
148
148
  size: t = 24,
149
149
  className: r,
150
150
  ...q
@@ -160,7 +160,7 @@ const l = (t) => v(t), w = l(({
160
160
  className: r,
161
161
  children: /* @__PURE__ */ h.jsx("path", { d: "M400-240 160-480l240-240 56 58-142 142h486v80H314l142 142-56 58Z" })
162
162
  }
163
- )), c = l(({
163
+ )), Z = l(({
164
164
  size: t = 24,
165
165
  className: r,
166
166
  ...q
@@ -304,7 +304,7 @@ const l = (t) => v(t), w = l(({
304
304
  className: r,
305
305
  children: /* @__PURE__ */ h.jsx("path", { d: "M400-240v-80h160v80H400ZM240-440v-80h480v80H240ZM120-640v-80h720v80H120Z" })
306
306
  }
307
- )), f = l(({
307
+ )), L = l(({
308
308
  size: t = 24,
309
309
  className: r,
310
310
  ...q
@@ -320,7 +320,7 @@ const l = (t) => v(t), w = l(({
320
320
  className: r,
321
321
  children: /* @__PURE__ */ h.jsx("path", { d: "M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z" })
322
322
  }
323
- )), H = l(({
323
+ )), f = l(({
324
324
  size: t = 24,
325
325
  className: r,
326
326
  ...q
@@ -336,7 +336,7 @@ const l = (t) => v(t), w = l(({
336
336
  className: r,
337
337
  children: /* @__PURE__ */ h.jsx("path", { d: "m668-380 152-130 120 10-176 153 52 227-102-62-46-198Zm-94-292-42-98 46-110 92 217-96-9ZM294-287l126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM173-120l65-281L20-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-340Z" })
338
338
  }
339
- )), L = l(({
339
+ )), H = l(({
340
340
  size: t = 24,
341
341
  className: r,
342
342
  ...q
@@ -400,7 +400,7 @@ const l = (t) => v(t), w = l(({
400
400
  className: r,
401
401
  children: /* @__PURE__ */ h.jsx("path", { d: "M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z" })
402
402
  }
403
- )), E = l(({
403
+ )), V = l(({
404
404
  size: t = 24,
405
405
  className: r,
406
406
  ...q
@@ -416,7 +416,7 @@ const l = (t) => v(t), w = l(({
416
416
  className: r,
417
417
  children: /* @__PURE__ */ h.jsx("path", { d: "M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z" })
418
418
  }
419
- )), V = l(({
419
+ )), E = l(({
420
420
  size: t = 24,
421
421
  className: r,
422
422
  ...q
@@ -599,17 +599,33 @@ const l = (t) => v(t), w = l(({
599
599
  className: r,
600
600
  children: /* @__PURE__ */ h.jsx("path", { d: "M3.5 21V17.5714H20.5V21H3.5ZM6.475 15L10.9375 3H13.0625L17.525 15H15.485L14.4225 11.9143H9.62L8.515 15H6.475ZM10.215 10.2H13.785L12.0425 5.22857H11.9575L10.215 10.2Z", fill: "currentColor" })
601
601
  }
602
- )), z = {
603
- Ticket: w,
604
- Home: T,
605
- Boards: s,
602
+ )), z = l(({
603
+ size: t = 24,
604
+ className: r,
605
+ ...q
606
+ }) => /* @__PURE__ */ h.jsx(
607
+ "svg",
608
+ {
609
+ xmlns: "http://www.w3.org/2000/svg",
610
+ width: t,
611
+ height: t,
612
+ viewBox: "0 -960 960 960",
613
+ fill: "currentColor",
614
+ ...q,
615
+ className: r,
616
+ children: /* @__PURE__ */ h.jsx("path", { d: "M286.5 -253.875L180 -360.375L222 -402.375L285.75 -338.625L413.25 -466.125L455.25 -423.375L286.5 -253.875ZM286.5 -493.875L180 -600.375L222 -642.375L285.75 -578.625L413.25 -706.125L455.25 -663.375L286.5 -493.875ZM510 -313.875V-373.875H780V-313.875H510ZM510 -553.875V-613.875H780V-553.875H510Z", fill: "currentColor", transform: "translate(480,-480) scale(1.45) translate(-480,480)" })
617
+ }
618
+ )), t0 = {
619
+ Ticket: o,
620
+ Home: s,
621
+ Boards: T,
606
622
  Notifications: n,
607
623
  Help: e,
608
624
  Settings: i,
609
625
  CrevronLeft: x,
610
626
  CrevronRight: g,
611
- ArrowLeft: Z,
612
- Shared: c,
627
+ ArrowLeft: c,
628
+ Shared: Z,
613
629
  ChevronDown: m,
614
630
  Collapse: d,
615
631
  Calendar: C,
@@ -618,14 +634,14 @@ const l = (t) => v(t), w = l(({
618
634
  Logout: j,
619
635
  ArrowUpDown: a,
620
636
  Filter: M,
621
- Search: f,
622
- Stars: H,
623
- MoreVert: L,
637
+ Search: L,
638
+ Stars: f,
639
+ MoreVert: H,
624
640
  Add: B,
625
641
  Edit: k,
626
642
  Upload: y,
627
- Copy: E,
628
- FaLock: V,
643
+ Copy: V,
644
+ FaLock: E,
629
645
  AccountCircle: A,
630
646
  UserAdd: F,
631
647
  AttachFile: S,
@@ -637,7 +653,7 @@ const l = (t) => v(t), w = l(({
637
653
  Check: N,
638
654
  Info: O,
639
655
  Error: P,
640
- TicketFilled: o,
656
+ TicketFilled: w,
641
657
  UploadCloud: R,
642
658
  Clock: $,
643
659
  Pause: G,
@@ -646,10 +662,11 @@ const l = (t) => v(t), w = l(({
646
662
  Sort: Q,
647
663
  Cancel: W,
648
664
  CheckCircle: X,
649
- FormatColorText: Y
665
+ FormatColorText: Y,
666
+ CheckList: z
650
667
  };
651
- for (const [t, r] of Object.entries(z))
668
+ for (const [t, r] of Object.entries(t0))
652
669
  r.displayName = `${t}_Icon`;
653
670
  export {
654
- z as Icons
671
+ t0 as Icons
655
672
  };
@@ -113,7 +113,7 @@ const h = {
113
113
  const x = {
114
114
  small: {
115
115
  container: "text-sm",
116
- input: "h-10 px-3 text-sm",
116
+ input: "h-10 px-3 text-[1rem]",
117
117
  label: "text-xs peer-focus:text-xs peer-placeholder-shown:text-sm",
118
118
  icon: "w-4 h-4 right-3"
119
119
  },
package/dist/Input.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as f } from "./Input-Bhd0bmVq.js";
1
+ import { I as f } from "./Input-PNwH7rb6.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,178 +1,178 @@
1
1
  import { j as p } from "./jsx-runtime-DKDX3adD.js";
2
- import { Icons as ve } from "./Icons.es.js";
3
- import { c as L } from "./cn-B6yFEsav.js";
2
+ import { Icons as ge } from "./Icons.es.js";
3
+ import { c as $ } from "./cn-B6yFEsav.js";
4
4
  import * as n from "react";
5
- import ge from "react";
6
- var De = Object.defineProperty, Te = Object.defineProperties, Oe = Object.getOwnPropertyDescriptors, te = Object.getOwnPropertySymbols, we = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable, xe = (t, r, a) => r in t ? De(t, r, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[r] = a, We = (t, r) => {
7
- for (var a in r || (r = {})) we.call(r, a) && xe(t, a, r[a]);
8
- if (te) for (var a of te(r)) ye.call(r, a) && xe(t, a, r[a]);
5
+ import xe, { memo as De } from "react";
6
+ var Oe = Object.defineProperty, Te = Object.defineProperties, We = Object.getOwnPropertyDescriptors, ee = Object.getOwnPropertySymbols, we = Object.prototype.hasOwnProperty, ye = Object.prototype.propertyIsEnumerable, be = (t, a, r) => a in t ? Oe(t, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[a] = r, Ae = (t, a) => {
7
+ for (var r in a || (a = {})) we.call(a, r) && be(t, r, a[r]);
8
+ if (ee) for (var r of ee(a)) ye.call(a, r) && be(t, r, a[r]);
9
9
  return t;
10
- }, Ae = (t, r) => Te(t, Oe(r)), Be = (t, r) => {
11
- var a = {};
12
- for (var u in t) we.call(t, u) && r.indexOf(u) < 0 && (a[u] = t[u]);
13
- if (t != null && te) for (var u of te(t)) r.indexOf(u) < 0 && ye.call(t, u) && (a[u] = t[u]);
14
- return a;
10
+ }, Be = (t, a) => Te(t, We(a)), _e = (t, a) => {
11
+ var r = {};
12
+ for (var u in t) we.call(t, u) && a.indexOf(u) < 0 && (r[u] = t[u]);
13
+ if (t != null && ee) for (var u of ee(t)) a.indexOf(u) < 0 && ye.call(t, u) && (r[u] = t[u]);
14
+ return r;
15
15
  };
16
- function _e(t) {
17
- let r = setTimeout(t, 0), a = setTimeout(t, 10), u = setTimeout(t, 50);
18
- return [r, a, u];
19
- }
20
16
  function Ie(t) {
21
- let r = n.useRef();
17
+ let a = setTimeout(t, 0), r = setTimeout(t, 10), u = setTimeout(t, 50);
18
+ return [a, r, u];
19
+ }
20
+ function Fe(t) {
21
+ let a = n.useRef();
22
22
  return n.useEffect(() => {
23
- r.current = t;
24
- }), r.current;
23
+ a.current = t;
24
+ }), a.current;
25
25
  }
26
- var Fe = 18, Ee = 40, He = `${Ee}px`, Le = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
27
- function $e({ containerRef: t, inputRef: r, pushPasswordManagerStrategy: a, isFocused: u }) {
28
- let [C, d] = n.useState(!1), [R, M] = n.useState(!1), [D, W] = n.useState(!1), A = n.useMemo(() => a === "none" ? !1 : (a === "increase-width" || a === "experimental-no-flickering") && C && R, [C, R, a]), x = n.useCallback(() => {
29
- let f = t.current, v = r.current;
30
- if (!f || !v || D || a === "none") return;
31
- let m = f, b = m.getBoundingClientRect().left + m.offsetWidth, w = m.getBoundingClientRect().top + m.offsetHeight / 2, o = b - Fe, j = w;
32
- document.querySelectorAll(Le).length === 0 && document.elementFromPoint(o, j) === f || (d(!0), W(!0));
33
- }, [t, r, D, a]);
26
+ var He = 18, Se = 40, Le = `${Se}px`, $e = ["[data-lastpass-icon-root]", "com-1password-button", "[data-dashlanecreated]", '[style$="2147483647 !important;"]'].join(",");
27
+ function ze({ containerRef: t, inputRef: a, pushPasswordManagerStrategy: r, isFocused: u }) {
28
+ let [M, d] = n.useState(!1), [D, k] = n.useState(!1), [O, B] = n.useState(!1), _ = n.useMemo(() => r === "none" ? !1 : (r === "increase-width" || r === "experimental-no-flickering") && M && D, [M, D, r]), x = n.useCallback(() => {
29
+ let f = t.current, v = a.current;
30
+ if (!f || !v || O || r === "none") return;
31
+ let m = f, b = m.getBoundingClientRect().left + m.offsetWidth, w = m.getBoundingClientRect().top + m.offsetHeight / 2, o = b - He, P = w;
32
+ document.querySelectorAll($e).length === 0 && document.elementFromPoint(o, P) === f || (d(!0), B(!0));
33
+ }, [t, a, O, r]);
34
34
  return n.useEffect(() => {
35
35
  let f = t.current;
36
- if (!f || a === "none") return;
36
+ if (!f || r === "none") return;
37
37
  function v() {
38
38
  let b = window.innerWidth - f.getBoundingClientRect().right;
39
- M(b >= Ee);
39
+ k(b >= Se);
40
40
  }
41
41
  v();
42
42
  let m = setInterval(v, 1e3);
43
43
  return () => {
44
44
  clearInterval(m);
45
45
  };
46
- }, [t, a]), n.useEffect(() => {
47
- let f = u || document.activeElement === r.current;
48
- if (a === "none" || !f) return;
46
+ }, [t, r]), n.useEffect(() => {
47
+ let f = u || document.activeElement === a.current;
48
+ if (r === "none" || !f) return;
49
49
  let v = setTimeout(x, 0), m = setTimeout(x, 2e3), b = setTimeout(x, 5e3), w = setTimeout(() => {
50
- W(!0);
50
+ B(!0);
51
51
  }, 6e3);
52
52
  return () => {
53
53
  clearTimeout(v), clearTimeout(m), clearTimeout(b), clearTimeout(w);
54
54
  };
55
- }, [r, u, a, x]), { hasPWMBadge: C, willPushPWMBadge: A, PWM_BADGE_SPACE_WIDTH: He };
55
+ }, [a, u, r, x]), { hasPWMBadge: M, willPushPWMBadge: _, PWM_BADGE_SPACE_WIDTH: Le };
56
56
  }
57
- var ze = n.createContext({}), Se = n.forwardRef((t, r) => {
58
- var a = t, { value: u, onChange: C, maxLength: d, textAlign: R = "left", pattern: M, placeholder: D, inputMode: W = "numeric", onComplete: A, pushPasswordManagerStrategy: x = "increase-width", pasteTransformer: f, containerClassName: v, noScriptCSSFallback: m = Ge, render: b, children: w } = a, o = Be(a, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), j, k, $, V, X;
59
- let [ne, q] = n.useState(typeof o.defaultValue == "string" ? o.defaultValue : ""), i = u ?? ne, B = Ie(i), Z = n.useCallback((e) => {
60
- C?.(e), q(e);
61
- }, [C]), P = n.useMemo(() => M ? typeof M == "string" ? new RegExp(M) : M : null, [M]), c = n.useRef(null), le = n.useRef(null), re = n.useRef({ value: i, onChange: Z, isIOS: typeof window < "u" && ((k = (j = window?.CSS) == null ? void 0 : j.supports) == null ? void 0 : k.call(j, "-webkit-touch-callout", "none")) }), Y = n.useRef({ prev: [($ = c.current) == null ? void 0 : $.selectionStart, (V = c.current) == null ? void 0 : V.selectionEnd, (X = c.current) == null ? void 0 : X.selectionDirection] });
62
- n.useImperativeHandle(r, () => c.current, []), n.useEffect(() => {
57
+ var Ge = n.createContext({}), Ee = n.forwardRef((t, a) => {
58
+ var r = t, { value: u, onChange: M, maxLength: d, textAlign: D = "left", pattern: k, placeholder: O, inputMode: B = "numeric", onComplete: _, pushPasswordManagerStrategy: x = "increase-width", pasteTransformer: f, containerClassName: v, noScriptCSSFallback: m = Ve, render: b, children: w } = r, o = _e(r, ["value", "onChange", "maxLength", "textAlign", "pattern", "placeholder", "inputMode", "onComplete", "pushPasswordManagerStrategy", "pasteTransformer", "containerClassName", "noScriptCSSFallback", "render", "children"]), P, N, U, T, V;
59
+ let [te, ne] = n.useState(typeof o.defaultValue == "string" ? o.defaultValue : ""), i = u ?? te, E = Fe(i), q = n.useCallback((e) => {
60
+ M?.(e), ne(e);
61
+ }, [M]), C = n.useMemo(() => k ? typeof k == "string" ? new RegExp(k) : k : null, [k]), c = n.useRef(null), le = n.useRef(null), ae = n.useRef({ value: i, onChange: q, isIOS: typeof window < "u" && ((N = (P = window?.CSS) == null ? void 0 : P.supports) == null ? void 0 : N.call(P, "-webkit-touch-callout", "none")) }), X = n.useRef({ prev: [(U = c.current) == null ? void 0 : U.selectionStart, (T = c.current) == null ? void 0 : T.selectionEnd, (V = c.current) == null ? void 0 : V.selectionDirection] });
62
+ n.useImperativeHandle(a, () => c.current, []), n.useEffect(() => {
63
63
  let e = c.current, l = le.current;
64
64
  if (!e || !l) return;
65
- re.current.value !== e.value && re.current.onChange(e.value), Y.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
65
+ ae.current.value !== e.value && ae.current.onChange(e.value), X.current.prev = [e.selectionStart, e.selectionEnd, e.selectionDirection];
66
66
  function h() {
67
67
  if (document.activeElement !== e) {
68
- K(null), Q(null);
68
+ J(null), K(null);
69
69
  return;
70
70
  }
71
- let s = e.selectionStart, g = e.selectionEnd, ee = e.selectionDirection, S = e.maxLength, I = e.value, N = Y.current.prev, T = -1, O = -1, F;
72
- if (I.length !== 0 && s !== null && g !== null) {
73
- let ke = s === g, Ne = s === I.length && I.length < S;
71
+ let s = e.selectionStart, g = e.selectionEnd, Y = e.selectionDirection, j = e.maxLength, F = e.value, R = X.current.prev, W = -1, A = -1, H;
72
+ if (F.length !== 0 && s !== null && g !== null) {
73
+ let ke = s === g, Ne = s === F.length && F.length < j;
74
74
  if (ke && !Ne) {
75
- let H = s;
76
- if (H === 0) T = 0, O = 1, F = "forward";
77
- else if (H === S) T = H - 1, O = H, F = "backward";
78
- else if (S > 1 && I.length > 1) {
75
+ let L = s;
76
+ if (L === 0) W = 0, A = 1, H = "forward";
77
+ else if (L === j) W = L - 1, A = L, H = "backward";
78
+ else if (j > 1 && F.length > 1) {
79
79
  let ie = 0;
80
- if (N[0] !== null && N[1] !== null) {
81
- F = H < N[1] ? "backward" : "forward";
82
- let Re = N[0] === N[1] && N[0] < S;
83
- F === "backward" && !Re && (ie = -1);
80
+ if (R[0] !== null && R[1] !== null) {
81
+ H = L < R[1] ? "backward" : "forward";
82
+ let Re = R[0] === R[1] && R[0] < j;
83
+ H === "backward" && !Re && (ie = -1);
84
84
  }
85
- T = ie + H, O = ie + H + 1;
85
+ W = ie + L, A = ie + L + 1;
86
86
  }
87
87
  }
88
- T !== -1 && O !== -1 && T !== O && c.current.setSelectionRange(T, O, F);
88
+ W !== -1 && A !== -1 && W !== A && c.current.setSelectionRange(W, A, H);
89
89
  }
90
- let me = T !== -1 ? T : s, he = O !== -1 ? O : g, Me = F ?? ee;
91
- K(me), Q(he), Y.current.prev = [me, he, Me];
90
+ let he = W !== -1 ? W : s, ve = A !== -1 ? A : g, Me = H ?? Y;
91
+ J(he), K(ve), X.current.prev = [he, ve, Me];
92
92
  }
93
- if (document.addEventListener("selectionchange", h, { capture: !0 }), h(), document.activeElement === e && ae(!0), !document.getElementById("input-otp-style")) {
93
+ if (document.addEventListener("selectionchange", h, { capture: !0 }), h(), document.activeElement === e && re(!0), !document.getElementById("input-otp-style")) {
94
94
  let s = document.createElement("style");
95
95
  if (s.id = "input-otp-style", document.head.appendChild(s), s.sheet) {
96
96
  let g = "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;";
97
- U(s.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), U(s.sheet, `[data-input-otp]:autofill { ${g} }`), U(s.sheet, `[data-input-otp]:-webkit-autofill { ${g} }`), U(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; } }"), U(s.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
97
+ Q(s.sheet, "[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"), Q(s.sheet, `[data-input-otp]:autofill { ${g} }`), Q(s.sheet, `[data-input-otp]:-webkit-autofill { ${g} }`), Q(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; } }"), Q(s.sheet, "[data-input-otp] + * { pointer-events: all !important; }");
98
98
  }
99
99
  }
100
100
  let y = () => {
101
101
  l && l.style.setProperty("--root-height", `${e.clientHeight}px`);
102
102
  };
103
103
  y();
104
- let E = new ResizeObserver(y);
105
- return E.observe(e), () => {
106
- document.removeEventListener("selectionchange", h, { capture: !0 }), E.disconnect();
104
+ let S = new ResizeObserver(y);
105
+ return S.observe(e), () => {
106
+ document.removeEventListener("selectionchange", h, { capture: !0 }), S.disconnect();
107
107
  };
108
108
  }, []);
109
- let [se, ue] = n.useState(!1), [J, ae] = n.useState(!1), [_, K] = n.useState(null), [z, Q] = n.useState(null);
109
+ let [ue, ce] = n.useState(!1), [Z, re] = n.useState(!1), [I, J] = n.useState(null), [z, K] = n.useState(null);
110
110
  n.useEffect(() => {
111
- _e(() => {
111
+ Ie(() => {
112
112
  var e, l, h, y;
113
113
  (e = c.current) == null || e.dispatchEvent(new Event("input"));
114
- let E = (l = c.current) == null ? void 0 : l.selectionStart, s = (h = c.current) == null ? void 0 : h.selectionEnd, g = (y = c.current) == null ? void 0 : y.selectionDirection;
115
- E !== null && s !== null && (K(E), Q(s), Y.current.prev = [E, s, g]);
114
+ let S = (l = c.current) == null ? void 0 : l.selectionStart, s = (h = c.current) == null ? void 0 : h.selectionEnd, g = (y = c.current) == null ? void 0 : y.selectionDirection;
115
+ S !== null && s !== null && (J(S), K(s), X.current.prev = [S, s, g]);
116
116
  });
117
- }, [i, J]), n.useEffect(() => {
118
- B !== void 0 && i !== B && B.length < d && i.length === d && A?.(i);
119
- }, [d, A, B, i]);
120
- let G = $e({ containerRef: le, inputRef: c, pushPasswordManagerStrategy: x, isFocused: J }), ce = n.useCallback((e) => {
117
+ }, [i, Z]), n.useEffect(() => {
118
+ E !== void 0 && i !== E && E.length < d && i.length === d && _?.(i);
119
+ }, [d, _, E, i]);
120
+ let G = ze({ containerRef: le, inputRef: c, pushPasswordManagerStrategy: x, isFocused: Z }), de = n.useCallback((e) => {
121
121
  let l = e.currentTarget.value.slice(0, d);
122
- if (l.length > 0 && P && !P.test(l)) {
122
+ if (l.length > 0 && C && !C.test(l)) {
123
123
  e.preventDefault();
124
124
  return;
125
125
  }
126
- typeof B == "string" && l.length < B.length && document.dispatchEvent(new Event("selectionchange")), Z(l);
127
- }, [d, Z, B, P]), de = n.useCallback(() => {
126
+ typeof E == "string" && l.length < E.length && document.dispatchEvent(new Event("selectionchange")), q(l);
127
+ }, [d, q, E, C]), fe = n.useCallback(() => {
128
128
  var e;
129
129
  if (c.current) {
130
130
  let l = Math.min(c.current.value.length, d - 1), h = c.current.value.length;
131
- (e = c.current) == null || e.setSelectionRange(l, h), K(l), Q(h);
131
+ (e = c.current) == null || e.setSelectionRange(l, h), J(l), K(h);
132
132
  }
133
- ae(!0);
134
- }, [d]), fe = n.useCallback((e) => {
133
+ re(!0);
134
+ }, [d]), pe = n.useCallback((e) => {
135
135
  var l, h;
136
136
  let y = c.current;
137
- if (!f && (!re.current.isIOS || !e.clipboardData || !y)) return;
138
- let E = e.clipboardData.getData("text/plain"), s = f ? f(E) : E;
137
+ if (!f && (!ae.current.isIOS || !e.clipboardData || !y)) return;
138
+ let S = e.clipboardData.getData("text/plain"), s = f ? f(S) : S;
139
139
  e.preventDefault();
140
- let g = (l = c.current) == null ? void 0 : l.selectionStart, ee = (h = c.current) == null ? void 0 : h.selectionEnd, S = (g !== ee ? i.slice(0, g) + s + i.slice(ee) : i.slice(0, g) + s + i.slice(g)).slice(0, d);
141
- if (S.length > 0 && P && !P.test(S)) return;
142
- y.value = S, Z(S);
143
- let I = Math.min(S.length, d - 1), N = S.length;
144
- y.setSelectionRange(I, N), K(I), Q(N);
145
- }, [d, Z, P, i]), je = n.useMemo(() => ({ position: "relative", cursor: o.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [o.disabled]), pe = 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: R, 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, R]), Pe = n.useMemo(() => n.createElement("input", Ae(We({ autoComplete: o.autoComplete || "one-time-code" }, o), { "data-input-otp": !0, "data-input-otp-placeholder-shown": i.length === 0 || void 0, "data-input-otp-mss": _, "data-input-otp-mse": z, inputMode: W, pattern: P?.source, "aria-placeholder": D, style: pe, maxLength: d, value: i, ref: c, onPaste: (e) => {
140
+ let g = (l = c.current) == null ? void 0 : l.selectionStart, Y = (h = c.current) == null ? void 0 : h.selectionEnd, j = (g !== Y ? i.slice(0, g) + s + i.slice(Y) : i.slice(0, g) + s + i.slice(g)).slice(0, d);
141
+ if (j.length > 0 && C && !C.test(j)) return;
142
+ y.value = j, q(j);
143
+ let F = Math.min(j.length, d - 1), R = j.length;
144
+ y.setSelectionRange(F, R), J(F), K(R);
145
+ }, [d, q, C, i]), je = n.useMemo(() => ({ position: "relative", cursor: o.disabled ? "default" : "text", userSelect: "none", WebkitUserSelect: "none", pointerEvents: "none" }), [o.disabled]), me = 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: 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" }), [G.PWM_BADGE_SPACE_WIDTH, G.willPushPWMBadge, D]), Pe = n.useMemo(() => n.createElement("input", Be(Ae({ autoComplete: o.autoComplete || "one-time-code" }, o), { "data-input-otp": !0, "data-input-otp-placeholder-shown": i.length === 0 || void 0, "data-input-otp-mss": I, "data-input-otp-mse": z, inputMode: B, pattern: C?.source, "aria-placeholder": O, style: me, maxLength: d, value: i, ref: c, onPaste: (e) => {
146
146
  var l;
147
- fe(e), (l = o.onPaste) == null || l.call(o, e);
148
- }, onChange: ce, onMouseOver: (e) => {
147
+ pe(e), (l = o.onPaste) == null || l.call(o, e);
148
+ }, onChange: de, onMouseOver: (e) => {
149
149
  var l;
150
- ue(!0), (l = o.onMouseOver) == null || l.call(o, e);
150
+ ce(!0), (l = o.onMouseOver) == null || l.call(o, e);
151
151
  }, onMouseLeave: (e) => {
152
152
  var l;
153
- ue(!1), (l = o.onMouseLeave) == null || l.call(o, e);
153
+ ce(!1), (l = o.onMouseLeave) == null || l.call(o, e);
154
154
  }, onFocus: (e) => {
155
155
  var l;
156
- de(), (l = o.onFocus) == null || l.call(o, e);
156
+ fe(), (l = o.onFocus) == null || l.call(o, e);
157
157
  }, onBlur: (e) => {
158
158
  var l;
159
- ae(!1), (l = o.onBlur) == null || l.call(o, e);
160
- } })), [ce, de, fe, W, pe, d, z, _, o, P?.source, i]), oe = n.useMemo(() => ({ slots: Array.from({ length: d }).map((e, l) => {
159
+ re(!1), (l = o.onBlur) == null || l.call(o, e);
160
+ } })), [de, fe, pe, B, me, d, z, I, o, C?.source, i]), oe = n.useMemo(() => ({ slots: Array.from({ length: d }).map((e, l) => {
161
161
  var h;
162
- let y = J && _ !== null && z !== null && (_ === z && l === _ || l >= _ && l < z), E = i[l] !== void 0 ? i[l] : null, s = i[0] !== void 0 ? null : (h = D?.[l]) != null ? h : null;
163
- return { char: E, placeholderChar: s, isActive: y, hasFakeCaret: y && E === null };
164
- }), isFocused: J, isHovering: !o.disabled && se }), [J, se, d, z, _, o.disabled, i]), Ce = n.useMemo(() => b ? b(oe) : n.createElement(ze.Provider, { value: oe }, w), [w, oe, b]);
162
+ let y = Z && I !== null && z !== null && (I === z && l === I || l >= I && l < z), S = i[l] !== void 0 ? i[l] : null, s = i[0] !== void 0 ? null : (h = O?.[l]) != null ? h : null;
163
+ return { char: S, placeholderChar: s, isActive: y, hasFakeCaret: y && S === null };
164
+ }), isFocused: Z, isHovering: !o.disabled && ue }), [Z, ue, d, z, I, o.disabled, i]), Ce = n.useMemo(() => b ? b(oe) : n.createElement(Ge.Provider, { value: oe }, w), [w, oe, b]);
165
165
  return n.createElement(n.Fragment, null, m !== null && n.createElement("noscript", null, n.createElement("style", null, m)), n.createElement("div", { ref: le, "data-input-otp-container": !0, style: je, className: v }, Ce, n.createElement("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" } }, Pe)));
166
166
  });
167
- Se.displayName = "Input";
168
- function U(t, r) {
167
+ Ee.displayName = "Input";
168
+ function Q(t, a) {
169
169
  try {
170
- t.insertRule(r);
170
+ t.insertRule(a);
171
171
  } catch {
172
- console.error("input-otp could not insert CSS rule:", r);
172
+ console.error("input-otp could not insert CSS rule:", a);
173
173
  }
174
174
  }
175
- var Ge = `
175
+ var Ve = `
176
176
  [data-input-otp] {
177
177
  --nojs-bg: white !important;
178
178
  --nojs-fg: black !important;
@@ -192,18 +192,18 @@ var Ge = `
192
192
  --nojs-fg: white !important;
193
193
  }
194
194
  }`;
195
- const Ke = ({
195
+ const qe = ({
196
196
  value: t = "",
197
- name: r,
198
- onChange: a,
197
+ name: a,
198
+ onChange: r,
199
199
  onComplete: u,
200
- onBlur: C,
200
+ onBlur: M,
201
201
  maxLength: d = 6,
202
- placeholder: R = "•",
203
- disabled: M = !1,
204
- className: D,
205
- autoFocus: W = !1,
206
- pasteTransformer: A,
202
+ placeholder: D = "•",
203
+ disabled: k = !1,
204
+ className: O,
205
+ autoFocus: B = !1,
206
+ pasteTransformer: _,
207
207
  errorComponent: x,
208
208
  hasError: f,
209
209
  helperComponent: v,
@@ -212,61 +212,65 @@ const Ke = ({
212
212
  variant: w = "default",
213
213
  hideSlotsMiddleSeparator: o = !1
214
214
  }) => {
215
- const j = m === "left" ? "justify-start w-full text-left" : m === "center" ? "justify-center" : "justify-end text-right w-full", k = {
215
+ const P = m === "left" ? "justify-start w-full text-left" : m === "center" ? "justify-center" : "justify-end text-right w-full", N = {
216
216
  default: {
217
217
  text: "text-neutral-default-default",
218
218
  icon: null
219
219
  },
220
220
  error: {
221
221
  text: "text-error-default-default",
222
- icon: /* @__PURE__ */ p.jsx(ve.Error, { size: 18, className: "text-error-default-default" })
222
+ icon: /* @__PURE__ */ p.jsx(ge.Error, { size: 18, className: "text-error-default-default" })
223
223
  },
224
224
  success: {
225
225
  text: "text-success-default-default",
226
- icon: /* @__PURE__ */ p.jsx(ve.Check, { size: 18, className: "text-success-default-default" })
226
+ icon: /* @__PURE__ */ p.jsx(ge.Check, { size: 18, className: "text-success-default-default" })
227
227
  }
228
+ }, U = (T) => {
229
+ r?.(T, a);
228
230
  };
229
231
  return /* @__PURE__ */ p.jsx(
230
- Se,
232
+ Ee,
231
233
  {
232
234
  value: t,
233
- name: r,
234
- autoFocus: W,
235
- onChange: a,
235
+ name: a,
236
+ autoFocus: B,
237
+ onChange: U,
236
238
  onComplete: u,
237
- onBlur: C,
239
+ onBlur: M,
238
240
  maxLength: d,
239
- disabled: M,
240
- pasteTransformer: A,
241
+ disabled: k,
242
+ pasteTransformer: _,
241
243
  spellCheck: !1,
242
- containerClassName: L("group flex items-center has-[:disabled]:opacity-30 w-max justify-center", D),
243
- render: ({ slots: $ }) => {
244
- const V = Math.floor($.length / 2), X = $.slice(0, V), ne = $.slice(V);
244
+ containerClassName: $("group flex items-center has-[:disabled]:opacity-30 w-max justify-center", O),
245
+ render: ({ slots: T }) => {
246
+ const V = Math.floor(T.length / 2), te = T.slice(0, V), ne = T.slice(V);
245
247
  return /* @__PURE__ */ p.jsxs("div", { className: "flex flex-col items-center", children: [
246
248
  /* @__PURE__ */ p.jsxs("div", { className: "flex items-center", children: [
247
- /* @__PURE__ */ p.jsx("div", { className: "flex", children: X.map((q, i) => /* @__PURE__ */ p.jsx(be, { ...q, placeholder: R, hasError: f, className: b, variant: w }, i)) }),
248
- /* @__PURE__ */ p.jsx("hr", { className: L("w-2 h-1 mx-2 border-neutral-default-default", o && "hidden") }),
249
- /* @__PURE__ */ p.jsx("div", { className: "flex", children: ne.map((q, i) => /* @__PURE__ */ p.jsx(be, { ...q, placeholder: R, hasError: f, variant: w, className: b }, i)) })
249
+ /* @__PURE__ */ p.jsx("div", { className: "flex", children: te.map((i, E) => /* @__PURE__ */ p.jsx(se, { ...i, placeholder: D, hasError: f, className: b, variant: w }, E)) }),
250
+ /* @__PURE__ */ p.jsx("hr", { className: $("w-2 h-1 mx-2 border-neutral-default-default", o && "hidden") }),
251
+ /* @__PURE__ */ p.jsx("div", { className: "flex", children: ne.map((i, E) => /* @__PURE__ */ p.jsx(se, { ...i, placeholder: D, hasError: f, variant: w, className: b }, E)) })
250
252
  ] }),
251
- f && x && (typeof x == "string" ? /* @__PURE__ */ p.jsxs("span", { className: L("text-error-default-default text-xs mt-1 flex items-center gap-1", j, k.error.text), children: [
252
- k.error.icon,
253
+ f && x && (typeof x == "string" ? /* @__PURE__ */ p.jsxs("span", { className: $("text-error-default-default text-xs mt-1 flex items-center gap-1", P, N.error.text), children: [
254
+ N.error.icon,
253
255
  x
254
- ] }) : ge.cloneElement(x, { className: L(
256
+ ] }) : xe.cloneElement(x, { className: $(
255
257
  "text-error-default-default text-xs mt-1",
256
- j,
257
- k.error.text,
258
+ P,
259
+ N.error.text,
258
260
  x?.props?.className
259
261
  ) })),
260
- v && m && (typeof v == "string" ? /* @__PURE__ */ p.jsxs("span", { className: L("text-neutral-medium-default text-xs mt-1 flex items-center gap-1", k[w].text, j), children: [
261
- k[w].icon,
262
+ v && m && (typeof v == "string" ? /* @__PURE__ */ p.jsxs("span", { className: $("text-neutral-medium-default text-xs mt-1 flex items-center gap-1", N[w].text, P), children: [
263
+ N[w].icon,
262
264
  v
263
- ] }) : ge.cloneElement(v, { className: L("text-neutral-medium-default text-xs mt-1", j, k[w].text, v?.props?.className) }))
265
+ ] }) : xe.cloneElement(v, { className: $("text-neutral-medium-default text-xs mt-1", P, N[w].text, v?.props?.className) }))
264
266
  ] });
265
267
  }
266
268
  }
267
269
  );
268
- }, be = (t) => {
269
- const r = {
270
+ };
271
+ qe.displayName = "OtpInput";
272
+ const Ze = (t) => {
273
+ const a = {
270
274
  default: "border-neutral-default-default",
271
275
  error: "border-error-default-default",
272
276
  success: "border-success-default-default"
@@ -274,15 +278,15 @@ const Ke = ({
274
278
  return /* @__PURE__ */ p.jsxs(
275
279
  "div",
276
280
  {
277
- className: L(
278
- "relative w-14 h-14 text-[1.2rem] text-white",
281
+ className: $(
282
+ "relative w-12 h-12 md:w-14 md:h-14 text-[1rem] md:text-[1.2rem] text-white",
279
283
  "flex items-center justify-center",
280
284
  "transition-all duration-300",
281
285
  "border-2 border-neutral-default-default rounded-md mx-1",
282
286
  { "border-2 border-primary-default-default": t.isActive },
283
- r[t.variant || "default"],
287
+ a[t.variant || "default"],
284
288
  t.className,
285
- t.hasError && r.error
289
+ t.hasError && a.error
286
290
  ),
287
291
  children: [
288
292
  /* @__PURE__ */ p.jsx("div", { className: "group-has-[input[data-input-otp-placeholder-shown]]:opacity-20", children: t.char ?? t.placeholder }),
@@ -290,7 +294,8 @@ const Ke = ({
290
294
  ]
291
295
  }
292
296
  );
293
- };
297
+ }, se = De(Ze);
298
+ se.displayName = "Slot";
294
299
  export {
295
- Ke as default
300
+ qe as default
296
301
  };