@incodetech/web 0.0.0-dev-20260402-728ce7f → 0.0.0-dev-20260403-10f7d94
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/base.css +8 -0
- package/dist/email/email.es.js +19 -17
- package/dist/extensibility.es.js +1 -1
- package/dist/governmentValidation/governmentValidation.es.js +1 -1
- package/dist/otpInput-CMi5-n2O.js +155 -0
- package/dist/phone/phone.es.js +45 -36
- package/package.json +2 -2
- package/dist/otpInput-B85heGC5.js +0 -148
package/dist/base.css
CHANGED
|
@@ -1104,6 +1104,14 @@
|
|
|
1104
1104
|
width: 100%;
|
|
1105
1105
|
display: flex;
|
|
1106
1106
|
}
|
|
1107
|
+
.IncodeOtpInputTimerText {
|
|
1108
|
+
margin: var(--spacing-0, var(--spacing-none, 0px));
|
|
1109
|
+
text-align: center;
|
|
1110
|
+
font-size: var(--text-18, var(--primitive-typography-size-18));
|
|
1111
|
+
--tw-font-weight: var(--font-weight-medium, var(--primitive-typography-weight-medium));
|
|
1112
|
+
font-weight: var(--font-weight-medium, var(--primitive-typography-weight-medium));
|
|
1113
|
+
color: var(--color-text-body-secondary, var(--text-body-500-secondary));
|
|
1114
|
+
}
|
|
1107
1115
|
.IncodeOtpInputResendText {
|
|
1108
1116
|
margin: var(--spacing-0, var(--spacing-none, 0px));
|
|
1109
1117
|
text-align: center;
|
package/dist/email/email.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { b as v, u as e, I as O, a as w, S as C, B as y } from "../button-DXIWei
|
|
|
2
2
|
import { createEmailManager as P } from "@incodetech/core/email";
|
|
3
3
|
import { d as b, y as V } from "../vendor-preact-BoMmvSgn.js";
|
|
4
4
|
import "@incodetech/core";
|
|
5
|
-
import { O as R } from "../otpInput-
|
|
5
|
+
import { O as R } from "../otpInput-CMi5-n2O.js";
|
|
6
6
|
import { P as I } from "../page-D4OThpFS.js";
|
|
7
7
|
import { r as S } from "../incodeModule-C4XIllao.js";
|
|
8
8
|
import "../uiConfig-DmIn-g8M.js";
|
|
@@ -17,7 +17,7 @@ import "../countries-DfLkrF0x.js";
|
|
|
17
17
|
const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
18
18
|
prefilledEmail: i,
|
|
19
19
|
emailError: s,
|
|
20
|
-
label:
|
|
20
|
+
label: m,
|
|
21
21
|
disabled: c = !1,
|
|
22
22
|
required: a = !1,
|
|
23
23
|
onEmailChange: t
|
|
@@ -31,9 +31,9 @@ const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
|
31
31
|
}
|
|
32
32
|
}, [i, t]);
|
|
33
33
|
const f = (r) => {
|
|
34
|
-
const
|
|
35
|
-
p(
|
|
36
|
-
const o =
|
|
34
|
+
const d = r.target.value;
|
|
35
|
+
p(d);
|
|
36
|
+
const o = d.trim(), u = o.length > 0 && h.test(o);
|
|
37
37
|
t(o, u);
|
|
38
38
|
}, n = s ? "email-error" : void 0;
|
|
39
39
|
return /* @__PURE__ */ e("div", { class: "IncodeEmailInput", children: /* @__PURE__ */ e("div", { class: "IncodeEmailInputContainer", children: /* @__PURE__ */ e(
|
|
@@ -46,9 +46,9 @@ const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
|
46
46
|
placeholder: l("email.placeholder"),
|
|
47
47
|
disabled: c,
|
|
48
48
|
required: a,
|
|
49
|
-
label:
|
|
49
|
+
label: m,
|
|
50
50
|
"data-testid": "email-input",
|
|
51
|
-
"aria-label":
|
|
51
|
+
"aria-label": m ? void 0 : "Email address",
|
|
52
52
|
"aria-invalid": s ? "true" : void 0,
|
|
53
53
|
"aria-describedby": n || void 0,
|
|
54
54
|
autocomplete: "email",
|
|
@@ -59,7 +59,7 @@ const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
|
59
59
|
}, T = ({
|
|
60
60
|
config: i,
|
|
61
61
|
manager: s,
|
|
62
|
-
onFinish:
|
|
62
|
+
onFinish: m,
|
|
63
63
|
onError: c
|
|
64
64
|
}) => {
|
|
65
65
|
const { t: a } = v(), [t, l] = w(
|
|
@@ -72,13 +72,13 @@ const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
|
72
72
|
{ manageLifecycle: !s }
|
|
73
73
|
), [E, p] = b(!1);
|
|
74
74
|
if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingInitialOtp") {
|
|
75
|
-
const n = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", r = t.status === "inputting" ? t.prefilledEmail : void 0, g = t.status === "inputting" && t.emailError ? a(t.emailError) : void 0,
|
|
75
|
+
const n = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", r = t.status === "inputting" ? t.prefilledEmail : void 0, g = t.status === "inputting" && t.emailError ? a(t.emailError) : void 0, d = t.status === "inputting" ? t.otpVerification ?? !1 : !1;
|
|
76
76
|
return /* @__PURE__ */ e(
|
|
77
77
|
I,
|
|
78
78
|
{
|
|
79
79
|
className: "IncodeEmailPage",
|
|
80
80
|
title: a("otp.enterCodeEmail"),
|
|
81
|
-
subtitle:
|
|
81
|
+
subtitle: d ? a("email.willSendCode") : void 0,
|
|
82
82
|
children: [
|
|
83
83
|
/* @__PURE__ */ e(
|
|
84
84
|
L,
|
|
@@ -103,11 +103,12 @@ const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
|
103
103
|
}
|
|
104
104
|
)
|
|
105
105
|
]
|
|
106
|
-
}
|
|
106
|
+
},
|
|
107
|
+
"email-input"
|
|
107
108
|
);
|
|
108
109
|
}
|
|
109
110
|
if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError" || t.status === "resendingOtp") {
|
|
110
|
-
const n = t.status === "verifyingOtp", r = t.status === "otpError", g = t.status === "awaitingOtp",
|
|
111
|
+
const n = t.status === "verifyingOtp", r = t.status === "otpError", g = t.status === "awaitingOtp", d = t.status === "resendingOtp", o = g || r || n;
|
|
111
112
|
return /* @__PURE__ */ e(
|
|
112
113
|
I,
|
|
113
114
|
{
|
|
@@ -120,28 +121,29 @@ const h = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, L = ({
|
|
|
120
121
|
canResend: o ? t.canResend : !1,
|
|
121
122
|
error: r ? a(t.otpError) : void 0,
|
|
122
123
|
isLoading: n,
|
|
123
|
-
disabled:
|
|
124
|
+
disabled: d || n,
|
|
124
125
|
onSubmit: (u) => l.submitOtp(u),
|
|
125
126
|
onResend: () => l.resendOtp(),
|
|
126
127
|
onBack: () => l.back(),
|
|
127
128
|
backLinkText: "otp.changeEmail"
|
|
128
129
|
}
|
|
129
130
|
)
|
|
130
|
-
}
|
|
131
|
+
},
|
|
132
|
+
"email-otp"
|
|
131
133
|
);
|
|
132
134
|
}
|
|
133
|
-
return t.status === "finished" ? (
|
|
135
|
+
return t.status === "finished" ? (m?.(), null) : (t.status === "error" && c?.(t.error), null);
|
|
134
136
|
}, B = ({
|
|
135
137
|
config: i,
|
|
136
138
|
manager: s,
|
|
137
|
-
onFinish:
|
|
139
|
+
onFinish: m,
|
|
138
140
|
onError: c
|
|
139
141
|
}) => /* @__PURE__ */ e(O, { children: i || s ? /* @__PURE__ */ e(
|
|
140
142
|
T,
|
|
141
143
|
{
|
|
142
144
|
config: i,
|
|
143
145
|
manager: s,
|
|
144
|
-
onFinish:
|
|
146
|
+
onFinish: m,
|
|
145
147
|
onError: c
|
|
146
148
|
}
|
|
147
149
|
) : null });
|
package/dist/extensibility.es.js
CHANGED
|
@@ -9,7 +9,7 @@ import { E as A } from "./errorContent-CnY-Deoi.js";
|
|
|
9
9
|
import { F as U, V as j } from "./formField-BoozuV2w.js";
|
|
10
10
|
import { C as q, P as z } from "./cameraView-DXT7CWqE.js";
|
|
11
11
|
import { I as J, a as K } from "./inputComposed-QzDneavl.js";
|
|
12
|
-
import { O as Q } from "./otpInput-
|
|
12
|
+
import { O as Q } from "./otpInput-CMi5-n2O.js";
|
|
13
13
|
import { C as Y, a as Z } from "./checkbox-wo8qk7tM.js";
|
|
14
14
|
import { P as $ } from "./phoneInputComposed-BAFZQ4Y8.js";
|
|
15
15
|
import { D as ra, S as ea } from "./dropdownComposed-CzAsPPqv.js";
|
|
@@ -6,7 +6,7 @@ import "../uiConfig-DmIn-g8M.js";
|
|
|
6
6
|
import { E as h } from "../errorIcon-DOuc6ONw.js";
|
|
7
7
|
import { S as c } from "../successIcon-BZphSsQr.js";
|
|
8
8
|
import { W as I } from "../warningIcon-xqaHPxjF.js";
|
|
9
|
-
import { O as V } from "../otpInput-
|
|
9
|
+
import { O as V } from "../otpInput-CMi5-n2O.js";
|
|
10
10
|
import { P as r } from "../page-D4OThpFS.js";
|
|
11
11
|
import { S as G } from "../spinner-CLwSl2tJ.js";
|
|
12
12
|
import { r as S } from "../incodeModule-C4XIllao.js";
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { b as B, u as r, S as A, B as M } from "./button-DXIWeie9.js";
|
|
2
|
+
import { d as N, A as s, q as y, y as C } from "./vendor-preact-BoMmvSgn.js";
|
|
3
|
+
import { a as E } from "./inputComposed-QzDneavl.js";
|
|
4
|
+
import "./uiConfig-DmIn-g8M.js";
|
|
5
|
+
const u = 6, G = (o) => {
|
|
6
|
+
const c = Math.floor(o / 60), l = o % 60;
|
|
7
|
+
return `${c}:${l.toString().padStart(2, "0")}`;
|
|
8
|
+
}, b = (o) => o.replace(/[^a-zA-Z0-9]/g, "").toUpperCase().slice(0, u), L = ({
|
|
9
|
+
resendTimer: o,
|
|
10
|
+
canResend: c,
|
|
11
|
+
error: l,
|
|
12
|
+
onSubmit: g,
|
|
13
|
+
onResend: z,
|
|
14
|
+
onBack: D,
|
|
15
|
+
backLinkText: P = "otp.changePhoneNumber",
|
|
16
|
+
disabled: f = !1,
|
|
17
|
+
isLoading: p = !1
|
|
18
|
+
}) => {
|
|
19
|
+
const { t: n } = B(), [a, m] = N(""), x = s(null), S = s(0), d = s(null), T = s(null), k = s(c), v = s(!1), O = s(), i = y((t) => {
|
|
20
|
+
const e = T.current;
|
|
21
|
+
e && (clearTimeout(O.current), e.textContent = "", O.current = setTimeout(() => {
|
|
22
|
+
e.textContent = t;
|
|
23
|
+
}, 50));
|
|
24
|
+
}, []);
|
|
25
|
+
C(() => {
|
|
26
|
+
const t = !k.current;
|
|
27
|
+
return k.current = c, t && c && i(n("otp.resendCodeAvailable")), () => clearTimeout(O.current);
|
|
28
|
+
}, [c, i, n]), C(() => {
|
|
29
|
+
l && (d.current = null, setTimeout(() => {
|
|
30
|
+
x.current?.focus();
|
|
31
|
+
}, 0));
|
|
32
|
+
}, [l]);
|
|
33
|
+
const h = y(
|
|
34
|
+
(t) => {
|
|
35
|
+
const e = b(t);
|
|
36
|
+
e.length !== u || p || d.current !== e && (d.current = e, g(e));
|
|
37
|
+
},
|
|
38
|
+
[p, g]
|
|
39
|
+
);
|
|
40
|
+
C(() => {
|
|
41
|
+
if (!a) return;
|
|
42
|
+
const t = a.length === u && S.current < u;
|
|
43
|
+
S.current = a.length, t && h(a);
|
|
44
|
+
}, [a, h]);
|
|
45
|
+
const R = (t) => {
|
|
46
|
+
const e = t.target;
|
|
47
|
+
m(b(e.value));
|
|
48
|
+
}, $ = (t) => {
|
|
49
|
+
t.preventDefault();
|
|
50
|
+
const e = t.clipboardData?.getData("text") || "", I = b(e);
|
|
51
|
+
I && (m(I), I.length === u && h(I));
|
|
52
|
+
};
|
|
53
|
+
C(() => {
|
|
54
|
+
if (c || o <= 0) {
|
|
55
|
+
v.current = !1;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (!v.current) {
|
|
59
|
+
v.current = !0, i(n("otp.timerStarted", { time: String(o) }));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
o === 10 ? i(n("otp.timerTenSeconds")) : o === 5 && i(n("otp.timerFiveSeconds"));
|
|
63
|
+
}, [o, c, i, n]);
|
|
64
|
+
const w = () => {
|
|
65
|
+
if (!c && o > 0)
|
|
66
|
+
return /* @__PURE__ */ r("div", { class: "IncodeOtpInputActions", children: /* @__PURE__ */ r("p", { class: "IncodeOtpInputTimerText", "data-testid": "otp-timer", children: n("otp.resendCountdown", { time: G(o) }) }) });
|
|
67
|
+
const t = () => {
|
|
68
|
+
d.current = null, m(""), z();
|
|
69
|
+
}, e = () => {
|
|
70
|
+
d.current = null, m(""), D();
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ r("div", { class: "IncodeOtpInputActions", children: /* @__PURE__ */ r(
|
|
73
|
+
"p",
|
|
74
|
+
{
|
|
75
|
+
class: `IncodeOtpInputResendText ${f ? "IncodeOtpInputResendTextDisabled" : ""}`,
|
|
76
|
+
"data-testid": "otp-resend-section",
|
|
77
|
+
children: [
|
|
78
|
+
n("otp.didYouNotGetIt"),
|
|
79
|
+
/* @__PURE__ */ r(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
class: "IncodeOtpInputLink",
|
|
84
|
+
onClick: t,
|
|
85
|
+
disabled: f || !c,
|
|
86
|
+
"data-testid": "otp-resend",
|
|
87
|
+
children: n("otp.resendCode")
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
` ${n("otp.or")} `,
|
|
91
|
+
/* @__PURE__ */ r(
|
|
92
|
+
"button",
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
class: "IncodeOtpInputLink",
|
|
96
|
+
onClick: e,
|
|
97
|
+
disabled: f,
|
|
98
|
+
"data-testid": "otp-back",
|
|
99
|
+
children: n(P)
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
) });
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ r("div", { class: "IncodeOtpInput IncodeOtpInputComposed", children: [
|
|
107
|
+
/* @__PURE__ */ r(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
ref: T,
|
|
111
|
+
class: "IncodeSrOnly",
|
|
112
|
+
"aria-live": "polite",
|
|
113
|
+
"aria-atomic": "true"
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ r(
|
|
117
|
+
E,
|
|
118
|
+
{
|
|
119
|
+
id: "otp-code",
|
|
120
|
+
type: "text",
|
|
121
|
+
inputMode: "text",
|
|
122
|
+
ref: x,
|
|
123
|
+
maxLength: u,
|
|
124
|
+
value: a,
|
|
125
|
+
error: l,
|
|
126
|
+
onInput: R,
|
|
127
|
+
onPaste: $,
|
|
128
|
+
disabled: f || p,
|
|
129
|
+
autocomplete: "one-time-code",
|
|
130
|
+
"data-testid": "otp-input-0",
|
|
131
|
+
"aria-label": n("otp.verificationCode"),
|
|
132
|
+
class: "IncodeOtpSingleInput",
|
|
133
|
+
showErrorIcon: !0
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ r(A, {}),
|
|
137
|
+
/* @__PURE__ */ r(
|
|
138
|
+
M,
|
|
139
|
+
{
|
|
140
|
+
onClick: () => {
|
|
141
|
+
h(a);
|
|
142
|
+
},
|
|
143
|
+
disabled: a.length < u || p,
|
|
144
|
+
isLoading: p,
|
|
145
|
+
"data-testid": "otp-submit",
|
|
146
|
+
children: n("common.continue")
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ r(A, { size: 12 }),
|
|
150
|
+
w()
|
|
151
|
+
] });
|
|
152
|
+
};
|
|
153
|
+
export {
|
|
154
|
+
L as O
|
|
155
|
+
};
|
package/dist/phone/phone.es.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { u as
|
|
1
|
+
import { u as n, I as O, b as C, a as E, S as g, B as v } from "../button-DXIWeie9.js";
|
|
2
2
|
import { createPhoneManager as w } from "@incodetech/core/phone";
|
|
3
3
|
import { d as S } from "../vendor-preact-BoMmvSgn.js";
|
|
4
4
|
import "../uiConfig-DmIn-g8M.js";
|
|
5
5
|
import "@incodetech/core";
|
|
6
6
|
import { C as y } from "../checkbox-wo8qk7tM.js";
|
|
7
|
-
import { O as k } from "../otpInput-
|
|
7
|
+
import { O as k } from "../otpInput-CMi5-n2O.js";
|
|
8
8
|
import { P } from "../page-D4OThpFS.js";
|
|
9
9
|
import { P as R } from "../phoneInputComposed-BAFZQ4Y8.js";
|
|
10
10
|
import { r as V } from "../incodeModule-C4XIllao.js";
|
|
11
11
|
const B = ({
|
|
12
12
|
config: r,
|
|
13
13
|
manager: s,
|
|
14
|
-
onFinish:
|
|
15
|
-
onError:
|
|
14
|
+
onFinish: p,
|
|
15
|
+
onError: d
|
|
16
16
|
}) => {
|
|
17
|
-
const { t:
|
|
17
|
+
const { t: e } = C(), [t, o] = E(
|
|
18
18
|
() => {
|
|
19
19
|
if (s) return s;
|
|
20
20
|
if (!r)
|
|
@@ -24,16 +24,16 @@ const B = ({
|
|
|
24
24
|
{ manageLifecycle: !s }
|
|
25
25
|
), [b, I] = S(!1);
|
|
26
26
|
if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingInitialOtp") {
|
|
27
|
-
const i = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", a = t.status === "inputting" ? t.countryCode : "US", l = t.status === "inputting" ? t.prefilledPhone : void 0, c = t.status === "inputting" && t.phoneError ?
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
const i = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingInitialOtp", a = t.status === "inputting" ? t.countryCode : "US", l = t.status === "inputting" ? t.prefilledPhone : void 0, c = t.status === "inputting" && t.phoneError ? e(t.phoneError) : void 0, u = t.status === "inputting" ? t.otpVerification ?? !1 : !1, h = t.status === "inputting" ? t.optinEnabled ?? !1 : !1;
|
|
28
|
+
return /* @__PURE__ */ n(
|
|
29
29
|
P,
|
|
30
30
|
{
|
|
31
31
|
className: "IncodePhonePage",
|
|
32
|
-
title:
|
|
33
|
-
subtitle: u ?
|
|
32
|
+
title: e("phone.verify"),
|
|
33
|
+
subtitle: u ? e("email.willSendCode") : void 0,
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ n("div", { class: "IncodePhoneInputContainer", children: [
|
|
36
|
+
/* @__PURE__ */ n(
|
|
37
37
|
R,
|
|
38
38
|
{
|
|
39
39
|
id: "phone",
|
|
@@ -48,61 +48,70 @@ const B = ({
|
|
|
48
48
|
showErrorIcon: !0
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
h && /* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ n(g, { size: 16 }),
|
|
52
|
+
h && /* @__PURE__ */ n(
|
|
53
53
|
y,
|
|
54
54
|
{
|
|
55
55
|
id: "phone-optin",
|
|
56
|
-
label:
|
|
56
|
+
label: e("phone.optIn"),
|
|
57
57
|
size: "s",
|
|
58
58
|
onChange: (m) => o.setOptInGranted(m.target.checked)
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
61
|
] }),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ n(g, {}),
|
|
63
|
+
/* @__PURE__ */ n(
|
|
64
64
|
v,
|
|
65
65
|
{
|
|
66
66
|
onClick: () => o.submit(),
|
|
67
67
|
disabled: !b,
|
|
68
68
|
isLoading: i,
|
|
69
69
|
"data-testid": "phone-submit",
|
|
70
|
-
children:
|
|
70
|
+
children: e("common.continue")
|
|
71
71
|
}
|
|
72
72
|
)
|
|
73
73
|
]
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
|
+
"phone-input"
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError" || t.status === "resendingOtp") {
|
|
78
79
|
const i = t.status === "verifyingOtp", a = t.status === "otpError", l = t.status === "awaitingOtp", c = t.status === "resendingOtp", u = l || a || i;
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
80
|
+
return /* @__PURE__ */ n(
|
|
81
|
+
P,
|
|
81
82
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
className: "IncodePhonePage",
|
|
84
|
+
title: e("otp.enterCodeSMS"),
|
|
85
|
+
children: /* @__PURE__ */ n(
|
|
86
|
+
k,
|
|
87
|
+
{
|
|
88
|
+
resendTimer: u ? t.resendTimer : 0,
|
|
89
|
+
canResend: u ? t.canResend : !1,
|
|
90
|
+
isLoading: i,
|
|
91
|
+
disabled: c || i,
|
|
92
|
+
error: a ? e(t.otpError) : void 0,
|
|
93
|
+
onSubmit: (h) => o.submitOtp(h),
|
|
94
|
+
onResend: () => o.resendOtp(),
|
|
95
|
+
onBack: () => o.back()
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
},
|
|
99
|
+
"phone-otp"
|
|
100
|
+
);
|
|
92
101
|
}
|
|
93
|
-
return t.status === "finished" ? (
|
|
102
|
+
return t.status === "finished" ? (p?.(), null) : (t.status === "error" && d?.(t.error), null);
|
|
94
103
|
}, L = ({
|
|
95
104
|
config: r,
|
|
96
105
|
manager: s,
|
|
97
|
-
onFinish:
|
|
98
|
-
onError:
|
|
99
|
-
}) => /* @__PURE__ */
|
|
106
|
+
onFinish: p,
|
|
107
|
+
onError: d
|
|
108
|
+
}) => /* @__PURE__ */ n(O, { children: r || s ? /* @__PURE__ */ n(
|
|
100
109
|
B,
|
|
101
110
|
{
|
|
102
111
|
config: r,
|
|
103
112
|
manager: s,
|
|
104
|
-
onFinish:
|
|
105
|
-
onError:
|
|
113
|
+
onFinish: p,
|
|
114
|
+
onError: d
|
|
106
115
|
}
|
|
107
116
|
) : null });
|
|
108
117
|
V(L, "incode-phone");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20260403-10f7d94",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"qrcode": "^1.5.4",
|
|
138
138
|
"signature_pad": "^5.1.3",
|
|
139
139
|
"tailwindcss": "^4.1.17",
|
|
140
|
-
"@incodetech/core": "0.0.0-dev-
|
|
140
|
+
"@incodetech/core": "0.0.0-dev-20260403-10f7d94"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@microsoft/api-extractor": "^7.53.3",
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { b as M, u as n, S as A, B as S } from "./button-DXIWeie9.js";
|
|
2
|
-
import { d as N, A as u, q as y, y as C } from "./vendor-preact-BoMmvSgn.js";
|
|
3
|
-
import { a as E } from "./inputComposed-QzDneavl.js";
|
|
4
|
-
import "./uiConfig-DmIn-g8M.js";
|
|
5
|
-
const a = 6, F = (s) => {
|
|
6
|
-
const r = Math.floor(s / 60), i = s % 60;
|
|
7
|
-
return `${r}:${i.toString().padStart(2, "0")}`;
|
|
8
|
-
}, v = (s) => s.replace(/[^a-zA-Z0-9]/g, "").toUpperCase().slice(0, a), L = ({
|
|
9
|
-
resendTimer: s,
|
|
10
|
-
canResend: r,
|
|
11
|
-
error: i,
|
|
12
|
-
onSubmit: O,
|
|
13
|
-
onResend: z,
|
|
14
|
-
onBack: R,
|
|
15
|
-
backLinkText: D = "otp.changePhoneNumber",
|
|
16
|
-
disabled: p = !1,
|
|
17
|
-
isLoading: l = !1
|
|
18
|
-
}) => {
|
|
19
|
-
const { t: o } = M(), [c, f] = N(""), m = u(null), g = u(0), d = u(null), x = u(null), T = u(r), b = u(), k = y((t) => {
|
|
20
|
-
const e = x.current;
|
|
21
|
-
e && (clearTimeout(b.current), e.textContent = "", b.current = setTimeout(() => {
|
|
22
|
-
e.textContent = t;
|
|
23
|
-
}, 50));
|
|
24
|
-
}, []);
|
|
25
|
-
C(() => {
|
|
26
|
-
const t = !T.current;
|
|
27
|
-
return T.current = r, t && r && k(o("otp.resendCodeAvailable")), () => clearTimeout(b.current);
|
|
28
|
-
}, [r, k, o]), C(() => {
|
|
29
|
-
m.current && m.current.focus();
|
|
30
|
-
}, []), C(() => {
|
|
31
|
-
i && (d.current = null, setTimeout(() => {
|
|
32
|
-
m.current?.focus();
|
|
33
|
-
}, 0));
|
|
34
|
-
}, [i]);
|
|
35
|
-
const h = y(
|
|
36
|
-
(t) => {
|
|
37
|
-
const e = v(t);
|
|
38
|
-
e.length !== a || l || d.current !== e && (d.current = e, O(e));
|
|
39
|
-
},
|
|
40
|
-
[l, O]
|
|
41
|
-
);
|
|
42
|
-
C(() => {
|
|
43
|
-
if (!c) return;
|
|
44
|
-
const t = c.length === a && g.current < a;
|
|
45
|
-
g.current = c.length, t && h(c);
|
|
46
|
-
}, [c, h]);
|
|
47
|
-
const P = (t) => {
|
|
48
|
-
t.target.select();
|
|
49
|
-
}, $ = (t) => {
|
|
50
|
-
const e = t.target;
|
|
51
|
-
f(v(e.value));
|
|
52
|
-
}, w = (t) => {
|
|
53
|
-
t.preventDefault();
|
|
54
|
-
const e = t.clipboardData?.getData("text") || "", I = v(e);
|
|
55
|
-
I && (f(I), I.length === a && h(I));
|
|
56
|
-
}, B = () => {
|
|
57
|
-
if (!r && s > 0)
|
|
58
|
-
return /* @__PURE__ */ n("div", { class: "IncodeOtpInputActions", children: /* @__PURE__ */ n(S, { variant: "link", disabled: !0, "data-testid": "otp-timer", children: o("otp.resendCountdown", { time: F(s) }) }) });
|
|
59
|
-
const t = () => {
|
|
60
|
-
d.current = null, f(""), z();
|
|
61
|
-
}, e = () => {
|
|
62
|
-
d.current = null, f(""), R();
|
|
63
|
-
};
|
|
64
|
-
return /* @__PURE__ */ n("div", { class: "IncodeOtpInputActions", children: /* @__PURE__ */ n(
|
|
65
|
-
"p",
|
|
66
|
-
{
|
|
67
|
-
class: `IncodeOtpInputResendText ${p ? "IncodeOtpInputResendTextDisabled" : ""}`,
|
|
68
|
-
"data-testid": "otp-resend-section",
|
|
69
|
-
children: [
|
|
70
|
-
o("otp.didYouNotGetIt"),
|
|
71
|
-
/* @__PURE__ */ n(
|
|
72
|
-
"button",
|
|
73
|
-
{
|
|
74
|
-
type: "button",
|
|
75
|
-
class: "IncodeOtpInputLink",
|
|
76
|
-
onClick: t,
|
|
77
|
-
disabled: p || !r,
|
|
78
|
-
"data-testid": "otp-resend",
|
|
79
|
-
children: o("otp.resendCode")
|
|
80
|
-
}
|
|
81
|
-
),
|
|
82
|
-
` ${o("otp.or")} `,
|
|
83
|
-
/* @__PURE__ */ n(
|
|
84
|
-
"button",
|
|
85
|
-
{
|
|
86
|
-
type: "button",
|
|
87
|
-
class: "IncodeOtpInputLink",
|
|
88
|
-
onClick: e,
|
|
89
|
-
disabled: p,
|
|
90
|
-
"data-testid": "otp-back",
|
|
91
|
-
children: o(D)
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
) });
|
|
97
|
-
};
|
|
98
|
-
return /* @__PURE__ */ n("div", { class: "IncodeOtpInput IncodeOtpInputComposed", children: [
|
|
99
|
-
/* @__PURE__ */ n(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
ref: x,
|
|
103
|
-
class: "IncodeSrOnly",
|
|
104
|
-
"aria-live": "polite",
|
|
105
|
-
"aria-atomic": "true"
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
/* @__PURE__ */ n(
|
|
109
|
-
E,
|
|
110
|
-
{
|
|
111
|
-
id: "otp-code",
|
|
112
|
-
type: "text",
|
|
113
|
-
inputMode: "text",
|
|
114
|
-
ref: m,
|
|
115
|
-
maxLength: a,
|
|
116
|
-
value: c,
|
|
117
|
-
error: i,
|
|
118
|
-
onInput: $,
|
|
119
|
-
onPaste: w,
|
|
120
|
-
onFocus: P,
|
|
121
|
-
disabled: p || l,
|
|
122
|
-
autocomplete: "one-time-code",
|
|
123
|
-
"data-testid": "otp-input-0",
|
|
124
|
-
"aria-label": o("otp.verificationCode"),
|
|
125
|
-
class: "IncodeOtpSingleInput",
|
|
126
|
-
showErrorIcon: !0
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
/* @__PURE__ */ n(A, {}),
|
|
130
|
-
/* @__PURE__ */ n(
|
|
131
|
-
S,
|
|
132
|
-
{
|
|
133
|
-
onClick: () => {
|
|
134
|
-
h(c);
|
|
135
|
-
},
|
|
136
|
-
disabled: c.length < a || l,
|
|
137
|
-
isLoading: l,
|
|
138
|
-
"data-testid": "otp-submit",
|
|
139
|
-
children: o("common.continue")
|
|
140
|
-
}
|
|
141
|
-
),
|
|
142
|
-
/* @__PURE__ */ n(A, { size: 12 }),
|
|
143
|
-
B()
|
|
144
|
-
] });
|
|
145
|
-
};
|
|
146
|
-
export {
|
|
147
|
-
L as O
|
|
148
|
-
};
|