@adyen/kyc-components 3.35.0 → 3.36.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.
@@ -2903,12 +2903,13 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
2903
2903
  ExperimentNames2["HidePciTask"] = "HidePciTask";
2904
2904
  ExperimentNames2["EnableAgeVerification"] = "EnableAgeVerification";
2905
2905
  ExperimentNames2["PreserveMismatchedInitialValues"] = "PreserveMismatchedInitialValues";
2906
- ExperimentNames2["StrictNameAndAddressValidationV4"] = "StrictNameAndAddressValidationV4";
2907
2906
  ExperimentNames2["EnableNationalitySGHK"] = "EnableNationalitySGHK";
2908
2907
  ExperimentNames2["EnableAUGovernmentalOrganizationSkipRegistrationNumber"] = "EnableAUGovernmentalOrganizationSkipRegistrationNumber";
2909
2908
  ExperimentNames2["EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation"] = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation";
2910
- ExperimentNames2["EnableFinancialInformationComponentV4"] = "EnableFinancialInformationComponentV4";
2911
2909
  ExperimentNames2["EnablePreferInstantVerificationFlow"] = "EnablePreferInstantVerificationFlow";
2910
+ ExperimentNames2["EnableFinancialInformationComponentV4"] = "EnableFinancialInformationComponentV4";
2911
+ ExperimentNames2["StrictNameAndAddressValidationV4"] = "StrictNameAndAddressValidationV4";
2912
+ ExperimentNames2["EnableLemApiVersionV4"] = "EnableLemApiVersionV4";
2912
2913
  ExperimentNames2["EnablePhoneFieldScenario"] = "EnablePhoneFieldScenario";
2913
2914
  ExperimentNames2["EnableAUIncorporatedPartnershipSkipRegistrationNumber"] = "EnableAUIncorporatedPartnershipSkipRegistrationNumber";
2914
2915
  ExperimentNames2["EnableCompanyTrusteeSkipABN"] = "EnableCompanyTrusteeSkipABN";
@@ -8213,6 +8214,96 @@ const dateOfIncorporationFieldMetadata = {
8213
8214
  }
8214
8215
  ]
8215
8216
  };
