@adyen/kyc-components 3.0.0-beta.8 → 3.0.0-beta.9

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.
@@ -17028,6 +17028,11 @@ function BankAccountFormat(props) {
17028
17028
  })
17029
17029
  });
17030
17030
  }
17031
+ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
17032
+ ExperimentNames2["EnableTrustFlow"] = "EnableTrustFlow";
17033
+ ExperimentNames2["OnlyAllowAlphanumericBankAccountNumbers"] = "OnlyAllowAlphanumericBankAccountNumbers";
17034
+ return ExperimentNames2;
17035
+ })(ExperimentNames || {});
17031
17036
  const stripNonAlphanumeric = (value) => value.replaceAll(/[^0-9a-zA-Z]/g, "");
17032
17037
  const isValueMasked = (value) => {
17033
17038
  var _a;
@@ -17038,6 +17043,9 @@ function BankAccountNumber(props) {
17038
17043
  const {
17039
17044
  i18n
17040
17045
  } = useI18nContext();
17046
+ const {
17047
+ isExperimentEnabled
17048
+ } = useExperimentsContext();
17041
17049
  const {
17042
17050
  dataStoreId,
17043
17051
  validators
@@ -17059,9 +17067,9 @@ function BankAccountNumber(props) {
17059
17067
  defaultData: props.data,
17060
17068
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors,
17061
17069
  formatters: {
17062
- bankAccountNumber: {
17070
+ bankAccountNumber: isExperimentEnabled(ExperimentNames.OnlyAllowAlphanumericBankAccountNumbers) ? {
17063
17071
  formatter: (v) => v && !isValueMasked(v) ? stripNonAlphanumeric(v) : v
17064
- }
17072
+ } : void 0
17065
17073
  },
17066
17074
  maskedFields: props.maskedFields
17067
17075
  });
@@ -1,7 +1,13 @@
1
1
  import { ComponentChildren } from 'preact';
2
- export interface ExperimentsContextValue {
3
- isExperimentEnabled(key: ExperimentName): boolean;
2
+ /**
3
+ * Experiments are features that can only be switched on or off internally.
4
+ * This list is defined in the BE.
5
+ */
6
+ export declare enum ExperimentNames {
7
+ EnableTrustFlow = "EnableTrustFlow",
8
+ OnlyAllowAlphanumericBankAccountNumbers = "OnlyAllowAlphanumericBankAccountNumbers"
4
9
  }
10
+ export type ExperimentName = `${ExperimentNames}`;
5
11
  export type Experiments = {
6
12
  [key in ExperimentName]?: boolean;
7
13
  };
@@ -9,4 +15,6 @@ export interface ExperimentsProps {
9
15
  children?: ComponentChildren;
10
16
  experiments: Experiments;
11
17
  }
12
- export type ExperimentName = 'EnableTrustFlow';
18
+ export interface ExperimentsContextValue {
19
+ isExperimentEnabled(key: ExperimentName): boolean;
20
+ }
@@ -1,14 +1,8 @@
1
1
  import { ComponentChildren } from 'preact';
2
- export type Settings = {
3
- [key in SettingName]?: boolean;
4
- };
5
- export interface SettingsProps {
6
- children?: ComponentChildren;
7
- settings: Settings;
8
- }
9
- export interface SettingsContextValue {
10
- isSettingEnabled(key: SettingName): boolean;
11
- }
2
+ /**
3
+ * Settings are features that can be switched on or off by external users.
4
+ * This list is defined in the BE.
5
+ */
12
6
  export declare enum SettingNames {
13
7
  AllowBankAccountFormatSelection = "allowBankAccountFormatSelection",
14
8
  AllowIntraRegionCrossBorderPayout = "allowIntraRegionCrossBorderPayout",
@@ -21,3 +15,13 @@ export declare enum SettingNames {
21
15
  RequirePciSignPosMoto = "requirePciSignPosMoto"
22
16
  }
23
17
  export type SettingName = `${SettingNames}`;
18
+ export type Settings = {
19
+ [key in SettingName]?: boolean;
20
+ };
21
+ export interface SettingsProps {
22
+ children?: ComponentChildren;
23
+ settings: Settings;
24
+ }
25
+ export interface SettingsContextValue {
26
+ isSettingEnabled(key: SettingName): boolean;
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/kyc-components",
3
- "version": "3.0.0-beta.8",
3
+ "version": "3.0.0-beta.9",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "files": [