@dynamic-labs/sdk-react-core 2.0.3 → 2.0.4

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 (33) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +12 -13
  5. package/src/lib/components/EmailForm/EmailForm.cjs +1 -1
  6. package/src/lib/components/EmailForm/EmailForm.js +1 -1
  7. package/src/lib/components/PhoneNumberField/PhoneNumberField.cjs +1 -1
  8. package/src/lib/components/PhoneNumberField/PhoneNumberField.js +1 -1
  9. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
  10. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +2 -1
  11. package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
  12. package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -0
  13. package/src/lib/context/DynamicContext/DynamicContext.js +1 -0
  14. package/src/lib/utils/functions/index.d.ts +1 -0
  15. package/src/lib/utils/functions/serializeWalletConnectors/index.d.ts +1 -0
  16. package/src/lib/utils/functions/serializeWalletConnectors/serializeWalletConnectors.cjs +31 -0
  17. package/src/lib/utils/functions/serializeWalletConnectors/serializeWalletConnectors.d.ts +2 -0
  18. package/src/lib/utils/functions/serializeWalletConnectors/serializeWalletConnectors.js +27 -0
  19. package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.cjs +6 -13
  20. package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.d.ts +1 -3
  21. package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.js +6 -12
  22. package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.cjs +25 -2
  23. package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.js +25 -2
  24. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -4
  25. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
  26. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -4
  27. package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.cjs +3 -3
  28. package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.js +3 -3
  29. package/src/lib/views/CollectUserDataView/useFields.cjs +1 -0
  30. package/src/lib/views/CollectUserDataView/useFields.d.ts +2 -0
  31. package/src/lib/views/CollectUserDataView/useFields.js +1 -0
  32. package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -1
  33. package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
1
 
