@web3auth/modal 10.0.0-beta.2 → 10.0.0-beta.3
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/config.js +1 -3
- package/dist/lib.cjs/packages/modal/src/modalManager.js +44 -21
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +8 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +12 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +13 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +5 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/Login.js +45 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +10 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +18 -32
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +15 -34
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +2 -1
- package/dist/lib.cjs/packages/modal/src/ui/config.js +2 -1
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +4 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/handlers/AbstractHandler.js +3 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +32 -31
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +5 -3
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +15 -3
- package/dist/lib.cjs/types/interface.d.ts +3 -1
- package/dist/lib.cjs/types/modalManager.d.ts +4 -1
- package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +2 -2
- package/dist/lib.cjs/types/ui/config.d.ts +1 -1
- package/dist/lib.cjs/types/ui/constants.d.ts +2 -0
- package/dist/lib.cjs/types/ui/handlers/AbstractHandler.d.ts +1 -1
- package/dist/lib.cjs/types/ui/interfaces.d.ts +5 -3
- package/dist/lib.esm/packages/modal/src/config.js +1 -3
- package/dist/lib.esm/packages/modal/src/modalManager.js +46 -22
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +8 -1
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +14 -6
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +2 -2
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +13 -5
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +5 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/Login/Login.js +48 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +11 -6
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +18 -33
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +16 -35
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +3 -2
- package/dist/lib.esm/packages/modal/src/ui/config.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/constants.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/handlers/AbstractHandler.js +3 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +32 -31
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +6 -4
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +16 -3
- package/dist/modal.umd.min.js +1 -1
- package/package.json +11 -11
|
@@ -72,18 +72,18 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
72
72
|
if (this.options.modalConfig) this.modalConfig = this.options.modalConfig;
|
|
73
73
|
noModal.log.info("modalConfig", this.modalConfig);
|
|
74
74
|
}
|
|
75
|
-
async initModal() {
|
|
75
|
+
async initModal(options) {
|
|
76
|
+
const {
|
|
77
|
+
signal
|
|
78
|
+
} = options || {};
|
|
76
79
|
super.checkInitRequirements();
|
|
77
80
|
// get project config and wallet registry
|
|
78
81
|
const {
|
|
79
82
|
projectConfig,
|
|
80
83
|
walletRegistry
|
|
81
84
|
} = await this.getProjectAndWalletConfig();
|
|
82
|
-
this.options.uiConfig = deepmerge(noModal.cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
83
|
-
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = utils.getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
84
|
-
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
85
|
-
this.options.uiConfig = deepmerge(projectConfig.loginModal || {}, this.options.uiConfig || {});
|
|
86
85
|
// init config
|
|
86
|
+
this.initUIConfig(projectConfig);
|
|
87
87
|
super.initAccountAbstractionConfig(projectConfig);
|
|
88
88
|
super.initChainsConfig(projectConfig);
|
|
89
89
|
super.initCachedConnectorAndChainId();
|
|
@@ -96,6 +96,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
96
96
|
connectorListener: this,
|
|
97
97
|
web3authClientId: this.options.clientId,
|
|
98
98
|
web3authNetwork: this.options.web3AuthNetwork,
|
|
99
|
+
authBuildEnv: this.options.authBuildEnv,
|
|
99
100
|
chainNamespaces: this.getChainNamespaces(),
|
|
100
101
|
walletRegistry: filteredWalletRegistry
|
|
101
102
|
}), {
|
|
@@ -104,22 +105,31 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
104
105
|
onExternalWalletLogin: this.onExternalWalletLogin,
|
|
105
106
|
onModalVisibility: this.onModalVisibility
|
|
106
107
|
});
|
|
107
|
-
await this.loginModal.initModal();
|
|
108
|
+
await noModal.withAbort(() => this.loginModal.initModal(), signal);
|
|
108
109
|
// setup common JRPC provider
|
|
109
|
-
await this.setupCommonJRPCProvider();
|
|
110
|
+
await noModal.withAbort(() => this.setupCommonJRPCProvider(), signal);
|
|
110
111
|
// initialize connectors
|
|
111
112
|
this.on(noModal.CONNECTOR_EVENTS.CONNECTORS_UPDATED, ({
|
|
112
113
|
connectors: newConnectors
|
|
113
|
-
}) =>
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
}) => {
|
|
115
|
+
const onAbortHandler = () => {
|
|
116
|
+
var _this$connectors;
|
|
117
|
+
noModal.log.debug("init aborted");
|
|
118
|
+
if (((_this$connectors = this.connectors) === null || _this$connectors === void 0 ? void 0 : _this$connectors.length) > 0) {
|
|
119
|
+
super.cleanup();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
noModal.withAbort(() => this.initConnectors({
|
|
123
|
+
connectors: newConnectors,
|
|
124
|
+
projectConfig,
|
|
125
|
+
disabledExternalWallets
|
|
126
|
+
}), signal, onAbortHandler);
|
|
120
127
|
});
|
|
128
|
+
await noModal.withAbort(() => super.loadConnectors({
|
|
129
|
+
projectConfig
|
|
130
|
+
}), signal);
|
|
121
131
|
// initialize plugins
|
|
122
|
-
await
|
|
132
|
+
await noModal.withAbort(() => super.initPlugins(), signal);
|
|
123
133
|
}
|
|
124
134
|
async connect() {
|
|
125
135
|
if (!this.loginModal) throw noModal.WalletInitializationError.notReady("Login modal is not initialized");
|
|
@@ -213,6 +223,23 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
213
223
|
walletRegistry
|
|
214
224
|
};
|
|
215
225
|
}
|
|
226
|
+
initUIConfig(projectConfig) {
|
|
227
|
+
this.options.uiConfig = deepmerge(noModal.cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
228
|
+
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = utils.getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
229
|
+
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
230
|
+
this.options.uiConfig = deepmerge(projectConfig.loginModal || {}, this.options.uiConfig);
|
|
231
|
+
// merge login methods order from project config and user config, with user config taking precedence
|
|
232
|
+
const defaultAuthConnections = projectConfig.embeddedWalletAuth.filter(x => x.isDefault).map(x => x.authConnection);
|
|
233
|
+
const mergedAuthConnections = [...(this.options.uiConfig.loginMethodsOrder || []), ...defaultAuthConnections];
|
|
234
|
+
const loginMethodsOrder = [];
|
|
235
|
+
const authConnectionSet = new Set();
|
|
236
|
+
for (const authConnection of mergedAuthConnections) {
|
|
237
|
+
if (authConnectionSet.has(authConnection)) continue;
|
|
238
|
+
authConnectionSet.add(authConnection);
|
|
239
|
+
loginMethodsOrder.push(authConnection);
|
|
240
|
+
}
|
|
241
|
+
this.options.uiConfig.loginMethodsOrder = loginMethodsOrder;
|
|
242
|
+
}
|
|
216
243
|
async initConnectors({
|
|
217
244
|
connectors,
|
|
218
245
|
projectConfig,
|
|
@@ -280,9 +307,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
280
307
|
groupedAuthConnectionId: groupedAuthConnectionId,
|
|
281
308
|
extraLoginOptions: authConnectionConfig.jwtParameters,
|
|
282
309
|
isDefault: true,
|
|
283
|
-
showOnModal: true
|
|
284
|
-
showOnDesktop: true,
|
|
285
|
-
showOnMobile: true
|
|
310
|
+
showOnModal: true
|
|
286
311
|
};
|
|
287
312
|
}
|
|
288
313
|
embedWalletConfigMap.set(groupedAuthConnectionId || authConnectionId, authConnectionConfig);
|
|
@@ -328,9 +353,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
328
353
|
// start with the default config of connector.
|
|
329
354
|
const defaultConnectorConfig = {
|
|
330
355
|
label: noModal.CONNECTOR_NAMES[connectorName] || connectorName.split("-").map(config$1.capitalizeFirstLetter).join(" "),
|
|
331
|
-
showOnModal: true
|
|
332
|
-
showOnMobile: true,
|
|
333
|
-
showOnDesktop: true
|
|
356
|
+
showOnModal: true
|
|
334
357
|
};
|
|
335
358
|
this.modalConfig.connectors[connectorName] = _objectSpread(_objectSpread({}, defaultConnectorConfig), ((_this$modalConfig3 = this.modalConfig) === null || _this$modalConfig3 === void 0 || (_this$modalConfig3 = _this$modalConfig3.connectors) === null || _this$modalConfig3 === void 0 ? void 0 : _this$modalConfig3[connectorName]) || {});
|
|
336
359
|
// check if connector is configured/added by user and exist in connectors map.
|
|
@@ -83,11 +83,14 @@ function Web3AuthInnerProvider(params) {
|
|
|
83
83
|
setWeb3Auth(web3AuthInstance);
|
|
84
84
|
}, [config]);
|
|
85
85
|
react.useEffect(() => {
|
|
86
|
+
const controller = new AbortController();
|
|
86
87
|
async function init() {
|
|
87
88
|
try {
|
|
88
89
|
setInitError(null);
|
|
89
90
|
setIsInitializing(true);
|
|
90
|
-
await web3Auth.initModal(
|
|
91
|
+
await web3Auth.initModal({
|
|
92
|
+
signal: controller.signal
|
|
93
|
+
});
|
|
91
94
|
} catch (error) {
|
|
92
95
|
setInitError(error);
|
|
93
96
|
} finally {
|
|
@@ -95,6 +98,9 @@ function Web3AuthInnerProvider(params) {
|
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
if (web3Auth) init();
|
|
101
|
+
return () => {
|
|
102
|
+
controller.abort();
|
|
103
|
+
};
|
|
98
104
|
}, [web3Auth, config]);
|
|
99
105
|
react.useEffect(() => {
|
|
100
106
|
const addState = async () => {
|
|
@@ -154,6 +160,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
154
160
|
web3Auth.off(noModal.CONNECTOR_EVENTS.DISCONNECTED, disconnectedListener);
|
|
155
161
|
web3Auth.off(noModal.CONNECTOR_EVENTS.CONNECTING, connectingListener);
|
|
156
162
|
web3Auth.off(noModal.CONNECTOR_EVENTS.ERRORED, errorListener);
|
|
163
|
+
web3Auth.cleanup();
|
|
157
164
|
}
|
|
158
165
|
};
|
|
159
166
|
}, [web3Auth]);
|
|
@@ -44,7 +44,7 @@ function BottomSheet({
|
|
|
44
44
|
fill: "none",
|
|
45
45
|
xmlns: "http://www.w3.org/2000/svg",
|
|
46
46
|
onClick: onClose,
|
|
47
|
-
className: "w3a--text-app-gray-500 dark:w3a--text-app-gray-200",
|
|
47
|
+
className: "w3a--text-app-gray-500 hover:w3a--text-app-gray-900 dark:w3a--text-app-gray-200 dark:hover:w3a--text-app-white",
|
|
48
48
|
children: jsxRuntime.jsx("path", {
|
|
49
49
|
fillRule: "evenodd",
|
|
50
50
|
clipRule: "evenodd",
|
|
@@ -6,7 +6,7 @@ var utils = require('../../../utils.js');
|
|
|
6
6
|
var Image = require('../../Image/Image.js');
|
|
7
7
|
|
|
8
8
|
function getProviderIcon(method, isDark, isPrimaryBtn) {
|
|
9
|
-
const imageId = method === auth.AUTH_CONNECTION.TWITTER ? `login-
|
|
9
|
+
const imageId = method === auth.AUTH_CONNECTION.TWITTER ? `login-X${isDark ? "-light" : "-dark"}` : `login-${method}${isDark ? "-light" : "-dark"}`;
|
|
10
10
|
const hoverId = method === auth.AUTH_CONNECTION.APPLE || method === auth.AUTH_CONNECTION.GITHUB || method === auth.AUTH_CONNECTION.TWITTER ? imageId : `login-${method}-active`;
|
|
11
11
|
if (isPrimaryBtn) {
|
|
12
12
|
return jsxRuntime.jsx(Image, {
|
|
@@ -4,6 +4,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var cn = require('classnames');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var reactI18next = require('react-i18next');
|
|
7
|
+
var ThemeContext = require('../../../context/ThemeContext.js');
|
|
7
8
|
var localeImport = require('../../../localeImport.js');
|
|
8
9
|
var utils = require('../../../utils.js');
|
|
9
10
|
var Image = require('../../Image/Image.js');
|
|
@@ -20,6 +21,7 @@ function ButtonWallet(props) {
|
|
|
20
21
|
label,
|
|
21
22
|
buttonRadius
|
|
22
23
|
} = props;
|
|
24
|
+
const isDark = react.useContext(ThemeContext.ThemedContext);
|
|
23
25
|
const isLink = react.useMemo(() => deviceDetails.platform !== "desktop" && button.href && button.hasWalletConnect && !button.hasInjectedWallet, [deviceDetails, button]);
|
|
24
26
|
const href = react.useMemo(() => button.href ? utils.formatIOSMobile({
|
|
25
27
|
uri: walletConnectUri,
|
|
@@ -34,7 +36,8 @@ function ButtonWallet(props) {
|
|
|
34
36
|
};
|
|
35
37
|
return jsxRuntime.jsxs("button", {
|
|
36
38
|
type: "button",
|
|
37
|
-
className: cn(`w3a--flex w3a--w-full w3a--items-center w3a--justify-between w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200
|
|
39
|
+
className: cn(`w3a--group w3a--relative w3a--overflow-hidden w3a--flex w3a--w-full w3a--items-center w3a--justify-between w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200
|
|
40
|
+
hover:w3a--text-app-gray-900 dark:w3a--bg-app-gray-800 dark:hover:w3a--bg-app-gray-600 active:w3a--scale-95 w3a--transition-all w3a--duration-150`, {
|
|
38
41
|
"w3a--rounded-full": buttonRadius === "pill",
|
|
39
42
|
"w3a--rounded-lg": buttonRadius === "rounded",
|
|
40
43
|
"w3a--rounded-none": buttonRadius === "square"
|
|
@@ -43,7 +46,7 @@ function ButtonWallet(props) {
|
|
|
43
46
|
children: [jsxRuntime.jsxs("div", {
|
|
44
47
|
className: "w3a--flex w3a--items-center w3a--gap-x-2",
|
|
45
48
|
children: [jsxRuntime.jsx("figure", {
|
|
46
|
-
className:
|
|
49
|
+
className: "w3a--size-5",
|
|
47
50
|
children: jsxRuntime.jsx(Image, {
|
|
48
51
|
imageData: button.icon,
|
|
49
52
|
imageId: `login-${button.name}`,
|
|
@@ -55,12 +58,17 @@ function ButtonWallet(props) {
|
|
|
55
58
|
extension: button.imgExtension || "webp"
|
|
56
59
|
})
|
|
57
60
|
}), jsxRuntime.jsx("p", {
|
|
58
|
-
className: "w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
|
|
61
|
+
className: "w3a--max-w-[180px] w3a--truncate w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
|
|
59
62
|
children: label
|
|
60
63
|
})]
|
|
61
64
|
}), button.hasInjectedWallet && jsxRuntime.jsx("span", {
|
|
62
|
-
className: "w3a--
|
|
65
|
+
className: "w3a--absolute w3a--right-4 w3a--top-1/2 w3a--flex w3a--w-auto -w3a--translate-y-1/2 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 w3a--transition-all w3a--duration-300 group-hover:w3a--translate-x-6 group-hover:w3a--opacity-0 \n dark:w3a--border dark:w3a--border-app-primary-400 dark:w3a--bg-transparent dark:w3a--text-app-primary-400",
|
|
63
66
|
children: t("modal.external.installed")
|
|
67
|
+
}), jsxRuntime.jsx("img", {
|
|
68
|
+
id: "injected-wallet-arrow",
|
|
69
|
+
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\n group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
70
|
+
src: utils.getIcons(isDark ? "chevron-right-light" : "chevron-right-dark"),
|
|
71
|
+
alt: "arrow"
|
|
64
72
|
})]
|
|
65
73
|
});
|
|
66
74
|
}
|
|
@@ -59,7 +59,7 @@ function ConnectWallet(props) {
|
|
|
59
59
|
}, [walletRegistry]);
|
|
60
60
|
const allUniqueButtons = react.useMemo(() => {
|
|
61
61
|
const uniqueButtonSet = new Set();
|
|
62
|
-
return
|
|
62
|
+
return customConnectorButtons.concat(allExternalButtons).filter(button => {
|
|
63
63
|
if (uniqueButtonSet.has(button.name)) return false;
|
|
64
64
|
uniqueButtonSet.add(button.name);
|
|
65
65
|
return true;
|
|
@@ -104,7 +104,7 @@ function ConnectWallet(props) {
|
|
|
104
104
|
};
|
|
105
105
|
const filteredButtons = react.useMemo(() => {
|
|
106
106
|
if (walletDiscoverySupported) {
|
|
107
|
-
return allUniqueButtons.filter(button => selectedChain === "all" || button.chainNamespaces.includes(selectedChain)).filter(button => button.name.toLowerCase().includes(walletSearch.toLowerCase()));
|
|
107
|
+
return [...allUniqueButtons.filter(button => button.hasInjectedWallet), ...allUniqueButtons.filter(button => !button.hasInjectedWallet)].filter(button => selectedChain === "all" || button.chainNamespaces.includes(selectedChain)).filter(button => button.name.toLowerCase().includes(walletSearch.toLowerCase()));
|
|
108
108
|
}
|
|
109
109
|
return installedWalletButtons;
|
|
110
110
|
}, [walletDiscoverySupported, installedWalletButtons, walletSearch, allUniqueButtons, selectedChain]);
|
|
@@ -43,11 +43,11 @@ function ConnectWalletChainFilter(props) {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
return jsxRuntime.jsx("div", {
|
|
46
|
-
className: "w3a--flex w3a--items-center w3a--justify-items-start w3a--gap-x-
|
|
46
|
+
className: "w3a--flex w3a--items-center w3a--justify-items-start w3a--gap-x-4",
|
|
47
47
|
children: chains.map(chain => jsxRuntime.jsxs("button", {
|
|
48
48
|
type: "button",
|
|
49
|
-
className: utils.cn("w3a--flex w3a--items-center w3a--justify-center w3a--gap-x-1 w3a--text-xs w3a--font-medium w3a--px-4 w3a--py-3 w3a--text-app-gray-500 dark:w3a--text-app-gray-300 hover:w3a--bg-app-gray-200 dark:hover:w3a--bg-app-gray-700 w3a--h-12 w3a--rounded-2xl", {
|
|
50
|
-
"w3a--bg-app-gray-100 dark:w3a--bg-app-gray-800 w3a--border
|
|
49
|
+
className: utils.cn("w3a--flex w3a--w-[104px] w3a--items-center w3a--justify-center w3a--gap-x-1 w3a--text-xs w3a--font-medium w3a--px-4 w3a--py-3 w3a--text-app-gray-500 dark:w3a--text-app-gray-300 hover:w3a--bg-app-gray-200 dark:hover:w3a--bg-app-gray-700 w3a--h-12 w3a--rounded-2xl w3a--border w3a--border-transparent", {
|
|
50
|
+
"w3a--bg-app-gray-100 dark:w3a--bg-app-gray-800 w3a--border-app-gray-200 dark:w3a--border-app-gray-700 w3a--text-app-gray-900 dark:w3a--text-app-white hover:!w3a--bg-app-gray-100 dark:hover:!w3a--bg-app-gray-800": selectedChain === chain.id
|
|
51
51
|
}),
|
|
52
52
|
onClick: () => setSelectedChain(chain.id),
|
|
53
53
|
children: [chain.icon && jsxRuntime.jsx("img", {
|
|
@@ -56,7 +56,7 @@ const ConnectWalletChainNamespaceSelect = props => {
|
|
|
56
56
|
}) => jsxRuntime.jsx("li", {
|
|
57
57
|
children: jsxRuntime.jsxs("button", {
|
|
58
58
|
type: "button",
|
|
59
|
-
className: "w3a--btn w3a
|
|
59
|
+
className: "w3a--btn w3a--group w3a--relative w3a--h-11 w3a--w-full w3a--items-center !w3a--justify-between w3a--overflow-hidden w3a--rounded-full",
|
|
60
60
|
onClick: () => handleExternalWalletClick({
|
|
61
61
|
connector: wallet.name,
|
|
62
62
|
chainNamespace
|
|
@@ -76,8 +76,8 @@ const ConnectWalletChainNamespaceSelect = props => {
|
|
|
76
76
|
children: displayName
|
|
77
77
|
})]
|
|
78
78
|
}), jsxRuntime.jsx("img", {
|
|
79
|
-
id: "
|
|
80
|
-
className: "w3a--
|
|
79
|
+
id: "chain-namespace-arrow",
|
|
80
|
+
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\n group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
81
81
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
82
82
|
alt: "arrow"
|
|
83
83
|
})]
|
|
@@ -29,7 +29,7 @@ function ConnectWalletHeader(props) {
|
|
|
29
29
|
xmlns: "http://www.w3.org/2000/svg",
|
|
30
30
|
fill: "none",
|
|
31
31
|
viewBox: "0 0 20 20",
|
|
32
|
-
className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
32
|
+
className: "w3a--text-app-gray-500 hover:w3a--text-app-gray-900 dark:w3a--text-app-gray-200 dark:hover:w3a--text-app-white",
|
|
33
33
|
children: jsxRuntime.jsx("path", {
|
|
34
34
|
fill: "currentColor",
|
|
35
35
|
fillRule: "evenodd",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
4
5
|
var reactI18next = require('react-i18next');
|
|
5
6
|
var localeImport = require('../../../localeImport.js');
|
|
6
7
|
var utils = require('../../../utils.js');
|
|
@@ -27,7 +28,7 @@ function WalletsFound(props) {
|
|
|
27
28
|
} = props;
|
|
28
29
|
if (isLoading) {
|
|
29
30
|
return jsxRuntime.jsx("div", {
|
|
30
|
-
className: "w3a--flex w3a--flex-col w3a--gap-y-2
|
|
31
|
+
className: "w3a--flex w3a--flex-col w3a--gap-y-2",
|
|
31
32
|
children: Array.from({
|
|
32
33
|
length: 6
|
|
33
34
|
}).map((_, index) => jsxRuntime.jsx("div", {
|
|
@@ -82,7 +83,7 @@ function MoreWalletsButton(props) {
|
|
|
82
83
|
}
|
|
83
84
|
return jsxRuntime.jsxs("button", {
|
|
84
85
|
type: "button",
|
|
85
|
-
className: utils.cn("w3a--flex w3a--items-center w3a--justify-start w3a--gap-x-2 w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200 dark:w3a--bg-app-gray-800 dark:hover:w3a--bg-app-gray-600", {
|
|
86
|
+
className: utils.cn("w3a--flex w3a--items-center w3a--justify-start w3a--gap-x-2 w3a--bg-app-gray-50 w3a--p-3 hover:w3a--bg-app-gray-200 dark:w3a--bg-app-gray-800 dark:hover:w3a--bg-app-gray-600 active:w3a--scale-95 w3a--transition-all w3a--duration-150 w3a--mr-2.5", {
|
|
86
87
|
"w3a--rounded-full": buttonRadius === "pill",
|
|
87
88
|
"w3a--rounded-lg": buttonRadius === "rounded",
|
|
88
89
|
"w3a--rounded-none": buttonRadius === "square"
|
|
@@ -115,9 +116,16 @@ function ConnectWalletList(props) {
|
|
|
115
116
|
walletConnectUri,
|
|
116
117
|
buttonRadius
|
|
117
118
|
} = props;
|
|
119
|
+
const [showMoreWallets, setShowMoreWallets] = react.useState(true);
|
|
120
|
+
const onShowMoreWalletsClick = () => {
|
|
121
|
+
setShowMoreWallets(false);
|
|
122
|
+
handleMoreWallets();
|
|
123
|
+
};
|
|
118
124
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
119
125
|
children: [jsxRuntime.jsx("ul", {
|
|
120
|
-
className: utils.cn("w3a--overflow-y-auto w3a--flex w3a--flex-col w3a--gap-y-2 w3a--h-[280px]"
|
|
126
|
+
className: utils.cn("w3a--overflow-y-auto w3a--flex w3a--flex-col w3a--gap-y-2 w3a--h-[280px] w3a--social-container w3a--pr-2.5", {
|
|
127
|
+
"w3a--h-[328px]": !showMoreWallets
|
|
128
|
+
}),
|
|
121
129
|
children: externalButtons.length === 0 ? jsxRuntime.jsx(NoWalletsFound, {}) : jsxRuntime.jsx(WalletsFound, {
|
|
122
130
|
externalButtons: externalButtons,
|
|
123
131
|
isLoading: isLoading,
|
|
@@ -126,10 +134,10 @@ function ConnectWalletList(props) {
|
|
|
126
134
|
walletConnectUri: walletConnectUri,
|
|
127
135
|
buttonRadius: buttonRadius
|
|
128
136
|
})
|
|
129
|
-
}), totalExternalWalletsCount > 15 && !isLoading && initialWalletCount < totalExternalWalletsCount && jsxRuntime.jsx(MoreWalletsButton, {
|
|
137
|
+
}), showMoreWallets && totalExternalWalletsCount > 15 && !isLoading && initialWalletCount < totalExternalWalletsCount && jsxRuntime.jsx(MoreWalletsButton, {
|
|
130
138
|
totalExternalWalletsCount: totalExternalWalletsCount,
|
|
131
139
|
initialWalletCount: initialWalletCount,
|
|
132
|
-
handleMoreWallets:
|
|
140
|
+
handleMoreWallets: onShowMoreWalletsClick,
|
|
133
141
|
isLoading: isLoading,
|
|
134
142
|
isDark: isDark,
|
|
135
143
|
buttonRadius: buttonRadius
|
|
@@ -77,7 +77,7 @@ function ConnectWalletQrCode(props) {
|
|
|
77
77
|
}), "?"]
|
|
78
78
|
}), jsxRuntime.jsx("button", {
|
|
79
79
|
type: "button",
|
|
80
|
-
className: "w3a--appearance-none w3a--rounded-full w3a--border w3a--border-app-gray-
|
|
80
|
+
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",
|
|
81
81
|
onClick: () => {
|
|
82
82
|
setBodyState(_objectSpread(_objectSpread({}, bodyState), {}, {
|
|
83
83
|
showWalletDetails: true,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var ThemeContext = require('../../context/ThemeContext.js');
|
|
6
|
+
var utils = require('../../utils.js');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Image component
|
|
@@ -36,7 +37,7 @@ function Image(props) {
|
|
|
36
37
|
height: height,
|
|
37
38
|
width: width,
|
|
38
39
|
alt: hoverImageId,
|
|
39
|
-
className: "w3a--object-contain"
|
|
40
|
+
className: utils.cn("w3a--object-contain", `w3a--h-${height} w3a--w-${width}`)
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
return jsxRuntime.jsx("img", {
|
|
@@ -45,7 +46,7 @@ function Image(props) {
|
|
|
45
46
|
height: height,
|
|
46
47
|
width: width,
|
|
47
48
|
alt: hoverImageId,
|
|
48
|
-
className: "w3a--rounded w3a--object-contain"
|
|
49
|
+
className: utils.cn("w3a--rounded w3a--object-contain", `w3a--h-${height} w3a--w-${width}`)
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
if (imageData) {
|
|
@@ -55,7 +56,7 @@ function Image(props) {
|
|
|
55
56
|
height: height,
|
|
56
57
|
width: width,
|
|
57
58
|
alt: imageId,
|
|
58
|
-
className: "w3a--object-contain",
|
|
59
|
+
className: utils.cn("w3a--object-contain", `w3a--h-${height} w3a--w-${width}`),
|
|
59
60
|
onError: ({
|
|
60
61
|
currentTarget
|
|
61
62
|
}) => {
|
|
@@ -73,7 +74,7 @@ function Image(props) {
|
|
|
73
74
|
height: height,
|
|
74
75
|
width: width,
|
|
75
76
|
alt: imageId,
|
|
76
|
-
className: "w3a--rounded w3a--object-contain",
|
|
77
|
+
className: utils.cn("w3a--rounded w3a--object-contain", `w3a--h-${height} w3a--w-${width}`),
|
|
77
78
|
onError: ({
|
|
78
79
|
currentTarget
|
|
79
80
|
}) => {
|
|
@@ -34,7 +34,7 @@ function ConnectingStatus(props) {
|
|
|
34
34
|
children: [jsxRuntime.jsxs("div", {
|
|
35
35
|
className: "w3a--flex w3a--items-center w3a--justify-center w3a--gap-x-6",
|
|
36
36
|
children: [jsxRuntime.jsx("figure", {
|
|
37
|
-
className: "w3a--
|
|
37
|
+
className: "w3a--flex w3a--size-10 w3a--items-center w3a--justify-center w3a--overflow-hidden",
|
|
38
38
|
children: jsxRuntime.jsx("img", {
|
|
39
39
|
src: appLogo,
|
|
40
40
|
alt: "",
|
|
@@ -24,6 +24,7 @@ function Login(props) {
|
|
|
24
24
|
const {
|
|
25
25
|
web3authClientId,
|
|
26
26
|
web3authNetwork,
|
|
27
|
+
authBuildEnv,
|
|
27
28
|
appLogo,
|
|
28
29
|
isModalVisible,
|
|
29
30
|
handleSocialLoginHeight,
|
|
@@ -42,8 +43,7 @@ function Login(props) {
|
|
|
42
43
|
showExternalWalletCount,
|
|
43
44
|
showInstalledExternalWallets,
|
|
44
45
|
logoAlignment = "center",
|
|
45
|
-
buttonRadius = "pill"
|
|
46
|
-
enableMainSocialLoginButton = false
|
|
46
|
+
buttonRadius = "pill"
|
|
47
47
|
} = props;
|
|
48
48
|
const [t] = reactI18next.useTranslation(undefined, {
|
|
49
49
|
i18n: localeImport
|
|
@@ -79,16 +79,38 @@ function Login(props) {
|
|
|
79
79
|
});
|
|
80
80
|
const visibleRows = [];
|
|
81
81
|
const otherRows = [];
|
|
82
|
+
const loginMethodsOrder = (socialLoginsConfig.loginMethodsOrder || []).reduce((acc, method, index) => {
|
|
83
|
+
acc[method] = index;
|
|
84
|
+
return acc;
|
|
85
|
+
}, {});
|
|
82
86
|
const loginOptions = Object.keys(socialLoginsConfig.loginMethods).filter(method => {
|
|
83
87
|
return !socialLoginsConfig.loginMethods[method].showOnModal === false && !restrictedLoginMethods.includes(method);
|
|
88
|
+
}).sort((a, b) => {
|
|
89
|
+
var _loginMethodsOrder$a, _loginMethodsOrder$b;
|
|
90
|
+
const maxOrder = (socialLoginsConfig.loginMethodsOrder || []).length;
|
|
91
|
+
const aOrder = (_loginMethodsOrder$a = loginMethodsOrder[a]) !== null && _loginMethodsOrder$a !== void 0 ? _loginMethodsOrder$a : maxOrder;
|
|
92
|
+
const bOrder = (_loginMethodsOrder$b = loginMethodsOrder[b]) !== null && _loginMethodsOrder$b !== void 0 ? _loginMethodsOrder$b : maxOrder;
|
|
93
|
+
const {
|
|
94
|
+
mainOption: aMainOption
|
|
95
|
+
} = socialLoginsConfig.loginMethods[a] || {};
|
|
96
|
+
const {
|
|
97
|
+
mainOption: bMainOption
|
|
98
|
+
} = socialLoginsConfig.loginMethods[b] || {};
|
|
99
|
+
// if both are main options, sort by order
|
|
100
|
+
if (aMainOption && bMainOption) {
|
|
101
|
+
return aOrder - bOrder;
|
|
102
|
+
}
|
|
103
|
+
// if one is main option, it should be first
|
|
104
|
+
if (aMainOption) return -1;
|
|
105
|
+
if (bMainOption) return 1;
|
|
106
|
+
// if none are main options, sort by order
|
|
107
|
+
return aOrder - bOrder;
|
|
84
108
|
});
|
|
85
109
|
loginOptions.forEach((method, index) => {
|
|
86
110
|
var _socialLoginsConfig$u;
|
|
87
111
|
const connectorConfig = socialLoginsConfig.loginMethods[method];
|
|
88
112
|
const name = config.capitalizeFirstLetter(connectorConfig.name || method);
|
|
89
|
-
// const orderIndex = socialLoginsConfig.loginMethodsOrder.indexOf(method) + 1;
|
|
90
113
|
const order = index + 1;
|
|
91
|
-
const isMainOption = order === 1 && enableMainSocialLoginButton;
|
|
92
114
|
const isPrimaryBtn = (socialLoginsConfig === null || socialLoginsConfig === void 0 || (_socialLoginsConfig$u = socialLoginsConfig.uiConfig) === null || _socialLoginsConfig$u === void 0 ? void 0 : _socialLoginsConfig$u.primaryButton) === "socialLogin" && order === 1;
|
|
93
115
|
const loginOptionLength = loginOptions.length;
|
|
94
116
|
const moreThanFour = loginOptionLength >= 4;
|
|
@@ -108,8 +130,7 @@ function Login(props) {
|
|
|
108
130
|
name,
|
|
109
131
|
login_hint: ""
|
|
110
132
|
},
|
|
111
|
-
order
|
|
112
|
-
isMainOption
|
|
133
|
+
order
|
|
113
134
|
});
|
|
114
135
|
}
|
|
115
136
|
otherRows.push({
|
|
@@ -126,14 +147,13 @@ function Login(props) {
|
|
|
126
147
|
name,
|
|
127
148
|
login_hint: ""
|
|
128
149
|
},
|
|
129
|
-
order
|
|
130
|
-
isMainOption
|
|
150
|
+
order
|
|
131
151
|
});
|
|
132
152
|
});
|
|
133
153
|
setVisibleRow(visibleRows);
|
|
134
154
|
setOtherRow(otherRows);
|
|
135
155
|
setCanShowMore(maxOptions.length > 4); // Update the state based on the condition
|
|
136
|
-
}, [socialLoginsConfig, isDark,
|
|
156
|
+
}, [socialLoginsConfig, isDark, buttonRadius]);
|
|
137
157
|
const handleCustomLogin = async (authConnection, loginHint) => {
|
|
138
158
|
try {
|
|
139
159
|
const handler = factory.createPasswordlessHandler(authConnection, {
|
|
@@ -141,7 +161,8 @@ function Login(props) {
|
|
|
141
161
|
web3authClientId,
|
|
142
162
|
network: web3authNetwork,
|
|
143
163
|
uiConfig: socialLoginsConfig.uiConfig,
|
|
144
|
-
authConnection
|
|
164
|
+
authConnection,
|
|
165
|
+
authBuildEnv
|
|
145
166
|
});
|
|
146
167
|
let token = "";
|
|
147
168
|
if (authConnection === auth.AUTH_CONNECTION.SMS_PASSWORDLESS) {
|
|
@@ -342,22 +363,22 @@ function Login(props) {
|
|
|
342
363
|
className: utils.cn("w3a--flex w3a--w-full w3a--flex-col w3a--items-start w3a--justify-start w3a--gap-y-2"),
|
|
343
364
|
children: [installedExternalWallets.length > 0 && installedExternalWallets.map(wallet => jsxRuntime.jsxs("button", {
|
|
344
365
|
type: "button",
|
|
345
|
-
className: utils.cn("w3a--btn !w3a--justify-between w3a-
|
|
366
|
+
className: utils.cn("w3a--btn !w3a--justify-between w3a--group w3a--relative w3a--overflow-hidden", {
|
|
346
367
|
"w3a--rounded-full": buttonRadius === "pill",
|
|
347
368
|
"w3a--rounded-lg": buttonRadius === "rounded",
|
|
348
369
|
"w3a--rounded-none": buttonRadius === "square"
|
|
349
370
|
}),
|
|
350
371
|
onClick: () => handleInstalledWalletClick(wallet),
|
|
351
372
|
children: [jsxRuntime.jsx("p", {
|
|
352
|
-
className: "w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
|
|
373
|
+
className: "w3a--max-w-[180px] w3a--truncate w3a--text-base w3a--font-normal w3a--text-app-gray-700 dark:w3a--text-app-white",
|
|
353
374
|
children: wallet.displayName
|
|
354
375
|
}), jsxRuntime.jsxs("div", {
|
|
355
|
-
className: "w3a--flex w3a--items-center w3a--gap-x-2",
|
|
376
|
+
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",
|
|
356
377
|
children: [wallet.hasInjectedWallet && jsxRuntime.jsx("span", {
|
|
357
378
|
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 \n dark:w3a--border dark:w3a--border-app-primary-400 dark:w3a--bg-transparent dark:w3a--text-app-primary-400",
|
|
358
379
|
children: t("modal.external.installed")
|
|
359
380
|
}), jsxRuntime.jsx("figure", {
|
|
360
|
-
className:
|
|
381
|
+
className: "w3a--size-5",
|
|
361
382
|
children: jsxRuntime.jsx(Image, {
|
|
362
383
|
imageData: wallet.icon,
|
|
363
384
|
imageId: `login-${wallet.name}`,
|
|
@@ -369,25 +390,30 @@ function Login(props) {
|
|
|
369
390
|
extension: wallet.imgExtension || "webp"
|
|
370
391
|
})
|
|
371
392
|
})]
|
|
393
|
+
}), jsxRuntime.jsx("img", {
|
|
394
|
+
id: "injected-wallet-arrow",
|
|
395
|
+
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\n group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
396
|
+
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
397
|
+
alt: "arrow"
|
|
372
398
|
})]
|
|
373
399
|
}, wallet.name)), totalExternalWallets > 3 && jsxRuntime.jsxs("button", {
|
|
374
400
|
type: "button",
|
|
375
|
-
className: utils.cn("w3a--btn !w3a--justify-between w3a-
|
|
401
|
+
className: utils.cn("w3a--btn !w3a--justify-between w3a--group w3a--relative w3a--overflow-hidden", {
|
|
376
402
|
"w3a--rounded-full": buttonRadius === "pill",
|
|
377
403
|
"w3a--rounded-lg": buttonRadius === "rounded",
|
|
378
404
|
"w3a--rounded-none": buttonRadius === "square"
|
|
379
405
|
}),
|
|
380
406
|
onClick: handleConnectWallet,
|
|
381
407
|
children: [jsxRuntime.jsx("p", {
|
|
382
|
-
className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
408
|
+
className: "w3a--text-base w3a--font-normal w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
383
409
|
children: t("modal.external.all-wallets")
|
|
384
410
|
}), showExternalWalletCount && totalExternalWallets > 0 && jsxRuntime.jsx("div", {
|
|
385
411
|
id: "external-wallet-count",
|
|
386
|
-
className: "w3a--w-auto 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 dark:w3a--border dark:w3a--border-app-primary-500 dark:w3a--bg-transparent dark:w3a--text-app-primary-500",
|
|
412
|
+
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",
|
|
387
413
|
children: totalExternalWallets - 1
|
|
388
414
|
}), jsxRuntime.jsx("img", {
|
|
389
415
|
id: "external-wallet-arrow",
|
|
390
|
-
className: "w3a--
|
|
416
|
+
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\n group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
391
417
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
392
418
|
alt: "arrow"
|
|
393
419
|
})]
|
|
@@ -460,7 +486,7 @@ function Login(props) {
|
|
|
460
486
|
children: jsxRuntime.jsx("img", {
|
|
461
487
|
src: headerLogo || utils.getIcons(isDark ? "logo-dark" : "logo-light"),
|
|
462
488
|
alt: "Logo",
|
|
463
|
-
className: "w3a--object-contain"
|
|
489
|
+
className: "w3a--size-full w3a--object-contain"
|
|
464
490
|
})
|
|
465
491
|
}), jsxRuntime.jsx("p", {
|
|
466
492
|
className: utils.cn("w3a--text-lg w3a--font-semibold w3a--text-app-gray-900 dark:w3a--text-app-white", logoAlignment === "center" ? "w3a--text-center" : "w3a--text-left w3a--w-full w3a--ml-4"),
|
package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js
CHANGED
|
@@ -57,9 +57,9 @@ function LoginPasswordLess(props) {
|
|
|
57
57
|
}
|
|
58
58
|
}, [isPasswordLessCtaClicked]);
|
|
59
59
|
if (!isPasswordLessCtaClicked) {
|
|
60
|
-
return jsxRuntime.
|
|
60
|
+
return jsxRuntime.jsxs("button", {
|
|
61
61
|
type: "button",
|
|
62
|
-
className: utils.cn("w3a--btn !w3a--justify-between", {
|
|
62
|
+
className: utils.cn("w3a--btn !w3a--justify-between w3a--relative w3a--group w3a--overflow-hidden", {
|
|
63
63
|
"w3a--rounded-full": buttonRadius === "pill",
|
|
64
64
|
"w3a--rounded-lg": buttonRadius === "rounded",
|
|
65
65
|
"w3a--rounded-none": buttonRadius === "square"
|
|
@@ -67,12 +67,17 @@ function LoginPasswordLess(props) {
|
|
|
67
67
|
onClick: () => {
|
|
68
68
|
setIsPasswordLessCtaClicked(true);
|
|
69
69
|
},
|
|
70
|
-
children: jsxRuntime.jsx("p", {
|
|
70
|
+
children: [jsxRuntime.jsx("p", {
|
|
71
71
|
className: "w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
72
72
|
children: t("modal.passwordless.title", {
|
|
73
73
|
title
|
|
74
74
|
})
|
|
75
|
-
})
|
|
75
|
+
}), jsxRuntime.jsx("img", {
|
|
76
|
+
id: "passwordless-arrow",
|
|
77
|
+
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\n group-hover:w3a--translate-x-0 group-hover:w3a--opacity-100",
|
|
78
|
+
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
79
|
+
alt: "arrow"
|
|
80
|
+
})]
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
83
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -100,7 +105,7 @@ function LoginPasswordLess(props) {
|
|
|
100
105
|
disabled: isPasswordLessLoading
|
|
101
106
|
}), isPasswordLessLoading && jsxRuntime.jsx(PulseLoader, {}), inputValue && !isPasswordLessLoading && jsxRuntime.jsx("button", {
|
|
102
107
|
type: "button",
|
|
103
|
-
className: "w3a--
|
|
108
|
+
className: "w3a--appearance-none",
|
|
104
109
|
onClick: onFormSubmit,
|
|
105
110
|
children: jsxRuntime.jsx("img", {
|
|
106
111
|
src: utils.getIcons(isDark ? "chevron-right-dark" : "chevron-right-light"),
|
|
@@ -71,7 +71,7 @@ function Modal(props) {
|
|
|
71
71
|
fill: "none",
|
|
72
72
|
xmlns: "http://www.w3.org/2000/svg",
|
|
73
73
|
onClick: onCloseHandler,
|
|
74
|
-
className: "w3a--text-app-gray-500 dark:w3a--text-app-gray-200",
|
|
74
|
+
className: "w3a--text-app-gray-500 hover:w3a--text-app-gray-900 dark:w3a--text-app-gray-200 dark:hover:w3a--text-app-white",
|
|
75
75
|
children: jsxRuntime.jsx("path", {
|
|
76
76
|
fillRule: "evenodd",
|
|
77
77
|
clipRule: "evenodd",
|