@web3auth/modal 11.0.0-beta.0 → 11.0.0-beta.1

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 (118) hide show
  1. package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
  2. package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
  3. package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
  4. package/dist/lib.cjs/packages/modal/src/config.js +1 -1
  5. package/dist/lib.cjs/packages/modal/src/modalManager.js +446 -26
  6. package/dist/lib.cjs/packages/modal/src/react/index.js +7 -3
  7. package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +27 -12
  8. package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
  9. package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
  10. package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
  11. package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
  12. package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +4 -4
  13. package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +28 -28
  14. package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
  15. package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +19 -19
  16. package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
  17. package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
  18. package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
  19. package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
  20. package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +11 -11
  21. package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
  22. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
  23. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
  24. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
  25. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
  26. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
  27. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
  28. package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
  29. package/dist/lib.cjs/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
  30. package/dist/lib.cjs/packages/modal/src/ui/containers/Login/Login.js +45 -41
  31. package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
  32. package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
  33. package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +24 -9
  34. package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
  35. package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
  36. package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +1 -0
  37. package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
  38. package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
  39. package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
  40. package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
  41. package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
  42. package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
  43. package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
  44. package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
  45. package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
  46. package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
  47. package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
  48. package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +26 -0
  49. package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +113 -4
  50. package/dist/lib.cjs/packages/modal/src/vue/index.js +7 -3
  51. package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +27 -14
  52. package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
  53. package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
  54. package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
  55. package/dist/lib.cjs/types/modalManager.d.ts +40 -2
  56. package/dist/lib.cjs/types/react/hooks/index.d.ts +1 -0
  57. package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
  58. package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
  59. package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
  60. package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
  61. package/dist/lib.cjs/types/ui/containers/Root/Root.d.ts +1 -1
  62. package/dist/lib.cjs/types/ui/interfaces.d.ts +43 -8
  63. package/dist/lib.cjs/types/ui/loginModal.d.ts +27 -2
  64. package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
  65. package/dist/lib.cjs/types/vue/composables/index.d.ts +1 -0
  66. package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
  67. package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
  68. package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
  69. package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
  70. package/dist/lib.esm/packages/modal/src/config.js +1 -1
  71. package/dist/lib.esm/packages/modal/src/modalManager.js +451 -28
  72. package/dist/lib.esm/packages/modal/src/react/index.js +1 -1
  73. package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +28 -13
  74. package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
  75. package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
  76. package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
  77. package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
  78. package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +4 -4
  79. package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +28 -28
  80. package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
  81. package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +19 -19
  82. package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
  83. package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
  84. package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
  85. package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
  86. package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +11 -11
  87. package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
  88. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
  89. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
  90. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
  91. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
  92. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
  93. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
  94. package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
  95. package/dist/lib.esm/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
  96. package/dist/lib.esm/packages/modal/src/ui/containers/Login/Login.js +46 -42
  97. package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
  98. package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
  99. package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +24 -9
  100. package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
  101. package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
  102. package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +2 -1
  103. package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
  104. package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
  105. package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
  106. package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
  107. package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
  108. package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
  109. package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
  110. package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
  111. package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
  112. package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
  113. package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
  114. package/dist/lib.esm/packages/modal/src/ui/interfaces.js +24 -1
  115. package/dist/lib.esm/packages/modal/src/ui/loginModal.js +115 -6
  116. package/dist/lib.esm/packages/modal/src/vue/index.js +1 -1
  117. package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +28 -15
  118. package/package.json +42 -19