2
+ ### [2.0.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.3...v2.0.4) (2024-04-24)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * add autocomplete attribute to email and phone inputs ([#5445](https://github.com/dynamic-labs/DynamicAuth/issues/5445)) ([f050365](https://github.com/dynamic-labs/DynamicAuth/commit/f050365e58cf0e8b64e552bbbcdc09c287703282))
8
+ * disconnect wallet on lock in connect-only ([#5421](https://github.com/dynamic-labs/DynamicAuth/issues/5421)) ([85e7e04](https://github.com/dynamic-labs/DynamicAuth/commit/85e7e04d8d1880a36e00ff292957fa2061230cec))
9
+ * improvements to DynamicWagmiConnector ([#5454](https://github.com/dynamic-labs/DynamicAuth/issues/5454)) ([47957de](https://github.com/dynamic-labs/DynamicAuth/commit/47957de44f030d8c2b4376ec20e17f76d4307c2d)), closes [#5446](https://github.com/dynamic-labs/DynamicAuth/issues/5446)
10
+
2
11
  ### [2.0.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.2...v2.0.3) (2024-04-22)
3
12
 
4
13
  ### [2.0.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.1...v2.0.2) (2024-04-19)
package/package.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "2.0.3";
5
+ var version = "2.0.4";
6
6
  var dependencies = {
7
7
  "@dynamic-labs/sdk-api-core": "0.0.418",
8
8
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "2.0.3";
1
+ var version = "2.0.4";
2
2
  var dependencies = {
3
3
  "@dynamic-labs/sdk-api-core": "0.0.418",
4
4
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -17,18 +17,17 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/ethereum": "2.0.3",
21
- "@dynamic-labs/iconic": "2.0.3",
22
- "@dynamic-labs/logger": "2.0.3",
23
- "@dynamic-labs/multi-wallet": "2.0.3",
24
- "@dynamic-labs/rpc-provider-ethereum": "2.0.3",
25
- "@dynamic-labs/rpc-provider-solana": "2.0.3",
26
- "@dynamic-labs/rpc-providers": "2.0.3",
27
- "@dynamic-labs/types": "2.0.3",
28
- "@dynamic-labs/utils": "2.0.3",
29
- "@dynamic-labs/viem-utils": "2.0.3",
30
- "@dynamic-labs/wallet-book": "2.0.3",
31
- "@dynamic-labs/wallet-connector-core": "2.0.3",
20
+ "@dynamic-labs/iconic": "2.0.4",
21
+ "@dynamic-labs/logger": "2.0.4",
22
+ "@dynamic-labs/multi-wallet": "2.0.4",
23
+ "@dynamic-labs/rpc-provider-ethereum": "2.0.4",
24
+ "@dynamic-labs/rpc-provider-solana": "2.0.4",
25
+ "@dynamic-labs/rpc-providers": "2.0.4",
26
+ "@dynamic-labs/types": "2.0.4",
27
+ "@dynamic-labs/utils": "2.0.4",
28
+ "@dynamic-labs/viem-utils": "2.0.4",
29
+ "@dynamic-labs/wallet-book": "2.0.4",
30
+ "@dynamic-labs/wallet-connector-core": "2.0.4",
32
31
  "eventemitter3": "5.0.1"
33
32
  },
34
33
  "devDependencies": {
@@ -95,7 +95,7 @@ const EmailForm = ({ isLoading, onSubmit, isEmailInvalid = false, currentEmail,
95
95
  }
96
96
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(emailInput);
97
97
  });
98
- return (jsxRuntime.jsxs("form", { className: classNames.classNames('login-with-email-form', className), style: style, "data-testid": 'email-form', onSubmit: (e) => handleSubmit(e), children: [jsxRuntime.jsx(Input.Input, { id: 'email_field', value: emailInput, onChange: handleEmailOnChangeEvent, copykey: 'dyn_login.email_form.email_field.label', label: t('dyn_login.email_form.email_field.label'), error: invalidEmail, message: invalidEmail && t('dyn_login.helper.email_form.invalid_email'), suffix: jsxRuntime.jsx(InlineSubmitButton.InlineSubmitButton, { disabled: isLoading || isDisabled, highlighted: emailInput.length > 0, isFocused: isFocused, isHovered: isHovered, emailSubmitButtonInsideInput: emailSubmitButtonInsideInput }), disabled: isLoading || isDisabled, type: 'email', onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false) }), !emailSubmitButtonInsideInput && (jsxRuntime.jsx(Button.Button, { dataTestId: 'submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading || emailInput.length < 3 || isDisabled, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: buttonCopyKey, typographyProps: {
98
+ return (jsxRuntime.jsxs("form", { className: classNames.classNames('login-with-email-form', className), style: style, "data-testid": 'email-form', onSubmit: (e) => handleSubmit(e), children: [jsxRuntime.jsx(Input.Input, { id: 'email_field', value: emailInput, onChange: handleEmailOnChangeEvent, copykey: 'dyn_login.email_form.email_field.label', label: t('dyn_login.email_form.email_field.label'), error: invalidEmail, message: invalidEmail && t('dyn_login.helper.email_form.invalid_email'), suffix: jsxRuntime.jsx(InlineSubmitButton.InlineSubmitButton, { disabled: isLoading || isDisabled, highlighted: emailInput.length > 0, isFocused: isFocused, isHovered: isHovered, emailSubmitButtonInsideInput: emailSubmitButtonInsideInput }), disabled: isLoading || isDisabled, type: 'email', onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), autoComplete: 'email' }), !emailSubmitButtonInsideInput && (jsxRuntime.jsx(Button.Button, { dataTestId: 'submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading || emailInput.length < 3 || isDisabled, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: buttonCopyKey, typographyProps: {
99
99
  color: 'inherit',
100
100
  }, children: t(buttonCopyKey) }))] }));
101
101
  };
@@ -91,7 +91,7 @@ const EmailForm = ({ isLoading, onSubmit, isEmailInvalid = false, currentEmail,
91
91
  }
92
92
  onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(emailInput);
93
93
  });
94
- return (jsxs("form", { className: classNames('login-with-email-form', className), style: style, "data-testid": 'email-form', onSubmit: (e) => handleSubmit(e), children: [jsx(Input, { id: 'email_field', value: emailInput, onChange: handleEmailOnChangeEvent, copykey: 'dyn_login.email_form.email_field.label', label: t('dyn_login.email_form.email_field.label'), error: invalidEmail, message: invalidEmail && t('dyn_login.helper.email_form.invalid_email'), suffix: jsx(InlineSubmitButton, { disabled: isLoading || isDisabled, highlighted: emailInput.length > 0, isFocused: isFocused, isHovered: isHovered, emailSubmitButtonInsideInput: emailSubmitButtonInsideInput }), disabled: isLoading || isDisabled, type: 'email', onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false) }), !emailSubmitButtonInsideInput && (jsx(Button, { dataTestId: 'submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading || emailInput.length < 3 || isDisabled, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: buttonCopyKey, typographyProps: {
94
+ return (jsxs("form", { className: classNames('login-with-email-form', className), style: style, "data-testid": 'email-form', onSubmit: (e) => handleSubmit(e), children: [jsx(Input, { id: 'email_field', value: emailInput, onChange: handleEmailOnChangeEvent, copykey: 'dyn_login.email_form.email_field.label', label: t('dyn_login.email_form.email_field.label'), error: invalidEmail, message: invalidEmail && t('dyn_login.helper.email_form.invalid_email'), suffix: jsx(InlineSubmitButton, { disabled: isLoading || isDisabled, highlighted: emailInput.length > 0, isFocused: isFocused, isHovered: isHovered, emailSubmitButtonInsideInput: emailSubmitButtonInsideInput }), disabled: isLoading || isDisabled, type: 'email', onPointerEnter: () => setIsHovered(true), onPointerLeave: () => setIsHovered(false), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), autoComplete: 'email' }), !emailSubmitButtonInsideInput && (jsx(Button, { dataTestId: 'submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading || emailInput.length < 3 || isDisabled, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: buttonCopyKey, typographyProps: {
95
95
  color: 'inherit',
96
96
  }, children: t(buttonCopyKey) }))] }));
97
97
  };
@@ -97,7 +97,7 @@ const PhoneNumberField = ({ isLoading, disabled, error, label, onUpdate, appendR
97
97
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
98
98
  }, ref: anchorRef, children: [jsxRuntime.jsxs("div", { className: classNames.classNames('phone-number-field__fields__country-code', {
99
99
  'phone-number-field__fields__country-code--disabled': isLoading || disabled,
100
- }), onClick: openDropdown, "data-testid": 'country-code', children: [jsxRuntime.jsx(reactInternationalPhone.FlagImage, { iso2: currentCountry.iso2, size: '24px', className: 'phone-number-field__fields__country-code__flag' }), jsxRuntime.jsx(Typography.Typography, { className: 'phone-number-field__fields__country-code__plus', variant: 'body_normal', weight: 'regular', style: { fontSize: countryFontSize }, color: 'primary', children: "+" }), jsxRuntime.jsx(Input.Input, { label: '', id: 'country_code_field', value: countryInput, onChange: handleCountryInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__country-code__container', className: 'phone-number-field__fields__country-code__container__input', onBlur: onBlurCountry, ref: countryInputRef, onKeyDown: handleCountryKeyDown, onFocus: onFocusCountry, style: { fontSize: countryFontSize }, "data-testid": 'country-code-input', inputMode: 'numeric' }), jsxRuntime.jsx(Icon.Icon, { className: 'phone-number-field__fields__country-code__chevron', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) })] }), jsxRuntime.jsx(Input.Input, { label: '', id: 'phoneNumber', value: formattedPhone, onChange: handlePhoneInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__phone-number', className: 'phone-number-field__fields__phone-number__input', ref: inputRef, error: Boolean(invalidNumberMessage || error), inputMode: 'numeric', "data-testid": 'phone_number_input' }), !hasInput && (jsxRuntime.jsx(Typography.Typography, { className: 'phone-number-field__fields__placeholder', variant: 'body_normal', weight: 'regular', copykey: 'dyn_collect_user_data.fields.phone_number.label', children: label !== null && label !== void 0 ? label : t('dyn_collect_user_data.fields.phone_number.label') })), appendRight] }), jsxRuntime.jsx(MenuList.MenuList, { isOpen: countryDropdownOpen, onClickClose: closeDropdown, popperProps: {
100
+ }), onClick: openDropdown, "data-testid": 'country-code', children: [jsxRuntime.jsx(reactInternationalPhone.FlagImage, { iso2: currentCountry.iso2, size: '24px', className: 'phone-number-field__fields__country-code__flag' }), jsxRuntime.jsx(Typography.Typography, { className: 'phone-number-field__fields__country-code__plus', variant: 'body_normal', weight: 'regular', style: { fontSize: countryFontSize }, color: 'primary', children: "+" }), jsxRuntime.jsx(Input.Input, { label: '', id: 'country_code_field', value: countryInput, onChange: handleCountryInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__country-code__container', className: 'phone-number-field__fields__country-code__container__input', onBlur: onBlurCountry, ref: countryInputRef, onKeyDown: handleCountryKeyDown, onFocus: onFocusCountry, style: { fontSize: countryFontSize }, "data-testid": 'country-code-input', inputMode: 'numeric', autoComplete: 'tel-country-code' }), jsxRuntime.jsx(Icon.Icon, { className: 'phone-number-field__fields__country-code__chevron', children: jsxRuntime.jsx(chevronDown.ReactComponent, {}) })] }), jsxRuntime.jsx(Input.Input, { label: '', id: 'phoneNumber', value: formattedPhone, onChange: handlePhoneInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__phone-number', className: 'phone-number-field__fields__phone-number__input', ref: inputRef, error: Boolean(invalidNumberMessage || error), inputMode: 'numeric', "data-testid": 'phone_number_input', autoComplete: 'tel-national' }), !hasInput && (jsxRuntime.jsx(Typography.Typography, { className: 'phone-number-field__fields__placeholder', variant: 'body_normal', weight: 'regular', copykey: 'dyn_collect_user_data.fields.phone_number.label', children: label !== null && label !== void 0 ? label : t('dyn_collect_user_data.fields.phone_number.label') })), appendRight] }), jsxRuntime.jsx(MenuList.MenuList, { isOpen: countryDropdownOpen, onClickClose: closeDropdown, popperProps: {
101
101
  anchorOrigin: 'bottom-left',
102
102
  anchorRef,
103
103
  }, mobileTitle: 'Select country', dropdownClassName: 'phone-number-field__dropdown', children: jsxRuntime.jsx("div", { className: 'phone-number-field__dropdown__items', ref: onMenuDisplayToggle, children: filteredCountries.map((countryData) => {
@@ -93,7 +93,7 @@ const PhoneNumberField = ({ isLoading, disabled, error, label, onUpdate, appendR
93
93
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
94
94
  }, ref: anchorRef, children: [jsxs("div", { className: classNames('phone-number-field__fields__country-code', {
95
95
  'phone-number-field__fields__country-code--disabled': isLoading || disabled,
96
- }), onClick: openDropdown, "data-testid": 'country-code', children: [jsx(FlagImage, { iso2: currentCountry.iso2, size: '24px', className: 'phone-number-field__fields__country-code__flag' }), jsx(Typography, { className: 'phone-number-field__fields__country-code__plus', variant: 'body_normal', weight: 'regular', style: { fontSize: countryFontSize }, color: 'primary', children: "+" }), jsx(Input, { label: '', id: 'country_code_field', value: countryInput, onChange: handleCountryInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__country-code__container', className: 'phone-number-field__fields__country-code__container__input', onBlur: onBlurCountry, ref: countryInputRef, onKeyDown: handleCountryKeyDown, onFocus: onFocusCountry, style: { fontSize: countryFontSize }, "data-testid": 'country-code-input', inputMode: 'numeric' }), jsx(Icon, { className: 'phone-number-field__fields__country-code__chevron', children: jsx(SvgChevronDown, {}) })] }), jsx(Input, { label: '', id: 'phoneNumber', value: formattedPhone, onChange: handlePhoneInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__phone-number', className: 'phone-number-field__fields__phone-number__input', ref: inputRef, error: Boolean(invalidNumberMessage || error), inputMode: 'numeric', "data-testid": 'phone_number_input' }), !hasInput && (jsx(Typography, { className: 'phone-number-field__fields__placeholder', variant: 'body_normal', weight: 'regular', copykey: 'dyn_collect_user_data.fields.phone_number.label', children: label !== null && label !== void 0 ? label : t('dyn_collect_user_data.fields.phone_number.label') })), appendRight] }), jsx(MenuList, { isOpen: countryDropdownOpen, onClickClose: closeDropdown, popperProps: {
96
+ }), onClick: openDropdown, "data-testid": 'country-code', children: [jsx(FlagImage, { iso2: currentCountry.iso2, size: '24px', className: 'phone-number-field__fields__country-code__flag' }), jsx(Typography, { className: 'phone-number-field__fields__country-code__plus', variant: 'body_normal', weight: 'regular', style: { fontSize: countryFontSize }, color: 'primary', children: "+" }), jsx(Input, { label: '', id: 'country_code_field', value: countryInput, onChange: handleCountryInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__country-code__container', className: 'phone-number-field__fields__country-code__container__input', onBlur: onBlurCountry, ref: countryInputRef, onKeyDown: handleCountryKeyDown, onFocus: onFocusCountry, style: { fontSize: countryFontSize }, "data-testid": 'country-code-input', inputMode: 'numeric', autoComplete: 'tel-country-code' }), jsx(Icon, { className: 'phone-number-field__fields__country-code__chevron', children: jsx(SvgChevronDown, {}) })] }), jsx(Input, { label: '', id: 'phoneNumber', value: formattedPhone, onChange: handlePhoneInput, disabled: isLoading || disabled, containerClassName: 'phone-number-field__fields__phone-number', className: 'phone-number-field__fields__phone-number__input', ref: inputRef, error: Boolean(invalidNumberMessage || error), inputMode: 'numeric', "data-testid": 'phone_number_input', autoComplete: 'tel-national' }), !hasInput && (jsx(Typography, { className: 'phone-number-field__fields__placeholder', variant: 'body_normal', weight: 'regular', copykey: 'dyn_collect_user_data.fields.phone_number.label', children: label !== null && label !== void 0 ? label : t('dyn_collect_user_data.fields.phone_number.label') })), appendRight] }), jsx(MenuList, { isOpen: countryDropdownOpen, onClickClose: closeDropdown, popperProps: {
97
97
  anchorOrigin: 'bottom-left',
98
98
  anchorRef,
99
99
  }, mobileTitle: 'Select country', dropdownClassName: 'phone-number-field__dropdown', children: jsx("div", { className: 'phone-number-field__dropdown__items', ref: onMenuDisplayToggle, children: filteredCountries.map((countryData) => {
@@ -76,7 +76,7 @@ require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Se
76
76
  require('@hcaptcha/react-hcaptcha');
77
77
  require('../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
78
78
 
79
- const UserProfileField = ({ name, label, value, copykey, }) => {
79
+ const UserProfileField = ({ name, label, value, copykey, autoComplete, }) => {
80
80
  var _a, _b;
81
81
  const { user } = useInternalDynamicContext.useInternalDynamicContext();
82
82
  const { t } = reactI18next.useTranslation();
@@ -5,5 +5,6 @@ export type UserProfileFieldProps = {
5
5
  label?: string;
6
6
  name: string;
7
7
  value?: string | boolean | null;
8
+ autoComplete?: string;
8
9
  } & CopyKey;
9
- export declare const UserProfileField: ({ name, label, value, copykey, }: UserProfileFieldProps) => JSX.Element;
10
+ export declare const UserProfileField: ({ name, label, value, copykey, autoComplete, }: UserProfileFieldProps) => JSX.Element;
@@ -72,7 +72,7 @@ import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/Sec
72
72
  import '@hcaptcha/react-hcaptcha';
73
73
  import '../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
74
74
 
75
- const UserProfileField = ({ name, label, value, copykey, }) => {
75
+ const UserProfileField = ({ name, label, value, copykey, autoComplete, }) => {
76
76
  var _a, _b;
77
77
  const { user } = useInternalDynamicContext();
78
78
  const { t } = useTranslation();
@@ -333,6 +333,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
333
333
  const { isLoading: loadingNetwork, network } = useWalletConnectorNetwork.useWalletConnectorNetwork(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
334
334
  useWalletEventListeners.useWalletEventListeners({
335
335
  authMode,
336
+ disconnectWallet,
336
337
  handleLogOut,
337
338
  multiWallet,
338
339
  multiWalletWidgetState,
@@ -329,6 +329,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings, locale, }) =>
329
329
  const { isLoading: loadingNetwork, network } = useWalletConnectorNetwork(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector);
330
330
  useWalletEventListeners({
331
331
  authMode,
332
+ disconnectWallet,
332
333
  handleLogOut,
333
334
  multiWallet,
334
335
  multiWalletWidgetState,
@@ -69,3 +69,4 @@ export * from './getEnabledEmbeddedWalletProviders';
69
69
  export * from './isAllowedToLinkWallet';
70
70
  export * from './updateJWTAndCreateUserProfile';
71
71
  export * from './getUserVerifiedCredentialType';
72
+ export * from './serializeWalletConnectors';
@@ -0,0 +1 @@
1
+ export { serializeWalletConnectors } from './serializeWalletConnectors';
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('@dynamic-labs/sdk-api-core');
6
+ var logger = require('../../../shared/logger.cjs');
7
+ require('@dynamic-labs/iconic');
8
+ require('@dynamic-labs/wallet-connector-core');
9
+ require('react/jsx-runtime');
10
+ require('../../../context/ViewContext/ViewContext.cjs');
11
+ require('react');
12
+ require('@dynamic-labs/wallet-book');
13
+ require('../../constants/colors.cjs');
14
+ require('../../constants/values.cjs');
15
+ require('../../../shared/utils/classes/storage/localStorage.cjs');
16
+ require('@dynamic-labs/utils');
17
+ require('../../../shared/consts/index.cjs');
18
+
19
+ const serializeWalletConnectors = (walletConnectors) => {
20
+ try {
21
+ if (!walletConnectors)
22
+ return undefined;
23
+ return walletConnectors.map((connector) => connector.name);
24
+ }
25
+ catch (error) {
26
+ logger.logger.error('error serializing walletConnectors', error);
27
+ return undefined;
28
+ }
29
+ };
30
+
31
+ exports.serializeWalletConnectors = serializeWalletConnectors;
@@ -0,0 +1,2 @@
1
+ import { WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
2
+ export declare const serializeWalletConnectors: (walletConnectors?: WalletConnectorsMethod[]) => string[] | undefined;
@@ -0,0 +1,27 @@
1
+ import '@dynamic-labs/sdk-api-core';
2
+ import { logger } from '../../../shared/logger.js';
3
+ import '@dynamic-labs/iconic';
4
+ import '@dynamic-labs/wallet-connector-core';
5
+ import 'react/jsx-runtime';
6
+ import '../../../context/ViewContext/ViewContext.js';
7
+ import 'react';
8
+ import '@dynamic-labs/wallet-book';
9
+ import '../../constants/colors.js';
10
+ import '../../constants/values.js';
11
+ import '../../../shared/utils/classes/storage/localStorage.js';
12
+ import '@dynamic-labs/utils';
13
+ import '../../../shared/consts/index.js';
14
+
15
+ const serializeWalletConnectors = (walletConnectors) => {
16
+ try {
17
+ if (!walletConnectors)
18
+ return undefined;
19
+ return walletConnectors.map((connector) => connector.name);
20
+ }
21
+ catch (error) {
22
+ logger.error('error serializing walletConnectors', error);
23
+ return undefined;
24
+ }
25
+ };
26
+
27
+ export { serializeWalletConnectors };
@@ -20,6 +20,11 @@ require('../../../../../_virtual/_tslib.cjs');
20
20
  require('../../../config/ApiEndpoint.cjs');
21
21
  var settings = require('../../../data/api/settings/settings.cjs');
22
22
  require('../../../locale/locale.cjs');
23
+ require('@dynamic-labs/multi-wallet');
24
+ require('react-international-phone');
25
+ require('viem');
26
+ require('viem/chains');
27
+ var serializeWalletConnectors = require('../../functions/serializeWalletConnectors/serializeWalletConnectors.cjs');
23
28
 
24
29
  const useSendDynamicProps = ({ settings: settings$1, environmentId, }) => {
25
30
  useEffectOnce.useEffectOnce(() => {
@@ -31,7 +36,7 @@ const useSendDynamicProps = ({ settings: settings$1, environmentId, }) => {
31
36
  settings: Object.assign(Object.assign({}, settings$1), { customPrivacyPolicy: Boolean(settings$1.customPrivacyPolicy), customTermsOfServices: Boolean(settings$1.customTermsOfServices), policiesConsentInnerComponent: Boolean(settings$1.policiesConsentInnerComponent) }),
32
37
  };
33
38
  const serializedEventsCallbacks = serializeEventsCallbacks(settings$1.events);
34
- const serializedWalletConnectors = serializeWalletConnectors(settings$1.walletConnectors);
39
+ const serializedWalletConnectors = serializeWalletConnectors.serializeWalletConnectors(settings$1.walletConnectors);
35
40
  const serializedDynamicContextProps = Object.assign(Object.assign({}, updatedDynamicProps), { settings: Object.assign(Object.assign({}, updatedDynamicProps.settings), { events: serializedEventsCallbacks, walletConnectors: serializedWalletConnectors }) });
36
41
  settings.sendDynamicProps(environmentId, {
37
42
  dynamicContextProps: serializedDynamicContextProps,
@@ -57,17 +62,6 @@ const serializeEventsCallbacks = (events) => {
57
62
  return undefined;
58
63
  }
59
64
  };
60
- const serializeWalletConnectors = (walletConnectors) => {
61
- try {
62
- if (!walletConnectors)
63
- return undefined;
64
- return walletConnectors.map((connector) => connector.name);
65
- }
66
- catch (error) {
67
- logger.logger.error('error serializing walletConnectors', error);
68
- return undefined;
69
- }
70
- };
71
65
  const getFrameworkSettings = () => {
72
66
  var _a;
73
67
  return ({
@@ -83,5 +77,4 @@ const getFrameworkSettings = () => {
83
77
  };
84
78
 
85
79
  exports.serializeEventsCallbacks = serializeEventsCallbacks;
86
- exports.serializeWalletConnectors = serializeWalletConnectors;
87
80
  exports.useSendDynamicProps = useSendDynamicProps;
@@ -1,5 +1,4 @@
1
- import { WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
2
- import { DynamicContextProps } from '../../../..';
1
+ import { DynamicContextProps } from '../../../context/DynamicContext';
3
2
  import { DynamicEventsCallbacks } from '../../../shared';
4
3
  type UseSendDynamicHookProps = {
5
4
  settings: DynamicContextProps['settings'];
@@ -7,5 +6,4 @@ type UseSendDynamicHookProps = {
7
6
  };
8
7
  export declare const useSendDynamicProps: ({ settings, environmentId, }: UseSendDynamicHookProps) => void;
9
8
  export declare const serializeEventsCallbacks: (events: DynamicEventsCallbacks | undefined) => string[] | undefined;
10
- export declare const serializeWalletConnectors: (walletConnectors?: WalletConnectorsMethod[]) => string[] | undefined;
11
9
  export {};
@@ -16,6 +16,11 @@ import '../../../../../_virtual/_tslib.js';
16
16
  import '../../../config/ApiEndpoint.js';
17
17
  import { sendDynamicProps } from '../../../data/api/settings/settings.js';
18
18
  import '../../../locale/locale.js';
19
+ import '@dynamic-labs/multi-wallet';
20
+ import 'react-international-phone';
21
+ import 'viem';
22
+ import 'viem/chains';
23
+ import { serializeWalletConnectors } from '../../functions/serializeWalletConnectors/serializeWalletConnectors.js';
19
24
 
20
25
  const useSendDynamicProps = ({ settings, environmentId, }) => {
21
26
  useEffectOnce(() => {
@@ -53,17 +58,6 @@ const serializeEventsCallbacks = (events) => {
53
58
  return undefined;
54
59
  }
55
60
  };
56
- const serializeWalletConnectors = (walletConnectors) => {
57
- try {
58
- if (!walletConnectors)
59
- return undefined;
60
- return walletConnectors.map((connector) => connector.name);
61
- }
62
- catch (error) {
63
- logger.error('error serializing walletConnectors', error);
64
- return undefined;
65
- }
66
- };
67
61
  const getFrameworkSettings = () => {
68
62
  var _a;
69
63
  return ({
@@ -78,4 +72,4 @@ const getFrameworkSettings = () => {
78
72
  });
79
73
  };
80
74
 
81
- export { serializeEventsCallbacks, serializeWalletConnectors, useSendDynamicProps };
75
+ export { serializeEventsCallbacks, useSendDynamicProps };
@@ -4,9 +4,31 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
6
  var data = require('../../../views/WalletList/data.cjs');
7
+ require('@dynamic-labs/wallet-connector-core');
8
+ require('@dynamic-labs/sdk-api-core');
9
+ require('../../../shared/logger.cjs');
10
+ require('@dynamic-labs/iconic');
11
+ require('react/jsx-runtime');
12
+ require('../../../context/ViewContext/ViewContext.cjs');
13
+ require('@dynamic-labs/wallet-book');
14
+ require('../../constants/colors.cjs');
15
+ require('../../constants/values.cjs');
16
+ require('../../../shared/utils/classes/storage/localStorage.cjs');
17
+ require('@dynamic-labs/utils');
18
+ require('../../../shared/consts/index.cjs');
19
+ require('../../../../../_virtual/_tslib.cjs');
20
+ require('@dynamic-labs/multi-wallet');
21
+ require('react-international-phone');
22
+ require('viem');
23
+ require('viem/chains');
24
+ require('../../../config/ApiEndpoint.cjs');
25
+ require('../../../locale/locale.cjs');
26
+ var serializeWalletConnectors = require('../../functions/serializeWalletConnectors/serializeWalletConnectors.cjs');
7
27
  var verifyRequiredConnectorsAreSetup = require('./utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.cjs');
8
28
 
9
29
  const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
30
+ const walletConnectorsKey = React.useMemo(() => { var _a; return (_a = serializeWalletConnectors.serializeWalletConnectors(walletConnectorsProp)) === null || _a === void 0 ? void 0 : _a.join(','); }, [walletConnectorsProp]);
31
+ const walletBookLength = React.useMemo(() => Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length, [walletBook]);
10
32
  const walletConnectorOptions = React.useMemo(() => {
11
33
  if (!projectSettings ||
12
34
  !Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length ||
@@ -30,14 +52,15 @@ const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepL
30
52
  walletConnectorExtensions,
31
53
  });
32
54
  // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
55
+ // eslint-disable-next-line react-hooks/exhaustive-deps
33
56
  }, [
34
57
  appLogoUrl,
35
58
  appName,
36
59
  projectSettings,
37
- walletConnectorsProp,
60
+ walletConnectorsKey,
38
61
  walletConnectPreferredChains,
39
62
  flowNetwork,
40
- Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length,
63
+ walletBookLength,
41
64
  networkConfigurations,
42
65
  ]);
43
66
  React.useEffect(() => {
@@ -1,8 +1,30 @@
1
1
  import { useMemo, useEffect } from 'react';
2
2
  import { getWallets } from '../../../views/WalletList/data.js';
3
+ import '@dynamic-labs/wallet-connector-core';
4
+ import '@dynamic-labs/sdk-api-core';
5
+ import '../../../shared/logger.js';
6
+ import '@dynamic-labs/iconic';
7
+ import 'react/jsx-runtime';
8
+ import '../../../context/ViewContext/ViewContext.js';
9
+ import '@dynamic-labs/wallet-book';
10
+ import '../../constants/colors.js';
11
+ import '../../constants/values.js';
12
+ import '../../../shared/utils/classes/storage/localStorage.js';
13
+ import '@dynamic-labs/utils';
14
+ import '../../../shared/consts/index.js';
15
+ import '../../../../../_virtual/_tslib.js';
16
+ import '@dynamic-labs/multi-wallet';
17
+ import 'react-international-phone';
18
+ import 'viem';
19
+ import 'viem/chains';
20
+ import '../../../config/ApiEndpoint.js';
21
+ import '../../../locale/locale.js';
22
+ import { serializeWalletConnectors } from '../../functions/serializeWalletConnectors/serializeWalletConnectors.js';
3
23
  import { verifyRequiredConnectorsAreSetup } from './utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.js';
4
24
 
5
25
  const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepLinkPreference, flowNetwork, mobileExperience, networkConfigurations, walletBook, walletUiUtils, walletConnectorsProp, walletConnectPreferredChains, walletConnectorExtensions, }) => {
26
+ const walletConnectorsKey = useMemo(() => { var _a; return (_a = serializeWalletConnectors(walletConnectorsProp)) === null || _a === void 0 ? void 0 : _a.join(','); }, [walletConnectorsProp]);
27
+ const walletBookLength = useMemo(() => Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length, [walletBook]);
6
28
  const walletConnectorOptions = useMemo(() => {
7
29
  if (!projectSettings ||
8
30
  !Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length ||
@@ -26,14 +48,15 @@ const useWalletConnectorOptions = ({ projectSettings, appLogoUrl, appName, deepL
26
48
  walletConnectorExtensions,
27
49
  });
28
50
  // Cannot include walletUiUtils in the dependency array because it will cause an infinite loop
51
+ // eslint-disable-next-line react-hooks/exhaustive-deps
29
52
  }, [
30
53
  appLogoUrl,
31
54
  appName,
32
55
  projectSettings,
33
- walletConnectorsProp,
56
+ walletConnectorsKey,
34
57
  walletConnectPreferredChains,
35
58
  flowNetwork,
36
- Object.keys(walletBook !== null && walletBook !== void 0 ? walletBook : {}).length,
59
+ walletBookLength,
37
60
  networkConfigurations,
38
61
  ]);
39
62
  useEffect(() => {
@@ -19,7 +19,7 @@ require('../../../shared/consts/index.cjs');
19
19
  require('../../../events/dynamicEvents.cjs');
20
20
  var useWalletConnectorEvent = require('../events/useWalletConnectorEvent/useWalletConnectorEvent.cjs');
21
21
 
22
- const useWalletEventListeners = ({ handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, setPrimaryWalletId, authMode, refreshConnectedWallet, }) => {
22
+ const useWalletEventListeners = ({ disconnectWallet, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, setPrimaryWalletId, authMode, refreshConnectedWallet, }) => {
23
23
  useWalletConnectorEvent.useWalletConnectorEvent(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, 'disconnect', () => {
24
24
  logger.logger.debug('primary wallet disconnect');
25
25
  handleLogOut();
@@ -108,13 +108,11 @@ const useWalletEventListeners = ({ handleLogOut, multiWallet, multiWalletWidgetS
108
108
  }));
109
109
  useWalletConnectorEvent.useWalletConnectorEvent(uniqueNonPrimaryWallets, 'disconnect', (affectedConnector) => {
110
110
  logger.logger.debug('secondary wallet disconnect');
111
- // argent sends a disconnect event when the user adds a new account
112
111
  if (authMode === 'connect-only') {
113
112
  // Get all wallets with this connector
114
113
  const affectedWallets = secondaryWallets.filter(({ connector }) => connector.key === affectedConnector.key);
115
114
  for (const wallet of affectedWallets) {
116
- if (wallet.connector.key === 'argentx')
117
- refreshConnectedWallet(wallet.id, wallet.connector);
115
+ disconnectWallet(wallet.id);
118
116
  }
119
117
  }
120
118
  });
@@ -3,6 +3,7 @@ import { IDynamicContext } from '../../../context/DynamicContext/types';
3
3
  import { AuthModeType, MultiWalletWidgetState, UserProfile, Wallet, WalletWithAction } from '../../../shared';
4
4
  import { MultiWalletWidgetStateSetter } from '../multiWallet';
5
5
  export type UseWalletEventListenersArgs = {
6
+ disconnectWallet: (walletId: string) => Promise<void>;
6
7
  handleLogOut(): Promise<void>;
7
8
  multiWallet: boolean;
8
9
  multiWalletWidgetState: MultiWalletWidgetState;
@@ -18,4 +19,4 @@ export type UseWalletEventListenersArgs = {
18
19
  authMode: AuthModeType;
19
20
  refreshConnectedWallet: (walletId: string, walletConnector: WalletConnector, shouldCallCallback?: boolean) => Promise<void>;
20
21
  };
21
- export declare const useWalletEventListeners: ({ handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, setPrimaryWalletId, authMode, refreshConnectedWallet, }: UseWalletEventListenersArgs) => void;
22
+ export declare const useWalletEventListeners: ({ disconnectWallet, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, setPrimaryWalletId, authMode, refreshConnectedWallet, }: UseWalletEventListenersArgs) => void;
@@ -15,7 +15,7 @@ import '../../../shared/consts/index.js';
15
15
  import '../../../events/dynamicEvents.js';
16
16
  import { useWalletConnectorEvent } from '../events/useWalletConnectorEvent/useWalletConnectorEvent.js';
17
17
 
18
- const useWalletEventListeners = ({ handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, setPrimaryWalletId, authMode, refreshConnectedWallet, }) => {
18
+ const useWalletEventListeners = ({ disconnectWallet, handleLogOut, multiWallet, multiWalletWidgetState, primaryWallet, secondaryWallets, selectedWalletConnector, selectedWalletWithAction, setSelectedWalletConnectorKey, setSelectedWalletWithAction, setMultiWalletWidgetState, user, setPrimaryWalletId, authMode, refreshConnectedWallet, }) => {
19
19
  useWalletConnectorEvent(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector, 'disconnect', () => {
20
20
  logger.debug('primary wallet disconnect');
21
21
  handleLogOut();
@@ -104,13 +104,11 @@ const useWalletEventListeners = ({ handleLogOut, multiWallet, multiWalletWidgetS
104
104
  }));
105
105
  useWalletConnectorEvent(uniqueNonPrimaryWallets, 'disconnect', (affectedConnector) => {
106
106
  logger.debug('secondary wallet disconnect');
107
- // argent sends a disconnect event when the user adds a new account
108
107
  if (authMode === 'connect-only') {
109
108
  // Get all wallets with this connector
110
109
  const affectedWallets = secondaryWallets.filter(({ connector }) => connector.key === affectedConnector.key);
111
110
  for (const wallet of affectedWallets) {
112
- if (wallet.connector.key === 'argentx')
113
- refreshConnectedWallet(wallet.id, wallet.connector);
111
+ disconnectWallet(wallet.id);
114
112
  }
115
113
  }
116
114
  });
@@ -77,7 +77,7 @@ require('@hcaptcha/react-hcaptcha');
77
77
  require('../../../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
78
78
  var Select = require('../../../../components/Select/Select.cjs');
79
79
 
80
- const UserField = ({ fieldData: { key, label, type }, fieldSettings: { enabled, name, required, verify }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
80
+ const UserField = ({ fieldData: { key, label, type, autoComplete }, fieldSettings: { enabled, name, required, verify }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
81
81
  if (name === 'tShirtSize') {
82
82
  return (jsxRuntime.jsx(formik.Field, { copykey: key, as: Select.Select, type: type, id: name, name: name, label: label, error: errors[name] && touched[name], selectDataTestId: 'tShirtSizeSelect', message: touched[name] && getDisplayErrorMessage.getDisplayErrorMessage(label, errors[name]), disabled: disabled, children: index.tShirtSizes.map((size) => (jsxRuntime.jsx("option", { value: size, children: size }, size))) }, name));
83
83
  }
@@ -93,10 +93,10 @@ const UserField = ({ fieldData: { key, label, type }, fieldSettings: { enabled,
93
93
  else if (name === 'phoneNumber') {
94
94
  return (jsxRuntime.jsx(formik.Field, { name: name, as: UserPhoneField.UserPhoneField, disabled: disabled, label: label, required: required, error: touched[name] && errors[name]
95
95
  ? getDisplayErrorMessage.getDisplayErrorMessage(label, errors[name])
96
- : undefined, verify: verify }, name));
96
+ : undefined, verify: verify, autoComplete: autoComplete }, name));
97
97
  }
98
98
  else {
99
- return (jsxRuntime.jsx(formik.Field, { copykey: key, disabled: disabled, as: Input.Input, type: type, id: name, name: name, label: label, optional: enabled && !required, error: errors[name] && touched[name], message: touched[name] && getDisplayErrorMessage.getDisplayErrorMessage(label, errors[name]) }, name));
99
+ return (jsxRuntime.jsx(formik.Field, { copykey: key, disabled: disabled, as: Input.Input, type: type, id: name, name: name, label: label, optional: enabled && !required, error: errors[name] && touched[name], message: touched[name] && getDisplayErrorMessage.getDisplayErrorMessage(label, errors[name]), autoComplete: autoComplete }, name));
100
100
  }
101
101
  };
102
102
 
@@ -73,7 +73,7 @@ import '@hcaptcha/react-hcaptcha';
73
73
  import '../../../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
74
74
  import { Select } from '../../../../components/Select/Select.js';
75
75
 
76
- const UserField = ({ fieldData: { key, label, type }, fieldSettings: { enabled, name, required, verify }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
76
+ const UserField = ({ fieldData: { key, label, type, autoComplete }, fieldSettings: { enabled, name, required, verify }, errors, touched, disabled, policiesConsentInnerComponentArray, }) => {
77
77
  if (name === 'tShirtSize') {
78
78
  return (jsx(Field, { copykey: key, as: Select, type: type, id: name, name: name, label: label, error: errors[name] && touched[name], selectDataTestId: 'tShirtSizeSelect', message: touched[name] && getDisplayErrorMessage(label, errors[name]), disabled: disabled, children: tShirtSizes.map((size) => (jsx("option", { value: size, children: size }, size))) }, name));
79
79
  }
@@ -89,10 +89,10 @@ const UserField = ({ fieldData: { key, label, type }, fieldSettings: { enabled,
89
89
  else if (name === 'phoneNumber') {
90
90
  return (jsx(Field, { name: name, as: UserPhoneField, disabled: disabled, label: label, required: required, error: touched[name] && errors[name]
91
91
  ? getDisplayErrorMessage(label, errors[name])
92
- : undefined, verify: verify }, name));
92
+ : undefined, verify: verify, autoComplete: autoComplete }, name));
93
93
  }
94
94
  else {
95
- return (jsx(Field, { copykey: key, disabled: disabled, as: Input, type: type, id: name, name: name, label: label, optional: enabled && !required, error: errors[name] && touched[name], message: touched[name] && getDisplayErrorMessage(label, errors[name]) }, name));
95
+ return (jsx(Field, { copykey: key, disabled: disabled, as: Input, type: type, id: name, name: name, label: label, optional: enabled && !required, error: errors[name] && touched[name], message: touched[name] && getDisplayErrorMessage(label, errors[name]), autoComplete: autoComplete }, name));
96
96
  }
97
97
  };
98
98
 
@@ -45,6 +45,7 @@ const useFields = () => {
45
45
  validation: yup.string().oneOf(index.countryCodes.map((c) => c.code)),
46
46
  },
47
47
  email: {
48
+ autoComplete: 'email',
48
49
  key: 'dyn_collect_user_data.fields.email.label',
49
50
  label: t('dyn_collect_user_data.fields.email.label'),
50
51
  type: 'email',
@@ -4,6 +4,7 @@ export type FieldConfig = {
4
4
  key: string;
5
5
  type: string;
6
6
  validation: StringSchema | BooleanSchema;
7
+ autoComplete?: string;
7
8
  };
8
9
  export declare const useFields: () => {
9
10
  fieldsConfig: {
@@ -20,6 +21,7 @@ export declare const useFields: () => {
20
21
  validation: StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
21
22
  };
22
23
  email: {
24
+ autoComplete: string;
23
25
  key: string;
24
26
  label: string;
25
27
  type: string;
@@ -41,6 +41,7 @@ const useFields = () => {
41
41
  validation: string().oneOf(countryCodes.map((c) => c.code)),
42
42
  },
43
43
  email: {
44
+ autoComplete: 'email',
44
45
  key: 'dyn_collect_user_data.fields.email.label',
45
46
  label: t('dyn_collect_user_data.fields.email.label'),
46
47
  type: 'email',
@@ -127,7 +127,7 @@ const EmailUpdate = () => {
127
127
  });
128
128
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, displayLeading: true, displayBorder: true, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_email_update.title', children: t('dyn_email_update.title') }) }), jsxRuntime.jsxs("div", { className: 'email-update__container', children: [jsxRuntime.jsxs("div", { className: 'email-update__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_email_update.current_email', children: t('dyn_email_update.current_email') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: email })] }), jsxRuntime.jsx(Input.Input, { id: 'email_field', onChange: (e) => {
129
129
  setUpdatedEmail(e.target.value);
130
- }, type: 'email', copykey: 'dyn_email_update.label', label: t('dyn_email_update.label'), className: 'email-update__input', error: Boolean(emailError), message: emailError }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, copykey: 'dyn_email_update.send_verification', children: t('dyn_email_update.send_verification') })] })] }));
130
+ }, type: 'email', copykey: 'dyn_email_update.label', label: t('dyn_email_update.label'), className: 'email-update__input', error: Boolean(emailError), message: emailError, autoComplete: 'email' }), jsxRuntime.jsx(Button.Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, copykey: 'dyn_email_update.send_verification', children: t('dyn_email_update.send_verification') })] })] }));
131
131
  };
132
132
 
133
133
  exports.EmailUpdate = EmailUpdate;
@@ -123,7 +123,7 @@ const EmailUpdate = () => {
123
123
  });
124
124
  return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, displayLeading: true, displayBorder: true, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_email_update.title', children: t('dyn_email_update.title') }) }), jsxs("div", { className: 'email-update__container', children: [jsxs("div", { className: 'email-update__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_email_update.current_email', children: t('dyn_email_update.current_email') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: email })] }), jsx(Input, { id: 'email_field', onChange: (e) => {
125
125
  setUpdatedEmail(e.target.value);
126
- }, type: 'email', copykey: 'dyn_email_update.label', label: t('dyn_email_update.label'), className: 'email-update__input', error: Boolean(emailError), message: emailError }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, copykey: 'dyn_email_update.send_verification', children: t('dyn_email_update.send_verification') })] })] }));
126
+ }, type: 'email', copykey: 'dyn_email_update.label', label: t('dyn_email_update.label'), className: 'email-update__input', error: Boolean(emailError), message: emailError, autoComplete: 'email' }), jsx(Button, { buttonVariant: 'primary', buttonPadding: 'medium', buttonClassName: 'email-update__button', onClick: () => handleEmailUpdate(), loading: loading, copykey: 'dyn_email_update.send_verification', children: t('dyn_email_update.send_verification') })] })] }));
127
127
  };
128
128
 
129
129
  export { EmailUpdate };