@adyen/kyc-components 2.47.1 → 2.48.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.
Files changed (66) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1739 -930
  2. package/dist/es/{arrow-right-DF4Qe-8E.js → arrow-right-C4o8oS1C.js} +1 -1
  3. package/dist/es/{chevron-down-BzENwYSf.js → chevron-down-C8-1xmDI.js} +1 -1
  4. package/dist/es/chevron-left-DSyI3arz.js +11 -0
  5. package/dist/es/{chevron-right-DczMHcvL.js → chevron-right-BDZzxAre.js} +1 -1
  6. package/dist/es/{cross-BadGfrgB.js → cross-D-SQig6J.js} +1 -1
  7. package/dist/es/{download-DGC5_Bxe.js → download-COfxdarq.js} +1 -1
  8. package/dist/style.css +380 -2127
  9. package/dist/types/components/AdditionalInformation/VerifiedBusinessCard.d.ts +7 -0
  10. package/dist/types/components/AdditionalInformation/component/AdditionalInformationComponent.d.ts +1 -1
  11. package/dist/types/components/AdditionalInformation/types.d.ts +4 -0
  12. package/dist/types/components/BasicInformation/component/BasicInformationComponent.d.ts +1 -1
  13. package/dist/types/components/BasicInformation/types.d.ts +2 -8
  14. package/dist/types/components/BusinessDetails/component/BusinessDetailsComponent.d.ts +1 -0
  15. package/dist/types/components/BusinessDetails/forms.d.ts +1 -2
  16. package/dist/types/components/BusinessDetails/types.d.ts +15 -0
  17. package/dist/types/components/BusinessSelection/BusinessInformationCard.d.ts +16 -0
  18. package/dist/types/components/BusinessSelection/component/BusinessSelectionComponent.d.ts +3 -0
  19. package/dist/types/components/BusinessSelection/index.d.ts +1 -0
  20. package/dist/types/components/BusinessSelection/types.d.ts +25 -0
  21. package/dist/types/components/CompanyStructure/component/CompanyStructureComponent.d.ts +1 -1
  22. package/dist/types/components/CompanyStructure/types.d.ts +3 -0
  23. package/dist/types/components/Dropins/BusinessDetailsDropin/types.d.ts +2 -1
  24. package/dist/types/components/Dropins/DropinLayout/ActionBar/ActionBar.d.ts +1 -1
  25. package/dist/types/components/Dropins/DropinLayout/ActionBar/type.d.ts +1 -0
  26. package/dist/types/components/Dropins/FormNavigation/FormNavigation.d.ts +1 -2
  27. package/dist/types/components/Dropins/FormNavigation/index.d.ts +1 -1
  28. package/dist/types/components/Dropins/FormWrapper/FormWrapper.d.ts +3 -1
  29. package/dist/types/components/Individual/validators.d.ts +1 -2
  30. package/dist/types/components/RegistrationAddress/types.d.ts +2 -0
  31. package/dist/types/components/UIElement/UIElement.d.ts +22 -0
  32. package/dist/types/components/internal/Address/components/SearchAddress.d.ts +1 -1
  33. package/dist/types/components/internal/Address/types.d.ts +3 -0
  34. package/dist/types/components/internal/Alert/Alert.d.ts +1 -1
  35. package/dist/types/components/internal/Alert/types.d.ts +4 -7
  36. package/dist/types/components/internal/Card/Card.d.ts +1 -1
  37. package/dist/types/components/internal/Card/CardGroup.d.ts +1 -1
  38. package/dist/types/components/internal/Card/index.d.ts +2 -0
  39. package/dist/types/components/internal/Card/types.d.ts +2 -0
  40. package/dist/types/components/internal/DBANameField/DBANameField.d.ts +1 -1
  41. package/dist/types/components/internal/DBANameField/fieldConfig.d.ts +1 -0
  42. package/dist/types/components/internal/DBANameField/types.d.ts +1 -1
  43. package/dist/types/components/internal/Icon/Icon.d.ts +1 -0
  44. package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +9 -0
  45. package/dist/types/components/internal/Link/Link.d.ts +1 -1
  46. package/dist/types/components/internal/Link/types.d.ts +0 -3
  47. package/dist/types/components/internal/Loader/Loader.d.ts +7 -9
  48. package/dist/types/components/internal/LoaderWrapper/LoaderWrapper.d.ts +1 -2
  49. package/dist/types/core/core.d.ts +1 -1
  50. package/dist/types/core/hooks/useBankConfigurationHandlers.d.ts +3 -1
  51. package/dist/types/core/hooks/useForm/reducer.d.ts +4 -2
  52. package/dist/types/core/hooks/useForm/types.d.ts +11 -0
  53. package/dist/types/core/hooks/useForm/useForm.d.ts +2 -1
  54. package/dist/types/core/hooks/useUnifyLoadingStatus.d.ts +2 -0
  55. package/dist/types/core/models/api/company-search.d.ts +1 -0
  56. package/dist/types/core/models/api/organization.d.ts +1 -0
  57. package/dist/types/core/models/country-code.d.ts +1 -0
  58. package/dist/types/core/process-field-configurations.d.ts +3 -2
  59. package/dist/types/utils/birth-date-utils.d.ts +11 -0
  60. package/dist/types/utils/mapping/componentApiMapping.d.ts +2 -1
  61. package/dist/types/utils/regex/patternValidators.d.ts +1 -1
  62. package/dist/types/utils/testing/IgnoreLocalStorage.d.ts +5 -0
  63. package/package.json +13 -2
  64. package/dist/types/components/UIElement.d.ts +0 -22
  65. package/dist/types/components/internal/Loader/index.d.ts +0 -2
  66. package/dist/types/components/internal/Spinner/Spinner.d.ts +0 -16
