prometeo-design-system 2.5.0 → 2.5.2

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.
@@ -1,6 +1,6 @@
1
1
  import { j as e } from "./jsx-runtime-DKDX3adD.js";
2
- import { c as i } from "./cn-B6yFEsav.js";
3
- import { motion as l, AnimatePresence as u } from "framer-motion";
2
+ import { c as l } from "./cn-B6yFEsav.js";
3
+ import { motion as i, AnimatePresence as u } from "framer-motion";
4
4
  import m from "./Avatar.es.js";
5
5
  import { Icons as s } from "./Icons.es.js";
6
6
  function f({
@@ -29,13 +29,13 @@ function f({
29
29
  r._id
30
30
  )) });
31
31
  }
32
- const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profile-container flex rounded-md text-white-prometeo overflow-hidden flex-shrink-0 w-full min-w-0 ", children: t }), h = ({
32
+ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profile-container flex rounded-md text-white-prometeo overflow-hidden shrink-0 w-full min-w-0 ", children: t }), h = ({
33
33
  isExpanded: t,
34
34
  sessions: a,
35
35
  onClickLogout: r,
36
36
  handleTokenLogin: n
37
37
  }) => /* @__PURE__ */ e.jsx(u, { mode: "wait", children: t && /* @__PURE__ */ e.jsxs(
38
- l.div,
38
+ i.div,
39
39
  {
40
40
  initial: { height: 0, opacity: 0 },
41
41
  animate: {
@@ -61,7 +61,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
61
61
  className: "overflow-hidden",
62
62
  children: [
63
63
  /* @__PURE__ */ e.jsx(
64
- l.div,
64
+ i.div,
65
65
  {
66
66
  className: "flex justify-center items-center w-full mt-4",
67
67
  exit: {
@@ -74,12 +74,12 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
74
74
  ease: "easeInOut"
75
75
  }
76
76
  },
77
- children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border-1 w-full" })
77
+ children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
78
78
  }
79
79
  ),
80
80
  a && a.length > 0 && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
81
81
  /* @__PURE__ */ e.jsx(
82
- l.div,
82
+ i.div,
83
83
  {
84
84
  className: "mt-4",
85
85
  exit: {
@@ -96,7 +96,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
96
96
  }
97
97
  ),
98
98
  /* @__PURE__ */ e.jsx(
99
- l.div,
99
+ i.div,
100
100
  {
101
101
  className: "mt-4 overflow-hidden w-full ",
102
102
  exit: {
@@ -122,7 +122,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
122
122
  }
123
123
  ),
124
124
  /* @__PURE__ */ e.jsx(
125
- l.div,
125
+ i.div,
126
126
  {
127
127
  className: "flex justify-center items-center w-full mt-4",
128
128
  exit: {
@@ -135,12 +135,12 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
135
135
  ease: "easeInOut"
136
136
  }
137
137
  },
138
- children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border-1 w-full" })
138
+ children: /* @__PURE__ */ e.jsx("div", { className: "border-b border-neutral-strong-default border w-full" })
139
139
  }
140
140
  )
141
141
  ] }),
142
142
  /* @__PURE__ */ e.jsxs(
143
- l.button,
143
+ i.button,
144
144
  {
145
145
  onClick: r,
146
146
  className: "flex flex-1 h-12 w-full gap-1 rounded-md cursor-pointer mt-4 mb-4 px-2 items-center overflow-hidden focus:outline-none hover:bg-neutral-medium-selected button-profile",
@@ -184,10 +184,10 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
184
184
  cardProfile: d,
185
185
  onClick: c
186
186
  }) => /* @__PURE__ */ e.jsxs(
187
- l.button,
187
+ i.button,
188
188
  {
189
189
  onClick: c,
190
- className: i(
190
+ className: l(
191
191
  "flex flex-1 gap-1 rounded-l-md cursor-pointer relative overflow-hidden focus:outline-none hover:bg-neutral-medium-selected button-profile h-12",
192
192
  t && "bg-neutral-medium-selected"
193
193
  ),
@@ -203,7 +203,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
203
203
  /* @__PURE__ */ e.jsx(
204
204
  "p",
205
205
  {
206
- className: i(
206
+ className: l(
207
207
  "profile-name font-semibold leading-tight mb-0 text-left",
208
208
  t ? "text-primary-default-default" : "text-neutral-default-default"
209
209
  ),
@@ -214,7 +214,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
214
214
  /* @__PURE__ */ e.jsx(
215
215
  "p",
216
216
  {
217
- className: i(
217
+ className: l(
218
218
  "profile-options truncate text-xs mt-0",
219
219
  t ? "text-primary-default-default" : "text-neutral-default-default"
220
220
  ),
@@ -224,7 +224,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
224
224
  /* @__PURE__ */ e.jsx(
225
225
  "p",
226
226
  {
227
- className: i(
227
+ className: l(
228
228
  "profile-options truncate font-bold mt-0",
229
229
  t ? "text-primary-default-default" : "text-neutral-default-default"
230
230
  ),
@@ -234,7 +234,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
234
234
  /* @__PURE__ */ e.jsx(
235
235
  "p",
236
236
  {
237
- className: i(
237
+ className: l(
238
238
  "profile-options truncate text-xs mt-0",
239
239
  t ? "text-primary-default-default" : "text-neutral-default-default"
240
240
  ),
@@ -246,7 +246,7 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
246
246
  ]
247
247
  }
248
248
  ), g = () => /* @__PURE__ */ e.jsx("div", { className: "w-px bg-gray-500/30 my-1 border-separator-profile" }), v = ({ isExpanded: t, onClick: a }) => /* @__PURE__ */ e.jsx(
249
- l.button,
249
+ i.button,
250
250
  {
251
251
  onClick: a,
252
252
  className: "flex items-center justify-center p-3 rounded-r-md cursor-pointer relative overflow-hidden focus:outline-none min-w-[50px] hover:bg-neutral-medium-selected button-content-chevron",
@@ -256,12 +256,12 @@ const x = ({ children: t }) => /* @__PURE__ */ e.jsx("div", { className: "profil
256
256
  title: t ? "Ocultar opciones" : "Mostrar opciones",
257
257
  "aria-label": t ? "Ocultar opciones" : "Mostrar opciones",
258
258
  children: /* @__PURE__ */ e.jsx(
259
- l.div,
259
+ i.div,
260
260
  {
261
261
  animate: { rotate: t ? 180 : 0 },
262
262
  transition: { duration: 0.3, ease: "easeOut" },
263
263
  className: "relative button-select-crevron",
264
- children: /* @__PURE__ */ e.jsx(l.div, { transition: { duration: 0.2 }, children: /* @__PURE__ */ e.jsx(s.ChevronDown, { size: 20, className: "text-prometeo-neutral " }) })
264
+ children: /* @__PURE__ */ e.jsx(i.div, { transition: { duration: 0.2 }, children: /* @__PURE__ */ e.jsx(s.ChevronDown, { size: 20, className: "text-prometeo-neutral " }) })
265
265
  }
266
266
  )
267
267
  }
@@ -1,4 +1,4 @@
1
- import { C as a } from "./CardProfile-Fn44kEnM.js";
1
+ import { C as a } from "./CardProfile-DV3gwvqE.js";
2
2
  export {
3
3
  a as CardProfile
4
4
  };
@@ -55,3 +55,5 @@ declare const Icons: {
55
55
  readonly FormatColorText: import('react').MemoExoticComponent<(props: IconProps) => ReactElement>;
56
56
  };
57
57
  export { Icons };
58
+ export type IconName = keyof typeof Icons;
59
+ export type IconComponent = (typeof Icons)[IconName];
@@ -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(
281
+ className: $(
278
282
  "relative w-14 h-14 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
  };