@dynamic-labs/sdk-react-core 1.4.9 → 1.4.10

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,11 @@
1
1
 
2
+ ### [1.4.10](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.9...v1.4.10) (2024-04-23)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * add autocomplete attribute to email and phone inputs ([#5444](https://github.com/dynamic-labs/DynamicAuth/issues/5444)) ([01fc1b0](https://github.com/dynamic-labs/DynamicAuth/commit/01fc1b0e0b93a5104112a7682907ea2948ece7b2))
8
+
2
9
  ### [1.4.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.8...v1.4.9) (2024-04-20)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "1.4.9";
5
+ var version = "1.4.10";
6
6
  var dependencies = {
7
7
  "@dynamic-labs/sdk-api": "0.0.387",
8
8
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "1.4.9";
1
+ var version = "1.4.10";
2
2
  var dependencies = {
3
3
  "@dynamic-labs/sdk-api": "0.0.387",
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": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -16,16 +16,16 @@
16
16
  "react-focus-lock": "2.9.2",
17
17
  "react-i18next": "^13.2.0",
18
18
  "yup": "0.32.11",
19
- "@dynamic-labs/ethereum": "1.4.9",
20
- "@dynamic-labs/iconic": "1.4.9",
21
- "@dynamic-labs/logger": "1.4.9",
22
- "@dynamic-labs/multi-wallet": "1.4.9",
23
- "@dynamic-labs/rpc-providers": "1.4.9",
24
- "@dynamic-labs/types": "1.4.9",
25
- "@dynamic-labs/utils": "1.4.9",
26
- "@dynamic-labs/viem-utils": "1.4.9",
27
- "@dynamic-labs/wallet-book": "1.4.9",
28
- "@dynamic-labs/wallet-connector-core": "1.4.9",
19
+ "@dynamic-labs/ethereum": "1.4.10",
20
+ "@dynamic-labs/iconic": "1.4.10",
21
+ "@dynamic-labs/logger": "1.4.10",
22
+ "@dynamic-labs/multi-wallet": "1.4.10",
23
+ "@dynamic-labs/rpc-providers": "1.4.10",
24
+ "@dynamic-labs/types": "1.4.10",
25
+ "@dynamic-labs/utils": "1.4.10",
26
+ "@dynamic-labs/viem-utils": "1.4.10",
27
+ "@dynamic-labs/wallet-book": "1.4.10",
28
+ "@dynamic-labs/wallet-connector-core": "1.4.10",
29
29
  "eventemitter3": "5.0.1"
30
30
  },
31
31
  "devDependencies": {
@@ -82,7 +82,7 @@ const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, to
82
82
  const { fieldsConfig } = useFields.useFields();
83
83
  const { t } = reactI18next.useTranslation();
84
84
  return (jsxRuntime.jsx("div", { className: 'user-data-fields__fields-column', children: fields === null || fields === void 0 ? void 0 : fields.map(({ name, required, enabled }) => {
85
- const { label, type, key } = index.getValueByKey(fieldsConfig, name);
85
+ const { label, type, key, autoComplete } = index.getValueByKey(fieldsConfig, name);
86
86
  if (name === 'tShirtSize') {
87
87
  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]), children: index$1.tShirtSizes.map((size) => (jsxRuntime.jsx("option", { value: size, children: size }, size))) }, name));
88
88
  }
@@ -96,10 +96,10 @@ const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, to
96
96
  return (jsxRuntime.jsx("div", { role: 'group', "aria-labelledby": 'checkbox-group', className: 'user-data-fields__checkbox-container', children: policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.map((component, index) => (jsxRuntime.jsxs("div", { className: 'user-data-fields__consent-checkbox', children: [jsxRuntime.jsx(formik.Field, { copykey: key, as: Checkbox.Checkbox, id: `policiesConsent_${index}`, name: 'policiesConsentArray', type: 'checkbox', value: `${index}` }, `policiesConsent_${index}`), jsxRuntime.jsx("label", { htmlFor: `policiesConsent_${index}`, className: 'user-data-fields__checkbox-label', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: component }) })] }, `policiesConsent_${index}`))) }, 'policiesConsentGroup'));
97
97
  }
98
98
  else if (name === 'email' && !enabled) {
99
- return (jsxRuntime.jsx(Tooltip.Tooltip, { content: t('dyn_collect_user_data.update_email_tooltip'), className: 'user-data-fields__tooltip', copykey: 'dyn_collect_user_data.update_email_tooltip', children: jsxRuntime.jsx(formik.Field, { copykey: key, disabled: true, as: Input.Input, type: type, id: name, name: name, label: label }, name) }, 'disabled-email-tooltip'));
99
+ return (jsxRuntime.jsx(Tooltip.Tooltip, { content: t('dyn_collect_user_data.update_email_tooltip'), className: 'user-data-fields__tooltip', copykey: 'dyn_collect_user_data.update_email_tooltip', children: jsxRuntime.jsx(formik.Field, { copykey: key, disabled: true, as: Input.Input, type: type, id: name, name: name, label: label, autoComplete: autoComplete }, name) }, 'disabled-email-tooltip'));
100
100
  }
