@incodetech/web 0.0.0-dev-20260608-c8c427ca → 0.0.0-dev-20260608-fe5ac64f

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.
Files changed (206) hide show
  1. package/dist/ae-signature/ae-signature.es.js +15 -13
  2. package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
  3. package/dist/antifraud/antifraud.es.js +22 -19
  4. package/dist/authentication/authentication.es.js +42 -33
  5. package/dist/autoFocusTitle-DM6PvgcP.js +29 -0
  6. package/dist/{back-horizontal-hint-DsPhKbR4.js → back-horizontal-hint-BXYix0Wj.js} +26 -26
  7. package/dist/back-tutorial-vb1MxlrT.js +14597 -0
  8. package/dist/{back-vertical-hint-BFJbYQrX.js → back-vertical-hint-DNSh6JNH.js} +27 -27
  9. package/dist/backdevicelottie-HypPqBz7.js +16690 -0
  10. package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
  11. package/dist/bottomSheet-BuzqNQtG.js +39 -0
  12. package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
  13. package/dist/button-B-qlr4iI.js +35 -0
  14. package/dist/checkbox-CTPETqo5.js +96 -0
  15. package/dist/consent/consent.es.js +75 -64
  16. package/dist/countrySelector-CzyuaDIs.js +60 -0
  17. package/dist/cpf-ocr/cpf-ocr.es.js +2 -2
  18. package/dist/cpfOcr-7DkO3a4-.js +92 -0
  19. package/dist/cpfOcr-BrpGqevl.js +2 -0
  20. package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -17
  21. package/dist/curp-validation/curp-validation.es.js +246 -211
  22. package/dist/customFields-CJxcEDgu.js +140 -0
  23. package/dist/customWatchlist-BvfsU7r-.js +36 -0
  24. package/dist/dateInputComposed-BsPQHG5o.js +1 -0
  25. package/dist/dateInputComposed-DY97tQVK.js +69 -0
  26. package/dist/defineProperty-mefzVtTv.js +39 -0
  27. package/dist/document-capture/document-capture.es.js +2 -2
  28. package/dist/documentCapture-CQSmWEdd.js +876 -0
  29. package/dist/documentCapture-r1zYPBgS.js +2 -0
  30. package/dist/dropdownComposed-BF4L-7mJ.js +380 -0
  31. package/dist/dropdownComposed-mvHuRFHn.js +1 -0
  32. package/dist/dynamicForms-DranXtuE.js +352 -0
  33. package/dist/ekyb/ekyb.es.js +2 -2
  34. package/dist/ekybModule-DOOUw8h0.js +2 -0
  35. package/dist/ekybModule-DSOvdViS.js +279 -0
  36. package/dist/ekyc/ekyc.es.js +2 -2
  37. package/dist/ekycModule-BYHmHRia.js +2 -0
  38. package/dist/ekycModule-DtzcD2wV.js +257 -0
  39. package/dist/electronic-signature/electronic-signature.es.js +2 -2
  40. package/dist/electronic-signature-B0SDITm5.js +426 -0
  41. package/dist/email/email.es.js +198 -78
  42. package/dist/emailInput-D8qiAdjn.js +39 -0
  43. package/dist/errorIcon-B0rmz3rw.js +26 -0
  44. package/dist/expiredId-Du3HsBaI.js +85 -0
  45. package/dist/extensibility-FK5oOsIJ.js +3070 -0
  46. package/dist/extensibility.es.js +26 -26
  47. package/dist/face-match/face-match.es.js +2 -2
  48. package/dist/faceMatch-C0UL_xA7.js +2 -0
  49. package/dist/faceMatch-DJMba1pt.js +343 -0
  50. package/dist/field-comparison/field-comparison.es.js +2 -2
  51. package/dist/fieldComparison-CcJA6KR5.js +88 -0
  52. package/dist/fieldComparison-CvnNOIWA.js +2 -0
  53. package/dist/{flip-animation-CuQ57qTn.js → flip-animation-BGRvygw9.js} +4221 -4221
  54. package/dist/flow/flow.es.js +597 -493
  55. package/dist/{front-horizontal-hint-CKm7PnmS.js → front-horizontal-hint-CLSU0iVo.js} +70 -70
  56. package/dist/{front-vertical-hint-CLHC2qoH.js → front-vertical-hint-BWq-yWQ8.js} +81 -81
  57. package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
  58. package/dist/geolocation/geolocation.es.js +485 -395
  59. package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
  60. package/dist/governmentValidation/governmentValidation.es.js +67 -59
  61. package/dist/homeScreen-BsEYyiDB.js +264 -0
  62. package/dist/hooks-BtgmGvba.js +149 -0
  63. package/dist/i18n-gTHArCl9.js +2971 -0
  64. package/dist/icons-DKY3xDkf.js +360 -0
  65. package/dist/id/id.es.js +565 -413
  66. package/dist/id-laser-h-DX8UbVNH.js +467 -0
  67. package/dist/id-laser-v-DhnHdjlB.js +490 -0
  68. package/dist/id-tutorial-lj4iKtYT.js +13165 -0
  69. package/dist/id-verification/id-verification.es.js +21 -18
  70. package/dist/idOcr-CfqkKAZH.js +123 -0
  71. package/dist/identity-reuse/identity-reuse.es.js +168 -130
  72. package/dist/incode-logo-57XFniXU.js +4 -0
  73. package/dist/incodeComponent-CDJxFZvS.js +63 -0
  74. package/dist/incodeModule-DkA_yd0X.js +13 -0
  75. package/dist/index.es.js +16 -14
  76. package/dist/inputComposed-5V2nLTqH.js +99 -0
  77. package/dist/inputComposed-BPOYwUBl.js +1 -0
  78. package/dist/loadingIcon-DN62ugKs.js +148 -0
  79. package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
  80. package/dist/mandatoryConsent-DxL7lmfQ.js +107 -0
  81. package/dist/modal-B5QeulDu.js +153 -0
  82. package/dist/modal.hooks-C7K9k_pY.js +202 -0
  83. package/dist/numberedStep-DVAyTPv1.js +13 -0
  84. package/dist/optionAccessibleLabel-Czc2YC8z.js +202 -0
  85. package/dist/otpInput-2IQ-JCK8.js +195 -0
  86. package/dist/page-6bCuq5Q6.js +70 -0
  87. package/dist/{passport-horizontal-hint-C_le0HVU.js → passport-horizontal-hint-DfVsf4Cc.js} +55 -55
  88. package/dist/{passport-tutorial-BYN4T_TE.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
  89. package/dist/{passport-vertical-hint-H-pyICSv.js → passport-vertical-hint-DVxbTyQp.js} +49 -49
  90. package/dist/pdf-BZA70WbM.js +22398 -0
  91. package/dist/pdfViewer-Dr63sJ51.js +114 -0
  92. package/dist/phone/phone.es.js +214 -87
  93. package/dist/phoneInputComposed-D_IabWKJ.js +12142 -0
  94. package/dist/processing-B_u8wUB7.js +8 -0
  95. package/dist/qe-signature/qe-signature.es.js +15 -13
  96. package/dist/radioGroupComposed-DwYW-Ld-.js +215 -0
  97. package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2099 -859
  98. package/dist/registerIncodeElement-BJJGzVdq.js +11 -0
  99. package/dist/requiredLabelHint-DEadtiwx.js +17 -0
  100. package/dist/richText-C7GUm0WL.js +3153 -0
  101. package/dist/rolldown-runtime--E5BIlTp.js +33 -0
  102. package/dist/selfie/selfie.es.js +54 -42
  103. package/dist/selfieTutorial-CtruLyO2.js +2689 -0
  104. package/dist/signature/signature.es.js +765 -406
  105. package/dist/snackbar-Dz9crm39.js +16 -0
  106. package/dist/spinner-BfBIZkDQ.js +42 -0
  107. package/dist/spinner-DEDtE7Pz.js +1 -0
  108. package/dist/statusPage-B1Ef7J5K.js +28 -0
  109. package/dist/successIcon-rmzr-pxu.js +30 -0
  110. package/dist/tabs--UMd6eEB.js +103 -0
  111. package/dist/transitionSpinner-CWhGcr7c.js +26 -0
  112. package/dist/{tutorial-QzQ536BL.js → tutorial-y-nq6ZhF.js} +832 -578
  113. package/dist/types/index.d.ts +13 -4
  114. package/dist/typography-BK4AmfKX.js +45 -0
  115. package/dist/uiConfig-sgEkFuuA.js +25 -0
  116. package/dist/useModuleLoader-8LslB-YG.js +670 -0
  117. package/dist/vendor-preact-BH7vOa2r.js +957 -0
  118. package/dist/verificationResult-CbVRf6Kh.js +91 -0
  119. package/dist/verifiedByIncode-8QBn-kgZ.js +103 -0
  120. package/dist/watchlist/watchlist.es.js +31 -26
  121. package/dist/watchlistForBusiness-Dfn1UMow.js +80 -0
  122. package/dist/workflow/workflow.es.js +251 -209
  123. package/package.json +4 -2
  124. package/dist/aligndevicelottie-D8KsO77t.js +0 -12757
  125. package/dist/autoFocusTitle-BpYdaSUM.js +0 -16
  126. package/dist/back-tutorial-DhSE2FJo.js +0 -14585
  127. package/dist/backdevicelottie-CJWGVMdw.js +0 -16678
  128. package/dist/blurdevicelottie-Dxt2deEB.js +0 -15939
  129. package/dist/bottomSheet-QrpyatOD.js +0 -31
  130. package/dist/browser-ponyfill-Crda_c5R.js +0 -299
  131. package/dist/button-DcCUEn2n.js +0 -24
  132. package/dist/checkbox-DCCzBAuF.js +0 -86
  133. package/dist/countrySelector-CJ8egQ4C.js +0 -58
  134. package/dist/cpfOcr-Db06i-Lm.js +0 -2
  135. package/dist/cpfOcr-FixhUeMQ.js +0 -79
  136. package/dist/customFields-C1G9xHNX.js +0 -125
  137. package/dist/customWatchlist-IKEblz7u.js +0 -31
  138. package/dist/dateInputComposed-Cg8BvYSK.js +0 -1
  139. package/dist/dateInputComposed-Ddd7HLyM.js +0 -58
  140. package/dist/defineProperty-xczUyn-m.js +0 -39
  141. package/dist/documentCapture-D9I7FjGe.js +0 -2
  142. package/dist/documentCapture-b61wlala.js +0 -765
  143. package/dist/dropdownComposed-B4U0AIak.js +0 -1
  144. package/dist/dropdownComposed-CS2pyn-g.js +0 -293
  145. package/dist/dynamicForms-tYQog0kw.js +0 -298
  146. package/dist/ekybModule-C33C4JES.js +0 -237
  147. package/dist/ekybModule-LON6G2Bz.js +0 -2
  148. package/dist/ekycModule-BJOgtTAh.js +0 -225
  149. package/dist/ekycModule-BSf_DIG7.js +0 -2
  150. package/dist/electronic-signature-OdgTyso4.js +0 -406
  151. package/dist/emailInput-CU7mLB21.js +0 -37
  152. package/dist/errorIcon-DpHzAoAo.js +0 -24
  153. package/dist/expiredId-nfVAZgTL.js +0 -70
  154. package/dist/extensibility-BbNy3mVG.js +0 -2602
  155. package/dist/faceMatch-BIila4kf.js +0 -2
  156. package/dist/faceMatch-DJ7Mqujx.js +0 -206
  157. package/dist/fieldComparison-D2RSFYl-.js +0 -84
  158. package/dist/fieldComparison-DbUyouFd.js +0 -2
  159. package/dist/frontdevicelottie-65Vyfpff.js +0 -17302
  160. package/dist/glaredevicelottie-BEyaqtc6.js +0 -14466
  161. package/dist/homeScreen-CyPddxWl.js +0 -227
  162. package/dist/hooks-MxHtZWTS.js +0 -112
  163. package/dist/i18n-Kzzvkz94.js +0 -2019
  164. package/dist/icons-9I5g9-_1.js +0 -292
  165. package/dist/id-laser-h-iCPbFixz.js +0 -467
  166. package/dist/id-laser-v-CNzwliP2.js +0 -483
  167. package/dist/id-tutorial-CF4nO4oX.js +0 -13153
  168. package/dist/idOcr-DlMLMDqa.js +0 -97
  169. package/dist/incode-logo-DX016usY.js +0 -4
  170. package/dist/incodeComponent-BoFhgK7G.js +0 -50
  171. package/dist/incodeModule-BiCoAJ5k.js +0 -13
  172. package/dist/inputComposed-DAEey9xm.js +0 -94
  173. package/dist/inputComposed-eS4B0Mkh.js +0 -1
  174. package/dist/loadingIcon-BN5YRQUb.js +0 -104
  175. package/dist/lottie_light-DLqSnziX.js +0 -4419
  176. package/dist/mandatoryConsent-DNz2jZ43.js +0 -98
  177. package/dist/modal-ZqAhwiRF.js +0 -135
  178. package/dist/modal.hooks-LdusROLW.js +0 -126
  179. package/dist/numberedStep-CdLWASwL.js +0 -11
  180. package/dist/optionAccessibleLabel-DcygPaME.js +0 -140
  181. package/dist/otpInput-C4pk4BJU.js +0 -157
  182. package/dist/page-DA3R7q0J.js +0 -69
  183. package/dist/pdf-51QeiFSx.js +0 -14967
  184. package/dist/pdfViewer-rKzTHket.js +0 -64
  185. package/dist/phoneInputComposed-CjAxk2Gj.js +0 -11230
  186. package/dist/processing-DPktVde2.js +0 -6
  187. package/dist/radioGroupComposed-DRRxVk9Z.js +0 -178
  188. package/dist/registerIncodeElement-BHWOwdSS.js +0 -7
  189. package/dist/requiredLabelHint-B6FN3v88.js +0 -13
  190. package/dist/richText-6pIbydcz.js +0 -1973
  191. package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
  192. package/dist/selfieTutorial-Yo9AlUoT.js +0 -2677
  193. package/dist/snackbar-CQiiWO4p.js +0 -14
  194. package/dist/spinner-B4dcie2T.js +0 -1
  195. package/dist/spinner-CKnjVHxw.js +0 -39
  196. package/dist/statusPage-B8b3Jg6N.js +0 -28
  197. package/dist/successIcon-SlKgTSty.js +0 -28
  198. package/dist/tabs-D7lGst3Q.js +0 -78
  199. package/dist/transitionSpinner-Di3bOyOu.js +0 -17
  200. package/dist/typography-CxjaknHN.js +0 -28
  201. package/dist/uiConfig-CwpQ-IM6.js +0 -20
  202. package/dist/useModuleLoader-Bqs7fglI.js +0 -517
  203. package/dist/vendor-preact-D6SntenC.js +0 -958
  204. package/dist/verificationResult-DhT3hH1b.js +0 -90
  205. package/dist/verifiedByIncode-DpbxzO0y.js +0 -101
  206. package/dist/watchlistForBusiness-CRXVbH4l.js +0 -75
@@ -1,100 +1,220 @@
1
- import { n as e } from "../i18n-Kzzvkz94.js";
2
- import { _ as t, p as n, v as r } from "../vendor-preact-D6SntenC.js";
3
- import { a as i, c as a, o } from "../hooks-MxHtZWTS.js";
4
- import { t as s } from "../incodeComponent-BoFhgK7G.js";
5
- import { r as c } from "../loadingIcon-BN5YRQUb.js";
6
- import { t as l } from "../page-DA3R7q0J.js";
7
- import { t as u } from "../button-DcCUEn2n.js";
8
- import { t as d } from "../otpInput-C4pk4BJU.js";
9
- import { t as f } from "../incodeModule-BiCoAJ5k.js";
10
- import { t as p } from "../emailInput-CU7mLB21.js";
11
- import { createEmailManager as m } from "@incodetech/core/email";
1
+ import { n as useTranslation } from "../i18n-gTHArCl9.js";
2
+ import { _ as y, p as d, v as u } from "../vendor-preact-BH7vOa2r.js";
3
+ import { a as isTerminalModuleState, c as useManager, o as useModuleTerminalCallbacks } from "../hooks-BtgmGvba.js";
4
+ import { t as IncodeComponent } from "../incodeComponent-CDJxFZvS.js";
5
+ import { r as Spacer } from "../loadingIcon-DN62ugKs.js";
6
+ import { t as Page } from "../page-6bCuq5Q6.js";
7
+ import { t as Button } from "../button-B-qlr4iI.js";
8
+ import { t as OtpInput } from "../otpInput-2IQ-JCK8.js";
9
+ import { t as registerIncodeModuleElement } from "../incodeModule-DkA_yd0X.js";
10
+ import { t as EmailInput } from "../emailInput-D8qiAdjn.js";
11
+ import { createEmailManager } from "@incodetech/core/email";
12
12
  //#region src/modules/email/email.tsx
13
- function h(e) {
14
- return e === "serverError" ? "email.serverError" : e;
13
+ /**
14
+ * @module @incodetech/ui/email
15
+ *
16
+ * Email verification UI component for the Incode Web SDK.
17
+ * Provides a complete, ready-to-use email verification experience
18
+ * with email input and OTP verification.
19
+ *
20
+ * ## UI Usage
21
+ *
22
+ * The Email component can be used as a React/Preact component or as a
23
+ * Web Component (`<incode-email>`).
24
+ *
25
+ * @example React/Preact component usage
26
+ * ```tsx
27
+ * import { Email } from '@incodetech/ui/email';
28
+ * import { setup } from '@incodetech/core';
29
+ *
30
+ * // Configure the SDK first
31
+ * setup({ apiURL: 'https://api.example.com', token: 'your-token' });
32
+ *
33
+ * function App() {
34
+ * const config = {
35
+ * otpVerification: true,
36
+ * otpExpirationInMinutes: 5,
37
+ * prefill: false,
38
+ * };
39
+ *
40
+ * return (
41
+ * <Email
42
+ * config={config}
43
+ * onFinish={() => console.log('Email verified!')}
44
+ * onError={(error) => console.error('Error:', error)}
45
+ * />
46
+ * );
47
+ * }
48
+ * ```
49
+ *
50
+ * @example Web Component usage
51
+ * ```html
52
+ * <!-- Include the script -->
53
+ * <script type="module">
54
+ * import '@incodetech/ui/email';
55
+ * import { setup } from '@incodetech/core';
56
+ *
57
+ * setup({ apiURL: 'https://api.example.com', token: 'your-token' });
58
+ *
59
+ * const email = document.querySelector('incode-email');
60
+ * email.config = {
61
+ * otpVerification: true,
62
+ * otpExpirationInMinutes: 5,
63
+ * prefill: false,
64
+ * };
65
+ * email.onFinish = () => console.log('Email verified!');
66
+ * email.onError = (error) => console.error('Error:', error);
67
+ * <\/script>
68
+ *
69
+ * <incode-email></incode-email>
70
+ * ```
71
+ *
72
+ * ## Styling
73
+ *
74
+ * The component uses CSS custom properties (variables) for theming.
75
+ * Override these variables to customize the appearance:
76
+ *
77
+ * ```css
78
+ * :root {
79
+ * --button-primary-surface-default: #0066cc;
80
+ * --input-border-default: #cccccc;
81
+ * --text-title: #333333;
82
+ * }
83
+ * ```
84
+ *
85
+ * ## Headless Alternative
86
+ *
87
+ * For complete control over the UI, use the headless `createEmailManager`
88
+ * from `@incodetech/core/email` instead. See the core module documentation.
89
+ */
90
+ function getOtpErrorTranslationKey(error) {
91
+ if (error === "serverError") return "email.serverError";
92
+ return error;
15
93
  }
16
- function g(e) {
17
- return e === "invalidEmail" ? "verification.errors.emailInvalid" : e === "serverError" ? "email.serverError" : e;
94
+ function getEmailErrorTranslationKey(error) {
95
+ if (error === "invalidEmail") return "verification.errors.emailInvalid";
96
+ if (error === "serverError") return "email.serverError";
97
+ return error;
18
98
  }
19
- var _ = ({ config: s, manager: f, onFinish: _, onError: v }) => {
20
- let { t: y } = e(), [b, x] = a(() => {
21
- if (f) return f;
22
- if (!s) throw Error("Email config is required");
23
- return m({ config: s });
24
- }, { manageLifecycle: !f }), [S, C] = n("");
25
- o({
26
- status: b.status,
27
- onFinish: _,
28
- onError: v,
29
- error: b.status === "error" ? b.error : void 0
99
+ var EmailContent = ({ config, manager: externalManager, onFinish, onError }) => {
100
+ const { t } = useTranslation();
101
+ const [state, manager] = useManager(() => {
102
+ if (externalManager) return externalManager;
103
+ if (!config) throw new Error("Email config is required");
104
+ return createEmailManager({ config });
105
+ }, { manageLifecycle: !externalManager });
106
+ const [emailValue, setEmailValue] = d("");
107
+ useModuleTerminalCallbacks({
108
+ status: state.status,
109
+ onFinish,
110
+ onError,
111
+ error: state.status === "error" ? state.error : void 0
30
112
  });
31
- let w = b.status === "inputting" ? b.prefilledEmail ?? "" : "";
32
- if (t(() => {
33
- if (w) {
34
- let e = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(w.trim());
35
- C(w.trim()), x.setEmail(w.trim(), e);
113
+ const prefilledEmail = state.status === "inputting" ? state.prefilledEmail ?? "" : "";
114
+ y(() => {
115
+ if (prefilledEmail) {
116
+ const isValid = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(prefilledEmail.trim());
117
+ setEmailValue(prefilledEmail.trim());
118
+ manager.setEmail(prefilledEmail.trim(), isValid);
36
119
  }
37
- }, [w, x]), b.status === "idle" || b.status === "loadingPrefill" || b.status === "inputting" || b.status === "submitting" || b.status === "sendingInitialOtp") {
38
- let e = b.status === "idle" || b.status === "loadingPrefill" || b.status === "submitting" || b.status === "sendingInitialOtp", t = b.status === "inputting" && b.emailError ? y(g(b.emailError)) : void 0, n = b.status === "inputting" && b.validationErrors?.email ? y(g(b.validationErrors.email)) : void 0, i = t ?? n, a = b.status === "inputting" ? b.isValid : !0;
39
- return /* @__PURE__ */ r(l, {
120
+ }, [prefilledEmail, manager]);
121
+ if (state.status === "idle" || state.status === "loadingPrefill" || state.status === "inputting" || state.status === "submitting" || state.status === "sendingInitialOtp") {
122
+ const isLoading = state.status === "idle" || state.status === "loadingPrefill" || state.status === "submitting" || state.status === "sendingInitialOtp";
123
+ const serverEmailError = state.status === "inputting" && state.emailError ? t(getEmailErrorTranslationKey(state.emailError)) : void 0;
124
+ const clientEmailError = state.status === "inputting" && state.validationErrors?.email ? t(getEmailErrorTranslationKey(state.validationErrors.email)) : void 0;
125
+ const emailError = serverEmailError ?? clientEmailError;
126
+ const isValid = state.status === "inputting" ? state.isValid : true;
127
+ return /* @__PURE__ */ u(Page, {
40
128
  className: "IncodeEmailPage",
41
- title: y("email.verify"),
42
- subtitle: y("email.willSendCode"),
129
+ title: t("email.verify"),
130
+ subtitle: t("email.willSendCode"),
43
131
  children: [
44
- /* @__PURE__ */ r(p, {
45
- value: S,
46
- emailError: i,
47
- disabled: e,
48
- required: !0,
49
- onEmailChange: (e, t) => {
50
- x.setEmail(e, t), C(e);
132
+ /* @__PURE__ */ u(EmailInput, {
133
+ value: emailValue,
134
+ emailError,
135
+ disabled: isLoading,
136
+ required: true,
137
+ onEmailChange: (email, isValid) => {
138
+ manager.setEmail(email, isValid);
139
+ setEmailValue(email);
51
140
  },
52
141
  onBlur: () => {
53
- x.validateEmail();
142
+ manager.validateEmail();
54
143
  }
55
144
  }),
56
- /* @__PURE__ */ r(c, {}),
57
- /* @__PURE__ */ r(u, {
58
- onClick: () => x.submit(),
59
- disabled: !a,
60
- isLoading: e,
145
+ /* @__PURE__ */ u(Spacer, {}),
146
+ /* @__PURE__ */ u(Button, {
147
+ onClick: () => manager.submit(),
148
+ disabled: !isValid,
149
+ isLoading,
61
150
  "data-testid": "email-submit",
62
- children: y("common.continue")
151
+ children: t("common.continue")
63
152
  })
64
153
  ]
65
154
  }, "email-input");
66
155
  }
67
- if (b.status === "awaitingOtp" || b.status === "verifyingOtp" || b.status === "otpError" || b.status === "resendingOtp") {
68
- let e = b.status === "verifyingOtp", t = b.status === "otpError", n = b.status === "awaitingOtp", i = b.status === "resendingOtp", a = n || t || e;
69
- return /* @__PURE__ */ r(l, {
156
+ if (state.status === "awaitingOtp" || state.status === "verifyingOtp" || state.status === "otpError" || state.status === "resendingOtp") {
157
+ const isVerifying = state.status === "verifyingOtp";
158
+ const hasOtpError = state.status === "otpError";
159
+ const isAwaitingOtp = state.status === "awaitingOtp";
160
+ const isResending = state.status === "resendingOtp";
161
+ const showResendCountdown = isAwaitingOtp || hasOtpError || isVerifying;
162
+ return /* @__PURE__ */ u(Page, {
70
163
  className: "IncodeEmailPage IncodeEmailOtpPage",
71
- title: y("otp.enterCodeEmail"),
72
- children: /* @__PURE__ */ r(d, {
73
- value: b.otpCode,
74
- otpLength: b.otpLength,
75
- resendTimer: a ? b.resendTimer : 0,
76
- canResend: a ? b.canResend : !1,
77
- error: t ? y(h(b.otpError)) : void 0,
78
- validationError: "otpValidationErrors" in b && b.otpValidationErrors?.otp ? y("otp.incompleteCode", { length: b.otpLength }) : void 0,
79
- isValid: "isOtpValid" in b ? b.isOtpValid : !0,
80
- isLoading: e,
81
- disabled: i || e,
82
- onSubmit: (e) => x.submitOtp(e),
83
- onChange: (e) => x.setOtpCode(e),
84
- onValidate: () => x.validateOtp(),
85
- onResend: () => x.resendOtp(),
86
- onBack: () => x.back(),
164
+ title: t("otp.enterCodeEmail"),
165
+ children: /* @__PURE__ */ u(OtpInput, {
166
+ value: state.otpCode,
167
+ otpLength: state.otpLength,
168
+ resendTimer: showResendCountdown ? state.resendTimer : 0,
169
+ canResend: showResendCountdown ? state.canResend : false,
170
+ error: hasOtpError ? t(getOtpErrorTranslationKey(state.otpError)) : void 0,
171
+ validationError: "otpValidationErrors" in state && state.otpValidationErrors?.otp ? t("otp.incompleteCode", { length: state.otpLength }) : void 0,
172
+ isValid: "isOtpValid" in state ? state.isOtpValid : true,
173
+ isLoading: isVerifying,
174
+ disabled: isResending || isVerifying,
175
+ onSubmit: (code) => manager.submitOtp(code),
176
+ onChange: (code) => manager.setOtpCode(code),
177
+ onValidate: () => manager.validateOtp(),
178
+ onResend: () => manager.resendOtp(),
179
+ onBack: () => manager.back(),
87
180
  backLinkText: "otp.changeEmail"
88
181
  })
89
182
  }, "email-otp");
90
183
  }
91
- return i(b), null;
92
- }, v = ({ config: e, manager: t, onFinish: n, onError: i }) => /* @__PURE__ */ r(s, { children: e || t ? /* @__PURE__ */ r(_, {
93
- config: e,
94
- manager: t,
95
- onFinish: n,
96
- onError: i
97
- }) : null });
98
- f(v, "incode-email");
184
+ if (isTerminalModuleState(state)) return null;
185
+ return null;
186
+ };
187
+ /**
188
+ * Email verification UI component.
189
+ *
190
+ * Provides a complete email verification experience including:
191
+ * - Email address input with validation
192
+ * - OTP code entry with resend functionality
193
+ * - Loading states and error handling
194
+ *
195
+ * @example Basic usage
196
+ * ```tsx
197
+ * <Email
198
+ * config={{
199
+ * otpVerification: true,
200
+ * otpExpirationInMinutes: 5,
201
+ * prefill: false,
202
+ * }}
203
+ * onFinish={() => router.push('/next-step')}
204
+ * onError={(err) => toast.error(err)}
205
+ * />
206
+ * ```
207
+ *
208
+ * @see {@link createEmailManager} for headless usage
209
+ */
210
+ var Email = ({ config, manager, onFinish, onError }) => {
211
+ return /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(EmailContent, {
212
+ config,
213
+ manager,
214
+ onFinish,
215
+ onError
216
+ }) : null });
217
+ };
218
+ registerIncodeModuleElement(Email, "incode-email");
99
219
  //#endregion
100
- export { v as Email };
220
+ export { Email };
@@ -0,0 +1,39 @@
1
+ import { n as useTranslation } from "./i18n-gTHArCl9.js";
2
+ import { v as u } from "./vendor-preact-BH7vOa2r.js";
3
+ import "./extensibility-FK5oOsIJ.js";
4
+ import { t as InputComposed } from "./inputComposed-5V2nLTqH.js";
5
+ //#region src/modules/email/emailInput.tsx
6
+ var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
7
+ var EmailInput = ({ value, emailError, label, labelHint, disabled = false, required = false, onEmailChange, onBlur }) => {
8
+ const { t } = useTranslation();
9
+ const handleEmailChange = (e) => {
10
+ const trimmed = e.target.value.trim();
11
+ onEmailChange(trimmed, trimmed.length > 0 && EMAIL_REGEX.test(trimmed));
12
+ };
13
+ return /* @__PURE__ */ u("div", {
14
+ class: "IncodeEmailInput",
15
+ children: /* @__PURE__ */ u("div", {
16
+ class: "IncodeEmailInputContainer",
17
+ onFocusOut: onBlur,
18
+ children: /* @__PURE__ */ u(InputComposed, {
19
+ id: "email-input",
20
+ type: "email",
21
+ value,
22
+ onInput: handleEmailChange,
23
+ placeholder: t("email.placeholder"),
24
+ disabled,
25
+ required,
26
+ label,
27
+ labelHint,
28
+ "data-testid": "email-input",
29
+ "aria-label": !label ? "Email address" : void 0,
30
+ "aria-invalid": emailError ? "true" : void 0,
31
+ autocomplete: "email",
32
+ error: emailError,
33
+ showErrorIcon: true
34
+ })
35
+ })
36
+ });
37
+ };
38
+ //#endregion
39
+ export { EmailInput as t };
@@ -0,0 +1,26 @@
1
+ import { v as u } from "./vendor-preact-BH7vOa2r.js";
2
+ //#region src/shared/icons/errorIcon.tsx
3
+ var ErrorIcon = ({ size = 32 }) => {
4
+ return /* @__PURE__ */ u("svg", {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: size,
7
+ height: size,
8
+ viewBox: "0 0 64 64",
9
+ fill: "none",
10
+ class: "IncodeErrorIcon",
11
+ "aria-hidden": "true",
12
+ children: [/* @__PURE__ */ u("path", {
13
+ "fill-rule": "evenodd",
14
+ "clip-rule": "evenodd",
15
+ d: "M32 6.66669C18.032 6.66669 6.66669 18.0294 6.66669 32C6.66669 45.968 18.032 57.3334 32 57.3334C45.968 57.3334 57.3334 45.968 57.3334 32C57.3334 18.0294 45.968 6.66669 32 6.66669Z",
16
+ fill: "var(--icon-status-negative)"
17
+ }), /* @__PURE__ */ u("path", {
18
+ "fill-rule": "evenodd",
19
+ "clip-rule": "evenodd",
20
+ d: "M39.6426 39.6368C39.2533 40.0261 38.7413 40.2235 38.2293 40.2235C37.7146 40.2235 37.2053 40.0261 36.8133 39.6368L31.9973 34.8181L27.1946 39.6208C26.4133 40.4021 25.1467 40.4021 24.3653 39.6208C23.5867 38.8395 23.5867 37.5755 24.3653 36.7941L29.168 31.9915L24.3627 27.1835C23.5813 26.4021 23.5813 25.1381 24.3627 24.3568C25.144 23.5755 26.408 23.5755 27.1893 24.3568L31.9946 29.1621L36.8 24.3595C37.5813 23.5781 38.8453 23.5781 39.6266 24.3595C40.408 25.1381 40.408 26.4048 39.6266 27.1861L34.824 31.9915L39.6426 36.8075C40.424 37.5888 40.424 38.8555 39.6426 39.6368Z",
21
+ fill: "var(--icon-neutral-0)"
22
+ })]
23
+ });
24
+ };
25
+ //#endregion
26
+ export { ErrorIcon as t };
@@ -0,0 +1,85 @@
1
+ import { n as useTranslation } from "./i18n-gTHArCl9.js";
2
+ import { _ as y, l as A, v as u } from "./vendor-preact-BH7vOa2r.js";
3
+ import { r as Spacer } from "./loadingIcon-DN62ugKs.js";
4
+ import { t as Page } from "./page-6bCuq5Q6.js";
5
+ import { t as Title } from "./typography-BK4AmfKX.js";
6
+ import { t as Button } from "./button-B-qlr4iI.js";
7
+ //#region src/shared/icons/redStrikeIcon.tsx
8
+ var RedStrikeIcon = ({ className, ...rest }) => /* @__PURE__ */ u("svg", {
9
+ class: className,
10
+ width: "33",
11
+ height: "32",
12
+ viewBox: "0 0 33 32",
13
+ fill: "none",
14
+ xmlns: "http://www.w3.org/2000/svg",
15
+ "aria-hidden": "true",
16
+ ...rest,
17
+ children: /* @__PURE__ */ u("path", {
18
+ d: "M16.5 0C25.3219 0 32.5 7.17642 32.5 16C32.5 24.8219 25.3219 32 16.5 32C7.67811 32 0.5 24.8219 0.5 16C0.5 7.17642 7.67811 0 16.5 0ZM13.6553 11.3701C13.1618 10.8767 12.3636 10.8767 11.8701 11.3701C11.3767 11.8636 11.3767 12.6618 11.8701 13.1553L14.9053 16.1924L11.8721 19.2256C11.3803 19.7191 11.3803 20.5173 11.8721 21.0107C12.3656 21.504 13.1658 21.5041 13.6592 21.0107L16.6924 17.9775L19.7334 21.0205C19.981 21.2664 20.3029 21.3916 20.6279 21.3916C20.9513 21.3916 21.2746 21.2664 21.5205 21.0205C22.014 20.527 22.014 19.7269 21.5205 19.2334L18.4775 16.1924L21.5107 13.1572C22.0041 12.6638 22.004 11.8639 21.5107 11.3721C21.0173 10.8786 20.2191 10.8786 19.7256 11.3721L16.6904 14.4053L13.6553 11.3701Z",
19
+ fill: "#E71111"
20
+ })
21
+ });
22
+ //#endregion
23
+ //#region src/shared/expiredId/expiredId.tsx
24
+ /**
25
+ * Shown when the backend reports `isDocumentExpired: true`. Exactly one of
26
+ * `onRetry` / `onContinue` should be provided; if both are passed, retry
27
+ * takes precedence.
28
+ *
29
+ * Visual contract mirrors the SDK 1 UXv2 Expired ID screen (red strike icon,
30
+ * centered title + subtitle, full-width primary button anchored near the
31
+ * bottom). The optional attempts counter (added by core PR #439 / SDK 1
32
+ * `IdError` parity) renders only when `attemptsRemaining` is supplied.
33
+ */
34
+ var ExpiredId = ({ onRetry, onContinue, attemptsRemaining }) => {
35
+ const { t } = useTranslation();
36
+ const titleRef = A(null);
37
+ y(() => {
38
+ titleRef.current?.focus();
39
+ }, []);
40
+ return /* @__PURE__ */ u(Page, {
41
+ hideHeader: true,
42
+ hideFooterBranding: true,
43
+ className: "IncodeIdExpiredPage",
44
+ "data-testid": "expired-id",
45
+ children: [/* @__PURE__ */ u("div", {
46
+ class: "IncodeIdExpiredContent",
47
+ role: "alert",
48
+ children: [
49
+ /* @__PURE__ */ u(RedStrikeIcon, { className: "IncodeIdExpiredIcon" }),
50
+ /* @__PURE__ */ u(Title, {
51
+ ref: titleRef,
52
+ tabIndex: -1,
53
+ className: "IncodeIdExpiredTitle",
54
+ children: t("idv2.capture.notifications.expiredId")
55
+ }),
56
+ /* @__PURE__ */ u(Spacer, { size: 12 }),
57
+ /* @__PURE__ */ u("p", {
58
+ class: "IncodeIdExpiredSubtitle",
59
+ children: t("idv2.capture.expiredId.pleaseTryWithADifferentId")
60
+ }),
61
+ /* @__PURE__ */ u(Spacer, { size: 80 }),
62
+ attemptsRemaining !== void 0 ? /* @__PURE__ */ u("p", {
63
+ class: "IncodeIdExpiredAttemptsCounter",
64
+ "data-testid": "expired-id-attempts-counter",
65
+ children: `${attemptsRemaining} ${t("idv2.capture.processing.attemptsRemainingLabel")}`
66
+ }) : null
67
+ ]
68
+ }), /* @__PURE__ */ u("div", {
69
+ class: "IncodeIdExpiredButtonContainer",
70
+ children: onRetry ? /* @__PURE__ */ u(Button, {
71
+ variant: "primary",
72
+ onClick: onRetry,
73
+ "data-testid": "expired-id-retry",
74
+ children: t("idv2.capture.processing.tryAgain")
75
+ }) : onContinue ? /* @__PURE__ */ u(Button, {
76
+ variant: "primary",
77
+ onClick: onContinue,
78
+ "data-testid": "expired-id-continue",
79
+ children: t("idv2.capture.processing.continue")
80
+ }) : null
81
+ })]
82
+ });
83
+ };
84
+ //#endregion
85
+ export { RedStrikeIcon as n, ExpiredId as t };