@web3auth/modal 10.0.0-alpha.2 → 10.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/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.cjs/packages/modal/src/config.js +3 -57
- package/dist/lib.cjs/packages/modal/src/index.js +1 -5
- package/dist/lib.cjs/packages/modal/src/modalManager.js +286 -189
- package/dist/lib.cjs/packages/modal/src/react/Web3AuthProvider.js +2 -2
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +27 -38
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +60 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +47 -22
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.type.js +8 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +53 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +68 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +202 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +62 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/{ExternalWallet/ExternalWalletChainNamespace.js → ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js} +28 -30
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +49 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +140 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +93 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +55 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Embed/Embed.js +70 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +53 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +89 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +151 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/Login.js +489 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginOtp/LoginOtp.js +116 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +117 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +52 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +87 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +190 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +18 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +452 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +156 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +70 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +229 -0
- package/dist/lib.cjs/packages/modal/src/ui/config.js +10 -0
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +18 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/RootContext.js +20 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/ThemeContext.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +8 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/AbstractHandler.js +117 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/EmailPasswordlessHandler.js +54 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/SmsPasswordlessHandler.js +57 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/factory.js +19 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +38 -2
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +7 -10
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +69 -43
- package/dist/lib.cjs/packages/modal/src/ui/utils.js +105 -20
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +1 -12
- package/dist/lib.cjs/types/config.d.ts +1 -5
- package/dist/lib.cjs/types/interface.d.ts +2 -6
- package/dist/lib.cjs/types/modalManager.d.ts +11 -4
- package/dist/lib.cjs/types/react/interfaces.d.ts +1 -6
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.type.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Button/Button.d.ts +2 -15
- package/dist/lib.cjs/types/ui/components/Button/Button.type.d.ts +12 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/ButtonSocial.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/ButtonSocial.type.d.ts +14 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.type.d.ts +13 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Button/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.type.d.ts +24 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.type.d.ts +13 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.type.d.ts +10 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +6 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.type.d.ts +19 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.type.d.ts +9 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.type.d.ts +9 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Embed/Embed.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Embed/Embed.type.d.ts +12 -0
- package/dist/lib.cjs/types/ui/components/Embed/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Footer/Footer.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/Footer/Footer.type.d.ts +4 -0
- package/dist/lib.cjs/types/ui/components/Footer/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Image/Image.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/{Image.d.ts → Image/Image.type.d.ts} +2 -1
- package/dist/lib.cjs/types/ui/components/Image/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.type.d.ts +12 -0
- package/dist/lib.cjs/types/ui/components/Loader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Login/Login.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +29 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginOtp/LoginOtp.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginOtp/LoginOtp.type.d.ts +10 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginOtp/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/LoginPasswordLess.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/LoginPasswordLess.type.d.ts +13 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Login/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.type.d.ts +6 -0
- package/dist/lib.cjs/types/ui/components/LoginHint/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Modal/Modal.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Modal/Modal.type.d.ts +14 -0
- package/dist/lib.cjs/types/ui/components/Modal/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Otp/Otp.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Otp/Otp.type.d.ts +22 -0
- package/dist/lib.cjs/types/ui/components/Otp/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/PulseLoader/PulseLoader.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/PulseLoader/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/Root/Root.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Root/Root.type.d.ts +27 -0
- package/dist/lib.cjs/types/ui/components/Root/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/SocialLoginList/SocialLoginList.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/SocialLoginList/SocialLoginList.type.d.ts +11 -0
- package/dist/lib.cjs/types/ui/components/SocialLoginList/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Toast/Toast.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Toast/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/Widget/Widget.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/{Modal.d.ts → Widget/Widget.type.d.ts} +4 -5
- package/dist/lib.cjs/types/ui/components/Widget/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/config.d.ts +4 -1
- package/dist/lib.cjs/types/ui/constants.d.ts +13 -0
- package/dist/lib.cjs/types/ui/context/RootContext.d.ts +18 -0
- package/dist/lib.cjs/types/ui/handlers/AbstractHandler.d.ts +20 -0
- package/dist/lib.cjs/types/ui/handlers/EmailPasswordlessHandler.d.ts +8 -0
- package/dist/lib.cjs/types/ui/handlers/SmsPasswordlessHandler.d.ts +9 -0
- package/dist/lib.cjs/types/ui/handlers/factory.d.ts +5 -0
- package/dist/lib.cjs/types/ui/interfaces.d.ts +116 -15
- package/dist/lib.cjs/types/ui/loginModal.d.ts +9 -7
- package/dist/lib.cjs/types/ui/utils.d.ts +16 -3
- package/dist/lib.cjs/types/vue/interfaces.d.ts +1 -6
- package/dist/lib.esm/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.esm/packages/modal/src/config.js +4 -54
- package/dist/lib.esm/packages/modal/src/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +299 -195
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +1 -12
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +58 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +48 -24
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.type.js +6 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +51 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +66 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +200 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +60 -0
- package/dist/lib.esm/packages/modal/src/ui/components/{ExternalWallet/ExternalWalletChainNamespace.js → ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js} +28 -31
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +47 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +138 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +91 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +56 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Embed/Embed.js +68 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +51 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +87 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +152 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Login/Login.js +489 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginOtp/LoginOtp.js +115 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +115 -0
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +50 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +85 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +188 -0
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +16 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +462 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +154 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +68 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +231 -0
- package/dist/lib.esm/packages/modal/src/ui/config.js +9 -2
- package/dist/lib.esm/packages/modal/src/ui/constants.js +13 -0
- package/dist/lib.esm/packages/modal/src/ui/context/RootContext.js +18 -0
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +6 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/AbstractHandler.js +115 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/EmailPasswordlessHandler.js +52 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/SmsPasswordlessHandler.js +55 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/factory.js +17 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +38 -3
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +8 -9
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +70 -44
- package/dist/lib.esm/packages/modal/src/ui/utils.js +104 -22
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +1 -12
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.LICENSE.txt +8 -8
- package/package.json +14 -11
- package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-dark.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-light.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/assets/x-dark.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/assets/x-light.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/AdapterLoader.js +0 -108
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/styles.css.js +0 -8
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +0 -44
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +0 -67
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +0 -43
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +0 -46
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +0 -167
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallets.js +0 -274
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer.js +0 -20
- package/dist/lib.cjs/packages/modal/src/ui/components/Header.js +0 -81
- package/dist/lib.cjs/packages/modal/src/ui/components/Icon.js +0 -73
- package/dist/lib.cjs/packages/modal/src/ui/components/Image.js +0 -51
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader.js +0 -59
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal.js +0 -244
- package/dist/lib.cjs/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +0 -30
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginPasswordless.js +0 -148
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLogins.js +0 -152
- package/dist/lib.cjs/packages/modal/src/ui/components/WalletConnect.js +0 -84
- package/dist/lib.cjs/packages/modal/src/ui/css/web3auth.css.js +0 -8
- package/dist/lib.cjs/types/ui/components/AdapterLoader.d.ts +0 -11
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletButton.d.ts +0 -7
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletChainNamespace.d.ts +0 -9
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletConnect.d.ts +0 -9
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletDetails.d.ts +0 -10
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletHeader.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletInstall.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/ExternalWallets.d.ts +0 -15
- package/dist/lib.cjs/types/ui/components/Footer.d.ts +0 -1
- package/dist/lib.cjs/types/ui/components/Header.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/Icon.d.ts +0 -9
- package/dist/lib.cjs/types/ui/components/Loader.d.ts +0 -10
- package/dist/lib.cjs/types/ui/components/SelfCustodyViaWeb3Auth.d.ts +0 -1
- package/dist/lib.cjs/types/ui/components/SocialLoginPasswordless.d.ts +0 -14
- package/dist/lib.cjs/types/ui/components/SocialLogins.d.ts +0 -10
- package/dist/lib.cjs/types/ui/components/WalletConnect.d.ts +0 -8
- package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-dark.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-light.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/assets/x-dark.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/assets/x-light.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/components/AdapterLoader.js +0 -106
- package/dist/lib.esm/packages/modal/src/ui/components/Button/styles.css.js +0 -6
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +0 -42
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +0 -65
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +0 -44
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +0 -44
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +0 -165
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallets.js +0 -276
- package/dist/lib.esm/packages/modal/src/ui/components/Footer.js +0 -18
- package/dist/lib.esm/packages/modal/src/ui/components/Header.js +0 -79
- package/dist/lib.esm/packages/modal/src/ui/components/Icon.js +0 -71
- package/dist/lib.esm/packages/modal/src/ui/components/Image.js +0 -49
- package/dist/lib.esm/packages/modal/src/ui/components/Loader.js +0 -57
- package/dist/lib.esm/packages/modal/src/ui/components/Modal.js +0 -243
- package/dist/lib.esm/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +0 -28
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginPasswordless.js +0 -146
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLogins.js +0 -151
- package/dist/lib.esm/packages/modal/src/ui/components/WalletConnect.js +0 -82
- package/dist/lib.esm/packages/modal/src/ui/css/web3auth.css.js +0 -6
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { useContext } from 'react';
|
|
2
|
-
import { ThemedContext } from '../context/ThemeContext.js';
|
|
3
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
function Image(props) {
|
|
6
|
-
const {
|
|
7
|
-
hoverImageId,
|
|
8
|
-
darkHoverImageId,
|
|
9
|
-
imageId,
|
|
10
|
-
darkImageId,
|
|
11
|
-
isButton = false,
|
|
12
|
-
height = "auto",
|
|
13
|
-
width = "auto",
|
|
14
|
-
fallbackImageId,
|
|
15
|
-
extension = "svg"
|
|
16
|
-
} = props;
|
|
17
|
-
const {
|
|
18
|
-
isDark
|
|
19
|
-
} = useContext(ThemedContext);
|
|
20
|
-
const imgName = isDark && darkImageId ? darkImageId : imageId;
|
|
21
|
-
const hoverImgName = isDark && darkHoverImageId ? darkHoverImageId : hoverImageId;
|
|
22
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
23
|
-
children: [/*#__PURE__*/jsx("img", {
|
|
24
|
-
src: `https://images.web3auth.io/${imgName}.${extension}`,
|
|
25
|
-
height: height,
|
|
26
|
-
width: width,
|
|
27
|
-
alt: imageId,
|
|
28
|
-
className: "image-icon w3a--object-contain w3a--rounded",
|
|
29
|
-
onError: ({
|
|
30
|
-
currentTarget
|
|
31
|
-
}) => {
|
|
32
|
-
if (fallbackImageId) {
|
|
33
|
-
// eslint-disable-next-line no-param-reassign
|
|
34
|
-
currentTarget.onerror = null; // prevents looping
|
|
35
|
-
// eslint-disable-next-line no-param-reassign
|
|
36
|
-
currentTarget.src = `https://images.web3auth.io/${fallbackImageId}.svg`;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}), isButton ? /*#__PURE__*/jsx("img", {
|
|
40
|
-
src: `https://images.web3auth.io/${hoverImgName}.${extension}`,
|
|
41
|
-
height: height,
|
|
42
|
-
width: width,
|
|
43
|
-
alt: hoverImageId,
|
|
44
|
-
className: "hover-icon w3a--object-contain w3a--rounded"
|
|
45
|
-
}) : null]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { Image as default };
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { log, CONNECTOR_STATUS } from '@web3auth/no-modal';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import { MODAL_STATUS } from '../interfaces.js';
|
|
4
|
-
import Icon from './Icon.js';
|
|
5
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
const closeIcon = /*#__PURE__*/jsx(Icon, {
|
|
8
|
-
iconName: "close"
|
|
9
|
-
});
|
|
10
|
-
function Loader(props) {
|
|
11
|
-
const {
|
|
12
|
-
message,
|
|
13
|
-
modalStatus,
|
|
14
|
-
label,
|
|
15
|
-
onClose,
|
|
16
|
-
canEmit = true
|
|
17
|
-
} = props;
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
log.debug("loader re-rendering");
|
|
20
|
-
if (modalStatus === MODAL_STATUS.CONNECTED && canEmit) {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
onClose();
|
|
23
|
-
}, 3000);
|
|
24
|
-
}
|
|
25
|
-
}, [canEmit, modalStatus, onClose]);
|
|
26
|
-
return modalStatus !== MODAL_STATUS.INITIALIZED ? /*#__PURE__*/jsxs("div", {
|
|
27
|
-
className: "w3ajs-modal-loader w3a-modal__loader",
|
|
28
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
29
|
-
className: "w3a-modal__loader-content",
|
|
30
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
31
|
-
className: "w3a-modal__loader-info",
|
|
32
|
-
children: [modalStatus === MODAL_STATUS.CONNECTING && /*#__PURE__*/jsx("div", {
|
|
33
|
-
className: "w3ajs-modal-loader__spinner w3a-spinner",
|
|
34
|
-
children: /*#__PURE__*/jsx("div", {
|
|
35
|
-
className: "w3a-spinner__spinner"
|
|
36
|
-
})
|
|
37
|
-
}), /*#__PURE__*/jsx("div", {
|
|
38
|
-
className: "w3ajs-modal-loader__label w3a-spinner-label",
|
|
39
|
-
children: label
|
|
40
|
-
}), modalStatus === CONNECTOR_STATUS.CONNECTED && /*#__PURE__*/jsx("div", {
|
|
41
|
-
className: "w3ajs-modal-loader__message w3a-spinner-message",
|
|
42
|
-
children: message
|
|
43
|
-
}), modalStatus === CONNECTOR_STATUS.ERRORED && /*#__PURE__*/jsx("div", {
|
|
44
|
-
className: "w3ajs-modal-loader__message w3a-spinner-message w3a-spinner-message--error",
|
|
45
|
-
children: message
|
|
46
|
-
})]
|
|
47
|
-
})
|
|
48
|
-
}), (modalStatus === CONNECTOR_STATUS.CONNECTED || modalStatus === CONNECTOR_STATUS.ERRORED) && /*#__PURE__*/jsx("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
className: "w3a-header__button w3ajs-loader-close-btn",
|
|
51
|
-
onClick: onClose,
|
|
52
|
-
children: closeIcon
|
|
53
|
-
})]
|
|
54
|
-
}) : null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { Loader as default };
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
-
import { AUTH_CONNECTION } from '@web3auth/auth';
|
|
3
|
-
import { log, cloneDeep, CONNECTOR_NAMES } from '@web3auth/no-modal';
|
|
4
|
-
import deepmerge from 'deepmerge';
|
|
5
|
-
import { useState, useEffect, useCallback, useMemo } from 'react';
|
|
6
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { MODAL_STATUS } from '../interfaces.js';
|
|
8
|
-
import i18nInstance from '../localeImport.js';
|
|
9
|
-
import DetailedLoader from './AdapterLoader.js';
|
|
10
|
-
import Button from './Button/Button.js';
|
|
11
|
-
import ExternalWallets from './ExternalWallets.js';
|
|
12
|
-
import Footer from './Footer.js';
|
|
13
|
-
import memoizedHeader from './Header.js';
|
|
14
|
-
import SocialLoginPasswordless from './SocialLoginPasswordless.js';
|
|
15
|
-
import SocialLogins from './SocialLogins.js';
|
|
16
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
17
|
-
|
|
18
|
-
log.enableAll();
|
|
19
|
-
function Modal(props) {
|
|
20
|
-
var _modalState$socialLog, _modalState$socialLog2, _modalState$socialLog5, _modalState$socialLog7, _modalState$socialLog9, _modalState$socialLog10;
|
|
21
|
-
const [modalTransitionClasses, setModalTransitionClasses] = useState(["w3a-modal__inner"]);
|
|
22
|
-
const [modalState, setModalState] = useState({
|
|
23
|
-
externalWalletsVisibility: false,
|
|
24
|
-
status: MODAL_STATUS.INITIALIZED,
|
|
25
|
-
hasExternalWallets: false,
|
|
26
|
-
externalWalletsInitialized: false,
|
|
27
|
-
modalVisibility: false,
|
|
28
|
-
modalVisibilityDelayed: false,
|
|
29
|
-
postLoadingMessage: "",
|
|
30
|
-
walletConnectUri: "",
|
|
31
|
-
socialLoginsConfig: {
|
|
32
|
-
loginMethods: {},
|
|
33
|
-
loginMethodsOrder: [],
|
|
34
|
-
connector: "",
|
|
35
|
-
uiConfig: {}
|
|
36
|
-
},
|
|
37
|
-
externalWalletsConfig: {},
|
|
38
|
-
detailedLoaderConnector: "",
|
|
39
|
-
detailedLoaderConnectorName: "",
|
|
40
|
-
showExternalWalletsOnly: false
|
|
41
|
-
});
|
|
42
|
-
const [t] = useTranslation(undefined, {
|
|
43
|
-
i18n: i18nInstance
|
|
44
|
-
});
|
|
45
|
-
const {
|
|
46
|
-
stateListener,
|
|
47
|
-
appLogo,
|
|
48
|
-
appName,
|
|
49
|
-
chainNamespaces,
|
|
50
|
-
walletRegistry,
|
|
51
|
-
handleSocialLoginClick,
|
|
52
|
-
handleExternalWalletClick,
|
|
53
|
-
handleShowExternalWallets,
|
|
54
|
-
closeModal
|
|
55
|
-
} = props;
|
|
56
|
-
const [transition, setTransition] = useState("");
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
stateListener.emit("MOUNTED");
|
|
59
|
-
stateListener.on("STATE_UPDATED", newModalState => {
|
|
60
|
-
log.debug("state updated", newModalState);
|
|
61
|
-
setModalState(prevState => {
|
|
62
|
-
const mergedState = cloneDeep(deepmerge(prevState, newModalState));
|
|
63
|
-
return mergedState;
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}, [stateListener]);
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
let timeOutId;
|
|
69
|
-
if (modalState.modalVisibility) {
|
|
70
|
-
setModalState(prevState => {
|
|
71
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
72
|
-
modalVisibilityDelayed: modalState.modalVisibility
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
timeOutId = window.setTimeout(() => {
|
|
76
|
-
setModalTransitionClasses(["w3a-modal__inner", modalState.modalVisibility ? "w3a-modal__inner--active" : ""]);
|
|
77
|
-
// hide external wallets, if modal is closing, so that it will show social login screen on reopen.
|
|
78
|
-
}, 100);
|
|
79
|
-
} else {
|
|
80
|
-
setModalTransitionClasses(["w3a-modal__inner", modalState.modalVisibility ? "w3a-modal__inner--active" : ""]);
|
|
81
|
-
// hide external wallets, if modal is closing, so that it will show social login screen on reopen.
|
|
82
|
-
|
|
83
|
-
timeOutId = window.setTimeout(() => {
|
|
84
|
-
setModalState(prevState => {
|
|
85
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
86
|
-
modalVisibilityDelayed: modalState.modalVisibility
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}, 250);
|
|
90
|
-
}
|
|
91
|
-
return () => {
|
|
92
|
-
clearTimeout(timeOutId);
|
|
93
|
-
};
|
|
94
|
-
}, [modalState.modalVisibility]);
|
|
95
|
-
const onCloseLoader = useCallback(() => {
|
|
96
|
-
if (modalState.status === MODAL_STATUS.CONNECTED) {
|
|
97
|
-
closeModal();
|
|
98
|
-
}
|
|
99
|
-
if (modalState.status === MODAL_STATUS.ERRORED) {
|
|
100
|
-
setModalState(prevState => {
|
|
101
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
102
|
-
modalVisibility: true,
|
|
103
|
-
status: MODAL_STATUS.INITIALIZED
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}, [closeModal, modalState.status]);
|
|
108
|
-
const preHandleExternalWalletClick = useCallback(params => {
|
|
109
|
-
const {
|
|
110
|
-
connector
|
|
111
|
-
} = params;
|
|
112
|
-
setModalState(prevState => {
|
|
113
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
114
|
-
detailedLoaderConnector: connector,
|
|
115
|
-
detailedLoaderConnectorName: CONNECTOR_NAMES[connector]
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
handleExternalWalletClick(params);
|
|
119
|
-
}, [handleExternalWalletClick]);
|
|
120
|
-
const preHandleSocialWalletClick = params => {
|
|
121
|
-
const {
|
|
122
|
-
loginParams
|
|
123
|
-
} = params;
|
|
124
|
-
setModalState(prevState => {
|
|
125
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
126
|
-
detailedLoaderConnector: loginParams.authConnection,
|
|
127
|
-
detailedLoaderConnectorName: loginParams.name
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
handleSocialLoginClick(params);
|
|
131
|
-
};
|
|
132
|
-
const isEmailPrimary = ((_modalState$socialLog = modalState.socialLoginsConfig) === null || _modalState$socialLog === void 0 || (_modalState$socialLog = _modalState$socialLog.uiConfig) === null || _modalState$socialLog === void 0 ? void 0 : _modalState$socialLog.primaryButton) === "emailLogin";
|
|
133
|
-
const isExternalPrimary = ((_modalState$socialLog2 = modalState.socialLoginsConfig) === null || _modalState$socialLog2 === void 0 || (_modalState$socialLog2 = _modalState$socialLog2.uiConfig) === null || _modalState$socialLog2 === void 0 ? void 0 : _modalState$socialLog2.primaryButton) === "externalLogin";
|
|
134
|
-
const externalWalletButton = /*#__PURE__*/jsx("div", {
|
|
135
|
-
className: "w3ajs-external-wallet w3a-group w3a--w-full",
|
|
136
|
-
children: /*#__PURE__*/jsx("div", {
|
|
137
|
-
className: "w3a-external-toggle w3ajs-external-toggle",
|
|
138
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
139
|
-
variant: isExternalPrimary ? "primary" : "tertiary",
|
|
140
|
-
type: "button",
|
|
141
|
-
className: "w3a--w-full w3ajs-external-toggle__button",
|
|
142
|
-
style: {
|
|
143
|
-
width: "100%"
|
|
144
|
-
},
|
|
145
|
-
onClick: () => {
|
|
146
|
-
setModalState(prevState => {
|
|
147
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
148
|
-
externalWalletsVisibility: true
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
setTransition("slide-enter");
|
|
152
|
-
handleShowExternalWallets(modalState.externalWalletsInitialized);
|
|
153
|
-
setTimeout(() => {
|
|
154
|
-
setTransition("slide-exit");
|
|
155
|
-
}, 300);
|
|
156
|
-
},
|
|
157
|
-
children: t("modal.external.connect")
|
|
158
|
-
})
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
const areSocialLoginsVisible = useMemo(() => {
|
|
162
|
-
var _modalState$socialLog3, _modalState$socialLog4;
|
|
163
|
-
if (modalState.showExternalWalletsOnly) return false;
|
|
164
|
-
if (Object.keys(((_modalState$socialLog3 = modalState.socialLoginsConfig) === null || _modalState$socialLog3 === void 0 ? void 0 : _modalState$socialLog3.loginMethods) || {}).length === 0) return false;
|
|
165
|
-
const isAnySocialLoginVisible = Object.entries(((_modalState$socialLog4 = modalState.socialLoginsConfig) === null || _modalState$socialLog4 === void 0 ? void 0 : _modalState$socialLog4.loginMethods) || {}).some(([k, v]) => k !== AUTH_CONNECTION.EMAIL_PASSWORDLESS && v.showOnModal !== false);
|
|
166
|
-
if (isAnySocialLoginVisible) return true;
|
|
167
|
-
return false;
|
|
168
|
-
}, [modalState.showExternalWalletsOnly, (_modalState$socialLog5 = modalState.socialLoginsConfig) === null || _modalState$socialLog5 === void 0 ? void 0 : _modalState$socialLog5.loginMethods]);
|
|
169
|
-
log.info("modal state", modalState, areSocialLoginsVisible);
|
|
170
|
-
const isEmailPasswordlessLoginVisible = useMemo(() => {
|
|
171
|
-
var _modalState$socialLog6;
|
|
172
|
-
return (_modalState$socialLog6 = modalState.socialLoginsConfig) === null || _modalState$socialLog6 === void 0 || (_modalState$socialLog6 = _modalState$socialLog6.loginMethods[AUTH_CONNECTION.EMAIL_PASSWORDLESS]) === null || _modalState$socialLog6 === void 0 ? void 0 : _modalState$socialLog6.showOnModal;
|
|
173
|
-
}, [(_modalState$socialLog7 = modalState.socialLoginsConfig) === null || _modalState$socialLog7 === void 0 ? void 0 : _modalState$socialLog7.loginMethods]);
|
|
174
|
-
const isSmsPasswordlessLoginVisible = useMemo(() => {
|
|
175
|
-
var _modalState$socialLog8;
|
|
176
|
-
return (_modalState$socialLog8 = modalState.socialLoginsConfig) === null || _modalState$socialLog8 === void 0 || (_modalState$socialLog8 = _modalState$socialLog8.loginMethods[AUTH_CONNECTION.SMS_PASSWORDLESS]) === null || _modalState$socialLog8 === void 0 ? void 0 : _modalState$socialLog8.showOnModal;
|
|
177
|
-
}, [(_modalState$socialLog9 = modalState.socialLoginsConfig) === null || _modalState$socialLog9 === void 0 ? void 0 : _modalState$socialLog9.loginMethods]);
|
|
178
|
-
return modalState.modalVisibilityDelayed && /*#__PURE__*/jsx("div", {
|
|
179
|
-
id: "w3a-modal",
|
|
180
|
-
className: "w3a-modal",
|
|
181
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
182
|
-
className: `${modalTransitionClasses.join(" ")} ${modalState.status !== MODAL_STATUS.INITIALIZED ? "w3a--p-6 w3a--pt-7" : ""} ${(areSocialLoginsVisible || isEmailPasswordlessLoginVisible || isSmsPasswordlessLoginVisible) && !modalState.externalWalletsVisibility ? "" : "wallet-adapter-container"}`,
|
|
183
|
-
children: [modalState.status !== MODAL_STATUS.INITIALIZED ? /*#__PURE__*/jsxs(Fragment, {
|
|
184
|
-
children: [/*#__PURE__*/jsx(memoizedHeader, {
|
|
185
|
-
onClose: closeModal,
|
|
186
|
-
appLogo: appLogo,
|
|
187
|
-
appName: appName
|
|
188
|
-
}), /*#__PURE__*/jsx("div", {
|
|
189
|
-
className: "w3a-modal__content w3ajs-content",
|
|
190
|
-
children: /*#__PURE__*/jsx(DetailedLoader, {
|
|
191
|
-
onClose: onCloseLoader,
|
|
192
|
-
appLogo: appLogo,
|
|
193
|
-
modalStatus: modalState.status,
|
|
194
|
-
message: t(modalState.postLoadingMessage),
|
|
195
|
-
connector: modalState.detailedLoaderConnector,
|
|
196
|
-
connectorName: modalState.detailedLoaderConnectorName
|
|
197
|
-
})
|
|
198
|
-
})]
|
|
199
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
200
|
-
className: `transition-wrapper ${transition}`,
|
|
201
|
-
children: (areSocialLoginsVisible || isEmailPasswordlessLoginVisible || isSmsPasswordlessLoginVisible) && !modalState.externalWalletsVisibility ? /*#__PURE__*/jsxs(Fragment, {
|
|
202
|
-
children: [/*#__PURE__*/jsx(memoizedHeader, {
|
|
203
|
-
onClose: closeModal,
|
|
204
|
-
appLogo: appLogo,
|
|
205
|
-
appName: appName
|
|
206
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
207
|
-
className: "w3a-modal__content w3ajs-content",
|
|
208
|
-
children: [areSocialLoginsVisible ? /*#__PURE__*/jsx(SocialLogins, {
|
|
209
|
-
handleSocialLoginClick: params => preHandleSocialWalletClick(params),
|
|
210
|
-
socialLoginsConfig: modalState.socialLoginsConfig
|
|
211
|
-
}) : null, (isEmailPasswordlessLoginVisible || isSmsPasswordlessLoginVisible) && /*#__PURE__*/jsx(SocialLoginPasswordless, {
|
|
212
|
-
isEmailVisible: isEmailPasswordlessLoginVisible,
|
|
213
|
-
isSmsVisible: isSmsPasswordlessLoginVisible,
|
|
214
|
-
connector: (_modalState$socialLog10 = modalState.socialLoginsConfig) === null || _modalState$socialLog10 === void 0 ? void 0 : _modalState$socialLog10.connector,
|
|
215
|
-
handleSocialLoginClick: params => preHandleSocialWalletClick(params),
|
|
216
|
-
socialLoginsConfig: modalState.socialLoginsConfig,
|
|
217
|
-
isPrimaryBtn: isEmailPrimary
|
|
218
|
-
}), modalState.hasExternalWallets && externalWalletButton]
|
|
219
|
-
})]
|
|
220
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
221
|
-
className: "w3a-modal__content_external_wallet w3ajs-content",
|
|
222
|
-
children: /*#__PURE__*/jsx(ExternalWallets, {
|
|
223
|
-
modalStatus: modalState.status,
|
|
224
|
-
showBackButton: areSocialLoginsVisible || isEmailPasswordlessLoginVisible || isSmsPasswordlessLoginVisible,
|
|
225
|
-
handleExternalWalletClick: preHandleExternalWalletClick,
|
|
226
|
-
chainNamespaces: chainNamespaces,
|
|
227
|
-
walletConnectUri: modalState.walletConnectUri,
|
|
228
|
-
config: modalState.externalWalletsConfig,
|
|
229
|
-
hideExternalWallets: () => setModalState(prevState => {
|
|
230
|
-
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
231
|
-
externalWalletsVisibility: false
|
|
232
|
-
});
|
|
233
|
-
}),
|
|
234
|
-
walletRegistry: walletRegistry,
|
|
235
|
-
closeModal: closeModal
|
|
236
|
-
})
|
|
237
|
-
})
|
|
238
|
-
}), /*#__PURE__*/jsx(Footer, {})]
|
|
239
|
-
})
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export { Modal as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import i18nInstance from '../localeImport.js';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
function SelfCustodyViaWeb3Auth() {
|
|
6
|
-
const [t] = useTranslation(undefined, {
|
|
7
|
-
i18n: i18nInstance
|
|
8
|
-
});
|
|
9
|
-
return /*#__PURE__*/jsxs("div", {
|
|
10
|
-
className: "w3a--flex w3a--items-center w3a--gap-2 w3a--justify-center",
|
|
11
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
12
|
-
className: "w3a--text-xs w3a--text-app-gray-300 dark:w3a--text-app-gray-500",
|
|
13
|
-
children: t("modal.footer.message-new")
|
|
14
|
-
}), /*#__PURE__*/jsx("img", {
|
|
15
|
-
height: "16",
|
|
16
|
-
src: "https://images.web3auth.io/web3auth-footer-logo-light.svg",
|
|
17
|
-
alt: "Web3Auth Logo Light",
|
|
18
|
-
className: "w3a--h-4 w3a--block dark:w3a--hidden"
|
|
19
|
-
}), /*#__PURE__*/jsx("img", {
|
|
20
|
-
height: "16",
|
|
21
|
-
src: "https://images.web3auth.io/web3auth-footer-logo-dark.svg",
|
|
22
|
-
alt: "Web3Auth Logo Dark",
|
|
23
|
-
className: "w3a--h-4 w3a--hidden dark:w3a--block"
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { SelfCustodyViaWeb3Auth as default };
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { AUTH_CONNECTION } from '@web3auth/auth';
|
|
2
|
-
import { useState, useEffect, useMemo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import i18nInstance from '../localeImport.js';
|
|
5
|
-
import { validatePhoneNumber, getUserCountry } from '../utils.js';
|
|
6
|
-
import Button from './Button/Button.js';
|
|
7
|
-
import Icon from './Icon.js';
|
|
8
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
function SocialLoginPasswordless(props) {
|
|
11
|
-
const {
|
|
12
|
-
handleSocialLoginClick,
|
|
13
|
-
connector,
|
|
14
|
-
isPrimaryBtn,
|
|
15
|
-
isEmailVisible,
|
|
16
|
-
isSmsVisible,
|
|
17
|
-
socialLoginsConfig
|
|
18
|
-
} = props;
|
|
19
|
-
const [fieldValue, setFieldValue] = useState("");
|
|
20
|
-
const [countryCode, setCountryCode] = useState("");
|
|
21
|
-
const [isValidInput, setIsValidInput] = useState(null);
|
|
22
|
-
const [t] = useTranslation(undefined, {
|
|
23
|
-
i18n: i18nInstance
|
|
24
|
-
});
|
|
25
|
-
const handleFormSubmit = async e => {
|
|
26
|
-
e.preventDefault();
|
|
27
|
-
const value = fieldValue;
|
|
28
|
-
if (isEmailVisible) {
|
|
29
|
-
const emailConfig = socialLoginsConfig.loginMethods[AUTH_CONNECTION.EMAIL_PASSWORDLESS];
|
|
30
|
-
const isEmailValid = value.match(/^([\w.%+-]+)@([\w-]+\.)+([\w]{2,})$/i);
|
|
31
|
-
if (isEmailValid) {
|
|
32
|
-
return handleSocialLoginClick({
|
|
33
|
-
connector,
|
|
34
|
-
loginParams: {
|
|
35
|
-
authConnection: AUTH_CONNECTION.EMAIL_PASSWORDLESS,
|
|
36
|
-
authConnectionId: emailConfig.authConnectionId,
|
|
37
|
-
groupedAuthConnectionId: "",
|
|
38
|
-
login_hint: value,
|
|
39
|
-
name: "Email"
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
if (isSmsVisible) {
|
|
45
|
-
const smsConfig = socialLoginsConfig.loginMethods[AUTH_CONNECTION.SMS_PASSWORDLESS];
|
|
46
|
-
const number = value.startsWith("+") ? value : `${countryCode}${value}`;
|
|
47
|
-
const result = await validatePhoneNumber(number);
|
|
48
|
-
if (result) {
|
|
49
|
-
return handleSocialLoginClick({
|
|
50
|
-
connector,
|
|
51
|
-
loginParams: {
|
|
52
|
-
authConnection: AUTH_CONNECTION.SMS_PASSWORDLESS,
|
|
53
|
-
authConnectionId: smsConfig.authConnectionId,
|
|
54
|
-
groupedAuthConnectionId: smsConfig.groupedAuthConnectionId,
|
|
55
|
-
login_hint: typeof result === "string" ? result : number,
|
|
56
|
-
name: "Mobile"
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
setIsValidInput(false);
|
|
62
|
-
return undefined;
|
|
63
|
-
};
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
const getLocation = async () => {
|
|
66
|
-
const result = await getUserCountry();
|
|
67
|
-
if (result && result.dialCode) {
|
|
68
|
-
setCountryCode(result.dialCode);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
if (isSmsVisible) getLocation();
|
|
72
|
-
}, [isSmsVisible]);
|
|
73
|
-
const handleInputChange = e => {
|
|
74
|
-
setFieldValue(e.target.value);
|
|
75
|
-
if (isValidInput === false) setIsValidInput(null);
|
|
76
|
-
};
|
|
77
|
-
const title = useMemo(() => {
|
|
78
|
-
if (isEmailVisible && isSmsVisible) return "modal.social.passwordless-title";
|
|
79
|
-
if (isEmailVisible) return "modal.social.email";
|
|
80
|
-
return "modal.social.phone";
|
|
81
|
-
}, [isEmailVisible, isSmsVisible]);
|
|
82
|
-
const placeholder = useMemo(() => {
|
|
83
|
-
if (isEmailVisible && isSmsVisible) return "+(00)123456/name@example.com";
|
|
84
|
-
if (isEmailVisible) return "name@example.com";
|
|
85
|
-
return "+(00)123456";
|
|
86
|
-
}, [isEmailVisible, isSmsVisible]);
|
|
87
|
-
const invalidInputErrorMessage = useMemo(() => {
|
|
88
|
-
if (isEmailVisible && isSmsVisible) return "modal.errors-invalid-number-email";
|
|
89
|
-
if (isEmailVisible) return "modal.errors-invalid-email";
|
|
90
|
-
return "modal.errors-invalid-number";
|
|
91
|
-
}, [isEmailVisible, isSmsVisible]);
|
|
92
|
-
return /*#__PURE__*/jsxs("div", {
|
|
93
|
-
className: "w3ajs-passwordless w3a-group w3a-group--passwordless",
|
|
94
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
95
|
-
className: "w3a-group__title",
|
|
96
|
-
children: [t(title), isSmsVisible && /*#__PURE__*/jsxs("div", {
|
|
97
|
-
className: "w3a--relative w3a--flex w3a--flex-col w3a--items-center w3a--cursor-pointer w3a--group",
|
|
98
|
-
children: [/*#__PURE__*/jsx(Icon, {
|
|
99
|
-
iconName: "information-circle-light",
|
|
100
|
-
darkIconName: "information-circle"
|
|
101
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
102
|
-
className: "w3a--absolute w3a--z-20 w3a--flex-col w3a--items-center w3a--hidden w3a--mb-5 w3a--top-4 group-hover:w3a--flex",
|
|
103
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
104
|
-
className: "w3a--w-3 w3a--h-3 w3a--ml-[3px] -w3a--mb-2 w3a--rotate-45 w3a--bg-app-gray-50 dark:w3a--bg-app-gray-600"
|
|
105
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
106
|
-
className: `w3a--relative w3a--p-4 w3a--w-[300px] w3a--text-xs w3a--leading-none w3a--text-app-white w3a--rounded-md w3a--bg-app-gray-50 dark:w3a--bg-app-gray-600 w3a--shadow-lg ${isSmsVisible && !isEmailVisible ? "w3a--left-20" : "w3a--left-8"}`,
|
|
107
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
108
|
-
className: "w3a--mb-1 w3a--text-xs w3a--font-medium w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
109
|
-
children: t("modal.popup.phone-header")
|
|
110
|
-
}), /*#__PURE__*/jsx("div", {
|
|
111
|
-
className: "w3a--text-xs w3a--text-app-gray-400",
|
|
112
|
-
children: t("modal.popup.phone-body")
|
|
113
|
-
})]
|
|
114
|
-
})]
|
|
115
|
-
})]
|
|
116
|
-
})]
|
|
117
|
-
}), /*#__PURE__*/jsxs("form", {
|
|
118
|
-
className: "w3ajs-passwordless-form",
|
|
119
|
-
onSubmit: e => handleFormSubmit(e),
|
|
120
|
-
children: [/*#__PURE__*/jsx("input", {
|
|
121
|
-
className: "w3a--w-full w3a--mb-4 w3a-text-field",
|
|
122
|
-
name: "passwordless-input",
|
|
123
|
-
required: true,
|
|
124
|
-
placeholder: `${t("modal.social.sms-placeholder-text")} ${placeholder}`,
|
|
125
|
-
onFocus: e => {
|
|
126
|
-
e.target.placeholder = "";
|
|
127
|
-
},
|
|
128
|
-
onBlur: e => {
|
|
129
|
-
e.target.placeholder = `${t("modal.social.sms-placeholder-text")} ${placeholder}`;
|
|
130
|
-
},
|
|
131
|
-
onChange: e => handleInputChange(e)
|
|
132
|
-
}), isValidInput === false && /*#__PURE__*/jsx("div", {
|
|
133
|
-
className: "w3a-sms-field--error",
|
|
134
|
-
children: t(invalidInputErrorMessage)
|
|
135
|
-
}), /*#__PURE__*/jsx(Button, {
|
|
136
|
-
variant: isPrimaryBtn ? "primary" : "tertiary",
|
|
137
|
-
disabled: fieldValue === "",
|
|
138
|
-
className: "w3a--w-full",
|
|
139
|
-
type: "submit",
|
|
140
|
-
children: t("modal.social.passwordless-cta")
|
|
141
|
-
})]
|
|
142
|
-
})]
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export { SocialLoginPasswordless as default };
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { AUTH_CONNECTION } from '@web3auth/auth';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { useState, useContext, useEffect } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { capitalizeFirstLetter } from '../config.js';
|
|
6
|
-
import { ThemedContext } from '../context/ThemeContext.js';
|
|
7
|
-
import i18nInstance from '../localeImport.js';
|
|
8
|
-
import Button from './Button/Button.js';
|
|
9
|
-
import Image from './Image.js';
|
|
10
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
|
-
|
|
12
|
-
function getProviderIcon(method, isDark, isPrimaryBtn) {
|
|
13
|
-
const imageId = method === AUTH_CONNECTION.TWITTER ? `login-twitter-x${isDark ? "-light" : "-dark"}` : `login-${method}${isDark ? "-light" : "-dark"}`;
|
|
14
|
-
const hoverId = method === AUTH_CONNECTION.APPLE || method === AUTH_CONNECTION.GITHUB || method === AUTH_CONNECTION.TWITTER ? imageId : `login-${method}-active`;
|
|
15
|
-
if (isPrimaryBtn) {
|
|
16
|
-
return /*#__PURE__*/jsx(Image, {
|
|
17
|
-
width: "20",
|
|
18
|
-
imageId: hoverId,
|
|
19
|
-
hoverImageId: hoverId,
|
|
20
|
-
isButton: true
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return /*#__PURE__*/jsx(Image, {
|
|
24
|
-
width: "20",
|
|
25
|
-
imageId: imageId,
|
|
26
|
-
hoverImageId: hoverId,
|
|
27
|
-
isButton: true
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function SocialLogins(props) {
|
|
31
|
-
const [canShowMore, setCanShowMore] = useState(false);
|
|
32
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
33
|
-
const {
|
|
34
|
-
socialLoginsConfig = {
|
|
35
|
-
loginMethods: {},
|
|
36
|
-
loginMethodsOrder: [],
|
|
37
|
-
connector: "",
|
|
38
|
-
uiConfig: {}
|
|
39
|
-
},
|
|
40
|
-
handleSocialLoginClick
|
|
41
|
-
} = props;
|
|
42
|
-
const {
|
|
43
|
-
isDark
|
|
44
|
-
} = useContext(ThemedContext);
|
|
45
|
-
const [t] = useTranslation(undefined, {
|
|
46
|
-
i18n: i18nInstance
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// Too small a function to use `useCallback`
|
|
50
|
-
const expandClickHandler = () => {
|
|
51
|
-
setIsExpanded(!isExpanded);
|
|
52
|
-
};
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
const maxOptions = Object.keys(socialLoginsConfig.loginMethods).filter(loginMethodKey => {
|
|
55
|
-
return socialLoginsConfig.loginMethods[loginMethodKey].showOnModal;
|
|
56
|
-
});
|
|
57
|
-
setCanShowMore(maxOptions.length > 4);
|
|
58
|
-
}, [socialLoginsConfig.loginMethods]);
|
|
59
|
-
const adapterListClass = classNames("w3a-adapter-list", "w3ajs-socials-adapters", !isExpanded ? " w3a-adapter-list--shrink" : "");
|
|
60
|
-
const adapterButtonClass = classNames("w3a-button-expand", "w3ajs-button-expand", isExpanded ? "w3a-button--rotate" : "");
|
|
61
|
-
const adapterExpandText = isExpanded ? t("modal.social.view-less") : t("modal.social.view-more");
|
|
62
|
-
const loginMethodsCount = Object.keys(socialLoginsConfig.loginMethods).length + 1;
|
|
63
|
-
const restrictedLoginMethods = [AUTH_CONNECTION.CUSTOM, AUTH_CONNECTION.SMS_PASSWORDLESS, AUTH_CONNECTION.EMAIL_PASSWORDLESS, AUTH_CONNECTION.PASSKEYS, AUTH_CONNECTION.TELEGRAM, AUTH_CONNECTION.AUTHENTICATOR];
|
|
64
|
-
return /*#__PURE__*/jsxs("div", {
|
|
65
|
-
className: "w3ajs-social-logins w3a-group",
|
|
66
|
-
children: [/*#__PURE__*/jsx("ul", {
|
|
67
|
-
className: adapterListClass,
|
|
68
|
-
children: Object.keys(socialLoginsConfig.loginMethods).map(method => {
|
|
69
|
-
var _socialLoginsConfig$u, _socialLoginsConfig$u2;
|
|
70
|
-
const socialLoginConfig = socialLoginsConfig.loginMethods[method];
|
|
71
|
-
const name = capitalizeFirstLetter(socialLoginConfig.name || method);
|
|
72
|
-
const orderIndex = socialLoginsConfig.loginMethodsOrder.indexOf(method) + 1;
|
|
73
|
-
const order = orderIndex || Object.keys(socialLoginsConfig.loginMethods).length + 1;
|
|
74
|
-
const isMainOption = socialLoginConfig.mainOption;
|
|
75
|
-
const isPrimaryBtn = (socialLoginsConfig === null || socialLoginsConfig === void 0 || (_socialLoginsConfig$u = socialLoginsConfig.uiConfig) === null || _socialLoginsConfig$u === void 0 ? void 0 : _socialLoginsConfig$u.primaryButton) === "socialLogin" && order === 1;
|
|
76
|
-
const providerIcon = getProviderIcon(method, isDark, isPrimaryBtn);
|
|
77
|
-
if (socialLoginConfig.showOnModal === false || restrictedLoginMethods.includes(method)) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
const loginMethodSpan = classNames("w3a-adapter-item", (socialLoginsConfig === null || socialLoginsConfig === void 0 || (_socialLoginsConfig$u2 = socialLoginsConfig.uiConfig) === null || _socialLoginsConfig$u2 === void 0 ? void 0 : _socialLoginsConfig$u2.loginGridCol) === 2 ? "w3a--col-span-3" : "w3a--col-span-2");
|
|
81
|
-
if (isMainOption || order === 1) {
|
|
82
|
-
return /*#__PURE__*/jsx("li", {
|
|
83
|
-
className: "w3a--col-span-6 w3a-adapter-item",
|
|
84
|
-
style: {
|
|
85
|
-
order
|
|
86
|
-
},
|
|
87
|
-
children: /*#__PURE__*/jsxs(Button, {
|
|
88
|
-
variant: "secondary",
|
|
89
|
-
onClick: () => handleSocialLoginClick({
|
|
90
|
-
connector: socialLoginsConfig.connector,
|
|
91
|
-
loginParams: {
|
|
92
|
-
authConnection: method,
|
|
93
|
-
name: socialLoginConfig.name,
|
|
94
|
-
authConnectionId: socialLoginConfig.authConnectionId,
|
|
95
|
-
groupedAuthConnectionId: socialLoginConfig.groupedAuthConnectionId,
|
|
96
|
-
login_hint: ""
|
|
97
|
-
}
|
|
98
|
-
}),
|
|
99
|
-
className: "w3a--w-full",
|
|
100
|
-
title: name,
|
|
101
|
-
children: [providerIcon, /*#__PURE__*/jsx("p", {
|
|
102
|
-
className: "w3a--ml-2",
|
|
103
|
-
children: t("modal.social.continueCustom", {
|
|
104
|
-
adapter: name
|
|
105
|
-
})
|
|
106
|
-
})]
|
|
107
|
-
})
|
|
108
|
-
}, method);
|
|
109
|
-
}
|
|
110
|
-
return /*#__PURE__*/jsx("li", {
|
|
111
|
-
className: loginMethodSpan,
|
|
112
|
-
style: {
|
|
113
|
-
order: order + loginMethodsCount
|
|
114
|
-
},
|
|
115
|
-
children: /*#__PURE__*/jsx(Button, {
|
|
116
|
-
variant: "secondary",
|
|
117
|
-
onClick: () => handleSocialLoginClick({
|
|
118
|
-
connector: socialLoginsConfig.connector,
|
|
119
|
-
loginParams: {
|
|
120
|
-
authConnection: method,
|
|
121
|
-
name: socialLoginConfig.name,
|
|
122
|
-
authConnectionId: socialLoginConfig.authConnectionId,
|
|
123
|
-
groupedAuthConnectionId: socialLoginConfig.groupedAuthConnectionId,
|
|
124
|
-
login_hint: ""
|
|
125
|
-
}
|
|
126
|
-
}),
|
|
127
|
-
className: "w3a--w-full",
|
|
128
|
-
title: name,
|
|
129
|
-
children: providerIcon
|
|
130
|
-
})
|
|
131
|
-
}, method);
|
|
132
|
-
})
|
|
133
|
-
}), /*#__PURE__*/jsx("div", {
|
|
134
|
-
className: "w3a-social__policy",
|
|
135
|
-
children: t("modal.social.policy")
|
|
136
|
-
}), canShowMore && /*#__PURE__*/jsx("div", {
|
|
137
|
-
className: "w3a--text-right",
|
|
138
|
-
children: /*#__PURE__*/jsx("button", {
|
|
139
|
-
type: "button",
|
|
140
|
-
className: adapterButtonClass,
|
|
141
|
-
onClick: expandClickHandler,
|
|
142
|
-
children: /*#__PURE__*/jsx("span", {
|
|
143
|
-
className: "w3ajs-button-expand-text",
|
|
144
|
-
children: adapterExpandText
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
})]
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
export { SocialLogins as default };
|