@dynamic-labs/sdk-react-core 2.3.4 → 2.3.6

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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,19 @@
1
1
 
2
+ ### [2.3.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.5...v2.3.6) (2024-07-26)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * add settings prefetch ([#6403](https://github.com/dynamic-labs/DynamicAuth/issues/6403)) ([dcf9e95](https://github.com/dynamic-labs/DynamicAuth/commit/dcf9e950943e9347ab01159772c4de18dd8abd9a)), closes [#6368](https://github.com/dynamic-labs/DynamicAuth/issues/6368)
8
+ * don't filter out bitcoin.com when searching for bitcoin ([#6409](https://github.com/dynamic-labs/DynamicAuth/issues/6409)) ([13121f6](https://github.com/dynamic-labs/DynamicAuth/commit/13121f6b4ad4529fc9691c4504e383caeb5dd294))
9
+
10
+ ### [2.3.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.4...v2.3.5) (2024-07-22)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * show custom labels in the sdk ([#6352](https://github.com/dynamic-labs/DynamicAuth/issues/6352)) ([#6383](https://github.com/dynamic-labs/DynamicAuth/issues/6383)) ([287484b](https://github.com/dynamic-labs/DynamicAuth/commit/287484b252d69300a5003a88c26daf380621d3b5))
16
+
2
17
  ### [2.3.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.3.3...v2.3.4) (2024-07-19)
3
18
 
4
19
 
