@incodetech/web 0.0.0-dev-20260317-ce5d28b → 0.0.0-dev-20260317-6ffceac
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/{addressAutocomplete-CL7IcYGQ.js → addressAutocomplete-3u5x8ZFs.js} +2 -2
- package/dist/base.css +25 -70
- package/dist/curp-validation/curp-validation.es.js +59 -58
- package/dist/dropdownComposed-B5ZuQS8C.js +345 -0
- package/dist/{ekybModule-CV7jE8qz.js → ekybModule-BKSouMz6.js} +8 -7
- package/dist/{ekycModule-fxKjsL1i.js → ekycModule-CWu3ZTNN.js} +4 -4
- package/dist/email/email.es.js +87 -86
- package/dist/extensibility.es.js +59 -58
- package/dist/flow/flow.es.js +2 -2
- package/dist/{formField-B2HDj15w.js → formField-UWsp-7Fj.js} +1 -1
- package/dist/governmentValidation/governmentValidation.es.js +1 -1
- package/dist/inputComposed-BHi-MSpP.js +102 -0
- package/dist/otpInput-DdkvlvCS.js +107 -0
- package/dist/phone/phone.es.js +58 -64
- package/dist/{phoneInputComposed-D0oBe-el.js → phoneInputComposed-CwtJKvGh.js} +7 -6
- package/package.json +2 -2
- package/dist/dropdownComposed-DBm7cotT.js +0 -440
- package/dist/otpInput-cazUY73p.js +0 -151
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { u as o, d as M } from "./button-Ca1tRSTI.js";
|
|
2
|
+
import { d as D, A as p, y as C } from "./vendor-preact-BXf0bkEs.js";
|
|
3
|
+
import { C as ce } from "./chevronDown-BUaOuf9J.js";
|
|
4
|
+
import { E as de } from "./errorIcon-BL647nVh.js";
|
|
5
|
+
import { S as ie } from "./successIcon-BybULRRU.js";
|
|
6
|
+
const le = ({ size: s = 20 }) => /* @__PURE__ */ o(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
width: s,
|
|
11
|
+
height: s,
|
|
12
|
+
viewBox: "0 0 20 20",
|
|
13
|
+
fill: "none",
|
|
14
|
+
class: "IncodeSearchIcon",
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ o("title", { children: "Search" }),
|
|
18
|
+
/* @__PURE__ */ o(
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
d: "M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z",
|
|
22
|
+
stroke: "var(--icon-neutral-300)",
|
|
23
|
+
"stroke-width": "2",
|
|
24
|
+
"stroke-linecap": "round",
|
|
25
|
+
"stroke-linejoin": "round"
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ o(
|
|
29
|
+
"path",
|
|
30
|
+
{
|
|
31
|
+
d: "M19 19L14.65 14.65",
|
|
32
|
+
stroke: "var(--icon-neutral-300)",
|
|
33
|
+
"stroke-width": "2",
|
|
34
|
+
"stroke-linecap": "round",
|
|
35
|
+
"stroke-linejoin": "round"
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
), ve = ({
|
|
41
|
+
id: s,
|
|
42
|
+
label: u,
|
|
43
|
+
placeholder: b = "Choose an option",
|
|
44
|
+
value: g,
|
|
45
|
+
options: k,
|
|
46
|
+
onChange: Q,
|
|
47
|
+
error: l,
|
|
48
|
+
helper: y,
|
|
49
|
+
showErrorIcon: U,
|
|
50
|
+
showHelperIcon: V,
|
|
51
|
+
suppressMessages: S = !1,
|
|
52
|
+
disabled: f = !1,
|
|
53
|
+
required: T,
|
|
54
|
+
searchable: w = !1,
|
|
55
|
+
searchPlaceholder: W = "Search...",
|
|
56
|
+
noResultsText: Z = "No results found",
|
|
57
|
+
name: H,
|
|
58
|
+
tabIndex: _,
|
|
59
|
+
onKeyDown: G,
|
|
60
|
+
onBlur: J,
|
|
61
|
+
renderSelectedLabel: K,
|
|
62
|
+
siblingElement: x,
|
|
63
|
+
enterKeyHint: pe,
|
|
64
|
+
class: P,
|
|
65
|
+
"data-testid": X
|
|
66
|
+
}) => {
|
|
67
|
+
const [n, d] = D(!1), [Y, L] = D(!1), [a, t] = D(-1), [$, O] = D(""), B = p(null), m = p(null), j = p(null), R = p([]), A = p(null), E = p(""), h = p(), v = k.find((e) => e.value === g), c = w && $ ? k.filter(
|
|
68
|
+
(e) => e.label.toLowerCase().includes($.toLowerCase())
|
|
69
|
+
) : k, F = `${s}-label`, z = `${s}-listbox`, N = `${s}-helper`, q = `${s}-error`, ee = S ? "" : [y ? N : null, l ? q : null].filter(Boolean).join(" ");
|
|
70
|
+
C(() => {
|
|
71
|
+
if (!n) return;
|
|
72
|
+
const e = requestAnimationFrame(() => {
|
|
73
|
+
w && A.current && A.current.focus(), requestAnimationFrame(() => {
|
|
74
|
+
j.current?.scrollIntoView({
|
|
75
|
+
behavior: "smooth",
|
|
76
|
+
block: "nearest",
|
|
77
|
+
inline: "nearest"
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
return () => cancelAnimationFrame(e);
|
|
82
|
+
}, [n, w]), C(() => {
|
|
83
|
+
n || (t(-1), O(""));
|
|
84
|
+
}, [n]), C(() => {
|
|
85
|
+
a >= 0 && R.current[a] && R.current[a]?.scrollIntoView({
|
|
86
|
+
block: "nearest",
|
|
87
|
+
inline: "nearest"
|
|
88
|
+
});
|
|
89
|
+
}, [a]), C(() => () => {
|
|
90
|
+
h.current && clearTimeout(h.current);
|
|
91
|
+
}, []);
|
|
92
|
+
const oe = () => {
|
|
93
|
+
f || d((e) => !e);
|
|
94
|
+
}, I = (e) => {
|
|
95
|
+
Q(e), d(!1), t(-1), m.current?.focus();
|
|
96
|
+
}, re = () => {
|
|
97
|
+
L(!0);
|
|
98
|
+
}, ne = (e) => {
|
|
99
|
+
L(!1), B.current?.contains(e.relatedTarget) || (d(!1), J?.());
|
|
100
|
+
}, te = (e) => {
|
|
101
|
+
if (f) return;
|
|
102
|
+
G?.(e);
|
|
103
|
+
const { key: i } = e;
|
|
104
|
+
if (i.length === 1 && /^[a-zA-Z0-9]$/.test(i)) {
|
|
105
|
+
e.preventDefault(), h.current && clearTimeout(h.current), E.current += i.toLowerCase();
|
|
106
|
+
const r = c.findIndex(
|
|
107
|
+
(se) => se.label.toLowerCase().startsWith(E.current)
|
|
108
|
+
);
|
|
109
|
+
r !== -1 && (n || d(!0), t(r)), h.current = setTimeout(() => {
|
|
110
|
+
E.current = "";
|
|
111
|
+
}, 500);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
switch (i) {
|
|
115
|
+
case "ArrowDown":
|
|
116
|
+
e.preventDefault(), n ? t(
|
|
117
|
+
(r) => r < c.length - 1 ? r + 1 : r
|
|
118
|
+
) : (d(!0), t(0));
|
|
119
|
+
break;
|
|
120
|
+
case "ArrowUp":
|
|
121
|
+
e.preventDefault(), n ? t((r) => r > 0 ? r - 1 : r) : (d(!0), t(c.length - 1));
|
|
122
|
+
break;
|
|
123
|
+
case "Home":
|
|
124
|
+
e.preventDefault(), n && t(0);
|
|
125
|
+
break;
|
|
126
|
+
case "End":
|
|
127
|
+
e.preventDefault(), n && t(c.length - 1);
|
|
128
|
+
break;
|
|
129
|
+
case "Enter":
|
|
130
|
+
e.preventDefault(), n && a >= 0 && c[a] ? I(c[a].value) : n || d(!0);
|
|
131
|
+
break;
|
|
132
|
+
case " ":
|
|
133
|
+
e.preventDefault(), n && a >= 0 && c[a] ? I(c[a].value) : n || (d(!0), t(0));
|
|
134
|
+
break;
|
|
135
|
+
case "Escape":
|
|
136
|
+
e.preventDefault(), n && (d(!1), t(-1), m.current?.focus());
|
|
137
|
+
break;
|
|
138
|
+
case "Tab":
|
|
139
|
+
n && (d(!1), t(-1));
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}, ae = (e) => {
|
|
143
|
+
const { key: i } = e;
|
|
144
|
+
switch (i) {
|
|
145
|
+
case "ArrowDown":
|
|
146
|
+
e.preventDefault(), t(
|
|
147
|
+
(r) => r < c.length - 1 ? r + 1 : r
|
|
148
|
+
);
|
|
149
|
+
break;
|
|
150
|
+
case "ArrowUp":
|
|
151
|
+
e.preventDefault(), t((r) => r > 0 ? r - 1 : r);
|
|
152
|
+
break;
|
|
153
|
+
case "Home":
|
|
154
|
+
e.preventDefault(), t(0);
|
|
155
|
+
break;
|
|
156
|
+
case "End":
|
|
157
|
+
e.preventDefault(), t(c.length - 1);
|
|
158
|
+
break;
|
|
159
|
+
case "Enter":
|
|
160
|
+
e.preventDefault(), a >= 0 && c[a] && I(c[a].value);
|
|
161
|
+
break;
|
|
162
|
+
case "Escape":
|
|
163
|
+
e.preventDefault(), d(!1), t(-1), m.current?.focus();
|
|
164
|
+
break;
|
|
165
|
+
case "Tab":
|
|
166
|
+
d(!1), t(-1);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
return /* @__PURE__ */ o(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
class: M("IncodeDropdownComposed", P),
|
|
174
|
+
ref: B,
|
|
175
|
+
onBlur: ne,
|
|
176
|
+
children: [
|
|
177
|
+
H && /* @__PURE__ */ o(
|
|
178
|
+
"input",
|
|
179
|
+
{
|
|
180
|
+
type: "hidden",
|
|
181
|
+
name: H,
|
|
182
|
+
value: g || "",
|
|
183
|
+
disabled: f,
|
|
184
|
+
required: T
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
u && /* @__PURE__ */ o(
|
|
188
|
+
"label",
|
|
189
|
+
{
|
|
190
|
+
class: "IncodeDropdownComposedLabel",
|
|
191
|
+
id: F,
|
|
192
|
+
htmlFor: s,
|
|
193
|
+
"data-testid": `${s}-label`,
|
|
194
|
+
children: [
|
|
195
|
+
u,
|
|
196
|
+
T && /* @__PURE__ */ o("span", { class: "IncodeDropdownComposedRequired", children: " *" })
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ o("div", { class: "IncodeDropdownComposedWrapper", children: [
|
|
201
|
+
/* @__PURE__ */ o(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
class: M("IncodeDropdownComposedTriggerRow", {
|
|
205
|
+
IncodeDropdownComposedTriggerRowWithSibling: !!x
|
|
206
|
+
}),
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ o(
|
|
209
|
+
"button",
|
|
210
|
+
{
|
|
211
|
+
ref: m,
|
|
212
|
+
type: "button",
|
|
213
|
+
id: s,
|
|
214
|
+
class: "IncodeDropdownComposedTrigger",
|
|
215
|
+
onClick: oe,
|
|
216
|
+
onFocus: re,
|
|
217
|
+
onKeyDown: te,
|
|
218
|
+
tabIndex: f ? -1 : _ ?? 0,
|
|
219
|
+
disabled: f,
|
|
220
|
+
"aria-haspopup": "listbox",
|
|
221
|
+
"aria-expanded": n ? "true" : "false",
|
|
222
|
+
"aria-disabled": f ? "true" : void 0,
|
|
223
|
+
"aria-labelledby": u ? F : void 0,
|
|
224
|
+
"aria-label": u ? void 0 : b,
|
|
225
|
+
"aria-controls": n ? z : void 0,
|
|
226
|
+
"aria-activedescendant": n && a >= 0 ? `${s}-option-${a}` : void 0,
|
|
227
|
+
"aria-invalid": l ? "true" : void 0,
|
|
228
|
+
"aria-required": T ? "true" : void 0,
|
|
229
|
+
"aria-describedby": ee || void 0,
|
|
230
|
+
"data-error": l ? "true" : void 0,
|
|
231
|
+
"data-focused": Y || n ? "true" : void 0,
|
|
232
|
+
"data-testid": X,
|
|
233
|
+
children: [
|
|
234
|
+
/* @__PURE__ */ o(
|
|
235
|
+
"span",
|
|
236
|
+
{
|
|
237
|
+
class: v ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
|
|
238
|
+
children: v ? K ? K(v) : v.label : b
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ o(
|
|
242
|
+
"span",
|
|
243
|
+
{
|
|
244
|
+
class: "IncodeDropdownComposedTriggerIcon",
|
|
245
|
+
"aria-hidden": "true",
|
|
246
|
+
"data-open": n,
|
|
247
|
+
children: /* @__PURE__ */ o(ce, {})
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
x && /* @__PURE__ */ o("div", { class: "IncodeDropdownComposedSibling", children: x })
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
n && /* @__PURE__ */ o(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
ref: j,
|
|
261
|
+
id: z,
|
|
262
|
+
class: "IncodeDropdownComposedList",
|
|
263
|
+
role: "listbox",
|
|
264
|
+
"aria-labelledby": u ? F : void 0,
|
|
265
|
+
"aria-label": u ? void 0 : b,
|
|
266
|
+
"data-error": l ? "true" : void 0,
|
|
267
|
+
children: [
|
|
268
|
+
w && /* @__PURE__ */ o("div", { class: "IncodeDropdownComposedSearchWrapper", children: /* @__PURE__ */ o("div", { class: "IncodeDropdownComposedSearchInner", children: [
|
|
269
|
+
/* @__PURE__ */ o(
|
|
270
|
+
"input",
|
|
271
|
+
{
|
|
272
|
+
ref: A,
|
|
273
|
+
type: "text",
|
|
274
|
+
class: "IncodeDropdownComposedSearchInput",
|
|
275
|
+
value: $,
|
|
276
|
+
onInput: (e) => {
|
|
277
|
+
O(e.target.value), t(0);
|
|
278
|
+
},
|
|
279
|
+
onKeyDown: ae,
|
|
280
|
+
placeholder: W,
|
|
281
|
+
"aria-label": W,
|
|
282
|
+
autocomplete: "off"
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
/* @__PURE__ */ o(
|
|
286
|
+
"span",
|
|
287
|
+
{
|
|
288
|
+
class: "IncodeDropdownComposedSearchIcon",
|
|
289
|
+
"aria-hidden": "true",
|
|
290
|
+
children: /* @__PURE__ */ o(le, { size: 20 })
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
] }) }),
|
|
294
|
+
/* @__PURE__ */ o("div", { class: "IncodeDropdownComposedOptionsScroll", children: c.length === 0 ? /* @__PURE__ */ o("div", { class: "IncodeDropdownComposedNoResults", children: Z }) : c.map((e, i) => /* @__PURE__ */ o(
|
|
295
|
+
"div",
|
|
296
|
+
{
|
|
297
|
+
id: `${s}-option-${i}`,
|
|
298
|
+
role: "option",
|
|
299
|
+
"aria-selected": g === e.value ? "true" : "false",
|
|
300
|
+
class: "IncodeDropdownComposedOption",
|
|
301
|
+
"data-highlighted": a === i,
|
|
302
|
+
ref: (r) => {
|
|
303
|
+
R.current[i] = r;
|
|
304
|
+
},
|
|
305
|
+
onClick: () => I(e.value),
|
|
306
|
+
onMouseDown: (r) => r.preventDefault(),
|
|
307
|
+
onMouseEnter: () => t(i),
|
|
308
|
+
children: e.label
|
|
309
|
+
},
|
|
310
|
+
e.value
|
|
311
|
+
)) })
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
] }),
|
|
316
|
+
!S && l && /* @__PURE__ */ o(
|
|
317
|
+
"div",
|
|
318
|
+
{
|
|
319
|
+
class: "IncodeDropdownComposedErrorWrapper",
|
|
320
|
+
"data-testid": `${s}-error-wrapper`,
|
|
321
|
+
children: [
|
|
322
|
+
U && /* @__PURE__ */ o("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ o(de, { size: 17 }) }),
|
|
323
|
+
/* @__PURE__ */ o("p", { id: q, class: "IncodeDropdownComposedError", children: l })
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
),
|
|
327
|
+
!S && y && !l && /* @__PURE__ */ o(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
class: "IncodeDropdownComposedHelperWrapper",
|
|
331
|
+
"data-testid": `${s}-helper-wrapper`,
|
|
332
|
+
children: [
|
|
333
|
+
V && /* @__PURE__ */ o("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ o(ie, { size: 17 }) }),
|
|
334
|
+
/* @__PURE__ */ o("p", { id: N, class: "IncodeDropdownComposedHelper", children: y })
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
]
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
};
|
|
342
|
+
export {
|
|
343
|
+
ve as D,
|
|
344
|
+
le as S
|
|
345
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { b as k, u as o, I as w, a as D, S as L, B as T } from "./button-Ca1tRSTI.js";
|
|
2
|
-
import { SUPPORTED_COUNTRIES as
|
|
2
|
+
import { SUPPORTED_COUNTRIES as f, DEV_ONLY_COUNTRIES as O, createEkybManager as _ } from "@incodetech/core/ekyb";
|
|
3
3
|
import { T as q, y as g, A as S, k as B } from "./vendor-preact-BXf0bkEs.js";
|
|
4
4
|
import "./uiConfig-Z6RT23Sl.js";
|
|
5
5
|
import "@incodetech/core";
|
|
6
|
-
import { u as V, A as G } from "./addressAutocomplete-
|
|
6
|
+
import { u as V, A as G } from "./addressAutocomplete-3u5x8ZFs.js";
|
|
7
7
|
import { P as K } from "./page-BVHG3h0V.js";
|
|
8
|
-
import { t as $, F as z, V as v } from "./formField-
|
|
8
|
+
import { t as $, F as z, V as v } from "./formField-UWsp-7Fj.js";
|
|
9
9
|
import { r as W } from "./incodeModule-aE-LkKwM.js";
|
|
10
|
-
import { D as P
|
|
10
|
+
import { D as P } from "./dropdownComposed-B5ZuQS8C.js";
|
|
11
|
+
import { I as F } from "./inputComposed-BHi-MSpP.js";
|
|
11
12
|
function Y(e) {
|
|
12
13
|
return [...e.toUpperCase()].map((r) => String.fromCodePoint(127462 + r.charCodeAt(0) - 65)).join("");
|
|
13
14
|
}
|
|
@@ -39,7 +40,7 @@ const J = ({
|
|
|
39
40
|
value: e,
|
|
40
41
|
onChange: r
|
|
41
42
|
}) => {
|
|
42
|
-
const { t: u } = k(), i = q(() => (X() ? [...
|
|
43
|
+
const { t: u } = k(), i = q(() => (X() ? [...f, ...O] : [...f]).map(H).sort((l, a) => l.label.localeCompare(a.label)), []);
|
|
43
44
|
return /* @__PURE__ */ o("div", { className: "IncodeEkybCountrySelector", children: /* @__PURE__ */ o(
|
|
44
45
|
P,
|
|
45
46
|
{
|
|
@@ -108,7 +109,7 @@ const J = ({
|
|
|
108
109
|
const b = n === 0 ? m("ekyb.uboName") : m("ekyb.uboNameWithNumber", { number: n + 1 }), C = n === 0 ? m("ekyb.uboSurname") : m("ekyb.uboSurnameWithNumber", { number: n + 1 }), E = n === 0;
|
|
109
110
|
return /* @__PURE__ */ o("div", { className: "IncodeEkybUboEntry", children: [
|
|
110
111
|
/* @__PURE__ */ o(
|
|
111
|
-
|
|
112
|
+
F,
|
|
112
113
|
{
|
|
113
114
|
id: `ubo-${n}-name`,
|
|
114
115
|
label: b,
|
|
@@ -120,7 +121,7 @@ const J = ({
|
|
|
120
121
|
}
|
|
121
122
|
),
|
|
122
123
|
/* @__PURE__ */ o(
|
|
123
|
-
|
|
124
|
+
F,
|
|
124
125
|
{
|
|
125
126
|
id: `ubo-${n}-surname`,
|
|
126
127
|
label: C,
|
|
@@ -3,13 +3,13 @@ import { createEkycManager as x } from "@incodetech/core/ekyc";
|
|
|
3
3
|
import { y as E, A as k } from "./vendor-preact-BXf0bkEs.js";
|
|
4
4
|
import "./uiConfig-Z6RT23Sl.js";
|
|
5
5
|
import "@incodetech/core";
|
|
6
|
-
import { u as T, A as B } from "./addressAutocomplete-
|
|
7
|
-
import { V as b, t as H, F as K } from "./formField-
|
|
6
|
+
import { u as T, A as B } from "./addressAutocomplete-3u5x8ZFs.js";
|
|
7
|
+
import { V as b, t as H, F as K } from "./formField-UWsp-7Fj.js";
|
|
8
8
|
import { D as O } from "./dateInputComposed-CvFmQpJ0.js";
|
|
9
|
-
import { D as z } from "./dropdownComposed-
|
|
9
|
+
import { D as z } from "./dropdownComposed-B5ZuQS8C.js";
|
|
10
10
|
import { P as G } from "./page-BVHG3h0V.js";
|
|
11
11
|
import { r as j } from "./incodeModule-aE-LkKwM.js";
|
|
12
|
-
import { P as J } from "./phoneInputComposed-
|
|
12
|
+
import { P as J } from "./phoneInputComposed-CwtJKvGh.js";
|
|
13
13
|
const Q = ({ config: p, onFinish: s, onError: m }) => {
|
|
14
14
|
const { t: h } = P(), [t, i] = M(() => x({ config: p }));
|
|
15
15
|
E(() => {
|
package/dist/email/email.es.js
CHANGED
|
@@ -1,63 +1,64 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { createEmailManager as
|
|
3
|
-
import { d as
|
|
1
|
+
import { u as e, S as g, I as v, b as O, a as y, B as C } from "../button-Ca1tRSTI.js";
|
|
2
|
+
import { createEmailManager as P } from "@incodetech/core/email";
|
|
3
|
+
import { d as f, y as k, k as w } from "../vendor-preact-BXf0bkEs.js";
|
|
4
4
|
import "@incodetech/core";
|
|
5
|
-
import { O as
|
|
6
|
-
import { P as
|
|
7
|
-
import { r as
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { O as L } from "../otpInput-DdkvlvCS.js";
|
|
6
|
+
import { P as E } from "../page-BVHG3h0V.js";
|
|
7
|
+
import { r as S } from "../incodeModule-aE-LkKwM.js";
|
|
8
|
+
import "../uiConfig-Z6RT23Sl.js";
|
|
9
|
+
const I = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, V = ({
|
|
10
|
+
prefilledEmail: i,
|
|
10
11
|
emailError: a,
|
|
11
|
-
disabled:
|
|
12
|
-
onEmailChange:
|
|
12
|
+
disabled: d = !1,
|
|
13
|
+
onEmailChange: s
|
|
13
14
|
}) => {
|
|
14
|
-
const [
|
|
15
|
-
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
15
|
+
const [n, t] = f("");
|
|
16
|
+
k(() => {
|
|
17
|
+
if (i) {
|
|
18
|
+
t(i);
|
|
19
|
+
const u = I.test(i.trim());
|
|
20
|
+
s(i.trim(), u);
|
|
20
21
|
}
|
|
21
|
-
}, [
|
|
22
|
-
const
|
|
23
|
-
const l =
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
22
|
+
}, [i, s]);
|
|
23
|
+
const r = (u) => {
|
|
24
|
+
const l = u.target.value;
|
|
25
|
+
t(l);
|
|
26
|
+
const o = l.trim(), c = o.length > 0 && I.test(o);
|
|
27
|
+
s(o, c);
|
|
28
|
+
}, m = a ? "email-error" : void 0;
|
|
29
|
+
return /* @__PURE__ */ e("div", { class: "IncodeEmailInput", children: /* @__PURE__ */ e("div", { class: "IncodeEmailInputContainer", children: [
|
|
30
|
+
/* @__PURE__ */ e(
|
|
30
31
|
"div",
|
|
31
32
|
{
|
|
32
|
-
class: `IncodeEmailInputWrapper ${a ? "IncodeEmailInputWrapperError" : ""} ${
|
|
33
|
+
class: `IncodeEmailInputWrapper ${a ? "IncodeEmailInputWrapperError" : ""} ${d ? "IncodeEmailInputWrapperDisabled" : ""}`,
|
|
33
34
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ e("label", { for: "email-input", class: "IncodeEmailInputLabel", children: "Email" }),
|
|
36
|
+
/* @__PURE__ */ e(
|
|
36
37
|
"input",
|
|
37
38
|
{
|
|
38
39
|
id: "email-input",
|
|
39
40
|
type: "email",
|
|
40
|
-
value:
|
|
41
|
-
onInput:
|
|
41
|
+
value: n,
|
|
42
|
+
onInput: r,
|
|
42
43
|
placeholder: "Email",
|
|
43
|
-
disabled:
|
|
44
|
+
disabled: d,
|
|
44
45
|
class: "IncodeEmailInputField",
|
|
45
46
|
"data-testid": "email-input",
|
|
46
47
|
"aria-label": "Email address",
|
|
47
48
|
"aria-invalid": a ? "true" : "false",
|
|
48
|
-
"aria-describedby":
|
|
49
|
+
"aria-describedby": m,
|
|
49
50
|
autocomplete: "email"
|
|
50
51
|
}
|
|
51
52
|
)
|
|
52
53
|
]
|
|
53
54
|
}
|
|
54
55
|
),
|
|
55
|
-
a && /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
56
|
+
a && /* @__PURE__ */ e(w, { children: [
|
|
57
|
+
/* @__PURE__ */ e(g, { size: 8 }),
|
|
58
|
+
/* @__PURE__ */ e(
|
|
58
59
|
"p",
|
|
59
60
|
{
|
|
60
|
-
id:
|
|
61
|
+
id: m,
|
|
61
62
|
class: "IncodeEmailInputError",
|
|
62
63
|
"data-testid": "email-error",
|
|
63
64
|
role: "alert",
|
|
@@ -66,50 +67,50 @@ const g = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, C = ({
|
|
|
66
67
|
)
|
|
67
68
|
] })
|
|
68
69
|
] }) });
|
|
69
|
-
},
|
|
70
|
-
config:
|
|
70
|
+
}, R = ({
|
|
71
|
+
config: i,
|
|
71
72
|
manager: a,
|
|
72
|
-
onFinish:
|
|
73
|
-
onError:
|
|
73
|
+
onFinish: d,
|
|
74
|
+
onError: s
|
|
74
75
|
}) => {
|
|
75
|
-
const [t,
|
|
76
|
+
const { t: n } = O(), [t, r] = y(
|
|
76
77
|
() => {
|
|
77
78
|
if (a) return a;
|
|
78
|
-
if (!
|
|
79
|
+
if (!i)
|
|
79
80
|
throw new Error("Email config is required");
|
|
80
|
-
return
|
|
81
|
+
return P({ config: i });
|
|
81
82
|
},
|
|
82
83
|
{ manageLifecycle: !a }
|
|
83
|
-
), [m, u] =
|
|
84
|
+
), [m, u] = f(!1);
|
|
84
85
|
if (t.status === "idle" || t.status === "loadingPrefill" || t.status === "inputting" || t.status === "submitting" || t.status === "sendingOtp") {
|
|
85
|
-
const
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
|
|
86
|
+
const l = t.status === "idle" || t.status === "loadingPrefill" || t.status === "submitting" || t.status === "sendingOtp", o = t.status === "inputting" ? t.prefilledEmail : void 0, c = t.status === "inputting" ? t.emailError : void 0;
|
|
87
|
+
return /* @__PURE__ */ e(
|
|
88
|
+
E,
|
|
88
89
|
{
|
|
89
90
|
className: "IncodeEmailPage",
|
|
90
|
-
title: "
|
|
91
|
-
subtitle:
|
|
91
|
+
title: n("otp.enterCodeEmail"),
|
|
92
|
+
subtitle: i.otpVerification ? n("email.willSendCode") : void 0,
|
|
92
93
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
94
|
+
/* @__PURE__ */ e(
|
|
95
|
+
V,
|
|
95
96
|
{
|
|
96
|
-
prefilledEmail:
|
|
97
|
-
emailError:
|
|
98
|
-
disabled:
|
|
99
|
-
onEmailChange: (
|
|
100
|
-
|
|
97
|
+
prefilledEmail: o,
|
|
98
|
+
emailError: c,
|
|
99
|
+
disabled: l,
|
|
100
|
+
onEmailChange: (h, p) => {
|
|
101
|
+
r.setEmail(h, p), u(p);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
105
|
+
/* @__PURE__ */ e(g, {}),
|
|
106
|
+
/* @__PURE__ */ e(
|
|
107
|
+
C,
|
|
107
108
|
{
|
|
108
|
-
onClick: () =>
|
|
109
|
+
onClick: () => r.submit(),
|
|
109
110
|
disabled: !m,
|
|
110
|
-
isLoading:
|
|
111
|
+
isLoading: l,
|
|
111
112
|
"data-testid": "email-submit",
|
|
112
|
-
children: "
|
|
113
|
+
children: n("common.continue")
|
|
113
114
|
}
|
|
114
115
|
)
|
|
115
116
|
]
|
|
@@ -117,44 +118,44 @@ const g = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, C = ({
|
|
|
117
118
|
);
|
|
118
119
|
}
|
|
119
120
|
if (t.status === "awaitingOtp" || t.status === "verifyingOtp" || t.status === "otpError") {
|
|
120
|
-
const
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
|
|
121
|
+
const l = t.status === "verifyingOtp";
|
|
122
|
+
return /* @__PURE__ */ e(
|
|
123
|
+
E,
|
|
123
124
|
{
|
|
124
125
|
className: "IncodeEmailPage IncodeEmailOtpPage",
|
|
125
|
-
title: "
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
|
|
126
|
+
title: n("otp.enterCodeEmail"),
|
|
127
|
+
children: /* @__PURE__ */ e(
|
|
128
|
+
L,
|
|
128
129
|
{
|
|
129
130
|
resendTimer: t.status === "awaitingOtp" ? t.resendTimer : 0,
|
|
130
131
|
canResend: t.status === "awaitingOtp" ? t.canResend : !1,
|
|
131
|
-
error: t.status === "otpError" ? t.error : void 0,
|
|
132
|
-
onSubmit: (
|
|
133
|
-
onResend: () =>
|
|
134
|
-
onBack: () =>
|
|
135
|
-
backLinkText: "
|
|
136
|
-
isLoading:
|
|
132
|
+
error: t.status === "otpError" ? n(t.error) : void 0,
|
|
133
|
+
onSubmit: (o) => r.submitOtp(o),
|
|
134
|
+
onResend: () => r.resendOtp(),
|
|
135
|
+
onBack: () => r.back(),
|
|
136
|
+
backLinkText: "otp.changeEmail",
|
|
137
|
+
isLoading: l
|
|
137
138
|
}
|
|
138
139
|
)
|
|
139
140
|
}
|
|
140
141
|
);
|
|
141
142
|
}
|
|
142
|
-
return t.status === "finished" ? (
|
|
143
|
-
},
|
|
144
|
-
config:
|
|
143
|
+
return t.status === "finished" ? (d?.(), null) : (t.status === "error" && s?.(t.error), null);
|
|
144
|
+
}, T = ({
|
|
145
|
+
config: i,
|
|
145
146
|
manager: a,
|
|
146
|
-
onFinish:
|
|
147
|
-
onError:
|
|
148
|
-
}) => /* @__PURE__ */
|
|
149
|
-
|
|
147
|
+
onFinish: d,
|
|
148
|
+
onError: s
|
|
149
|
+
}) => /* @__PURE__ */ e(v, { children: i ? /* @__PURE__ */ e(
|
|
150
|
+
R,
|
|
150
151
|
{
|
|
151
|
-
config:
|
|
152
|
+
config: i,
|
|
152
153
|
manager: a,
|
|
153
|
-
onFinish:
|
|
154
|
-
onError:
|
|
154
|
+
onFinish: d,
|
|
155
|
+
onError: s
|
|
155
156
|
}
|
|
156
157
|
) : null });
|
|
157
|
-
|
|
158
|
+
S(T, "incode-email");
|
|
158
159
|
export {
|
|
159
|
-
|
|
160
|
+
T as Email
|
|
160
161
|
};
|