@incodetech/web 0.0.0-dev-20260320-c9bdba0 → 0.0.0-dev-20260320-b29aeee

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.
@@ -10,7 +10,7 @@ import { D as ee } from "./dropdownComposed-Cg6lQD2C.js";
10
10
  import { P as T } from "./page-Dv0s0RPn.js";
11
11
  import { S as re } from "./spinner-BbVGMG-G.js";
12
12
  import { r as oe } from "./incodeModule-aE-LkKwM.js";
13
- import { P as te } from "./phoneInputComposed-DNfU__MR.js";
13
+ import { P as te } from "./phoneInputComposed-DKesjaq0.js";
14
14
  const ae = ({ config: p, onFinish: s }) => {
15
15
  const { t: l } = $(), [a, d] = G(() => z({ config: p }));
16
16
  return q(() => {
@@ -10,8 +10,8 @@ import { F as J, V as K } from "./formField-hlgxOSE6.js";
10
10
  import { a as Q, C as X, c as Y, b as Z, e as _, d as $, H as aa, L as ea, P as ra } from "./captureFooter-SNtyUXrI.js";
11
11
  import { I as ta, a as sa } from "./inputComposed-CyGtRLzv.js";
12
12
  import { O as pa } from "./otpInput-B3iNW8b5.js";
13
- import { C as ia, g as ua, h as la, b as da, d as ma, I as Ca, e as fa, F as Ia, c as xa, S as ha, T as ga, a as ya, f as Ta, V as Sa } from "./flipAnimation-CnXEIDH1.js";
14
- import { P as Ba } from "./phoneInputComposed-DNfU__MR.js";
13
+ import { C as ia, g as ua, h as la, b as da, d as ma, I as Ca, e as fa, F as Ia, c as xa, S as ha, T as ga, a as ya, f as Ta, V as Sa } from "./flipAnimation-DLpjmTf-.js";
14
+ import { P as Ba } from "./phoneInputComposed-DKesjaq0.js";
15
15
  import { D as Pa, S as La } from "./dropdownComposed-Cg6lQD2C.js";
16
16
  import { C as Ha, D as Ma } from "./dateInputComposed-C8WTSu9L.js";
17
17
  import { A as i, y as u, q as l } from "./vendor-preact-BXf0bkEs.js";
@@ -8,7 +8,7 @@ import { L as A, B as d1 } from "./manualCaptureButton-iYqQECzn.js";
8
8
  import "@incodetech/core";
9
9
  import "./inputComposed-CyGtRLzv.js";
10
10
  import { E as K } from "./errorIcon-bIXk9nAy.js";
11
- import "./phoneInputComposed-DNfU__MR.js";
11
+ import "./phoneInputComposed-DKesjaq0.js";
12
12
  import "./dateInputComposed-C8WTSu9L.js";
13
13
  import { S as C1 } from "./successIcon-DN8LMqE2.js";
14
14
  import "./countries-DfLkrF0x.js";
@@ -2000,7 +2000,7 @@ const Pe = () => import("../id/id.es.js").then((e) => e.Id), ke = {
2000
2000
  (e) => e.GovernmentValidation
2001
2001
  ),
2002
2002
  GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
2003
- EXTERNAL_VERIFICATION: () => import("../ekycModule-DEMkVZr2.js").then((e) => e.EkycModule),
2003
+ EXTERNAL_VERIFICATION: () => import("../ekycModule-CXSChoV-.js").then((e) => e.EkycModule),
2004
2004
  EKYB: () => import("../ekybModule-DtMbgF08.js").then((e) => e.EkybModule),
2005
2005
  DOCUMENT_CAPTURE: () => import("../documentCapture-DWNK3phM.js").then(
2006
2006
  (e) => e.DocumentCapture
package/dist/id/id.es.js CHANGED
@@ -5,7 +5,7 @@ import "@incodetech/core";
5
5
  import { P as c } from "../manualCaptureButton-iYqQECzn.js";
6
6
  import { r as p } from "../incodeModule-aE-LkKwM.js";
7
7
  import { P as l } from "../processing-BhY0-0xy.js";
8
- import { d as f, c as I, F as a, b as g, e as h, I as C } from "../flipAnimation-CnXEIDH1.js";
8
+ import { d as f, c as I, F as a, b as g, e as h, I as C } from "../flipAnimation-DLpjmTf-.js";
9
9
  import "../uiConfig-Z6RT23Sl.js";
10
10
  import "../spinner-BbVGMG-G.js";
11
11
  const F = ({
@@ -1,184 +1,198 @@
1
- import { u as t } from "./button-zCdeDeEB.js";
2
- import { D as J, d as b, A as x, T as f, y as Q, q as A } from "./vendor-preact-BXf0bkEs.js";
3
- import { w as X, g as C, c as j, b as z } from "./countries-DfLkrF0x.js";
4
- import { D as k } from "./dropdownComposed-Cg6lQD2C.js";
1
+ import { u as r } from "./button-zCdeDeEB.js";
2
+ import { D as J, d as L, A as x, T as M, y as Q, q as A } from "./vendor-preact-BXf0bkEs.js";
3
+ import { w as X, g as I, c as j, b as k } from "./countries-DfLkrF0x.js";
4
+ import { D as z } from "./dropdownComposed-Cg6lQD2C.js";
5
5
  import { E as q } from "./errorIcon-bIXk9nAy.js";
6
6
  import { S as _ } from "./successIcon-DN8LMqE2.js";
7
7
  import { a as e2 } from "./inputComposed-CyGtRLzv.js";
8
- import { P as o2, p as L, A as y } from "./AsYouType-D1H_js4X.js";
9
- function n2(n, r, s) {
10
- if (r[n])
11
- return new o2(n, r[n], s);
8
+ import { P as n2, p as b, A as g } from "./AsYouType-D1H_js4X.js";
9
+ function o2(e, o, a) {
10
+ if (o[e])
11
+ return new n2(e, o[e], a);
12
12
  }
13
13
  function t2() {
14
- return X(n2, arguments);
14
+ return X(o2, arguments);
15
15
  }
16
16
  const r2 = { AC: "40123", AD: "312345", AE: "501234567", AF: "701234567", AG: "2684641234", AI: "2642351234", AL: "672123456", AM: "77123456", AO: "923123456", AR: "91123456789", AS: "6847331234", AT: "664123456", AU: "412345678", AW: "5601234", AX: "412345678", AZ: "401234567", BA: "61123456", BB: "2462501234", BD: "1812345678", BE: "470123456", BF: "70123456", BG: "43012345", BH: "36001234", BI: "79561234", BJ: "0195123456", BL: "690001234", BM: "4413701234", BN: "7123456", BO: "71234567", BQ: "3181234", BR: "11961234567", BS: "2423591234", BT: "17123456", BW: "71123456", BY: "294911911", BZ: "6221234", CA: "5062345678", CC: "412345678", CD: "991234567", CF: "70012345", CG: "061234567", CH: "781234567", CI: "0123456789", CK: "71234", CL: "221234567", CM: "671234567", CN: "13123456789", CO: "3211234567", CR: "83123456", CU: "51234567", CV: "9911234", CW: "95181234", CX: "412345678", CY: "96123456", CZ: "601123456", DE: "15123456789", DJ: "77831001", DK: "34412345", DM: "7672251234", DO: "8092345678", DZ: "551234567", EC: "991234567", EE: "51234567", EG: "1001234567", EH: "650123456", ER: "7123456", ES: "612345678", ET: "911234567", FI: "412345678", FJ: "7012345", FK: "51234", FM: "3501234", FO: "211234", FR: "612345678", GA: "06031234", GB: "7400123456", GD: "4734031234", GE: "555123456", GF: "694201234", GG: "7781123456", GH: "231234567", GI: "57123456", GL: "221234", GM: "3012345", GN: "601123456", GP: "690001234", GQ: "222123456", GR: "6912345678", GT: "51234567", GU: "6713001234", GW: "955012345", GY: "6091234", HK: "51234567", HN: "91234567", HR: "921234567", HT: "34101234", HU: "201234567", ID: "812345678", IE: "850123456", IL: "502345678", IM: "7924123456", IN: "8123456789", IO: "3801234", IQ: "7912345678", IR: "9123456789", IS: "6111234", IT: "3123456789", JE: "7797712345", JM: "8762101234", JO: "790123456", JP: "9012345678", KE: "712123456", KG: "700123456", KH: "91234567", KI: "72001234", KM: "3212345", KN: "8697652917", KP: "1921234567", KR: "1020000000", KW: "50012345", KY: "3453231234", KZ: "7710009998", LA: "2023123456", LB: "71123456", LC: "7582845678", LI: "660234567", LK: "712345678", LR: "770123456", LS: "50123456", LT: "61234567", LU: "628123456", LV: "21234567", LY: "912345678", MA: "650123456", MC: "612345678", MD: "62112345", ME: "60123456", MF: "690001234", MG: "321234567", MH: "2351234", MK: "72345678", ML: "65012345", MM: "92123456", MN: "88123456", MO: "66123456", MP: "6702345678", MQ: "696201234", MR: "22123456", MS: "6644923456", MT: "96961234", MU: "52512345", MV: "7712345", MW: "991234567", MX: "2221234567", MY: "123456789", MZ: "821234567", NA: "811234567", NC: "751234", NE: "93123456", NF: "381234", NG: "8021234567", NI: "81234567", NL: "612345678", NO: "40612345", NP: "9841234567", NR: "5551234", NU: "8884012", NZ: "211234567", OM: "92123456", PA: "61234567", PE: "912345678", PF: "87123456", PG: "70123456", PH: "9051234567", PK: "3012345678", PL: "512345678", PM: "551234", PR: "7872345678", PS: "599123456", PT: "912345678", PW: "6201234", PY: "961456789", QA: "33123456", RE: "692123456", RO: "712034567", RS: "601234567", RU: "9123456789", RW: "720123456", SA: "512345678", SB: "7421234", SC: "2510123", SD: "911231234", SE: "701234567", SG: "81234567", SH: "51234", SI: "31234567", SJ: "41234567", SK: "912123456", SL: "25123456", SM: "66661212", SN: "701234567", SO: "71123456", SR: "7412345", SS: "977123456", ST: "9812345", SV: "70123456", SX: "7215205678", SY: "944567890", SZ: "76123456", TA: "8999", TC: "6492311234", TD: "63012345", TG: "90112345", TH: "812345678", TJ: "917123456", TK: "7290", TL: "77212345", TM: "66123456", TN: "20123456", TO: "7715123", TR: "5012345678", TT: "8682911234", TV: "901234", TW: "912345678", TZ: "621234567", UA: "501234567", UG: "712345678", US: "2015550123", UY: "94231234", UZ: "912345678", VA: "3123456789", VC: "7844301234", VE: "4121234567", VG: "2843001234", VI: "3406421234", VN: "912345678", VU: "5912345", WF: "821234", WS: "7212345", XK: "43201234", YE: "712345678", YT: "639012345", ZA: "711234567", ZM: "955123456", ZW: "712345678" };
17
- function K(n, r, s) {
18
- return new y(s).input(`${r}${n}`).replace(r, "").trimStart();
17
+ function y(e, o, a) {
18
+ return new g(a).input(`${o}${e}`).replace(o, "").trimStart();
19
19
  }
20
- function s2(n) {
21
- const r = t2(n, r2);
22
- if (!r) return "";
23
- const s = `+${z(n)}`;
24
- return K(r.nationalNumber, s, n);
20
+ function s2(e, o) {
21
+ const a = e.replace(/\D/g, "");
22
+ if (a === o) return e;
23
+ if (!a.endsWith(o)) return null;
24
+ const s = a.length - o.length;
25
+ if (s <= 0) return e;
26
+ let i = 0;
27
+ for (let c = 0; c < e.length; c++)
28
+ if (/\d/.test(e[c]) && (i++, i === s))
29
+ return e.slice(c + 1).trimStart();
30
+ return e;
25
31
  }
26
- const a2 = J(
32
+ function a2(e) {
33
+ const o = t2(e, r2);
34
+ if (!o) return "";
35
+ const a = o.formatNational(), s = s2(a, o.nationalNumber);
36
+ if (s) return s;
37
+ const i = `+${k(e)}`;
38
+ return y(o.nationalNumber, i, e);
39
+ }
40
+ const c2 = J(
27
41
  ({
28
- id: n,
29
- label: r,
30
- countryCode: s = "US",
31
- value: l,
32
- placeholder: I,
33
- error: i,
42
+ id: e,
43
+ label: o,
44
+ countryCode: a = "US",
45
+ value: s,
46
+ placeholder: i,
47
+ error: c,
34
48
  helper: h,
35
- showErrorIcon: R,
36
- showHelperIcon: D,
49
+ showErrorIcon: D,
50
+ showHelperIcon: K,
37
51
  disabled: N = !1,
38
- disableCountrySelector: $ = !1,
52
+ disableCountrySelector: R = !1,
39
53
  required: P,
40
- onChange: M,
41
- "aria-labelledby": g,
54
+ onChange: S,
55
+ "aria-labelledby": $,
42
56
  "data-testid": W,
43
57
  ...F
44
58
  }, H) => {
45
- const [a, G] = b(s), [p, S] = b(""), T = x(!1), U = f(
46
- () => j.map((o) => ({
47
- value: o.code,
48
- label: `${o.emoji} ${o.callingCode} ${o.name}`
59
+ const [l, T] = L(a), [u, f] = L(""), G = x(!1), U = M(
60
+ () => j.map((t) => ({
61
+ value: t.code,
62
+ label: `${t.emoji} ${t.callingCode} ${t.name}`
49
63
  })),
50
64
  []
51
- ), c = f(
52
- () => C(a) ?? C("US"),
53
- [a]
54
- ), O = f(
55
- () => I ?? s2(a),
56
- [I, a]
65
+ ), d = M(
66
+ () => I(l) ?? I("US"),
67
+ [l]
68
+ ), O = M(
69
+ () => i ?? a2(l),
70
+ [i, l]
57
71
  );
58
72
  Q(() => {
59
- if (T.current || !l || !c) return;
60
- T.current = !0;
61
- const o = l.startsWith("+") ? l : `+${l}`, e = L(o);
62
- if (e?.isValid() && e.country) {
63
- e.country !== a && G(e.country);
64
- const d = new y(e.country);
65
- S(d.input(e.nationalNumber));
73
+ if (G.current || !s || !d) return;
74
+ G.current = !0;
75
+ const t = s.startsWith("+") ? s : `+${s}`, n = b(t);
76
+ if (n?.isValid() && n.country) {
77
+ n.country !== l && T(n.country);
78
+ const p = new g(n.country);
79
+ f(p.input(n.nationalNumber));
66
80
  }
67
- }, [l, c, a]);
68
- const u = A(
69
- (o, e) => {
70
- const d = `${e.callingCode}${o.replace(/\D/g, "")}`;
81
+ }, [s, d, l]);
82
+ const C = A(
83
+ (t, n) => {
84
+ const p = `${n.callingCode}${t.replace(/\D/g, "")}`;
71
85
  try {
72
- const Y = L(d, e.code);
73
- M?.(d, Y?.isValid() ?? !1);
86
+ const Y = b(p, n.code);
87
+ S?.(p, Y?.isValid() ?? !1);
74
88
  } catch {
75
- M?.(d, !1);
89
+ S?.(p, !1);
76
90
  }
77
91
  },
78
- [M]
92
+ [S]
79
93
  ), V = A(
80
- (o) => {
81
- G(o);
82
- const e = C(o);
83
- e && p && u(p, e);
94
+ (t) => {
95
+ T(t);
96
+ const n = I(t);
97
+ n && u && C(u, n);
84
98
  },
85
- [p, u]
99
+ [u, C]
86
100
  ), Z = A(
87
- (o) => {
88
- const e = o.target.value;
89
- if (!c) {
90
- S(e);
101
+ (t) => {
102
+ const n = t.target.value;
103
+ if (!d) {
104
+ f(n);
91
105
  return;
92
106
  }
93
- const d = K(
94
- e,
95
- c.callingCode,
96
- c.code
107
+ const p = y(
108
+ n,
109
+ d.callingCode,
110
+ d.code
97
111
  );
98
- S(d), u(e, c);
112
+ f(p), C(n, d);
99
113
  },
100
- [c, u]
101
- ), v = `${n}-country`, m = `${n}-phone`, E = `${m}-helper`, B = `${m}-error`, w = [h ? E : null, i ? B : null].filter(Boolean).join(" ");
102
- return /* @__PURE__ */ t("div", { class: "IncodePhoneInputComposed", children: [
103
- r && /* @__PURE__ */ t(
114
+ [d, C]
115
+ ), v = `${e}-country`, m = `${e}-phone`, E = `${m}-helper`, B = `${m}-error`, w = [h ? E : null, c ? B : null].filter(Boolean).join(" ");
116
+ return /* @__PURE__ */ r("div", { class: "IncodePhoneInputComposed", children: [
117
+ o && /* @__PURE__ */ r(
104
118
  "label",
105
119
  {
106
120
  class: "IncodePhoneInputComposedLabel",
107
121
  htmlFor: m,
108
- "data-testid": `${n}-label`,
122
+ "data-testid": `${e}-label`,
109
123
  children: [
110
- r,
111
- P && /* @__PURE__ */ t("span", { class: "IncodePhoneInputComposedRequired", children: " *" })
124
+ o,
125
+ P && /* @__PURE__ */ r("span", { class: "IncodePhoneInputComposedRequired", children: " *" })
112
126
  ]
113
127
  }
114
128
  ),
115
- /* @__PURE__ */ t(
116
- k,
129
+ /* @__PURE__ */ r(
130
+ z,
117
131
  {
118
132
  id: v,
119
133
  options: U,
120
- value: a,
134
+ value: l,
121
135
  onChange: V,
122
- disabled: N || $,
136
+ disabled: N || R,
123
137
  required: P,
124
138
  searchable: !0,
125
139
  searchPlaceholder: "Search countries...",
126
140
  suppressMessages: !0,
127
141
  "aria-label": "Select country code",
128
- renderSelectedLabel: (o) => {
129
- const e = C(o.value);
130
- return e ? `${e.emoji} ${e.callingCode}` : o.label;
142
+ renderSelectedLabel: (t) => {
143
+ const n = I(t.value);
144
+ return n ? `${n.emoji} ${n.callingCode}` : t.label;
131
145
  },
132
146
  class: "IncodePhoneInputComposedDropdown",
133
- siblingElement: /* @__PURE__ */ t(
147
+ siblingElement: /* @__PURE__ */ r(
134
148
  e2,
135
149
  {
136
150
  id: m,
137
151
  ref: H,
138
152
  type: "tel",
139
- value: p,
153
+ value: u,
140
154
  onInput: Z,
141
155
  placeholder: O,
142
- error: i,
156
+ error: c,
143
157
  disabled: N,
144
158
  required: P,
145
159
  suppressMessages: !0,
146
- "aria-label": r ? void 0 : "Phone number",
147
- "aria-labelledby": g,
160
+ "aria-label": o ? void 0 : "Phone number",
161
+ "aria-labelledby": $,
148
162
  "aria-describedby": w || void 0,
149
- "aria-invalid": i ? "true" : void 0,
163
+ "aria-invalid": c ? "true" : void 0,
150
164
  "data-testid": W,
151
165
  ...F
152
166
  }
153
167
  )
154
168
  }
155
169
  ),
156
- i && /* @__PURE__ */ t(
170
+ c && /* @__PURE__ */ r(
157
171
  "div",
158
172
  {
159
173
  class: "IncodePhoneInputComposedErrorWrapper",
160
- "data-testid": `${n}-error-wrapper`,
174
+ "data-testid": `${e}-error-wrapper`,
161
175
  children: [
162
- R && /* @__PURE__ */ t("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ t(q, { size: 16 }) }),
163
- /* @__PURE__ */ t("p", { id: B, class: "IncodePhoneInputComposedError", children: i })
176
+ D && /* @__PURE__ */ r("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ r(q, { size: 16 }) }),
177
+ /* @__PURE__ */ r("p", { id: B, class: "IncodePhoneInputComposedError", children: c })
164
178
  ]
165
179
  }
166
180
  ),
167
- h && !i && /* @__PURE__ */ t(
181
+ h && !c && /* @__PURE__ */ r(
168
182
  "div",
169
183
  {
170
184
  class: "IncodePhoneInputComposedHelperWrapper",
171
- "data-testid": `${n}-helper-wrapper`,
185
+ "data-testid": `${e}-helper-wrapper`,
172
186
  children: [
173
- D && /* @__PURE__ */ t("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ t(_, { size: 16 }) }),
174
- /* @__PURE__ */ t("p", { id: E, class: "IncodePhoneInputComposedHelper", children: h })
187
+ K && /* @__PURE__ */ r("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ r(_, { size: 16 }) }),
188
+ /* @__PURE__ */ r("p", { id: E, class: "IncodePhoneInputComposedHelper", children: h })
175
189
  ]
176
190
  }
177
191
  )
178
192
  ] });
179
193
  }
180
194
  );
181
- a2.displayName = "PhoneInputComposed";
195
+ c2.displayName = "PhoneInputComposed";
182
196
  export {
183
- a2 as P
197
+ c2 as P
184
198
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260320-c9bdba0",
3
+ "version": "0.0.0-dev-20260320-b29aeee",
4
4
  "type": "module",
5
5
  "main": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -119,7 +119,7 @@
119
119
  "preact-custom-element": "^4.6.0",
120
120
  "qrcode": "^1.5.4",
121
121
  "tailwindcss": "^4.1.17",
122
- "@incodetech/core": "0.0.0-dev-20260320-c9bdba0"
122
+ "@incodetech/core": "0.0.0-dev-20260320-b29aeee"
123
123
  },
124
124
  "devDependencies": {
125
125
  "@microsoft/api-extractor": "^7.53.3",