@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,14 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var react = require('@web3auth/no-modal/react');
|
|
3
4
|
var useWeb3Auth = require('./hooks/useWeb3Auth.js');
|
|
4
5
|
var useWeb3AuthConnect = require('./hooks/useWeb3AuthConnect.js');
|
|
5
|
-
var react = require('@web3auth/no-modal/react');
|
|
6
6
|
var Web3AuthProvider = require('./Web3AuthProvider.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.useWeb3Auth = useWeb3Auth.useWeb3Auth;
|
|
11
|
-
exports.useWeb3AuthConnect = useWeb3AuthConnect.useWeb3AuthConnect;
|
|
12
10
|
Object.defineProperty(exports, "useAuthTokenInfo", {
|
|
13
11
|
enumerable: true,
|
|
14
12
|
get: function () { return react.useAuthTokenInfo; }
|
|
@@ -57,6 +55,10 @@ Object.defineProperty(exports, "useWalletUI", {
|
|
|
57
55
|
enumerable: true,
|
|
58
56
|
get: function () { return react.useWalletUI; }
|
|
59
57
|
});
|
|
58
|
+
Object.defineProperty(exports, "useWallets", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return react.useWallets; }
|
|
61
|
+
});
|
|
60
62
|
Object.defineProperty(exports, "useWeb3AuthDisconnect", {
|
|
61
63
|
enumerable: true,
|
|
62
64
|
get: function () { return react.useWeb3AuthDisconnect; }
|
|
@@ -65,4 +67,6 @@ Object.defineProperty(exports, "useWeb3AuthUser", {
|
|
|
65
67
|
enumerable: true,
|
|
66
68
|
get: function () { return react.useWeb3AuthUser; }
|
|
67
69
|
});
|
|
70
|
+
exports.useWeb3Auth = useWeb3Auth.useWeb3Auth;
|
|
71
|
+
exports.useWeb3AuthConnect = useWeb3AuthConnect.useWeb3AuthConnect;
|
|
68
72
|
exports.Web3AuthProvider = Web3AuthProvider.Web3AuthProvider;
|
|
@@ -7,8 +7,8 @@ var react = require('react');
|
|
|
7
7
|
var viem = require('viem');
|
|
8
8
|
var wagmi = require('wagmi');
|
|
9
9
|
var connectors = require('wagmi/connectors');
|
|
10
|
-
var useWeb3Auth = require('../hooks/useWeb3Auth.js');
|
|
11
10
|
var react$1 = require('@web3auth/no-modal/react');
|
|
11
|
+
var useWeb3Auth = require('../hooks/useWeb3Auth.js');
|
|
12
12
|
require('@babel/runtime/helpers/defineProperty');
|
|
13
13
|
require('@web3auth/auth');
|
|
14
14
|
require('deepmerge');
|
|
@@ -26,6 +26,7 @@ require('react-i18next');
|
|
|
26
26
|
require('../../ui/localeImport.js');
|
|
27
27
|
require('../../ui/components/SpinnerLoader/SpinnerLoader.css.js');
|
|
28
28
|
require('../../ui/context/RootContext.js');
|
|
29
|
+
require('../../ui/containers/AccountLinking/AccountLinking.js');
|
|
29
30
|
require('classnames');
|
|
30
31
|
require('react-qrcode-logo');
|
|
31
32
|
require('../../ui/containers/Login/Login.js');
|
|
@@ -95,7 +96,10 @@ function Web3AuthWagmiProvider({
|
|
|
95
96
|
}) {
|
|
96
97
|
const {
|
|
97
98
|
isConnected,
|
|
98
|
-
connection
|
|
99
|
+
connection,
|
|
100
|
+
web3Auth: {
|
|
101
|
+
primaryConnectorName
|
|
102
|
+
}
|
|
99
103
|
} = useWeb3Auth.useWeb3Auth();
|
|
100
104
|
const {
|
|
101
105
|
disconnect
|
|
@@ -104,6 +108,7 @@ function Web3AuthWagmiProvider({
|
|
|
104
108
|
const {
|
|
105
109
|
mutate: reconnect
|
|
106
110
|
} = wagmi.useReconnect();
|
|
111
|
+
const lastSyncedWeb3AuthConnection = react.useRef(null);
|
|
107
112
|
wagmi.useConnectionEffect({
|
|
108
113
|
onDisconnect: async () => {
|
|
109
114
|
noModal.log.info("Disconnected from wagmi");
|
|
@@ -117,22 +122,33 @@ function Web3AuthWagmiProvider({
|
|
|
117
122
|
}
|
|
118
123
|
});
|
|
119
124
|
react.useEffect(() => {
|
|
120
|
-
(async
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
(async _connection$ethereumP => {
|
|
126
|
+
const newConnection = connection !== null && connection !== void 0 ? connection : null;
|
|
127
|
+
const newEth = (_connection$ethereumP = connection === null || connection === void 0 ? void 0 : connection.ethereumProvider) !== null && _connection$ethereumP !== void 0 ? _connection$ethereumP : null;
|
|
128
|
+
if (isConnected && newConnection && newEth && newConnection.connectorName === primaryConnectorName) {
|
|
129
|
+
// `ethereumProvider` is a stable proxy (`commonJRPCProvider`) across account switches,
|
|
130
|
+
// so key wagmi resyncs off the Web3Auth connection object instead of provider identity.
|
|
131
|
+
if (lastSyncedWeb3AuthConnection.current !== newConnection) {
|
|
132
|
+
if (getWeb3authConnector(wagmiConfig)) {
|
|
133
|
+
resetConnectorState(wagmiConfig);
|
|
134
|
+
}
|
|
135
|
+
lastSyncedWeb3AuthConnection.current = newConnection;
|
|
136
|
+
const connector = await setupConnector(newEth, wagmiConfig);
|
|
137
|
+
if (!connector) {
|
|
138
|
+
noModal.log.error("Failed to setup react wagmi connector");
|
|
139
|
+
throw new Error("Failed to setup connector");
|
|
140
|
+
}
|
|
141
|
+
await connectWeb3AuthWithWagmi(connector, wagmiConfig);
|
|
142
|
+
reconnect();
|
|
126
143
|
}
|
|
127
|
-
await connectWeb3AuthWithWagmi(connector, wagmiConfig);
|
|
128
|
-
reconnect();
|
|
129
144
|
} else if (!isConnected) {
|
|
145
|
+
lastSyncedWeb3AuthConnection.current = null;
|
|
130
146
|
if (wagmiConfig.state.status === "connected") {
|
|
131
147
|
await disconnectWeb3AuthFromWagmi(wagmiConfig);
|
|
132
148
|
}
|
|
133
149
|
}
|
|
134
150
|
})();
|
|
135
|
-
}, [isConnected, wagmiConfig, connection, reconnect]);
|
|
151
|
+
}, [isConnected, wagmiConfig, connection, reconnect, primaryConnectorName]);
|
|
136
152
|
return /*#__PURE__*/react.createElement(react.Fragment, null, children);
|
|
137
153
|
}
|
|
138
154
|
function WagmiProvider(_ref) {
|
|
@@ -216,7 +232,6 @@ function WagmiProvider(_ref) {
|
|
|
216
232
|
finalConfig.chains = [wagmiChains[0], ...wagmiChains.slice(1)];
|
|
217
233
|
}
|
|
218
234
|
return wagmi.createConfig(finalConfig);
|
|
219
|
-
// eslint-disable-next-line react-hooks/preserve-manual-memoization
|
|
220
235
|
}, [config, web3Auth, isInitialized]);
|
|
221
236
|
return /*#__PURE__*/react.createElement(wagmi.WagmiProvider, // typecast to WagmiProviderPropsBase to avoid type error
|
|
222
237
|
// as we are omitting the config prop from WagmiProviderProps
|
|
@@ -21,25 +21,25 @@ function BottomSheet({
|
|
|
21
21
|
};
|
|
22
22
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
23
23
|
children: [jsxRuntime.jsx("div", {
|
|
24
|
-
className: utils.cn("w3a--bottom-sheet-bg
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
24
|
+
className: utils.cn("w3a--bottom-sheet-bg wta:fixed wta:left-0 wta:top-0 wta:size-full wta:transition-opacity wta:duration-300", {
|
|
25
|
+
"wta:rounded-[30px]": borderRadiusType === "large",
|
|
26
|
+
"wta:rounded-2xl": borderRadiusType === "medium",
|
|
27
|
+
"wta:rounded-none": borderRadiusType === "small"
|
|
28
28
|
}),
|
|
29
29
|
onClick: handleClose,
|
|
30
30
|
"aria-hidden": "true",
|
|
31
31
|
role: "button"
|
|
32
32
|
}), jsxRuntime.jsxs("div", {
|
|
33
|
-
className: utils.cn(`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
${isShown ? "
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
33
|
+
className: utils.cn(`wta:fixed wta:bottom-2 wta:left-2 wta:mx-auto wta:flex wta:w-[96%] wta:flex-col
|
|
34
|
+
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
|
|
35
|
+
wta:ease-out wta:dark:border-app-gray-600 wta:dark:bg-app-dark-surface-main
|
|
36
|
+
${isShown ? "wta:translate-y-0 wta:delay-700" : "wta:translate-y-full"}`, {
|
|
37
|
+
"wta:rounded-[30px]": borderRadiusType === "large",
|
|
38
|
+
"wta:rounded-2xl": borderRadiusType === "medium",
|
|
39
|
+
"wta:rounded-none": borderRadiusType === "small"
|
|
40
40
|
}, sheetClassName),
|
|
41
41
|
children: [showCloseButton && jsxRuntime.jsx("div", {
|
|
42
|
-
className: "
|
|
42
|
+
className: "wta:absolute wta:right-4 wta:top-[16px] wta:z-10 wta:cursor-pointer",
|
|
43
43
|
children: jsxRuntime.jsx("svg", {
|
|
44
44
|
width: "13",
|
|
45
45
|
height: "13",
|
|
@@ -47,7 +47,7 @@ function BottomSheet({
|
|
|
47
47
|
fill: "none",
|
|
48
48
|
xmlns: "http://www.w3.org/2000/svg",
|
|
49
49
|
onClick: onClose,
|
|
50
|
-
className: "
|
|
50
|
+
className: "wta:text-app-gray-500 wta:hover:text-app-gray-900 wta:dark:text-app-gray-200 wta:dark:hover:text-app-white",
|
|
51
51
|
children: jsxRuntime.jsx("path", {
|
|
52
52
|
fillRule: "evenodd",
|
|
53
53
|
clipRule: "evenodd",
|
|
@@ -39,12 +39,12 @@ function SocialLoginButton(props) {
|
|
|
39
39
|
type: "button",
|
|
40
40
|
onClick: e => onClick && onClick(e),
|
|
41
41
|
className: utils.cn("w3a--btn", btnStyle, {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
42
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
43
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
44
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
45
45
|
}),
|
|
46
46
|
children: [showIcon && getProviderIcon(method, isDark, isPrimaryBtn), children, showText && jsxRuntime.jsx("p", {
|
|
47
|
-
className: "
|
|
47
|
+
className: "wta:text-base wta:font-normal wta:text-app-gray-900 wta:dark:text-app-white",
|
|
48
48
|
children: text
|
|
49
49
|
})]
|
|
50
50
|
});
|
|
@@ -35,17 +35,17 @@ function ButtonWallet(props) {
|
|
|
35
35
|
};
|
|
36
36
|
return jsxRuntime.jsxs("button", {
|
|
37
37
|
type: "button",
|
|
38
|
-
className: cn(`
|
|
39
|
-
hover:
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
38
|
+
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
|
|
39
|
+
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`, {
|
|
40
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
41
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
42
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
43
43
|
}),
|
|
44
44
|
onClick: handleBtnClick,
|
|
45
45
|
children: [jsxRuntime.jsxs("div", {
|
|
46
|
-
className: "
|
|
46
|
+
className: "wta:flex wta:items-center wta:gap-x-2",
|
|
47
47
|
children: [jsxRuntime.jsx("figure", {
|
|
48
|
-
className: "
|
|
48
|
+
className: "wta:size-5",
|
|
49
49
|
children: jsxRuntime.jsx(Image, {
|
|
50
50
|
imageData: button.icon,
|
|
51
51
|
imageId: `login-${button.name}`,
|
|
@@ -57,15 +57,15 @@ function ButtonWallet(props) {
|
|
|
57
57
|
extension: button.imgExtension || "webp"
|
|
58
58
|
})
|
|
59
59
|
}), jsxRuntime.jsx("p", {
|
|
60
|
-
className: "
|
|
60
|
+
className: "wta:max-w-[180px] wta:truncate wta:text-base wta:font-normal wta:text-app-gray-700 wta:dark:text-app-white",
|
|
61
61
|
children: label
|
|
62
62
|
})]
|
|
63
63
|
}), button.hasInjectedWallet && jsxRuntime.jsx("span", {
|
|
64
|
-
className: "
|
|
64
|
+
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 \n wta:dark:border wta:dark:border-app-primary-400 wta:dark:bg-transparent wta:dark:text-app-primary-400",
|
|
65
65
|
children: t("modal.external.installed")
|
|
66
66
|
}), jsxRuntime.jsx("img", {
|
|
67
67
|
id: "injected-wallet-arrow",
|
|
68
|
-
className: "
|
|
68
|
+
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\n wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
|
|
69
69
|
src: utils.getIcons(isDark ? "chevron-right-light" : "chevron-right-dark"),
|
|
70
70
|
alt: "arrow"
|
|
71
71
|
})]
|
|
@@ -16,32 +16,32 @@ function Footer({
|
|
|
16
16
|
i18n: localeImport
|
|
17
17
|
});
|
|
18
18
|
return jsxRuntime.jsxs("div", {
|
|
19
|
-
className: "
|
|
19
|
+
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",
|
|
20
20
|
children: [(privacyPolicy || termsOfService) && jsxRuntime.jsxs("p", {
|
|
21
|
-
className: "
|
|
21
|
+
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",
|
|
22
22
|
children: [t("modal.footer.by-signing-in"), " ", termsOfService && jsxRuntime.jsxs("a", {
|
|
23
23
|
href: termsOfService,
|
|
24
|
-
className: "
|
|
24
|
+
className: "wta:text-app-primary-600 wta:dark:text-app-primary-500",
|
|
25
25
|
children: [t("modal.footer.terms-of-service"), " "]
|
|
26
26
|
}), privacyPolicy && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
27
27
|
children: [t("modal.footer.and"), " ", jsxRuntime.jsx("a", {
|
|
28
28
|
href: privacyPolicy,
|
|
29
|
-
className: "
|
|
29
|
+
className: "wta:text-app-primary-600 wta:dark:text-app-primary-500",
|
|
30
30
|
children: t("modal.footer.privacy-policy")
|
|
31
31
|
})]
|
|
32
32
|
})]
|
|
33
33
|
}), jsxRuntime.jsxs("div", {
|
|
34
|
-
className: "
|
|
34
|
+
className: "wta:flex wta:items-center wta:justify-center wta:gap-2",
|
|
35
35
|
children: [jsxRuntime.jsx("img", {
|
|
36
36
|
height: "36",
|
|
37
37
|
src: "https://images.web3auth.io/metamask-footer-logo-light.svg",
|
|
38
38
|
alt: "Web3Auth Logo Light",
|
|
39
|
-
className: "
|
|
39
|
+
className: "wta:block wta:h-9 wta:dark:hidden"
|
|
40
40
|
}), jsxRuntime.jsx("img", {
|
|
41
41
|
height: "36",
|
|
42
42
|
src: "https://images.web3auth.io/metamask-footer-logo-dark.svg",
|
|
43
43
|
alt: "Web3Auth Logo Dark",
|
|
44
|
-
className: "
|
|
44
|
+
className: "wta:hidden wta:h-9 wta:dark:block"
|
|
45
45
|
})]
|
|
46
46
|
})]
|
|
47
47
|
});
|
|
@@ -37,7 +37,7 @@ function Image(props) {
|
|
|
37
37
|
height: height,
|
|
38
38
|
width: width,
|
|
39
39
|
alt: hoverImageId,
|
|
40
|
-
className: utils.cn("
|
|
40
|
+
className: utils.cn("wta:object-contain", `wta:h-${height} wta:w-${width}`)
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
return jsxRuntime.jsx("img", {
|
|
@@ -46,7 +46,7 @@ function Image(props) {
|
|
|
46
46
|
height: height,
|
|
47
47
|
width: width,
|
|
48
48
|
alt: hoverImageId,
|
|
49
|
-
className: utils.cn("
|
|
49
|
+
className: utils.cn("wta:rounded wta:object-contain", `wta:h-${height} wta:w-${width}`)
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
if (imageData) {
|
|
@@ -56,7 +56,7 @@ function Image(props) {
|
|
|
56
56
|
height: height,
|
|
57
57
|
width: width,
|
|
58
58
|
alt: imageId,
|
|
59
|
-
className: utils.cn("
|
|
59
|
+
className: utils.cn("wta:object-contain", `wta:h-${height} wta:w-${width}`),
|
|
60
60
|
onError: ({
|
|
61
61
|
currentTarget
|
|
62
62
|
}) => {
|
|
@@ -74,7 +74,7 @@ function Image(props) {
|
|
|
74
74
|
height: height,
|
|
75
75
|
width: width,
|
|
76
76
|
alt: imageId,
|
|
77
|
-
className: utils.cn("
|
|
77
|
+
className: utils.cn("wta:rounded wta:object-contain", `wta:h-${height} wta:w-${width}`),
|
|
78
78
|
onError: ({
|
|
79
79
|
currentTarget
|
|
80
80
|
}) => {
|
|
@@ -29,20 +29,20 @@ function ConnectingStatus(props) {
|
|
|
29
29
|
width: "40"
|
|
30
30
|
}), [connector]);
|
|
31
31
|
return jsxRuntime.jsxs("div", {
|
|
32
|
-
className: "
|
|
32
|
+
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",
|
|
33
33
|
children: [jsxRuntime.jsx(SpinnerLoader, {
|
|
34
34
|
width: 95,
|
|
35
35
|
height: 95,
|
|
36
36
|
children: providerIcon
|
|
37
37
|
}), jsxRuntime.jsxs("div", {
|
|
38
|
-
className: "
|
|
38
|
+
className: "wta:flex wta:flex-col wta:gap-y-1",
|
|
39
39
|
children: [jsxRuntime.jsx("div", {
|
|
40
|
-
className: "
|
|
40
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
41
41
|
children: t("modal.adapter-loader.message1", {
|
|
42
42
|
adapter: connectorName
|
|
43
43
|
})
|
|
44
44
|
}), jsxRuntime.jsx("div", {
|
|
45
|
-
className: "
|
|
45
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
46
46
|
children: t("modal.adapter-loader.message2", {
|
|
47
47
|
adapter: connectorName
|
|
48
48
|
})
|
|
@@ -60,7 +60,7 @@ function ConnectedStatus(props) {
|
|
|
60
60
|
message
|
|
61
61
|
} = props;
|
|
62
62
|
return jsxRuntime.jsxs("div", {
|
|
63
|
-
className: "
|
|
63
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-2 wta:pt-6",
|
|
64
64
|
children: [jsxRuntime.jsx("svg", {
|
|
65
65
|
xmlns: "http://www.w3.org/2000/svg",
|
|
66
66
|
fill: "none",
|
|
@@ -72,8 +72,8 @@ function ConnectedStatus(props) {
|
|
|
72
72
|
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",
|
|
73
73
|
clipRule: "evenodd"
|
|
74
74
|
})
|
|
75
|
-
}), jsxRuntime.jsx("p", {
|
|
76
|
-
className: "
|
|
75
|
+
}), message && jsxRuntime.jsx("p", {
|
|
76
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
77
77
|
children: message
|
|
78
78
|
})]
|
|
79
79
|
});
|
|
@@ -88,7 +88,7 @@ function ErroredStatus(props) {
|
|
|
88
88
|
message
|
|
89
89
|
} = props;
|
|
90
90
|
return jsxRuntime.jsxs("div", {
|
|
91
|
-
className: "
|
|
91
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-2 wta:pt-6",
|
|
92
92
|
children: [jsxRuntime.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
|
-
}), jsxRuntime.jsx("p", {
|
|
104
|
-
className: "
|
|
103
|
+
}), message && jsxRuntime.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 jsxRuntime.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: [jsxRuntime.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
|
}), jsxRuntime.jsx("div", {
|
|
132
|
-
className: "
|
|
132
|
+
className: "wta:flex wta:justify-center",
|
|
133
133
|
children: jsxRuntime.jsx(SpinnerLoader, {
|
|
134
134
|
width: 95,
|
|
135
135
|
height: 95,
|
|
@@ -141,11 +141,11 @@ function AuthorizingStatus(props) {
|
|
|
141
141
|
})
|
|
142
142
|
})
|
|
143
143
|
}), jsxRuntime.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
|
}), jsxRuntime.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 jsxRuntime.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: [jsxRuntime.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: jsxRuntime.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: jsxRuntime.jsx("path", {
|
|
190
190
|
stroke: "currentColor",
|
|
191
191
|
strokeLinecap: "round",
|
|
@@ -195,17 +195,17 @@ function ConsentRequiredStatus(props) {
|
|
|
195
195
|
})
|
|
196
196
|
})
|
|
197
197
|
}), jsxRuntime.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) && jsxRuntime.jsxs("div", {
|
|
203
|
-
className: "
|
|
203
|
+
className: "wta:flex wta:w-full wta:flex-col wta:gap-y-2",
|
|
204
204
|
children: [tncLink && jsxRuntime.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
|
}), jsxRuntime.jsxs("div", {
|
|
222
|
-
className: "
|
|
222
|
+
className: "wta:flex wta:w-full wta:gap-x-2",
|
|
223
223
|
children: [jsxRuntime.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: jsxRuntime.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: jsxRuntime.jsx("p", {
|
|
240
|
-
className: "
|
|
240
|
+
className: "wta:text-app-onPrimary",
|
|
241
241
|
children: t("modal.consent.accept", {
|
|
242
242
|
defaultValue: "Accept"
|
|
243
243
|
})
|
|
@@ -281,7 +281,7 @@ function Loader(props) {
|
|
|
281
281
|
}, [isConnectedAccordingToAuthenticationMode, hideSuccessScreen, onClose]);
|
|
282
282
|
const isConsentRequiringStatus = modalStatus === interfaces.MODAL_STATUS.CONSENT_REQUIRING;
|
|
283
283
|
return jsxRuntime.jsxs("div", {
|
|
284
|
-
className: isConsentRequiringStatus ? "
|
|
284
|
+
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",
|
|
285
285
|
children: [modalStatus === interfaces.MODAL_STATUS.CONNECTING && jsxRuntime.jsx(ConnectingStatus, {
|
|
286
286
|
connector: connector,
|
|
287
287
|
connectorName: connectorName
|
|
@@ -30,7 +30,7 @@ const LoginHint = ({
|
|
|
30
30
|
};
|
|
31
31
|
}, [isDark]);
|
|
32
32
|
return jsxRuntime.jsxs("div", {
|
|
33
|
-
className: "
|
|
33
|
+
className: "wta:relative",
|
|
34
34
|
"aria-hidden": true,
|
|
35
35
|
onMouseEnter: handleMouseEnter,
|
|
36
36
|
onMouseLeave: handleMouseLeave,
|
|
@@ -40,9 +40,9 @@ const LoginHint = ({
|
|
|
40
40
|
children: [children, showPopover && !hideHint && jsxRuntime.jsxs("div", {
|
|
41
41
|
"data-popover": true,
|
|
42
42
|
role: "tooltip",
|
|
43
|
-
className: utils.cn("
|
|
43
|
+
className: utils.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"),
|
|
44
44
|
children: [content, jsxRuntime.jsx("div", {
|
|
45
|
-
className: "
|
|
45
|
+
className: "wta:absolute",
|
|
46
46
|
style: triangleStyle
|
|
47
47
|
})]
|
|
48
48
|
})]
|
|
@@ -37,34 +37,34 @@ function Modal(props) {
|
|
|
37
37
|
}
|
|
38
38
|
}, [open]);
|
|
39
39
|
const positions = react.useMemo(() => ({
|
|
40
|
-
center: "
|
|
41
|
-
"top-center": "
|
|
42
|
-
"bottom-center": "
|
|
43
|
-
left: "sm:
|
|
44
|
-
right: "sm:
|
|
40
|
+
center: "wta:top-0 wta:left-0 wta:items-center wta:justify-center",
|
|
41
|
+
"top-center": "wta:top-8 wta:left-0 wta:items-start wta:justify-center",
|
|
42
|
+
"bottom-center": "wta:bottom-8 wta:left-0 wta:items-end wta:justify-center",
|
|
43
|
+
left: "wta:sm:left-8 wta:flex wta:items-center wta:justify-center wta:sm:justify-start",
|
|
44
|
+
right: "wta:sm:right-8 wta:flex wta:items-center wta:justify-center wta:sm:justify-end"
|
|
45
45
|
}), []);
|
|
46
46
|
const placementClass = react.useMemo(() => positions[placement], [placement, positions]);
|
|
47
47
|
const onCloseHandler = () => {
|
|
48
48
|
if (onClose) onClose();
|
|
49
49
|
};
|
|
50
50
|
return jsxRuntime.jsx("div", {
|
|
51
|
-
className: utils.cn("
|
|
52
|
-
"
|
|
53
|
-
"
|
|
51
|
+
className: utils.cn("wta:fixed wta:z-50 wta:overflow-hidden wta:flex wta:transition-all", placementClass, {
|
|
52
|
+
"wta:w-screen wta:h-screen": isOpen,
|
|
53
|
+
"wta:w-0 wta:h-0 wta:delay-500": !isOpen
|
|
54
54
|
}),
|
|
55
55
|
children: jsxRuntime.jsxs("div", {
|
|
56
|
-
className: utils.cn("
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
56
|
+
className: utils.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", {
|
|
57
|
+
"wta:translate-y-0 wta:delay-100": isOpen,
|
|
58
|
+
"wta:translate-y-[100vh]": !isOpen,
|
|
59
|
+
"wta:p-4": padding,
|
|
60
|
+
"wta:shadow-xl wta:sm:shadow-lg": shadow,
|
|
61
|
+
"wta:border wta:border-app-gray-100 wta:dark:border-app-gray-800": border,
|
|
62
|
+
"wta:rounded-[30px]": borderRadius === "large",
|
|
63
|
+
"wta:rounded-2xl": borderRadius === "medium",
|
|
64
|
+
"wta:rounded-none": borderRadius === "small"
|
|
65
65
|
}),
|
|
66
66
|
children: [showCloseIcon && jsxRuntime.jsx("div", {
|
|
67
|
-
className: "
|
|
67
|
+
className: "wta:absolute wta:right-6 wta:top-[30px] wta:z-10 wta:cursor-pointer",
|
|
68
68
|
children: jsxRuntime.jsx("svg", {
|
|
69
69
|
width: "13",
|
|
70
70
|
height: "13",
|
|
@@ -72,7 +72,7 @@ function Modal(props) {
|
|
|
72
72
|
fill: "none",
|
|
73
73
|
xmlns: "http://www.w3.org/2000/svg",
|
|
74
74
|
onClick: onCloseHandler,
|
|
75
|
-
className: "
|
|
75
|
+
className: "wta:text-app-gray-500 wta:hover:text-app-gray-900 wta:dark:text-app-gray-200 wta:dark:hover:text-app-white",
|
|
76
76
|
children: jsxRuntime.jsx("path", {
|
|
77
77
|
fillRule: "evenodd",
|
|
78
78
|
clipRule: "evenodd",
|