@@ -41,6 +41,11 @@ export interface BaseFormFieldProps<FieldSchema> {
41
41
  stateSliceId?: AnyFormIdOfTLDS;
42
42
  name?: string;
43
43
  handleChangeFor: (key: keyof FieldSchema, mode?: ValidatorMode) => (e: any) => void;
44
+ setData?: (key: keyof FieldSchema, value: FieldValue<FieldSchema>) => void;
45
+ setValid?: (key: keyof FieldSchema, value: boolean) => void;
46
+ setErrors?: (key: keyof FieldSchema, value: ValidationRuleResult | null) => void;
47
+ setFieldProblems?: (fieldProblems: Record<keyof FieldSchema, boolean>) => void;
48
+ triggerValidation?: (schema?: Array<keyof FieldSchema>) => void;
44
49
  }
45
50
  export type FieldValue<FormSchema> = FormSchema[keyof FormSchema];
46
51
  export interface FormState<FormSchema> {
@@ -51,6 +56,7 @@ export interface FormState<FormSchema> {
51
56
  fieldProblems: Record<keyof FormSchema, boolean>;
52
57
  obscuredFields?: Array<keyof FormSchema>;
53
58
  optionalFields?: Array<keyof FormSchema>;
59
+ trustedFields?: Array<keyof FormSchema>;
54
60
  isValid?: boolean;
55
61
  dataStoreId?: string;
56
62
  local?: FormState<FormSchema> | Partial<FormState<FormSchema>>;
@@ -69,6 +75,7 @@ export interface Form<FormSchema> extends FormState<FormSchema> {
69
75
  handleChangeFor: (key: keyof FormSchema, mode?: ValidatorMode) => (e: any) => void;
70
76
  triggerValidation: (schema?: Array<keyof FormSchema>) => void;
71
77
  mergeForm: (formValue: FormState<FormSchema>) => void;
78
+ resetToDefaultData: () => void;
72
79
  }
73
80
  export interface BaseFormProps<FormSchema> {
74
81
  placeholders?: {
@@ -119,6 +126,9 @@ export interface BaseOuterFormProps<FormSchema> extends BaseFormProps<FormSchema
119
126
  obscuredFields?: {
120
127
  [InnerFormName in keyof FormSchema]: Array<keyof FormSchema[InnerFormName]>;
121
128
  };
129
+ trustedFields?: {
130
+ [InnerFormName in keyof FormSchema]: Array<keyof FormSchema[InnerFormName]>;
131
+ };
122
132
  evaluateConfiguration?: (data: FormSchema) => void;
123
133
  setCustomFormNavigationHandlers?(formId: string, onNext: () => void, onBack: () => void): void;
124
134
  setHideDropinLayout?: Dispatch<StateUpdater<boolean>>;
@@ -138,6 +148,7 @@ export interface BaseInnerFormProps<FormSchema> extends BaseFormProps<FormSchema
138
148
  optionalFields?: Array<keyof FormSchema>;
139
149
  verifyFields?: Array<keyof FormSchema>;
140
150
  readOnlyFields?: Array<keyof FormSchema>;
151
+ trustedFields?: Array<keyof FormSchema>;
141
152
  id?: string;
142
153
  dataStoreId?: string;
143
154
  capabilities?: CapabilityName[];
@@ -10,5 +10,6 @@ export interface UseFormOptions<FormSchema> {
10
10
  fieldProblems?: Record<keyof FormSchema, boolean>;
11
11
  obscuredFields?: (keyof FormSchema)[];
12
12
  optionalFields?: (keyof FormSchema)[];
13
+ trustedFields?: (keyof FormSchema)[];
13
14
  }
14
- export declare function useForm<FormSchema>({ schema, defaultData, rules, asyncRules, fieldProblems, obscuredFields, optionalFields, formatters, shouldValidate, }: UseFormOptions<FormSchema>): Form<FormSchema>;
15
+ export declare function useForm<FormSchema>({ schema, defaultData, rules, asyncRules, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, shouldValidate, }: UseFormOptions<FormSchema>): Form<FormSchema>;
@@ -0,0 +1,2 @@
1
+ import type { LoadingStatus } from '../../components/internal/LoaderWrapper/constants';
2
+ export declare const useUnifyLoadingStatus: (setParentLoadingStatus: (status: LoadingStatus) => void, ...childLoadingStatuses: Array<LoadingStatus>) => void;
@@ -43,6 +43,7 @@ export interface CompanyDatasetResponse extends CompanySearchResult {
43
43
  country: CountryCode;
44
44
  organizationType: OrganizationType | null;
45
45
  address: string;
46
+ legalForm?: string;
46
47
  street?: string;
47
48
  city?: string;
48
49
  state?: StateCodeUS;
@@ -13,6 +13,7 @@ export interface Organization {
13
13
  doingBusinessAs?: string;
14
14
  email?: string;
15
15
  headOfficeIndicator?: boolean;
16
+ legalFormDescription?: string;
16
17
  phone?: Phone;
17
18
  principalPlaceOfBusiness?: Address;
18
19
  registrationNumber?: string;
@@ -247,3 +247,4 @@ export declare const enum CountryCodes {
247
247
  Zambia = "ZM",
248
248
  Zimbabwe = "ZW"
249
249
  }
250
+ export declare const euCountries: CountryCodes[];
@@ -10,6 +10,7 @@ import type { AnyTLDSFieldName } from '../utils/getFieldsWithExistingData';
10
10
  import type { ValidatorRules } from '../utils/validation/types';
11
11
  import type { BaseOuterFormProps } from './hooks/useForm';
12
12
  import type { Scenario } from './models/api/get-scenarios';
13
+ import type { LegalEntityTrustedFields } from './models/api/legal-entity';
13
14
  import type { VerificationError } from './models/api/verification-error';
14
15
  import type { CountryCode } from './models/country-code';
15
16
  import type { Remediation } from './models/errors/remediation';
@@ -27,7 +28,7 @@ export declare function parsePayoutScenarios({ requiredFields, country, bankVeri
27
28
  country: CountryCode;
28
29
  bankVerificationAvailable: boolean | undefined;
29
30
  }): Partial<FieldConfigurations<PayoutAccountSchema>>;
30
- type PropsFromConfiguration<FormSchema> = Required<Pick<BaseOuterFormProps<FormSchema>, 'allFields' | 'verifyFields' | 'requiredFields' | 'placeholders' | 'helperText' | 'masks' | 'optionalFields' | 'labels' | 'obscuredFields'>> & {
31
+ type PropsFromConfiguration<FormSchema> = Required<Pick<BaseOuterFormProps<FormSchema>, 'allFields' | 'verifyFields' | 'requiredFields' | 'placeholders' | 'helperText' | 'masks' | 'optionalFields' | 'labels' | 'obscuredFields' | 'trustedFields'>> & {
31
32
  validators: ValidatorRules<FormSchema>;
32
33
  };
33
34
  /**
@@ -70,5 +71,5 @@ type PropsFromConfiguration<FormSchema> = Required<Pick<BaseOuterFormProps<FormS
70
71
  * }
71
72
  * ```
72
73
  */
73
- export declare function getPropsFromConfigurations<FormSchema extends object>(scenarioConfiguration: FieldConfigurations<FormSchema> | undefined, forms: FormList, remediationActions: Remediation[], dataMissingErrors: VerificationError[], fieldsWithExistingData: AnyTLDSFieldName[], customRules?: {}, customLabels?: {}, customValidators?: {}): PropsFromConfiguration<FormSchema> | undefined;
74
+ export declare function getPropsFromConfigurations<FormSchema extends object>(scenarioConfiguration: FieldConfigurations<FormSchema> | undefined, forms: FormList, remediationActions: Remediation[], dataMissingErrors: VerificationError[], fieldsWithExistingData: AnyTLDSFieldName[], customRules?: {}, customLabels?: {}, customValidators?: {}, legalEntityTrustedFields?: LegalEntityTrustedFields[]): PropsFromConfiguration<FormSchema> | undefined;
74
75
  export {};
@@ -0,0 +1,11 @@
1
+ import type { PersonalDetailsSchema } from '../components/PersonalDetails/types';
2
+ import type { Translatable } from '../language/types';
3
+ export declare const getAgeToday: (birthdate: string) => number;
4
+ interface TranslatableAlertProps {
5
+ title: Translatable;
6
+ message: Translatable;
7
+ }
8
+ export declare const getLegalRepresentativeWarningMessage: ({ data: { birthDate, residencyCountry }, }: {
9
+ data: PersonalDetailsSchema;
10
+ }) => TranslatableAlertProps | undefined;
11
+ export {};
@@ -50,6 +50,7 @@ export declare const businessDetailsComponentsKeyMapping: {
50
50
  'basicInformation.isUen': string;
51
51
  'companyStructure.entityType': string;
52
52
  'additionalInformation.legalCompanyName': string;
53
+ 'additionalInformation.legalFormDescription': string;
53
54
  'additionalInformation.dbaName': string;
54
55
  'additionalInformation.registrationNumber': string;
55
56
  'additionalInformation.taxInformation': string;
@@ -75,7 +76,7 @@ export declare const businessDetailsComponentsKeyMapping: {
75
76
  'additionalInformation.exemptedFromVat': string;
76
77
  };
77
78
  export declare const businessDetailsApiKeyMapping: {
78
- [x: string]: "companyRegistrationAddress.registrationAddress.postalCode" | "companyRegistrationAddress.registrationAddress.city" | "companyRegistrationAddress.registrationAddress.country" | "companyRegistrationAddress.registrationAddress.stateOrProvince" | "companyRegistrationAddress.registrationAddress.otherAddressInformation" | "companyRegistrationAddress.registrationAddress.address" | "companyRegistrationAddress.operationalAddress.postalCode" | "companyRegistrationAddress.operationalAddress.city" | "companyRegistrationAddress.operationalAddress.country" | "companyRegistrationAddress.operationalAddress.stateOrProvince" | "companyRegistrationAddress.operationalAddress.otherAddressInformation" | "companyRegistrationAddress.operationalAddress.address" | "companyStructure.entityType" | "basicInformation.country" | "basicInformation.stateOrProvince" | "basicInformation.registrationNumber" | "basicInformation.isUen" | "basicInformation.taxInformation" | "basicInformation.businessName" | "additionalInformation.legalCompanyName" | "additionalInformation.dateOfIncorporation" | "additionalInformation.vatAbsenceReason" | "additionalInformation.vatNumber" | "additionalInformation.registrationNumber" | "additionalInformation.stockExchangeMIC" | "additionalInformation.stockISIN" | "additionalInformation.stockTickerSymbol" | "additionalInformation.isUen" | "additionalInformation.taxInformation" | "additionalInformation.dbaName";
79
+ [x: string]: "companyRegistrationAddress.registrationAddress.postalCode" | "companyRegistrationAddress.registrationAddress.city" | "companyRegistrationAddress.registrationAddress.country" | "companyRegistrationAddress.registrationAddress.stateOrProvince" | "companyRegistrationAddress.registrationAddress.otherAddressInformation" | "companyRegistrationAddress.registrationAddress.address" | "companyRegistrationAddress.operationalAddress.postalCode" | "companyRegistrationAddress.operationalAddress.city" | "companyRegistrationAddress.operationalAddress.country" | "companyRegistrationAddress.operationalAddress.stateOrProvince" | "companyRegistrationAddress.operationalAddress.otherAddressInformation" | "companyRegistrationAddress.operationalAddress.address" | "companyStructure.entityType" | "basicInformation.country" | "basicInformation.stateOrProvince" | "basicInformation.registrationNumber" | "basicInformation.isUen" | "basicInformation.taxInformation" | "basicInformation.businessName" | "additionalInformation.legalCompanyName" | "additionalInformation.dateOfIncorporation" | "additionalInformation.vatAbsenceReason" | "additionalInformation.vatNumber" | "additionalInformation.registrationNumber" | "additionalInformation.stockExchangeMIC" | "additionalInformation.stockISIN" | "additionalInformation.stockTickerSymbol" | "additionalInformation.isUen" | "additionalInformation.taxInformation" | "additionalInformation.dbaName" | "additionalInformation.legalFormDescription";
79
80
  };
80
81
  export declare const companyComponentsKeyMapping: {
81
82
  'companyNameAndCountry.country': string;
@@ -1,3 +1,3 @@
1
1
  import type { ValidatorRule } from '../validation/types';
2
- export declare const validateNotEmptyOnBlur: ValidatorRule<string | undefined, object>;
2
+ export declare const validateNotEmptyOnBlur: ValidatorRule<string | boolean | undefined, object>;
3
3
  export declare const validatePatternOnBlur: <ValueType extends string | undefined, FormSchema>(pattern: RegExp) => ValidatorRule<ValueType, FormSchema>;
@@ -0,0 +1,5 @@
1
+ import type { ComponentChildren } from 'preact';
2
+ export declare const IgnoreLocalStorage: ({ children }: {
3
+ children: ComponentChildren;
4
+ }) => import("preact").JSX.Element;
5
+ export declare const useIgnoreLocalStorage: () => boolean;
package/package.json CHANGED
@@ -1,7 +1,16 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "2.47.1",
4
- "description": "",
3
+ "version": "2.48.0",
4
+ "keywords": [
5
+ "adyen",
6
+ "adyen-kyc",
7
+ "platforms",
8
+ "components",
9
+ "onboarding",
10
+ "adyen-for-platforms",
11
+ "adyen-kyc-components",
12
+ "onboarding-components"
13
+ ],
5
14
  "license": "MIT",
6
15
  "files": [
7
16
  "./dist"
@@ -86,10 +95,12 @@
86
95
  "@playwright/test": "1.41.0",
87
96
  "@preact/preset-vite": "^2.8.1",
88
97
  "@storybook/addon-actions": "^8.0.4",
98
+ "@storybook/addon-interactions": "^8.0.4",
89
99
  "@storybook/addon-essentials": "^8.0.4",
90
100
  "@storybook/core-server": "^8.0.4",
91
101
  "@storybook/preact": "^8.0.4",
92
102
  "@storybook/preact-vite": "^8.0.4",
103
+ "@storybook/test": "^8.0.4",
93
104
  "@testing-library/jest-dom": "^5.17.0",
94
105
  "@testing-library/preact": "^3.2.3",
95
106
  "@testing-library/user-event": "^14.4.3",
@@ -1,22 +0,0 @@
1
- import '../style/_utilities.scss';
2
- import type { JSX } from 'preact';
3
- import type { EmptyObject } from 'type-fest';
4
- import type { AuthProviderProps } from '../core/Context/AuthContext/AuthProvider';
5
- import type { CoreProviderProps } from '../core/Context/CoreProvider';
6
- import type { ExperimentsProps } from '../core/Context/ExperimentContext/types';
7
- import type { ExpiryProviderProps } from '../core/Context/ExpiryContext/ExpiryContext';
8
- import type { I18nProviderProps } from '../core/Context/I18nProvider/I18nProvider';
9
- import type { SettingsProps } from '../core/Context/SettingsContext/types';
10
- import type { UserEventCallback } from '../core/user-events';
11
- import type { BaseElementProps } from './BaseElement';
12
- import { BaseElement } from './BaseElement';
13
- import type { ComponentMap } from './index';
14
- export interface UIElementProps<ComponentProps extends object> extends BaseElementProps, CoreProviderProps, AuthProviderProps, I18nProviderProps, ExpiryProviderProps, SettingsProps, ExperimentsProps {
15
- onUserEvent?: UserEventCallback;
16
- component: (props: ComponentProps) => JSX.Element;
17
- componentName: keyof ComponentMap;
18
- componentProps: ComponentProps;
19
- }
20
- export declare class UIElement<ComponentProps extends object = EmptyObject> extends BaseElement<UIElementProps<ComponentProps>> {
21
- render: () => JSX.Element;
22
- }
@@ -1,2 +0,0 @@
1
- export type { LoaderSize } from './Loader';
2
- export { default } from './Loader';
@@ -1,16 +0,0 @@
1
- import './Spinner.scss';
2
- export interface SpinnerProps {
3
- /**
4
- * Whether the spinner should be rendered inline
5
- */
6
- inline?: boolean;
7
- /**
8
- * size of the spinner (small/medium/large)
9
- */
10
- size?: 'small' | 'medium' | 'large';
11
- }
12
- /**
13
- * Default Loading Spinner
14
- * @param props -
15
- */
16
- export declare const Spinner: ({ inline, size }: SpinnerProps) => import("preact").JSX.Element;