@incodetech/web 0.0.0-dev-20260813-ad5ea9e1 → 0.0.0-dev-20260813-2991a679

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.
@@ -4,6 +4,7 @@ import { K as InputComposed, P as DateInputComposed, V as Checkbox, X as StatusP
4
4
  import { n as LoadingIcon, t as Spacer } from "./spacer-Bev-wMBC.js";
5
5
  import { k as Button, u as SuccessIcon } from "./dropdownComposed-CH8FoLKA.js";
6
6
  import { t as registerIncodeModuleElement } from "./incodeModule-CPafHixS.js";
7
+ import { n as getRequiredHintMode, t as getFieldHint } from "./requiredLabelHint-BWCuo0he.js";
7
8
  import { createCustomFieldsManager } from "@incodetech/core/custom-fields";
8
9
  //#region src/modules/custom-fields/customFields.tsx
9
10
  var INPUT_TYPE_MAP = {
@@ -12,14 +13,20 @@ var INPUT_TYPE_MAP = {
12
13
  STRING: "text"
13
14
  };
14
15
  var INPUT_STEP_MAP = { DOUBLE: "any" };
15
- var DateFieldInput = ({ field, isDisabled, onChange }) => {
16
+ var DateFieldInput = ({ error, field, isDisabled, labelHint, required, onChange }) => {
16
17
  const [dateValue, setDateValue] = d("");
18
+ const id = `custom-field-${field.name}`;
17
19
  return /* @__PURE__ */ u("div", {
18
20
  class: "IncodeCustomFieldsField",
19
21
  children: /* @__PURE__ */ u(DateInputComposed, {
20
- id: `custom-field-${field.name}`,
22
+ id,
21
23
  name: field.name,
22
24
  label: field.label,
25
+ labelHint,
26
+ "data-testid": id,
27
+ error,
28
+ showErrorIcon: !!error,
29
+ required,
23
30
  disabled: isDisabled,
24
31
  value: dateValue,
25
32
  onInput: (e) => {
@@ -30,7 +37,7 @@ var DateFieldInput = ({ field, isDisabled, onChange }) => {
30
37
  })
31
38
  });
32
39
  };
33
- var CustomFieldInput = ({ field, isDisabled, onChange }) => {
40
+ var CustomFieldInput = ({ error, field, isDisabled, labelHint, required, onChange }) => {
34
41
  const id = `custom-field-${field.name}`;
35
42
  if (field.type === "BOOLEAN") return /* @__PURE__ */ u("div", {
36
43
  class: "IncodeCustomFieldsField",
@@ -38,13 +45,20 @@ var CustomFieldInput = ({ field, isDisabled, onChange }) => {
38
45
  id,
39
46
  name: field.name,
40
47
  label: field.label,
48
+ labelHint,
49
+ "data-testid": id,
50
+ error,
51
+ required,
41
52
  disabled: isDisabled,
42
53
  onChange: (e) => onChange(field.name, e.target.checked)
43
54
  })
44
55
  });
45
56
  if (field.type === "DATE") return /* @__PURE__ */ u(DateFieldInput, {
57
+ error,
46
58
  field,
47
59
  isDisabled,
60
+ labelHint,
61
+ required,
48
62
  onChange
49
63
  });
50
64
  return /* @__PURE__ */ u("div", {
@@ -53,8 +67,13 @@ var CustomFieldInput = ({ field, isDisabled, onChange }) => {
53
67
  id,
54
68
  name: field.name,
55
69
  label: field.label,
70
+ labelHint,
71
+ "data-testid": id,
72
+ error,
73
+ showErrorIcon: !!error,
56
74
  type: INPUT_TYPE_MAP[field.type] ?? "text",
57
75
  step: INPUT_STEP_MAP[field.type],
76
+ required,
58
77
  disabled: isDisabled,
59
78
  onInput: (e) => onChange(field.name, e.target.value)
60
79
  })
@@ -74,6 +93,7 @@ var CustomFieldsContent = ({ config, manager: externalManager, onFinish, onError
74
93
  status: state.status === "finished" ? "finished" : "loading",
75
94
  onFinish
76
95
  });
96
+ if (state.status === "idle") return null;
77
97
  if (state.status === "success") return /* @__PURE__ */ u(StatusPage, {
78
98
  variant: "success",
79
99
  icon: /* @__PURE__ */ u(SuccessIcon, { size: 64 }),
@@ -90,6 +110,7 @@ var CustomFieldsContent = ({ config, manager: externalManager, onFinish, onError
90
110
  });
91
111
  const canSubmit = state.status === "inputting" ? state.canSubmit : false;
92
112
  const customFields = state.status === "inputting" ? state.customFields : [];
113
+ const requiredHintMode = getRequiredHintMode(customFields.map((field) => field.type !== "BOOLEAN"));
93
114
  const handleChange = (name, value) => {
94
115
  manager.setField(name, value);
95
116
  };
@@ -97,23 +118,35 @@ var CustomFieldsContent = ({ config, manager: externalManager, onFinish, onError
97
118
  className: "IncodeCustomFieldsPage",
98
119
  title,
99
120
  hideFooterBranding: true,
121
+ "data-testid": "custom-fields-page",
100
122
  children: /* @__PURE__ */ u("form", {
101
123
  class: "IncodeCustomFieldsForm",
124
+ "data-testid": "custom-fields-form",
125
+ noValidate: true,
102
126
  onSubmit: (e) => {
103
127
  e.preventDefault();
104
128
  manager.submit();
105
129
  },
106
130
  autoComplete: "off",
107
131
  children: [
108
- customFields.map((field) => /* @__PURE__ */ u(CustomFieldInput, {
109
- field,
110
- isDisabled: false,
111
- onChange: handleChange
112
- }, field.name)),
132
+ customFields.map((field) => {
133
+ const required = field.type !== "BOOLEAN";
134
+ const hint = getFieldHint(requiredHintMode, required);
135
+ const errorKey = state.validationErrors?.[field.name];
136
+ return /* @__PURE__ */ u(CustomFieldInput, {
137
+ error: errorKey ? t(errorKey, { fieldName: field.label }) : void 0,
138
+ field,
139
+ isDisabled: false,
140
+ labelHint: hint ? t(`forms.label.${hint}`) : void 0,
141
+ required,
142
+ onChange: handleChange
143
+ }, field.name);
144
+ }),
113
145
  /* @__PURE__ */ u(Spacer, {}),
114
146
  /* @__PURE__ */ u(Button, {
115
147
  type: "submit",
116
148
  disabled: !canSubmit,
149
+ "data-testid": "custom-fields-submit",
117
150
  children: t("customFields.continue")
118
151
  })
119
152
  ]
@@ -3,7 +3,7 @@ import { _ as y, c as z, d as T, l as A, o as P, p as d, v as u } from "../vendo
3
3
  import { X as StatusPage, dt as TransitionSpinner, ot as ResolvedConfigProvider, st as TerminalErrorPage, tt as IncodeComponent, yt as useManager } from "../extensibility-li3u8bJP.js";
4
4
  import { O as ErrorIcon } from "../dropdownComposed-CH8FoLKA.js";
5
5
  import { t as registerIncodeModuleElement } from "../incodeModule-CPafHixS.js";
6
- import { _ as warmupWasmIfNeeded, a as resolveApiKey, c as HEADLESS_FLOW_MODULE_KEYS, d as fetchTheme, f as initializeFlowManager, h as preloadRedirectToMobile, l as LAZY_UI_MODULES, m as preloadHomeScreen, n as useModulePreloader, o as extractIncodeStatus, p as preloadFirstModule, r as usePrefetchNextModule, s as UnsupportedModule, t as useModuleLoader, u as createFlowManager, v as isDesktopOrEmulated } from "../useModuleLoader-Bj_qdihU.js";
6
+ import { _ as warmupWasmIfNeeded, a as resolveApiKey, c as HEADLESS_FLOW_MODULE_KEYS, d as fetchTheme, f as initializeFlowManager, h as preloadRedirectToMobile, l as LAZY_UI_MODULES, m as preloadHomeScreen, n as useModulePreloader, o as extractIncodeStatus, p as preloadFirstModule, r as usePrefetchNextModule, s as UnsupportedModule, t as useModuleLoader, u as createFlowManager, v as isDesktopOrEmulated } from "../useModuleLoader-Bl4AhWD8.js";
7
7
  import { getRequiredWasmPipelines } from "@incodetech/core/flow";
8
8
  import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
9
9
  //#region src/shared/processing/useDelayedFlag.ts
@@ -828,12 +828,12 @@
828
828
  }
829
829
 
830
830
  .IncodeGovtValidation.IncodeGovtValidation--otp .IncodeGovtValidationPage .IncodeGovtValidationOtpInstructions p, .IncodeGovtValidation.IncodeGovtValidation--otp .IncodeGovtValidationPage .IncodeGovtValidationOtpInstructions h2 {
831
+ text-align: center;
831
832
  font-family: var(--typography-input-dropdown-family);
832
833
  font-size: var(--typography-input-dropdown-m-size);
833
834
  font-weight: var(--typography-input-dropdown-m-weight);
834
835
  line-height: var(--typography-input-dropdown-m-line-height);
835
836
  letter-spacing: var(--typography-input-dropdown-m-letter-spacing);
836
- text-wrap: nowrap;
837
837
  }
838
838
 
839
839
  .IncodeFlowStart {
@@ -84,17 +84,18 @@ var GovernmentVerificationResult = (props) => /* @__PURE__ */ u(VerificationResu
84
84
  hideFooterBranding: false,
85
85
  footerBrandingSlot: /* @__PURE__ */ u(VerifiedByGovIncodeLogo, {})
86
86
  });
87
- var GovernmentValidationContent = ({ config, onFinish }) => {
87
+ var GovernmentValidationContent = ({ config, manager: externalManager, onFinish }) => {
88
88
  const { t } = useTranslation();
89
89
  const [state, manager] = useManager(() => {
90
+ if (externalManager) return externalManager;
90
91
  if (!config) throw new Error("GovernmentValidation config is required");
91
92
  return createGovernmentValidationManager({ config });
92
- });
93
+ }, { manageLifecycle: !externalManager });
93
94
  useModuleTerminalCallbacks({
94
95
  status: state.status === "finished" ? "finished" : "loading",
95
96
  onFinish
96
97
  });
97
- if (config.backgroundExecution || state.status === "finished") return null;
98
+ if (config?.backgroundExecution || state.status === "finished") return null;
98
99
  const isOtpStep = state.status === "awaitingOtp" || state.status === "verifyingOtp";
99
100
  return /* @__PURE__ */ u(k, { children: [
100
101
  (state.status === "idle" || state.status === "loading" || state.status === "processing") && /* @__PURE__ */ u(GovernmentVerificationResult, {
@@ -150,13 +151,14 @@ var GovernmentValidationContent = ({ config, onFinish }) => {
150
151
  })
151
152
  ] });
152
153
  };
153
- var GovernmentValidationWithLocalConfig = ({ config, onFinish }) => {
154
- return /* @__PURE__ */ u(IncodeComponent, { children: config ? /* @__PURE__ */ u(GovernmentValidationContent, {
154
+ var GovernmentValidationWithLocalConfig = ({ config, manager, onFinish }) => {
155
+ return /* @__PURE__ */ u(IncodeComponent, { children: config || manager ? /* @__PURE__ */ u(GovernmentValidationContent, {
155
156
  config,
157
+ manager,
156
158
  onFinish
157
159
  }) : null });
158
160
  };
159
- var GovernmentValidation = withStandaloneModuleBootstrap(GovernmentValidationWithLocalConfig, "GOVT_VALIDATION_PROVISIONING");
161
+ var GovernmentValidation = withStandaloneModuleBootstrap(GovernmentValidationWithLocalConfig, "GOVT_VALIDATION_PROVISIONING", { supportsExternalManager: true });
160
162
  registerIncodeModuleElement(GovernmentValidation, "incode-government-validation");
161
163
  //#endregion
162
164
  export { GovernmentValidation };
@@ -32,10 +32,10 @@
32
32
  }
33
33
 
34
34
  .IncodeGovtValidation.IncodeGovtValidation--otp .IncodeGovtValidationPage .IncodeGovtValidationOtpInstructions p, .IncodeGovtValidation.IncodeGovtValidation--otp .IncodeGovtValidationPage .IncodeGovtValidationOtpInstructions h2 {
35
+ text-align: center;
35
36
  font-family: var(--typography-input-dropdown-family);
36
37
  font-size: var(--typography-input-dropdown-m-size);
37
38
  font-weight: var(--typography-input-dropdown-m-weight);
38
39
  line-height: var(--typography-input-dropdown-m-line-height);
39
40
  letter-spacing: var(--typography-input-dropdown-m-letter-spacing);
40
- text-wrap: nowrap;
41
41
  }
package/dist/id/id.es.js CHANGED
@@ -1103,7 +1103,7 @@ function preloadIdTutorialAssets() {
1103
1103
  }
1104
1104
  //#endregion
1105
1105
  //#region src/modules/id/id.tsx
1106
- var MandatoryConsent = z(() => import("../mandatoryConsent-pblMVUjs.js").then((module) => ({ default: module.MandatoryConsent })));
1106
+ var MandatoryConsent = z(() => import("../mandatoryConsent-B7KFPn4W.js").then((module) => ({ default: module.MandatoryConsent })));
1107
1107
  var IdContent = ({ config, manager: externalManager, onFinish, onError }) => {
1108
1108
  usePreloadDisplayFont();
1109
1109
  const { t } = useTranslation();
@@ -48,6 +48,7 @@ var MandatoryConsentContent = ({ config, manager: externalManager, onFinish, onE
48
48
  class: "IncodeConsentCheckboxList",
49
49
  children: /* @__PURE__ */ u(Checkbox, {
50
50
  id: "mandatory-consent-checkbox",
51
+ "data-testid": "mandatory-consent-checkbox",
51
52
  class: "IncodeConsentCheckbox",
52
53
  checked: state.isSigned,
53
54
  required: true,
@@ -82,6 +83,7 @@ var MandatoryConsentContent = ({ config, manager: externalManager, onFinish, onE
82
83
  children: t("biometricConsent.button.continue")
83
84
  }), isMandatoryConsent && /* @__PURE__ */ u(Button, {
84
85
  variant: "link",
86
+ "data-testid": "mandatory-consent-cancel",
85
87
  onClick: () => manager.cancel(),
86
88
  children: t("biometricConsent.button.cancel")
87
89
  })]
@@ -2,6 +2,7 @@ import { DeepPartial } from '@incodetech/core/flow';
2
2
  import { FC } from 'preact/compat';
3
3
  import { FunctionComponent } from 'preact';
4
4
  import { GovernmentValidationConfig } from '@incodetech/core/government-validation';
5
+ import { GovernmentValidationManager } from '@incodetech/core/government-validation';
5
6
  import { SVGProps } from 'preact/compat';
6
7
 
7
8
  /**
@@ -58,7 +59,7 @@ export declare const GovernmentValidation: FC<Omit<GovernmentValidationProps, "c
58
59
  config?: (Omit<unknown, never> & DeepPartial<Pick<unknown, never>>) | undefined;
59
60
  }>;
60
61
 
61
- declare type GovernmentValidationProps = IncodeModuleProps<GovernmentValidationConfig>;
62
+ declare type GovernmentValidationProps = IncodeModuleProps<GovernmentValidationConfig, void, GovernmentValidationManager>;
62
63
 
63
64
  /**
64
65
  * Extra context passed to `onFinish` alongside the result. Lets a host decide
@@ -88,12 +88,12 @@ var LAZY_UI_MODULES = {
88
88
  DOCUMENT_CAPTURE: () => import("./documentCapture-otFa-W4b.js").then((m) => m.DocumentCapture),
89
89
  ADDRESS: () => import("./documentCapture-otFa-W4b.js").then((m) => m.DocumentCapture),
90
90
  COMBINED_CONSENT: () => import("./consent/consent.es.js").then((m) => m.Consent),
91
- MANDATORY_CONSENT: () => import("./mandatoryConsent-pblMVUjs.js").then((m) => m.MandatoryConsent),
92
- ML_CONSENT: () => import("./mandatoryConsent-pblMVUjs.js").then((m) => m.MandatoryConsent),
91
+ MANDATORY_CONSENT: () => import("./mandatoryConsent-B7KFPn4W.js").then((m) => m.MandatoryConsent),
92
+ ML_CONSENT: () => import("./mandatoryConsent-B7KFPn4W.js").then((m) => m.MandatoryConsent),
93
93
  SIGNATURE: () => import("./signature/signature.es.js").then((m) => m.Signature),
94
94
  ID_OCR: () => import("./idOcr-BLQhHZbS.js").then((m) => m.IdOcr),
95
95
  ANTIFRAUD: () => import("./antifraud/antifraud.es.js").then((m) => m.Antifraud),
96
- CUSTOM_FIELDS: () => import("./customFields-Om1nY5wK.js").then((m) => m.CustomFields),
96
+ CUSTOM_FIELDS: () => import("./customFields-BrWlGrZ9.js").then((m) => m.CustomFields),
97
97
  WATCHLIST: () => import("./watchlist/watchlist.es.js").then((m) => m.Watchlist),
98
98
  WATCHLIST_BUSINESS: () => import("./watchlistForBusiness-CqVbOd4P.js").then((m) => m.WatchlistForBusiness),
99
99
  INCODE_WATCHLIST: () => import("./customWatchlist-Dh3A_Nmm.js").then((m) => m.CustomWatchlist),
@@ -959,12 +959,12 @@
959
959
  }
960
960
 
961
961
  .IncodeGovtValidation.IncodeGovtValidation--otp .IncodeGovtValidationPage .IncodeGovtValidationOtpInstructions p, .IncodeGovtValidation.IncodeGovtValidation--otp .IncodeGovtValidationPage .IncodeGovtValidationOtpInstructions h2 {
962
+ text-align: center;
962
963
  font-family: var(--typography-input-dropdown-family);
963
964
  font-size: var(--typography-input-dropdown-m-size);
964
965
  font-weight: var(--typography-input-dropdown-m-weight);
965
966
  line-height: var(--typography-input-dropdown-m-line-height);
966
967
  letter-spacing: var(--typography-input-dropdown-m-letter-spacing);
967
- text-wrap: nowrap;
968
968
  }
969
969
 
970
970
  .IncodeSrOnly {
@@ -3,7 +3,7 @@ import { _ as y, c as z, l as A, o as P, p as d, v as u } from "../vendor-preact
3
3
  import { i as fetchAndApplyTheme } from "../dashboardTheme-C87VA-Zf.js";
4
4
  import { ct as Page, dt as TransitionSpinner, ot as ResolvedConfigProvider, rt as AutoFocusTitle, st as TerminalErrorPage, tt as IncodeComponent, yt as useManager } from "../extensibility-li3u8bJP.js";
5
5
  import { t as registerIncodeModuleElement } from "../incodeModule-CPafHixS.js";
6
- import { a as resolveApiKey, g as setupSDK, i as HEADLESS_WORKFLOW_MODULE_KEYS, l as LAZY_UI_MODULES, o as extractIncodeStatus, s as UnsupportedModule, t as useModuleLoader, v as isDesktopOrEmulated } from "../useModuleLoader-Bj_qdihU.js";
6
+ import { a as resolveApiKey, g as setupSDK, i as HEADLESS_WORKFLOW_MODULE_KEYS, l as LAZY_UI_MODULES, o as extractIncodeStatus, s as UnsupportedModule, t as useModuleLoader, v as isDesktopOrEmulated } from "../useModuleLoader-Bl4AhWD8.js";
7
7
  import { resolveWasmConfig, upgradeToWasmHttpClient, warmupWasm } from "@incodetech/core/wasm";
8
8
  import { classifyScoreStatus } from "@incodetech/core/flow";
9
9
  import { bootstrapSession, refreshQrUrlUuid } from "@incodetech/core/session";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260813-ad5ea9e1",
3
+ "version": "0.0.0-dev-20260813-2991a679",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -292,7 +292,7 @@
292
292
  "qrcode": "^1.5.4",
293
293
  "signature_pad": "^5.1.3",
294
294
  "tailwindcss": "^4.1.17",
295
- "@incodetech/core": "0.0.0-dev-20260813-ad5ea9e1"
295
+ "@incodetech/core": "0.0.0-dev-20260813-2991a679"
296
296
  },
297
297
  "devDependencies": {
298
298
  "@microsoft/api-extractor": "^7.53.3",