101
101
  else {
102
- return (jsxRuntime.jsx(formik.Field, { copykey: key, disabled: !enabled, 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));
102
+ return (jsxRuntime.jsx(formik.Field, { copykey: key, disabled: !enabled, 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));
103
103
  }
104
104
  }) }));
105
105
  };
@@ -78,7 +78,7 @@ const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, to
78
78
  const { fieldsConfig } = useFields();
79
79
  const { t } = useTranslation();
80
80
  return (jsx("div", { className: 'user-data-fields__fields-column', children: fields === null || fields === void 0 ? void 0 : fields.map(({ name, required, enabled }) => {
81
- const { label, type, key } = getValueByKey(fieldsConfig, name);
81
+ const { label, type, key, autoComplete } = getValueByKey(fieldsConfig, name);
82
82
  if (name === 'tShirtSize') {
83
83
  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]), children: tShirtSizes.map((size) => (jsx("option", { value: size, children: size }, size))) }, name));
84
84
  }
@@ -92,10 +92,10 @@ const UserDataFields = ({ errors, policiesConsentInnerComponentArray, fields, to
92
92
  return (jsx("div", { role: 'group', "aria-labelledby": 'checkbox-group', className: 'user-data-fields__checkbox-container', children: policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.map((component, index) => (jsxs("div", { className: 'user-data-fields__consent-checkbox', children: [jsx(Field, { copykey: key, as: Checkbox, id: `policiesConsent_${index}`, name: 'policiesConsentArray', type: 'checkbox', value: `${index}` }, `policiesConsent_${index}`), jsx("label", { htmlFor: `policiesConsent_${index}`, className: 'user-data-fields__checkbox-label', children: jsx(Typography, { variant: 'body_small', color: 'secondary', children: component }) })] }, `policiesConsent_${index}`))) }, 'policiesConsentGroup'));
93
93
  }
94
94
  else if (name === 'email' && !enabled) {
95
- return (jsx(Tooltip, { content: t('dyn_collect_user_data.update_email_tooltip'), className: 'user-data-fields__tooltip', copykey: 'dyn_collect_user_data.update_email_tooltip', children: jsx(Field, { copykey: key, disabled: true, as: Input, type: type, id: name, name: name, label: label }, name) }, 'disabled-email-tooltip'));
95
+ return (jsx(Tooltip, { content: t('dyn_collect_user_data.update_email_tooltip'), className: 'user-data-fields__tooltip', copykey: 'dyn_collect_user_data.update_email_tooltip', children: jsx(Field, { copykey: key, disabled: true, as: Input, type: type, id: name, name: name, label: label, autoComplete: autoComplete }, name) }, 'disabled-email-tooltip'));
96
96
  }
97
97
  else {
98
- return (jsx(Field, { copykey: key, disabled: !enabled, 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));
98
+ return (jsx(Field, { copykey: key, disabled: !enabled, 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));
99
99
  }
100
100
  }) }));
101
101
  };
@@ -35,6 +35,7 @@ const useFields = () => {
35
35
  validation: yup.string().oneOf(index.countryCodes.map((c) => c.code)),
36
36
  },
