@incodetech/web 2.0.1 → 2.1.0-rc.1
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/ae-signature/ae-signature.es.js +15 -13
- package/dist/ae-signature/styles.css +3 -17
- package/dist/ae-signature/styles2.css +15 -5
- package/dist/aligndevicelottie-DY_bX_p8.js +12769 -0
- package/dist/antifraud/antifraud.es.js +23 -16
- package/dist/authentication/authentication.es.js +42 -27
- package/dist/autoFocusTitle-BzkUiELM.js +29 -0
- package/dist/{back-horizontal-hint-B8Brxh3U.js → back-horizontal-hint-D_8LptLm.js} +26 -26
- package/dist/back-tutorial-vb1MxlrT.js +14597 -0
- package/dist/{back-vertical-hint-BBo36dxn.js → back-vertical-hint-C1evxxq2.js} +27 -27
- package/dist/backdevicelottie-HypPqBz7.js +16690 -0
- package/dist/base.css +1258 -104
- package/dist/blurdevicelottie-CBXtBFiJ.js +15951 -0
- package/dist/bottomSheet-F1GJfQx_.js +39 -0
- package/dist/browser-ponyfill-CLLvZCVg.js +441 -0
- package/dist/button-CM_hgyIP.js +35 -0
- package/dist/checkbox-BoeLHKgp.js +96 -0
- package/dist/consent/consent.es.js +89 -73
- package/dist/consent/styles.css +35 -22
- package/dist/countrySelector-mSWyHSy4.js +60 -0
- package/dist/cpf-ocr/cpf-ocr.es.js +2 -0
- package/dist/cpfOcr-MtpRztkG.js +92 -0
- package/dist/cpfOcr-jJkYCfsX.js +2 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +20 -16
- package/dist/curp-validation/curp-validation.es.js +247 -203
- package/dist/customFields-DXXt9HGM.js +140 -0
- package/dist/customWatchlist-DsW04UF6.js +36 -0
- package/dist/dateInputComposed-C_mh4XBg.js +69 -0
- package/dist/dateInputComposed-Cy6a7ymh.js +1 -0
- package/dist/defineProperty-mefzVtTv.js +39 -0
- package/dist/document-capture/document-capture.es.js +2 -0
- package/dist/document-capture/styles.css +2 -5
- package/dist/documentCapture-8ypBJehw.js +2 -0
- package/dist/documentCapture-BDV_921m.js +880 -0
- package/dist/dropdownComposed-CEWBSdGl.js +1 -0
- package/dist/dropdownComposed-_fgAlo_C.js +380 -0
- package/dist/dynamic-forms/styles.css +25 -13
- package/dist/dynamicForms-DyfnsS7E.js +352 -0
- package/dist/ekyb/ekyb.es.js +2 -2
- package/dist/ekyb/styles.css +2 -0
- package/dist/ekybModule-CIPGmCvD.js +279 -0
- package/dist/ekybModule-DFoYpheB.js +2 -0
- package/dist/ekyc/ekyc.es.js +2 -2
- package/dist/ekyc/styles.css +9 -7
- package/dist/ekycModule-BGzwgjl1.js +2 -0
- package/dist/ekycModule-BuTaC5ct.js +257 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -2
- package/dist/electronic-signature-B-Q7M0wK.js +430 -0
- package/dist/email/email.es.js +199 -66
- package/dist/emailInput-KZmhjOdZ.js +39 -0
- package/dist/errorIcon-DJRZpd8j.js +26 -0
- package/dist/expiredId-Q1t6aVpk.js +85 -0
- package/dist/extensibility-Cs3KQQdC.js +3070 -0
- package/dist/extensibility.es.js +26 -25
- package/dist/face-match/face-match.es.js +2 -2
- package/dist/face-match/styles.css +0 -4
- package/dist/faceMatch--RDHJe4t.js +343 -0
- package/dist/faceMatch-yEKPYaym.js +2 -0
- package/dist/field-comparison/field-comparison.es.js +2 -0
- package/dist/field-comparison/styles.css +16 -0
- package/dist/fieldComparison-CAF86bTC.js +88 -0
- package/dist/fieldComparison-D0an7T_g.js +2 -0
- package/dist/fiscal-qr/fiscal-qr.es.js +224 -0
- package/dist/fiscal-qr/styles.css +71 -0
- package/dist/{flip-animation-CgwRsEmK.js → flip-animation-BGRvygw9.js} +4221 -4221
- package/dist/flow/flow.es.js +619 -484
- package/dist/flow/styles.css +378 -418
- package/dist/{front-horizontal-hint-DGGGi8e1.js → front-horizontal-hint-Uf5bHCsd.js} +70 -70
- package/dist/{front-vertical-hint-CNr5mE6Q.js → front-vertical-hint-DdWNA45v.js} +81 -81
- package/dist/frontdevicelottie-CLqitJhG.js +17314 -0
- package/dist/geolocation/geolocation.es.js +486 -395
- package/dist/glaredevicelottie-BS04U6Fc.js +14478 -0
- package/dist/governmentValidation/governmentValidation.es.js +166 -93
- package/dist/governmentValidation/styles.css +0 -17
- package/dist/homeScreen-BZnIEDrV.js +264 -0
- package/dist/hooks-Da_yP_Dr.js +149 -0
- package/dist/i18n-CoCO2ZuN.js +2971 -0
- package/dist/icons-Dbs9ZfYM.js +360 -0
- package/dist/id/id.es.js +583 -414
- package/dist/id/styles.css +59 -43
- package/dist/id-laser-h-DX8UbVNH.js +467 -0
- package/dist/id-laser-v-DhnHdjlB.js +490 -0
- package/dist/id-tutorial-lj4iKtYT.js +13165 -0
- package/dist/id-verification/id-verification.es.js +21 -17
- package/dist/idOcr-CjGbb4dB.js +123 -0
- package/dist/identity-reuse/identity-reuse.es.js +311 -182
- package/dist/identity-reuse/styles.css +134 -80
- package/dist/incode-logo-57XFniXU.js +4 -0
- package/dist/incodeComponent-wfnHlnXx.js +63 -0
- package/dist/incodeModule-BUDoTwT9.js +13 -0
- package/dist/index.es.js +17 -13
- package/dist/inputComposed-BEn7_nZd.js +1 -0
- package/dist/inputComposed-CQ4AsvZg.js +99 -0
- package/dist/loadingIcon-B0ysgiNq.js +148 -0
- package/dist/lottie_light-Dp9Bz3mf.js +9031 -0
- package/dist/mandatoryConsent-r0PQHmv-.js +107 -0
- package/dist/modal-nTSaG7nB.js +139 -0
- package/dist/modal.hooks-D2xhIuHA.js +195 -0
- package/dist/numberedStep-CEtwZqLp.js +13 -0
- package/dist/optionAccessibleLabel-CnA-mNAU.js +202 -0
- package/dist/otpInput-_JmtVwa0.js +195 -0
- package/dist/page-DxGQj7Gk.js +71 -0
- package/dist/{passport-horizontal-hint-Bgquwtac.js → passport-horizontal-hint-Bbm2mvSn.js} +55 -55
- package/dist/{passport-tutorial-DwRwtPVX.js → passport-tutorial-zT1ZoA-D.js} +7096 -7084
- package/dist/{passport-vertical-hint-BT1D5BrW.js → passport-vertical-hint-DJbCtBiM.js} +49 -49
- package/dist/pdf-BZA70WbM.js +22398 -0
- package/dist/pdfViewer-BK-yVIve.js +114 -0
- package/dist/phone/phone.es.js +214 -70
- package/dist/phoneInputComposed-DjNdsmPE.js +12142 -0
- package/dist/processing-BM-wT-1W.js +8 -0
- package/dist/qe-signature/qe-signature.es.js +15 -13
- package/dist/radioGroupComposed-BNuaopVr.js +215 -0
- package/dist/redirect-to-mobile/redirect-to-mobile.es.js +2774 -0
- package/dist/redirect-to-mobile/styles.css +19 -269
- package/dist/registerIncodeElement-77NGCDsy.js +11 -0
- package/dist/requiredLabelHint-DEadtiwx.js +17 -0
- package/dist/richText-Cf9aMOCk.js +3153 -0
- package/dist/rolldown-runtime--E5BIlTp.js +33 -0
- package/dist/selfie/selfie.es.js +54 -37
- package/dist/selfie/styles.css +0 -4
- package/dist/selfieTutorial-CtruLyO2.js +2689 -0
- package/dist/signature/signature.es.js +778 -405
- package/dist/snackbar-CxepGC3e.js +16 -0
- package/dist/spinner-B6RxGFrI.js +1 -0
- package/dist/spinner-D8a_2LvW.js +42 -0
- package/dist/statusPage-DMYPUwRZ.js +28 -0
- package/dist/successIcon-BAyDPT7I.js +30 -0
- package/dist/tabs-C8npVBbk.js +103 -0
- package/dist/themes/dark.css +5 -0
- package/dist/themes/light.css +4 -0
- package/dist/transitionSpinner-DRRz-NV8.js +26 -0
- package/dist/{tutorial-9vHAHvMK.js → tutorial-D1qaY2Tm.js} +1105 -856
- package/dist/types/ae-signature.d.ts +4 -1
- package/dist/types/antifraud.d.ts +9 -3
- package/dist/types/authentication.d.ts +4 -1
- package/dist/types/consent.d.ts +4 -1
- package/dist/types/cpf-ocr.d.ts +12 -0
- package/dist/types/cross-document-data-match.d.ts +4 -1
- package/dist/types/curp-validation.d.ts +9 -3
- package/dist/types/document-capture.d.ts +37 -0
- package/dist/types/ekyb.d.ts +4 -1
- package/dist/types/ekyc.d.ts +4 -1
- package/dist/types/electronic-signature.d.ts +4 -1
- package/dist/types/email.d.ts +4 -1
- package/dist/types/extensibility.d.ts +40 -15
- package/dist/types/face-match.d.ts +4 -1
- package/dist/types/field-comparison.d.ts +38 -0
- package/dist/types/fiscal-qr.d.ts +43 -0
- package/dist/types/flow.d.ts +5 -2
- package/dist/types/geolocation.d.ts +4 -1
- package/dist/types/governmentValidation.d.ts +4 -1
- package/dist/types/id-verification.d.ts +4 -1
- package/dist/types/id.d.ts +4 -1
- package/dist/types/identity-reuse.d.ts +4 -1
- package/dist/types/index.d.ts +26 -2
- package/dist/types/phone.d.ts +4 -1
- package/dist/types/qe-signature.d.ts +4 -1
- package/dist/types/redirect-to-mobile.d.ts +17 -0
- package/dist/types/selfie.d.ts +4 -1
- package/dist/types/signature.d.ts +4 -1
- package/dist/types/watchlist.d.ts +4 -1
- package/dist/types/workflow.d.ts +55 -11
- package/dist/typography-YLgHHuao.js +45 -0
- package/dist/uiConfig-D2_wawvr.js +25 -0
- package/dist/useModuleLoader-CeJ2jL25.js +672 -0
- package/dist/vendor-preact-DThS2ZQ_.js +955 -0
- package/dist/verificationResult-Do5SpZ6X.js +64 -0
- package/dist/verifiedByIncode-DjXOdCml.js +103 -0
- package/dist/watchlist/watchlist.es.js +31 -28
- package/dist/watchlistForBusiness-BFFXC9d-.js +80 -0
- package/dist/workflow/styles.css +449 -427
- package/dist/workflow/workflow.es.js +268 -182
- package/package.json +32 -10
- package/dist/aligndevicelottie-DoV8xKjh.js +0 -12757
- package/dist/autoFocusTitle-QexamZ4i.js +0 -16
- package/dist/back-tutorial-1NOQobGO.js +0 -14585
- package/dist/backdevicelottie-C_ceuqY7.js +0 -16678
- package/dist/blurdevicelottie-UO14Y0WC.js +0 -15939
- package/dist/bottomSheet-DE_8TFEC.js +0 -31
- package/dist/browser-ponyfill-jOkuz57z.js +0 -299
- package/dist/button-DcCUEn2n.js +0 -24
- package/dist/checkbox-Cl57ltq_.js +0 -85
- package/dist/countrySelector-CE-JgIsv.js +0 -58
- package/dist/cpfOcr-D_tbwbvh.js +0 -78
- package/dist/customFields-CW38fQUv.js +0 -127
- package/dist/customWatchlist-D9_yjEQd.js +0 -33
- package/dist/dateInputComposed-BpAGsjN6.js +0 -55
- package/dist/dateInputComposed-DU3o6PAV.js +0 -1
- package/dist/defineProperty-Dh8nSJpJ.js +0 -39
- package/dist/documentCapture-xX-JT7ZY.js +0 -763
- package/dist/dropdownComposed-DFRBG22E.js +0 -284
- package/dist/dropdownComposed-DwTzc2YU.js +0 -1
- package/dist/dynamicForms-CJP1Ia6Q.js +0 -262
- package/dist/ekybModule-BSs7mndb.js +0 -280
- package/dist/ekybModule-D9M3E2Gm.js +0 -2
- package/dist/ekycModule-CU9pt5YN.js +0 -246
- package/dist/ekycModule-CZw9cLno.js +0 -2
- package/dist/electronic-signature-COYXjGdd.js +0 -410
- package/dist/emailInput-DppGf9pv.js +0 -37
- package/dist/expiredId-BnmzE8T3.js +0 -70
- package/dist/extensibility-CzEJfRwo.js +0 -2586
- package/dist/faceMatch-B8j0g0Yo.js +0 -2
- package/dist/faceMatch-BV8UD7tj.js +0 -201
- package/dist/frontdevicelottie-Bu6f9fDE.js +0 -17302
- package/dist/glaredevicelottie-B10axYs_.js +0 -14466
- package/dist/homeScreen-DnP1jw9A.js +0 -227
- package/dist/hooks-BVnGysT7.js +0 -80
- package/dist/i18n-9s4OSqwi.js +0 -2010
- package/dist/icons-Cc7zwchP.js +0 -310
- package/dist/id-laser-h-mBAzHVOK.js +0 -467
- package/dist/id-laser-v-CrFg4bcJ.js +0 -483
- package/dist/id-tutorial-BCr42Pnn.js +0 -13153
- package/dist/idOcr-CCjfWQvH.js +0 -94
- package/dist/incode-logo-DX016usY.js +0 -4
- package/dist/incodeComponent-C1o4M0ZK.js +0 -50
- package/dist/incodeModule-BqCjVgEI.js +0 -18
- package/dist/inputComposed-APSw8C7o.js +0 -89
- package/dist/inputComposed-XYrarFxS.js +0 -1
- package/dist/loadingIcon-BN5YRQUb.js +0 -104
- package/dist/mandatoryConsent-DssKMC3v.js +0 -100
- package/dist/modal-NMxsQHAO.js +0 -135
- package/dist/modal.hooks-CAjcIFZK.js +0 -126
- package/dist/numberedStep-CT-alrK5.js +0 -11
- package/dist/optionAccessibleLabel-CzEeX3Q4.js +0 -140
- package/dist/otpInput-DqRA_egd.js +0 -145
- package/dist/page-C1yT4DLb.js +0 -69
- package/dist/pdf-BurGZ08w.js +0 -14967
- package/dist/pdfViewer-BGBNL1Ea.js +0 -63
- package/dist/phoneInputComposed-bvWhGLFZ.js +0 -11206
- package/dist/processing-G_y3o32b.js +0 -6
- package/dist/radioGroupComposed-BbmvxmD2.js +0 -177
- package/dist/redirectToMobile-C3k1gloW.js +0 -1514
- package/dist/requiredLabelHint-BLwgqozE.js +0 -13
- package/dist/richText-DbJ5sl2n.js +0 -1973
- package/dist/rolldown-runtime-CYMK-g2i.js +0 -20
- package/dist/selfieTutorial-BgrlUMXP.js +0 -2677
- package/dist/snackbar-BDp8x7Cv.js +0 -14
- package/dist/spinner-B4dcie2T.js +0 -1
- package/dist/spinner-CKnjVHxw.js +0 -39
- package/dist/statusPage-CUI7ApcU.js +0 -28
- package/dist/successIcon-DbILeIz_.js +0 -28
- package/dist/tabs-DaPyP71c.js +0 -78
- package/dist/transitionSpinner-PIEPU2Vx.js +0 -17
- package/dist/types/cpf-ocr/styles.d.ts +0 -1
- package/dist/types/document-capture/styles.d.ts +0 -1
- package/dist/types/redirect-to-mobile/styles.d.ts +0 -1
- package/dist/typography-CxjaknHN.js +0 -28
- package/dist/uiConfig-CwpQ-IM6.js +0 -20
- package/dist/useModuleLoader-BFiVA41N.js +0 -432
- package/dist/vendor-preact-D6SntenC.js +0 -958
- package/dist/verificationResult-BrVbUJ4U.js +0 -97
- package/dist/verifiedByIncode-ChZBpqNy.js +0 -101
- package/dist/watchlistForBusiness-BcSNtHCV.js +0 -77
package/dist/email/email.es.js
CHANGED
|
@@ -1,87 +1,220 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { o as
|
|
4
|
-
import { t as
|
|
5
|
-
import { r as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { createEmailManager
|
|
1
|
+
import { n as useTranslation } from "../i18n-CoCO2ZuN.js";
|
|
2
|
+
import { _ as y, p as d, v as u } from "../vendor-preact-DThS2ZQ_.js";
|
|
3
|
+
import { a as isTerminalModuleState, c as useManager, o as useModuleTerminalCallbacks } from "../hooks-Da_yP_Dr.js";
|
|
4
|
+
import { t as IncodeComponent } from "../incodeComponent-wfnHlnXx.js";
|
|
5
|
+
import { r as Spacer } from "../loadingIcon-B0ysgiNq.js";
|
|
6
|
+
import { t as Page } from "../page-DxGQj7Gk.js";
|
|
7
|
+
import { t as Button } from "../button-CM_hgyIP.js";
|
|
8
|
+
import { t as OtpInput } from "../otpInput-_JmtVwa0.js";
|
|
9
|
+
import { t as registerIncodeModuleElement } from "../incodeModule-BUDoTwT9.js";
|
|
10
|
+
import { t as EmailInput } from "../emailInput-KZmhjOdZ.js";
|
|
11
|
+
import { createEmailManager } from "@incodetech/core/email";
|
|
12
12
|
//#region src/modules/email/email.tsx
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
17
|
-
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
112
|
+
});
|
|
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);
|
|
29
119
|
}
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
|
|
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, {
|
|
33
128
|
className: "IncodeEmailPage",
|
|
34
|
-
title:
|
|
35
|
-
subtitle:
|
|
129
|
+
title: t("email.verify"),
|
|
130
|
+
subtitle: t("email.willSendCode"),
|
|
36
131
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
value:
|
|
39
|
-
emailError
|
|
40
|
-
disabled:
|
|
41
|
-
required:
|
|
42
|
-
onEmailChange: (
|
|
43
|
-
|
|
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);
|
|
44
140
|
},
|
|
45
141
|
onBlur: () => {
|
|
46
|
-
|
|
142
|
+
manager.validateEmail();
|
|
47
143
|
}
|
|
48
144
|
}),
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
onClick: () =>
|
|
52
|
-
disabled:
|
|
53
|
-
isLoading
|
|
145
|
+
/* @__PURE__ */ u(Spacer, {}),
|
|
146
|
+
/* @__PURE__ */ u(Button, {
|
|
147
|
+
onClick: () => manager.submit(),
|
|
148
|
+
disabled: !isValid,
|
|
149
|
+
isLoading,
|
|
54
150
|
"data-testid": "email-submit",
|
|
55
|
-
children:
|
|
151
|
+
children: t("common.continue")
|
|
56
152
|
})
|
|
57
153
|
]
|
|
58
154
|
}, "email-input");
|
|
59
155
|
}
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
|
|
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, {
|
|
63
163
|
className: "IncodeEmailPage IncodeEmailOtpPage",
|
|
64
|
-
title:
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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(),
|
|
74
180
|
backLinkText: "otp.changeEmail"
|
|
75
181
|
})
|
|
76
182
|
}, "email-otp");
|
|
77
183
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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");
|
|
86
219
|
//#endregion
|
|
87
|
-
export {
|
|
220
|
+
export { Email };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { n as useTranslation } from "./i18n-CoCO2ZuN.js";
|
|
2
|
+
import { v as u } from "./vendor-preact-DThS2ZQ_.js";
|
|
3
|
+
import "./extensibility-Cs3KQQdC.js";
|
|
4
|
+
import { t as InputComposed } from "./inputComposed-CQ4AsvZg.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-DThS2ZQ_.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-CoCO2ZuN.js";
|
|
2
|
+
import { _ as y, l as A, v as u } from "./vendor-preact-DThS2ZQ_.js";
|
|
3
|
+
import { r as Spacer } from "./loadingIcon-B0ysgiNq.js";
|
|
4
|
+
import { t as Page } from "./page-DxGQj7Gk.js";
|
|
5
|
+
import { t as Title } from "./typography-YLgHHuao.js";
|
|
6
|
+
import { t as Button } from "./button-CM_hgyIP.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 };
|