@incodetech/web 2.0.0-alpha.8 → 2.0.0-rc.0
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 -0
- package/dist/ae-signature/styles.css +348 -0
- package/dist/ae-signature/styles2.css +107 -0
- package/dist/aligndevicelottie-DoV8xKjh.js +12757 -0
- package/dist/antifraud/antifraud.es.js +18 -0
- package/dist/antifraud/styles.css +2 -0
- package/dist/authentication/authentication.es.js +29 -0
- package/dist/autoFocusTitle-QexamZ4i.js +16 -0
- package/dist/back-horizontal-hint-B8Brxh3U.js +137 -0
- package/dist/back-tutorial-1NOQobGO.js +14585 -0
- package/dist/back-vertical-hint-BBo36dxn.js +128 -0
- package/dist/backdevicelottie-C_ceuqY7.js +16678 -0
- package/dist/base.css +5218 -639
- package/dist/blurdevicelottie-UO14Y0WC.js +15939 -0
- package/dist/bottomSheet-DE_8TFEC.js +31 -0
- package/dist/browser-ponyfill-jOkuz57z.js +299 -0
- package/dist/button-DcCUEn2n.js +24 -0
- package/dist/checkbox-Cl57ltq_.js +85 -0
- package/dist/consent/consent.es.js +90 -0
- package/dist/consent/styles.css +116 -0
- package/dist/countrySelector-CE-JgIsv.js +58 -0
- package/dist/cpf-ocr/styles.css +45 -0
- package/dist/cpfOcr-D_tbwbvh.js +78 -0
- package/dist/cross-document-data-match/cross-document-data-match.es.js +18 -0
- package/dist/curp-validation/curp-validation.es.js +279 -0
- package/dist/curp-validation/styles.css +82 -0
- package/dist/custom-fields/styles.css +22 -0
- package/dist/customFields-CW38fQUv.js +127 -0
- package/dist/customWatchlist-D9_yjEQd.js +33 -0
- package/dist/dateInputComposed-BpAGsjN6.js +55 -0
- package/dist/dateInputComposed-DU3o6PAV.js +1 -0
- package/dist/defineProperty-Dh8nSJpJ.js +39 -0
- package/dist/document-capture/styles.css +367 -0
- package/dist/documentCapture-xX-JT7ZY.js +763 -0
- package/dist/dropdownComposed-DFRBG22E.js +284 -0
- package/dist/dropdownComposed-DwTzc2YU.js +1 -0
- package/dist/dynamic-forms/styles.css +36 -0
- package/dist/dynamicForms-CJP1Ia6Q.js +262 -0
- package/dist/ekyb/ekyb.es.js +2 -0
- package/dist/ekyb/styles.css +137 -0
- package/dist/ekybModule-BSs7mndb.js +280 -0
- package/dist/ekybModule-D9M3E2Gm.js +2 -0
- package/dist/ekyc/ekyc.es.js +2 -0
- package/dist/ekyc/styles.css +106 -0
- package/dist/ekycModule-CU9pt5YN.js +246 -0
- package/dist/ekycModule-CZw9cLno.js +2 -0
- package/dist/electronic-signature/electronic-signature.es.js +2 -0
- package/dist/electronic-signature-COYXjGdd.js +410 -0
- package/dist/email/email.es.js +87 -145
- package/dist/email/styles.css +5 -116
- package/dist/emailInput-DppGf9pv.js +37 -0
- package/dist/expiredId-BnmzE8T3.js +70 -0
- package/dist/extensibility-CzEJfRwo.js +2586 -0
- package/dist/extensibility.es.js +25 -0
- package/dist/face-match/face-match.es.js +2 -0
- package/dist/face-match/styles.css +910 -0
- package/dist/faceMatch-B8j0g0Yo.js +2 -0
- package/dist/faceMatch-BV8UD7tj.js +201 -0
- package/dist/flip-animation-CgwRsEmK.js +6983 -0
- package/dist/flow/flow.es.js +646 -542
- package/dist/flow/styles.css +4524 -440
- package/dist/front-horizontal-hint-DGGGi8e1.js +380 -0
- package/dist/front-vertical-hint-CNr5mE6Q.js +420 -0
- package/dist/frontdevicelottie-Bu6f9fDE.js +17302 -0
- package/dist/geolocation/geolocation.es.js +857 -0
- package/dist/geolocation/styles.css +158 -0
- package/dist/glaredevicelottie-B10axYs_.js +14466 -0
- package/dist/governmentValidation/governmentValidation.es.js +98 -0
- package/dist/governmentValidation/styles.css +58 -0
- package/dist/homeScreen-DnP1jw9A.js +227 -0
- package/dist/hooks-BVnGysT7.js +80 -0
- package/dist/i18n-9s4OSqwi.js +2010 -0
- package/dist/icons-Cc7zwchP.js +310 -0
- package/dist/id/id.es.js +832 -0
- package/dist/id/styles.css +1287 -0
- package/dist/id-laser-h-mBAzHVOK.js +467 -0
- package/dist/id-laser-v-CrFg4bcJ.js +483 -0
- package/dist/id-ocr/styles.css +46 -0
- package/dist/id-tutorial-BCr42Pnn.js +13153 -0
- package/dist/id-verification/id-verification.es.js +20 -0
- package/dist/idOcr-CCjfWQvH.js +94 -0
- package/dist/identity-reuse/identity-reuse.es.js +198 -0
- package/dist/identity-reuse/styles.css +163 -0
- package/dist/incode-logo-DX016usY.js +4 -0
- package/dist/incodeComponent-C1o4M0ZK.js +50 -0
- package/dist/incodeModule-BqCjVgEI.js +18 -0
- package/dist/index.es.js +16 -6
- package/dist/inputComposed-APSw8C7o.js +89 -0
- package/dist/inputComposed-XYrarFxS.js +1 -0
- package/dist/loadingIcon-BN5YRQUb.js +104 -0
- package/dist/mandatoryConsent-DssKMC3v.js +100 -0
- package/dist/modal-NMxsQHAO.js +135 -0
- package/dist/modal.hooks-CAjcIFZK.js +126 -0
- package/dist/numberedStep-CT-alrK5.js +11 -0
- package/dist/optionAccessibleLabel-CzEeX3Q4.js +140 -0
- package/dist/otpInput-DqRA_egd.js +145 -0
- package/dist/page-C1yT4DLb.js +69 -0
- package/dist/passport-horizontal-hint-Bgquwtac.js +293 -0
- package/dist/passport-tutorial-DwRwtPVX.js +11689 -0
- package/dist/passport-vertical-hint-BT1D5BrW.js +267 -0
- package/dist/pdf-BurGZ08w.js +14967 -0
- package/dist/pdfViewer-BGBNL1Ea.js +63 -0
- package/dist/phone/phone.es.js +98 -3441
- package/dist/phone/styles.css +3 -297
- package/dist/phoneInputComposed-bvWhGLFZ.js +11206 -0
- package/dist/processing-G_y3o32b.js +6 -0
- package/dist/qe-signature/qe-signature.es.js +15 -0
- package/dist/radioGroupComposed-BbmvxmD2.js +177 -0
- package/dist/redirect-to-mobile/styles.css +588 -0
- package/dist/redirectToMobile-C3k1gloW.js +1514 -0
- package/dist/requiredLabelHint-BLwgqozE.js +13 -0
- package/dist/richText-DbJ5sl2n.js +1973 -0
- package/dist/rolldown-runtime-CYMK-g2i.js +20 -0
- package/dist/selfie/selfie.es.js +42 -892
- package/dist/selfie/styles.css +298 -184
- package/dist/selfieTutorial-BgrlUMXP.js +2677 -0
- package/dist/signature/signature.es.js +546 -0
- package/dist/snackbar-BDp8x7Cv.js +14 -0
- package/dist/spinner-B4dcie2T.js +1 -0
- package/dist/spinner-CKnjVHxw.js +39 -0
- package/dist/statusPage-CUI7ApcU.js +28 -0
- package/dist/successIcon-DbILeIz_.js +28 -0
- package/dist/tabs-DaPyP71c.js +78 -0
- package/dist/themes/dark.css +846 -151
- package/dist/themes/light.css +798 -116
- package/dist/transitionSpinner-PIEPU2Vx.js +17 -0
- package/dist/tutorial-9vHAHvMK.js +2587 -0
- package/dist/types/ae-signature.d.ts +40 -0
- package/dist/types/antifraud.d.ts +40 -0
- package/dist/types/authentication.d.ts +45 -0
- package/dist/types/consent.d.ts +41 -0
- package/dist/types/cpf-ocr/styles.d.ts +1 -0
- package/dist/types/cross-document-data-match.d.ts +34 -0
- package/dist/types/curp-validation.d.ts +40 -0
- package/dist/types/custom-fields/styles.d.ts +1 -0
- package/dist/types/document-capture/styles.d.ts +1 -0
- package/dist/types/dynamic-forms/styles.d.ts +1 -0
- package/dist/types/ekyb.d.ts +34 -0
- package/dist/types/ekyc.d.ts +34 -0
- package/dist/types/electronic-signature.d.ts +43 -0
- package/dist/types/email.d.ts +14 -4
- package/dist/types/extensibility.d.ts +981 -0
- package/dist/types/face-match.d.ts +59 -0
- package/dist/types/flow.d.ts +81 -13
- package/dist/types/geolocation.d.ts +41 -0
- package/dist/types/governmentValidation.d.ts +34 -0
- package/dist/types/id-ocr/styles.d.ts +1 -0
- package/dist/types/id-verification.d.ts +40 -0
- package/dist/types/id.d.ts +41 -0
- package/dist/types/identity-reuse.d.ts +43 -0
- package/dist/types/index.d.ts +6 -12
- package/dist/types/mandatory-consent/styles.d.ts +1 -0
- package/dist/types/phone.d.ts +14 -4
- package/dist/types/qe-signature.d.ts +40 -0
- package/dist/types/redirect-to-mobile/styles.d.ts +1 -0
- package/dist/types/selfie.d.ts +14 -4
- package/dist/types/signature.d.ts +40 -0
- package/dist/types/watchlist-for-business/styles.d.ts +1 -0
- package/dist/types/watchlist.d.ts +40 -0
- package/dist/types/workflow.d.ts +91 -0
- package/dist/typography-CxjaknHN.js +28 -0
- package/dist/uiConfig-CwpQ-IM6.js +20 -0
- package/dist/useModuleLoader-BFiVA41N.js +432 -0
- package/dist/vendor-preact-D6SntenC.js +958 -0
- package/dist/verificationResult-BrVbUJ4U.js +97 -0
- package/dist/verifiedByIncode-ChZBpqNy.js +101 -0
- package/dist/watchlist/watchlist.es.js +33 -0
- package/dist/watchlist-for-business/styles.css +18 -0
- package/dist/watchlistForBusiness-BcSNtHCV.js +77 -0
- package/dist/workflow/styles.css +4612 -0
- package/dist/workflow/workflow.es.js +244 -0
- package/package.json +211 -15
- package/dist/browser-ponyfill-B6W6hHVY.js +0 -344
- package/dist/incodeModule-Dv8Qllrv.js +0 -254
- package/dist/instance-B-q0ZREN.js +0 -2140
- package/dist/otpInput-BtoZe0Wz.js +0 -151
- package/dist/page-D9ijzlSn.js +0 -234
- package/dist/selfieTutorial-C-u5GufD.js +0 -29
- package/dist/setup-wNL83jmW.js +0 -20
- package/dist/title-BfO5Dlzk.js +0 -25
- package/dist/uiConfig-CQ1W9cUD.js +0 -23
- package/dist/vendor-preact-CK0WeTOR.js +0 -584
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { n as e } from "./i18n-9s4OSqwi.js";
|
|
2
|
+
import { d as t, v as n } from "./vendor-preact-D6SntenC.js";
|
|
3
|
+
import { t as r } from "./dropdownComposed-DFRBG22E.js";
|
|
4
|
+
//#region src/shared/countrySelector/countrySelector.tsx
|
|
5
|
+
var i = [
|
|
6
|
+
"BR",
|
|
7
|
+
"CN",
|
|
8
|
+
"FR",
|
|
9
|
+
"DE",
|
|
10
|
+
"IL",
|
|
11
|
+
"IT",
|
|
12
|
+
"MX",
|
|
13
|
+
"ES",
|
|
14
|
+
"GB",
|
|
15
|
+
"US"
|
|
16
|
+
], a = [
|
|
17
|
+
"CM",
|
|
18
|
+
"KE",
|
|
19
|
+
"NG"
|
|
20
|
+
];
|
|
21
|
+
function o(e) {
|
|
22
|
+
return [...e.toUpperCase()].map((e) => String.fromCodePoint(127462 + e.charCodeAt(0) - 65)).join("");
|
|
23
|
+
}
|
|
24
|
+
function s() {
|
|
25
|
+
if (typeof window > "u") return !1;
|
|
26
|
+
let { hostname: e } = window.location;
|
|
27
|
+
return e === "localhost" || e.includes("stage") || e.includes("demo");
|
|
28
|
+
}
|
|
29
|
+
var c = ({ value: c, onChange: l, label: u, id: d = "country-selector", countryCodes: f = i, devOnlyCountryCodes: p = a, "data-testid": m }) => {
|
|
30
|
+
let { i18n: h } = e(), g = h.language || "en";
|
|
31
|
+
return /* @__PURE__ */ n("div", {
|
|
32
|
+
class: "IncodeCountrySelector",
|
|
33
|
+
children: /* @__PURE__ */ n(r, {
|
|
34
|
+
id: d,
|
|
35
|
+
label: u,
|
|
36
|
+
value: c,
|
|
37
|
+
options: t(() => {
|
|
38
|
+
let e = new Intl.DisplayNames([g, "en"], { type: "region" });
|
|
39
|
+
return (s() ? [...f, ...p] : [...f]).map((t) => {
|
|
40
|
+
let n = e.of(t) ?? t;
|
|
41
|
+
return {
|
|
42
|
+
value: t,
|
|
43
|
+
label: `${o(t)} ${n}`,
|
|
44
|
+
ariaLabel: n
|
|
45
|
+
};
|
|
46
|
+
}).sort((e, t) => e.label.localeCompare(t.label, g));
|
|
47
|
+
}, [
|
|
48
|
+
f,
|
|
49
|
+
p,
|
|
50
|
+
g
|
|
51
|
+
]),
|
|
52
|
+
onChange: l,
|
|
53
|
+
"data-testid": m
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { c as t };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
.IncodeCpfOcrPage {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
animation: fadeIn var(--motion-fade-in-duration, .7s) ease-out;
|
|
6
|
+
margin-inline: auto;
|
|
7
|
+
animation-fill-mode: both;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@media (min-width: 48rem) {
|
|
11
|
+
.IncodeCpfOcrPage.IncodePageContainer {
|
|
12
|
+
align-items: stretch;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.IncodeCpfOcrPage .IncodePageInner {
|
|
17
|
+
height: 100%;
|
|
18
|
+
min-height: var(--spacing-0, var(--spacing-none, 0px));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.IncodeCpfOcrPage .IncodePageContent {
|
|
22
|
+
min-height: var(--spacing-0, var(--spacing-none, 0px));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.IncodeCpfOcrPage .IncodeCpfOcr {
|
|
26
|
+
height: 100%;
|
|
27
|
+
min-height: var(--spacing-0, var(--spacing-none, 0px));
|
|
28
|
+
width: 100%;
|
|
29
|
+
max-width: var(--incode-form-max-w);
|
|
30
|
+
align-items: center;
|
|
31
|
+
gap: var(--spacing-16, var(--spacing-16, 16px));
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
flex: 1;
|
|
34
|
+
display: flex;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.IncodeCpfOcrPage .IncodeCpfOcrLoading {
|
|
38
|
+
height: 100%;
|
|
39
|
+
min-height: var(--spacing-0, var(--spacing-none, 0px));
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
flex: 1;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { _ as e, p as t, v as n } from "./vendor-preact-D6SntenC.js";
|
|
2
|
+
import { o as r } from "./hooks-BVnGysT7.js";
|
|
3
|
+
import { r as i } from "./loadingIcon-BN5YRQUb.js";
|
|
4
|
+
import { t as a } from "./page-C1yT4DLb.js";
|
|
5
|
+
import { t as o } from "./spinner-CKnjVHxw.js";
|
|
6
|
+
import "./spinner-B4dcie2T.js";
|
|
7
|
+
import { t as s } from "./button-DcCUEn2n.js";
|
|
8
|
+
import { t as c } from "./verificationResult-BrVbUJ4U.js";
|
|
9
|
+
import { t as l } from "./inputComposed-APSw8C7o.js";
|
|
10
|
+
import { createCpfOcrManager as u } from "@incodetech/core/cpf-ocr";
|
|
11
|
+
//#region src/modules/cpf-ocr/cpfOcr.tsx
|
|
12
|
+
var d = (e) => e.status === "inputting" ? {
|
|
13
|
+
cpf: e.cpf,
|
|
14
|
+
isValid: e.isValid
|
|
15
|
+
} : {
|
|
16
|
+
cpf: "",
|
|
17
|
+
isValid: !1
|
|
18
|
+
}, f = ({ onFinish: f, onError: p }) => {
|
|
19
|
+
let [m, h] = r(() => u()), [g, _] = t(!1), [v, y] = t(!1), [b, x] = t(!1);
|
|
20
|
+
if (e(() => {
|
|
21
|
+
m.status === "finished" && f?.();
|
|
22
|
+
}, [m.status, f]), e(() => {
|
|
23
|
+
m.status === "error" && p?.(m.error);
|
|
24
|
+
}, [m, p]), m.status === "idle" || m.status === "loading" || m.status === "submitting") return /* @__PURE__ */ n(a, {
|
|
25
|
+
className: "IncodeCpfOcrPage",
|
|
26
|
+
children: /* @__PURE__ */ n("div", {
|
|
27
|
+
class: "IncodeCpfOcrLoading",
|
|
28
|
+
children: /* @__PURE__ */ n(o, { fullScreen: !1 })
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
if (m.status === "error") return /* @__PURE__ */ n(c, {
|
|
32
|
+
status: "failure",
|
|
33
|
+
failureTitle: "Não foi possível verificar o CPF",
|
|
34
|
+
onRetry: () => h.retry()
|
|
35
|
+
});
|
|
36
|
+
if (m.status === "finished") return null;
|
|
37
|
+
let S = d(m), C = S.cpf.replace(/\D/g, "").length === 11, w = v && !S.isValid && (C || g && !b) ? "Insira um CPF válido" : void 0;
|
|
38
|
+
return /* @__PURE__ */ n(a, {
|
|
39
|
+
className: "IncodeCpfOcrPage",
|
|
40
|
+
title: "Insira e verifique o número do seu CPF",
|
|
41
|
+
children: /* @__PURE__ */ n("div", {
|
|
42
|
+
class: "IncodeCpfOcr",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ n(i, { size: 32 }),
|
|
45
|
+
/* @__PURE__ */ n(l, {
|
|
46
|
+
id: "cpf-ocr-input",
|
|
47
|
+
label: "",
|
|
48
|
+
value: S.cpf,
|
|
49
|
+
placeholder: "Seu CPF",
|
|
50
|
+
maxLength: 14,
|
|
51
|
+
inputMode: "numeric",
|
|
52
|
+
"aria-label": "CPF",
|
|
53
|
+
onInput: (e) => {
|
|
54
|
+
y(!0), h.setCpf(e.target.value);
|
|
55
|
+
},
|
|
56
|
+
onFocus: () => {
|
|
57
|
+
x(!0);
|
|
58
|
+
},
|
|
59
|
+
onBlur: () => {
|
|
60
|
+
x(!1), _(!0);
|
|
61
|
+
},
|
|
62
|
+
error: w,
|
|
63
|
+
showErrorIcon: !0
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ n(i, {}),
|
|
66
|
+
/* @__PURE__ */ n(s, {
|
|
67
|
+
type: "button",
|
|
68
|
+
onClick: () => h.submit(),
|
|
69
|
+
disabled: !S.isValid,
|
|
70
|
+
"data-testid": "cpf-ocr-continue",
|
|
71
|
+
children: "Continuar"
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { f as CpfOcr };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _ as e, v as t } from "../vendor-preact-D6SntenC.js";
|
|
2
|
+
import { o as n } from "../hooks-BVnGysT7.js";
|
|
3
|
+
import { t as r } from "../incodeComponent-C1o4M0ZK.js";
|
|
4
|
+
import { t as i } from "../spinner-CKnjVHxw.js";
|
|
5
|
+
import { t as a } from "../incodeModule-BqCjVgEI.js";
|
|
6
|
+
import { createCrossDocumentDataMatchManager as o } from "@incodetech/core/cross-document-data-match";
|
|
7
|
+
//#region src/modules/cross-document-data-match/cross-document-data-match.tsx
|
|
8
|
+
var s = ({ onFinish: r }) => {
|
|
9
|
+
let [a, s] = n(() => o());
|
|
10
|
+
return e(() => {
|
|
11
|
+
s.load();
|
|
12
|
+
}, [s]), e(() => {
|
|
13
|
+
a.status === "finished" && r?.();
|
|
14
|
+
}, [a.status, r]), /* @__PURE__ */ t(i, { fullScreen: !0 });
|
|
15
|
+
}, c = ({ onFinish: e }) => /* @__PURE__ */ t(r, { children: /* @__PURE__ */ t(s, { onFinish: e }) });
|
|
16
|
+
a(c, "incode-cross-document-data-match");
|
|
17
|
+
//#endregion
|
|
18
|
+
export { c as CrossDocumentDataMatch };
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { n as e } from "../i18n-9s4OSqwi.js";
|
|
2
|
+
import { S as t, d as n, v as r } from "../vendor-preact-D6SntenC.js";
|
|
3
|
+
import { o as i } from "../hooks-BVnGysT7.js";
|
|
4
|
+
import { t as a } from "../incodeComponent-C1o4M0ZK.js";
|
|
5
|
+
import { r as o } from "../loadingIcon-BN5YRQUb.js";
|
|
6
|
+
import { t as s } from "../page-C1yT4DLb.js";
|
|
7
|
+
import { t as c } from "../transitionSpinner-PIEPU2Vx.js";
|
|
8
|
+
import { t as l } from "../button-DcCUEn2n.js";
|
|
9
|
+
import { g as u } from "../icons-Cc7zwchP.js";
|
|
10
|
+
import { t as d } from "../successIcon-DbILeIz_.js";
|
|
11
|
+
import { t as f } from "../inputComposed-APSw8C7o.js";
|
|
12
|
+
import { t as p } from "../dropdownComposed-DFRBG22E.js";
|
|
13
|
+
import "../dropdownComposed-DwTzc2YU.js";
|
|
14
|
+
import { t as m } from "../dateInputComposed-BpAGsjN6.js";
|
|
15
|
+
import "../dateInputComposed-DU3o6PAV.js";
|
|
16
|
+
import { t as h } from "../incodeModule-BqCjVgEI.js";
|
|
17
|
+
import { n as g, t as _ } from "../requiredLabelHint-BLwgqozE.js";
|
|
18
|
+
import { t as v } from "../autoFocusTitle-QexamZ4i.js";
|
|
19
|
+
import { GENERATE_CURP_FIELDS as y, createCurpValidationManager as b, mexicanStates as x } from "@incodetech/core/curp-validation";
|
|
20
|
+
//#region src/modules/curp-validation/curpInput.tsx
|
|
21
|
+
var S = ({ curp: t, errorKey: n, onCurpChange: i, onCurpBlur: a, onVerify: s, onSwitchToGenerate: c, disabled: u = !1, placeholder: d, continueLabel: p, dontHaveLabel: m }) => {
|
|
22
|
+
let { t: h } = e(), g = d ?? h("curp.placeholder.curp") ?? "CURP", _ = p ?? h("curp.continue") ?? "Continue", v = m ?? h("curp.dontHave") ?? "I don't have my CURP", y = n ? h(n) : void 0, b = t.length === 0 || !!y || u;
|
|
23
|
+
return /* @__PURE__ */ r("div", {
|
|
24
|
+
class: "IncodeCurpValidation IncodeCurpInput",
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ r(f, {
|
|
27
|
+
id: "curp-input",
|
|
28
|
+
value: t,
|
|
29
|
+
onInput: (e) => {
|
|
30
|
+
let t = e.target;
|
|
31
|
+
i(t.value.toUpperCase());
|
|
32
|
+
},
|
|
33
|
+
onBlur: a,
|
|
34
|
+
placeholder: g,
|
|
35
|
+
disabled: u,
|
|
36
|
+
required: !0,
|
|
37
|
+
maxLength: 18,
|
|
38
|
+
"aria-label": h("curp.placeholder.curp") ?? "CURP",
|
|
39
|
+
error: y,
|
|
40
|
+
showErrorIcon: !!y
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ r(o, {}),
|
|
43
|
+
/* @__PURE__ */ r(l, {
|
|
44
|
+
type: "button",
|
|
45
|
+
onClick: s,
|
|
46
|
+
disabled: b,
|
|
47
|
+
"data-testid": "curp-verify",
|
|
48
|
+
children: _
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ r(l, {
|
|
51
|
+
type: "button",
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
onClick: c,
|
|
54
|
+
disabled: u,
|
|
55
|
+
"data-testid": "curp-switch-to-generate",
|
|
56
|
+
children: v
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}, C = ({ form: t, validationErrors: i, onFormChange: a, onValidateField: s, onGenerate: c, disabled: u = !1, labels: d }) => {
|
|
61
|
+
let { t: h } = e(), v = {
|
|
62
|
+
firstName: h("curp.labels.firstName") ?? "Your First name",
|
|
63
|
+
firstLast: h("curp.labels.firstLast") ?? "Your First last name",
|
|
64
|
+
secondLast: h("curp.labels.secondLast") ?? "Your Second last name",
|
|
65
|
+
gender: h("curp.labels.genderV2") ?? "Gender",
|
|
66
|
+
genderPlaceholder: h("curp.placeholder.gender") ?? "Choose gender",
|
|
67
|
+
male: h("curp.labels.maleV2") ?? "Male",
|
|
68
|
+
female: h("curp.labels.femaleV2") ?? "Female",
|
|
69
|
+
other: h("curp.labels.other") ?? "Other",
|
|
70
|
+
dob: h("curp.labels.dob") ?? "Date of birth",
|
|
71
|
+
birthState: h("curp.labels.birthState") ?? "State of birth",
|
|
72
|
+
statePlaceholder: h("curp.placeholder.state") ?? "Select state",
|
|
73
|
+
generate: h("curp.generateCta") ?? "Generate CURP",
|
|
74
|
+
...d
|
|
75
|
+
}, b = n(() => g(y.map((e) => e.required)), []), S = !!i && Object.keys(i).length > 0, C = (e) => (t) => {
|
|
76
|
+
let n = t.target;
|
|
77
|
+
a({ [e]: n.value });
|
|
78
|
+
}, w = (e) => () => {
|
|
79
|
+
s(e);
|
|
80
|
+
}, T = [
|
|
81
|
+
{
|
|
82
|
+
value: "H",
|
|
83
|
+
label: v.male
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: "M",
|
|
87
|
+
label: v.female
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: "X",
|
|
91
|
+
label: v.other
|
|
92
|
+
}
|
|
93
|
+
], E = x.map((e) => ({
|
|
94
|
+
value: e.value,
|
|
95
|
+
label: e.label
|
|
96
|
+
})), D = (e) => {
|
|
97
|
+
switch (e) {
|
|
98
|
+
case "name": return v.firstName;
|
|
99
|
+
case "firstLastName": return v.firstLast;
|
|
100
|
+
case "secondLastName": return v.secondLast;
|
|
101
|
+
case "gender": return v.gender;
|
|
102
|
+
case "birthDate": return v.dob;
|
|
103
|
+
case "birthState": return v.birthState;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ r("div", {
|
|
107
|
+
class: "IncodeCurpValidation IncodeGenerateCurpForm",
|
|
108
|
+
children: [
|
|
109
|
+
y.map((e) => {
|
|
110
|
+
let n = _(b, e.required), o = n ? h(`forms.label.${n}`) ?? void 0 : void 0, s = i?.[e.key], c = s ? h(s) ?? void 0 : void 0, l = D(e.key);
|
|
111
|
+
if (e.type === "dropdown") {
|
|
112
|
+
let n = e.key === "gender" ? T : E, i = e.key === "gender" ? v.genderPlaceholder : v.statePlaceholder;
|
|
113
|
+
return /* @__PURE__ */ r(p, {
|
|
114
|
+
id: `curp-${e.key === "birthState" ? "birth-state" : "gender"}`,
|
|
115
|
+
label: l,
|
|
116
|
+
labelHint: o,
|
|
117
|
+
placeholder: i,
|
|
118
|
+
value: t[e.key],
|
|
119
|
+
options: n,
|
|
120
|
+
disabled: u,
|
|
121
|
+
required: e.required,
|
|
122
|
+
onChange: (t) => {
|
|
123
|
+
e.key === "gender" ? a({ gender: t }) : a({ [e.key]: t });
|
|
124
|
+
},
|
|
125
|
+
onBlur: w(e.key),
|
|
126
|
+
error: c,
|
|
127
|
+
showErrorIcon: !!c,
|
|
128
|
+
"data-testid": e.key === "gender" ? "curp-gender" : "curp-birth-state",
|
|
129
|
+
...e.key === "birthState" ? { searchable: !0 } : {}
|
|
130
|
+
}, e.key);
|
|
131
|
+
}
|
|
132
|
+
return e.type === "date" ? /* @__PURE__ */ r(m, {
|
|
133
|
+
id: "curp-birth-date",
|
|
134
|
+
label: l,
|
|
135
|
+
labelHint: o,
|
|
136
|
+
value: t.birthDate,
|
|
137
|
+
onInput: C("birthDate"),
|
|
138
|
+
onBlur: w("birthDate"),
|
|
139
|
+
max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
140
|
+
placeholder: h("curp.placeholder.dob") ?? "mm/dd/yyyy",
|
|
141
|
+
disabled: u,
|
|
142
|
+
required: e.required,
|
|
143
|
+
error: c,
|
|
144
|
+
showErrorIcon: !!c,
|
|
145
|
+
"data-testid": "curp-birth-date"
|
|
146
|
+
}, e.key) : /* @__PURE__ */ r(f, {
|
|
147
|
+
id: e.key === "name" ? "curp-first-name" : e.key === "firstLastName" ? "curp-first-last" : "curp-second-last",
|
|
148
|
+
label: l,
|
|
149
|
+
labelHint: o,
|
|
150
|
+
value: t[e.key],
|
|
151
|
+
onInput: C(e.key),
|
|
152
|
+
onBlur: w(e.key),
|
|
153
|
+
placeholder: l,
|
|
154
|
+
disabled: u,
|
|
155
|
+
required: e.required,
|
|
156
|
+
error: c,
|
|
157
|
+
showErrorIcon: !!c,
|
|
158
|
+
...e.autoComplete ? { autoComplete: e.autoComplete } : {}
|
|
159
|
+
}, e.key);
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ r(o, { size: 16 }),
|
|
162
|
+
/* @__PURE__ */ r(l, {
|
|
163
|
+
type: "button",
|
|
164
|
+
onClick: c,
|
|
165
|
+
disabled: S || u,
|
|
166
|
+
"data-testid": "curp-generate",
|
|
167
|
+
children: v.generate
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
}, w = ({ config: n, onFinish: a, onError: p }) => {
|
|
172
|
+
let { t: m } = e(), [h, g] = i(() => {
|
|
173
|
+
if (!n) throw Error("CURP validation config is required");
|
|
174
|
+
return b({ config: n });
|
|
175
|
+
});
|
|
176
|
+
if (h.status === "idle" || h.status === "loading" || h.status === "verifying" || h.status === "generating") return /* @__PURE__ */ r(c, { spinnerConfig: { title: h.status === "generating" ? m("curp.status.generating") ?? "Generating..." : m("curp.status.verifying") ?? "Verifying..." } });
|
|
177
|
+
if (h.status === "enterCurp") return /* @__PURE__ */ r(s, {
|
|
178
|
+
className: "IncodeCurpValidationPage",
|
|
179
|
+
title: m("curp.enterCurp") ?? "Enter your CURP",
|
|
180
|
+
children: /* @__PURE__ */ r(S, {
|
|
181
|
+
curp: h.curp,
|
|
182
|
+
errorKey: h.validationErrors?.curp,
|
|
183
|
+
onCurpChange: (e) => g.setCurp(e),
|
|
184
|
+
onCurpBlur: () => g.validateField("curp"),
|
|
185
|
+
onVerify: () => g.verify(),
|
|
186
|
+
onSwitchToGenerate: () => g.switchToGenerate(),
|
|
187
|
+
placeholder: m("curp.placeholder.curp") ?? "CURP",
|
|
188
|
+
continueLabel: m("curp.continue") ?? "Continue",
|
|
189
|
+
dontHaveLabel: m("curp.dontHave") ?? "I don't have my CURP"
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
if (h.status === "generateCurp") return /* @__PURE__ */ r(s, {
|
|
193
|
+
className: "IncodeCurpValidationPage",
|
|
194
|
+
title: m("curp.generate") ?? "Generate your CURP",
|
|
195
|
+
hideFooterBranding: !0,
|
|
196
|
+
children: /* @__PURE__ */ r(C, {
|
|
197
|
+
form: h.form,
|
|
198
|
+
validationErrors: h.validationErrors,
|
|
199
|
+
onFormChange: (e) => g.setGenerateForm(e),
|
|
200
|
+
onValidateField: (e) => g.validateField(e),
|
|
201
|
+
onGenerate: () => g.generate()
|
|
202
|
+
})
|
|
203
|
+
});
|
|
204
|
+
if (h.status === "confirmCurp") return /* @__PURE__ */ r(s, {
|
|
205
|
+
className: "IncodeCurpValidationPage",
|
|
206
|
+
title: m("curp.status.confirm") ?? "Confirm your CURP",
|
|
207
|
+
children: /* @__PURE__ */ r("div", {
|
|
208
|
+
class: "IncodeCurpValidation IncodeCurpConfirm",
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ r(f, {
|
|
211
|
+
id: "curp-confirm-input",
|
|
212
|
+
value: h.curp,
|
|
213
|
+
readOnly: !0,
|
|
214
|
+
"aria-label": m("curp.status.generatedCurp") ?? "Generated CURP",
|
|
215
|
+
"data-testid": "curp-confirm-input"
|
|
216
|
+
}),
|
|
217
|
+
/* @__PURE__ */ r(o, {}),
|
|
218
|
+
/* @__PURE__ */ r(l, {
|
|
219
|
+
type: "button",
|
|
220
|
+
onClick: () => g.confirmGenerated(),
|
|
221
|
+
"data-testid": "curp-confirm",
|
|
222
|
+
children: m("curp.continue") ?? "Continue"
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
if (h.status === "success") return /* @__PURE__ */ r(s, {
|
|
228
|
+
className: "IncodeCurpValidationPage",
|
|
229
|
+
children: /* @__PURE__ */ r("div", {
|
|
230
|
+
class: "IncodeCurpValidation IncodeCurpSuccess",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ r(d, { size: 64 }),
|
|
233
|
+
/* @__PURE__ */ r(o, { size: 16 }),
|
|
234
|
+
/* @__PURE__ */ r(v, {
|
|
235
|
+
className: "IncodeCurpSuccessTitle",
|
|
236
|
+
children: m("curp.status.verified") ?? "Verified"
|
|
237
|
+
})
|
|
238
|
+
]
|
|
239
|
+
})
|
|
240
|
+
});
|
|
241
|
+
if (h.status === "failure" || h.status === "generateError") {
|
|
242
|
+
let e = h.retriesLeft > 0, n = h.status === "failure" ? m("curp.status.notVerified") ?? "Not verified" : m("curp.status.couldntGenerate") ?? "Couldn't generate CURP";
|
|
243
|
+
return /* @__PURE__ */ r(s, {
|
|
244
|
+
className: "IncodeCurpValidationPage",
|
|
245
|
+
children: /* @__PURE__ */ r("div", {
|
|
246
|
+
class: "IncodeCurpValidation IncodeCurpFailure",
|
|
247
|
+
children: [
|
|
248
|
+
/* @__PURE__ */ r(o, {}),
|
|
249
|
+
/* @__PURE__ */ r(u, { size: 64 }),
|
|
250
|
+
/* @__PURE__ */ r(o, { size: 16 }),
|
|
251
|
+
/* @__PURE__ */ r(v, {
|
|
252
|
+
className: "IncodeCurpFailureTitle",
|
|
253
|
+
children: n
|
|
254
|
+
}),
|
|
255
|
+
h.status === "generateError" && e && /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ r(o, { size: 12 }), /* @__PURE__ */ r("p", {
|
|
256
|
+
class: "IncodeCurpFailureHint",
|
|
257
|
+
role: "alert",
|
|
258
|
+
children: m("curp.status.checkInfo") ?? "Please check your information"
|
|
259
|
+
})] }),
|
|
260
|
+
/* @__PURE__ */ r(o, {}),
|
|
261
|
+
e && /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(l, {
|
|
262
|
+
type: "button",
|
|
263
|
+
onClick: () => g.retry(),
|
|
264
|
+
"data-testid": "curp-retry",
|
|
265
|
+
children: h.status === "failure" ? m("curp.status.tryAgain") ?? "Try again" : m("curp.status.edit") ?? "Edit information"
|
|
266
|
+
}) })
|
|
267
|
+
]
|
|
268
|
+
})
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
return h.status === "finished" ? (a?.(), null) : (h.status === "closed" && p?.(void 0), null);
|
|
272
|
+
}, T = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ r(a, { children: e ? /* @__PURE__ */ r(w, {
|
|
273
|
+
config: e,
|
|
274
|
+
onFinish: t,
|
|
275
|
+
onError: n
|
|
276
|
+
}) : null });
|
|
277
|
+
h(T, "incode-curp-validation");
|
|
278
|
+
//#endregion
|
|
279
|
+
export { T as CurpValidation };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
.IncodeCurpValidationPage .IncodePageContent {
|
|
3
|
+
padding-top: var(--spacing-32, var(--spacing-32, 32px));
|
|
4
|
+
padding-bottom: var(--spacing-16, var(--spacing-16, 16px));
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
display: flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.IncodeCurpValidationPage .IncodeCurpValidation {
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.IncodeCurpValidationPage .IncodeCurpInput {
|
|
19
|
+
min-height: var(--spacing-0, var(--spacing-none, 0px));
|
|
20
|
+
width: 100%;
|
|
21
|
+
max-width: var(--incode-form-max-w);
|
|
22
|
+
gap: var(--spacing-12, var(--spacing-12, 12px));
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
flex: 1;
|
|
25
|
+
display: flex;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.IncodeCurpValidationPage .IncodeCurpInput .IncodeButtonSecondary:focus {
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.IncodeCurpValidationPage .IncodeCurpInput .IncodeButtonSecondary:active {
|
|
33
|
+
color: var(--color-button-secondary-text-default, var(--button-secondary-text-default));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.IncodeCurpValidationPage .IncodeGenerateCurpForm {
|
|
37
|
+
width: 100%;
|
|
38
|
+
max-width: var(--incode-form-max-w);
|
|
39
|
+
gap: var(--spacing-8, var(--spacing-8, 8px));
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
display: flex;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.IncodeCurpValidationPage .IncodeCurpConfirm {
|
|
45
|
+
width: 100%;
|
|
46
|
+
max-width: var(--incode-curp-confirm-max-w);
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
display: flex;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.IncodeCurpValidationPage .IncodeCurpConfirm .IncodeInput {
|
|
53
|
+
text-align: center;
|
|
54
|
+
font-family: var(--typography-input-dropdown-family);
|
|
55
|
+
font-size: var(--typography-input-dropdown-m-size);
|
|
56
|
+
font-weight: var(--typography-input-dropdown-m-weight);
|
|
57
|
+
line-height: var(--typography-input-dropdown-m-line-height);
|
|
58
|
+
letter-spacing: var(--typography-input-dropdown-m-letter-spacing);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.IncodeCurpValidationPage .IncodeCurpSuccess, .IncodeCurpValidationPage .IncodeCurpFailure {
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
align-items: center;
|
|
65
|
+
display: flex;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.IncodeCurpValidationPage .IncodeCurpSuccessTitle, .IncodeCurpValidationPage .IncodeCurpFailureTitle {
|
|
69
|
+
margin: var(--spacing-0, var(--spacing-none, 0px));
|
|
70
|
+
padding: var(--spacing-0, var(--spacing-none, 0px));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.IncodeCurpValidationPage .IncodeCurpFailureHint {
|
|
74
|
+
margin: var(--spacing-0, var(--spacing-none, 0px));
|
|
75
|
+
text-align: center;
|
|
76
|
+
font-family: var(--typography-headline-family);
|
|
77
|
+
font-size: var(--typography-headline-h5-size);
|
|
78
|
+
font-weight: var(--typography-headline-h5-weight);
|
|
79
|
+
line-height: var(--typography-headline-h5-line-height);
|
|
80
|
+
letter-spacing: var(--typography-headline-h5-letter-spacing);
|
|
81
|
+
color: var(--color-text-body-secondary, var(--text-body-500-secondary));
|
|
82
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
2
|
+
.IncodeCustomFieldsForm {
|
|
3
|
+
margin-top: var(--spacing-32, var(--spacing-32, 32px));
|
|
4
|
+
margin-bottom: var(--spacing-16, var(--spacing-16, 16px));
|
|
5
|
+
gap: var(--spacing-16, var(--spacing-16, 16px));
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
flex: 1;
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.IncodeCustomFieldsForm .IncodeCustomFieldsField {
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 100%;
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.IncodeCustomFieldsPage .IncodePageHeader {
|
|
21
|
+
margin-bottom: var(--spacing-16, var(--spacing-16, 16px));
|
|
22
|
+
}
|