8217
+ const DBA_NAME_FIELD = ["hasDba", "dbaName"];
8218
+ function DBANameField({
8219
+ data,
8220
+ valid,
8221
+ errors,
8222
+ labels: labels2,
8223
+ legalCompanyName,
8224
+ helperText,
8225
+ readonly,
8226
+ handleChangeFor,
8227
+ setErrors
8228
+ }) {
8229
+ const { i18n } = useI18nContext();
8230
+ const { isExperimentEnabled } = useExperimentsContext();
8231
+ const isLemApiVersionV4Enabled = isExperimentEnabled(ExperimentNames.EnableLemApiVersionV4);
8232
+ const selection = useMemo(() => {
8233
+ if (typeof data.hasDba === "undefined") return;
8234
+ if (!data.hasDba) setErrors == null ? void 0 : setErrors("dbaName", null);
8235
+ return data.hasDba ? "yes" : "no";
8236
+ }, [data.hasDba, setErrors]);
8237
+ const handleDbaChange = (selectedValue) => {
8238
+ const isYes = selectedValue === "yes";
8239
+ const isNo = selectedValue === "no";
8240
+ handleChangeFor("hasDba")(isYes);
8241
+ if (isLemApiVersionV4Enabled) {
8242
+ handleChangeFor("doingBusinessAbsent")(isNo);
8243
+ if (isNo) {
8244
+ handleChangeFor("dbaName")(legalCompanyName);
8245
+ }
8246
+ }
8247
+ };
8248
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
8249
+ /* @__PURE__ */ jsx(
8250
+ Field,
8251
+ {
8252
+ name: "hasDba",
8253
+ label: labels2.hasDba ?? i18n.get("hasDba"),
8254
+ helper: (helperText == null ? void 0 : helperText.hasDba) ?? i18n.get("hasDba__helperText"),
8255
+ isValid: valid.hasDba,
8256
+ errorMessage: errors.hasDba,
8257
+ children: (childProps) => /* @__PURE__ */ jsx(
8258
+ RadioGroup,
8259
+ {
8260
+ ...childProps,
8261
+ name: "hasDba",
8262
+ items: [
8263
+ { id: "yes", name: "yes" },
8264
+ { id: "no", name: "no" }
8265
+ ],
8266
+ value: selection,
8267
+ onChange: handleDbaChange,
8268
+ horizontal: true
8269
+ }
8270
+ )
8271
+ }
8272
+ ),
8273
+ data.hasDba && /* @__PURE__ */ jsx(
8274
+ Field,
8275
+ {
8276
+ name: "dbaName",
8277
+ label: labels2.dbaName ?? i18n.get("dbaName"),
8278
+ errorMessage: errors.dbaName,
8279
+ isValid: valid.dbaName,
8280
+ classNameModifiers: ["dbaName"],
8281
+ children: (childProps) => /* @__PURE__ */ jsx(
8282
+ InputText,
8283
+ {
8284
+ ...childProps,
8285
+ "aria-required": true,
8286
+ "aria-label": labels2.dbaName ?? i18n.get("dbaName"),
8287
+ "aria-invalid": !valid.dbaName,
8288
+ name: "dbaName",
8289
+ value: data.dbaName,
8290
+ readonly,
8291
+ classNameModifiers: ["dbaName"],
8292
+ onInput: handleChangeFor("dbaName", "input"),
8293
+ onBlur: handleChangeFor("dbaName", "blur")
8294
+ }
8295
+ )
8296
+ }
8297
+ )
8298
+ ] });
8299
+ }
8300
+ const hasDbaFieldMetadata = {
8301
+ validators: [validateNotEmptyOnBlur]
8302
+ };
8303
+ const dbaNameFieldMetadata = {
8304
+ label: "dbaName",
8305
+ validators: [validateNotEmptyOnBlur]
8306
+ };
8216
8307
  const inferCompanyRegistrationNumberType = (registrationNumber, country, companyType) => {
8217
8308
  const optionsForCountry = companyRegistrationNumberOptions[country];
8218
8309
  const metadataFn = defaultFieldConfig$9[country];
@@ -9958,6 +10049,7 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [
9958
10049
  ];
9959
10050
  const companyRegistrationDetailsFields = [
9960
10051
  ...TRADING_NAME_FIELD,
10052
+ ...DBA_NAME_FIELD,
9961
10053
  ...BUSINESS_REGISTRATION_NUMBER_FIELD,
9962
10054
  ...STOCK_EXCHANGE_MIC_FIELD,
9963
10055
  ...STOCK_ISIN_FIELD,
@@ -9972,6 +10064,7 @@ function CompanyRegistrationDetailsComponent(props) {
9972
10064
  const COMPANY_REGISTRATION_DETAILS = mergedProps.id ?? "companyRegistrationDetails";
9973
10065
  const { i18n } = useI18nContext();
9974
10066
  const { isExperimentEnabled } = useExperimentsContext();
10067
+ const isLemApiVersionV4Enabled = isExperimentEnabled(ExperimentNames.EnableLemApiVersionV4);
9975
10068
  const { companyNameAndCountry } = useGlobalData();
9976
10069
  const { updateStateSlice } = useGlobalDataSlice(COMPANY_REGISTRATION_DETAILS);
9977
10070
  const country = (companyNameAndCountry == null ? void 0 : companyNameAndCountry.country) ?? mergedProps.country;
@@ -10006,6 +10099,16 @@ function CompanyRegistrationDetailsComponent(props) {
10006
10099
  tradingNameFieldMetadata,
10007
10100
  mergedProps
10008
10101
  );
10102
+ mergedProps = mergeFieldMetadataIntoProps(
10103
+ "hasDba",
10104
+ hasDbaFieldMetadata,
10105
+ mergedProps
10106
+ );
10107
+ mergedProps = mergeFieldMetadataIntoProps(
10108
+ "dbaName",
10109
+ dbaNameFieldMetadata,
10110
+ mergedProps
10111
+ );
10009
10112
  mergedProps = mergeFieldMetadataIntoProps(
10010
10113
  "stockExchangeMIC",
10011
10114
  stockExchangeMICFieldMetadata,
@@ -10066,6 +10169,9 @@ function CompanyRegistrationDetailsComponent(props) {
10066
10169
  if (currentData.sameNameAsLegalName) {
10067
10170
  fieldsToRemove.push("tradingName");
10068
10171
  }
10172
+ if (!currentData.hasDba) {
10173
+ fieldsToRemove.push("dbaName");
10174
+ }
10069
10175
  if (currentData.exemptedFromVat) {
10070
10176
  fieldsToRemove.push("vatNumber");
10071
10177
  } else {
@@ -10088,7 +10194,7 @@ function CompanyRegistrationDetailsComponent(props) {
10088
10194
  },
10089
10195
  [requiredFields]
10090
10196
  );
10091
- const { schema, data, valid, errors, fieldProblems, handleChangeFor } = useForm({
10197
+ const { schema, data, valid, errors, fieldProblems, handleChangeFor, setErrors } = useForm({
10092
10198
  ...mergedProps,
10093
10199
  schema: getFormSchema2,
10094
10200
  defaultData: mergedProps.data,
@@ -10127,7 +10233,7 @@ function CompanyRegistrationDetailsComponent(props) {
10127
10233
  }
10128
10234
  ),
10129
10235
  /* @__PURE__ */ jsxs("fieldset", { form: COMPANY_REGISTRATION_DETAILS, children: [
10130
- formUtils.isRequiredField("tradingName") && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
10236
+ !isLemApiVersionV4Enabled && formUtils.isRequiredField("tradingName") && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
10131
10237
  TradingNameField,
10132
10238
  {
10133
10239
  data: formUtils.getFieldData(data, TRADING_NAME_FIELD),
@@ -10139,6 +10245,21 @@ function CompanyRegistrationDetailsComponent(props) {
10139
10245
  legalCompanyName
10140
10246
  }
10141
10247
  ) }),
10248
+ isLemApiVersionV4Enabled && formUtils.isRequiredField("dbaName") && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
10249
+ DBANameField,
10250
+ {
10251
+ data: formUtils.getFieldData(data, DBA_NAME_FIELD),
10252
+ valid: formUtils.getFieldValid(valid, DBA_NAME_FIELD),
10253
+ errors: formUtils.getFieldErrors(errors, fieldProblems, DBA_NAME_FIELD),
10254
+ labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
10255
+ hasDba: "hasDba"
10256
+ }),
10257
+ legalCompanyName,
10258
+ readonly: formUtils.isReadOnly("dbaName"),
10259
+ handleChangeFor,
10260
+ setErrors
10261
+ }
10262
+ ) }),
10142
10263
  formUtils.isRequiredField("stockExchangeMIC") && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
10143
10264
  StockExchangeMICField,
10144
10265
  {
@@ -10295,7 +10416,9 @@ const companyBase = {
10295
10416
  stockExchangeMIC: { rule: "ifPubliclyTradedCompany" },
10296
10417
  stockISIN: { rule: "ifPubliclyTradedCompany" },
10297
10418
  stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
10298
- tradingName: { rule: "REQUIRED" },
10419
+ tradingName: { rule: "isLemApiVersionV4Disabled" },
10420
+ dbaName: { rule: "isLemApiVersionV4Enabled" },
10421
+ hasDba: { rule: "isLemApiVersionV4Enabled" },
10299
10422
  dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
10300
10423
  exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
10301
10424
  registrationNumber: { rule: "countryRequiresRegistrationNumberForCompanies" },
@@ -12033,27 +12156,6 @@ function FieldContainer(props) {
12033
12156
  }
12034
12157
  return renderField(fieldName);
12035
12158
  }
12036
- const isIntersectionObserverSupported = typeof IntersectionObserver === "function";
12037
- function useIsElementVisible(ref, fallback = true) {
12038
- const [isOnScreen, setIsOnScreen] = useState(isIntersectionObserverSupported ? false : fallback);
12039
- const observerRef = useRef();
12040
- useEffect(() => {
12041
- if (!isIntersectionObserverSupported) return;
12042
- observerRef.current = new IntersectionObserver(
12043
- ([entry]) => setIsOnScreen(entry.isIntersecting)
12044
- );
12045
- }, []);
12046
- useEffect(() => {
12047
- var _a;
12048
- if (!ref.current) return;
12049
- (_a = observerRef.current) == null ? void 0 : _a.observe(ref.current);
12050
- return () => {
12051
- var _a2;
12052
- (_a2 = observerRef.current) == null ? void 0 : _a2.disconnect();
12053
- };
12054
- }, [ref]);
12055
- return isOnScreen;
12056
- }
12057
12159
  const logger$D = createLogger("SearchAddress");
12058
12160
  const SearchAddress = ({
12059
12161
  data,
@@ -12063,8 +12165,7 @@ const SearchAddress = ({
12063
12165
  handleAddressSearch,
12064
12166
  handleFindAddress,
12065
12167
  addressType,
12066
- kompanyAddress,
12067
- kompanyPrefilled = false
12168
+ kompanyAddress
12068
12169
  }) => {
12069
12170
  const { i18n } = useI18nContext();
12070
12171
  const [items, setItems] = useState([]);
@@ -12072,21 +12173,13 @@ const SearchAddress = ({
12072
12173
  const [resetSearch, setResetSearch] = useState(false);
12073
12174
  const [searchText, setSearchText] = useState(null);
12074
12175
  const [showSearchList, setShowSearchList] = useState(false);
12075
- const searchBoxRef = useRef(null);
12076
- const isVisible = useIsElementVisible(searchBoxRef);
12077
12176
  const canAutoFillKompanyAddress = kompanyAddress && searchText !== kompanyAddress && addressType === "registrationAddress";
12078
12177
  useEffect(() => {
12079
12178
  setSearchText(kompanyAddress);
12080
12179
  if (canAutoFillKompanyAddress) {
12081
- const searchForAddress = () => getSearchItems(kompanyAddress);
12082
- searchForAddress();
12180
+ getSearchItems(kompanyAddress);
12083
12181
  }
12084
12182
  }, [kompanyAddress]);
12085
- useEffect(() => {
12086
- if (isVisible && kompanyAddress && addressType === "registrationAddress" && !kompanyPrefilled) {
12087
- setShowSearchList(true);
12088
- }
12089
- }, [isVisible, kompanyAddress, addressType, kompanyPrefilled]);
12090
12183
  useEffect(() => {
12091
12184
  setItems([]);
12092
12185
  setResetSearch(true);
@@ -12227,7 +12320,6 @@ const SearchAddress = ({
12227
12320
  name: "searchAddress",
12228
12321
  className: "adyen-kyc-u-margin-bottom-8",
12229
12322
  label: i18n.get("searchAddress"),
12230
- wrapperRef: searchBoxRef,
12231
12323
  children: (childProps) => /* @__PURE__ */ jsx(
12232
12324
  Select,
12233
12325
  {
@@ -12599,16 +12691,14 @@ function Address(props) {
12599
12691
  [dataProp == null ? void 0 : dataProp.country, i18n]
12600
12692
  );
12601
12693
  const {
12694
+ schema,
12602
12695
  data,
12603
12696
  errors,
12604
12697
  valid,
12605
12698
  isValid,
12606
12699
  fieldProblems,
12607
12700
  handleChangeFor,
12608
- triggerValidation,
12609
- resetToDefaultData,
12610
- schema,
12611
- setData
12701
+ triggerValidation
12612
12702
  } = useForm({
12613
12703
  ...props,
12614
12704
  schema: requiredFields,
@@ -12683,26 +12773,6 @@ function Address(props) {
12683
12773
  setShowAddAddressButton(false);
12684
12774
  }
12685
12775
  }, [shouldValidate]);
12686
- const canAutofillVerifiedBusinessAddress = Boolean(
12687
- (verifiedBusiness == null ? void 0 : verifiedBusiness.street) && (verifiedBusiness == null ? void 0 : verifiedBusiness.city) && (verifiedBusiness == null ? void 0 : verifiedBusiness.state) && verifiedBusiness.zipcode
12688
- );
12689
- useEffect(() => {
12690
- if (!isExperimentEnabled("EnableNewBusinessDetailsFlow")) return;
12691
- if (verifiedBusiness && canAutofillVerifiedBusinessAddress) {
12692
- setShowAutocompletedAddressFields(true);
12693
- setShowAddAddressButton(false);
12694
- setData("address", verifiedBusiness.street);
12695
- setData("city", verifiedBusiness.city);
12696
- setData("stateOrProvince", verifiedBusiness.state);
12697
- setData("postalCode", verifiedBusiness.zipcode);
12698
- return triggerValidation();
12699
- }
12700
- if (!(dataProp == null ? void 0 : dataProp.address) || !(dataProp == null ? void 0 : dataProp.city) || !(dataProp == null ? void 0 : dataProp.postalCode)) {
12701
- setShowAutocompletedAddressFields(false);
12702
- setShowAddAddressButton(true);
12703
- resetToDefaultData();
12704
- }
12705
- }, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
12706
12776
  const getComponent = (fieldName) => {
12707
12777
  if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
12708
12778
  const hideField = fieldName === "country" && hideCountry;
@@ -12790,8 +12860,7 @@ function Address(props) {
12790
12860
  legalEntityId,
12791
12861
  autocompleteAddressForm,
12792
12862
  addressType,
12793
- kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address,
12794
- kompanyPrefilled: canAutofillVerifiedBusinessAddress
12863
+ kompanyAddress: verifiedBusiness == null ? void 0 : verifiedBusiness.address
12795
12864
  }
12796
12865
  ),
12797
12866
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-search-address--below", children: [
@@ -14364,6 +14433,16 @@ const rules$3 = ({
14364
14433
  )) {
14365
14434
  return "REQUIRED";
14366
14435
  }
14436
+ },
14437
+ isLemApiVersionV4Enabled: () => {
14438
+ if (isExperimentEnabled("EnableLemApiVersionV4")) {
14439
+ return "REQUIRED";
14440
+ }
14441
+ },
14442
+ isLemApiVersionV4Disabled: () => {
14443
+ if (!isExperimentEnabled("EnableLemApiVersionV4")) {
14444
+ return "REQUIRED";
14445
+ }
14367
14446
  }
14368
14447
  });
14369
14448
  const logger$B = createLogger("mapPayoutAccountSchemaToApiBankAccount");
@@ -14572,6 +14651,7 @@ const businessDetailsBaseMapping = {
14572
14651
  "additionalInformation.legalCompanyName": "organization.legalName",
14573
14652
  "additionalInformation.legalFormDescription": "organization.legalFormDescription",
14574
14653
  "additionalInformation.dbaName": "organization.doingBusinessAs",
14654
+ "additionalInformation.doingBusinessAbsent": "organization.doingBusinessAbsent",
14575
14655
  "additionalInformation.registrationNumber": "organization.registrationNumber",
14576
14656
  "additionalInformation.taxInformation": "organization.taxInformation",
14577
14657
  "additionalInformation.vatNumber": "organization.vatNumber",
@@ -14599,6 +14679,8 @@ const companyBaseMapping = {
14599
14679
  "companyNameAndCountry.countryOfGoverningLaw": "organization.countryOfGoverningLaw",
14600
14680
  "companyType.entityType": "organization.type",
14601
14681
  "companyRegistrationDetails.tradingName": "organization.doingBusinessAs",
14682
+ "companyRegistrationDetails.dbaName": "organization.doingBusinessAs",
14683
+ "companyRegistrationDetails.doingBusinessAbsent": "organization.doingBusinessAbsent",
14602
14684
  "companyRegistrationDetails.registrationNumber": "organization.registrationNumber",
14603
14685
  "companyRegistrationDetails.taxInformation": "organization.taxInformation",
14604
14686
  "companyRegistrationDetails.vatNumber": "organization.vatNumber",
@@ -14623,6 +14705,8 @@ const companyBaseMapping = {
14623
14705
  const trustBaseMapping = {
14624
14706
  "trustRegistrationDetails.trustType": "trust.type",
14625
14707
  "trustRegistrationDetails.legalName": "trust.name",
14708
+ "trustRegistrationDetails.dbaName": "trust.doingBusinessAs",
14709
+ "trustRegistrationDetails.doingBusinessAbsent": "trust.doingBusinessAbsent",
14626
14710
  "trustRegistrationDetails.country": "trust.countryOfGoverningLaw",
14627
14711
  "trustRegistrationDetails.registrationNumber": "trust.registrationNumber",
14628
14712
  "trustRegistrationAddress.registrationAddress.city": "trust.registeredAddress.city",
@@ -14642,6 +14726,8 @@ const solePropBaseMapping = {
14642
14726
  "solePropNameAndCountry.country": "soleProprietorship.countryOfGoverningLaw",
14643
14727
  "solePropNameAndCountry.legalCompanyName": "soleProprietorship.name",
14644
14728
  "solePropRegistrationDetails.tradingName": "soleProprietorship.doingBusinessAs",
14729
+ "solePropRegistrationDetails.dbaName": "soleProprietorship.doingBusinessAs",
14730
+ "solePropRegistrationDetails.doingBusinessAbsent": "soleProprietorship.doingBusinessAbsent",
14645
14731
  "solePropRegistrationDetails.vatNumber": "soleProprietorship.vatNumber",
14646
14732
  "solePropRegistrationDetails.vatAbsenceReason": "soleProprietorship.vatAbsenceReason",
14647
14733
  "solePropRegistrationDetails.exemptedFromTax": "soleProprietorship.taxAbsent",
@@ -17071,6 +17157,8 @@ const trustBase = {
17071
17157
  legalName: {
17072
17158
  rule: "REQUIRED"
17073
17159
  },
17160
+ dbaName: { rule: "isLemApiVersionV4Enabled" },
17161
+ hasDba: { rule: "isLemApiVersionV4Enabled" },
17074
17162
  country: {
17075
17163
  rule: "REQUIRED"
17076
17164
  },
@@ -23223,6 +23311,7 @@ const trustRegistrationDetailsValidationsV4 = {
23223
23311
  };
23224
23312
  const trustRegistrationDetailsFields = [
23225
23313
  "legalName",
23314
+ ...DBA_NAME_FIELD,
23226
23315
  "country",
23227
23316
  "trustType",
23228
23317
  "objectOfTrust",
@@ -23237,6 +23326,7 @@ function TrustRegistrationDetailsComponent(props) {
23237
23326
  const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(
23238
23327
  ExperimentNames.StrictNameAndAddressValidationV4
23239
23328
  );
23329
+ const isLemApiVersionV4Enabled = isExperimentEnabled(ExperimentNames.EnableLemApiVersionV4);
23240
23330
  const TRUST_REGISTRATION_DETAILS = props.id || trustForms.trustRegistrationDetails.formId;
23241
23331
  const stateRef = useRef({ setState: null });
23242
23332
  const requiredFieldsByTask = trustRegistrationDetailsFields;
@@ -23246,7 +23336,7 @@ function TrustRegistrationDetailsComponent(props) {
23246
23336
  field
23247
23337
  )
23248
23338
  );
23249
- const { handleChangeFor, data, valid, errors, setData, fieldProblems } = useForm({
23339
+ const { handleChangeFor, data, valid, errors, setData, fieldProblems, setErrors } = useForm({
23250
23340
  ...props,
23251
23341
  schema: directChildFields,
23252
23342
  defaultData: { ...props.data, country },
@@ -23342,6 +23432,21 @@ function TrustRegistrationDetailsComponent(props) {
23342
23432
  )
23343
23433
  }
23344
23434
  ),
23435
+ isLemApiVersionV4Enabled && formUtils.isRequiredField("dbaName") && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-field-wrapper", children: /* @__PURE__ */ jsx(
23436
+ DBANameField,
23437
+ {
23438
+ data: formUtils.getFieldData(data, DBA_NAME_FIELD),
23439
+ valid: formUtils.getFieldValid(valid, DBA_NAME_FIELD),
23440
+ errors: formUtils.getFieldErrors(errors, fieldProblems, DBA_NAME_FIELD),
23441
+ labels: formUtils.getFieldLabels(DBA_NAME_FIELD, {
23442
+ hasDba: "hasDba"
23443
+ }),
23444
+ legalCompanyName: data.legalName,
23445
+ readonly: formUtils.isReadOnly("dbaName"),
23446
+ handleChangeFor,
23447
+ setErrors
23448
+ }
23449
+ ) }),
23345
23450
  formUtils.isRequiredField("trustType") && /* @__PURE__ */ jsx(
23346
23451
  Field,
23347
23452
  {
@@ -24711,7 +24816,9 @@ const solePropBase = {
24711
24816
  stockExchangeMIC: { rule: "ifPubliclyTradedCompany" },
24712
24817
  stockISIN: { rule: "ifPubliclyTradedCompany" },
24713
24818
  stockTickerSymbol: { rule: "ifPubliclyTradedCompany" },
24714
- tradingName: { rule: "REQUIRED" },
24819
+ tradingName: { rule: "isLemApiVersionV4Disabled" },
24820
+ dbaName: { rule: "isLemApiVersionV4Enabled" },
24821
+ hasDba: { rule: "isLemApiVersionV4Enabled" },
24715
24822
  dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
24716
24823
  exemptedFromRegistrationNumber: { rule: "countryHasRegistrationExemptionsForSomeSoleProps" },
24717
24824
  registrationNumber: { rule: "countryRequiresRegistrationNumberForSoleProps" },
@@ -25156,82 +25263,6 @@ const getFieldsWithExistingData = (legalEntity, isExperimentEnabled) => {
25156
25263
  }
25157
25264
  return nonDocumentFields;
25158
25265
  };
25159
- const DBA_NAME_FIELD = ["hasDba", "dbaName"];
25160
- function DBANameField({
25161
- data,
25162
- valid,
25163
- errors,
25164
- labels: labels2,
25165
- helperText,
25166
- readonly,
25167
- handleChangeFor,
25168
- setErrors
25169
- }) {
25170
- const { i18n } = useI18nContext();
25171
- const selection = useMemo(() => {
25172
- if (typeof data.hasDba === "undefined") return;
25173
- if (!data.hasDba) setErrors == null ? void 0 : setErrors("dbaName", null);
25174
- return data.hasDba ? "yes" : "no";
25175
- }, [data.hasDba, setErrors]);
25176
- return /* @__PURE__ */ jsxs(Fragment, { children: [
25177
- /* @__PURE__ */ jsx(
25178
- Field,
25179
- {
25180
- name: "hasDba",
25181
- label: labels2.hasDba ?? i18n.get("hasDba"),
25182
- helper: (helperText == null ? void 0 : helperText.hasDba) ?? i18n.get("hasDba__helperText"),
25183
- isValid: valid.hasDba,
25184
- errorMessage: errors.hasDba,
25185
- children: (childProps) => /* @__PURE__ */ jsx(
25186
- RadioGroup,
25187
- {
25188
- ...childProps,
25189
- name: "hasDba",
25190
- items: [
25191
- { id: "yes", name: "yes" },
25192
- { id: "no", name: "no" }
25193
- ],
25194
- value: selection,
25195
- onChange: (newValue) => handleChangeFor("hasDba")(newValue === "yes"),
25196
- horizontal: true
25197
- }
25198
- )
25199
- }
25200
- ),
25201
- data.hasDba && /* @__PURE__ */ jsx(
25202
- Field,
25203
- {
25204
- name: "dbaName",
25205
- label: labels2.dbaName ?? i18n.get("dbaName"),
25206
- errorMessage: errors.dbaName,
25207
- isValid: valid.dbaName,
25208
- classNameModifiers: ["dbaName"],
25209
- children: (childProps) => /* @__PURE__ */ jsx(
25210
- InputText,
25211
- {
25212
- ...childProps,
25213
- "aria-required": true,
25214
- "aria-label": labels2.dbaName ?? i18n.get("dbaName"),
25215
- "aria-invalid": !valid.dbaName,
25216
- name: "dbaName",
25217
- value: data.dbaName,
25218
- readonly,
25219
- classNameModifiers: ["dbaName"],
25220
- onInput: handleChangeFor("dbaName", "input"),
25221
- onBlur: handleChangeFor("dbaName", "blur")
25222
- }
25223
- )
25224
- }
25225
- )
25226
- ] });
25227
- }
25228
- const hasDbaFieldMetadata = {
25229
- validators: [validateNotEmptyOnBlur]
25230
- };
25231
- const dbaNameFieldMetadata = {
25232
- label: "dbaName",
25233
- validators: [validateNotEmptyOnBlur]
25234
- };
25235
25266
  const getNestedTrustedFields = (field, data, trustedFields) => {
25236
25267
  if (trustedFields && (data == null ? void 0 : data[field]) && typeof data[field] === "object") {
25237
25268
  return trustedFields.reduce((fields, trustedField) => {
@@ -35810,7 +35841,11 @@ function SolePropDropinComponent({
35810
35841
  );
35811
35842
  }
35812
35843
  const COUNTRIES_THAT_USE_REGISTRATION_NUMBER = [CountryCodes.NewZealand];
35813
- const rules = ({ data, country }) => ({
35844
+ const rules = ({
35845
+ data,
35846
+ country,
35847
+ isExperimentEnabled = () => false
35848
+ }) => ({
35814
35849
  countryUsesTaxId: () => {
35815
35850
  if (country !== CountryCodes.NewZealand && COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT.includes(country)) {
35816
35851
  return "REQUIRED";
@@ -35826,6 +35861,11 @@ const rules = ({ data, country }) => ({
35826
35861
  if (((_a = data == null ? void 0 : data.trustRegistrationDetails) == null ? void 0 : _a.trustType) === TrustTypes.CHARITABLE_TRUST) {
35827
35862
  return "REQUIRED";
35828
35863
  }
35864
+ },
35865
+ isLemApiVersionV4Enabled: () => {
35866
+ if (isExperimentEnabled("EnableLemApiVersionV4")) {
35867
+ return "REQUIRED";
35868
+ }
35829
35869
  }
35830
35870
  });
35831
35871
  const parseConfiguration$1 = ({ matchingScenario, country }) => parseTrustScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.TRUST], country);
@@ -38964,6 +39004,7 @@ function OnboardingDropinComponent({
38964
39004
  const [legalEntity, setLegalEntity] = useState();
38965
39005
  const [loadingStatus, setLoadingStatus] = useState("loading");
38966
39006
  const [providerStatus, setProviderStatus] = useState();
39007
+ const { i18n } = useI18nContext();
38967
39008
  const init2 = useCallback(async () => {
38968
39009
  try {
38969
39010
  const le = await getLegalEntity2(legalEntityId);
@@ -39013,7 +39054,7 @@ function OnboardingDropinComponent({
39013
39054
  handleDeleteTransferInstrument: deleteTransferInstrument2,
39014
39055
  handleUpdateTransferInstrument: updateTransferInstrument2,
39015
39056
  handleCreateTrustedTransferInstrument: createTrustedTransferInstrument2,
39016
- handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId),
39057
+ handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId, i18n.locale),
39017
39058
  handleReviewConfirm: confirmDataReview2,
39018
39059
  handleCompanyIndexSearch: companyIndexSearch2,
39019
39060
  handleCompanyDeepSearch: companyDeepSearch2,
@@ -41797,7 +41838,7 @@ const ConfigurationApiProvider = ({
41797
41838
  }) => {
41798
41839
  const authContext = useAuthContext();
41799
41840
  const { isEmbeddedDropin, loadingContext } = authContext;
41800
- const sdkVersion = "3.35.0";
41841
+ const sdkVersion = "3.36.0";
41801
41842
  useAnalytics({
41802
41843
  onUserEvent,
41803
41844
  legalEntityId: rootLegalEntityId,
@@ -42468,7 +42509,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42468
42509
  };
42469
42510
  const copyToClipboard = async () => {
42470
42511
  const toCopy = {
42471
- sdkVersion: "3.35.0",
42512
+ sdkVersion: "3.36.0",
42472
42513
  experiments: Object.fromEntries(allExperimentsWithValues),
42473
42514
  settings: Object.fromEntries(allSettingsWithValues)
42474
42515
  };
@@ -42533,7 +42574,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42533
42574
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
42534
42575
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42535
42576
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
42536
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.35.0" })
42577
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.36.0" })
42537
42578
  ] }) }),
42538
42579
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42539
42580
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
package/dist/style.css CHANGED
@@ -1484,6 +1484,8 @@ button[disabled]:hover {
1484
1484
  font-weight: var(--adyen-sdk-text-body-font-weight, 400);
1485
1485
  margin-right: var(--adyen-sdk-spacer-070, 16px);
1486
1486
  vertical-align: baseline;
1487
+ }.adyen-kyc-field--dbaName {
1488
+ margin-left: 0 !important;
1487
1489
  }.adyen-kyc-field--entityType {
1488
1490
  margin-bottom: var(--adyen-sdk-spacer-090, 24px);
1489
1491
  }
@@ -2380,8 +2382,6 @@ fieldset {
2380
2382
  }
2381
2383
  .adyen-kyc-additional-information .adyen-kyc__address {
2382
2384
  margin-bottom: 0 !important;
2383
- }.adyen-kyc-field--dbaName {
2384
- margin-left: 0 !important;
2385
2385
  }.adyen-kyc-verified-business-card {
2386
2386
  display: flex;
2387
2387
  flex-direction: column;
@@ -15,7 +15,7 @@ export declare const companyForms: {
15
15
  readonly companyRegistrationDetails: {
16
16
  readonly formId: "companyRegistrationDetails";
17
17
  readonly formName: "registrationDetails";
18
- readonly fields: ("dateOfIncorporation" | "stockExchangeMIC" | "stockISIN" | "stockTickerSymbol" | keyof import("../../internal/BusinessRegistrationNumberField/types").BusinessRegistrationNumberFieldSchema | keyof import("../../internal/VatNumberField/types").VatNumberFieldSchema | keyof import("../../internal/TaxInformationField/types").TaxInformationFieldSchema | keyof import("../../internal/TradingNameField/types").TradingNameFieldSchema)[];
18
+ readonly fields: ("dateOfIncorporation" | "stockExchangeMIC" | "stockISIN" | "stockTickerSymbol" | keyof import("../../internal/BusinessRegistrationNumberField/types").BusinessRegistrationNumberFieldSchema | keyof import("../../internal/DBANameField/types").DBANameFieldSchema | keyof import("../../internal/VatNumberField/types").VatNumberFieldSchema | keyof import("../../internal/TaxInformationField/types").TaxInformationFieldSchema | keyof import("../../internal/TradingNameField/types").TradingNameFieldSchema)[];
19
19
  };
20
20
  readonly companyRegistrationAddress: {
21
21
  readonly formId: "companyRegistrationAddress";
@@ -3,13 +3,14 @@ import type { CompanyTypesValue } from '../../core/models/api/company-types-valu
3
3
  import type { CountryCode } from '../../core/models/country-code';
4
4
  import type { BusinessRegistrationNumberFieldSchema } from '../internal/BusinessRegistrationNumberField/types';
5
5
  import type { DateOfIncorporationFieldSchema } from '../internal/DateOfIncorporationField/types';
6
+ import type { DBANameFieldSchema } from '../internal/DBANameField/types';
6
7
  import type { StockExchangeMICFieldSchema } from '../internal/StockExchangeMICField/types';
7
8
  import type { StockISINFieldSchema } from '../internal/StockISINField/types';
8
9
  import type { StockTickerSymbolFieldSchema } from '../internal/StockTickerSymbol/types';
9
10
  import type { TaxInformationFieldSchema } from '../internal/TaxInformationField/types';
10
11
  import type { TradingNameFieldSchema } from '../internal/TradingNameField/types';
11
12
  import type { VatNumberFieldSchema } from '../internal/VatNumberField/types';
12
- export type CompanyRegistrationDetailsSchema = TradingNameFieldSchema & BusinessRegistrationNumberFieldSchema & TaxInformationFieldSchema & VatNumberFieldSchema & StockExchangeMICFieldSchema & StockISINFieldSchema & StockTickerSymbolFieldSchema & DateOfIncorporationFieldSchema;
13
+ export type CompanyRegistrationDetailsSchema = TradingNameFieldSchema & DBANameFieldSchema & BusinessRegistrationNumberFieldSchema & TaxInformationFieldSchema & VatNumberFieldSchema & StockExchangeMICFieldSchema & StockISINFieldSchema & StockTickerSymbolFieldSchema & DateOfIncorporationFieldSchema;
13
14
  export interface CompanyRegistrationDetailsProps extends BaseInnerFormProps<CompanyRegistrationDetailsSchema> {
14
15
  companyType?: CompanyTypesValue;
15
16
  country?: CountryCode;
@@ -9,7 +9,7 @@ export declare const solePropForms: {
9
9
  readonly solePropRegistrationDetails: {
10
10
  readonly formId: "solePropRegistrationDetails";
11
11
  readonly formName: "registrationDetails";
12
- readonly fields: ("dateOfIncorporation" | "stockExchangeMIC" | "stockISIN" | "stockTickerSymbol" | keyof import("../../internal/BusinessRegistrationNumberField/types").BusinessRegistrationNumberFieldSchema | keyof import("../../internal/VatNumberField/types").VatNumberFieldSchema | keyof import("../../internal/TaxInformationField/types").TaxInformationFieldSchema | keyof import("../../internal/TradingNameField/types").TradingNameFieldSchema)[];
12
+ readonly fields: ("dateOfIncorporation" | "stockExchangeMIC" | "stockISIN" | "stockTickerSymbol" | keyof import("../../internal/BusinessRegistrationNumberField/types").BusinessRegistrationNumberFieldSchema | keyof import("../../internal/DBANameField/types").DBANameFieldSchema | keyof import("../../internal/VatNumberField/types").VatNumberFieldSchema | keyof import("../../internal/TaxInformationField/types").TaxInformationFieldSchema | keyof import("../../internal/TradingNameField/types").TradingNameFieldSchema)[];
13
13
  };
14
14
  readonly solePropRegistrationAddress: {
15
15
  readonly formId: "solePropRegistrationAddress";
@@ -3,8 +3,9 @@ import { TrustTypes } from '../../core/models/api/trust-types-value';
3
3
  import type { CountryCode } from '../../core/models/country-code';
4
4
  import type { TranslationKey } from '../../language/types';
5
5
  import type { BusinessRegistrationNumberSchema } from '../internal/BusinessRegistrationNumber/types';
6
+ import type { DBANameFieldSchema } from '../internal/DBANameField/types';
6
7
  import type { TaxIdSchema } from '../internal/TaxId/types';
7
- export interface TrustRegistrationDetailsSchema extends BusinessRegistrationNumberSchema, TaxIdSchema {
8
+ export interface TrustRegistrationDetailsSchema extends BusinessRegistrationNumberSchema, TaxIdSchema, DBANameFieldSchema {
8
9
  legalName?: string;
9
10
  country?: CountryCode;
10
11
  trustType?: TrustTypes;
@@ -1,4 +1,4 @@
1
1
  import type { JSX } from 'preact';
2
2
  import type { SearchAddressProps } from '../types';
3
- declare const SearchAddress: ({ data, legalEntityId, autocompleteAddressForm, handleChangeFor, handleAddressSearch, handleFindAddress, addressType, kompanyAddress, kompanyPrefilled, }: SearchAddressProps) => JSX.Element;
3
+ declare const SearchAddress: ({ data, legalEntityId, autocompleteAddressForm, handleChangeFor, handleAddressSearch, handleFindAddress, addressType, kompanyAddress, }: SearchAddressProps) => JSX.Element;
4
4
  export default SearchAddress;
@@ -1,4 +1,4 @@
1
1
  import './DBANameField.scss';
2
2
  import type { DBANameFieldProps, DBANameFieldSchema } from './types';
3
3
  export declare const DBA_NAME_FIELD: Array<keyof DBANameFieldSchema>;
4
- export declare function DBANameField({ data, valid, errors, labels, helperText, readonly, handleChangeFor, setErrors, }: DBANameFieldProps): import("preact").JSX.Element;
4
+ export declare function DBANameField({ data, valid, errors, labels, legalCompanyName, helperText, readonly, handleChangeFor, setErrors, }: DBANameFieldProps): import("preact").JSX.Element;
@@ -2,5 +2,8 @@ import type { BaseFormFieldProps } from '../../../core/hooks/useForm/types';
2
2
  export interface DBANameFieldSchema {
3
3
  hasDba?: boolean;
4
4
  dbaName?: string;
5
+ doingBusinessAbsent?: boolean;
6
+ }
7
+ export interface DBANameFieldProps extends BaseFormFieldProps<DBANameFieldSchema> {
8
+ legalCompanyName?: string;
5
9
  }
6
- export type DBANameFieldProps = BaseFormFieldProps<DBANameFieldSchema>;
@@ -18,12 +18,13 @@ export declare enum ExperimentNames {
18
18
  HidePciTask = "HidePciTask",
19
19
  EnableAgeVerification = "EnableAgeVerification",
20
20
  PreserveMismatchedInitialValues = "PreserveMismatchedInitialValues",
21
- StrictNameAndAddressValidationV4 = "StrictNameAndAddressValidationV4",
22
21
  EnableNationalitySGHK = "EnableNationalitySGHK",
23
22
  EnableAUGovernmentalOrganizationSkipRegistrationNumber = "EnableAUGovernmentalOrganizationSkipRegistrationNumber",
24
23
  EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation",
25
- EnableFinancialInformationComponentV4 = "EnableFinancialInformationComponentV4",
26
24
  EnablePreferInstantVerificationFlow = "EnablePreferInstantVerificationFlow",
25
+ EnableFinancialInformationComponentV4 = "EnableFinancialInformationComponentV4",
26
+ StrictNameAndAddressValidationV4 = "StrictNameAndAddressValidationV4",
27
+ EnableLemApiVersionV4 = "EnableLemApiVersionV4",
27
28
  EnablePhoneFieldScenario = "EnablePhoneFieldScenario",
28
29
  EnableAUIncorporatedPartnershipSkipRegistrationNumber = "EnableAUIncorporatedPartnershipSkipRegistrationNumber",
29
30
  EnableCompanyTrusteeSkipABN = "EnableCompanyTrusteeSkipABN"
@@ -59,6 +59,7 @@ export declare const businessDetailsComponentsKeyMapping: {
59
59
  'additionalInformation.legalCompanyName': string;
60
60
  'additionalInformation.legalFormDescription': string;
61
61
  'additionalInformation.dbaName': string;
62
+ 'additionalInformation.doingBusinessAbsent': string;
62
63
  'additionalInformation.registrationNumber': string;
63
64
  'additionalInformation.taxInformation': string;
64
65
  'additionalInformation.vatNumber': string;
@@ -88,6 +89,8 @@ export declare const companyComponentsKeyMapping: {
88
89
  'companyNameAndCountry.countryOfGoverningLaw': string;
89
90
  'companyType.entityType': string;
90
91
  'companyRegistrationDetails.tradingName': string;
92
+ 'companyRegistrationDetails.dbaName': string;
93
+ 'companyRegistrationDetails.doingBusinessAbsent': string;
91
94
  'companyRegistrationDetails.registrationNumber': string;
92
95
  'companyRegistrationDetails.taxInformation': string;
93
96
  'companyRegistrationDetails.vatNumber': string;
@@ -645,6 +648,8 @@ export declare const payoutApiKeyMapping: {
645
648
  export declare const trustComponentsKeyMapping: {
646
649
  'trustRegistrationDetails.trustType': string;
647
650
  'trustRegistrationDetails.legalName': string;
651
+ 'trustRegistrationDetails.dbaName': string;
652
+ 'trustRegistrationDetails.doingBusinessAbsent': string;
648
653
  'trustRegistrationDetails.country': string;
649
654
  'trustRegistrationDetails.registrationNumber': string;
650
655
  'trustRegistrationAddress.registrationAddress.city': string;
@@ -680,6 +685,8 @@ export declare const solePropComponentsKeyMapping: {
680
685
  'solePropNameAndCountry.country': string;
681
686
  'solePropNameAndCountry.legalCompanyName': string;
682
687
  'solePropRegistrationDetails.tradingName': string;
688
+ 'solePropRegistrationDetails.dbaName': string;
689
+ 'solePropRegistrationDetails.doingBusinessAbsent': string;
683
690
  'solePropRegistrationDetails.vatNumber': string;
684
691
  'solePropRegistrationDetails.vatAbsenceReason': string;
685
692
  'solePropRegistrationDetails.exemptedFromTax': string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.35.0",
3
+ "version": "3.36.0",
4
4
  "keywords": [
5
5
  "adyen",
6
6
  "adyen-kyc",
@@ -62,7 +62,6 @@
62
62
  "prepare": "bash ./scripts/process-package-lock.sh",
63
63
  "prettier": "prettier --config ./.prettierrc.json --ignore-unknown --check \"**/*\"",
64
64
  "prettier:fix": "prettier --config ./.prettierrc.json --ignore-unknown --write \"**/*\"",
65
- "release": "release-it",
66
65
  "repo:setup": "bash ./scripts/first-time-setup.sh",
67
66
  "start": "npm run dev",
68
67
  "storybook": "vite-node .storybook/scripts/runStorybook.ts",
@@ -138,8 +137,6 @@
138
137
  "phone": "^3.1.40",
139
138
  "postcss": "^8.4.29",
140
139
  "prettier": "^2.8.8",
141
- "pseudolocale": "^2.0.0",
142
- "release-it": "^15.5.1",
143
140
  "sass": "^1.66.1",
144
141
  "stylelint": "^15.9.0",
145
142
  "stylelint-config-recommended-scss": "^11.0.0",
@@ -1,2 +0,0 @@
1
- import type { MutableRef } from 'preact/hooks';
2
- export declare function useIsElementVisible(ref: MutableRef<Element>, fallback?: boolean): boolean;