@@ -49,12 +49,12 @@ function ConnectWalletQrCode(props) {
49
49
  const modalColor = ((_getComputedStyle = getComputedStyle(root)) === null || _getComputedStyle === void 0 || (_getComputedStyle = _getComputedStyle.getPropertyValue("--app-gray-800")) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.trim()) || "#1f2a37";
50
50
  const qrColor = primaryColor && primaryColor.toLowerCase() === "#ffffff" ? "#000000" : primaryColor;
51
51
  return /*#__PURE__*/jsxs("div", {
52
- className: "w3a--contents",
52
+ className: "wta:contents",
53
53
  children: [qrCodeValue ? /*#__PURE__*/jsxs("div", {
54
- className: "w3a--flex w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4 w3a--rounded-2xl w3a--border w3a--border-app-gray-200 w3a--p-4 dark:w3a--border-app-gray-700",
54
+ className: "wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-4 wta:rounded-2xl wta:border wta:border-app-gray-200 wta:p-4 wta:dark:border-app-gray-700",
55
55
  children: [/*#__PURE__*/jsx("button", {
56
56
  type: "button",
57
- className: "w3a--relative w3a--flex w3a--size-[300px] w3a--appearance-none w3a--items-center w3a--justify-center w3a--rounded-2xl",
57
+ className: "wta:relative wta:flex wta:size-[300px] wta:appearance-none wta:items-center wta:justify-center wta:rounded-2xl",
58
58
  onClick: () => {
59
59
  navigator.clipboard.writeText(qrCodeValue);
60
60
  setToast({
@@ -77,11 +77,11 @@ function ConnectWalletQrCode(props) {
77
77
  fgColor: isDark ? whiteColor : blackColor
78
78
  })
79
79
  }), /*#__PURE__*/jsx("p", {
80
- className: "w3a--text-center w3a--text-sm w3a--font-normal w3a--text-app-gray-500 dark:w3a--text-app-gray-300",
80
+ className: "wta:text-center wta:text-sm wta:font-normal wta:text-app-gray-500 wta:dark:text-app-gray-300",
81
81
  children: t("modal.external.walletconnect-copy")
82
82
  })]
83
83
  }) : /*#__PURE__*/jsx("div", {
84
- className: "w3a--mx-auto w3a--flex w3a--size-[300px] w3a--animate-pulse w3a--items-center w3a--justify-center w3a--rounded-lg w3a--bg-app-gray-200 w3a--p-2 dark:w3a--bg-app-gray-700",
84
+ className: "wta:mx-auto wta:flex wta:size-[300px] wta:animate-pulse wta:items-center wta:justify-center wta:rounded-lg wta:bg-app-gray-200 wta:p-2 wta:dark:bg-app-gray-700",
85
85
  children: /*#__PURE__*/jsx(Image, {
86
86
  imageId: `login-${selectedButton.name}`,
87
87
  hoverImageId: `login-${selectedButton.name}`,
@@ -92,15 +92,15 @@ function ConnectWalletQrCode(props) {
92
92
  extension: selectedButton.imgExtension
93
93
  })
94
94
  }), showGetWalletComponent && /*#__PURE__*/jsxs("div", {
95
- className: "w3a--flex w3a--w-full w3a--items-center w3a--justify-between w3a--rounded-2xl w3a--bg-app-gray-50 w3a--px-4 w3a--py-2 w3a--text-app-gray-900 dark:w3a--bg-app-gray-800 dark:w3a--text-app-white",
95
+ className: "wta:flex wta:w-full wta:items-center wta:justify-between wta:rounded-2xl wta:bg-app-gray-50 wta:px-4 wta:py-2 wta:text-app-gray-900 wta:dark:bg-app-gray-800 wta:dark:text-app-white",
96
96
  children: [/*#__PURE__*/jsxs("p", {
97
- className: "w3a--text-sm w3a--text-app-gray-900 dark:w3a--text-app-white",
97
+ className: "wta:text-sm wta:text-app-gray-900 wta:dark:text-app-white",
98
98
  children: [t("modal.external.dont-have"), " ", /*#__PURE__*/jsx("span", {
99
99
  children: selectedButton === null || selectedButton === void 0 ? void 0 : selectedButton.displayName
100
100
  }), "?"]
101
101
  }), /*#__PURE__*/jsx("button", {
102
102
  type: "button",
103
- className: "w3a--appearance-none w3a--rounded-full w3a--border w3a--border-app-gray-200 w3a--bg-transparent w3a--px-5 w3a--py-2 w3a--text-base w3a--font-normal w3a--text-app-gray-700 w3a--transition-all w3a--duration-150 hover:w3a--border-transparent hover:w3a--shadow-light active:w3a--scale-95 dark:w3a--border-app-gray-700 dark:w3a--text-app-gray-300 dark:hover:w3a--border-transparent dark:hover:w3a--shadow-dark",
103
+ className: "wta:appearance-none wta:rounded-full wta:border wta:border-app-gray-200 wta:bg-transparent wta:px-5 wta:py-2 wta:text-base wta:font-normal wta:text-app-gray-700 wta:transition-all wta:duration-150 wta:hover:border-transparent wta:hover:shadow-light wta:active:scale-95 wta:dark:border-app-gray-700 wta:dark:text-app-gray-300 wta:dark:hover:border-transparent wta:dark:hover:shadow-dark",
104
104
  onClick: () => {
105
105
  setBodyState(_objectSpread(_objectSpread({}, bodyState), {}, {
106
106
  installLinks: {
@@ -30,7 +30,7 @@ function ConnectWalletSearch(props) {
30
30
  // const isShowSearch = totalExternalWalletCount > 15 && !isLoading;
31
31
 
32
32
  // if (!isShowSearch) {
33
- // return <div className="w3a--h-[50px] w3a--w-full w3a--animate-pulse w3a--rounded-full w3a--bg-app-gray-200 dark:w3a--bg-app-gray-700" />;
33
+ // return <div className="wta:h-[50px] wta:w-full wta:animate-pulse wta:rounded-full wta:bg-app-gray-200 wta:dark:bg-app-gray-700" />;
34
34
  // }
35
35
 
36
36
  return /*#__PURE__*/jsx("input", {
@@ -51,10 +51,10 @@ function ConnectWalletSearch(props) {
51
51
  count: totalExternalWalletCount
52
52
  }),
53
53
  disabled: isLoading,
54
- className: cn("w3a--input w3a--appearance-none w3a--outline-none active:w3a--outline-none focus:w3a--outline-none w3a--bg-transparent placeholder:w3a--text-app-gray-400 dark:placeholder:w3a--text-app-gray-500 w3a--text-app-gray-900 dark:w3a--text-app-white", isInputFocused && "!w3a--border-app-primary-600", {
55
- "w3a--rounded-full": buttonRadius === "pill",
56
- "w3a--rounded-lg": buttonRadius === "rounded",
57
- "w3a--rounded-none": buttonRadius === "square"
54
+ className: cn("w3a--input wta:appearance-none wta:outline-none wta:active:outline-none wta:focus:outline-none wta:bg-transparent wta:placeholder:text-app-gray-400 wta:dark:placeholder:text-app-gray-500 wta:text-app-gray-900 wta:dark:text-app-white", isInputFocused && "wta:border-app-primary-600!", {
55
+ "wta:rounded-full": buttonRadius === "pill",
56
+ "wta:rounded-lg": buttonRadius === "rounded",
57
+ "wta:rounded-none": buttonRadius === "square"
58
58
  })
59
59
  });
60
60
  }
@@ -35,18 +35,18 @@ function Embed(props) {
35
35
  };
36
36
  if (!isOpen) return null;
37
37
  return /*#__PURE__*/jsxs("div", {
38
- className: cn("w3a--bg-app-light-surface1 dark:w3a--bg-app-dark-surface-main w3a--rounded-3xl w3a--w-[356px] [@media(min-width:375px)]:w3a--w-[393px] w3a--h-auto w3a--flex w3a--flex-col w3a--duration-500", {
39
- "w3a--translate-y-0 w3a--delay-100": isOpen,
40
- "w3a--translate-y-[100vh]": !isOpen,
41
- "w3a--p-4": padding,
42
- "w3a--shadow-xl sm:w3a--shadow-lg": shadow,
43
- "w3a--border w3a--border-app-gray-100 dark:w3a--border-app-gray-800": border,
44
- "w3a--rounded-[30px]": borderRadius === "large",
45
- "w3a--rounded-2xl": borderRadius === "medium",
46
- "w3a--rounded-none": borderRadius === "small"
38
+ className: cn("wta:bg-app-light-surface1 wta:dark:bg-app-dark-surface-main wta:rounded-3xl wta:w-[356px] wta:[@media(min-width:375px)]:w-[393px] wta:h-auto wta:flex wta:flex-col wta:duration-500", {
39
+ "wta:translate-y-0 wta:delay-100": isOpen,
40
+ "wta:translate-y-[100vh]": !isOpen,
41
+ "wta:p-4": padding,
42
+ "wta:shadow-xl wta:sm:shadow-lg": shadow,
43
+ "wta:border wta:border-app-gray-100 wta:dark:border-app-gray-800": border,
44
+ "wta:rounded-[30px]": borderRadius === "large",
45
+ "wta:rounded-2xl": borderRadius === "medium",
46
+ "wta:rounded-none": borderRadius === "small"
47
47
  }),
48
48
  children: [showCloseIcon && /*#__PURE__*/jsx("div", {
49
- className: "w3a--absolute w3a--right-6 w3a--top-[30px] w3a--z-10 w3a--cursor-pointer",
49
+ className: "wta:absolute wta:right-6 wta:top-[30px] wta:z-10 wta:cursor-pointer",
50
50
  children: /*#__PURE__*/jsx("svg", {
51
51
  width: "13",
52
52
  height: "13",
@@ -54,7 +54,7 @@ function Embed(props) {
54
54
  fill: "none",
55
55
  xmlns: "http://www.w3.org/2000/svg",
56
56
  onClick: onCloseHandler,
57
- className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
57
+ className: "wta:text-app-gray-900 wta:dark:text-app-white",
58
58
  children: /*#__PURE__*/jsx("path", {
59
59
  fillRule: "evenodd",
60
60
  clipRule: "evenodd",
@@ -2,7 +2,7 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import HCaptcha from '@hcaptcha/react-hcaptcha';
3
3
  import { AUTH_CONNECTION } from '@web3auth/auth';
4
4
  import { WALLET_CONNECTORS, ANALYTICS_EVENTS, log, WalletLoginError } from '@web3auth/no-modal';
5
- import { useContext, useState, useRef, useEffect, useMemo, useCallback } from 'react';
5
+ import { useContext, useState, useRef, useMemo, useEffect, useCallback } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import Image from '../../components/Image/Image.js';
8
8
  import SocialLoginList from '../../components/SocialLoginList/SocialLoginList.js';
@@ -74,10 +74,6 @@ function Login(props) {
74
74
  const [passwordlessErrorMessage, setPasswordlessErrorMessage] = useState("");
75
75
  const [otpErrorMessage, setOtpErrorMessage] = useState("");
76
76
  const [expandSocialLogins, setExpandSocialLogins] = useState(false);
77
- const [canShowMore, setCanShowMore] = useState(false);
78
- const [visibleRow, setVisibleRow] = useState([]);
79
- const [otherRow, setOtherRow] = useState([]);
80
- const [mainOptionsRow, setMainOptionsRow] = useState([]);
81
77
  const [isPasswordLessCtaClicked, setIsPasswordLessCtaClicked] = useState(false);
82
78
  const [showOtpFlow, setShowOtpFlow] = useState(false);
83
79
  const [authConnection, setAuthConnection] = useState(undefined);
@@ -91,7 +87,12 @@ function Login(props) {
91
87
  setExpandSocialLogins(prev => !prev);
92
88
  setIsPasswordLessCtaClicked(false);
93
89
  };
94
- useEffect(() => {
90
+ const {
91
+ visibleRow,
92
+ otherRow,
93
+ mainOptionsRow,
94
+ canShowMore
95
+ } = useMemo(() => {
95
96
  const maxOptions = Object.keys(socialLoginsConfig.loginMethods).filter(loginMethodKey => {
96
97
  return socialLoginsConfig.loginMethods[loginMethodKey].showOnModal && !restrictedLoginMethods.includes(loginMethodKey);
97
98
  });
@@ -161,11 +162,13 @@ function Login(props) {
161
162
  }
162
163
  otherRows.push(rows);
163
164
  });
164
- setVisibleRow(visibleRows);
165
- setOtherRow(otherRows);
166
- setMainOptionsRow(mainOptionsRows);
167
- setCanShowMore(maxOptions.length > 4); // Update the state based on the condition
168
- }, [socialLoginsConfig, isDark, buttonRadius]);
165
+ return {
166
+ visibleRow: visibleRows,
167
+ otherRow: otherRows,
168
+ mainOptionsRow: mainOptionsRows,
169
+ canShowMore: maxOptions.length > 4
170
+ };
171
+ }, [socialLoginsConfig, isDark]);
169
172
  const handleCustomLogin = async (authConnection, loginHint) => {
170
173
  try {
171
174
  const handler = createPasswordlessHandler(authConnection, {
@@ -248,7 +251,7 @@ function Login(props) {
248
251
  }
249
252
  }
250
253
  }
251
- setPasswordlessErrorMessage(invalidInputErrorMessage);
254
+ setPasswordlessErrorMessage(getInvalidInputErrorMessage());
252
255
  setIsPasswordLessLoading(false);
253
256
  return undefined;
254
257
  };
@@ -262,11 +265,11 @@ function Login(props) {
262
265
  if (isEmailPasswordLessLoginVisible) return "name@example.com";
263
266
  return "+(00)123456";
264
267
  }, [isEmailPasswordLessLoginVisible, isSmsPasswordLessLoginVisible]);
265
- const invalidInputErrorMessage = useMemo(() => {
268
+ const getInvalidInputErrorMessage = () => {
266
269
  if (isEmailPasswordLessLoginVisible && isSmsPasswordLessLoginVisible) return t("modal.errors-invalid-number-email");
267
270
  if (isEmailPasswordLessLoginVisible) return t("modal.errors-invalid-email");
268
271
  return t("modal.errors-invalid-number");
269
- }, [isEmailPasswordLessLoginVisible, isSmsPasswordLessLoginVisible, t]);
272
+ };
270
273
  useEffect(() => {
271
274
  const getLocation = async () => {
272
275
  const result = await getUserCountry();
@@ -379,6 +382,7 @@ function Login(props) {
379
382
  }, [analytics, handleExternalWalletBtnClick, installedExternalWallets.length, totalExternalWallets]);
380
383
  useEffect(() => {
381
384
  if (showExternalWalletButton && !areSocialLoginsVisible && !showPasswordLessInput) {
385
+ // eslint-disable-next-line react-hooks/set-state-in-effect -- intentional
382
386
  handleConnectWallet();
383
387
  }
384
388
  }, [showExternalWalletButton, areSocialLoginsVisible, showPasswordLessInput, handleConnectWallet]);
@@ -422,25 +426,25 @@ function Login(props) {
422
426
  };
423
427
  const externalWalletSection = () => {
424
428
  return /*#__PURE__*/jsxs("div", {
425
- className: cn("w3a--flex w3a--w-full w3a--flex-col w3a--items-start w3a--justify-start w3a--gap-y-2"),
429
+ className: cn("wta:flex wta:w-full wta:flex-col wta:items-start wta:justify-start wta:gap-y-2"),
426
430
  children: [installedExternalWallets.length > 0 && installedExternalWallets.map(wallet => /*#__PURE__*/jsxs("button", {
427
431
  type: "button",
428
- className: cn("w3a--btn !w3a--justify-between w3a--group w3a--relative w3a--overflow-hidden", {
429
- "w3a--rounded-full": buttonRadius === "pill",
430
- "w3a--rounded-lg": buttonRadius === "rounded",
431
- "w3a--rounded-none": buttonRadius === "square"
432
+ className: cn("w3a--btn wta:justify-between! wta:group wta:relative wta:overflow-hidden", {
433
+ "wta:rounded-full": buttonRadius === "pill",
434
+ "wta:rounded-lg": buttonRadius === "rounded",
435
+ "wta:rounded-none": buttonRadius === "square"
432
436
  }),
433
437
  onClick: () => handleInstalledWalletClick(wallet),
434
438
  children: [/*#__PURE__*/jsx("p", {
435
- className: "w3a--max-w-[180px] w3a--truncate w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
439
+ className: "wta:max-w-[180px] wta:truncate wta:text-base wta:font-normal wta:text-app-gray-700 wta:dark:text-app-white",
436
440
  children: wallet.displayName
437
441
  }), /*#__PURE__*/jsxs("div", {
438
- className: "w3a--absolute w3a--right-4 w3a--top-1/2 w3a--flex w3a--w-auto -w3a--translate-y-1/2 w3a--items-center w3a--gap-x-2 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-6 group-hover:w3a--opacity-0",
442
+ className: "wta:absolute wta:right-4 wta:top-1/2 wta:flex wta:w-auto wta:-translate-y-1/2 wta:items-center wta:gap-x-2 wta:transition-all wta:duration-300 wta:group-hover:translate-x-6 wta:group-hover:opacity-0",
439
443
  children: [wallet.hasInjectedWallet && /*#__PURE__*/jsx("span", {
440
- className: "w3a--inline-flex w3a--items-center w3a--rounded-md w3a--bg-app-primary-100 w3a--px-2 w3a--py-1 w3a--text-xs w3a--font-medium w3a--text-app-primary-800 dark:w3a--border dark:w3a--border-app-primary-400 dark:w3a--bg-transparent dark:w3a--text-app-primary-400",
444
+ className: "wta:inline-flex wta:items-center wta:rounded-md wta:bg-app-primary-100 wta:px-2 wta:py-1 wta:text-xs wta:font-medium wta:text-app-primary-800 wta:dark:border wta:dark:border-app-primary-400 wta:dark:bg-transparent wta:dark:text-app-primary-400",
441
445
  children: t("modal.external.installed")
442
446
  }), /*#__PURE__*/jsx("figure", {
443
- className: "w3a--size-5",
447
+ className: "wta:size-5",
444
448
  children: /*#__PURE__*/jsx(Image, {
445
449
  imageData: wallet.icon,
446
450
  imageId: `login-${wallet.name}`,
@@ -454,28 +458,28 @@ function Login(props) {
454
458
  })]
455
459
  }), /*#__PURE__*/jsx("img", {
456
460
  id: "injected-wallet-arrow",
457
- className: "w3a--absolute w3a--right-4 w3a--top-1/2 -w3a--translate-x-10 -w3a--translate-y-1/2 w3a--opacity-0 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
461
+ className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-10 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300 wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
458
462
  src: getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
459
463
  alt: "arrow"
460
464
  })]
461
465
  }, wallet.name)), remainingUndisplayedWallets > 0 && /*#__PURE__*/jsxs("button", {
462
466
  type: "button",
463
- className: cn("w3a--btn !w3a--justify-between w3a--group w3a--relative w3a--overflow-hidden", {
464
- "w3a--rounded-full": buttonRadius === "pill",
465
- "w3a--rounded-lg": buttonRadius === "rounded",
466
- "w3a--rounded-none": buttonRadius === "square"
467
+ className: cn("w3a--btn wta:justify-between! wta:group wta:relative wta:overflow-hidden", {
468
+ "wta:rounded-full": buttonRadius === "pill",
469
+ "wta:rounded-lg": buttonRadius === "rounded",
470
+ "wta:rounded-none": buttonRadius === "square"
467
471
  }),
468
472
  onClick: handleConnectWallet,
469
473
  children: [/*#__PURE__*/jsx("p", {
470
- className: "w3a--text-base w3a--font-normal w3a--text-app-gray-900 dark:w3a--text-app-white",
474
+ className: "wta:text-base wta:font-normal wta:text-app-gray-900 wta:dark:text-app-white",
471
475
  children: t("modal.external.all-wallets")
472
476
  }), showExternalWalletCount && /*#__PURE__*/jsx("div", {
473
477
  id: "external-wallet-count",
474
- className: "w3a--absolute w3a--right-4 w3a--top-1/2 w3a--w-auto -w3a--translate-y-1/2 w3a--rounded-full w3a--bg-app-primary-100 w3a--px-2.5 w3a--py-0.5 w3a--text-xs w3a--font-medium w3a--text-app-primary-800 w3a--transition-all w3a--delay-300 w3a--duration-300 group-hover:w3a--translate-x-6 group-hover:w3a--opacity-0 group-hover:w3a--delay-0 dark:w3a--border dark:w3a--border-app-primary-500 dark:w3a--bg-transparent dark:w3a--text-app-primary-500",
478
+ className: "wta:absolute wta:right-4 wta:top-1/2 wta:w-auto wta:-translate-y-1/2 wta:rounded-full wta:bg-app-primary-100 wta:px-2.5 wta:py-0.5 wta:text-xs wta:font-medium wta:text-app-primary-800 wta:transition-all wta:delay-300 wta:duration-300 wta:group-hover:translate-x-6 wta:group-hover:opacity-0 wta:group-hover:delay-0 wta:dark:border wta:dark:border-app-primary-500 wta:dark:bg-transparent wta:dark:text-app-primary-500",
475
479
  children: remainingUndisplayedWallets
476
480
  }), /*#__PURE__*/jsx("img", {
477
481
  id: "external-wallet-arrow",
478
- className: "w3a--absolute w3a--right-4 w3a--top-1/2 -w3a--translate-x-10 -w3a--translate-y-1/2 w3a--opacity-0 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
482
+ className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-10 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300 wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
479
483
  src: getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
480
484
  alt: "arrow"
481
485
  })]
@@ -485,14 +489,14 @@ function Login(props) {
485
489
  const headerLogo = [DEFAULT_LOGO_DARK, DEFAULT_LOGO_LIGHT].includes(appLogo) ? "" : appLogo;
486
490
  const delimiter = index => {
487
491
  return /*#__PURE__*/jsxs("div", {
488
- className: cn("w3a--flex w3a--w-full w3a--items-center w3a--gap-x-2", headerLogo ? "w3a--my-2" : "w3a--my-4"),
492
+ className: cn("wta:flex wta:w-full wta:items-center wta:gap-x-2", headerLogo ? "wta:my-2" : "wta:my-4"),
489
493
  children: [/*#__PURE__*/jsx("div", {
490
- className: "w3a--h-px w3a--w-full w3a--bg-app-gray-200 dark:w3a--bg-app-gray-500"
494
+ className: "wta:h-px wta:w-full wta:bg-app-gray-200 wta:dark:bg-app-gray-500"
491
495
  }), /*#__PURE__*/jsx("p", {
492
- className: "w3a--text-xs w3a--font-normal w3a--uppercase w3a--text-app-gray-400 dark:w3a--text-app-gray-400",
496
+ className: "wta:text-xs wta:font-normal wta:uppercase wta:text-app-gray-400 wta:dark:text-app-gray-400",
493
497
  children: "or"
494
498
  }), /*#__PURE__*/jsx("div", {
495
- className: "w3a--h-px w3a--w-full w3a--bg-app-gray-200 dark:w3a--bg-app-gray-500"
499
+ className: "wta:h-px wta:w-full wta:bg-app-gray-200 wta:dark:bg-app-gray-500"
496
500
  })]
497
501
  }, `section-delimiter-${index}`);
498
502
  };
@@ -542,18 +546,18 @@ function Login(props) {
542
546
  };
543
547
  const socialLoginExpandedView = () => socialLoginSection(otherRow);
544
548
  return /*#__PURE__*/jsxs("div", {
545
- className: "w3a--flex w3a--flex-col w3a--items-center w3a--gap-y-4 w3a--p-2",
549
+ className: "wta:flex wta:flex-col wta:items-center wta:gap-y-4 wta:p-2",
546
550
  children: [/*#__PURE__*/jsxs("div", {
547
- className: cn("w3a--flex w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-2 w3a--pt-6", logoAlignment === "center" ? "" : "w3a--w-full"),
551
+ className: cn("wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-2 wta:pt-6", logoAlignment === "center" ? "" : "wta:w-full"),
548
552
  children: [headerLogo && /*#__PURE__*/jsx("figure", {
549
- className: cn("w3a--mx-auto w3a--h-12 w3a--w-[200px]", logoAlignment === "center" ? "w3a--flex w3a--justify-center w3a--items-center" : "w3a--ml-0 w3a--w-auto"),
553
+ className: cn("wta:mx-auto wta:h-12 wta:w-[200px]", logoAlignment === "center" ? "wta:flex wta:justify-center wta:items-center" : "wta:ml-0 wta:w-auto"),
550
554
  children: /*#__PURE__*/jsx("img", {
551
555
  src: headerLogo,
552
556
  alt: "Logo",
553
- className: "w3a--size-full w3a--object-contain"
557
+ className: "wta:size-full wta:object-contain"
554
558
  })
555
559
  }), /*#__PURE__*/jsx("p", {
556
- className: cn("w3a--text-app-gray-900 dark:w3a--text-app-white", logoAlignment === "center" ? "w3a--text-center" : "w3a--text-left w3a--w-full w3a--ml-4", headerLogo ? "w3a--text-lg w3a--font-semibold" : "w3a--text-3xl w3a--font-medium"),
560
+ className: cn("wta:text-app-gray-900 wta:dark:text-app-white", logoAlignment === "center" ? "wta:text-center" : "wta:text-left wta:w-full wta:ml-4", headerLogo ? "wta:text-lg wta:font-semibold" : "wta:text-3xl wta:font-medium"),
557
561
  children: t("modal.social.sign-in")
558
562
  })]
559
563
  }), /*#__PURE__*/jsx(HCaptcha, {
@@ -567,10 +571,10 @@ function Login(props) {
567
571
  onError: () => setCaptchaError("passwordless.captcha-default-error"),
568
572
  onChalExpired: () => setCaptchaError("passwordless.captcha-default-error")
569
573
  }), captchaError && showCaptcha && /*#__PURE__*/jsx("p", {
570
- className: "-w3a--mt-2 w3a--w-full w3a--pl-6 w3a--text-start w3a--text-xs w3a--font-normal w3a--text-app-red-500 dark:w3a--text-app-red-400",
574
+ className: "wta:-mt-2 wta:w-full wta:pl-6 wta:text-start wta:text-xs wta:font-normal wta:text-app-red-500 wta:dark:text-app-red-400",
571
575
  children: t(captchaError)
572
576
  }), !showCaptcha && /*#__PURE__*/jsxs("div", {
573
- className: "w3a--flex w3a--w-full w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-2",
577
+ className: "wta:flex wta:w-full wta:flex-col wta:items-center wta:justify-center wta:gap-y-2",
574
578
  children: [!expandSocialLogins && defaultView(), expandSocialLogins && socialLoginExpandedView()]
575
579
  })]
576
580
  });
@@ -33,16 +33,16 @@ function OtpInput(props) {
33
33
  }, [loginHint, authConnection, countryFlag]);
34
34
  return /*#__PURE__*/jsxs(Fragment, {
35
35
  children: [/*#__PURE__*/jsx("div", {
36
- className: "w3a--mr-auto w3a--flex w3a--w-full w3a--items-start w3a--justify-start",
36
+ className: "wta:mr-auto wta:flex wta:w-full wta:items-start wta:justify-start",
37
37
  children: /*#__PURE__*/jsx("button", {
38
38
  type: "button",
39
- className: "w3a--z-20 w3a--flex w3a--size-5 w3a--cursor-pointer w3a--items-center w3a--justify-center w3a--rounded-full",
39
+ className: "wta:z-20 wta:flex wta:size-5 wta:cursor-pointer wta:items-center wta:justify-center wta:rounded-full",
40
40
  onClick: () => setShowOtpFlow(false),
41
41
  children: /*#__PURE__*/jsx("svg", {
42
42
  xmlns: "http://www.w3.org/2000/svg",
43
43
  fill: "none",
44
44
  viewBox: "0 0 20 20",
45
- className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
45
+ className: "wta:text-app-gray-900 wta:dark:text-app-white",
46
46
  children: /*#__PURE__*/jsx("path", {
47
47
  fill: "currentColor",
48
48
  fillRule: "evenodd",
@@ -52,23 +52,23 @@ function OtpInput(props) {
52
52
  })
53
53
  })
54
54
  }), /*#__PURE__*/jsxs("div", {
55
- className: "-w3a--mt-10 w3a--flex w3a--size-full w3a--flex-1 w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4",
55
+ className: "wta:-mt-10 wta:flex wta:size-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4",
56
56
  children: [/*#__PURE__*/jsx("img", {
57
57
  src: getIcons(isMobileOtp ? "sms-otp-light" : "email-otp-light"),
58
58
  alt: "otp",
59
- className: "w3a--size-auto"
59
+ className: "wta:size-auto"
60
60
  }), /*#__PURE__*/jsxs("div", {
61
- className: "w3a--mx-auto -w3a--mt-6 w3a--flex w3a--w-full w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-2",
61
+ className: "wta:mx-auto wta:-mt-6 wta:flex wta:w-full wta:flex-col wta:items-center wta:justify-center wta:gap-y-2",
62
62
  children: [/*#__PURE__*/jsx("p", {
63
- className: "w3a--text-lg w3a--font-bold w3a--text-app-gray-900 dark:w3a--text-app-white",
63
+ className: "wta:text-lg wta:font-bold wta:text-app-gray-900 wta:dark:text-app-white",
64
64
  children: isMobileOtp ? t("modal.otp.mobile-title") : t("modal.otp.email-title")
65
65
  }), /*#__PURE__*/jsxs("div", {
66
- className: "w3a--mx-auto w3a--flex w3a--w-full w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-1",
66
+ className: "wta:mx-auto wta:flex wta:w-full wta:flex-col wta:items-center wta:justify-center wta:gap-y-1",
67
67
  children: [/*#__PURE__*/jsx("p", {
68
- className: "w3a--text-center w3a--text-sm w3a--font-normal w3a--text-app-gray-500 dark:w3a--text-app-gray-300",
68
+ className: "wta:text-center wta:text-sm wta:font-normal wta:text-app-gray-500 wta:dark:text-app-gray-300",
69
69
  children: isMobileOtp ? t("modal.otp.mobile-subtext") : t("modal.otp.email-subtext")
70
70
  }), /*#__PURE__*/jsx("p", {
71
- className: "w3a--text-center w3a--text-sm w3a--font-normal w3a--text-app-gray-500 dark:w3a--text-app-gray-300",
71
+ className: "wta:text-center wta:text-sm wta:font-normal wta:text-app-gray-500 wta:dark:text-app-gray-300",
72
72
  children: isMobileOtp ? parsedLoginHint : t("modal.otp.email-subtext-example", {
73
73
  email: parsedLoginHint
74
74
  })
@@ -102,7 +102,7 @@ function LoginOtp(props) {
102
102
  countryFlag
103
103
  } = props;
104
104
  return /*#__PURE__*/jsx("div", {
105
- className: "w3a--flex w3a--size-full w3a--flex-1 w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4",
105
+ className: "wta:flex wta:size-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4",
106
106
  children: /*#__PURE__*/jsx(OtpInput, {
107
107
  errorMessage: errorMessage,
108
108
  setShowOtpFlow: setShowOtpFlow,
@@ -57,22 +57,22 @@ function LoginPasswordLess(props) {
57
57
  if (!isPasswordLessCtaClicked) {
58
58
  return /*#__PURE__*/jsxs("button", {
59
59
  type: "button",
60
- className: cn("w3a--btn !w3a--justify-between w3a--relative w3a--group w3a--overflow-hidden", {
61
- "w3a--rounded-full": buttonRadius === "pill",
62
- "w3a--rounded-lg": buttonRadius === "rounded",
63
- "w3a--rounded-none": buttonRadius === "square"
60
+ className: cn("w3a--btn wta:justify-between! wta:relative wta:group wta:overflow-hidden", {
61
+ "wta:rounded-full": buttonRadius === "pill",
62
+ "wta:rounded-lg": buttonRadius === "rounded",
63
+ "wta:rounded-none": buttonRadius === "square"
64
64
  }),
65
65
  onClick: () => {
66
66
  setIsPasswordLessCtaClicked(true);
67
67
  },
68
68
  children: [/*#__PURE__*/jsx("p", {
69
- className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
69
+ className: "wta:text-app-gray-900 wta:dark:text-app-white",
70
70
  children: t("modal.passwordless.title", {
71
71
  title
72
72
  })
73
73
  }), /*#__PURE__*/jsx("img", {
74
74
  id: "passwordless-arrow",
75
- className: "w3a--absolute w3a--right-4 w3a--top-1/2 -w3a--translate-x-6 -w3a--translate-y-1/2 w3a--opacity-0 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
75
+ className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-6 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300 wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
76
76
  src: getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
77
77
  alt: "arrow"
78
78
  })]
@@ -80,10 +80,10 @@ function LoginPasswordLess(props) {
80
80
  }
81
81
  return /*#__PURE__*/jsxs(Fragment, {
82
82
  children: [/*#__PURE__*/jsxs("div", {
83
- className: cn("w3a--input", isInputFocused && "!w3a--border-app-primary-600", {
84
- "w3a--rounded-full": buttonRadius === "pill",
85
- "w3a--rounded-lg": buttonRadius === "rounded",
86
- "w3a--rounded-none": buttonRadius === "square"
83
+ className: cn("w3a--input", isInputFocused && "wta:border-app-primary-600!", {
84
+ "wta:rounded-full": buttonRadius === "pill",
85
+ "wta:rounded-lg": buttonRadius === "rounded",
86
+ "wta:rounded-none": buttonRadius === "square"
87
87
  }),
88
88
  children: [/*#__PURE__*/jsx("input", {
89
89
  ref: inputRef,
@@ -98,12 +98,12 @@ function LoginPasswordLess(props) {
98
98
  setIsInputFocused(false);
99
99
  },
100
100
  type: "text",
101
- className: cn("w3a--w-full w3a--appearance-none w3a--bg-transparent w3a--text-app-gray-900 w3a--outline-none placeholder:w3a--text-xs placeholder:w3a--text-app-gray-400 focus:w3a--outline-none active:w3a--outline-none dark:w3a--text-app-white dark:placeholder:w3a--text-app-gray-500"),
101
+ className: cn("wta:w-full wta:appearance-none wta:bg-transparent wta:text-app-gray-900 wta:outline-none wta:placeholder:text-xs wta:placeholder:text-app-gray-400 wta:focus:outline-none wta:active:outline-none wta:dark:text-app-white wta:dark:placeholder:text-app-gray-500"),
102
102
  onKeyDown: e => handleEnter(e),
103
103
  disabled: isPasswordLessLoading
104
104
  }), isPasswordLessLoading && /*#__PURE__*/jsx(PulseLoader, {}), inputValue && !isPasswordLessLoading && /*#__PURE__*/jsx("button", {
105
105
  type: "button",
106
- className: "w3a--appearance-none",
106
+ className: "wta:appearance-none",
107
107
  onClick: onFormSubmit,
108
108
  children: /*#__PURE__*/jsx("img", {
109
109
  src: getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
@@ -111,7 +111,7 @@ function LoginPasswordLess(props) {
111
111
  })
112
112
  })]
113
113
  }), errorMessage && !isInputFocused && isPasswordLessCtaClicked && /*#__PURE__*/jsx("p", {
114
- className: "w3a--w-full w3a--pl-6 w3a--text-start w3a--text-xs w3a--font-normal w3a--text-app-red-500 dark:w3a--text-app-red-400",
114
+ className: "wta:w-full wta:pl-6 wta:text-start wta:text-xs wta:font-normal wta:text-app-red-500 wta:dark:text-app-red-400",
115
115
  children: errorMessage
116
116
  })]
117
117
  });
@@ -1,7 +1,7 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import { WALLET_CONNECTORS } from '@web3auth/no-modal';
3
3
  import { useRef, useState, useEffect, useMemo, useCallback } from 'react';
4
- import { twMerge } from 'tailwind-merge';
4
+ import { useTranslation } from 'react-i18next';
5
5
  import Footer from '../../components/Footer/Footer.js';
6
6
  import Loader from '../../components/Loader/Loader.js';
7
7
  import Toast from '../../components/Toast/Toast.js';
@@ -10,6 +10,8 @@ import { useModalState } from '../../context/ModalStateContext.js';
10
10
  import { RootProvider } from '../../context/RootContext.js';
11
11
  import { useWidget } from '../../context/WidgetContext.js';
12
12
  import { MODAL_STATUS } from '../../interfaces.js';
13
+ import i18nInstance from '../../localeImport.js';
14
+ import AccountLinking from '../AccountLinking/AccountLinking.js';
13
15
  import ConnectWallet from '../ConnectWallet/ConnectWallet.js';
14
16
  import Login from '../Login/Login.js';
15
17
  import RootBodySheets from './RootBodySheets/RootBodySheets.js';
@@ -19,6 +21,9 @@ function RootContent(props) {
19
21
  const {
20
22
  onCloseLoader
21
23
  } = props;
24
+ const [t] = useTranslation(undefined, {
25
+ i18n: i18nInstance
26
+ });
22
27
  const {
23
28
  modalState,
24
29
  shouldShowLoginPage,
@@ -181,14 +186,21 @@ function RootContent(props) {
181
186
  const isExternalWalletModeOnly = useMemo(() => {
182
187
  return !showPasswordLessInput && !areSocialLoginsVisible;
183
188
  }, [areSocialLoginsVisible, showPasswordLessInput]);
189
+ const isWalletConnectAccountLinkingVisible = useMemo(() => {
190
+ return modalState.accountLinking.active && modalState.accountLinking.transportConnectorName === WALLET_CONNECTORS.WALLET_CONNECT_V2;
191
+ }, [modalState.accountLinking.active, modalState.accountLinking.transportConnectorName]);
184
192
  const isShowLoader = useMemo(() => {
185
- return modalState.status !== MODAL_STATUS.INITIALIZED;
186
- }, [modalState.status]);
187
- const isConsentRequiringStatus = modalState.status === MODAL_STATUS.CONSENT_REQUIRING;
193
+ return !isWalletConnectAccountLinkingVisible && modalState.status !== MODAL_STATUS.INITIALIZED;
194
+ }, [isWalletConnectAccountLinkingVisible, modalState.status]);
195
+ const loaderMessage = useMemo(() => {
196
+ const message = modalState.postLoadingMessage;
197
+ if (!message) return undefined;
198
+ return i18nInstance.exists(message) ? t(message) : message;
199
+ }, [modalState.postLoadingMessage, t]);
188
200
  return /*#__PURE__*/jsxs("div", {
189
- className: "w3a--relative w3a--flex w3a--flex-col",
201
+ className: "wta:relative wta:flex wta:flex-col",
190
202
  children: [/*#__PURE__*/jsxs("div", {
191
- className: "w3a-modal-container w3a--relative w3a--flex w3a--flex-col w3a--overflow-hidden",
203
+ className: "w3a-modal-container wta:relative wta:flex wta:flex-col wta:overflow-hidden",
192
204
  style: {
193
205
  height: containerHeight
194
206
  },
@@ -196,11 +208,12 @@ function RootContent(props) {
196
208
  className: "w3a--modal-curtain"
197
209
  }), /*#__PURE__*/jsxs("div", {
198
210
  ref: contentRef,
199
- className: twMerge("w3a--relative w3a--flex w3a--flex-col w3a--p-6", isShowLoader && !isConsentRequiringStatus ? "w3a--flex-1" : "w3a--flex-none"),
211
+ className: "wta:relative wta:flex wta:flex-none wta:flex-col wta:p-6",
200
212
  children: [isShowLoader ? /*#__PURE__*/jsx(Loader, {
201
213
  connector: modalState.detailedLoaderConnector,
202
214
  connectorName: modalState.detailedLoaderConnectorName,
203
215
  modalStatus: modalState.status,
216
+ message: loaderMessage,
204
217
  onClose: onCloseLoader,
205
218
  isConnectAndSignAuthenticationMode: isConnectAndSignAuthenticationMode,
206
219
  externalWalletsConfig: modalState.externalWalletsConfig,
@@ -211,11 +224,13 @@ function RootContent(props) {
211
224
  privacyPolicy: privacyPolicy,
212
225
  tncLink: tncLink
213
226
  }) : /*#__PURE__*/jsxs(Fragment, {
214
- children: [modalState.currentPage === PAGES.LOGIN_OPTIONS && shouldShowLoginPage && modalState.status === MODAL_STATUS.INITIALIZED && /*#__PURE__*/jsx(Login, {
227
+ children: [isWalletConnectAccountLinkingVisible && /*#__PURE__*/jsx(AccountLinking, {
228
+ allExternalWallets: allExternalWallets
229
+ }), !isWalletConnectAccountLinkingVisible && !modalState.accountLinking.pickerActive && modalState.currentPage === PAGES.LOGIN_OPTIONS && shouldShowLoginPage && modalState.status === MODAL_STATUS.INITIALIZED && /*#__PURE__*/jsx(Login, {
215
230
  installedExternalWalletConfig: topInstalledConnectorButtons,
216
231
  totalExternalWallets: allExternalWallets.length,
217
232
  remainingUndisplayedWallets: remainingUndisplayedWallets
218
- }), modalState.currentPage === PAGES.WALLET_LIST && (!shouldShowLoginPage || isExternalWalletModeOnly) && modalState.status === MODAL_STATUS.INITIALIZED && /*#__PURE__*/jsx(ConnectWallet, {
233
+ }), !isWalletConnectAccountLinkingVisible && modalState.currentPage === PAGES.WALLET_LIST && (!shouldShowLoginPage || isExternalWalletModeOnly || modalState.accountLinking.pickerActive) && modalState.status === MODAL_STATUS.INITIALIZED && /*#__PURE__*/jsx(ConnectWallet, {
219
234
  allRegistryButtons: allRegistryButtons,
220
235
  connectorVisibilityMap: connectorVisibilityMap,
221
236
  customConnectorButtons: customConnectorButtons,