@adyen/kyc-components 2.66.0 → 2.67.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.
@@ -2172,7 +2172,7 @@ const formUtilities = (props, i18n) => ({
2172
2172
  getErrorMessage: (field, errors, fieldProblems) => {
2173
2173
  var _a;
2174
2174
  const errorMessage = (_a = errors == null ? void 0 : errors[field]) == null ? void 0 : _a.errorMessage;
2175
- return errorMessage ? i18n.get(errorMessage) : Boolean(fieldProblems == null ? void 0 : fieldProblems[field]);
2175
+ return errorMessage || Boolean(fieldProblems == null ? void 0 : fieldProblems[field]);
2176
2176
  },
2177
2177
  getFieldData: (formData, fieldKeys) => getDataByFields(formData, fieldKeys),
2178
2178
  getFieldValid: (formValid, fieldKeys) => entriesOf(formValid).reduce(
@@ -2183,7 +2183,7 @@ const formUtilities = (props, i18n) => ({
2183
2183
  var _a;
2184
2184
  if (fieldKeys.includes(key)) {
2185
2185
  const error = (_a = formErrors == null ? void 0 : formErrors[key]) == null ? void 0 : _a.errorMessage;
2186
- return error ? { ...acc, [key]: i18n.get(error) } : { ...acc, [key]: Boolean(fieldProblems == null ? void 0 : fieldProblems[key]) };
2186
+ return error ? { ...acc, [key]: error } : { ...acc, [key]: Boolean(fieldProblems == null ? void 0 : fieldProblems[key]) };
2187
2187
  }
2188
2188
  return acc;
2189
2189
  }, {}),
@@ -2327,6 +2327,7 @@ const svgs = {
2327
2327
  document: lazy(() => import("./document-1-BN3bKHzc.js")),
2328
2328
  download: lazy(() => import("./download-Doa1e9Lk.js")),
2329
2329
  edit: lazy(() => import("./edit-1-CfwIJ2-1.js")),
2330
+ "external-link": lazy(() => import("./external-link-B2BGNXtd.js")),
2330
2331
  "field-error": lazy(
2331
2332
  () => import("./warning-circle-fill-FaaY90uz.js")
2332
2333
  ),
@@ -2732,15 +2733,16 @@ const Link = ({
2732
2733
  const target = external ? "_blank" : "_self";
2733
2734
  const rel = external ? "external noopener noreferrer" : void 0;
2734
2735
  const showIcon = icon || external;
2736
+ const iconLeft = showIcon && iconPosition === "left" && !external;
2735
2737
  const classNames = showAsButton ? cx("adyen-kyc-button", className, {
2736
- "adyen-kyc-button--icon-left": iconPosition === "left"
2738
+ "adyen-kyc-button--icon-left": iconLeft
2737
2739
  }) : cx("adyen-kyc-link", className, {
2738
2740
  "adyen-kyc-link--with-icon": showIcon,
2739
- "adyen-kyc-link--icon-left": iconPosition === "left"
2741
+ "adyen-kyc-link--icon-left": iconLeft
2740
2742
  });
2741
2743
  return /* @__PURE__ */ jsxs("a", { href, className: classNames, target, rel, onClick, children: [
2742
2744
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-link__text adyen-kyc-link--inherit", children }),
2743
- showIcon && icon && /* @__PURE__ */ jsx(Icon, { name: icon, className: "adyen-kyc-link__icon" })
2745
+ showIcon && /* @__PURE__ */ jsx(Icon, { name: external ? "external-link" : icon, className: "adyen-kyc-link__icon" })
2744
2746
  ] });
2745
2747
  };
2746
2748
  const NavigateToFieldLink = ({ fieldName, label }) => {
@@ -3760,7 +3762,7 @@ const Field = ({
3760
3762
  });
3761
3763
  useEffect(() => {
3762
3764
  if (!errorMessage) return;
3763
- const returnValue = typeof errorMessage === "string" && errorMessage || "invalid";
3765
+ const returnValue = typeof errorMessage === "string" && errorMessage || typeof errorMessage === "object" && errorMessage.key || "invalid";
3764
3766
  userEvents.addFieldEvent("Encountered error", {
3765
3767
  actionType: "input",
3766
3768
  field: name,
@@ -3835,20 +3837,20 @@ const Field = ({
3835
3837
  uniqueId
3836
3838
  }),
3837
3839
  helper && helperPosition === "below" && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-helper-text adyen-kyc-helper-text__below", children: helper }),
3838
- isLoading && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-input__inline-validation adyen-kyc-input__inline-validation--loading", children: /* @__PURE__ */ jsx(Loader, { size: "small" }) }),
3840
+ isLoading && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-input__inline-validation", children: /* @__PURE__ */ jsx(Loader, { size: "small" }) }),
3839
3841
  isValid && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-input__inline-validation adyen-kyc-input__inline-validation--valid", children: /* @__PURE__ */ jsx(Icon, { name: "check" }) }),
3840
3842
  !!errorMessage && !showErrorIconBottom && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-input__inline-validation adyen-kyc-input__inline-validation--invalid", children: /* @__PURE__ */ jsx(Icon, { name: "field-error" }) })
3841
3843
  ]
3842
3844
  }
3843
3845
  ),
3844
- !!errorMessage && /* @__PURE__ */ jsxs(
3846
+ !!errorMessage && typeof errorMessage !== "boolean" && /* @__PURE__ */ jsxs(
3845
3847
  "span",
3846
3848
  {
3847
3849
  "aria-live": "polite",
3848
3850
  className: "adyen-kyc-error-text",
3849
3851
  id: `${uniqueId}${ARIA_ERROR_SUFFIX}`,
3850
3852
  children: [
3851
- errorMessage,
3853
+ isValidElement(errorMessage) ? errorMessage : i18n.get(errorMessage),
3852
3854
  showErrorIconBottom && /* @__PURE__ */ jsx("span", { className: "adyen-kyc-input__inline-validation adyen-kyc-input__inline-validation--invalid-bottom", children: /* @__PURE__ */ jsx(Icon, { name: "field-error" }) })
3853
3855
  ]
3854
3856
  }
@@ -7460,7 +7462,8 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
7460
7462
  if (!isValid && (shouldValidate || hasBlurred))
7461
7463
  return {
7462
7464
  isError: true,
7463
- text: typeof errorMessage === "string" && errorMessage ? errorMessage : formatGuidance
7465
+ errorMessage,
7466
+ text: formatGuidance
7464
7467
  };
7465
7468
  return {
7466
7469
  isError: false
@@ -7615,20 +7618,9 @@ Falling back to partially valid value "${fallback}"`
7615
7618
  inputEl.value = newMaskResult.displayValue;
7616
7619
  onInput(newPureValue);
7617
7620
  };
7618
- const getErrorMessage = () => {
7619
- if (inputState.isError) {
7620
- if (helper) {
7621
- return /* @__PURE__ */ jsxs("span", { children: [
7622
- /* @__PURE__ */ jsx("div", { children: helper }),
7623
- /* @__PURE__ */ jsx("div", { children: inputState.text })
7624
- ] });
7625
- }
7626
- return inputState.text ?? true;
7627
- }
7628
- };
7629
7621
  const getHelper = () => {
7630
7622
  if (inputState.isError) {
7631
- return;
7623
+ return inputState.text;
7632
7624
  }
7633
7625
  if (helper) {
7634
7626
  return /* @__PURE__ */ jsxs("span", { children: [
@@ -7644,7 +7636,7 @@ Falling back to partially valid value "${fallback}"`
7644
7636
  name,
7645
7637
  label,
7646
7638
  isValid: !inputState.isError,
7647
- errorMessage: getErrorMessage(),
7639
+ errorMessage: inputState.errorMessage || inputState.isError,
7648
7640
  helper: getHelper(),
7649
7641
  helperPosition,
7650
7642
  classNameModifiers: classNameModifiers == null ? void 0 : classNameModifiers.field,
@@ -15360,7 +15352,7 @@ const documentTypeValidationRules$1 = {
15360
15352
  }
15361
15353
  };
15362
15354
  function IdDocumentManualUploadComponent(props) {
15363
- var _a;
15355
+ var _a, _b;
15364
15356
  const { i18n } = useI18nContext();
15365
15357
  const [idFrontPage, setIdFrontPage] = useState({});
15366
15358
  const [idBackPage, setIdBackPage] = useState({});
@@ -15384,9 +15376,9 @@ function IdDocumentManualUploadComponent(props) {
15384
15376
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
15385
15377
  });
15386
15378
  useEffect(() => {
15387
- var _a2, _b, _c, _d;
15379
+ var _a2, _b2, _c, _d;
15388
15380
  if ((_a2 = props.data) == null ? void 0 : _a2.idDocumentType) {
15389
- setData("idDocumentType", (_b = props.data) == null ? void 0 : _b.idDocumentType);
15381
+ setData("idDocumentType", (_b2 = props.data) == null ? void 0 : _b2.idDocumentType);
15390
15382
  setIdFrontPage({ idFrontPage: (_c = props.data) == null ? void 0 : _c.idFrontPage });
15391
15383
  setIdBackPage({ idBackPage: (_d = props.data) == null ? void 0 : _d.idBackPage });
15392
15384
  triggerValidation();
@@ -15409,8 +15401,8 @@ function IdDocumentManualUploadComponent(props) {
15409
15401
  ...hasBack ? ["idBackPage"] : []
15410
15402
  ];
15411
15403
  useEffect(() => {
15412
- var _a2, _b;
15413
- (_b = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b.call(_a2, {
15404
+ var _a2, _b2;
15405
+ (_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.setState) == null ? void 0 : _b2.call(_a2, {
15414
15406
  type: "addToState",
15415
15407
  value: {
15416
15408
  data,
@@ -15428,8 +15420,8 @@ function IdDocumentManualUploadComponent(props) {
15428
15420
  prevState,
15429
15421
  changeInitiatedBy
15430
15422
  }) => {
15431
- var _a2, _b, _c, _d, _e, _f;
15432
- if (changeInitiatedBy === "idDocument" && ((_b = (_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.idDocument) == null ? void 0 : _b.idDocumentType) !== ((_d = (_c = prevState == null ? void 0 : prevState.data) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.idDocumentType)) {
15423
+ var _a2, _b2, _c, _d, _e, _f;
15424
+ if (changeInitiatedBy === "idDocument" && ((_b2 = (_a2 = currentState == null ? void 0 : currentState.data) == null ? void 0 : _a2.idDocument) == null ? void 0 : _b2.idDocumentType) !== ((_d = (_c = prevState == null ? void 0 : prevState.data) == null ? void 0 : _c.idDocument) == null ? void 0 : _d.idDocumentType)) {
15433
15425
  const idDocumentType = (_f = (_e = currentState.data) == null ? void 0 : _e.idDocument) == null ? void 0 : _f.idDocumentType;
15434
15426
  const document2 = idDocumentType ? getDocument$1(props.legalEntityId, idDocumentType) : void 0;
15435
15427
  if (!document2) {
@@ -15470,7 +15462,7 @@ function IdDocumentManualUploadComponent(props) {
15470
15462
  {
15471
15463
  name: "idDocumentType",
15472
15464
  label: i18n.get("selectDocumentType"),
15473
- errorMessage: errors.idDocumentType ? i18n.get(errors.idDocumentType.errorMessage) : null,
15465
+ errorMessage: (_b = errors.idDocumentType) == null ? void 0 : _b.errorMessage,
15474
15466
  isValid: valid.idDocumentType,
15475
15467
  children: (childProps) => /* @__PURE__ */ jsx(
15476
15468
  Select,
@@ -20044,6 +20036,13 @@ class IFrameWidget {
20044
20036
  const WIDGET_IFRAME_CLASS = "adyen-kyc-bank-verification-widget";
20045
20037
  const WIDGET_CONTAINER_CLASS = `${WIDGET_IFRAME_CLASS}-container`;
20046
20038
  const EMPTY_WIDGET_CONTAINER_ANIMATION = "adyen-kyc:empty-bank-verification-widget-container";
20039
+ const trackVerificationError = (returnValue) => {
20040
+ userEvents.addPageEvent("Encountered error", {
20041
+ actionType: "add",
20042
+ returnType: "sdk error",
20043
+ returnValue
20044
+ });
20045
+ };
20047
20046
  const DEFAULT_ERROR = {
20048
20047
  error: "UNKNOWN_ERROR",
20049
20048
  message: `We couldn't complete the account check. Please try again later or provide account details manually.`
@@ -20130,20 +20129,23 @@ function BankVerificationWidget({
20130
20129
  link: url,
20131
20130
  successHandler: (code, state) => {
20132
20131
  createTrustedTransferInstrument2(code, state).then((res) => {
20132
+ userEvents.addPageEvent("Success", { actionType: "add" });
20133
20133
  if (res) {
20134
20134
  widgetCallback({
20135
20135
  action: "verification_success",
20136
20136
  result: res
20137
20137
  });
20138
20138
  }
20139
- }).catch(
20140
- () => widgetCallback({
20139
+ }).catch(() => {
20140
+ trackVerificationError(DEFAULT_ERROR.error);
20141
+ widgetCallback({
20141
20142
  action: "handle_exception",
20142
20143
  err: DEFAULT_ERROR
20143
- })
20144
- );
20144
+ });
20145
+ });
20145
20146
  },
20146
20147
  errorHandler: (errorCode, errorMessage, state, metadata) => {
20148
+ trackVerificationError(errorCode);
20147
20149
  handleBankVerificationError2 == null ? void 0 : handleBankVerificationError2(errorCode, errorMessage, state, metadata).then(
20148
20150
  (error) => widgetCallback({
20149
20151
  action: "handle_exception",
@@ -20173,6 +20175,7 @@ function BankVerificationWidget({
20173
20175
  action: "verification_success",
20174
20176
  result
20175
20177
  });
20178
+ userEvents.addPageEvent("Success", { actionType: "add" });
20176
20179
  } catch (err) {
20177
20180
  if (err instanceof AdyenKycSdkError) {
20178
20181
  switch (err.message) {
@@ -20199,6 +20202,9 @@ function BankVerificationWidget({
20199
20202
  });
20200
20203
  }
20201
20204
  }
20205
+ trackVerificationError(
20206
+ err instanceof AdyenKycSdkError ? err.message : "sdk error"
20207
+ );
20202
20208
  return widgetCallback({
20203
20209
  action: "handle_exception",
20204
20210
  err
@@ -30211,7 +30217,7 @@ const BusinessTypeSelection = ({
30211
30217
  {
30212
30218
  name: "businessType",
30213
30219
  useLabelElement: false,
30214
- errorMessage: i18n.get((_i = errors.businessType) == null ? void 0 : _i.errorMessage),
30220
+ errorMessage: (_i = errors.businessType) == null ? void 0 : _i.errorMessage,
30215
30221
  showErrorIconBottom: true,
30216
30222
  isValid: valid.businessType,
30217
30223
  children: (childProps) => /* @__PURE__ */ jsx(
@@ -30237,7 +30243,7 @@ const BusinessTypeSelection = ({
30237
30243
  {
30238
30244
  name: "legalArrangement",
30239
30245
  useLabelElement: false,
30240
- errorMessage: i18n.get((_j = errors.legalArrangement) == null ? void 0 : _j.errorMessage),
30246
+ errorMessage: (_j = errors.legalArrangement) == null ? void 0 : _j.errorMessage,
30241
30247
  showErrorIconBottom: true,
30242
30248
  isValid: valid.legalArrangement,
30243
30249
  children: (childProps) => /* @__PURE__ */ jsx(
@@ -30265,7 +30271,7 @@ const BusinessTypeSelection = ({
30265
30271
  label: i18n.get("whatTypeOfTrusteeAreYou"),
30266
30272
  className: "adyen-kyc-u-margin-top-32",
30267
30273
  useLabelElement: false,
30268
- errorMessage: i18n.get((_l = errors.trusteeType) == null ? void 0 : _l.errorMessage),
30274
+ errorMessage: (_l = errors.trusteeType) == null ? void 0 : _l.errorMessage,
30269
30275
  showErrorIconBottom: true,
30270
30276
  isValid: valid.trusteeType,
30271
30277
  children: (childProps) => /* @__PURE__ */ jsx(
@@ -33804,7 +33810,7 @@ function PciDropinComponent({
33804
33810
  label: i18n.get("signer"),
33805
33811
  classNameModifiers: ["col-50"],
33806
33812
  className: "adyen-kyc-u-margin-y-32",
33807
- errorMessage: i18n.get((_c = errors.signer) == null ? void 0 : _c.errorMessage),
33813
+ errorMessage: (_c = errors.signer) == null ? void 0 : _c.errorMessage,
33808
33814
  isValid: valid.signer,
33809
33815
  children: (childProps) => /* @__PURE__ */ jsx(
33810
33816
  Select,
@@ -33823,7 +33829,7 @@ function PciDropinComponent({
33823
33829
  Field,
33824
33830
  {
33825
33831
  name: "acceptPci",
33826
- errorMessage: i18n.get((_d = errors.acceptPci) == null ? void 0 : _d.errorMessage),
33832
+ errorMessage: (_d = errors.acceptPci) == null ? void 0 : _d.errorMessage,
33827
33833
  isValid: valid.acceptPci,
33828
33834
  showErrorIconBottom: true,
33829
33835
  children: (childProps) => /* @__PURE__ */ jsx(
@@ -34966,7 +34972,7 @@ function ServiceAgreementDropinComponent({
34966
34972
  label: i18n.get("signer"),
34967
34973
  classNameModifiers: ["col-50"],
34968
34974
  className: "adyen-kyc-u-margin-top-32",
34969
- errorMessage: i18n.get((_a = errors.signer) == null ? void 0 : _a.errorMessage),
34975
+ errorMessage: (_a = errors.signer) == null ? void 0 : _a.errorMessage,
34970
34976
  isValid: valid.signer,
34971
34977
  children: (childProps) => /* @__PURE__ */ jsx(
34972
34978
  Select,
@@ -34987,7 +34993,7 @@ function ServiceAgreementDropinComponent({
34987
34993
  {
34988
34994
  name: "acceptServiceAgreement",
34989
34995
  className: "adyen-kyc-u-margin-top-16",
34990
- errorMessage: i18n.get((_b = errors.acceptServiceAgreement) == null ? void 0 : _b.errorMessage),
34996
+ errorMessage: (_b = errors.acceptServiceAgreement) == null ? void 0 : _b.errorMessage,
34991
34997
  isValid: valid.acceptServiceAgreement,
34992
34998
  children: (childProps) => /* @__PURE__ */ jsx(
34993
34999
  Checkbox,
@@ -39649,7 +39655,7 @@ const ConfigurationApiProvider = ({
39649
39655
  }) => {
39650
39656
  const authContext = useAuthContext();
39651
39657
  const { isEmbeddedDropin, loadingContext } = authContext;
39652
- const sdkVersion = "2.66.0";
39658
+ const sdkVersion = "2.67.0";
39653
39659
  useAnalytics({
39654
39660
  onUserEvent,
39655
39661
  legalEntityId: rootLegalEntityId,
@@ -40283,7 +40289,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40283
40289
  };
40284
40290
  const copyToClipboard = async () => {
40285
40291
  const toCopy = {
40286
- sdkVersion: "2.66.0",
40292
+ sdkVersion: "2.67.0",
40287
40293
  experiments: Object.fromEntries(allExperimentsWithValues),
40288
40294
  settings: Object.fromEntries(allSettingsWithValues)
40289
40295
  };
@@ -40348,7 +40354,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
40348
40354
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
40349
40355
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40350
40356
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
40351
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.66.0" })
40357
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "2.67.0" })
40352
40358
  ] }) }),
40353
40359
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
40354
40360
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
@@ -0,0 +1,5 @@
1
+ import { jsx } from "preact/compat/jsx-runtime";
2
+ const SvgExternalLink = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, fill: "none", role: "img", ...props, children: /* @__PURE__ */ jsx("path", { fill: "#00112C", d: "M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.9999Z" }) });
3
+ export {
4
+ SvgExternalLink as default
5
+ };
package/dist/style.css CHANGED
@@ -255,24 +255,25 @@ button[disabled]:hover {
255
255
  color: var(--adyen-sdk-color-link-primary-active, #8d95a3);
256
256
  }
257
257
  .adyen-kyc-link:focus {
258
- outline: none;
259
- text-decoration: underline;
258
+ box-shadow: 0 0 0 var(--adyen-sdk-focus-ring-spacer, 1px) var(--adyen-sdk-color-background-primary, #ffffff), 0 0 0 var(--adyen-sdk-focus-ring-outline, 3px) var(--adyen-sdk-focus-ring-color, rgba(0, 112, 245, 0.8));
259
+ border-radius: var(--adyen-sdk-border-radius-xs, 2px);
260
+ transition: var(--adyen-sdk-animation-duration-fast, 100ms) var(--adyen-sdk-animation-easing-standard, cubic-bezier(0.2, 0, 0.4, 0.9));
261
+ transition-property: box-shadow;
260
262
  }
261
263
  .adyen-kyc-link:visited {
262
264
  color: var(--adyen-sdk-color-link-primary, #00112c);
263
265
  }
264
- .adyen-kyc-link--with-icon .adyen-kyc-link__text {
265
- margin-right: var(--adyen-sdk-spacer-020, 4px);
266
+ .adyen-kyc-link--with-icon {
267
+ display: inline-flex;
268
+ width: fit-content;
269
+ gap: var(--adyen-sdk-spacer-020, 4px);
266
270
  }
267
271
  .adyen-kyc-link--with-icon:hover {
268
272
  color: var(--adyen-sdk-color-link-primary-hover, #5c687c);
269
- margin-right: var(--adyen-sdk-spacer-000, 0px);
270
273
  text-decoration: none;
271
274
  }
272
275
  .adyen-kyc-link--icon-left {
273
- display: inline-flex;
274
276
  flex-direction: row-reverse;
275
- gap: var(--adyen-sdk-spacer-020, 4px);
276
277
  }
277
278
  .adyen-kyc-link__text {
278
279
  display: inline;
@@ -1329,6 +1330,7 @@ button[disabled]:hover {
1329
1330
  right: 14px;
1330
1331
  transform: translateY(-50%);
1331
1332
  width: 16px;
1333
+ top: var(--adyen-sdk-spacer-080, 20px);
1332
1334
  }
1333
1335
  .adyen-kyc-input__inline-validation--valid {
1334
1336
  color: var(--adyen-sdk-color-label-success, #07893c);
@@ -1336,7 +1338,6 @@ button[disabled]:hover {
1336
1338
  }
1337
1339
  .adyen-kyc-input__inline-validation--invalid {
1338
1340
  color: var(--adyen-sdk-color-label-critical, #e22d2d);
1339
- top: 50%;
1340
1341
  }
1341
1342
  .adyen-kyc-input__inline-validation--invalid-bottom {
1342
1343
  top: var(--adyen-sdk-spacer-040, 8px);
@@ -1496,7 +1497,8 @@ button[disabled]:hover {
1496
1497
  background-color: var(--adyen-sdk-color-background-primary-hover, #f7f7f8);
1497
1498
  }
1498
1499
  .adyen-kyc-input-radio__input:focus {
1499
- box-shadow: 0 0 0 var(--adyen-sdk-focus-ring-spacer, 1px) var(--adyen-sdk-focus-ring-color, rgba(0, 112, 245, 0.8)), 0 0 0 var(--adyen-sdk-focus-ring-outline, 3px) var(--adyen-sdk-focus-ring-color, rgba(0, 112, 245, 0.8));
1500
+ box-shadow: 0 0 0 var(--adyen-sdk-focus-ring-spacer, 1px) var(--adyen-sdk-color-background-primary, #ffffff), 0 0 0 var(--adyen-sdk-focus-ring-outline, 3px) var(--adyen-sdk-focus-ring-color, rgba(0, 112, 245, 0.8));
1501
+ border-radius: var(--adyen-sdk-border-radius-xs, 2px);
1500
1502
  transition: var(--adyen-sdk-animation-duration-fast, 100ms) var(--adyen-sdk-animation-easing-standard, cubic-bezier(0.2, 0, 0.4, 0.9));
1501
1503
  transition-property: box-shadow;
1502
1504
  }
@@ -1,4 +1,5 @@
1
1
  import type { CountryCode } from '../../../../../core/models/country-code';
2
+ import type { Translatable } from '../../../../../language/types';
2
3
  export type AmountSelectorProps = {
3
4
  country: CountryCode;
4
5
  handleChangeForCurrency: (e: any) => void;
@@ -6,7 +7,7 @@ export type AmountSelectorProps = {
6
7
  fieldName: string;
7
8
  fieldLabel?: string;
8
9
  fieldHelper?: string;
9
- errorMessage?: string | boolean;
10
+ errorMessage?: Translatable | boolean;
10
11
  currency?: string;
11
12
  value?: number;
12
13
  validCurrency?: any;
@@ -1,12 +1,13 @@
1
1
  import type { JSX } from 'preact';
2
2
  import type { Currency } from '../../../core/models/currency';
3
+ import type { Translatable } from '../../../language/types';
3
4
  interface ReportedValueProps {
4
5
  currency: Currency;
5
6
  amount: number | undefined;
6
7
  onAmountChanged: (amount: number) => void;
7
8
  helper: string;
8
9
  fieldName: string;
9
- errorMessage: string | boolean | JSX.Element | undefined;
10
+ errorMessage?: Translatable | boolean | JSX.Element;
10
11
  isValid: boolean | undefined;
11
12
  }
12
13
  export declare const ReportedValue: ({ currency, amount, onAmountChanged, helper, fieldName, errorMessage, isValid, }: ReportedValueProps) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { Translatable } from '../../../../../../language/types';
1
2
  import type { FormUtils } from '../../../../../../utils/formUtils';
2
3
  import type { IdentityNumberSchema } from '../../../../../IdentityNumber/type';
3
4
  import type { MultiSelectOnChangeProps, SingleSelectOnChangeProps } from '../../../../../internal/FormFields/Select/types';
@@ -16,7 +17,7 @@ interface DriversLicenseProps {
16
17
  onCardNumberBlur: (event: Event) => void;
17
18
  formUtils: FormUtils<AuDriversLicenseSchema>;
18
19
  isValid: Record<keyof AuDriversLicenseSchema, boolean>;
19
- errorMessages: Record<keyof AuDriversLicenseSchema, string | boolean>;
20
+ errorMessages: Record<keyof AuDriversLicenseSchema, Translatable | boolean>;
20
21
  shouldValidate?: boolean;
21
22
  }
22
23
  export declare const DriversLicense: ({ driversLicense, onIssuerStateChange, onLicenseNumberInput, onLicenseNumberBlur, onCardNumberInput, onCardNumberBlur, formUtils, isValid, errorMessages, shouldValidate, }: DriversLicenseProps) => import("preact").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import type { Translatable } from '../../../../../../language/types';
1
2
  import type { FormUtils } from '../../../../../../utils/formUtils';
2
3
  import type { IdentityNumberSchema } from '../../../../../IdentityNumber/type';
3
4
  import type { AdditionalIdentityInfoSchema } from '../../types';
@@ -13,7 +14,7 @@ interface DriversLicenseProps {
13
14
  onCardNumberBlur: (event: Event) => void;
14
15
  formUtils: FormUtils<NZDriversLicenseSchema>;
15
16
  isValid: Record<keyof NZDriversLicenseSchema, boolean>;
16
- errorMessages: Record<keyof NZDriversLicenseSchema, string | boolean>;
17
+ errorMessages: Record<keyof NZDriversLicenseSchema, Translatable | boolean>;
17
18
  shouldValidate?: boolean;
18
19
  }
19
20
  export declare const DriversLicense: ({ driversLicense, onLicenseNumberInput, onLicenseNumberBlur, onCardNumberInput, onCardNumberBlur, formUtils, isValid, errorMessages, shouldValidate, }: DriversLicenseProps) => import("preact").JSX.Element;
@@ -1,9 +1,10 @@
1
+ import type { Translatable } from '../../../../../language/types';
1
2
  import type { IndividualIdNumberOption, IndividualIdNumberType } from '../../../../internal/IdFieldTypeSelector/countryIdNumberTypes';
2
3
  export interface TypeOfIdentityProps {
3
4
  availableIdentityTypesOptions: readonly IndividualIdNumberOption[];
4
5
  selectedIdentityType: IndividualIdNumberType | undefined;
5
6
  setSelectedIdentityType: (type: IndividualIdNumberType) => void;
6
- errorMessage: string | boolean;
7
+ errorMessage: Translatable | boolean;
7
8
  isValid: boolean;
8
9
  label?: string;
9
10
  }
@@ -1,5 +1,5 @@
1
1
  import './Field.scss';
2
- import type { ComponentChildren, ComponentProps, JSX } from 'preact';
2
+ import { type ComponentChildren, type ComponentProps, type JSX } from 'preact';
3
3
  import type { FieldProps } from './types';
4
4
  export type MaybeLabelElementProps = {
5
5
  children: ComponentChildren;
@@ -1,6 +1,7 @@
1
1
  import type { ComponentChildren, JSX } from 'preact';
2
2
  import type { ChangeEventHandler } from 'preact/compat';
3
3
  import type { MutableRef } from 'preact/hooks';
4
+ import type { Translatable } from '../../../../language/types';
4
5
  export interface FieldChildProps {
5
6
  isInvalid: boolean;
6
7
  isValid: boolean;
@@ -15,8 +16,7 @@ export interface FieldProps {
15
16
  dataPlaceholder?: string;
16
17
  disabled?: boolean;
17
18
  optional?: boolean;
18
- dualBrandingElements?: any;
19
- errorMessage?: string | boolean | JSX.Element | null;
19
+ errorMessage?: Translatable | boolean | JSX.Element;
20
20
  filled?: boolean;
21
21
  focused?: boolean;
22
22
  helper?: string | JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import './MaskedInputText.scss';
2
2
  import type { JSX } from 'preact';
3
3
  import type { MaskSettings } from '../../../../core/hooks/useForm/types';
4
+ import type { Translatable } from '../../../../language/types';
4
5
  import type { MismatchResult } from '../../../../utils/masking/matchAgainstMask';
5
6
  export interface MaskedInputTextProps extends MaskSettings {
6
7
  value: string;
@@ -9,7 +10,7 @@ export interface MaskedInputTextProps extends MaskSettings {
9
10
  onBlur?: (event: JSX.TargetedFocusEvent<HTMLInputElement>) => void;
10
11
  onMismatch?: (mismatch: MismatchResult) => void;
11
12
  isValid: boolean;
12
- errorMessage?: string | boolean;
13
+ errorMessage?: Translatable | boolean;
13
14
  shouldValidate?: boolean;
14
15
  label: string;
15
16
  name: string;
@@ -1,11 +1,12 @@
1
1
  import type { JSX } from 'preact';
2
2
  import type { BaseFormFieldProps } from '../../../core/hooks/useForm/types';
3
3
  import type { CountryCode } from '../../../core/models/country-code';
4
+ import type { Translatable } from '../../../language/types';
4
5
  interface LegalFormFieldSchema {
5
6
  legalForm?: string;
6
7
  }
7
8
  export interface LegalFormFieldProps extends Omit<BaseFormFieldProps<LegalFormFieldSchema>, 'errors' | 'labels'> {
8
- errorMessage?: string | boolean | JSX.Element | null;
9
+ errorMessage?: Translatable | boolean | JSX.Element;
9
10
  countryCode?: CountryCode;
10
11
  label?: string;
11
12
  }
@@ -1,10 +1,11 @@
1
1
  import type { JSX } from 'preact';
2
2
  import type { BaseFormFieldProps } from '../../../core/hooks/useForm/types';
3
+ import type { Translatable } from '../../../language/types';
3
4
  interface NaceCodeFieldSchema {
4
5
  naceCode?: string;
5
6
  }
6
7
  export interface NaceCodeFieldProps extends Omit<BaseFormFieldProps<NaceCodeFieldSchema>, 'errors' | 'labels'> {
7
- errorMessage?: string | boolean | JSX.Element | null;
8
+ errorMessage?: Translatable | boolean | JSX.Element;
8
9
  label?: string;
9
10
  }
10
11
  export {};
@@ -33,6 +33,7 @@ export declare const svgs: {
33
33
  readonly document: import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
34
34
  readonly download: import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
35
35
  readonly edit: import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
36
+ readonly 'external-link': import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
36
37
  readonly 'field-error': import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
37
38
  readonly hide: import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
38
39
  readonly 'info-circle': import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>>;
@@ -16,7 +16,7 @@ export type FieldValid<FieldSchema> = {
16
16
  [fieldValid in keyof FieldSchema]: boolean;
17
17
  };
18
18
  export type FieldErrors<FieldSchema> = {
19
- [fieldError in keyof FieldSchema]: string | boolean;
19
+ [fieldError in keyof FieldSchema]: Translatable | boolean;
20
20
  };
21
21
  export type FieldLabels<FieldSchema> = {
22
22
  [fieldLabel in keyof FieldSchema]?: string;
@@ -16,12 +16,12 @@ export type FormUtils<Schema> = {
16
16
  isReadOnly: (field: keyof Schema) => boolean;
17
17
  isTrusted: (field: keyof Schema) => boolean;
18
18
  getVal: (val: Translatable) => string;
19
- getErrorMessage: (field: keyof Schema, errors: ValidationRuleResults<Schema> | null, fieldProblems: Partial<Record<keyof Schema, boolean>> | undefined) => string | boolean;
19
+ getErrorMessage: (field: keyof Schema, errors: ValidationRuleResults<Schema> | null, fieldProblems: Partial<Record<keyof Schema, boolean>> | undefined) => Translatable | boolean;
20
20
  getFieldData: <Fields extends Array<keyof Schema>, FieldSchema extends {
21
21
  [field in keyof Schema]: Schema[field];
22
22
  }>(formData: Schema, fieldKeys: Fields) => FieldData<FieldSchema>;
23
23
  getFieldValid: (formValid: Record<keyof Schema, boolean>, fieldKeys: Array<keyof Schema>) => Record<keyof Schema, boolean>;
24
- getFieldErrors: (formErrors: Record<keyof Schema, ValidationRuleResult | null>, fieldProblems: Partial<Record<keyof Schema, boolean>> | undefined, fieldKeys: Array<keyof Schema>) => Record<keyof Schema, string | boolean>;
24
+ getFieldErrors: (formErrors: Record<keyof Schema, ValidationRuleResult | null>, fieldProblems: Partial<Record<keyof Schema, boolean>> | undefined, fieldKeys: Array<keyof Schema>) => Record<keyof Schema, Translatable | boolean>;
25
25
  getFieldLabels: (fieldKeys: Array<keyof Schema>, fallbackLabelKeys?: Partial<Record<keyof Schema, TranslationKey>>) => Partial<Record<keyof Schema, string>>;
26
26
  getFieldPlaceholders: (fieldKeys: Array<keyof Schema>, fallbackPlaceholderKeys?: Partial<Record<keyof Schema, TranslationKey>>) => Partial<Record<keyof Schema, string>>;
27
27
  getFieldHelperText: (fieldKeys: Array<keyof Schema>, fallbackHelperTextKeys?: Partial<Record<keyof Schema, TranslationKey>>) => Partial<Record<keyof Schema, string>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.66.0",
3
+ "version": "2.67.0",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",