docthub-core-components 3.3.10 → 3.3.12
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/components/overrides/ui/inputs/otp-input.js +36 -36
- package/dist/components/overrides/ui/inputs/phone-input.js +220 -219
- package/dist/components/overrides/ui/mobile-number-dialog/mobile-number-dialog.js +366 -324
- package/dist/src/components/overrides/ui/inputs/phone-input.d.ts +3 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as B, jsxs as Z } from "react/jsx-runtime";
|
|
3
3
|
import { c as x } from "react-compiler-runtime";
|
|
4
4
|
import { useRef as _, useId as G, useLayoutEffect as tt } from "react";
|
|
5
5
|
import { Input as et } from "../../../ui/input.js";
|
|
@@ -10,46 +10,46 @@ const ut = (N) => {
|
|
|
10
10
|
length: H,
|
|
11
11
|
label: f,
|
|
12
12
|
value: d,
|
|
13
|
-
onChange:
|
|
13
|
+
onChange: K,
|
|
14
14
|
onComplete: g,
|
|
15
15
|
className: C,
|
|
16
|
-
error:
|
|
16
|
+
error: a,
|
|
17
17
|
inputClassName: J,
|
|
18
18
|
autoFocus: Q,
|
|
19
19
|
autoSubmit: U,
|
|
20
20
|
secure: V
|
|
21
|
-
} = N, o = H === void 0 ? 6 : H,
|
|
21
|
+
} = N, o = H === void 0 ? 6 : H, F = J === void 0 ? "h-10 w-10" : J, j = Q === void 0 ? !1 : Q, q = U === void 0 ? !1 : U, E = V === void 0 ? !1 : V;
|
|
22
|
+
let L;
|
|
23
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (L = [], t[0] = L) : L = t[0];
|
|
24
|
+
const n = _(L), h = G(), y = G(), S = G();
|
|
22
25
|
let M;
|
|
23
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (M = [], t[0] = M) : M = t[0];
|
|
24
|
-
const a = _(M), h = G(), v = G(), S = G();
|
|
25
|
-
let O;
|
|
26
26
|
if (t[1] !== o || t[2] !== S) {
|
|
27
27
|
let i;
|
|
28
|
-
t[4] !== S ? (i = (W, z) => `${S}-digit-${z + 1}`, t[4] = S, t[5] = i) : i = t[5],
|
|
28
|
+
t[4] !== S ? (i = (W, z) => `${S}-digit-${z + 1}`, t[4] = S, t[5] = i) : i = t[5], M = Array.from({
|
|
29
29
|
length: o
|
|
30
|
-
}, i), t[1] = o, t[2] = S, t[3] =
|
|
30
|
+
}, i), t[1] = o, t[2] = S, t[3] = M;
|
|
31
31
|
} else
|
|
32
|
-
|
|
33
|
-
const T =
|
|
34
|
-
let
|
|
35
|
-
t[6] !==
|
|
32
|
+
M = t[3];
|
|
33
|
+
const T = M;
|
|
34
|
+
let O, A;
|
|
35
|
+
t[6] !== j ? (O = () => {
|
|
36
36
|
var i;
|
|
37
|
-
|
|
37
|
+
j && ((i = n.current[0]) == null || i.focus({
|
|
38
38
|
preventScroll: !0
|
|
39
39
|
}));
|
|
40
|
-
},
|
|
41
|
-
let
|
|
42
|
-
if (t[9] !==
|
|
40
|
+
}, A = [j], t[6] = j, t[7] = O, t[8] = A) : (O = t[7], A = t[8]), tt(O, A);
|
|
41
|
+
let v, b, D, I, u, m;
|
|
42
|
+
if (t[9] !== q || t[10] !== C || t[11] !== a || t[12] !== y || t[13] !== F || t[14] !== f || t[15] !== h || t[16] !== o || t[17] !== K || t[18] !== g || t[19] !== T || t[20] !== E || t[21] !== d) {
|
|
43
43
|
const i = (r, e) => {
|
|
44
44
|
var c;
|
|
45
45
|
const l = e.replace(/\D/g, "").slice(0, 1);
|
|
46
46
|
if (e && !l || e.length > 1 && l.length <= 1)
|
|
47
47
|
return;
|
|
48
48
|
const s = [...d];
|
|
49
|
-
s[r] = l,
|
|
49
|
+
s[r] = l, K(s), l && r < o - 1 && ((c = n.current[r + 1]) == null || c.focus()), s.every(st) && (g && g(s.join("")), q && queueMicrotask(() => {
|
|
50
50
|
var $;
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const R = ($ = n.current[r]) == null ? void 0 : $.closest("form");
|
|
52
|
+
R && R.requestSubmit();
|
|
53
53
|
}));
|
|
54
54
|
}, W = (r, e) => {
|
|
55
55
|
var $;
|
|
@@ -60,35 +60,35 @@ const ut = (N) => {
|
|
|
60
60
|
const c = [...d];
|
|
61
61
|
for (let p = 0; p < s.length && r + p < o; p++)
|
|
62
62
|
c[r + p] = s[p];
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
($ =
|
|
63
|
+
K(c);
|
|
64
|
+
const R = Math.min(r + s.length, o - 1);
|
|
65
|
+
($ = n.current[R]) == null || $.focus(), c.every(ot) && (g && g(c.join("")), q && queueMicrotask(() => {
|
|
66
66
|
var X;
|
|
67
|
-
const p = (X =
|
|
67
|
+
const p = (X = n.current[r]) == null ? void 0 : X.closest("form");
|
|
68
68
|
p && p.requestSubmit();
|
|
69
69
|
}));
|
|
70
70
|
}, z = (r, e) => {
|
|
71
71
|
var l, s, c;
|
|
72
|
-
e.key.length === 1 && !/\d/.test(e.key) ? e.preventDefault() : e.key === "Backspace" && !d[r] && r > 0 ? (l =
|
|
72
|
+
!e.ctrlKey && !e.metaKey && !e.altKey && e.key.length === 1 && !/\d/.test(e.key) ? e.preventDefault() : e.key === "Backspace" && !d[r] && r > 0 ? (l = n.current[r - 1]) == null || l.focus() : e.key === "ArrowLeft" && r > 0 ? (e.preventDefault(), (s = n.current[r - 1]) == null || s.focus()) : e.key === "ArrowRight" && r < o - 1 && (e.preventDefault(), (c = n.current[r + 1]) == null || c.focus());
|
|
73
73
|
};
|
|
74
|
-
t[28] !== C ? (u = Y("space-y-2", C), t[28] = C, t[29] = u) : u = t[29], t[30] !== f || t[31] !== h ? (m = f && /* @__PURE__ */
|
|
74
|
+
t[28] !== C ? (u = Y("space-y-2", C), t[28] = C, t[29] = u) : u = t[29], t[30] !== f || t[31] !== h ? (m = f && /* @__PURE__ */ B(rt, { id: h, className: "text-sm font-medium text-gray-700", children: f }), t[30] = f, t[31] = h, t[32] = m) : m = t[32], v = "flex gap-2 border-0 p-0 m-0", b = f ? h : void 0, D = a ? y : void 0, I = T.map((r, e) => {
|
|
75
75
|
const l = d[e] ?? "";
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
|
|
78
|
-
}, type: E ? "password" : "text", inputMode: "numeric", maxLength: 1, value: l, onChange: (s) => i(e, s.target.value), onKeyDown: (s) => z(e, s), onPaste: (s) => W(e, s), className: Y("text-center p-0 text-lg font-semibold",
|
|
79
|
-
}), t[9] =
|
|
76
|
+
return /* @__PURE__ */ B(et, { ref: (s) => {
|
|
77
|
+
n.current[e] = s;
|
|
78
|
+
}, type: E ? "password" : "text", inputMode: "numeric", maxLength: 1, value: l, onChange: (s) => i(e, s.target.value), onKeyDown: (s) => z(e, s), onPaste: (s) => W(e, s), className: Y("text-center p-0 text-lg font-semibold", a && "border-destructive", F), "aria-label": `${f || "OTP"} digit ${e + 1} of ${o}`, "aria-invalid": a ? "true" : "false" }, r);
|
|
79
|
+
}), t[9] = q, t[10] = C, t[11] = a, t[12] = y, t[13] = F, t[14] = f, t[15] = h, t[16] = o, t[17] = K, t[18] = g, t[19] = T, t[20] = E, t[21] = d, t[22] = v, t[23] = b, t[24] = D, t[25] = I, t[26] = u, t[27] = m;
|
|
80
80
|
} else
|
|
81
|
-
|
|
81
|
+
v = t[22], b = t[23], D = t[24], I = t[25], u = t[26], m = t[27];
|
|
82
82
|
let k;
|
|
83
|
-
t[33] !==
|
|
83
|
+
t[33] !== v || t[34] !== b || t[35] !== D || t[36] !== I ? (k = /* @__PURE__ */ B("fieldset", { className: v, "aria-labelledby": b, "aria-describedby": D, children: I }), t[33] = v, t[34] = b, t[35] = D, t[36] = I, t[37] = k) : k = t[37];
|
|
84
84
|
let w;
|
|
85
|
-
t[38] !==
|
|
86
|
-
let
|
|
87
|
-
return t[41] !== u || t[42] !== m || t[43] !== k || t[44] !== w ? (
|
|
85
|
+
t[38] !== a || t[39] !== y ? (w = a && /* @__PURE__ */ B("p", { id: y, className: "text-xs text-destructive mt-1", role: "alert", children: a }), t[38] = a, t[39] = y, t[40] = w) : w = t[40];
|
|
86
|
+
let P;
|
|
87
|
+
return t[41] !== u || t[42] !== m || t[43] !== k || t[44] !== w ? (P = /* @__PURE__ */ Z("div", { className: u, children: [
|
|
88
88
|
m,
|
|
89
89
|
k,
|
|
90
90
|
w
|
|
91
|
-
] }), t[41] = u, t[42] = m, t[43] = k, t[44] = w, t[45] =
|
|
91
|
+
] }), t[41] = u, t[42] = m, t[43] = k, t[44] = w, t[45] = P) : P = t[45], P;
|
|
92
92
|
};
|
|
93
93
|
function st(N) {
|
|
94
94
|
return N !== "";
|