37
37
  email: {
38
+ autoComplete: 'email',
38
39
  key: 'dyn_collect_user_data.fields.email.label',
39
40
  label: t('dyn_collect_user_data.fields.email.label'),
40
41
  type: 'email',
@@ -59,6 +60,7 @@ const useFields = () => {
59
60
  validation: yup.string().trim(),
60
61
  },
61
62
  phoneNumber: {
63
+ autoComplete: 'tel',
62
64
  key: 'dyn_collect_user_data.fields.phone_number.label',
63
65
  label: t('dyn_collect_user_data.fields.phone_number.label'),
64
66
  type: 'string',
@@ -13,6 +13,7 @@ export declare const useFields: () => {
13
13
  validation: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
14
  };
15
15
  email: {
16
+ autoComplete: string;
16
17
  key: string;
17
18
  label: string;
18
19
  type: string;
@@ -37,6 +38,7 @@ export declare const useFields: () => {
37
38
  validation: import("yup").StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
38
39
  };
39
40
  phoneNumber: {
41
+ autoComplete: string;
40
42
  key: string;
41
43
  label: string;
42
44
  type: string;
@@ -31,6 +31,7 @@ const useFields = () => {
31
31
  validation: string().oneOf(countryCodes.map((c) => c.code)),
32
32
  },
33
33
  email: {
34
+ autoComplete: 'email',
34
35
  key: 'dyn_collect_user_data.fields.email.label',
35
36
  label: t('dyn_collect_user_data.fields.email.label'),
36
37
  type: 'email',
@@ -55,6 +56,7 @@ const useFields = () => {
55
56
  validation: string().trim(),
56
57
  },
57
58
  phoneNumber: {
59
+ autoComplete: 'tel',
58
60
  key: 'dyn_collect_user_data.fields.phone_number.label',
59
61
  label: t('dyn_collect_user_data.fields.phone_number.label'),
60
62
  type: 'string',
@@ -125,7 +125,7 @@ const EmailUpdate = () => {
125
125
  });
126
126
  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) => {
127
127
  setUpdatedEmail(e.target.value);
128
- }, 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') })] })] }));
128
+ }, 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') })] })] }));
129
129
  };
130
130
 
131
131
  exports.EmailUpdate = EmailUpdate;
@@ -121,7 +121,7 @@ const EmailUpdate = () => {
121
121
  });
122
122
  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) => {
123
123
  setUpdatedEmail(e.target.value);
124
- }, 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') })] })] }));
124
+ }, 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') })] })] }));
125
125
  };
126
126
 
127
127
  export { EmailUpdate };
@@ -158,7 +158,7 @@ const LoginEmailForm = ({ isLoading: isExternalLoading, onSubmit, onSubmitError,
158
158
  }
159
159
  return (jsxRuntime.jsxs("form", { className: 'login-with-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: ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _b === void 0 ? void 0 : _b.emailSubmitButtonInsideInput)
160
160
  ? emailInputSuffixIcon
161
- : null, disabled: isLoading, type: 'email', onPointerEnter: () => dispatchInputState(['hovered', true]), onPointerLeave: () => dispatchInputState(['hovered', false]), onFocus: () => dispatchInputState(['focused', true]), onBlur: () => dispatchInputState(['focused', false]) }), !((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _c === void 0 ? void 0 : _c.emailSubmitButtonInsideInput) && (jsxRuntime.jsx(Button.Button, { dataTestId: 'email_submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: 'dyn_login.email_form.submit_button.label', typographyProps: {
161
+ : null, disabled: isLoading, type: 'email', onPointerEnter: () => dispatchInputState(['hovered', true]), onPointerLeave: () => dispatchInputState(['hovered', false]), onFocus: () => dispatchInputState(['focused', true]), onBlur: () => dispatchInputState(['focused', false]), autoComplete: 'email' }), !((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _c === void 0 ? void 0 : _c.emailSubmitButtonInsideInput) && (jsxRuntime.jsx(Button.Button, { dataTestId: 'email_submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: 'dyn_login.email_form.submit_button.label', typographyProps: {
162
162
  color: 'inherit',
163
163
  }, children: t('dyn_login.email_form.submit_button.label') }))] }));
164
164
  };
@@ -154,7 +154,7 @@ const LoginEmailForm = ({ isLoading: isExternalLoading, onSubmit, onSubmitError,
154
154
  }
155
155
  return (jsxs("form", { className: 'login-with-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: ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _b === void 0 ? void 0 : _b.emailSubmitButtonInsideInput)
156
156
  ? emailInputSuffixIcon
157
- : null, disabled: isLoading, type: 'email', onPointerEnter: () => dispatchInputState(['hovered', true]), onPointerLeave: () => dispatchInputState(['hovered', false]), onFocus: () => dispatchInputState(['focused', true]), onBlur: () => dispatchInputState(['focused', false]) }), !((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _c === void 0 ? void 0 : _c.emailSubmitButtonInsideInput) && (jsx(Button, { dataTestId: 'email_submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: 'dyn_login.email_form.submit_button.label', typographyProps: {
157
+ : null, disabled: isLoading, type: 'email', onPointerEnter: () => dispatchInputState(['hovered', true]), onPointerLeave: () => dispatchInputState(['hovered', false]), onFocus: () => dispatchInputState(['focused', true]), onBlur: () => dispatchInputState(['focused', false]), autoComplete: 'email' }), !((_c = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _c === void 0 ? void 0 : _c.emailSubmitButtonInsideInput) && (jsx(Button, { dataTestId: 'email_submit_button', buttonClassName: 'login-with-email-form__button', type: 'submit', loading: isLoading, disabled: isLoading, buttonVariant: 'brand-primary', buttonPadding: 'login-screen-height', expanded: true, copykey: 'dyn_login.email_form.submit_button.label', typographyProps: {
158
158
  color: 'inherit',
159
159
  }, children: t('dyn_login.email_form.submit_button.label') }))] }));
160
160
  };