@incodetech/web 0.0.0-dev-20260316-0522f9e → 0.0.0-dev-20260317-ce5d28b

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 CHANGED
@@ -882,13 +882,66 @@
882
882
  font-family: inherit;
883
883
  display: inline-block;
884
884
  }
885
- .IncodePhoneInputComposed .IncodeDropdownComposedTrigger {
885
+ .IncodePhoneInputComposed {
886
+ width: 100%;
887
+ max-width: 420px;
888
+ position: relative;
889
+ }
890
+ .IncodePhoneInputComposedLabel {
891
+ margin: var(--spacing-0, var(--spacing-none, 0px));
892
+ margin-bottom: var(--spacing-8, var(--spacing-8, 8px));
893
+ font-family: var(--typography-label-family);
894
+ font-size: var(--typography-label-m-size);
895
+ font-weight: var(--typography-label-m-weight);
896
+ line-height: var(--typography-label-m-line-height);
897
+ letter-spacing: var(--typography-label-m-letter-spacing);
898
+ display: inline-block;
899
+ }
900
+ .IncodePhoneInputComposedRequired {
901
+ color: var(--color-input-text-helper-negative, var(--input-text-helper-negative));
902
+ }
903
+ .IncodePhoneInputComposedDropdown {
904
+ max-width: none;
905
+ }
906
+ .IncodePhoneInputComposedDropdown .IncodeDropdownComposedTrigger {
886
907
  flex-shrink: 0;
887
908
  width: auto;
909
+ min-width: 120px;
888
910
  }
889
- .IncodePhoneInputComposed .IncodeDropdownComposedSibling .IncodeInputComposed, .IncodePhoneInputComposed .IncodeDropdownComposedSibling .IncodeInput {
911
+ .IncodePhoneInputComposedDropdown .IncodeDropdownComposedSibling .IncodeInputComposed, .IncodePhoneInputComposedDropdown .IncodeDropdownComposedSibling .IncodeInput {
890
912
  max-width: none;
891
913
  }
914
+ .IncodePhoneInputComposedErrorWrapper, .IncodePhoneInputComposedHelperWrapper {
915
+ margin-top: var(--spacing-8, var(--spacing-8, 8px));
916
+ align-items: center;
917
+ display: flex;
918
+ }
919
+ .IncodePhoneInputComposedIconWrapper {
920
+ margin-right: var(--spacing-8, var(--spacing-8, 8px));
921
+ justify-content: center;
922
+ align-items: center;
923
+ display: flex;
924
+ }
925
+ .IncodePhoneInputComposedError {
926
+ margin: var(--spacing-0, var(--spacing-none, 0px));
927
+ font-family: var(--typography-body-family);
928
+ font-size: var(--typography-body-m-regular-size);
929
+ font-weight: var(--typography-body-m-regular-weight);
930
+ line-height: var(--typography-body-m-regular-line-height);
931
+ letter-spacing: var(--typography-body-m-regular-letter-spacing);
932
+ color: var(--color-input-text-helper-negative, var(--input-text-helper-negative));
933
+ display: inline-block;
934
+ }
935
+ .IncodePhoneInputComposedHelper {
936
+ margin: var(--spacing-0, var(--spacing-none, 0px));
937
+ font-family: var(--typography-body-family);
938
+ font-size: var(--typography-body-m-regular-size);
939
+ font-weight: var(--typography-body-m-regular-weight);
940
+ line-height: var(--typography-body-m-regular-line-height);
941
+ letter-spacing: var(--typography-body-m-regular-letter-spacing);
942
+ color: var(--color-input-text-helper-default, var(--input-text-helper-default));
943
+ display: inline-block;
944
+ }
892
945
  .IncodeOtpInput {
893
946
  flex-direction: column;
894
947
  flex: 1;
@@ -9,7 +9,7 @@ import { D as O } from "./dateInputComposed-CvFmQpJ0.js";
9
9
  import { D as z } from "./dropdownComposed-DBm7cotT.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-B1gXoSzr.js";
12
+ import { P as J } from "./phoneInputComposed-D0oBe-el.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(() => {
@@ -12,7 +12,7 @@ import { D as Oe, a as Re, I as We, S as je } from "./dropdownComposed-DBm7cotT.
12
12
  import { O as $e } from "./otpInput-cazUY73p.js";
13
13
  import { D as E, d as O, A as R, y as W, q as j } from "./vendor-preact-BXf0bkEs.js";
14
14
  import { E as U } from "./errorIcon-BL647nVh.js";
15
- import { P as Ae } from "./phoneInputComposed-B1gXoSzr.js";
15
+ import { P as Ae } from "./phoneInputComposed-D0oBe-el.js";
16
16
  import { C as ze, D as Ge } from "./dateInputComposed-CvFmQpJ0.js";
17
17
  import { B as Ke, L as Qe, P as Xe } from "./permissions-DwF2Ez1N.js";
18
18
  import { C as _e } from "./chevronDown-BUaOuf9J.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-CmD1wsRS.js").then((e) => e.EkycModule),
2003
+ EXTERNAL_VERIFICATION: () => import("../ekycModule-fxKjsL1i.js").then((e) => e.EkycModule),
2004
2004
  EKYB: () => import("../ekybModule-CV7jE8qz.js").then((e) => e.EkybModule),
2005
2005
  DOCUMENT_CAPTURE: () => import("../documentCapture-PdKA2frR.js").then(
2006
2006
  (e) => e.DocumentCapture
@@ -0,0 +1,159 @@
1
+ import { u as n } from "./button-Ca1tRSTI.js";
2
+ import { D as Y, d as S, A as k, T as D, y as q, q as y } from "./vendor-preact-BXf0bkEs.js";
3
+ import { g as u, c as G } from "./countries-C9bhJe4u.js";
4
+ import { D as J, I as K } from "./dropdownComposed-DBm7cotT.js";
5
+ import { E as Q } from "./errorIcon-BL647nVh.js";
6
+ import { S as X } from "./successIcon-BybULRRU.js";
7
+ import { A as E, p as W } from "./AsYouType-CpH-Rmtj.js";
8
+ const Z = Y(
9
+ ({
10
+ id: a,
11
+ label: m,
12
+ countryCode: A = "US",
13
+ value: c,
14
+ placeholder: N = "(123) 123-6789",
15
+ error: r,
16
+ helper: h,
17
+ showErrorIcon: j,
18
+ showHelperIcon: B,
19
+ disabled: P = !1,
20
+ disableCountrySelector: L = !1,
21
+ required: I,
22
+ onChange: f,
23
+ "aria-labelledby": T,
24
+ "data-testid": x,
25
+ ...z
26
+ }, F) => {
27
+ const [d, b] = S(A), [l, C] = S(""), $ = k(!1), H = D(
28
+ () => G.map((o) => ({
29
+ value: o.code,
30
+ label: `${o.emoji} ${o.callingCode} ${o.name}`
31
+ })),
32
+ []
33
+ ), t = D(
34
+ () => u(d) ?? u("US"),
35
+ [d]
36
+ );
37
+ q(() => {
38
+ if ($.current || !c || !t) return;
39
+ $.current = !0;
40
+ const o = c.startsWith("+") ? c : `+${c}`, e = W(o);
41
+ if (e?.isValid() && e.country) {
42
+ e.country !== d && b(e.country);
43
+ const s = new E(e.country);
44
+ C(s.input(e.nationalNumber));
45
+ }
46
+ }, [c, t, d]);
47
+ const p = y(
48
+ (o, e) => {
49
+ const s = `${e.callingCode}${o.replace(/\D/g, "")}`;
50
+ try {
51
+ const w = W(s, e.code);
52
+ f?.(s, w?.isValid() ?? !1);
53
+ } catch {
54
+ f?.(s, !1);
55
+ }
56
+ },
57
+ [f]
58
+ ), M = y(
59
+ (o) => {
60
+ b(o);
61
+ const e = u(o);
62
+ e && l && p(l, e);
63
+ },
64
+ [l, p]
65
+ ), U = y(
66
+ (o) => {
67
+ const e = o.target.value;
68
+ if (!t) {
69
+ C(e);
70
+ return;
71
+ }
72
+ const s = `${t.callingCode}${e}`, R = new E(t.code).input(s).replace(t.callingCode, "").trimStart();
73
+ C(R), p(e, t);
74
+ },
75
+ [t, p]
76
+ ), V = `${a}-country`, i = `${a}-phone`, g = `${i}-helper`, v = `${i}-error`, O = [h ? g : null, r ? v : null].filter(Boolean).join(" ");
77
+ return /* @__PURE__ */ n("div", { class: "IncodePhoneInputComposed", children: [
78
+ m && /* @__PURE__ */ n(
79
+ "label",
80
+ {
81
+ class: "IncodePhoneInputComposedLabel",
82
+ htmlFor: i,
83
+ "data-testid": `${a}-label`,
84
+ children: [
85
+ m,
86
+ I && /* @__PURE__ */ n("span", { class: "IncodePhoneInputComposedRequired", children: " *" })
87
+ ]
88
+ }
89
+ ),
90
+ /* @__PURE__ */ n(
91
+ J,
92
+ {
93
+ id: V,
94
+ options: H,
95
+ value: d,
96
+ onChange: M,
97
+ disabled: P || L,
98
+ required: I,
99
+ searchable: !0,
100
+ searchPlaceholder: "Search countries...",
101
+ suppressMessages: !0,
102
+ "aria-label": "Select country code",
103
+ renderSelectedLabel: (o) => {
104
+ const e = u(o.value);
105
+ return e ? `${e.emoji} ${e.callingCode}` : o.label;
106
+ },
107
+ class: "IncodePhoneInputComposedDropdown",
108
+ siblingElement: /* @__PURE__ */ n(
109
+ K,
110
+ {
111
+ id: i,
112
+ ref: F,
113
+ type: "tel",
114
+ value: l,
115
+ onInput: U,
116
+ placeholder: N,
117
+ error: r,
118
+ disabled: P,
119
+ required: I,
120
+ suppressMessages: !0,
121
+ "aria-label": m ? void 0 : "Phone number",
122
+ "aria-labelledby": T,
123
+ "aria-describedby": O || void 0,
124
+ "aria-invalid": r ? "true" : void 0,
125
+ "data-testid": x,
126
+ ...z
127
+ }
128
+ )
129
+ }
130
+ ),
131
+ r && /* @__PURE__ */ n(
132
+ "div",
133
+ {
134
+ class: "IncodePhoneInputComposedErrorWrapper",
135
+ "data-testid": `${a}-error-wrapper`,
136
+ children: [
137
+ j && /* @__PURE__ */ n("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ n(Q, { size: 16 }) }),
138
+ /* @__PURE__ */ n("p", { id: v, class: "IncodePhoneInputComposedError", children: r })
139
+ ]
140
+ }
141
+ ),
142
+ h && !r && /* @__PURE__ */ n(
143
+ "div",
144
+ {
145
+ class: "IncodePhoneInputComposedHelperWrapper",
146
+ "data-testid": `${a}-helper-wrapper`,
147
+ children: [
148
+ B && /* @__PURE__ */ n("div", { class: "IncodePhoneInputComposedIconWrapper", children: /* @__PURE__ */ n(X, { size: 16 }) }),
149
+ /* @__PURE__ */ n("p", { id: g, class: "IncodePhoneInputComposedHelper", children: h })
150
+ ]
151
+ }
152
+ )
153
+ ] });
154
+ }
155
+ );
156
+ Z.displayName = "PhoneInputComposed";
157
+ export {
158
+ Z as P
159
+ };
@@ -513,19 +513,27 @@ declare type PermissionsProps = {
513
513
  permissionStatus: PermissionStatus_2;
514
514
  };
515
515
 
516
- export declare const PhoneInputComposed: FC<PhoneInputComposedProps>;
516
+ export declare const PhoneInputComposed: FunctionalComponent<PropsWithoutRef<PhoneInputComposedProps> & {
517
+ ref?: Ref<HTMLInputElement> | undefined;
518
+ }>;
517
519
 
518
- declare type PhoneInputComposedProps = {
520
+ declare type PhoneInputComposedProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'id' | 'onChange' | 'class'> & PhoneInputOwnProps;
521
+
522
+ declare type PhoneInputOwnProps = {
519
523
  id: string;
520
524
  label?: string;
521
525
  countryCode?: string;
522
526
  value?: string;
523
527
  placeholder?: string;
524
528
  error?: string;
529
+ helper?: string;
530
+ showErrorIcon?: boolean;
531
+ showHelperIcon?: boolean;
525
532
  disabled?: boolean;
526
533
  disableCountrySelector?: boolean;
527
534
  required?: boolean;
528
535
  onChange?: (fullNumber: string, isValid: boolean) => void;
536
+ 'aria-labelledby'?: string;
529
537
  'data-testid'?: string;
530
538
  };
531
539
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260316-0522f9e",
3
+ "version": "0.0.0-dev-20260317-ce5d28b",
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-20260316-0522f9e"
122
+ "@incodetech/core": "0.0.0-dev-20260317-ce5d28b"
123
123
  },
124
124
  "devDependencies": {
125
125
  "@microsoft/api-extractor": "^7.53.3",
@@ -1,107 +0,0 @@
1
- import { u as $ } from "./button-Ca1tRSTI.js";
2
- import { d as g, A as q, T as I, y as B, q as u } from "./vendor-preact-BXf0bkEs.js";
3
- import { c as E, g as l } from "./countries-C9bhJe4u.js";
4
- import { I as F, D as M } from "./dropdownComposed-DBm7cotT.js";
5
- import { p as P, A as b } from "./AsYouType-CpH-Rmtj.js";
6
- const H = ({
7
- id: p,
8
- label: w,
9
- countryCode: S = "US",
10
- value: r,
11
- placeholder: A = "(123) 123-6789",
12
- error: m,
13
- disabled: f = !1,
14
- disableCountrySelector: D = !1,
15
- required: N,
16
- onChange: d,
17
- "data-testid": T
18
- }) => {
19
- const [s, h] = g(S), [a, i] = g(""), y = q(!1), j = I(
20
- () => E.map((t) => ({
21
- value: t.code,
22
- label: `${t.emoji} ${t.callingCode} ${t.name}`
23
- })),
24
- []
25
- ), o = I(
26
- () => l(s) ?? l("US"),
27
- [s]
28
- );
29
- B(() => {
30
- if (y.current || !r || !o) return;
31
- y.current = !0;
32
- const t = r.startsWith("+") ? r : `+${r}`, e = P(t);
33
- if (e?.isValid() && e.country) {
34
- e.country !== s && h(e.country);
35
- const n = new b(e.country);
36
- i(n.input(e.nationalNumber));
37
- }
38
- }, [r, o, s]);
39
- const c = u(
40
- (t, e) => {
41
- const n = `${e.callingCode}${t.replace(/\D/g, "")}`;
42
- try {
43
- const C = P(n, e.code);
44
- d?.(n, C?.isValid() ?? !1);
45
- } catch {
46
- d?.(n, !1);
47
- }
48
- },
49
- [d]
50
- ), v = u(
51
- (t) => {
52
- h(t);
53
- const e = l(t);
54
- e && a && c(a, e);
55
- },
56
- [a, c]
57
- ), x = u(
58
- (t) => {
59
- const e = t.target.value;
60
- if (!o) {
61
- i(e);
62
- return;
63
- }
64
- const n = `${o.callingCode}${e}`, V = new b(o.code).input(n).replace(o.callingCode, "").trimStart();
65
- i(V), c(e, o);
66
- },
67
- [o, c]
68
- ), L = `${p}-country`, U = `${p}-phone`;
69
- return /* @__PURE__ */ $(
70
- M,
71
- {
72
- id: L,
73
- label: w,
74
- options: j,
75
- value: s,
76
- onChange: v,
77
- error: m,
78
- disabled: f || D,
79
- required: N,
80
- searchable: !0,
81
- searchPlaceholder: "Search countries...",
82
- renderSelectedLabel: (t) => {
83
- const e = l(t.value);
84
- return e ? `${e.emoji} ${e.callingCode}` : t.label;
85
- },
86
- class: "IncodePhoneInputComposed",
87
- siblingElement: /* @__PURE__ */ $(
88
- F,
89
- {
90
- id: U,
91
- type: "tel",
92
- value: a,
93
- onInput: x,
94
- placeholder: A,
95
- error: m,
96
- disabled: f,
97
- suppressMessages: !0,
98
- "aria-label": "Phone number",
99
- "data-testid": T
100
- }
101
- )
102
- }
103
- );
104
- };
105
- export {
106
- H as P
107
- };