@web3auth/modal 10.16.0 → 11.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.cjs/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.cjs/packages/modal/src/account-linking/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/react.js +22 -0
- package/dist/lib.cjs/packages/modal/src/account-linking/vue.js +22 -0
- package/dist/lib.cjs/packages/modal/src/config.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +473 -17
- package/dist/lib.cjs/packages/modal/src/react/Web3AuthProvider.js +4 -2
- package/dist/lib.cjs/packages/modal/src/react/context/WalletServicesInnerContext.js +3 -56
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +15 -152
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +1 -22
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthConnect.js +30 -43
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthInner.js +8 -4
- package/dist/lib.cjs/packages/modal/src/react/index.js +61 -28
- package/dist/lib.cjs/packages/modal/src/react/solana/index.js +21 -8
- package/dist/lib.cjs/packages/modal/src/react/wagmi/provider.js +34 -17
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +15 -18
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +4 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +11 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +6 -6
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +132 -44
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +20 -19
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +22 -24
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.css.js +6 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +30 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +12 -12
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +5 -2
- package/dist/lib.cjs/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +109 -0
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWallet.js +77 -29
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +20 -11
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +10 -10
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.js +41 -33
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +13 -11
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +13 -7
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Embed/Embed.js +12 -11
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/Login.js +95 -80
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/LoginOtp/LoginOtp.js +12 -12
- package/dist/lib.cjs/packages/modal/src/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.js +14 -14
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/Root.js +250 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +185 -0
- package/dist/lib.cjs/packages/modal/src/ui/containers/Widget/Widget.js +110 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/ModalStateContext.js +158 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/RootContext.js +64 -21
- package/dist/lib.cjs/packages/modal/src/ui/context/WidgetContext.js +52 -0
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +28 -1
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +186 -46
- package/dist/lib.cjs/packages/modal/src/vue/WalletServicesInnerProvider.js +2 -50
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +7 -170
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthConnect.js +31 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthInner.js +2 -5
- package/dist/lib.cjs/packages/modal/src/vue/index.js +61 -28
- package/dist/lib.cjs/packages/modal/src/vue/solana/index.js +29 -8
- package/dist/lib.cjs/packages/modal/src/vue/wagmi/provider.js +37 -23
- package/dist/lib.cjs/packages/modal/src/x402/index.js +12 -0
- package/dist/lib.cjs/packages/modal/src/x402/react.js +26 -0
- package/dist/lib.cjs/packages/modal/src/x402/vue.js +18 -0
- package/dist/lib.cjs/types/account-linking/index.d.ts +1 -0
- package/dist/lib.cjs/types/account-linking/react.d.ts +2 -0
- package/dist/lib.cjs/types/account-linking/vue.d.ts +2 -0
- package/dist/lib.cjs/types/interface.d.ts +2 -2
- package/dist/lib.cjs/types/modalManager.d.ts +46 -4
- package/dist/lib.cjs/types/react/context/WalletServicesInnerContext.d.ts +12 -5
- package/dist/lib.cjs/types/react/context/Web3AuthInnerContext.d.ts +4 -3
- package/dist/lib.cjs/types/react/hooks/index.d.ts +16 -14
- package/dist/lib.cjs/types/react/hooks/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/react/hooks/useWeb3Auth.d.ts +1 -2
- package/dist/lib.cjs/types/react/hooks/useWeb3AuthConnect.d.ts +3 -3
- package/dist/lib.cjs/types/react/interfaces.d.ts +3 -2
- package/dist/lib.cjs/types/react/solana/hooks/index.d.ts +5 -4
- package/dist/lib.cjs/types/react/solana/index.d.ts +1 -0
- package/dist/lib.cjs/types/react/solana/provider.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.type.d.ts +4 -3
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.type.d.ts +7 -5
- package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.type.d.ts +2 -1
- package/dist/lib.cjs/types/ui/components/SpinnerLoader/SpinnerLoader.d.ts +4 -0
- package/dist/lib.cjs/types/ui/components/SpinnerLoader/SpinnerLoader.type.d.ts +9 -0
- package/dist/lib.cjs/types/ui/components/SpinnerLoader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/constants.d.ts +7 -4
- package/dist/lib.cjs/types/ui/containers/AccountLinking/AccountLinking.d.ts +6 -0
- package/dist/lib.cjs/types/ui/containers/AccountLinking/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/ConnectWallet/ConnectWallet.type.d.ts +7 -0
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.type.d.ts +0 -2
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +1 -0
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.type.d.ts +3 -9
- package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.type.d.ts +0 -2
- package/dist/lib.cjs/types/ui/containers/Login/Login.type.d.ts +6 -0
- package/dist/lib.cjs/types/ui/{components → containers}/Root/Root.d.ts +1 -1
- package/dist/lib.cjs/types/ui/containers/Root/Root.type.d.ts +3 -0
- package/dist/lib.cjs/types/ui/containers/Root/RootBodySheets/RootBodySheets.d.ts +1 -0
- package/dist/lib.cjs/types/ui/containers/Widget/Widget.type.d.ts +5 -0
- package/dist/lib.cjs/types/ui/context/ModalStateContext.d.ts +28 -0
- package/dist/lib.cjs/types/ui/context/RootContext.d.ts +19 -7
- package/dist/lib.cjs/types/ui/context/WidgetContext.d.ts +45 -0
- package/dist/lib.cjs/types/ui/interfaces.d.ts +53 -15
- package/dist/lib.cjs/types/ui/loginModal.d.ts +31 -4
- package/dist/lib.cjs/types/ui/utils.d.ts +1 -1
- package/dist/lib.cjs/types/vue/composables/index.d.ts +3 -14
- package/dist/lib.cjs/types/vue/composables/useWallets.d.ts +2 -0
- package/dist/lib.cjs/types/vue/composables/useWeb3Auth.d.ts +1 -2
- package/dist/lib.cjs/types/vue/composables/useWeb3AuthConnect.d.ts +3 -3
- package/dist/lib.cjs/types/vue/interfaces.d.ts +3 -17
- package/dist/lib.cjs/types/vue/solana/composables/index.d.ts +3 -4
- package/dist/lib.cjs/types/vue/solana/composables/useSolanaClient.d.ts +1 -0
- package/dist/lib.cjs/types/vue/solana/constants.d.ts +1 -0
- package/dist/lib.cjs/types/vue/solana/index.d.ts +2 -0
- package/dist/lib.cjs/types/vue/solana/provider.d.ts +1 -0
- package/dist/lib.cjs/types/x402/index.d.ts +1 -0
- package/dist/lib.cjs/types/x402/react.d.ts +2 -0
- package/dist/lib.cjs/types/x402/vue.d.ts +2 -0
- package/dist/lib.esm/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.esm/packages/modal/src/account-linking/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/account-linking/vue.js +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +478 -19
- package/dist/lib.esm/packages/modal/src/react/Web3AuthProvider.js +4 -2
- package/dist/lib.esm/packages/modal/src/react/context/WalletServicesInnerContext.js +4 -57
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +12 -151
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3Auth.js +1 -22
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthConnect.js +28 -41
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthInner.js +7 -3
- package/dist/lib.esm/packages/modal/src/react/index.js +1 -14
- package/dist/lib.esm/packages/modal/src/react/solana/index.js +1 -4
- package/dist/lib.esm/packages/modal/src/react/wagmi/provider.js +34 -17
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +15 -18
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +4 -2
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +12 -13
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +7 -7
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +133 -45
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +3 -3
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +20 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +4 -4
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +22 -24
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.css.js +4 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SpinnerLoader/SpinnerLoader.js +28 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +14 -14
- package/dist/lib.esm/packages/modal/src/ui/constants.js +5 -2
- package/dist/lib.esm/packages/modal/src/ui/containers/AccountLinking/AccountLinking.js +107 -0
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWallet.js +81 -32
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +20 -11
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js +10 -10
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +9 -8
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.js +41 -33
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +15 -13
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +13 -7
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Embed/Embed.js +12 -11
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/Login.js +99 -83
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/LoginOtp/LoginOtp.js +12 -12
- package/dist/lib.esm/packages/modal/src/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.js +14 -14
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/Root.js +253 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/Root/RootBodySheets/RootBodySheets.js +183 -0
- package/dist/lib.esm/packages/modal/src/ui/containers/Widget/Widget.js +108 -0
- package/dist/lib.esm/packages/modal/src/ui/context/ModalStateContext.js +161 -0
- package/dist/lib.esm/packages/modal/src/ui/context/RootContext.js +60 -22
- package/dist/lib.esm/packages/modal/src/ui/context/WidgetContext.js +49 -0
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +26 -12
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +14 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +26 -2
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +188 -48
- package/dist/lib.esm/packages/modal/src/vue/WalletServicesInnerProvider.js +5 -54
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +9 -176
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthConnect.js +28 -30
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthInner.js +2 -5
- package/dist/lib.esm/packages/modal/src/vue/index.js +1 -14
- package/dist/lib.esm/packages/modal/src/vue/solana/index.js +1 -4
- package/dist/lib.esm/packages/modal/src/vue/wagmi/provider.js +33 -19
- package/dist/lib.esm/packages/modal/src/x402/index.js +1 -0
- package/dist/lib.esm/packages/modal/src/x402/react.js +1 -0
- package/dist/lib.esm/packages/modal/src/x402/vue.js +1 -0
- package/package.json +94 -47
- package/dist/lib.cjs/packages/modal/src/providers/ethereum-mpc-provider/index.js +0 -12
- package/dist/lib.cjs/packages/modal/src/react/hooks/useChain.js +0 -16
- package/dist/lib.cjs/packages/modal/src/react/hooks/useCheckout.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useEnableMFA.js +0 -30
- package/dist/lib.cjs/packages/modal/src/react/hooks/useFunding.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useIdentityToken.js +0 -46
- package/dist/lib.cjs/packages/modal/src/react/hooks/useManageMFA.js +0 -30
- package/dist/lib.cjs/packages/modal/src/react/hooks/useReceive.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useSwap.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useSwitchChain.js +0 -32
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWalletConnectScanner.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWalletServicesPlugin.js +0 -13
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWalletUI.js +0 -34
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthDisconnect.js +0 -30
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3AuthUser.js +0 -50
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSignAndSendTransaction.js +0 -36
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSignMessage.js +0 -37
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSignTransaction.js +0 -36
- package/dist/lib.cjs/packages/modal/src/react/solana/hooks/useSolanaWallet.js +0 -68
- package/dist/lib.cjs/packages/modal/src/ui/components/CircularLoader/CircularLoader.js +0 -88
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +0 -513
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +0 -251
- package/dist/lib.cjs/packages/modal/src/ui/context/ThemeContext.js +0 -9
- package/dist/lib.cjs/packages/modal/src/vue/composables/useChain.js +0 -13
- package/dist/lib.cjs/packages/modal/src/vue/composables/useCheckout.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useEnableMFA.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useFunding.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useIdentityToken.js +0 -51
- package/dist/lib.cjs/packages/modal/src/vue/composables/useManageMFA.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useReceive.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useSwap.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useSwitchChain.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletConnectScanner.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletServicesPlugin.js +0 -13
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWalletUI.js +0 -35
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthDisconnect.js +0 -33
- package/dist/lib.cjs/packages/modal/src/vue/composables/useWeb3AuthUser.js +0 -54
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignAndSendTransaction.js +0 -37
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignMessage.js +0 -39
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSignTransaction.js +0 -37
- package/dist/lib.cjs/packages/modal/src/vue/solana/composables/useSolanaWallet.js +0 -67
- package/dist/lib.cjs/types/providers/ethereum-mpc-provider/index.d.ts +0 -1
- package/dist/lib.cjs/types/react/hooks/useChain.d.ts +0 -6
- package/dist/lib.cjs/types/react/hooks/useCheckout.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useEnableMFA.d.ts +0 -7
- package/dist/lib.cjs/types/react/hooks/useFunding.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useIdentityToken.d.ts +0 -13
- package/dist/lib.cjs/types/react/hooks/useManageMFA.d.ts +0 -7
- package/dist/lib.cjs/types/react/hooks/useReceive.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useSwap.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useSwitchChain.d.ts +0 -7
- package/dist/lib.cjs/types/react/hooks/useWalletConnectScanner.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useWalletServicesPlugin.d.ts +0 -2
- package/dist/lib.cjs/types/react/hooks/useWalletUI.d.ts +0 -8
- package/dist/lib.cjs/types/react/hooks/useWeb3AuthDisconnect.d.ts +0 -9
- package/dist/lib.cjs/types/react/hooks/useWeb3AuthUser.d.ts +0 -9
- package/dist/lib.cjs/types/react/solana/hooks/useSignAndSendTransaction.d.ts +0 -8
- package/dist/lib.cjs/types/react/solana/hooks/useSignMessage.d.ts +0 -8
- package/dist/lib.cjs/types/react/solana/hooks/useSignTransaction.d.ts +0 -13
- package/dist/lib.cjs/types/react/solana/hooks/useSolanaWallet.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/CircularLoader/CircularLoader.d.ts +0 -3
- package/dist/lib.cjs/types/ui/components/CircularLoader/CircularLoader.type.d.ts +0 -19
- package/dist/lib.cjs/types/ui/components/CircularLoader/index.d.ts +0 -2
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.type.d.ts +0 -27
- package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +0 -35
- package/dist/lib.cjs/types/ui/components/Root/Root.type.d.ts +0 -36
- package/dist/lib.cjs/types/ui/components/Widget/Widget.type.d.ts +0 -24
- package/dist/lib.cjs/types/ui/context/ThemeContext.d.ts +0 -3
- package/dist/lib.cjs/types/vue/composables/useChain.d.ts +0 -7
- package/dist/lib.cjs/types/vue/composables/useCheckout.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useEnableMFA.d.ts +0 -8
- package/dist/lib.cjs/types/vue/composables/useFunding.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useIdentityToken.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useManageMFA.d.ts +0 -8
- package/dist/lib.cjs/types/vue/composables/useReceive.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useSwap.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useSwitchChain.d.ts +0 -10
- package/dist/lib.cjs/types/vue/composables/useWalletConnectScanner.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useWalletServicesPlugin.d.ts +0 -2
- package/dist/lib.cjs/types/vue/composables/useWalletUI.d.ts +0 -9
- package/dist/lib.cjs/types/vue/composables/useWeb3AuthDisconnect.d.ts +0 -10
- package/dist/lib.cjs/types/vue/composables/useWeb3AuthUser.d.ts +0 -10
- package/dist/lib.cjs/types/vue/solana/composables/useSignAndSendTransaction.d.ts +0 -9
- package/dist/lib.cjs/types/vue/solana/composables/useSignMessage.d.ts +0 -9
- package/dist/lib.cjs/types/vue/solana/composables/useSignTransaction.d.ts +0 -9
- package/dist/lib.cjs/types/vue/solana/composables/useSolanaWallet.d.ts +0 -9
- package/dist/lib.esm/packages/modal/src/providers/ethereum-mpc-provider/index.js +0 -1
- package/dist/lib.esm/packages/modal/src/react/hooks/useChain.js +0 -14
- package/dist/lib.esm/packages/modal/src/react/hooks/useCheckout.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useEnableMFA.js +0 -28
- package/dist/lib.esm/packages/modal/src/react/hooks/useFunding.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useIdentityToken.js +0 -44
- package/dist/lib.esm/packages/modal/src/react/hooks/useManageMFA.js +0 -28
- package/dist/lib.esm/packages/modal/src/react/hooks/useReceive.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useSwap.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useSwitchChain.js +0 -30
- package/dist/lib.esm/packages/modal/src/react/hooks/useWalletConnectScanner.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useWalletServicesPlugin.js +0 -11
- package/dist/lib.esm/packages/modal/src/react/hooks/useWalletUI.js +0 -32
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthDisconnect.js +0 -28
- package/dist/lib.esm/packages/modal/src/react/hooks/useWeb3AuthUser.js +0 -48
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSignAndSendTransaction.js +0 -34
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSignMessage.js +0 -35
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSignTransaction.js +0 -34
- package/dist/lib.esm/packages/modal/src/react/solana/hooks/useSolanaWallet.js +0 -64
- package/dist/lib.esm/packages/modal/src/ui/components/CircularLoader/CircularLoader.js +0 -86
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +0 -524
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +0 -253
- package/dist/lib.esm/packages/modal/src/ui/context/ThemeContext.js +0 -7
- package/dist/lib.esm/packages/modal/src/vue/composables/useChain.js +0 -11
- package/dist/lib.esm/packages/modal/src/vue/composables/useCheckout.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useEnableMFA.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useFunding.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useIdentityToken.js +0 -49
- package/dist/lib.esm/packages/modal/src/vue/composables/useManageMFA.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useReceive.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useSwap.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useSwitchChain.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletConnectScanner.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletServicesPlugin.js +0 -11
- package/dist/lib.esm/packages/modal/src/vue/composables/useWalletUI.js +0 -33
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthDisconnect.js +0 -31
- package/dist/lib.esm/packages/modal/src/vue/composables/useWeb3AuthUser.js +0 -52
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignAndSendTransaction.js +0 -35
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignMessage.js +0 -37
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSignTransaction.js +0 -35
- package/dist/lib.esm/packages/modal/src/vue/solana/composables/useSolanaWallet.js +0 -65
- package/dist/modal.umd.min.js +0 -2
- package/dist/modal.umd.min.js.LICENSE.txt +0 -102
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWallet.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainFilter/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletChainNamespaceSelect/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletHeader/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletList/ConnectWalletList.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletList/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletQrCode/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/ConnectWalletSearch/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/ConnectWallet/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Embed/Embed.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Embed/Embed.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Embed/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/Login.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginOtp/LoginOtp.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginOtp/LoginOtp.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginOtp/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginPasswordLess/LoginPasswordLess.type.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/LoginPasswordLess/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Login/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Root/index.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Widget/Widget.d.ts +0 -0
- /package/dist/lib.cjs/types/ui/{components → containers}/Widget/index.d.ts +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cn from 'classnames';
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { ThemedContext } from '../../../context/ThemeContext.js';
|
|
5
4
|
import i18nInstance from '../../../localeImport.js';
|
|
6
5
|
import { formatIOSMobile, getIcons } from '../../../utils.js';
|
|
7
6
|
import Image from '../../Image/Image.js';
|
|
@@ -12,6 +11,7 @@ function ButtonWallet(props) {
|
|
|
12
11
|
i18n: i18nInstance
|
|
13
12
|
});
|
|
14
13
|
const {
|
|
14
|
+
isDark,
|
|
15
15
|
deviceDetails,
|
|
16
16
|
button,
|
|
17
17
|
walletConnectUri,
|
|
@@ -19,7 +19,6 @@ function ButtonWallet(props) {
|
|
|
19
19
|
label,
|
|
20
20
|
buttonRadius
|
|
21
21
|
} = props;
|
|
22
|
-
const isDark = useContext(ThemedContext);
|
|
23
22
|
const isLink = useMemo(() => deviceDetails.platform !== "desktop" && button.href && button.hasWalletConnect && !button.isInstalled, [deviceDetails, button]);
|
|
24
23
|
const href = useMemo(() => button.href ? formatIOSMobile({
|
|
25
24
|
uri: walletConnectUri,
|
|
@@ -34,17 +33,17 @@ function ButtonWallet(props) {
|
|
|
34
33
|
};
|
|
35
34
|
return /*#__PURE__*/jsxs("button", {
|
|
36
35
|
type: "button",
|
|
37
|
-
className: cn(`
|
|
38
|
-
hover:
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
36
|
+
className: cn(`wta:group wta:relative wta:overflow-hidden wta:flex wta:w-full wta:items-center wta:justify-between wta:bg-app-gray-50 wta:p-3 wta:hover:bg-app-gray-200
|
|
37
|
+
wta:hover:text-app-gray-900 wta:dark:bg-app-gray-800 wta:dark:hover:bg-app-gray-600 wta:active:scale-95 wta:transition-all wta:duration-150`, {
|
|
38
|
+
"wta:rounded-full": buttonRadius === "pill",
|
|
39
|
+
"wta:rounded-lg": buttonRadius === "rounded",
|
|
40
|
+
"wta:rounded-none": buttonRadius === "square"
|
|
42
41
|
}),
|
|
43
42
|
onClick: handleBtnClick,
|
|
44
43
|
children: [/*#__PURE__*/jsxs("div", {
|
|
45
|
-
className: "
|
|
44
|
+
className: "wta:flex wta:items-center wta:gap-x-2",
|
|
46
45
|
children: [/*#__PURE__*/jsx("figure", {
|
|
47
|
-
className: "
|
|
46
|
+
className: "wta:size-5",
|
|
48
47
|
children: /*#__PURE__*/jsx(Image, {
|
|
49
48
|
imageData: button.icon,
|
|
50
49
|
imageId: `login-${button.name}`,
|
|
@@ -56,15 +55,15 @@ function ButtonWallet(props) {
|
|
|
56
55
|
extension: button.imgExtension || "webp"
|
|
57
56
|
})
|
|
58
57
|
}), /*#__PURE__*/jsx("p", {
|
|
59
|
-
className: "
|
|
58
|
+
className: "wta:max-w-[180px] wta:truncate wta:text-base wta:font-normal wta:text-app-gray-700 wta:dark:text-app-white",
|
|
60
59
|
children: label
|
|
61
60
|
})]
|
|
62
61
|
}), button.hasInjectedWallet && /*#__PURE__*/jsx("span", {
|
|
63
|
-
className: "
|
|
62
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:flex wta:w-auto wta:-translate-y-1/2 wta:items-center wta:rounded-md wta:bg-app-primary-100 wta:px-2 wta:py-1 wta:text-xs wta:font-medium wta:text-app-primary-800 wta:transition-all wta:duration-300 wta:group-hover:translate-x-6 wta:group-hover:opacity-0 wta:dark:border wta:dark:border-app-primary-400 wta:dark:bg-transparent wta:dark:text-app-primary-400",
|
|
64
63
|
children: t("modal.external.installed")
|
|
65
64
|
}), /*#__PURE__*/jsx("img", {
|
|
66
65
|
id: "injected-wallet-arrow",
|
|
67
|
-
className: "
|
|
66
|
+
className: "wta:absolute wta:right-4 wta:top-1/2 wta:-translate-x-10 wta:-translate-y-1/2 wta:opacity-0 wta:transition-all wta:duration-300 wta:group-hover:translate-x-0 wta:group-hover:opacity-100",
|
|
68
67
|
src: getIcons(isDark ? "chevron-right-light" : "chevron-right-dark"),
|
|
69
68
|
alt: "arrow"
|
|
70
69
|
})]
|
|
@@ -14,32 +14,32 @@ function Footer({
|
|
|
14
14
|
i18n: i18nInstance
|
|
15
15
|
});
|
|
16
16
|
return /*#__PURE__*/jsxs("div", {
|
|
17
|
-
className: "
|
|
17
|
+
className: "wta:mx-auto wta:mt-auto wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-4 wta:pt-5",
|
|
18
18
|
children: [(privacyPolicy || termsOfService) && /*#__PURE__*/jsxs("p", {
|
|
19
|
-
className: "
|
|
19
|
+
className: "wta:mx-auto wta:w-4/5 wta:text-center wta:text-xs wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
20
20
|
children: [t("modal.footer.by-signing-in"), " ", termsOfService && /*#__PURE__*/jsxs("a", {
|
|
21
21
|
href: termsOfService,
|
|
22
|
-
className: "
|
|
22
|
+
className: "wta:text-app-primary-600 wta:dark:text-app-primary-500",
|
|
23
23
|
children: [t("modal.footer.terms-of-service"), " "]
|
|
24
24
|
}), privacyPolicy && /*#__PURE__*/jsxs(Fragment, {
|
|
25
25
|
children: [t("modal.footer.and"), " ", /*#__PURE__*/jsx("a", {
|
|
26
26
|
href: privacyPolicy,
|
|
27
|
-
className: "
|
|
27
|
+
className: "wta:text-app-primary-600 wta:dark:text-app-primary-500",
|
|
28
28
|
children: t("modal.footer.privacy-policy")
|
|
29
29
|
})]
|
|
30
30
|
})]
|
|
31
31
|
}), /*#__PURE__*/jsxs("div", {
|
|
32
|
-
className: "
|
|
32
|
+
className: "wta:flex wta:items-center wta:justify-center wta:gap-2",
|
|
33
33
|
children: [/*#__PURE__*/jsx("img", {
|
|
34
34
|
height: "36",
|
|
35
35
|
src: "https://images.web3auth.io/metamask-footer-logo-light.svg",
|
|
36
36
|
alt: "Web3Auth Logo Light",
|
|
37
|
-
className: "
|
|
37
|
+
className: "wta:block wta:h-9 wta:dark:hidden"
|
|
38
38
|
}), /*#__PURE__*/jsx("img", {
|
|
39
39
|
height: "36",
|
|
40
40
|
src: "https://images.web3auth.io/metamask-footer-logo-dark.svg",
|
|
41
41
|
alt: "Web3Auth Logo Dark",
|
|
42
|
-
className: "
|
|
42
|
+
className: "wta:hidden wta:h-9 wta:dark:block"
|
|
43
43
|
})]
|
|
44
44
|
})]
|
|
45
45
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useWidget } from '../../context/WidgetContext.js';
|
|
3
3
|
import { cn } from '../../utils.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ function Image(props) {
|
|
|
24
24
|
} = props;
|
|
25
25
|
const {
|
|
26
26
|
isDark
|
|
27
|
-
} =
|
|
27
|
+
} = useWidget();
|
|
28
28
|
const imgName = useMemo(() => isDark && darkImageId ? darkImageId : imageId, [isDark, darkImageId, imageId]);
|
|
29
29
|
const hoverImgName = useMemo(() => isDark && darkHoverImageId ? darkHoverImageId : hoverImageId, [isDark, darkHoverImageId, hoverImageId]);
|
|
30
30
|
if (isButton) {
|
|
@@ -35,7 +35,7 @@ function Image(props) {
|
|
|
35
35
|
height: height,
|
|
36
36
|
width: width,
|
|
37
37
|
alt: hoverImageId,
|
|
38
|
-
className: cn("
|
|
38
|
+
className: cn("wta:object-contain", `wta:h-${height} wta:w-${width}`)
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return /*#__PURE__*/jsx("img", {
|
|
@@ -44,7 +44,7 @@ function Image(props) {
|
|
|
44
44
|
height: height,
|
|
45
45
|
width: width,
|
|
46
46
|
alt: hoverImageId,
|
|
47
|
-
className: cn("
|
|
47
|
+
className: cn("wta:rounded wta:object-contain", `wta:h-${height} wta:w-${width}`)
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
if (imageData) {
|
|
@@ -54,7 +54,7 @@ function Image(props) {
|
|
|
54
54
|
height: height,
|
|
55
55
|
width: width,
|
|
56
56
|
alt: imageId,
|
|
57
|
-
className: cn("
|
|
57
|
+
className: cn("wta:object-contain", `wta:h-${height} wta:w-${width}`),
|
|
58
58
|
onError: ({
|
|
59
59
|
currentTarget
|
|
60
60
|
}) => {
|
|
@@ -72,7 +72,7 @@ function Image(props) {
|
|
|
72
72
|
height: height,
|
|
73
73
|
width: width,
|
|
74
74
|
alt: imageId,
|
|
75
|
-
className: cn("
|
|
75
|
+
className: cn("wta:rounded wta:object-contain", `wta:h-${height} wta:w-${width}`),
|
|
76
76
|
onError: ({
|
|
77
77
|
currentTarget
|
|
78
78
|
}) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useMemo, useEffect } from 'react';
|
|
1
|
+
import { useMemo, useEffect, useState } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { MODAL_STATUS } from '../../interfaces.js';
|
|
4
4
|
import i18nInstance from '../../localeImport.js';
|
|
5
|
-
import CircularLoader from '../CircularLoader/CircularLoader.js';
|
|
6
5
|
import Image from '../Image/Image.js';
|
|
7
|
-
import
|
|
6
|
+
import SpinnerLoader from '../SpinnerLoader/SpinnerLoader.js';
|
|
8
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -18,7 +17,6 @@ function ConnectingStatus(props) {
|
|
|
18
17
|
});
|
|
19
18
|
const {
|
|
20
19
|
connector,
|
|
21
|
-
appLogo,
|
|
22
20
|
connectorName
|
|
23
21
|
} = props;
|
|
24
22
|
const providerIcon = useMemo(() => connector === "twitter" ? /*#__PURE__*/jsx(Image, {
|
|
@@ -29,26 +27,20 @@ function ConnectingStatus(props) {
|
|
|
29
27
|
width: "40"
|
|
30
28
|
}), [connector]);
|
|
31
29
|
return /*#__PURE__*/jsxs("div", {
|
|
32
|
-
className: "
|
|
33
|
-
children: [/*#__PURE__*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
children: /*#__PURE__*/jsx("img", {
|
|
38
|
-
src: appLogo,
|
|
39
|
-
alt: "",
|
|
40
|
-
className: "w3a--size-full w3a--object-contain"
|
|
41
|
-
})
|
|
42
|
-
}), /*#__PURE__*/jsx(PulseLoader, {}), providerIcon]
|
|
30
|
+
className: "wta:flex wta:h-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4 wta:pt-6",
|
|
31
|
+
children: [/*#__PURE__*/jsx(SpinnerLoader, {
|
|
32
|
+
width: 95,
|
|
33
|
+
height: 95,
|
|
34
|
+
children: providerIcon
|
|
43
35
|
}), /*#__PURE__*/jsxs("div", {
|
|
44
|
-
className: "
|
|
36
|
+
className: "wta:flex wta:flex-col wta:gap-y-1",
|
|
45
37
|
children: [/*#__PURE__*/jsx("div", {
|
|
46
|
-
className: "
|
|
38
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
47
39
|
children: t("modal.adapter-loader.message1", {
|
|
48
40
|
adapter: connectorName
|
|
49
41
|
})
|
|
50
42
|
}), /*#__PURE__*/jsx("div", {
|
|
51
|
-
className: "
|
|
43
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
52
44
|
children: t("modal.adapter-loader.message2", {
|
|
53
45
|
adapter: connectorName
|
|
54
46
|
})
|
|
@@ -67,7 +59,7 @@ function ConnectedStatus(props) {
|
|
|
67
59
|
message
|
|
68
60
|
} = props;
|
|
69
61
|
return /*#__PURE__*/jsxs("div", {
|
|
70
|
-
className: "
|
|
62
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-2 wta:pt-6",
|
|
71
63
|
children: [/*#__PURE__*/jsx("svg", {
|
|
72
64
|
xmlns: "http://www.w3.org/2000/svg",
|
|
73
65
|
fill: "none",
|
|
@@ -79,8 +71,8 @@ function ConnectedStatus(props) {
|
|
|
79
71
|
d: "M6.267 3.455a3.07 3.07 0 0 0 1.745-.723 3.066 3.066 0 0 1 3.976 0 3.07 3.07 0 0 0 1.745.723 3.066 3.066 0 0 1 2.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 0 1 0 3.976 3.07 3.07 0 0 0-.723 1.745 3.066 3.066 0 0 1-2.812 2.812 3.07 3.07 0 0 0-1.745.723 3.066 3.066 0 0 1-3.976 0 3.07 3.07 0 0 0-1.745-.723 3.066 3.066 0 0 1-2.812-2.812 3.07 3.07 0 0 0-.723-1.745 3.066 3.066 0 0 1 0-3.976 3.07 3.07 0 0 0 .723-1.745 3.066 3.066 0 0 1 2.812-2.812m7.44 5.252a1 1 0 0 0-1.414-1.414L9 10.586 7.707 9.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0z",
|
|
80
72
|
clipRule: "evenodd"
|
|
81
73
|
})
|
|
82
|
-
}), /*#__PURE__*/jsx("p", {
|
|
83
|
-
className: "
|
|
74
|
+
}), message && /*#__PURE__*/jsx("p", {
|
|
75
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
84
76
|
children: message
|
|
85
77
|
})]
|
|
86
78
|
});
|
|
@@ -96,7 +88,7 @@ function ErroredStatus(props) {
|
|
|
96
88
|
message
|
|
97
89
|
} = props;
|
|
98
90
|
return /*#__PURE__*/jsxs("div", {
|
|
99
|
-
className: "
|
|
91
|
+
className: "wta:flex wta:flex-col wta:items-center wta:gap-y-2 wta:pt-6",
|
|
100
92
|
children: [/*#__PURE__*/jsx("svg", {
|
|
101
93
|
xmlns: "http://www.w3.org/2000/svg",
|
|
102
94
|
fill: "none",
|
|
@@ -108,45 +100,39 @@ function ErroredStatus(props) {
|
|
|
108
100
|
d: "M18 10a8 8 0 1 1-16.001 0A8 8 0 0 1 18 10m-7 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-1-9a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1",
|
|
109
101
|
clipRule: "evenodd"
|
|
110
102
|
})
|
|
111
|
-
}), /*#__PURE__*/jsx("p", {
|
|
112
|
-
className: "
|
|
103
|
+
}), message && /*#__PURE__*/jsx("p", {
|
|
104
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
113
105
|
children: message
|
|
114
106
|
})]
|
|
115
107
|
});
|
|
116
108
|
}
|
|
117
109
|
function AuthorizingStatus(props) {
|
|
118
|
-
var
|
|
110
|
+
var _externalWalletsConfi;
|
|
119
111
|
const [t] = useTranslation(undefined, {
|
|
120
112
|
i18n: i18nInstance
|
|
121
113
|
});
|
|
122
114
|
const {
|
|
123
115
|
connector,
|
|
124
116
|
externalWalletsConfig,
|
|
125
|
-
walletRegistry,
|
|
126
117
|
handleMobileVerifyConnect
|
|
127
118
|
} = props;
|
|
128
|
-
const registryItem = (walletRegistry === null || walletRegistry === void 0 || (_walletRegistry$defau = walletRegistry.default) === null || _walletRegistry$defau === void 0 ? void 0 : _walletRegistry$defau[connector]) || (walletRegistry === null || walletRegistry === void 0 || (_walletRegistry$other = walletRegistry.others) === null || _walletRegistry$other === void 0 ? void 0 : _walletRegistry$other[connector]);
|
|
129
|
-
const primaryColor = (registryItem === null || registryItem === void 0 ? void 0 : registryItem.primaryColor) || "";
|
|
130
119
|
const handleMobileVerifyConnectClick = () => {
|
|
131
120
|
handleMobileVerifyConnect({
|
|
132
121
|
connector: connector
|
|
133
122
|
});
|
|
134
123
|
};
|
|
135
124
|
return /*#__PURE__*/jsxs("div", {
|
|
136
|
-
className: "
|
|
125
|
+
className: "wta:flex wta:size-full wta:flex-col wta:items-center wta:justify-between wta:gap-y-6",
|
|
137
126
|
children: [/*#__PURE__*/jsx("p", {
|
|
138
|
-
className: "
|
|
127
|
+
className: "wta:p-2 wta:text-center wta:text-base wta:font-semibold wta:text-app-gray-900 wta:dark:text-app-white",
|
|
139
128
|
children: t("modal.loader.authorizing-header", {
|
|
140
|
-
connector: externalWalletsConfig[connector].label
|
|
129
|
+
connector: (_externalWalletsConfi = externalWalletsConfig[connector]) === null || _externalWalletsConfi === void 0 ? void 0 : _externalWalletsConfi.label
|
|
141
130
|
})
|
|
142
131
|
}), /*#__PURE__*/jsx("div", {
|
|
143
|
-
className: "
|
|
144
|
-
children: /*#__PURE__*/jsx(
|
|
132
|
+
className: "wta:flex wta:justify-center",
|
|
133
|
+
children: /*#__PURE__*/jsx(SpinnerLoader, {
|
|
145
134
|
width: 95,
|
|
146
135
|
height: 95,
|
|
147
|
-
thickness: 6,
|
|
148
|
-
arcSizeDeg: 100,
|
|
149
|
-
arcColors: primaryColor ? [primaryColor, primaryColor] : undefined,
|
|
150
136
|
children: /*#__PURE__*/jsx(Image, {
|
|
151
137
|
imageId: `login-${connector}`,
|
|
152
138
|
hoverImageId: `login-${connector}`,
|
|
@@ -155,15 +141,111 @@ function AuthorizingStatus(props) {
|
|
|
155
141
|
})
|
|
156
142
|
})
|
|
157
143
|
}), /*#__PURE__*/jsx("p", {
|
|
158
|
-
className: "
|
|
144
|
+
className: "wta:text-center wta:text-sm wta:text-app-gray-500 wta:dark:text-app-gray-400",
|
|
159
145
|
children: t("modal.loader.authorizing-message")
|
|
160
146
|
}), /*#__PURE__*/jsx("button", {
|
|
161
147
|
onClick: handleMobileVerifyConnectClick,
|
|
162
|
-
className: "
|
|
148
|
+
className: "wta:w-full wta:rounded-xl wta:bg-app-gray-100 wta:p-2 wta:py-3 wta:text-center wta:text-sm wta:text-app-gray-900 wta:dark:bg-app-gray-800 wta:dark:text-app-white wta:md:hidden",
|
|
163
149
|
children: t("modal.loader.authorizing-verify-btn")
|
|
164
150
|
})]
|
|
165
151
|
});
|
|
166
152
|
}
|
|
153
|
+
function ConsentRequiredStatus(props) {
|
|
154
|
+
const {
|
|
155
|
+
onAccept,
|
|
156
|
+
onDecline,
|
|
157
|
+
privacyPolicy,
|
|
158
|
+
tncLink
|
|
159
|
+
} = props;
|
|
160
|
+
const [t] = useTranslation(undefined, {
|
|
161
|
+
i18n: i18nInstance
|
|
162
|
+
});
|
|
163
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
164
|
+
const handleAccept = async () => {
|
|
165
|
+
setIsSubmitting(true);
|
|
166
|
+
try {
|
|
167
|
+
await (onAccept === null || onAccept === void 0 ? void 0 : onAccept());
|
|
168
|
+
} finally {
|
|
169
|
+
setIsSubmitting(false);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const handleDecline = async () => {
|
|
173
|
+
setIsSubmitting(true);
|
|
174
|
+
try {
|
|
175
|
+
await (onDecline === null || onDecline === void 0 ? void 0 : onDecline());
|
|
176
|
+
} finally {
|
|
177
|
+
setIsSubmitting(false);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
return /*#__PURE__*/jsxs("div", {
|
|
181
|
+
className: "wta:flex wta:w-full wta:flex-col wta:items-center wta:gap-y-6 wta:mt-8",
|
|
182
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
183
|
+
className: "wta:flex wta:items-center wta:justify-center wta:p-3 wta:bg-app-gray-100 wta:dark:bg-app-gray-800 wta:rounded-full wta:text-app-gray-600 wta:dark:text-app-white",
|
|
184
|
+
children: /*#__PURE__*/jsx("svg", {
|
|
185
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
186
|
+
fill: "none",
|
|
187
|
+
viewBox: "0 0 24 24",
|
|
188
|
+
className: "wta:size-10",
|
|
189
|
+
children: /*#__PURE__*/jsx("path", {
|
|
190
|
+
stroke: "currentColor",
|
|
191
|
+
strokeLinecap: "round",
|
|
192
|
+
strokeLinejoin: "round",
|
|
193
|
+
strokeWidth: "2",
|
|
194
|
+
d: "M9 12h6m-6 4h6m2 5H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5.586a1 1 0 0 1 .707.293l5.414 5.414a1 1 0 0 1 .293.707V19a2 2 0 0 1-2 2"
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
}), /*#__PURE__*/jsx("div", {
|
|
198
|
+
className: "wta:w-full wta:px-8 wta:text-center wta:text-app-gray-900 wta:dark:text-app-white",
|
|
199
|
+
children: t("modal.consent.description", {
|
|
200
|
+
defaultValue: "To proceed, please accept the terms and privacy policy"
|
|
201
|
+
})
|
|
202
|
+
}), (tncLink || privacyPolicy) && /*#__PURE__*/jsxs("div", {
|
|
203
|
+
className: "wta:flex wta:w-full wta:flex-col wta:gap-y-2",
|
|
204
|
+
children: [tncLink && /*#__PURE__*/jsx("a", {
|
|
205
|
+
href: tncLink,
|
|
206
|
+
target: "_blank",
|
|
207
|
+
rel: "noopener noreferrer",
|
|
208
|
+
className: "w3a--btn wta:text-sm! wta:font-light wta:justify-start! wta:rounded-full wta:border-app-gray-50 wta:bg-app-gray-50 wta:p-3 wta:text-left wta:text-app-gray-700 wta:hover:border-app-gray-200 wta:hover:bg-app-gray-200 wta:hover:text-app-gray-900 wta:dark:border-app-gray-800 wta:dark:bg-app-gray-800 wta:dark:text-app-white wta:dark:hover:border-app-gray-600 wta:dark:hover:bg-app-gray-600",
|
|
209
|
+
children: t("modal.consent.tnc", {
|
|
210
|
+
defaultValue: "Terms of service"
|
|
211
|
+
})
|
|
212
|
+
}), privacyPolicy && /*#__PURE__*/jsx("a", {
|
|
213
|
+
href: privacyPolicy,
|
|
214
|
+
target: "_blank",
|
|
215
|
+
rel: "noopener noreferrer",
|
|
216
|
+
className: "w3a--btn wta:text-sm! wta:font-light wta:justify-start! wta:rounded-full wta:border-app-gray-50 wta:bg-app-gray-50 wta:p-3 wta:text-left wta:text-app-gray-700 wta:hover:border-app-gray-200 wta:hover:bg-app-gray-200 wta:hover:text-app-gray-900 wta:dark:border-app-gray-800 wta:dark:bg-app-gray-800 wta:dark:text-app-white wta:dark:hover:border-app-gray-600 wta:dark:hover:bg-app-gray-600",
|
|
217
|
+
children: t("modal.consent.privacy", {
|
|
218
|
+
defaultValue: "Privacy Policy"
|
|
219
|
+
})
|
|
220
|
+
})]
|
|
221
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
222
|
+
className: "wta:flex wta:w-full wta:gap-x-2",
|
|
223
|
+
children: [/*#__PURE__*/jsx("button", {
|
|
224
|
+
type: "button",
|
|
225
|
+
disabled: isSubmitting,
|
|
226
|
+
onClick: handleDecline,
|
|
227
|
+
className: "w3a--btn wta:rounded-full wta:disabled:opacity-60",
|
|
228
|
+
children: /*#__PURE__*/jsx("p", {
|
|
229
|
+
className: "wta:text-app-gray-900 wta:dark:text-app-white",
|
|
230
|
+
children: t("modal.consent.decline", {
|
|
231
|
+
defaultValue: "Decline"
|
|
232
|
+
})
|
|
233
|
+
})
|
|
234
|
+
}), /*#__PURE__*/jsx("button", {
|
|
235
|
+
type: "button",
|
|
236
|
+
disabled: isSubmitting,
|
|
237
|
+
onClick: handleAccept,
|
|
238
|
+
className: "w3a--btn wta:rounded-full wta:border-app-primary-600! wta:bg-app-primary-600 wta:hover:border-app-primary-700! wta:hover:bg-app-primary-700! wta:disabled:opacity-60 wta:dark:border-app-primary-600! wta:dark:bg-app-primary-600 wta:dark:hover:border-app-primary-700! wta:dark:hover:bg-app-primary-700!",
|
|
239
|
+
children: /*#__PURE__*/jsx("p", {
|
|
240
|
+
className: "wta:text-app-onPrimary",
|
|
241
|
+
children: t("modal.consent.accept", {
|
|
242
|
+
defaultValue: "Accept"
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
})]
|
|
246
|
+
})]
|
|
247
|
+
});
|
|
248
|
+
}
|
|
167
249
|
|
|
168
250
|
/**
|
|
169
251
|
* Loader component
|
|
@@ -176,13 +258,15 @@ function Loader(props) {
|
|
|
176
258
|
connectorName,
|
|
177
259
|
modalStatus,
|
|
178
260
|
onClose,
|
|
179
|
-
appLogo,
|
|
180
261
|
message,
|
|
181
262
|
isConnectAndSignAuthenticationMode,
|
|
182
263
|
externalWalletsConfig,
|
|
183
|
-
walletRegistry,
|
|
184
264
|
handleMobileVerifyConnect,
|
|
185
|
-
hideSuccessScreen = false
|
|
265
|
+
hideSuccessScreen = false,
|
|
266
|
+
onAcceptConsent,
|
|
267
|
+
onDeclineConsent,
|
|
268
|
+
privacyPolicy,
|
|
269
|
+
tncLink
|
|
186
270
|
} = props;
|
|
187
271
|
const isConnectedAccordingToAuthenticationMode = useMemo(() => !isConnectAndSignAuthenticationMode && modalStatus === MODAL_STATUS.CONNECTED || isConnectAndSignAuthenticationMode && modalStatus === MODAL_STATUS.AUTHORIZED, [modalStatus, isConnectAndSignAuthenticationMode]);
|
|
188
272
|
useEffect(() => {
|
|
@@ -196,12 +280,12 @@ function Loader(props) {
|
|
|
196
280
|
return () => clearTimeout(timeout);
|
|
197
281
|
}
|
|
198
282
|
}, [isConnectedAccordingToAuthenticationMode, hideSuccessScreen, onClose]);
|
|
283
|
+
const isConsentRequiringStatus = modalStatus === MODAL_STATUS.CONSENT_REQUIRING;
|
|
199
284
|
return /*#__PURE__*/jsxs("div", {
|
|
200
|
-
className: "
|
|
285
|
+
className: isConsentRequiringStatus ? "wta:flex wta:flex-col wta:items-center wta:justify-center wta:gap-y-4" : "wta:flex wta:h-full wta:flex-1 wta:flex-col wta:items-center wta:justify-center wta:gap-y-4",
|
|
201
286
|
children: [modalStatus === MODAL_STATUS.CONNECTING && /*#__PURE__*/jsx(ConnectingStatus, {
|
|
202
287
|
connector: connector,
|
|
203
|
-
connectorName: connectorName
|
|
204
|
-
appLogo: appLogo
|
|
288
|
+
connectorName: connectorName
|
|
205
289
|
}), isConnectedAccordingToAuthenticationMode && !hideSuccessScreen && /*#__PURE__*/jsx(ConnectedStatus, {
|
|
206
290
|
message: message
|
|
207
291
|
}), modalStatus === MODAL_STATUS.ERRORED && /*#__PURE__*/jsx(ErroredStatus, {
|
|
@@ -209,8 +293,12 @@ function Loader(props) {
|
|
|
209
293
|
}), modalStatus === MODAL_STATUS.AUTHORIZING && /*#__PURE__*/jsx(AuthorizingStatus, {
|
|
210
294
|
connector: connector,
|
|
211
295
|
externalWalletsConfig: externalWalletsConfig,
|
|
212
|
-
walletRegistry: walletRegistry,
|
|
213
296
|
handleMobileVerifyConnect: handleMobileVerifyConnect
|
|
297
|
+
}), isConsentRequiringStatus && /*#__PURE__*/jsx(ConsentRequiredStatus, {
|
|
298
|
+
onAccept: onAcceptConsent,
|
|
299
|
+
onDecline: onDeclineConsent,
|
|
300
|
+
privacyPolicy: privacyPolicy,
|
|
301
|
+
tncLink: tncLink
|
|
214
302
|
})]
|
|
215
303
|
});
|
|
216
304
|
}
|
|
@@ -28,7 +28,7 @@ const LoginHint = ({
|
|
|
28
28
|
};
|
|
29
29
|
}, [isDark]);
|
|
30
30
|
return /*#__PURE__*/jsxs("div", {
|
|
31
|
-
className: "
|
|
31
|
+
className: "wta:relative",
|
|
32
32
|
"aria-hidden": true,
|
|
33
33
|
onMouseEnter: handleMouseEnter,
|
|
34
34
|
onMouseLeave: handleMouseLeave,
|
|
@@ -38,9 +38,9 @@ const LoginHint = ({
|
|
|
38
38
|
children: [children, showPopover && !hideHint && /*#__PURE__*/jsxs("div", {
|
|
39
39
|
"data-popover": true,
|
|
40
40
|
role: "tooltip",
|
|
41
|
-
className: cn("
|
|
41
|
+
className: cn("wta:absolute wta:z-[45] wta:shadow-2xl wta:rounded-lg wta:bottom-[100%] wta:left-[50%] wta:w-max wta:text-xs wta:px-[6px] wta:py-[3px]", isDark ? "wta:bg-app-white wta:text-app-gray-900" : "wta:bg-app-gray-800 wta:text-app-gray-100"),
|
|
42
42
|
children: [content, /*#__PURE__*/jsx("div", {
|
|
43
|
-
className: "
|
|
43
|
+
className: "wta:absolute",
|
|
44
44
|
style: triangleStyle
|
|
45
45
|
})]
|
|
46
46
|
})]
|
|
@@ -28,40 +28,41 @@ function Modal(props) {
|
|
|
28
28
|
setIsOpen(true);
|
|
29
29
|
}, 50);
|
|
30
30
|
} else {
|
|
31
|
+
// eslint-disable-next-line react-hooks/set-state-in-effect -- intentional
|
|
31
32
|
setIsOpen(false);
|
|
32
33
|
// Remove overflow styling to enable scroll again.
|
|
33
34
|
document.body.style.overflow = "";
|
|
34
35
|
}
|
|
35
36
|
}, [open]);
|
|
36
37
|
const positions = useMemo(() => ({
|
|
37
|
-
center: "
|
|
38
|
-
"top-center": "
|
|
39
|
-
"bottom-center": "
|
|
40
|
-
left: "sm:
|
|
41
|
-
right: "sm:
|
|
38
|
+
center: "wta:top-0 wta:left-0 wta:items-center wta:justify-center",
|
|
39
|
+
"top-center": "wta:top-8 wta:left-0 wta:items-start wta:justify-center",
|
|
40
|
+
"bottom-center": "wta:bottom-8 wta:left-0 wta:items-end wta:justify-center",
|
|
41
|
+
left: "wta:sm:left-8 wta:flex wta:items-center wta:justify-center wta:sm:justify-start",
|
|
42
|
+
right: "wta:sm:right-8 wta:flex wta:items-center wta:justify-center wta:sm:justify-end"
|
|
42
43
|
}), []);
|
|
43
44
|
const placementClass = useMemo(() => positions[placement], [placement, positions]);
|
|
44
45
|
const onCloseHandler = () => {
|
|
45
46
|
if (onClose) onClose();
|
|
46
47
|
};
|
|
47
48
|
return /*#__PURE__*/jsx("div", {
|
|
48
|
-
className: cn("
|
|
49
|
-
"
|
|
50
|
-
"
|
|
49
|
+
className: cn("wta:fixed wta:z-50 wta:overflow-hidden wta:flex wta:transition-all", placementClass, {
|
|
50
|
+
"wta:w-screen wta:h-screen": isOpen,
|
|
51
|
+
"wta:w-0 wta:h-0 wta:delay-500": !isOpen
|
|
51
52
|
}),
|
|
52
53
|
children: /*#__PURE__*/jsxs("div", {
|
|
53
|
-
className: cn("
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
54
|
+
className: cn("wta:bg-app-light-surface1 wta:dark:bg-app-dark-surface-main wta:w-[356px] wta:[@media(min-width:375px)]:w-[393px] wta:h-auto wta:flex wta:flex-col wta:duration-500", {
|
|
55
|
+
"wta:translate-y-0 wta:delay-100": isOpen,
|
|
56
|
+
"wta:translate-y-[100vh]": !isOpen,
|
|
57
|
+
"wta:p-4": padding,
|
|
58
|
+
"wta:shadow-xl wta:sm:shadow-lg": shadow,
|
|
59
|
+
"wta:border wta:border-app-gray-100 wta:dark:border-app-gray-800": border,
|
|
60
|
+
"wta:rounded-[30px]": borderRadius === "large",
|
|
61
|
+
"wta:rounded-2xl": borderRadius === "medium",
|
|
62
|
+
"wta:rounded-none": borderRadius === "small"
|
|
62
63
|
}),
|
|
63
64
|
children: [showCloseIcon && /*#__PURE__*/jsx("div", {
|
|
64
|
-
className: "
|
|
65
|
+
className: "wta:absolute wta:right-6 wta:top-[30px] wta:z-10 wta:cursor-pointer",
|
|
65
66
|
children: /*#__PURE__*/jsx("svg", {
|
|
66
67
|
width: "13",
|
|
67
68
|
height: "13",
|
|
@@ -69,7 +70,7 @@ function Modal(props) {
|
|
|
69
70
|
fill: "none",
|
|
70
71
|
xmlns: "http://www.w3.org/2000/svg",
|
|
71
72
|
onClick: onCloseHandler,
|
|
72
|
-
className: "
|
|
73
|
+
className: "wta:text-app-gray-500 wta:hover:text-app-gray-900 wta:dark:text-app-gray-200 wta:dark:hover:text-app-white",
|
|
73
74
|
children: /*#__PURE__*/jsx("path", {
|
|
74
75
|
fillRule: "evenodd",
|
|
75
76
|
clipRule: "evenodd",
|
|
@@ -131,16 +131,16 @@ const OtpInput = /*#__PURE__*/forwardRef(({
|
|
|
131
131
|
(_inputRefs$current7 = inputRefs.current) === null || _inputRefs$current7 === void 0 || _inputRefs$current7[0].focus();
|
|
132
132
|
}
|
|
133
133
|
}, [autoFocus]);
|
|
134
|
-
const helperTextClass = cn("
|
|
135
|
-
"
|
|
136
|
-
"
|
|
134
|
+
const helperTextClass = cn("wta:text-xs wta:font-normal wta:text-app-gray-500 wta:dark:text-app-white wta:mt-2", {
|
|
135
|
+
"wta:text-app-red-500 wta:dark:text-app-red-400": error,
|
|
136
|
+
"wta:text-app-green-500 wta:dark:text-app-green-400": success
|
|
137
137
|
}, classes === null || classes === void 0 ? void 0 : classes.helperText);
|
|
138
138
|
const inputKey = new Date().getFullYear();
|
|
139
139
|
return /*#__PURE__*/jsxs("div", {
|
|
140
|
-
className: cn("
|
|
140
|
+
className: cn("wta:flex wta:flex-col wta:items-center", classes === null || classes === void 0 ? void 0 : classes.root),
|
|
141
141
|
ref: ref,
|
|
142
142
|
children: [/*#__PURE__*/jsx("form", {
|
|
143
|
-
className: cn("
|
|
143
|
+
className: cn("wta:flex wta:space-x-2", classes === null || classes === void 0 ? void 0 : classes.inputContainer),
|
|
144
144
|
children: otpArray.map((digit, index) => {
|
|
145
145
|
var _classes$success, _classes$error, _classes$disabled;
|
|
146
146
|
return /*#__PURE__*/jsx("input", {
|
|
@@ -153,7 +153,7 @@ const OtpInput = /*#__PURE__*/forwardRef(({
|
|
|
153
153
|
onInput: e => handleInputChange(e, index),
|
|
154
154
|
onKeyUp: e => handleKeyDown(e, index),
|
|
155
155
|
onPaste: handlePaste,
|
|
156
|
-
className: cn("
|
|
156
|
+
className: cn("wta:w-12 wta:h-[42px] wta:rounded-full wta:border wta:text-center wta:text-xl wta:focus:outline-none wta:active:outline-none wta:focus:border-app-primary-600 wta:dark:focus:border-app-primary-500 wta:border-app-gray-300 wta:dark:border-app-gray-500 wta:bg-app-gray-50 wta:dark:bg-app-gray-700 wta:text-app-gray-900 wta:dark:text-app-white", success && ((_classes$success = classes === null || classes === void 0 ? void 0 : classes.success) !== null && _classes$success !== void 0 ? _classes$success : "wta:border-app-green-400 wta:dark:border-app-green-500 wta:focus:border-app-green-400 wta:dark:focus:border-app-green-500"), error && ((_classes$error = classes === null || classes === void 0 ? void 0 : classes.error) !== null && _classes$error !== void 0 ? _classes$error : "wta:border-app-red-600 wta:dark:border-app-red-500 wta:focus:border-app-red-600 wta:dark:focus:border-app-red-500"), disabled && ((_classes$disabled = classes === null || classes === void 0 ? void 0 : classes.disabled) !== null && _classes$disabled !== void 0 ? _classes$disabled : "wta:border-app-gray-200 wta:bg-app-gray-200 wta:dark:border-app-gray-700 wta:focus:border-app-gray-200 wta:dark:focus:border-app-gray-700 wta:cursor-not-allowed"), classes === null || classes === void 0 ? void 0 : classes.input),
|
|
157
157
|
ref: el => {
|
|
158
158
|
inputRefs.current[index] = el;
|
|
159
159
|
},
|
|
@@ -164,18 +164,18 @@ const OtpInput = /*#__PURE__*/forwardRef(({
|
|
|
164
164
|
className: helperTextClass,
|
|
165
165
|
children: helperText
|
|
166
166
|
}), loading && /*#__PURE__*/jsx("div", {
|
|
167
|
-
className: "
|
|
167
|
+
className: "wta:mt-3",
|
|
168
168
|
children: /*#__PURE__*/jsx(PulseLoader, {})
|
|
169
169
|
}), showCta && !loading && /*#__PURE__*/jsx("div", {
|
|
170
|
-
className: cn("
|
|
170
|
+
className: cn("wta:flex wta:items-center wta:mt-3", classes === null || classes === void 0 ? void 0 : classes.ctaContainer),
|
|
171
171
|
children: timer > 0 && showTimer ? /*#__PURE__*/jsx("span", {
|
|
172
|
-
className: cn("
|
|
172
|
+
className: cn("wta:text-xs wta:text-app-gray-500 wta:dark:text-app-gray-400", classes === null || classes === void 0 ? void 0 : classes.timerText),
|
|
173
173
|
children: t("modal.resendTimer", {
|
|
174
174
|
timer: timer
|
|
175
175
|
})
|
|
176
176
|
}) : /*#__PURE__*/jsx("button", {
|
|
177
177
|
type: "button",
|
|
178
|
-
className: cn("
|
|
178
|
+
className: cn("wta:text-xs wta:p-0 wta:text-app-primary-600 wta:dark:text-app-primary-500", classes === null || classes === void 0 ? void 0 : classes.resendBtnText),
|
|
179
179
|
onClick: handleResendClick,
|
|
180
180
|
disabled: timer > 0 && showTimer,
|
|
181
181
|
children: resendBtnText || t("modal.resendCode")
|
|
@@ -2,13 +2,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
|
|
3
3
|
const PulseLoader = () => {
|
|
4
4
|
return /*#__PURE__*/jsxs("div", {
|
|
5
|
-
className: "
|
|
5
|
+
className: "wta:flex wta:items-center wta:justify-center wta:gap-x-2",
|
|
6
6
|
children: [/*#__PURE__*/jsx("div", {
|
|
7
|
-
className: "
|
|
7
|
+
className: "wta:size-3 wta:animate-pulse wta:rounded-full wta:bg-app-gray-500 wta:dark:bg-app-gray-200"
|
|
8
8
|
}), /*#__PURE__*/jsx("div", {
|
|
9
|
-
className: "
|
|
9
|
+
className: "wta:size-3 wta:animate-pulse wta:rounded-full wta:bg-app-gray-400 wta:dark:bg-app-gray-400"
|
|
10
10
|
}), /*#__PURE__*/jsx("div", {
|
|
11
|
-
className: "
|
|
11
|
+
className: "wta:size-3 wta:animate-pulse wta:rounded-full wta:bg-app-gray-200 wta:dark:bg-app-gray-600"
|
|
12
12
|
})]
|
|
13
13
|
});
|
|
14
14
|
};
|