@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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { h as q, l as A, v as u } from "./vendor-preact-DThS2ZQ_.js";
|
|
2
|
+
import { i as useModalFocusCapture, n as useModalBodyScrollLock, o as useModalTabCycle, r as useModalEscapeDismiss, s as useModalVisualViewportBounds } from "./modal.hooks-D2xhIuHA.js";
|
|
3
|
+
//#region src/shared/bottomSheet/bottomSheet.tsx
|
|
4
|
+
var BottomSheet = ({ isOpen = false, onClose, labelledById, children }) => {
|
|
5
|
+
const dialogRef = A(null);
|
|
6
|
+
const overlayRef = A(null);
|
|
7
|
+
const requestClose = q(() => {
|
|
8
|
+
onClose?.();
|
|
9
|
+
}, [onClose]);
|
|
10
|
+
useModalBodyScrollLock(isOpen);
|
|
11
|
+
useModalEscapeDismiss(isOpen, true, requestClose);
|
|
12
|
+
useModalFocusCapture(isOpen, dialogRef);
|
|
13
|
+
useModalTabCycle(isOpen, dialogRef);
|
|
14
|
+
useModalVisualViewportBounds(isOpen, overlayRef);
|
|
15
|
+
if (!isOpen) return null;
|
|
16
|
+
return /* @__PURE__ */ u("div", {
|
|
17
|
+
ref: overlayRef,
|
|
18
|
+
class: "IncodeBottomSheetOverlay",
|
|
19
|
+
onClick: (event) => {
|
|
20
|
+
if (event.target === event.currentTarget) requestClose();
|
|
21
|
+
},
|
|
22
|
+
children: /* @__PURE__ */ u("div", {
|
|
23
|
+
class: "IncodeBottomSheetContainer",
|
|
24
|
+
onClick: requestClose,
|
|
25
|
+
children: /* @__PURE__ */ u("div", {
|
|
26
|
+
ref: dialogRef,
|
|
27
|
+
class: "IncodeBottomSheet",
|
|
28
|
+
role: "dialog",
|
|
29
|
+
"aria-modal": "true",
|
|
30
|
+
"aria-labelledby": labelledById,
|
|
31
|
+
tabIndex: -1,
|
|
32
|
+
onClick: (event) => event.stopPropagation(),
|
|
33
|
+
children
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { BottomSheet as t };
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
import { t as __commonJSMin } from "./rolldown-runtime--E5BIlTp.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/cross-fetch@4.0.0/node_modules/cross-fetch/dist/browser-ponyfill.js
|
|
3
|
+
var require_browser_ponyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
var __global__ = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof global !== "undefined" && global;
|
|
5
|
+
var __globalThis__ = (function() {
|
|
6
|
+
function F() {
|
|
7
|
+
this.fetch = false;
|
|
8
|
+
this.DOMException = __global__.DOMException;
|
|
9
|
+
}
|
|
10
|
+
F.prototype = __global__;
|
|
11
|
+
return new F();
|
|
12
|
+
})();
|
|
13
|
+
(function(globalThis) {
|
|
14
|
+
(function(exports$1) {
|
|
15
|
+
var global = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || typeof global !== "undefined" && global;
|
|
16
|
+
var support = {
|
|
17
|
+
searchParams: "URLSearchParams" in global,
|
|
18
|
+
iterable: "Symbol" in global && "iterator" in Symbol,
|
|
19
|
+
blob: "FileReader" in global && "Blob" in global && (function() {
|
|
20
|
+
try {
|
|
21
|
+
new Blob();
|
|
22
|
+
return true;
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
})(),
|
|
27
|
+
formData: "FormData" in global,
|
|
28
|
+
arrayBuffer: "ArrayBuffer" in global
|
|
29
|
+
};
|
|
30
|
+
function isDataView(obj) {
|
|
31
|
+
return obj && DataView.prototype.isPrototypeOf(obj);
|
|
32
|
+
}
|
|
33
|
+
if (support.arrayBuffer) {
|
|
34
|
+
var viewClasses = [
|
|
35
|
+
"[object Int8Array]",
|
|
36
|
+
"[object Uint8Array]",
|
|
37
|
+
"[object Uint8ClampedArray]",
|
|
38
|
+
"[object Int16Array]",
|
|
39
|
+
"[object Uint16Array]",
|
|
40
|
+
"[object Int32Array]",
|
|
41
|
+
"[object Uint32Array]",
|
|
42
|
+
"[object Float32Array]",
|
|
43
|
+
"[object Float64Array]"
|
|
44
|
+
];
|
|
45
|
+
var isArrayBufferView = ArrayBuffer.isView || function(obj) {
|
|
46
|
+
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function normalizeName(name) {
|
|
50
|
+
if (typeof name !== "string") name = String(name);
|
|
51
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") throw new TypeError("Invalid character in header field name: \"" + name + "\"");
|
|
52
|
+
return name.toLowerCase();
|
|
53
|
+
}
|
|
54
|
+
function normalizeValue(value) {
|
|
55
|
+
if (typeof value !== "string") value = String(value);
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
function iteratorFor(items) {
|
|
59
|
+
var iterator = { next: function() {
|
|
60
|
+
var value = items.shift();
|
|
61
|
+
return {
|
|
62
|
+
done: value === void 0,
|
|
63
|
+
value
|
|
64
|
+
};
|
|
65
|
+
} };
|
|
66
|
+
if (support.iterable) iterator[Symbol.iterator] = function() {
|
|
67
|
+
return iterator;
|
|
68
|
+
};
|
|
69
|
+
return iterator;
|
|
70
|
+
}
|
|
71
|
+
function Headers(headers) {
|
|
72
|
+
this.map = {};
|
|
73
|
+
if (headers instanceof Headers) headers.forEach(function(value, name) {
|
|
74
|
+
this.append(name, value);
|
|
75
|
+
}, this);
|
|
76
|
+
else if (Array.isArray(headers)) headers.forEach(function(header) {
|
|
77
|
+
this.append(header[0], header[1]);
|
|
78
|
+
}, this);
|
|
79
|
+
else if (headers) Object.getOwnPropertyNames(headers).forEach(function(name) {
|
|
80
|
+
this.append(name, headers[name]);
|
|
81
|
+
}, this);
|
|
82
|
+
}
|
|
83
|
+
Headers.prototype.append = function(name, value) {
|
|
84
|
+
name = normalizeName(name);
|
|
85
|
+
value = normalizeValue(value);
|
|
86
|
+
var oldValue = this.map[name];
|
|
87
|
+
this.map[name] = oldValue ? oldValue + ", " + value : value;
|
|
88
|
+
};
|
|
89
|
+
Headers.prototype["delete"] = function(name) {
|
|
90
|
+
delete this.map[normalizeName(name)];
|
|
91
|
+
};
|
|
92
|
+
Headers.prototype.get = function(name) {
|
|
93
|
+
name = normalizeName(name);
|
|
94
|
+
return this.has(name) ? this.map[name] : null;
|
|
95
|
+
};
|
|
96
|
+
Headers.prototype.has = function(name) {
|
|
97
|
+
return this.map.hasOwnProperty(normalizeName(name));
|
|
98
|
+
};
|
|
99
|
+
Headers.prototype.set = function(name, value) {
|
|
100
|
+
this.map[normalizeName(name)] = normalizeValue(value);
|
|
101
|
+
};
|
|
102
|
+
Headers.prototype.forEach = function(callback, thisArg) {
|
|
103
|
+
for (var name in this.map) if (this.map.hasOwnProperty(name)) callback.call(thisArg, this.map[name], name, this);
|
|
104
|
+
};
|
|
105
|
+
Headers.prototype.keys = function() {
|
|
106
|
+
var items = [];
|
|
107
|
+
this.forEach(function(value, name) {
|
|
108
|
+
items.push(name);
|
|
109
|
+
});
|
|
110
|
+
return iteratorFor(items);
|
|
111
|
+
};
|
|
112
|
+
Headers.prototype.values = function() {
|
|
113
|
+
var items = [];
|
|
114
|
+
this.forEach(function(value) {
|
|
115
|
+
items.push(value);
|
|
116
|
+
});
|
|
117
|
+
return iteratorFor(items);
|
|
118
|
+
};
|
|
119
|
+
Headers.prototype.entries = function() {
|
|
120
|
+
var items = [];
|
|
121
|
+
this.forEach(function(value, name) {
|
|
122
|
+
items.push([name, value]);
|
|
123
|
+
});
|
|
124
|
+
return iteratorFor(items);
|
|
125
|
+
};
|
|
126
|
+
if (support.iterable) Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
|
127
|
+
function consumed(body) {
|
|
128
|
+
if (body.bodyUsed) return Promise.reject(/* @__PURE__ */ new TypeError("Already read"));
|
|
129
|
+
body.bodyUsed = true;
|
|
130
|
+
}
|
|
131
|
+
function fileReaderReady(reader) {
|
|
132
|
+
return new Promise(function(resolve, reject) {
|
|
133
|
+
reader.onload = function() {
|
|
134
|
+
resolve(reader.result);
|
|
135
|
+
};
|
|
136
|
+
reader.onerror = function() {
|
|
137
|
+
reject(reader.error);
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function readBlobAsArrayBuffer(blob) {
|
|
142
|
+
var reader = new FileReader();
|
|
143
|
+
var promise = fileReaderReady(reader);
|
|
144
|
+
reader.readAsArrayBuffer(blob);
|
|
145
|
+
return promise;
|
|
146
|
+
}
|
|
147
|
+
function readBlobAsText(blob) {
|
|
148
|
+
var reader = new FileReader();
|
|
149
|
+
var promise = fileReaderReady(reader);
|
|
150
|
+
reader.readAsText(blob);
|
|
151
|
+
return promise;
|
|
152
|
+
}
|
|
153
|
+
function readArrayBufferAsText(buf) {
|
|
154
|
+
var view = new Uint8Array(buf);
|
|
155
|
+
var chars = new Array(view.length);
|
|
156
|
+
for (var i = 0; i < view.length; i++) chars[i] = String.fromCharCode(view[i]);
|
|
157
|
+
return chars.join("");
|
|
158
|
+
}
|
|
159
|
+
function bufferClone(buf) {
|
|
160
|
+
if (buf.slice) return buf.slice(0);
|
|
161
|
+
else {
|
|
162
|
+
var view = new Uint8Array(buf.byteLength);
|
|
163
|
+
view.set(new Uint8Array(buf));
|
|
164
|
+
return view.buffer;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function Body() {
|
|
168
|
+
this.bodyUsed = false;
|
|
169
|
+
this._initBody = function(body) {
|
|
170
|
+
this.bodyUsed = this.bodyUsed;
|
|
171
|
+
this._bodyInit = body;
|
|
172
|
+
if (!body) this._bodyText = "";
|
|
173
|
+
else if (typeof body === "string") this._bodyText = body;
|
|
174
|
+
else if (support.blob && Blob.prototype.isPrototypeOf(body)) this._bodyBlob = body;
|
|
175
|
+
else if (support.formData && FormData.prototype.isPrototypeOf(body)) this._bodyFormData = body;
|
|
176
|
+
else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this._bodyText = body.toString();
|
|
177
|
+
else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
|
178
|
+
this._bodyArrayBuffer = bufferClone(body.buffer);
|
|
179
|
+
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
|
180
|
+
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) this._bodyArrayBuffer = bufferClone(body);
|
|
181
|
+
else this._bodyText = body = Object.prototype.toString.call(body);
|
|
182
|
+
if (!this.headers.get("content-type")) {
|
|
183
|
+
if (typeof body === "string") this.headers.set("content-type", "text/plain;charset=UTF-8");
|
|
184
|
+
else if (this._bodyBlob && this._bodyBlob.type) this.headers.set("content-type", this._bodyBlob.type);
|
|
185
|
+
else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
if (support.blob) {
|
|
189
|
+
this.blob = function() {
|
|
190
|
+
var rejected = consumed(this);
|
|
191
|
+
if (rejected) return rejected;
|
|
192
|
+
if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
|
|
193
|
+
else if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
194
|
+
else if (this._bodyFormData) throw new Error("could not read FormData body as blob");
|
|
195
|
+
else return Promise.resolve(new Blob([this._bodyText]));
|
|
196
|
+
};
|
|
197
|
+
this.arrayBuffer = function() {
|
|
198
|
+
if (this._bodyArrayBuffer) {
|
|
199
|
+
var isConsumed = consumed(this);
|
|
200
|
+
if (isConsumed) return isConsumed;
|
|
201
|
+
if (ArrayBuffer.isView(this._bodyArrayBuffer)) return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
|
|
202
|
+
else return Promise.resolve(this._bodyArrayBuffer);
|
|
203
|
+
} else return this.blob().then(readBlobAsArrayBuffer);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
this.text = function() {
|
|
207
|
+
var rejected = consumed(this);
|
|
208
|
+
if (rejected) return rejected;
|
|
209
|
+
if (this._bodyBlob) return readBlobAsText(this._bodyBlob);
|
|
210
|
+
else if (this._bodyArrayBuffer) return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
|
|
211
|
+
else if (this._bodyFormData) throw new Error("could not read FormData body as text");
|
|
212
|
+
else return Promise.resolve(this._bodyText);
|
|
213
|
+
};
|
|
214
|
+
if (support.formData) this.formData = function() {
|
|
215
|
+
return this.text().then(decode);
|
|
216
|
+
};
|
|
217
|
+
this.json = function() {
|
|
218
|
+
return this.text().then(JSON.parse);
|
|
219
|
+
};
|
|
220
|
+
return this;
|
|
221
|
+
}
|
|
222
|
+
var methods = [
|
|
223
|
+
"DELETE",
|
|
224
|
+
"GET",
|
|
225
|
+
"HEAD",
|
|
226
|
+
"OPTIONS",
|
|
227
|
+
"POST",
|
|
228
|
+
"PUT"
|
|
229
|
+
];
|
|
230
|
+
function normalizeMethod(method) {
|
|
231
|
+
var upcased = method.toUpperCase();
|
|
232
|
+
return methods.indexOf(upcased) > -1 ? upcased : method;
|
|
233
|
+
}
|
|
234
|
+
function Request(input, options) {
|
|
235
|
+
if (!(this instanceof Request)) throw new TypeError("Please use the \"new\" operator, this DOM object constructor cannot be called as a function.");
|
|
236
|
+
options = options || {};
|
|
237
|
+
var body = options.body;
|
|
238
|
+
if (input instanceof Request) {
|
|
239
|
+
if (input.bodyUsed) throw new TypeError("Already read");
|
|
240
|
+
this.url = input.url;
|
|
241
|
+
this.credentials = input.credentials;
|
|
242
|
+
if (!options.headers) this.headers = new Headers(input.headers);
|
|
243
|
+
this.method = input.method;
|
|
244
|
+
this.mode = input.mode;
|
|
245
|
+
this.signal = input.signal;
|
|
246
|
+
if (!body && input._bodyInit != null) {
|
|
247
|
+
body = input._bodyInit;
|
|
248
|
+
input.bodyUsed = true;
|
|
249
|
+
}
|
|
250
|
+
} else this.url = String(input);
|
|
251
|
+
this.credentials = options.credentials || this.credentials || "same-origin";
|
|
252
|
+
if (options.headers || !this.headers) this.headers = new Headers(options.headers);
|
|
253
|
+
this.method = normalizeMethod(options.method || this.method || "GET");
|
|
254
|
+
this.mode = options.mode || this.mode || null;
|
|
255
|
+
this.signal = options.signal || this.signal;
|
|
256
|
+
this.referrer = null;
|
|
257
|
+
if ((this.method === "GET" || this.method === "HEAD") && body) throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
258
|
+
this._initBody(body);
|
|
259
|
+
if (this.method === "GET" || this.method === "HEAD") {
|
|
260
|
+
if (options.cache === "no-store" || options.cache === "no-cache") {
|
|
261
|
+
var reParamSearch = /([?&])_=[^&]*/;
|
|
262
|
+
if (reParamSearch.test(this.url)) this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
|
|
263
|
+
else this.url += (/\?/.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
Request.prototype.clone = function() {
|
|
268
|
+
return new Request(this, { body: this._bodyInit });
|
|
269
|
+
};
|
|
270
|
+
function decode(body) {
|
|
271
|
+
var form = new FormData();
|
|
272
|
+
body.trim().split("&").forEach(function(bytes) {
|
|
273
|
+
if (bytes) {
|
|
274
|
+
var split = bytes.split("=");
|
|
275
|
+
var name = split.shift().replace(/\+/g, " ");
|
|
276
|
+
var value = split.join("=").replace(/\+/g, " ");
|
|
277
|
+
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
return form;
|
|
281
|
+
}
|
|
282
|
+
function parseHeaders(rawHeaders) {
|
|
283
|
+
var headers = new Headers();
|
|
284
|
+
rawHeaders.replace(/\r?\n[\t ]+/g, " ").split("\r").map(function(header) {
|
|
285
|
+
return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
|
|
286
|
+
}).forEach(function(line) {
|
|
287
|
+
var parts = line.split(":");
|
|
288
|
+
var key = parts.shift().trim();
|
|
289
|
+
if (key) {
|
|
290
|
+
var value = parts.join(":").trim();
|
|
291
|
+
headers.append(key, value);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
return headers;
|
|
295
|
+
}
|
|
296
|
+
Body.call(Request.prototype);
|
|
297
|
+
function Response(bodyInit, options) {
|
|
298
|
+
if (!(this instanceof Response)) throw new TypeError("Please use the \"new\" operator, this DOM object constructor cannot be called as a function.");
|
|
299
|
+
if (!options) options = {};
|
|
300
|
+
this.type = "default";
|
|
301
|
+
this.status = options.status === void 0 ? 200 : options.status;
|
|
302
|
+
this.ok = this.status >= 200 && this.status < 300;
|
|
303
|
+
this.statusText = options.statusText === void 0 ? "" : "" + options.statusText;
|
|
304
|
+
this.headers = new Headers(options.headers);
|
|
305
|
+
this.url = options.url || "";
|
|
306
|
+
this._initBody(bodyInit);
|
|
307
|
+
}
|
|
308
|
+
Body.call(Response.prototype);
|
|
309
|
+
Response.prototype.clone = function() {
|
|
310
|
+
return new Response(this._bodyInit, {
|
|
311
|
+
status: this.status,
|
|
312
|
+
statusText: this.statusText,
|
|
313
|
+
headers: new Headers(this.headers),
|
|
314
|
+
url: this.url
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
Response.error = function() {
|
|
318
|
+
var response = new Response(null, {
|
|
319
|
+
status: 0,
|
|
320
|
+
statusText: ""
|
|
321
|
+
});
|
|
322
|
+
response.type = "error";
|
|
323
|
+
return response;
|
|
324
|
+
};
|
|
325
|
+
var redirectStatuses = [
|
|
326
|
+
301,
|
|
327
|
+
302,
|
|
328
|
+
303,
|
|
329
|
+
307,
|
|
330
|
+
308
|
|
331
|
+
];
|
|
332
|
+
Response.redirect = function(url, status) {
|
|
333
|
+
if (redirectStatuses.indexOf(status) === -1) throw new RangeError("Invalid status code");
|
|
334
|
+
return new Response(null, {
|
|
335
|
+
status,
|
|
336
|
+
headers: { location: url }
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
exports$1.DOMException = global.DOMException;
|
|
340
|
+
try {
|
|
341
|
+
new exports$1.DOMException();
|
|
342
|
+
} catch (err) {
|
|
343
|
+
exports$1.DOMException = function(message, name) {
|
|
344
|
+
this.message = message;
|
|
345
|
+
this.name = name;
|
|
346
|
+
this.stack = Error(message).stack;
|
|
347
|
+
};
|
|
348
|
+
exports$1.DOMException.prototype = Object.create(Error.prototype);
|
|
349
|
+
exports$1.DOMException.prototype.constructor = exports$1.DOMException;
|
|
350
|
+
}
|
|
351
|
+
function fetch(input, init) {
|
|
352
|
+
return new Promise(function(resolve, reject) {
|
|
353
|
+
var request = new Request(input, init);
|
|
354
|
+
if (request.signal && request.signal.aborted) return reject(new exports$1.DOMException("Aborted", "AbortError"));
|
|
355
|
+
var xhr = new XMLHttpRequest();
|
|
356
|
+
function abortXhr() {
|
|
357
|
+
xhr.abort();
|
|
358
|
+
}
|
|
359
|
+
xhr.onload = function() {
|
|
360
|
+
var options = {
|
|
361
|
+
status: xhr.status,
|
|
362
|
+
statusText: xhr.statusText,
|
|
363
|
+
headers: parseHeaders(xhr.getAllResponseHeaders() || "")
|
|
364
|
+
};
|
|
365
|
+
options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
|
|
366
|
+
var body = "response" in xhr ? xhr.response : xhr.responseText;
|
|
367
|
+
setTimeout(function() {
|
|
368
|
+
resolve(new Response(body, options));
|
|
369
|
+
}, 0);
|
|
370
|
+
};
|
|
371
|
+
xhr.onerror = function() {
|
|
372
|
+
setTimeout(function() {
|
|
373
|
+
reject(/* @__PURE__ */ new TypeError("Network request failed"));
|
|
374
|
+
}, 0);
|
|
375
|
+
};
|
|
376
|
+
xhr.ontimeout = function() {
|
|
377
|
+
setTimeout(function() {
|
|
378
|
+
reject(/* @__PURE__ */ new TypeError("Network request failed"));
|
|
379
|
+
}, 0);
|
|
380
|
+
};
|
|
381
|
+
xhr.onabort = function() {
|
|
382
|
+
setTimeout(function() {
|
|
383
|
+
reject(new exports$1.DOMException("Aborted", "AbortError"));
|
|
384
|
+
}, 0);
|
|
385
|
+
};
|
|
386
|
+
function fixUrl(url) {
|
|
387
|
+
try {
|
|
388
|
+
return url === "" && global.location.href ? global.location.href : url;
|
|
389
|
+
} catch (e) {
|
|
390
|
+
return url;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
xhr.open(request.method, fixUrl(request.url), true);
|
|
394
|
+
if (request.credentials === "include") xhr.withCredentials = true;
|
|
395
|
+
else if (request.credentials === "omit") xhr.withCredentials = false;
|
|
396
|
+
if ("responseType" in xhr) {
|
|
397
|
+
if (support.blob) xhr.responseType = "blob";
|
|
398
|
+
else if (support.arrayBuffer && request.headers.get("Content-Type") && request.headers.get("Content-Type").indexOf("application/octet-stream") !== -1) xhr.responseType = "arraybuffer";
|
|
399
|
+
}
|
|
400
|
+
if (init && typeof init.headers === "object" && !(init.headers instanceof Headers)) Object.getOwnPropertyNames(init.headers).forEach(function(name) {
|
|
401
|
+
xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
|
|
402
|
+
});
|
|
403
|
+
else request.headers.forEach(function(value, name) {
|
|
404
|
+
xhr.setRequestHeader(name, value);
|
|
405
|
+
});
|
|
406
|
+
if (request.signal) {
|
|
407
|
+
request.signal.addEventListener("abort", abortXhr);
|
|
408
|
+
xhr.onreadystatechange = function() {
|
|
409
|
+
if (xhr.readyState === 4) request.signal.removeEventListener("abort", abortXhr);
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
xhr.send(typeof request._bodyInit === "undefined" ? null : request._bodyInit);
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
fetch.polyfill = true;
|
|
416
|
+
if (!global.fetch) {
|
|
417
|
+
global.fetch = fetch;
|
|
418
|
+
global.Headers = Headers;
|
|
419
|
+
global.Request = Request;
|
|
420
|
+
global.Response = Response;
|
|
421
|
+
}
|
|
422
|
+
exports$1.Headers = Headers;
|
|
423
|
+
exports$1.Request = Request;
|
|
424
|
+
exports$1.Response = Response;
|
|
425
|
+
exports$1.fetch = fetch;
|
|
426
|
+
return exports$1;
|
|
427
|
+
})({});
|
|
428
|
+
})(__globalThis__);
|
|
429
|
+
__globalThis__.fetch.ponyfill = true;
|
|
430
|
+
delete __globalThis__.fetch.polyfill;
|
|
431
|
+
var ctx = __global__.fetch ? __global__ : __globalThis__;
|
|
432
|
+
exports = ctx.fetch;
|
|
433
|
+
exports.default = ctx.fetch;
|
|
434
|
+
exports.fetch = ctx.fetch;
|
|
435
|
+
exports.Headers = ctx.Headers;
|
|
436
|
+
exports.Request = ctx.Request;
|
|
437
|
+
exports.Response = ctx.Response;
|
|
438
|
+
module.exports = exports;
|
|
439
|
+
}));
|
|
440
|
+
//#endregion
|
|
441
|
+
export default require_browser_ponyfill();
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { a as D, v as u, x as k } from "./vendor-preact-DThS2ZQ_.js";
|
|
2
|
+
import { n as cn, t as LoadingIcon } from "./loadingIcon-B0ysgiNq.js";
|
|
3
|
+
//#region src/shared/button/button.tsx
|
|
4
|
+
var LOADER_SIZE = 30;
|
|
5
|
+
var variantClass = {
|
|
6
|
+
primary: "IncodeButtonPrimary",
|
|
7
|
+
secondary: "IncodeButtonSecondary",
|
|
8
|
+
link: "IncodeButtonLink"
|
|
9
|
+
};
|
|
10
|
+
var sizeClass = {
|
|
11
|
+
L: "IncodeButtonL",
|
|
12
|
+
M: "IncodeButtonM",
|
|
13
|
+
S: "IncodeButtonS"
|
|
14
|
+
};
|
|
15
|
+
var Button = D((props, ref) => {
|
|
16
|
+
const { isLoading = false, variant = "primary", size = "L", icon, class: className, type = "button", children, disabled, ...rest } = props;
|
|
17
|
+
const iconOnly = !children && !!icon;
|
|
18
|
+
const showLoader = isLoading && size === "L";
|
|
19
|
+
const renderContent = () => {
|
|
20
|
+
if (showLoader) return /* @__PURE__ */ u(LoadingIcon, { size: LOADER_SIZE });
|
|
21
|
+
if (iconOnly) return icon;
|
|
22
|
+
if (icon) return /* @__PURE__ */ u(k, { children: [children, icon] });
|
|
23
|
+
return children;
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ u("button", {
|
|
26
|
+
ref,
|
|
27
|
+
...rest,
|
|
28
|
+
class: cn("IncodeButton", variantClass[variant], sizeClass[size], showLoader ? "IncodeButtonLoading" : "", iconOnly ? "IncodeButtonIconOnly" : "", className),
|
|
29
|
+
disabled: disabled || showLoader,
|
|
30
|
+
type,
|
|
31
|
+
children: renderContent()
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Button as t };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { a as D, p as d, v as u } from "./vendor-preact-DThS2ZQ_.js";
|
|
2
|
+
import { n as cn } from "./loadingIcon-B0ysgiNq.js";
|
|
3
|
+
import { t as ErrorIcon } from "./errorIcon-DJRZpd8j.js";
|
|
4
|
+
import { d as CheckmarkIcon } from "./icons-Dbs9ZfYM.js";
|
|
5
|
+
//#region src/shared/checkbox/checkbox.tsx
|
|
6
|
+
var Checkbox = D(({ id, label, labelHint, size = "m", checked, defaultChecked, disabled = false, required = false, name, value, onChange, error, helper, showErrorIcon = true, class: className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, ...restProps }, ref) => {
|
|
7
|
+
const [internalChecked, setInternalChecked] = d(!!defaultChecked);
|
|
8
|
+
const isControlled = checked !== void 0;
|
|
9
|
+
const isChecked = isControlled ? !!checked : internalChecked;
|
|
10
|
+
const isDisabled = !!disabled;
|
|
11
|
+
const isRequired = !!required;
|
|
12
|
+
const classStr = typeof className === "string" ? className : void 0;
|
|
13
|
+
const handleChange = (event) => {
|
|
14
|
+
if (!isControlled) setInternalChecked(event.target.checked);
|
|
15
|
+
onChange?.(event);
|
|
16
|
+
};
|
|
17
|
+
const helperTextId = helper ? `${id}-helper` : void 0;
|
|
18
|
+
const errorTextId = error ? `${id}-error` : void 0;
|
|
19
|
+
const describedBy = [
|
|
20
|
+
ariaDescribedBy,
|
|
21
|
+
errorTextId,
|
|
22
|
+
helperTextId
|
|
23
|
+
].filter(Boolean).join(" ") || void 0;
|
|
24
|
+
return /* @__PURE__ */ u("div", {
|
|
25
|
+
class: cn("IncodeCheckbox", classStr),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ u("label", {
|
|
28
|
+
class: cn("IncodeCheckboxLabel", { IncodeCheckboxLabelDisabled: isDisabled }),
|
|
29
|
+
htmlFor: id,
|
|
30
|
+
children: [/* @__PURE__ */ u("div", {
|
|
31
|
+
class: "relative inline-flex",
|
|
32
|
+
children: [/* @__PURE__ */ u("input", {
|
|
33
|
+
ref,
|
|
34
|
+
type: "checkbox",
|
|
35
|
+
class: "IncodeCheckboxInput",
|
|
36
|
+
id,
|
|
37
|
+
name,
|
|
38
|
+
value,
|
|
39
|
+
...isControlled ? { checked } : { defaultChecked },
|
|
40
|
+
disabled,
|
|
41
|
+
required,
|
|
42
|
+
onChange: handleChange,
|
|
43
|
+
"aria-label": ariaLabel,
|
|
44
|
+
"aria-labelledby": ariaLabelledBy,
|
|
45
|
+
"aria-describedby": describedBy,
|
|
46
|
+
"aria-invalid": ariaInvalid || !!error,
|
|
47
|
+
"aria-required": isRequired,
|
|
48
|
+
...restProps
|
|
49
|
+
}), /* @__PURE__ */ u("div", {
|
|
50
|
+
class: cn("IncodeCheckboxVisual", {
|
|
51
|
+
IncodeCheckboxVisualChecked: isChecked,
|
|
52
|
+
IncodeCheckboxVisualDisabled: isDisabled,
|
|
53
|
+
IncodeCheckboxVisualError: !!error
|
|
54
|
+
}),
|
|
55
|
+
children: isChecked && /* @__PURE__ */ u(CheckmarkIcon, { size: 28 })
|
|
56
|
+
})]
|
|
57
|
+
}), label && /* @__PURE__ */ u("span", {
|
|
58
|
+
class: cn("IncodeCheckboxText", {
|
|
59
|
+
IncodeCheckboxTextS: size === "s",
|
|
60
|
+
IncodeCheckboxTextM: size === "m",
|
|
61
|
+
IncodeCheckboxTextDisabled: isDisabled
|
|
62
|
+
}),
|
|
63
|
+
"aria-hidden": ariaLabelledBy ? "true" : void 0,
|
|
64
|
+
children: [label, labelHint && /* @__PURE__ */ u("span", {
|
|
65
|
+
class: "IncodeCheckboxLabelHint",
|
|
66
|
+
"data-testid": `${id}-label-hint`,
|
|
67
|
+
children: labelHint
|
|
68
|
+
})]
|
|
69
|
+
})]
|
|
70
|
+
}),
|
|
71
|
+
error && /* @__PURE__ */ u("div", {
|
|
72
|
+
class: "IncodeCheckboxMessageWrapper",
|
|
73
|
+
"data-testid": `${id}-error-wrapper`,
|
|
74
|
+
children: [showErrorIcon && /* @__PURE__ */ u("div", {
|
|
75
|
+
class: "IncodeCheckboxIconWrapper",
|
|
76
|
+
children: /* @__PURE__ */ u(ErrorIcon, { size: 17 })
|
|
77
|
+
}), /* @__PURE__ */ u("p", {
|
|
78
|
+
id: errorTextId,
|
|
79
|
+
class: "IncodeCheckboxErrorText",
|
|
80
|
+
children: error
|
|
81
|
+
})]
|
|
82
|
+
}),
|
|
83
|
+
helper && !error && /* @__PURE__ */ u("div", {
|
|
84
|
+
class: "IncodeCheckboxMessageWrapper",
|
|
85
|
+
"data-testid": `${id}-helper-wrapper`,
|
|
86
|
+
children: /* @__PURE__ */ u("p", {
|
|
87
|
+
id: helperTextId,
|
|
88
|
+
class: "IncodeCheckboxHelperText",
|
|
89
|
+
children: helper
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Checkbox as t };
|