package/package.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.3.4";
6
+ var version = "2.3.6";
7
7
  var dependencies = {
8
- "@dynamic-labs/sdk-api-core": "0.0.460",
8
+ "@dynamic-labs/sdk-api-core": "0.0.497",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
10
10
  "country-list": "2.3.0",
11
11
  formik: "2.2.9",
package/package.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client'
2
- var version = "2.3.4";
2
+ var version = "2.3.6";
3
3
  var dependencies = {
4
- "@dynamic-labs/sdk-api-core": "0.0.460",
4
+ "@dynamic-labs/sdk-api-core": "0.0.497",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
6
6
  "country-list": "2.3.0",
7
7
  formik: "2.2.9",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.3.4",
3
+ "version": "2.3.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
7
7
  "directory": "packages/sdk-react-core"
8
8
  },
9
9
  "dependencies": {
10
- "@dynamic-labs/sdk-api-core": "0.0.460",
10
+ "@dynamic-labs/sdk-api-core": "0.0.497",
11
11
  "@hcaptcha/react-hcaptcha": "1.4.4",
12
12
  "country-list": "2.3.0",
13
13
  "formik": "2.2.9",
@@ -17,18 +17,18 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/iconic": "2.3.4",
21
- "@dynamic-labs/logger": "2.3.4",
22
- "@dynamic-labs/multi-wallet": "2.3.4",
23
- "@dynamic-labs/rpc-provider-ethereum": "2.3.4",
24
- "@dynamic-labs/rpc-provider-solana": "2.3.4",
25
- "@dynamic-labs/rpc-providers": "2.3.4",
26
- "@dynamic-labs/store": "2.3.4",
27
- "@dynamic-labs/types": "2.3.4",
28
- "@dynamic-labs/utils": "2.3.4",
29
- "@dynamic-labs/viem-utils": "2.3.4",
30
- "@dynamic-labs/wallet-book": "2.3.4",
31
- "@dynamic-labs/wallet-connector-core": "2.3.4",
20
+ "@dynamic-labs/iconic": "2.3.6",
21
+ "@dynamic-labs/logger": "2.3.6",
22
+ "@dynamic-labs/multi-wallet": "2.3.6",
23
+ "@dynamic-labs/rpc-provider-ethereum": "2.3.6",
24
+ "@dynamic-labs/rpc-provider-solana": "2.3.6",
25
+ "@dynamic-labs/rpc-providers": "2.3.6",
26
+ "@dynamic-labs/store": "2.3.6",
27
+ "@dynamic-labs/types": "2.3.6",
28
+ "@dynamic-labs/utils": "2.3.6",
29
+ "@dynamic-labs/viem-utils": "2.3.6",
30
+ "@dynamic-labs/wallet-book": "2.3.6",
31
+ "@dynamic-labs/wallet-connector-core": "2.3.6",
32
32
  "eventemitter3": "5.0.1"
33
33
  },
34
34
  "devDependencies": {
@@ -128,7 +128,7 @@ const UserProfile = ({ rootClassName }) => {
128
128
  // if it's multiwallet, the wallet should appear in the wallets tab
129
129
  // if there's a primary wallet, it will be displayed in the header
130
130
  const wallet = !multiWallet && !primaryWallet && userWallets[0];
131
- return (jsxRuntime.jsxs("div", { "data-testid": 'userProfile', className: classNames.classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), wallet && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsxRuntime.jsx(Wallet.Wallet, { ens: (_a = getWalletVerifiedCredential.getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
131
+ return (jsxRuntime.jsxs("div", { "data-testid": 'userProfile', className: classNames.classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), wallet && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsxRuntime.jsx(Wallet.Wallet, { ens: (_a = getWalletVerifiedCredential.getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type, label }) => {
132
132
  var _a, _b;
133
133
  if (type === sdkApiCore.KycFieldType.Custom) {
134
134
  const value = (_b = (_a = user.metadata) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
@@ -137,11 +137,10 @@ const UserProfile = ({ rootClassName }) => {
137
137
  fieldValue = value.length > 0 ? 'Checked' : 'Unchecked';
138
138
  return (jsxRuntime.jsx(UserProfileField.UserProfileField, { name: name, label: name, value: fieldValue }, name));
139
139
  }
140
- else {
141
- const { label, key } = index$1.getValueByKey(fieldsConfig, name);
142
- const value = mapFieldKeyToValue(name);
143
- return (jsxRuntime.jsx(UserProfileField.UserProfileField, { copykey: key, name: name, label: label, value: value }, name));
144
- }
140
+ const { label: defaultLabel, key } = index$1.getValueByKey(fieldsConfig, name);
141
+ label !== null && label !== void 0 ? label : (label = defaultLabel);
142
+ const value = mapFieldKeyToValue(name);
143
+ return (jsxRuntime.jsx(UserProfileField.UserProfileField, { copykey: key, name: name, label: label, value: value }, name));
145
144
  }) }) })), canLink && !multiWallet && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.wallets.title'), children: jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'link-wallet-button', onClick: addNewWallet, startSlot: jsxRuntime.jsx(add.ReactComponent, {}), showInternalLoading: false, children: jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_user_profile.wallets.link_wallet_button', children: t('dyn_user_profile.wallets.link_wallet_button') }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.social_accounts.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ provider }) => (jsxRuntime.jsx(UserProfileSocialAccount.UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
146
145
  };
147
146
 
@@ -124,7 +124,7 @@ const UserProfile = ({ rootClassName }) => {
124
124
  // if it's multiwallet, the wallet should appear in the wallets tab
125
125
  // if there's a primary wallet, it will be displayed in the header
126
126
  const wallet = !multiWallet && !primaryWallet && userWallets[0];
127
- return (jsxs("div", { "data-testid": 'userProfile', className: classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsx(ErrorContainer, { children: error }), wallet && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsx(Wallet, { ens: (_a = getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
127
+ return (jsxs("div", { "data-testid": 'userProfile', className: classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsx(ErrorContainer, { children: error }), wallet && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsx(Wallet, { ens: (_a = getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type, label }) => {
128
128
  var _a, _b;
129
129
  if (type === KycFieldType.Custom) {
130
130
  const value = (_b = (_a = user.metadata) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
@@ -133,11 +133,10 @@ const UserProfile = ({ rootClassName }) => {
133
133
  fieldValue = value.length > 0 ? 'Checked' : 'Unchecked';
134
134
  return (jsx(UserProfileField, { name: name, label: name, value: fieldValue }, name));
135
135
  }
136
- else {
137
- const { label, key } = getValueByKey(fieldsConfig, name);
138
- const value = mapFieldKeyToValue(name);
139
- return (jsx(UserProfileField, { copykey: key, name: name, label: label, value: value }, name));
140
- }
136
+ const { label: defaultLabel, key } = getValueByKey(fieldsConfig, name);
137
+ label !== null && label !== void 0 ? label : (label = defaultLabel);
138
+ const value = mapFieldKeyToValue(name);
139
+ return (jsx(UserProfileField, { copykey: key, name: name, label: label, value: value }, name));
141
140
  }) }) })), canLink && !multiWallet && (jsx(UserProfileSection, { title: t('dyn_user_profile.wallets.title'), children: jsx(TypographyButton, { dataTestId: 'link-wallet-button', onClick: addNewWallet, startSlot: jsx(SvgAdd, {}), showInternalLoading: false, children: jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_user_profile.wallets.link_wallet_button', children: t('dyn_user_profile.wallets.link_wallet_button') }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.social_accounts.title'), children: jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ provider }) => (jsx(UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
142
141
  };
143
142
 
@@ -1,6 +1,8 @@
1
1
  'use client'
2
2
  'use strict';
3
3
 
4
+ var sdkApiCore = require('@dynamic-labs/sdk-api-core');
5
+
4
6
  /* eslint-disable no-underscore-dangle */
5
7
  class ApiEndpoint {
6
8
  }
@@ -12,9 +14,24 @@ ApiEndpoint.getBaseUrl = () => {
12
14
  };
13
15
  ApiEndpoint.setBaseUrl = (baseUrlInput) => {
14
16
  if (!ApiEndpoint.__defined__) {
15
- ApiEndpoint.__baseUrl__ = baseUrlInput;
17
+ if (!baseUrlInput) {
18
+ /**
19
+ * If the baseUrl is not provided, use the default baseUrl from the sdk-api package
20
+ */
21
+ ApiEndpoint.__baseUrl__ = new sdkApiCore.Configuration().basePath;
22
+ }
23
+ else {
24
+ ApiEndpoint.__baseUrl__ = baseUrlInput;
25
+ }
16
26
  ApiEndpoint.__defined__ = true;
17
27
  }
28
+ else if (!baseUrlInput && ApiEndpoint.__defined__) {
29
+ /**
30
+ * If for some reason (usually in local development), the setBaseUrl is called multiple times with undefined
31
+ * And we already have it defined, let's just assume it's a no-op
32
+ */
33
+ return;
34
+ }
18
35
  else if (ApiEndpoint.__baseUrl__ !== baseUrlInput) {
19
36
  throw new Error(`ApiEndpoint baseUrl is already set to ${ApiEndpoint.__baseUrl__}, cannot change it to ${baseUrlInput}`);
20
37
  }
@@ -1,4 +1,6 @@
1
1
  'use client'
2
+ import { Configuration } from '@dynamic-labs/sdk-api-core';
3
+
2
4
  /* eslint-disable no-underscore-dangle */
3
5
  class ApiEndpoint {
4
6
  }
@@ -10,9 +12,24 @@ ApiEndpoint.getBaseUrl = () => {
10
12
  };
11
13
  ApiEndpoint.setBaseUrl = (baseUrlInput) => {
12
14
  if (!ApiEndpoint.__defined__) {
13
- ApiEndpoint.__baseUrl__ = baseUrlInput;
15
+ if (!baseUrlInput) {
16
+ /**
17
+ * If the baseUrl is not provided, use the default baseUrl from the sdk-api package
18
+ */
19
+ ApiEndpoint.__baseUrl__ = new Configuration().basePath;
20
+ }
21
+ else {
22
+ ApiEndpoint.__baseUrl__ = baseUrlInput;
23
+ }
14
24
  ApiEndpoint.__defined__ = true;
15
25
  }
26
+ else if (!baseUrlInput && ApiEndpoint.__defined__) {
27
+ /**
28
+ * If for some reason (usually in local development), the setBaseUrl is called multiple times with undefined
29
+ * And we already have it defined, let's just assume it's a no-op
30
+ */
31
+ return;
32
+ }
16
33
  else if (ApiEndpoint.__baseUrl__ !== baseUrlInput) {
17
34
  throw new Error(`ApiEndpoint baseUrl is already set to ${ApiEndpoint.__baseUrl__}, cannot change it to ${baseUrlInput}`);
18
35
  }
@@ -20,11 +20,15 @@ require('@dynamic-labs/utils');
20
20
  require('../../../shared/consts/index.cjs');
21
21
  var api = require('../api.cjs');
22
22
  var helpers = require('../../../context/DynamicContext/helpers/helpers.cjs');
23
+ var version = require('../../../../version.cjs');
23
24
 
24
25
  const fetchProjectSettings = (environmentId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
25
26
  try {
26
27
  const res = yield api.sdkApi().getEnvironmentSettings({
27
28
  environmentId,
29
+ sdkVersion: `WalletKit/${version.VERSION}`,
30
+ }, {
31
+ credentials: 'omit',
28
32
  });
29
33
  return res;
30
34
  }
@@ -16,11 +16,15 @@ import '@dynamic-labs/utils';
16
16
  import '../../../shared/consts/index.js';
17
17
  import { sdkApi } from '../api.js';
18
18
  import { isDynamicContextSessionSettingExpired, setDynamicContextSessionSettings, isWagmiSessionSettingExpired, setWagmiSessionSettings } from '../../../context/DynamicContext/helpers/helpers.js';
19
+ import { VERSION } from '../../../../version.js';
19
20
 
20
21
  const fetchProjectSettings = (environmentId) => __awaiter(void 0, void 0, void 0, function* () {
21
22
  try {
22
23
  const res = yield sdkApi().getEnvironmentSettings({
23
24
  environmentId,
25
+ sdkVersion: `WalletKit/${VERSION}`,
26
+ }, {
27
+ credentials: 'omit',
24
28
  });
25
29
  return res;
26
30
  }
@@ -134,7 +134,7 @@ const orderAndFilterList = (walletList, walletsFilter, isWalletConnectList, reco
134
134
  return sortedWalletList;
135
135
  }
136
136
  };
137
- const KEEP_WALLETS_NAME_LIST = ['wallet connect'];
137
+ const KEEP_WALLETS_NAME_LIST = ['wallet connect', 'bitcoin.com wallet'];
138
138
  const applySearchFilterToWalletOptionList = (rawSearchFilter, walletOptionList) => {
139
139
  const searchFilter = rawSearchFilter.trim().toLowerCase();
140
140
  const cleanName = (name) => {
@@ -130,7 +130,7 @@ const orderAndFilterList = (walletList, walletsFilter, isWalletConnectList, reco
130
130
  return sortedWalletList;
131
131
  }
132
132
  };
133
- const KEEP_WALLETS_NAME_LIST = ['wallet connect'];
133
+ const KEEP_WALLETS_NAME_LIST = ['wallet connect', 'bitcoin.com wallet'];
134
134
  const applySearchFilterToWalletOptionList = (rawSearchFilter, walletOptionList) => {
135
135
  const searchFilter = rawSearchFilter.trim().toLowerCase();
136
136
  const cleanName = (name) => {
@@ -176,9 +176,9 @@ const useSocialAccounts = ({ sessionTimeout } = {
176
176
  }
177
177
  const { id, oauthAccountId, oauthAccountPhotos, oauthDisplayName, oauthEmails, oauthProvider, oauthUsername, publicIdentifier, } = verifiedCredential;
178
178
  return {
179
- accountId: oauthAccountId,
179
+ accountId: oauthAccountId !== null && oauthAccountId !== void 0 ? oauthAccountId : undefined,
180
180
  avatar: oauthAccountPhotos === null || oauthAccountPhotos === void 0 ? void 0 : oauthAccountPhotos[0],
181
- displayName: oauthDisplayName,
181
+ displayName: oauthDisplayName !== null && oauthDisplayName !== void 0 ? oauthDisplayName : undefined,
182
182
  email: oauthEmails === null || oauthEmails === void 0 ? void 0 : oauthEmails[0],
183
183
  id,
184
184
  provider: oauthProvider,
@@ -172,9 +172,9 @@ const useSocialAccounts = ({ sessionTimeout } = {
172
172
  }
173
173
  const { id, oauthAccountId, oauthAccountPhotos, oauthDisplayName, oauthEmails, oauthProvider, oauthUsername, publicIdentifier, } = verifiedCredential;
174
174
  return {
175
- accountId: oauthAccountId,
175
+ accountId: oauthAccountId !== null && oauthAccountId !== void 0 ? oauthAccountId : undefined,
176
176
  avatar: oauthAccountPhotos === null || oauthAccountPhotos === void 0 ? void 0 : oauthAccountPhotos[0],
177
- displayName: oauthDisplayName,
177
+ displayName: oauthDisplayName !== null && oauthDisplayName !== void 0 ? oauthDisplayName : undefined,
178
178
  email: oauthEmails === null || oauthEmails === void 0 ? void 0 : oauthEmails[0],
179
179
  id,
180
180
  provider: oauthProvider,
@@ -88,7 +88,7 @@ const renderCheckboxGroup = (key, name, label, validationRules, errors, touched,
88
88
  ? 'user-field__checkbox-container--error'
89
89
  : ''}`, children: (validationRules === null || validationRules === void 0 ? void 0 : validationRules.checkboxText) && (jsxRuntime.jsxs("div", { className: 'user-field__consent-checkbox', children: [jsxRuntime.jsx(formik.Field, { as: Checkbox.Checkbox, id: key, name: name, type: 'checkbox', value: '0', disabled: disabled, selectDataTestId: 'customFieldCheckbox' }, key), jsxRuntime.jsx("label", { htmlFor: key, className: 'user-field__checkbox-label', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: validationRules.checkboxText }) })] }, key)) }, 'customConsentGroup'), touched[name] && getDisplayErrorMessage.getDisplayErrorMessage(label, errors[name]) && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', className: 'user-field__error-message', children: `${name.charAt(0).toUpperCase() + name.slice(1)} is required` }))] }));
90
90
  const renderPoliciesConsentGroup = (key, policiesConsentInnerComponentArray, disabled) => (jsxRuntime.jsx("div", { role: 'group', "aria-labelledby": 'checkbox-group', className: 'user-field__checkbox-container', children: policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.map((component, index) => (jsxRuntime.jsxs("div", { className: 'user-field__consent-checkbox', children: [jsxRuntime.jsx(formik.Field, { copykey: key, as: Checkbox.Checkbox, id: `policiesConsent_${index}`, name: 'policiesConsentArray', type: 'checkbox', value: `${index}`, disabled: disabled }, `policiesConsent_${index}`), jsxRuntime.jsx("label", { htmlFor: `policiesConsent_${index}`, className: 'user-field__checkbox-label', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: component }) })] }, `policiesConsent_${index}`))) }, 'policiesConsentGroup'));
91
- const UserField = ({ fieldData: { validationRules, isCustom, key, label, type, autoComplete }, fieldSettings: { enabled, name, required, verify }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
91
+ const UserField = ({ fieldData: { validationRules, isCustom, key, label: defaultLabel, type, autoComplete, }, fieldSettings: { enabled, name, required, verify, label = defaultLabel }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
92
92
  if (isCustom) {
93
93
  if (type === sdkApiCore.CustomFieldType.Select && (validationRules === null || validationRules === void 0 ? void 0 : validationRules.validOptions)) {
94
94
  const options = validationRules.validOptions.map((opt) => opt.label);
@@ -84,7 +84,7 @@ const renderCheckboxGroup = (key, name, label, validationRules, errors, touched,
84
84
  ? 'user-field__checkbox-container--error'
85
85
  : ''}`, children: (validationRules === null || validationRules === void 0 ? void 0 : validationRules.checkboxText) && (jsxs("div", { className: 'user-field__consent-checkbox', children: [jsx(Field, { as: Checkbox, id: key, name: name, type: 'checkbox', value: '0', disabled: disabled, selectDataTestId: 'customFieldCheckbox' }, key), jsx("label", { htmlFor: key, className: 'user-field__checkbox-label', children: jsx(Typography, { variant: 'body_small', color: 'secondary', children: validationRules.checkboxText }) })] }, key)) }, 'customConsentGroup'), touched[name] && getDisplayErrorMessage(label, errors[name]) && (jsx(Typography, { variant: 'body_mini', className: 'user-field__error-message', children: `${name.charAt(0).toUpperCase() + name.slice(1)} is required` }))] }));
86
86
  const renderPoliciesConsentGroup = (key, policiesConsentInnerComponentArray, disabled) => (jsx("div", { role: 'group', "aria-labelledby": 'checkbox-group', className: 'user-field__checkbox-container', children: policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.map((component, index) => (jsxs("div", { className: 'user-field__consent-checkbox', children: [jsx(Field, { copykey: key, as: Checkbox, id: `policiesConsent_${index}`, name: 'policiesConsentArray', type: 'checkbox', value: `${index}`, disabled: disabled }, `policiesConsent_${index}`), jsx("label", { htmlFor: `policiesConsent_${index}`, className: 'user-field__checkbox-label', children: jsx(Typography, { variant: 'body_small', color: 'secondary', children: component }) })] }, `policiesConsent_${index}`))) }, 'policiesConsentGroup'));
87
- const UserField = ({ fieldData: { validationRules, isCustom, key, label, type, autoComplete }, fieldSettings: { enabled, name, required, verify }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
87
+ const UserField = ({ fieldData: { validationRules, isCustom, key, label: defaultLabel, type, autoComplete, }, fieldSettings: { enabled, name, required, verify, label = defaultLabel }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
88
88
  if (isCustom) {
89
89
  if (type === CustomFieldType.Select && (validationRules === null || validationRules === void 0 ? void 0 : validationRules.validOptions)) {
90
90
  const options = validationRules.validOptions.map((opt) => opt.label);