@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.
- package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
- package/dist/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +446 -26
- package/dist/lib.cjs/packages/modal/src/react/index.js +7 -3
- package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +27 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +28 -28
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +19 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
- package/dist/lib.cjs/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
- package/dist/lib.cjs/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/Login.js +45 -41
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +24 -9
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
- package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
- package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +1 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +26 -0
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +113 -4
- package/dist/lib.cjs/packages/modal/src/vue/index.js +7 -3
- package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +27 -14
- package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
- package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
- package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
- package/dist/lib.cjs/types/modalManager.d.ts +40 -2
- package/dist/lib.cjs/types/react/hooks/index.d.ts +1 -0
- package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/Root/Root.d.ts +1 -1
- package/dist/lib.cjs/types/ui/interfaces.d.ts +43 -8
- package/dist/lib.cjs/types/ui/loginModal.d.ts +27 -2
- package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
- package/dist/lib.cjs/types/vue/composables/index.d.ts +1 -0
- package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
- package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +451 -28
- package/dist/lib.esm/packages/modal/src/react/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +28 -13
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +13 -13
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +28 -28
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +19 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +21 -21
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWallet.js +14 -3
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +9 -9
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletList/ConnectWalletList.js +19 -19
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +8 -8
- package/dist/lib.esm/packages/modal/src/ui/containers/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +5 -5
- package/dist/lib.esm/packages/modal/src/ui/containers/Embed/Embed.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/Login.js +46 -42
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginOtp/LoginOtp.js +11 -11
- package/dist/lib.esm/packages/modal/src/ui/containers/Login/LoginPasswordLess/LoginPasswordLess.js +13 -13
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +24 -9
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +16 -16
- package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +6 -2
- package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +24 -1
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +115 -6
- package/dist/lib.esm/packages/modal/src/vue/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +28 -15
- package/package.json +42 -19
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import { CHAIN_NAMESPACES, WalletInitializationError, log } from '@web3auth/no-modal';
|
|
4
|
-
import { useMemo, createElement, useEffect, Fragment } from 'react';
|
|
4
|
+
import { useMemo, createElement, useRef, useEffect, Fragment } from 'react';
|
|
5
5
|
import { defineChain, webSocket, http } from 'viem';
|
|
6
6
|
import { createConfig, WagmiProvider as WagmiProvider$1, fallback, useConfig, useReconnect, useConnectionEffect } from 'wagmi';
|
|
7
7
|
import { injected } from 'wagmi/connectors';
|
|
8
|
-
import { useWeb3Auth } from '../hooks/useWeb3Auth.js';
|
|
9
8
|
import { useWeb3AuthDisconnect } from '@web3auth/no-modal/react';
|
|
9
|
+
import { useWeb3Auth } from '../hooks/useWeb3Auth.js';
|
|
10
10
|
import '@babel/runtime/helpers/defineProperty';
|
|
11
11
|
import '@web3auth/auth';
|
|
12
12
|
import 'deepmerge';
|
|
@@ -22,6 +22,7 @@ import 'react/jsx-runtime';
|
|
|
22
22
|
import 'react-i18next';
|
|
23
23
|
import '../../ui/localeImport.js';
|
|
24
24
|
import '../../ui/components/SpinnerLoader/SpinnerLoader.css.js';
|
|
25
|
+
import '../../ui/containers/AccountLinking/AccountLinking.js';
|
|
25
26
|
import 'classnames';
|
|
26
27
|
import 'react-qrcode-logo';
|
|
27
28
|
import '../../ui/containers/Login/Login.js';
|
|
@@ -94,7 +95,10 @@ function Web3AuthWagmiProvider({
|
|
|
94
95
|
}) {
|
|
95
96
|
const {
|
|
96
97
|
isConnected,
|
|
97
|
-
connection
|
|
98
|
+
connection,
|
|
99
|
+
web3Auth: {
|
|
100
|
+
primaryConnectorName
|
|
101
|
+
}
|
|
98
102
|
} = useWeb3Auth();
|
|
99
103
|
const {
|
|
100
104
|
disconnect
|
|
@@ -103,6 +107,7 @@ function Web3AuthWagmiProvider({
|
|
|
103
107
|
const {
|
|
104
108
|
mutate: reconnect
|
|
105
109
|
} = useReconnect();
|
|
110
|
+
const lastSyncedWeb3AuthConnection = useRef(null);
|
|
106
111
|
useConnectionEffect({
|
|
107
112
|
onDisconnect: async () => {
|
|
108
113
|
log.info("Disconnected from wagmi");
|
|
@@ -116,22 +121,33 @@ function Web3AuthWagmiProvider({
|
|
|
116
121
|
}
|
|
117
122
|
});
|
|
118
123
|
useEffect(() => {
|
|
119
|
-
(async
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
(async _connection$ethereumP => {
|
|
125
|
+
const newConnection = connection !== null && connection !== void 0 ? connection : null;
|
|
126
|
+
const newEth = (_connection$ethereumP = connection === null || connection === void 0 ? void 0 : connection.ethereumProvider) !== null && _connection$ethereumP !== void 0 ? _connection$ethereumP : null;
|
|
127
|
+
if (isConnected && newConnection && newEth && newConnection.connectorName === primaryConnectorName) {
|
|
128
|
+
// `ethereumProvider` is a stable proxy (`commonJRPCProvider`) across account switches,
|
|
129
|
+
// so key wagmi resyncs off the Web3Auth connection object instead of provider identity.
|
|
130
|
+
if (lastSyncedWeb3AuthConnection.current !== newConnection) {
|
|
131
|
+
if (getWeb3authConnector(wagmiConfig)) {
|
|
132
|
+
resetConnectorState(wagmiConfig);
|
|
133
|
+
}
|
|
134
|
+
lastSyncedWeb3AuthConnection.current = newConnection;
|
|
135
|
+
const connector = await setupConnector(newEth, wagmiConfig);
|
|
136
|
+
if (!connector) {
|
|
137
|
+
log.error("Failed to setup react wagmi connector");
|
|
138
|
+
throw new Error("Failed to setup connector");
|
|
139
|
+
}
|
|
140
|
+
await connectWeb3AuthWithWagmi(connector, wagmiConfig);
|
|
141
|
+
reconnect();
|
|
125
142
|
}
|
|
126
|
-
await connectWeb3AuthWithWagmi(connector, wagmiConfig);
|
|
127
|
-
reconnect();
|
|
128
143
|
} else if (!isConnected) {
|
|
144
|
+
lastSyncedWeb3AuthConnection.current = null;
|
|
129
145
|
if (wagmiConfig.state.status === "connected") {
|
|
130
146
|
await disconnectWeb3AuthFromWagmi(wagmiConfig);
|
|
131
147
|
}
|
|
132
148
|
}
|
|
133
149
|
})();
|
|
134
|
-
}, [isConnected, wagmiConfig, connection, reconnect]);
|
|
150
|
+
}, [isConnected, wagmiConfig, connection, reconnect, primaryConnectorName]);
|
|
135
151
|
return /*#__PURE__*/createElement(Fragment, null, children);
|
|
136
152
|
}
|
|
137
153
|
function WagmiProvider(_ref) {
|
|
@@ -215,7 +231,6 @@ function WagmiProvider(_ref) {
|
|
|
215
231
|
finalConfig.chains = [wagmiChains[0], ...wagmiChains.slice(1)];
|
|
216
232
|
}
|
|
217
233
|
return createConfig(finalConfig);
|
|
218
|
-
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
219
234
|
}, [config, web3Auth, isInitialized]);
|
|
220
235
|
return /*#__PURE__*/createElement(WagmiProvider$1, // typecast to WagmiProviderPropsBase to avoid type error
|
|
221
236
|
// as we are omitting the config prop from WagmiProviderProps
|
|
@@ -19,25 +19,25 @@ function BottomSheet({
|
|
|
19
19
|
};
|
|
20
20
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
21
21
|
children: [/*#__PURE__*/jsx("div", {
|
|
22
|
-
className: cn("w3a--bottom-sheet-bg
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
22
|
+
className: cn("w3a--bottom-sheet-bg wta:fixed wta:left-0 wta:top-0 wta:size-full wta:transition-opacity wta:duration-300", {
|
|
23
|
+
"wta:rounded-[30px]": borderRadiusType === "large",
|
|
24
|
+
"wta:rounded-2xl": borderRadiusType === "medium",
|
|
25
|
+
"wta:rounded-none": borderRadiusType === "small"
|
|
26
26
|
}),
|
|
27
27
|
onClick: handleClose,
|
|
28
28
|
"aria-hidden": "true",
|
|
29
29
|
role: "button"
|
|
30
30
|
}), /*#__PURE__*/jsxs("div", {
|
|
31
|
-
className: cn(`
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
${isShown ? "
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
31
|
+
className: cn(`wta:fixed wta:bottom-2 wta:left-2 wta:mx-auto wta:flex wta:w-[96%] wta:flex-col
|
|
32
|
+
wta:gap-y-2 wta:border wta:border-app-gray-100 wta:bg-app-white wta:p-4 wta:shadow-lg wta:transition-transform wta:duration-500
|
|
33
|
+
wta:ease-out wta:dark:border-app-gray-600 wta:dark:bg-app-dark-surface-main
|
|
34
|
+
${isShown ? "wta:translate-y-0 wta:delay-700" : "wta:translate-y-full"}`, {
|
|
35
|
+
"wta:rounded-[30px]": borderRadiusType === "large",
|
|
36
|
+
"wta:rounded-2xl": borderRadiusType === "medium",
|
|
37
|
+
"wta:rounded-none": borderRadiusType === "small"
|
|
38
38
|
}, sheetClassName),
|
|
39
39
|
children: [showCloseButton && /*#__PURE__*/jsx("div", {
|
|
40
|
-
className: "
|
|
40
|
+
className: "wta:absolute wta:right-4 wta:top-[16px] wta:z-10 wta:cursor-pointer",
|
|
41
41
|
children: /*#__PURE__*/jsx("svg", {
|
|
42
42
|
width: "13",
|
|
43
43
|
height: "13",
|
|
@@ -45,7 +45,7 @@ function BottomSheet({
|
|
|
45
45
|
fill: "none",
|
|
46
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
47
47
|
onClick: onClose,
|
|
48
|
-
className: "
|
|
48
|
+
className: "wta:text-app-gray-500 wta:hover:text-app-gray-900 wta:dark:text-app-gray-200 wta:dark:hover:text-app-white",
|
|
49
49
|
children: /*#__PURE__*/jsx("path", {
|
|
50
50
|
fillRule: "evenodd",
|
|
51
51
|
clipRule: "evenodd",
|
|
@@ -37,12 +37,12 @@ function SocialLoginButton(props) {
|
|
|
37
37
|
type: "button",
|
|
38
38
|
onClick: e => onClick && onClick(e),
|
|
39
39
|
className: cn("w3a--btn", btnStyle, {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
40
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
41
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
42
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
43
43
|
}),
|
|
44
44
|
children: [showIcon && getProviderIcon(method, isDark, isPrimaryBtn), children, showText && /*#__PURE__*/jsx("p", {
|
|
45
|
-
className: "
|
|
45
|
+
className: "wta:text-base wta:font-normal wta:text-app-gray-900 wta:dark:text-app-white",
|
|
46
46
|
children: text
|
|
47
47
|
})]
|
|
48
48
|
});
|
|
@@ -33,17 +33,17 @@ function ButtonWallet(props) {
|
|
|
33
33
|
};
|
|
34
34
|
return /*#__PURE__*/jsxs("button", {
|
|
35
35
|
type: "button",
|
|
36
|
-
className: cn(`
|
|
37
|
-
hover:
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
36
|
+
className: cn(`wta:group wta:relative wta:overflow-hidden wta:flex wta:w-full wta:items-center wta:justify-between wta:bg-app-gray-50 wta:p-3 wta:hover:bg-app-gray-200
|
|
37
|
+
wta:hover:text-app-gray-900 wta:dark:bg-app-gray-800 wta:dark:hover:bg-app-gray-600 wta:active:scale-95 wta:transition-all wta:duration-150`, {
|
|
38
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
39
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
40
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
41
41
|
}),
|
|
42
42
|
onClick: handleBtnClick,
|
|
43
43
|
children: [/*#__PURE__*/jsxs("div", {
|
|
44
|
-
className: "
|
|
44
|
+
className: "wta:flex wta:items-center wta:gap-x-2",
|
|
45
45
|
children: [/*#__PURE__*/jsx("figure", {
|
|
46
|
-
className: "
|
|
46
|
+
className: "wta:size-5",
|
|
47
47
|
children: /*#__PURE__*/jsx(Image, {
|
|
48
48
|
imageData: button.icon,
|
|
49
49
|
imageId: `login-${button.name}`,
|
|
@@ -55,15 +55,15 @@ function ButtonWallet(props) {
|
|
|
55
55
|
extension: button.imgExtension || "webp"
|
|
56
56
|
})
|
|
57
57
|
}), /*#__PURE__*/jsx("p", {
|
|
58
|
-
className: "
|
|
58
|
+
className: "wta:max-w-[180px] wta:truncate wta:text-base wta:font-normal wta:text-app-gray-700 wta:dark:text-app-white",
|
|
59
59
|
children: label
|
|
60
60
|
})]
|
|
61
61
|
}), button.hasInjectedWallet && /*#__PURE__*/jsx("span", {
|
|
62
|
-
className: "
|
|
62
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:flex wta:w-auto wta:-translate-y-1/2 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:transition-all wta:duration-300 wta:group-hover:translate-x-6 wta:group-hover:opacity-0 wta:dark:border wta:dark:border-app-primary-400 wta:dark:bg-transparent wta:dark:text-app-primary-400",
|
|
63
63
|
children: t("modal.external.installed")
|
|
64
64
|
}), /*#__PURE__*/jsx("img", {
|
|
65
65
|
id: "injected-wallet-arrow",
|
|
66
|
-
className: "
|
|
66
|
+
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",
|
|
67
67
|
src: getIcons(isDark ? "chevron-right-light" : "chevron-right-dark"),
|
|
68
68
|
alt: "arrow"
|
|
69
69
|
})]
|
|
@@ -14,32 +14,32 @@ function Footer({
|
|
|
14
14
|
i18n: i18nInstance
|
|
15
15
|
});
|
|
16
16
|
return /*#__PURE__*/jsxs("div", {
|
|
17
|
-
className: "
|
|
17
|
+
className: "wta:mx-auto wta:mt-auto wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-4 wta:pt-5",
|
|
18
18
|
children: [(privacyPolicy || termsOfService) && /*#__PURE__*/jsxs("p", {
|
|
19
|
-
className: "
|
|
19
|
+
className: "wta:mx-auto wta:w-4/5 wta:text-center wta:text-xs wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
20
20
|
children: [t("modal.footer.by-signing-in"), " ", termsOfService && /*#__PURE__*/jsxs("a", {
|
|
21
21
|
href: termsOfService,
|
|
22
|
-
className: "
|
|
22
|
+
className: "wta:text-app-primary-600 wta:dark:text-app-primary-500",
|
|
23
23
|
children: [t("modal.footer.terms-of-service"), " "]
|
|
24
24
|
}), privacyPolicy && /*#__PURE__*/jsxs(Fragment, {
|
|
25
25
|
children: [t("modal.footer.and"), " ", /*#__PURE__*/jsx("a", {
|
|
26
26
|
href: privacyPolicy,
|
|
27
|
-
className: "
|
|
27
|
+
className: "wta:text-app-primary-600 wta:dark:text-app-primary-500",
|
|
28
28
|
children: t("modal.footer.privacy-policy")
|
|
29
29
|
})]
|
|
30
30
|
})]
|
|
31
31
|
}), /*#__PURE__*/jsxs("div", {
|
|
32
|
-
className: "
|
|
32
|
+
className: "wta:flex wta:items-center wta:justify-center wta:gap-2",
|
|
33
33
|
children: [/*#__PURE__*/jsx("img", {
|
|
34
34
|
height: "36",
|
|
35
35
|
src: "https://images.web3auth.io/metamask-footer-logo-light.svg",
|
|
36
36
|
alt: "Web3Auth Logo Light",
|
|
37
|
-
className: "
|
|
37
|
+
className: "wta:block wta:h-9 wta:dark:hidden"
|
|
38
38
|
}), /*#__PURE__*/jsx("img", {
|
|
39
39
|
height: "36",
|
|
40
40
|
src: "https://images.web3auth.io/metamask-footer-logo-dark.svg",
|
|
41
41
|
alt: "Web3Auth Logo Dark",
|
|
42
|
-
className: "
|
|
42
|
+
className: "wta:hidden wta:h-9 wta:dark:block"
|
|
43
43
|
})]
|
|
44
44
|
})]
|
|
45
45
|
});
|
|
@@ -35,7 +35,7 @@ function Image(props) {
|
|
|
35
35
|
height: height,
|
|
36
36
|
width: width,
|
|
37
37
|
alt: hoverImageId,
|
|
38
|
-
className: cn("
|
|
38
|
+
className: cn("wta:object-contain", `wta:h-${height} wta:w-${width}`)
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return /*#__PURE__*/jsx("img", {
|
|
@@ -44,7 +44,7 @@ function Image(props) {
|
|
|
44
44
|
height: height,
|
|
45
45
|
width: width,
|
|
46
46
|
alt: hoverImageId,
|
|
47
|
-
className: cn("
|
|
47
|
+
className: cn("wta:rounded wta:object-contain", `wta:h-${height} wta:w-${width}`)
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
if (imageData) {
|
|
@@ -54,7 +54,7 @@ function Image(props) {
|
|
|
54
54
|
height: height,
|
|
55
55
|
width: width,
|
|
56
56
|
alt: imageId,
|
|
57
|
-
className: cn("
|
|
57
|
+
className: cn("wta:object-contain", `wta:h-${height} wta:w-${width}`),
|
|
58
58
|
onError: ({
|
|
59
59
|
currentTarget
|
|
60
60
|
}) => {
|
|
@@ -72,7 +72,7 @@ function Image(props) {
|
|
|
72
72
|
height: height,
|
|
73
73
|
width: width,
|
|
74
74
|
alt: imageId,
|
|
75
|
-
className: cn("
|
|
75
|
+
className: cn("wta:rounded wta:object-contain", `wta:h-${height} wta:w-${width}`),
|
|
76
76
|
onError: ({
|
|
77
77
|
currentTarget
|
|
78
78
|
}) => {
|
|
@@ -27,20 +27,20 @@ function ConnectingStatus(props) {
|
|
|
27
27
|
width: "40"
|
|
28
28
|
}), [connector]);
|
|
29
29
|
return /*#__PURE__*/jsxs("div", {
|
|
30
|
-
className: "
|
|
30
|
+
className: "wta:flex wta:h-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4 wta:pt-6",
|
|
31
31
|
children: [/*#__PURE__*/jsx(SpinnerLoader, {
|
|
32
32
|
width: 95,
|
|
33
33
|
height: 95,
|
|
34
34
|
children: providerIcon
|
|
35
35
|
}), /*#__PURE__*/jsxs("div", {
|
|
36
|
-
className: "
|
|
36
|
+
className: "wta:flex wta:flex-col wta:gap-y-1",
|
|
37
37
|
children: [/*#__PURE__*/jsx("div", {
|
|
38
|
-
className: "
|
|
38
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
39
39
|
children: t("modal.adapter-loader.message1", {
|
|
40
40
|
adapter: connectorName
|
|
41
41
|
})
|
|
42
42
|
}), /*#__PURE__*/jsx("div", {
|
|
43
|
-
className: "
|
|
43
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
44
44
|
children: t("modal.adapter-loader.message2", {
|
|
45
45
|
adapter: connectorName
|
|
46
46
|
})
|
|
@@ -59,7 +59,7 @@ function ConnectedStatus(props) {
|
|
|
59
59
|
message
|
|
60
60
|
} = props;
|
|
61
61
|
return /*#__PURE__*/jsxs("div", {
|
|
62
|
-
className: "
|
|
62
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-2 wta:pt-6",
|
|
63
63
|
children: [/*#__PURE__*/jsx("svg", {
|
|
64
64
|
xmlns: "http://www.w3.org/2000/svg",
|
|
65
65
|
fill: "none",
|
|
@@ -71,8 +71,8 @@ function ConnectedStatus(props) {
|
|
|
71
71
|
d: "M6.267 3.455a3.07 3.07 0 0 0 1.745-.723 3.066 3.066 0 0 1 3.976 0 3.07 3.07 0 0 0 1.745.723 3.066 3.066 0 0 1 2.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 0 1 0 3.976 3.07 3.07 0 0 0-.723 1.745 3.066 3.066 0 0 1-2.812 2.812 3.07 3.07 0 0 0-1.745.723 3.066 3.066 0 0 1-3.976 0 3.07 3.07 0 0 0-1.745-.723 3.066 3.066 0 0 1-2.812-2.812 3.07 3.07 0 0 0-.723-1.745 3.066 3.066 0 0 1 0-3.976 3.07 3.07 0 0 0 .723-1.745 3.066 3.066 0 0 1 2.812-2.812m7.44 5.252a1 1 0 0 0-1.414-1.414L9 10.586 7.707 9.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0z",
|
|
72
72
|
clipRule: "evenodd"
|
|
73
73
|
})
|
|
74
|
-
}), /*#__PURE__*/jsx("p", {
|
|
75
|
-
className: "
|
|
74
|
+
}), message && /*#__PURE__*/jsx("p", {
|
|
75
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
76
76
|
children: message
|
|
77
77
|
})]
|
|
78
78
|
});
|
|
@@ -88,7 +88,7 @@ function ErroredStatus(props) {
|
|
|
88
88
|
message
|
|
89
89
|
} = props;
|
|
90
90
|
return /*#__PURE__*/jsxs("div", {
|
|
91
|
-
className: "
|
|
91
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-2 wta:pt-6",
|
|
92
92
|
children: [/*#__PURE__*/jsx("svg", {
|
|
93
93
|
xmlns: "http://www.w3.org/2000/svg",
|
|
94
94
|
fill: "none",
|
|
@@ -100,8 +100,8 @@ function ErroredStatus(props) {
|
|
|
100
100
|
d: "M18 10a8 8 0 1 1-16.001 0A8 8 0 0 1 18 10m-7 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-1-9a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1",
|
|
101
101
|
clipRule: "evenodd"
|
|
102
102
|
})
|
|
103
|
-
}), /*#__PURE__*/jsx("p", {
|
|
104
|
-
className: "
|
|
103
|
+
}), message && /*#__PURE__*/jsx("p", {
|
|
104
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
105
105
|
children: message
|
|
106
106
|
})]
|
|
107
107
|
});
|
|
@@ -122,14 +122,14 @@ function AuthorizingStatus(props) {
|
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
124
|
return /*#__PURE__*/jsxs("div", {
|
|
125
|
-
className: "
|
|
125
|
+
className: "wta:flex wta:size-full wta:flex-col wta:items-center wta:justify-between wta:gap-y-6",
|
|
126
126
|
children: [/*#__PURE__*/jsx("p", {
|
|
127
|
-
className: "
|
|
127
|
+
className: "wta:p-2 wta:text-center wta:text-base wta:font-semibold wta:text-app-gray-900 wta:dark:text-app-white",
|
|
128
128
|
children: t("modal.loader.authorizing-header", {
|
|
129
129
|
connector: (_externalWalletsConfi = externalWalletsConfig[connector]) === null || _externalWalletsConfi === void 0 ? void 0 : _externalWalletsConfi.label
|
|
130
130
|
})
|
|
131
131
|
}), /*#__PURE__*/jsx("div", {
|
|
132
|
-
className: "
|
|
132
|
+
className: "wta:flex wta:justify-center",
|
|
133
133
|
children: /*#__PURE__*/jsx(SpinnerLoader, {
|
|
134
134
|
width: 95,
|
|
135
135
|
height: 95,
|
|
@@ -141,11 +141,11 @@ function AuthorizingStatus(props) {
|
|
|
141
141
|
})
|
|
142
142
|
})
|
|
143
143
|
}), /*#__PURE__*/jsx("p", {
|
|
144
|
-
className: "
|
|
144
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
145
145
|
children: t("modal.loader.authorizing-message")
|
|
146
146
|
}), /*#__PURE__*/jsx("button", {
|
|
147
147
|
onClick: handleMobileVerifyConnectClick,
|
|
148
|
-
className: "
|
|
148
|
+
className: "wta:w-full wta:rounded-xl wta:bg-app-gray-100 wta:p-2 wta:py-3 wta:text-center wta:text-sm wta:text-app-gray-900 wta:dark:bg-app-gray-800 wta:dark:text-app-white wta:md:hidden",
|
|
149
149
|
children: t("modal.loader.authorizing-verify-btn")
|
|
150
150
|
})]
|
|
151
151
|
});
|
|
@@ -178,14 +178,14 @@ function ConsentRequiredStatus(props) {
|
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
return /*#__PURE__*/jsxs("div", {
|
|
181
|
-
className: "
|
|
181
|
+
className: "wta:flex wta:w-full wta:flex-col wta:items-center wta:gap-y-6 wta:mt-8",
|
|
182
182
|
children: [/*#__PURE__*/jsx("div", {
|
|
183
|
-
className: "
|
|
183
|
+
className: "wta:flex wta:items-center wta:justify-center wta:p-3 wta:bg-app-gray-100 wta:dark:bg-app-gray-800 wta:rounded-full wta:text-app-gray-600 wta:dark:text-app-white",
|
|
184
184
|
children: /*#__PURE__*/jsx("svg", {
|
|
185
185
|
xmlns: "http://www.w3.org/2000/svg",
|
|
186
186
|
fill: "none",
|
|
187
187
|
viewBox: "0 0 24 24",
|
|
188
|
-
className: "
|
|
188
|
+
className: "wta:size-10",
|
|
189
189
|
children: /*#__PURE__*/jsx("path", {
|
|
190
190
|
stroke: "currentColor",
|
|
191
191
|
strokeLinecap: "round",
|
|
@@ -195,17 +195,17 @@ function ConsentRequiredStatus(props) {
|
|
|
195
195
|
})
|
|
196
196
|
})
|
|
197
197
|
}), /*#__PURE__*/jsx("div", {
|
|
198
|
-
className: "
|
|
198
|
+
className: "wta:w-full wta:px-8 wta:text-center wta:text-app-gray-900 wta:dark:text-app-white",
|
|
199
199
|
children: t("modal.consent.description", {
|
|
200
200
|
defaultValue: "To proceed, please accept the terms and privacy policy"
|
|
201
201
|
})
|
|
202
202
|
}), (tncLink || privacyPolicy) && /*#__PURE__*/jsxs("div", {
|
|
203
|
-
className: "
|
|
203
|
+
className: "wta:flex wta:w-full wta:flex-col wta:gap-y-2",
|
|
204
204
|
children: [tncLink && /*#__PURE__*/jsx("a", {
|
|
205
205
|
href: tncLink,
|
|
206
206
|
target: "_blank",
|
|
207
207
|
rel: "noopener noreferrer",
|
|
208
|
-
className: "w3a--btn
|
|
208
|
+
className: "w3a--btn wta:text-sm! wta:font-light wta:justify-start! wta:rounded-full wta:border-app-gray-50 wta:bg-app-gray-50 wta:p-3 wta:text-left wta:text-app-gray-700 wta:hover:border-app-gray-200 wta:hover:bg-app-gray-200 wta:hover:text-app-gray-900 wta:dark:border-app-gray-800 wta:dark:bg-app-gray-800 wta:dark:text-app-white wta:dark:hover:border-app-gray-600 wta:dark:hover:bg-app-gray-600",
|
|
209
209
|
children: t("modal.consent.tnc", {
|
|
210
210
|
defaultValue: "Terms of service"
|
|
211
211
|
})
|
|
@@ -213,20 +213,20 @@ function ConsentRequiredStatus(props) {
|
|
|
213
213
|
href: privacyPolicy,
|
|
214
214
|
target: "_blank",
|
|
215
215
|
rel: "noopener noreferrer",
|
|
216
|
-
className: "w3a--btn
|
|
216
|
+
className: "w3a--btn wta:text-sm! wta:font-light wta:justify-start! wta:rounded-full wta:border-app-gray-50 wta:bg-app-gray-50 wta:p-3 wta:text-left wta:text-app-gray-700 wta:hover:border-app-gray-200 wta:hover:bg-app-gray-200 wta:hover:text-app-gray-900 wta:dark:border-app-gray-800 wta:dark:bg-app-gray-800 wta:dark:text-app-white wta:dark:hover:border-app-gray-600 wta:dark:hover:bg-app-gray-600",
|
|
217
217
|
children: t("modal.consent.privacy", {
|
|
218
218
|
defaultValue: "Privacy Policy"
|
|
219
219
|
})
|
|
220
220
|
})]
|
|
221
221
|
}), /*#__PURE__*/jsxs("div", {
|
|
222
|
-
className: "
|
|
222
|
+
className: "wta:flex wta:w-full wta:gap-x-2",
|
|
223
223
|
children: [/*#__PURE__*/jsx("button", {
|
|
224
224
|
type: "button",
|
|
225
225
|
disabled: isSubmitting,
|
|
226
226
|
onClick: handleDecline,
|
|
227
|
-
className: "w3a--btn
|
|
227
|
+
className: "w3a--btn wta:rounded-full wta:disabled:opacity-60",
|
|
228
228
|
children: /*#__PURE__*/jsx("p", {
|
|
229
|
-
className: "
|
|
229
|
+
className: "wta:text-app-gray-900 wta:dark:text-app-white",
|
|
230
230
|
children: t("modal.consent.decline", {
|
|
231
231
|
defaultValue: "Decline"
|
|
232
232
|
})
|
|
@@ -235,9 +235,9 @@ function ConsentRequiredStatus(props) {
|
|
|
235
235
|
type: "button",
|
|
236
236
|
disabled: isSubmitting,
|
|
237
237
|
onClick: handleAccept,
|
|
238
|
-
className: "w3a--btn
|
|
238
|
+
className: "w3a--btn wta:rounded-full wta:border-app-primary-600! wta:bg-app-primary-600 wta:hover:border-app-primary-700! wta:hover:bg-app-primary-700! wta:disabled:opacity-60 wta:dark:border-app-primary-600! wta:dark:bg-app-primary-600 wta:dark:hover:border-app-primary-700! wta:dark:hover:bg-app-primary-700!",
|
|
239
239
|
children: /*#__PURE__*/jsx("p", {
|
|
240
|
-
className: "
|
|
240
|
+
className: "wta:text-app-onPrimary",
|
|
241
241
|
children: t("modal.consent.accept", {
|
|
242
242
|
defaultValue: "Accept"
|
|
243
243
|
})
|
|
@@ -282,7 +282,7 @@ function Loader(props) {
|
|
|
282
282
|
}, [isConnectedAccordingToAuthenticationMode, hideSuccessScreen, onClose]);
|
|
283
283
|
const isConsentRequiringStatus = modalStatus === MODAL_STATUS.CONSENT_REQUIRING;
|
|
284
284
|
return /*#__PURE__*/jsxs("div", {
|
|
285
|
-
className: isConsentRequiringStatus ? "
|
|
285
|
+
className: isConsentRequiringStatus ? "wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-4" : "wta:flex wta:h-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4",
|
|
286
286
|
children: [modalStatus === MODAL_STATUS.CONNECTING && /*#__PURE__*/jsx(ConnectingStatus, {
|
|
287
287
|
connector: connector,
|
|
288
288
|
connectorName: connectorName
|
|
@@ -28,7 +28,7 @@ const LoginHint = ({
|
|
|
28
28
|
};
|
|
29
29
|
}, [isDark]);
|
|
30
30
|
return /*#__PURE__*/jsxs("div", {
|
|
31
|
-
className: "
|
|
31
|
+
className: "wta:relative",
|
|
32
32
|
"aria-hidden": true,
|
|
33
33
|
onMouseEnter: handleMouseEnter,
|
|
34
34
|
onMouseLeave: handleMouseLeave,
|
|
@@ -38,9 +38,9 @@ const LoginHint = ({
|
|
|
38
38
|
children: [children, showPopover && !hideHint && /*#__PURE__*/jsxs("div", {
|
|
39
39
|
"data-popover": true,
|
|
40
40
|
role: "tooltip",
|
|
41
|
-
className: cn("
|
|
41
|
+
className: cn("wta:absolute wta:z-[45] wta:shadow-2xl wta:rounded-lg wta:bottom-[100%] wta:left-[50%] wta:w-max wta:text-xs wta:px-[6px] wta:py-[3px]", isDark ? "wta:bg-app-white wta:text-app-gray-900" : "wta:bg-app-gray-800 wta:text-app-gray-100"),
|
|
42
42
|
children: [content, /*#__PURE__*/jsx("div", {
|
|
43
|
-
className: "
|
|
43
|
+
className: "wta:absolute",
|
|
44
44
|
style: triangleStyle
|
|
45
45
|
})]
|
|
46
46
|
})]
|
|
@@ -35,34 +35,34 @@ function Modal(props) {
|
|
|
35
35
|
}
|
|
36
36
|
}, [open]);
|
|
37
37
|
const positions = useMemo(() => ({
|
|
38
|
-
center: "
|
|
39
|
-
"top-center": "
|
|
40
|
-
"bottom-center": "
|
|
41
|
-
left: "sm:
|
|
42
|
-
right: "sm:
|
|
38
|
+
center: "wta:top-0 wta:left-0 wta:items-center wta:justify-center",
|
|
39
|
+
"top-center": "wta:top-8 wta:left-0 wta:items-start wta:justify-center",
|
|
40
|
+
"bottom-center": "wta:bottom-8 wta:left-0 wta:items-end wta:justify-center",
|
|
41
|
+
left: "wta:sm:left-8 wta:flex wta:items-center wta:justify-center wta:sm:justify-start",
|
|
42
|
+
right: "wta:sm:right-8 wta:flex wta:items-center wta:justify-center wta:sm:justify-end"
|
|
43
43
|
}), []);
|
|
44
44
|
const placementClass = useMemo(() => positions[placement], [placement, positions]);
|
|
45
45
|
const onCloseHandler = () => {
|
|
46
46
|
if (onClose) onClose();
|
|
47
47
|
};
|
|
48
48
|
return /*#__PURE__*/jsx("div", {
|
|
49
|
-
className: cn("
|
|
50
|
-
"
|
|
51
|
-
"
|
|
49
|
+
className: cn("wta:fixed wta:z-50 wta:overflow-hidden wta:flex wta:transition-all", placementClass, {
|
|
50
|
+
"wta:w-screen wta:h-screen": isOpen,
|
|
51
|
+
"wta:w-0 wta:h-0 wta:delay-500": !isOpen
|
|
52
52
|
}),
|
|
53
53
|
children: /*#__PURE__*/jsxs("div", {
|
|
54
|
-
className: cn("
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
54
|
+
className: cn("wta:bg-app-light-surface1 wta:dark:bg-app-dark-surface-main wta:w-[356px] wta:[@media(min-width:375px)]:w-[393px] wta:h-auto wta:flex wta:flex-col wta:duration-500", {
|
|
55
|
+
"wta:translate-y-0 wta:delay-100": isOpen,
|
|
56
|
+
"wta:translate-y-[100vh]": !isOpen,
|
|
57
|
+
"wta:p-4": padding,
|
|
58
|
+
"wta:shadow-xl wta:sm:shadow-lg": shadow,
|
|
59
|
+
"wta:border wta:border-app-gray-100 wta:dark:border-app-gray-800": border,
|
|
60
|
+
"wta:rounded-[30px]": borderRadius === "large",
|
|
61
|
+
"wta:rounded-2xl": borderRadius === "medium",
|
|
62
|
+
"wta:rounded-none": borderRadius === "small"
|
|
63
63
|
}),
|
|
64
64
|
children: [showCloseIcon && /*#__PURE__*/jsx("div", {
|
|
65
|
-
className: "
|
|
65
|
+
className: "wta:absolute wta:right-6 wta:top-[30px] wta:z-10 wta:cursor-pointer",
|
|
66
66
|
children: /*#__PURE__*/jsx("svg", {
|
|
67
67
|
width: "13",
|
|
68
68
|
height: "13",
|
|
@@ -70,7 +70,7 @@ function Modal(props) {
|
|
|
70
70
|
fill: "none",
|
|
71
71
|
xmlns: "http://www.w3.org/2000/svg",
|
|
72
72
|
onClick: onCloseHandler,
|
|
73
|
-
className: "
|
|
73
|
+
className: "wta:text-app-gray-500 wta:hover:text-app-gray-900 wta:dark:text-app-gray-200 wta:dark:hover:text-app-white",
|
|
74
74
|
children: /*#__PURE__*/jsx("path", {
|
|
75
75
|
fillRule: "evenodd",
|
|
76
76
|
clipRule: "evenodd",
|
|
@@ -131,16 +131,16 @@ const OtpInput = /*#__PURE__*/forwardRef(({
|
|
|
131
131
|
(_inputRefs$current7 = inputRefs.current) === null || _inputRefs$current7 === void 0 || _inputRefs$current7[0].focus();
|
|
132
132
|
}
|
|
133
133
|
}, [autoFocus]);
|
|
134
|
-
const helperTextClass = cn("
|
|
135
|
-
"
|
|
136
|
-
"
|
|
134
|
+
const helperTextClass = cn("wta:text-xs wta:font-normal wta:text-app-gray-500 wta:dark:text-app-white wta:mt-2", {
|
|
135
|
+
"wta:text-app-red-500 wta:dark:text-app-red-400": error,
|
|
136
|
+
"wta:text-app-green-500 wta:dark:text-app-green-400": success
|
|
137
137
|
}, classes === null || classes === void 0 ? void 0 : classes.helperText);
|
|
138
138
|
const inputKey = new Date().getFullYear();
|
|
139
139
|
return /*#__PURE__*/jsxs("div", {
|
|
140
|
-
className: cn("
|
|
140
|
+
className: cn("wta:flex wta:flex-col wta:items-center", classes === null || classes === void 0 ? void 0 : classes.root),
|
|
141
141
|
ref: ref,
|
|
142
142
|
children: [/*#__PURE__*/jsx("form", {
|
|
143
|
-
className: cn("
|
|
143
|
+
className: cn("wta:flex wta:space-x-2", classes === null || classes === void 0 ? void 0 : classes.inputContainer),
|
|
144
144
|
children: otpArray.map((digit, index) => {
|
|
145
145
|
var _classes$success, _classes$error, _classes$disabled;
|
|
146
146
|
return /*#__PURE__*/jsx("input", {
|
|
@@ -153,7 +153,7 @@ const OtpInput = /*#__PURE__*/forwardRef(({
|
|
|
153
153
|
onInput: e => handleInputChange(e, index),
|
|
154
154
|
onKeyUp: e => handleKeyDown(e, index),
|
|
155
155
|
onPaste: handlePaste,
|
|
156
|
-
className: cn("
|
|
156
|
+
className: cn("wta:w-12 wta:h-[42px] wta:rounded-full wta:border wta:text-center wta:text-xl wta:focus:outline-none wta:active:outline-none wta:focus:border-app-primary-600 wta:dark:focus:border-app-primary-500 wta:border-app-gray-300 wta:dark:border-app-gray-500 wta:bg-app-gray-50 wta:dark:bg-app-gray-700 wta:text-app-gray-900 wta:dark:text-app-white", success && ((_classes$success = classes === null || classes === void 0 ? void 0 : classes.success) !== null && _classes$success !== void 0 ? _classes$success : "wta:border-app-green-400 wta:dark:border-app-green-500 wta:focus:border-app-green-400 wta:dark:focus:border-app-green-500"), error && ((_classes$error = classes === null || classes === void 0 ? void 0 : classes.error) !== null && _classes$error !== void 0 ? _classes$error : "wta:border-app-red-600 wta:dark:border-app-red-500 wta:focus:border-app-red-600 wta:dark:focus:border-app-red-500"), disabled && ((_classes$disabled = classes === null || classes === void 0 ? void 0 : classes.disabled) !== null && _classes$disabled !== void 0 ? _classes$disabled : "wta:border-app-gray-200 wta:bg-app-gray-200 wta:dark:border-app-gray-700 wta:focus:border-app-gray-200 wta:dark:focus:border-app-gray-700 wta:cursor-not-allowed"), classes === null || classes === void 0 ? void 0 : classes.input),
|
|
157
157
|
ref: el => {
|
|
158
158
|
inputRefs.current[index] = el;
|
|
159
159
|
},
|
|
@@ -164,18 +164,18 @@ const OtpInput = /*#__PURE__*/forwardRef(({
|
|
|
164
164
|
className: helperTextClass,
|
|
165
165
|
children: helperText
|
|
166
166
|
}), loading && /*#__PURE__*/jsx("div", {
|
|
167
|
-
className: "
|
|
167
|
+
className: "wta:mt-3",
|
|
168
168
|
children: /*#__PURE__*/jsx(PulseLoader, {})
|
|
169
169
|
}), showCta && !loading && /*#__PURE__*/jsx("div", {
|
|
170
|
-
className: cn("
|
|
170
|
+
className: cn("wta:flex wta:items-center wta:mt-3", classes === null || classes === void 0 ? void 0 : classes.ctaContainer),
|
|
171
171
|
children: timer > 0 && showTimer ? /*#__PURE__*/jsx("span", {
|
|
172
|
-
className: cn("
|
|
172
|
+
className: cn("wta:text-xs wta:text-app-gray-500 wta:dark:text-app-gray-400", classes === null || classes === void 0 ? void 0 : classes.timerText),
|
|
173
173
|
children: t("modal.resendTimer", {
|
|
174
174
|
timer: timer
|
|
175
175
|
})
|
|
176
176
|
}) : /*#__PURE__*/jsx("button", {
|
|
177
177
|
type: "button",
|
|
178
|
-
className: cn("
|
|
178
|
+
className: cn("wta:text-xs wta:p-0 wta:text-app-primary-600 wta:dark:text-app-primary-500", classes === null || classes === void 0 ? void 0 : classes.resendBtnText),
|
|
179
179
|
onClick: handleResendClick,
|
|
180
180
|
disabled: timer > 0 && showTimer,
|
|
181
181
|
children: resendBtnText || t("modal.resendCode")
|