@getpara/react-sdk-lite 2.0.0-alpha.33
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/chunk-MMUBH76A.js +59 -0
- package/dist/cli/cli.mjs +51 -0
- package/dist/css/modal.css +13 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +10 -0
- package/dist/modal/ParaModal.d.ts +2 -0
- package/dist/modal/ParaModal.js +308 -0
- package/dist/modal/components/Account/Account.d.ts +5 -0
- package/dist/modal/components/Account/Account.js +148 -0
- package/dist/modal/components/Account/AccountProfile.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfile.js +168 -0
- package/dist/modal/components/Account/AccountProfileLink.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfileLink.js +206 -0
- package/dist/modal/components/Account/AccountProfileLinkOptions.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +111 -0
- package/dist/modal/components/Account/AccountProfileUnlink.d.ts +1 -0
- package/dist/modal/components/Account/AccountProfileUnlink.js +47 -0
- package/dist/modal/components/AddFunds/AddFunds.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFunds.js +69 -0
- package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsAsset.js +125 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +78 -0
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +31 -0
- package/dist/modal/components/AddFunds/AddFundsContext.js +160 -0
- package/dist/modal/components/AddFunds/AddFundsDone.d.ts +6 -0
- package/dist/modal/components/AddFunds/AddFundsDone.js +49 -0
- package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsProvider.js +109 -0
- package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsReceive.js +83 -0
- package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +1 -0
- package/dist/modal/components/AddFunds/AddFundsSettings.js +237 -0
- package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +2 -0
- package/dist/modal/components/AddFunds/MoonPayEmbed.js +7 -0
- package/dist/modal/components/AddFunds/common.d.ts +19 -0
- package/dist/modal/components/AddFunds/common.js +24 -0
- package/dist/modal/components/AddFunds/index.d.ts +3 -0
- package/dist/modal/components/AddFunds/index.js +4 -0
- package/dist/modal/components/AuthInput/AuthInput.d.ts +20 -0
- package/dist/modal/components/AuthInput/AuthInput.js +277 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +7 -0
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +33 -0
- package/dist/modal/components/AuthInput/phoneMasks.d.ts +247 -0
- package/dist/modal/components/AuthInput/phoneMasks.js +253 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +9 -0
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +50 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +9 -0
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +179 -0
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +9 -0
- package/dist/modal/components/AuthOptions/AuthOptions.js +85 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +1 -0
- package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +18 -0
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.d.ts +1 -0
- package/dist/modal/components/AwaitingIFrameStep/AwaitingIFrameStep.js +12 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +1 -0
- package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +10 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +1 -0
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +18 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +5 -0
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +49 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +62 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -0
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +48 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +6 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +29 -0
- package/dist/modal/components/Body/Body.d.ts +11 -0
- package/dist/modal/components/Body/Body.js +354 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -0
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +95 -0
- package/dist/modal/components/ChainSwitch/config.d.ts +7 -0
- package/dist/modal/components/ChainSwitch/config.js +17 -0
- package/dist/modal/components/Controls/Controls.d.ts +5 -0
- package/dist/modal/components/Controls/Controls.js +78 -0
- package/dist/modal/components/Controls/Selects.d.ts +2 -0
- package/dist/modal/components/Controls/Selects.js +173 -0
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +75 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +8 -0
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +175 -0
- package/dist/modal/components/ExternalWalletStep/config.d.ts +7 -0
- package/dist/modal/components/ExternalWalletStep/config.js +17 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +39 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +1 -0
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +182 -0
- package/dist/modal/components/Footer/Footer.d.ts +1 -0
- package/dist/modal/components/Footer/Footer.js +95 -0
- package/dist/modal/components/Header/Header.d.ts +1 -0
- package/dist/modal/components/Header/Header.js +43 -0
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +3 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +62 -0
- package/dist/modal/components/Hero/Hero.d.ts +1 -0
- package/dist/modal/components/Hero/Hero.js +116 -0
- package/dist/modal/components/IFrameStep/IFrameStep.d.ts +1 -0
- package/dist/modal/components/IFrameStep/IFrameStep.js +70 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +5 -0
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +44 -0
- package/dist/modal/components/ModalContent/ModalContent.d.ts +10 -0
- package/dist/modal/components/ModalContent/ModalContent.js +88 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +3 -0
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +31 -0
- package/dist/modal/components/OAuth/OAuth.d.ts +6 -0
- package/dist/modal/components/OAuth/OAuth.js +81 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +8 -0
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +74 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +1 -0
- package/dist/modal/components/OnRampComponents/AddingFunds.js +23 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +9 -0
- package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +77 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +6 -0
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +107 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +5 -0
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +132 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +5 -0
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +27 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +12 -0
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +160 -0
- package/dist/modal/components/Waiting/Waiting.d.ts +6 -0
- package/dist/modal/components/Waiting/Waiting.js +17 -0
- package/dist/modal/components/WalletCard/PartnerIcon.d.ts +6 -0
- package/dist/modal/components/WalletCard/PartnerIcon.js +34 -0
- package/dist/modal/components/WalletCard/WalletCard.d.ts +18 -0
- package/dist/modal/components/WalletCard/WalletCard.js +128 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +6 -0
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +83 -0
- package/dist/modal/components/common.d.ts +59 -0
- package/dist/modal/components/common.js +261 -0
- package/dist/modal/components/index.d.ts +1 -0
- package/dist/modal/components/index.js +2 -0
- package/dist/modal/constants/constants.d.ts +40 -0
- package/dist/modal/constants/constants.js +142 -0
- package/dist/modal/constants/defaults.d.ts +5 -0
- package/dist/modal/constants/defaults.js +10 -0
- package/dist/modal/constants/oAuthLogos.d.ts +17 -0
- package/dist/modal/constants/oAuthLogos.js +158 -0
- package/dist/modal/constants/walletTypeConfig.d.ts +6 -0
- package/dist/modal/constants/walletTypeConfig.js +13 -0
- package/dist/modal/hooks/useGoBack.d.ts +1 -0
- package/dist/modal/hooks/useGoBack.js +43 -0
- package/dist/modal/hooks/useTelegramLogin.d.ts +12 -0
- package/dist/modal/hooks/useTelegramLogin.js +65 -0
- package/dist/modal/index.d.ts +8 -0
- package/dist/modal/index.js +29 -0
- package/dist/modal/stores/index.d.ts +1 -0
- package/dist/modal/stores/index.js +2 -0
- package/dist/modal/stores/modal/actions.d.ts +3 -0
- package/dist/modal/stores/modal/actions.js +139 -0
- package/dist/modal/stores/modal/useModalStore.d.ts +105 -0
- package/dist/modal/stores/modal/useModalStore.js +75 -0
- package/dist/modal/types/commonTypes.d.ts +6 -0
- package/dist/modal/types/commonTypes.js +1 -0
- package/dist/modal/types/modalProps.d.ts +129 -0
- package/dist/modal/types/modalProps.js +12 -0
- package/dist/modal/utils/authInputHelpers.d.ts +5 -0
- package/dist/modal/utils/authInputHelpers.js +41 -0
- package/dist/modal/utils/authLayoutHelpers.d.ts +3 -0
- package/dist/modal/utils/authLayoutHelpers.js +8 -0
- package/dist/modal/utils/countryCodes.d.ts +8 -0
- package/dist/modal/utils/countryCodes.js +45 -0
- package/dist/modal/utils/getMailtoLink.d.ts +1 -0
- package/dist/modal/utils/getMailtoLink.js +10 -0
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -0
- package/dist/modal/utils/getTileButtonFlex.js +20 -0
- package/dist/modal/utils/getWalletDisplayName.d.ts +5 -0
- package/dist/modal/utils/getWalletDisplayName.js +22 -0
- package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
- package/dist/modal/utils/isPasskeySupported.js +15 -0
- package/dist/modal/utils/openPopup.d.ts +6 -0
- package/dist/modal/utils/openPopup.js +60 -0
- package/dist/modal/utils/routeMobileExternalWallet.d.ts +1 -0
- package/dist/modal/utils/routeMobileExternalWallet.js +31 -0
- package/dist/modal/utils/steps.d.ts +136 -0
- package/dist/modal/utils/steps.js +279 -0
- package/dist/modal/utils/stringFormatters.d.ts +5 -0
- package/dist/modal/utils/stringFormatters.js +19 -0
- package/dist/modal/utils/validateOnRampConfig.d.ts +5 -0
- package/dist/modal/utils/validateOnRampConfig.js +32 -0
- package/dist/package.json +6 -0
- package/dist/provider/ParaProvider.d.ts +4 -0
- package/dist/provider/ParaProvider.js +140 -0
- package/dist/provider/actions/getEmbeddedAccount.d.ts +26 -0
- package/dist/provider/actions/getEmbeddedAccount.js +57 -0
- package/dist/provider/actions/getWallet.d.ts +5 -0
- package/dist/provider/actions/getWallet.js +18 -0
- package/dist/provider/actions/index.d.ts +47 -0
- package/dist/provider/actions/index.js +79 -0
- package/dist/provider/actions/utils.d.ts +4 -0
- package/dist/provider/actions/utils.js +34 -0
- package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
- package/dist/provider/components/CosmosWalletWrapper.js +43 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/EvmWalletWrapper.js +43 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/ExternalWalletWrapper.js +140 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/components/SolanaWalletWrapper.js +44 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaCosmosConnector.js +19 -0
- package/dist/provider/external/getParaCosmosLib.d.ts +4 -0
- package/dist/provider/external/getParaCosmosLib.js +16 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.js +19 -0
- package/dist/provider/external/getParaEvmLib.d.ts +4 -0
- package/dist/provider/external/getParaEvmLib.js +16 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.js +19 -0
- package/dist/provider/external/getParaSolanaLib.d.ts +4 -0
- package/dist/provider/external/getParaSolanaLib.js +16 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +2 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +8 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +2 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +8 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +2 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +8 -0
- package/dist/provider/hooks/index.d.ts +3 -0
- package/dist/provider/hooks/index.js +4 -0
- package/dist/provider/hooks/mutations/core.d.ts +27 -0
- package/dist/provider/hooks/mutations/core.js +66 -0
- package/dist/provider/hooks/mutations/index.d.ts +3 -0
- package/dist/provider/hooks/mutations/index.js +9 -0
- package/dist/provider/hooks/mutations/useLinkAccount.d.ts +9 -0
- package/dist/provider/hooks/mutations/useLinkAccount.js +18 -0
- package/dist/provider/hooks/mutations/utils.d.ts +12 -0
- package/dist/provider/hooks/mutations/utils.js +90 -0
- package/dist/provider/hooks/queries/core.d.ts +4 -0
- package/dist/provider/hooks/queries/core.js +16 -0
- package/dist/provider/hooks/queries/index.d.ts +5 -0
- package/dist/provider/hooks/queries/index.js +13 -0
- package/dist/provider/hooks/queries/useAccount.d.ts +90 -0
- package/dist/provider/hooks/queries/useAccount.js +141 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +5 -0
- package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +24 -0
- package/dist/provider/hooks/queries/useParaStatus.d.ts +22 -0
- package/dist/provider/hooks/queries/useParaStatus.js +25 -0
- package/dist/provider/hooks/queries/useWallet.d.ts +5 -0
- package/dist/provider/hooks/queries/useWallet.js +26 -0
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +6 -0
- package/dist/provider/hooks/queries/useWalletBalance.js +55 -0
- package/dist/provider/hooks/queries/utils.d.ts +7 -0
- package/dist/provider/hooks/queries/utils.js +25 -0
- package/dist/provider/hooks/utils/index.d.ts +3 -0
- package/dist/provider/hooks/utils/index.js +10 -0
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +3 -0
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +74 -0
- package/dist/provider/hooks/utils/useClient.d.ts +5 -0
- package/dist/provider/hooks/utils/useClient.js +10 -0
- package/dist/provider/hooks/utils/useEventListeners.d.ts +2 -0
- package/dist/provider/hooks/utils/useEventListeners.js +157 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.d.ts +4 -0
- package/dist/provider/hooks/utils/useFormattedBiometricHints.js +27 -0
- package/dist/provider/hooks/utils/useInternalClient.d.ts +5 -0
- package/dist/provider/hooks/utils/useInternalClient.js +10 -0
- package/dist/provider/hooks/utils/useModal.d.ts +11 -0
- package/dist/provider/hooks/utils/useModal.js +27 -0
- package/dist/provider/hooks/utils/useWalletState.d.ts +15 -0
- package/dist/provider/hooks/utils/useWalletState.js +48 -0
- package/dist/provider/index.d.ts +6 -0
- package/dist/provider/index.js +11 -0
- package/dist/provider/providers/AccountLinkProvider.d.ts +47 -0
- package/dist/provider/providers/AccountLinkProvider.js +452 -0
- package/dist/provider/providers/AuthProvider.d.ts +38 -0
- package/dist/provider/providers/AuthProvider.js +575 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.js +66 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.js +74 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +61 -0
- package/dist/provider/providers/ExternalWalletProvider.js +626 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.js +66 -0
- package/dist/provider/stores/getters.d.ts +4 -0
- package/dist/provider/stores/getters.js +13 -0
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/setters.js +7 -0
- package/dist/provider/stores/slices/analytics.d.ts +3 -0
- package/dist/provider/stores/slices/analytics.js +9 -0
- package/dist/provider/stores/slices/client.d.ts +3 -0
- package/dist/provider/stores/slices/client.js +9 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/config.js +11 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.js +46 -0
- package/dist/provider/stores/slices/index.d.ts +5 -0
- package/dist/provider/stores/slices/index.js +6 -0
- package/dist/provider/stores/slices/modal.d.ts +3 -0
- package/dist/provider/stores/slices/modal.js +18 -0
- package/dist/provider/stores/slices/wallet.d.ts +3 -0
- package/dist/provider/stores/slices/wallet.js +13 -0
- package/dist/provider/stores/types.d.ts +86 -0
- package/dist/provider/stores/types.js +1 -0
- package/dist/provider/stores/useStore.d.ts +17 -0
- package/dist/provider/stores/useStore.js +34 -0
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/externalWalletProviders.js +1 -0
- package/dist/provider/types/provider.d.ts +166 -0
- package/dist/provider/types/provider.js +1 -0
- package/dist/provider/types/query.d.ts +3 -0
- package/dist/provider/types/query.js +1 -0
- package/dist/provider/types/utils.d.ts +45 -0
- package/dist/provider/types/utils.js +1 -0
- package/dist/provider/utils/constants.d.ts +5 -0
- package/dist/provider/utils/constants.js +10 -0
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/dist/provider/utils/paraConfigTypeGuards.js +13 -0
- package/dist/provider/utils/renameMutations.d.ts +5 -0
- package/dist/provider/utils/renameMutations.js +18 -0
- package/dist/public/Inter-VariableFont_slnt,wght.ttf +0 -0
- package/package.json +63 -0
- package/styles.css/package.json +3 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { safeStyled } from "@getpara/react-common";
|
|
7
|
+
import { StyledCpslTileButton } from "../common.js";
|
|
8
|
+
import { CpslButton, CpslIcon, CpslInput, CpslText } from "@getpara/react-components";
|
|
9
|
+
import { useModalStore } from "../../stores/index.js";
|
|
10
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
import { hasEmbeddedAuth } from "../../utils/authLayoutHelpers.js";
|
|
13
|
+
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
14
|
+
const HAS_MORE_LENGTH = 3;
|
|
15
|
+
const ExternalWallets = () => {
|
|
16
|
+
const { wallets: allWallets, connectExternalWallet } = useExternalWallets();
|
|
17
|
+
const setSelectedExternalWalletId = useModalStore((state) => state.setSelectedExternalWalletId);
|
|
18
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
19
|
+
const showAll = useModalStore((state) => state.step === ModalStep.EX_WALLET_MORE);
|
|
20
|
+
const authLayout = useModalStore((state) => state.authLayout);
|
|
21
|
+
const [search, setSearch] = useState("");
|
|
22
|
+
const dedupedWallets = Array.from(new Set(allWallets.map((wallet) => wallet.id))).map((id) => {
|
|
23
|
+
return allWallets.find((wallet) => wallet.id === id);
|
|
24
|
+
}).filter((wallet) => wallet.internalId !== "FARCASTER");
|
|
25
|
+
const hasMore = dedupedWallets.length > HAS_MORE_LENGTH;
|
|
26
|
+
const walletsToShow = showAll || !hasMore ? search ? dedupedWallets.filter((w) => w.name.toLowerCase().includes(search.toLowerCase())) : dedupedWallets : dedupedWallets.slice(0, HAS_MORE_LENGTH);
|
|
27
|
+
const showMoreButton = !showAll && hasMore;
|
|
28
|
+
const handleShowAll = () => {
|
|
29
|
+
setStep(ModalStep.EX_WALLET_MORE);
|
|
30
|
+
};
|
|
31
|
+
const handleParaClick = () => {
|
|
32
|
+
setStep(ModalStep.AUTH_MORE);
|
|
33
|
+
};
|
|
34
|
+
const handleWalletClick = (wallet) => () => {
|
|
35
|
+
const shouldShowNetworkSelection = allWallets.filter((w) => w.id === wallet.id).length > 1;
|
|
36
|
+
if (shouldShowNetworkSelection) {
|
|
37
|
+
setSelectedExternalWalletId(wallet.internalId);
|
|
38
|
+
setStep(ModalStep.EX_WALLET_NETWORK_SELECT);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setSelectedExternalWalletId(wallet.internalId);
|
|
42
|
+
setStep(ModalStep.EX_WALLET_SELECTED);
|
|
43
|
+
if (wallet.installed) {
|
|
44
|
+
connectExternalWallet(wallet);
|
|
45
|
+
} else if (wallet.isMobile) {
|
|
46
|
+
connectExternalWallet(wallet, true);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ jsxs(Container, { $maxHeight: showAll, children: [
|
|
50
|
+
showAll && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx(SearchInputWrapper, { children: /* @__PURE__ */ jsx(
|
|
52
|
+
SearchInput,
|
|
53
|
+
{
|
|
54
|
+
placeholder: "Search for your wallet",
|
|
55
|
+
onCpslInput: (e) => __async(void 0, null, function* () {
|
|
56
|
+
var _a;
|
|
57
|
+
setSearch((_a = e.target.value) != null ? _a : "");
|
|
58
|
+
}),
|
|
59
|
+
value: search,
|
|
60
|
+
style: { width: "100%" },
|
|
61
|
+
children: /* @__PURE__ */ jsx(SearchIcon, { slot: "start", icon: "search" })
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
hasEmbeddedAuth(authLayout != null ? authLayout : []) && /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, variant: "tertiary", onClick: handleParaClick, children: /* @__PURE__ */ jsxs(WalletButtonOuterContainer, { children: [
|
|
65
|
+
/* @__PURE__ */ jsxs(WalletButtonInnerContainer, { children: [
|
|
66
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "paraIcon" }),
|
|
67
|
+
/* @__PURE__ */ jsx(CpslText, { weight: "medium", children: "Para" })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ jsx(Badge, { $show: true, $variant: "installed", children: /* @__PURE__ */ jsx(CpslText, { variant: "body2XS", weight: "medium", children: "Available" }) })
|
|
70
|
+
] }) })
|
|
71
|
+
] }),
|
|
72
|
+
walletsToShow.map(
|
|
73
|
+
(wallet) => showAll ? /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, variant: "tertiary", onClick: handleWalletClick(wallet), children: /* @__PURE__ */ jsxs(WalletButtonOuterContainer, { children: [
|
|
74
|
+
/* @__PURE__ */ jsxs(WalletButtonInnerContainer, { children: [
|
|
75
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", src: wallet.iconUrl }),
|
|
76
|
+
/* @__PURE__ */ jsx(CpslText, { weight: "medium", children: wallet.name })
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ jsx(Badge, { $show: !!wallet.isMobile || !!wallet.installed, $variant: wallet.installed ? "installed" : "mobile", children: /* @__PURE__ */ jsx(CpslText, { variant: "body2XS", weight: "medium", children: wallet.installed ? "Installed" : "Mobile" }) })
|
|
79
|
+
] }) }, wallet.id) : /* @__PURE__ */ jsx(WalletTileButton, { src: wallet.iconUrl, onClick: handleWalletClick(wallet), children: /* @__PURE__ */ jsxs(TileButtonInnerContainer, { children: [
|
|
80
|
+
wallet.installed && /* @__PURE__ */ jsx(InstalledIndicator, {}),
|
|
81
|
+
/* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: wallet.name })
|
|
82
|
+
] }) }, wallet.id)
|
|
83
|
+
),
|
|
84
|
+
showMoreButton && /* @__PURE__ */ jsxs(CpslButton, { variant: "tertiary", fullWidth: true, onClick: handleShowAll, children: [
|
|
85
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "wallet" }),
|
|
86
|
+
"More Wallets"
|
|
87
|
+
] }),
|
|
88
|
+
showAll && /* @__PURE__ */ jsx(BlurContainer, {})
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
const Container = safeStyled.div`
|
|
92
|
+
position: relative;
|
|
93
|
+
display: flex;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
gap: 8px;
|
|
96
|
+
flex-wrap: wrap;
|
|
97
|
+
|
|
98
|
+
max-height: ${({ $maxHeight }) => $maxHeight ? "348px" : "none"};
|
|
99
|
+
overflow-y: auto;
|
|
100
|
+
|
|
101
|
+
&::-webkit-scrollbar {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
-ms-overflow-style: none;
|
|
105
|
+
scrollbar-width: none;
|
|
106
|
+
`;
|
|
107
|
+
const WalletTileButton = safeStyled(StyledCpslTileButton)`
|
|
108
|
+
flex: 1;
|
|
109
|
+
`;
|
|
110
|
+
const WalletButtonOuterContainer = safeStyled.div`
|
|
111
|
+
width: 100%;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: 8px;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
`;
|
|
117
|
+
const WalletButtonInnerContainer = safeStyled.div`
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 8px;
|
|
121
|
+
|
|
122
|
+
cpsl-icon {
|
|
123
|
+
--icon-color: var(--cpsl-color-contrast);
|
|
124
|
+
}
|
|
125
|
+
cpsl-text {
|
|
126
|
+
&::part(text-element) {
|
|
127
|
+
color: var(--cpsl-color-contrast);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
const Badge = safeStyled.div`
|
|
132
|
+
visibility: ${({ $show }) => $show ? "visible" : "hidden"};
|
|
133
|
+
padding: 2px 4px;
|
|
134
|
+
border-radius: 4px;
|
|
135
|
+
border: 1px solid;
|
|
136
|
+
border-color: ${({ $variant }) => $variant === "installed" ? "var(--cpsl-color-utility-green)" : "var(--cpsl-color-text-primary)"};
|
|
137
|
+
cpsl-text {
|
|
138
|
+
&::part(text-element) {
|
|
139
|
+
color: ${({ $variant }) => $variant === "installed" ? "var(--cpsl-color-utility-green)" : "var(--cpsl-color-text-primary)"};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`;
|
|
143
|
+
const InstalledIndicator = safeStyled.span`
|
|
144
|
+
width: 8px;
|
|
145
|
+
height: 8px;
|
|
146
|
+
border-radius: 100%;
|
|
147
|
+
background-color: var(--cpsl-color-utility-green);
|
|
148
|
+
`;
|
|
149
|
+
const TileButtonInnerContainer = safeStyled.div`
|
|
150
|
+
display: flex;
|
|
151
|
+
gap: 4px;
|
|
152
|
+
align-items: center;
|
|
153
|
+
`;
|
|
154
|
+
const SearchIcon = safeStyled(CpslIcon)`
|
|
155
|
+
--icon-color: var(--cpsl-color-contrast);
|
|
156
|
+
`;
|
|
157
|
+
const SearchInputWrapper = safeStyled.div`
|
|
158
|
+
width: 100%;
|
|
159
|
+
background-color: var(--cpsl-color-background-0);
|
|
160
|
+
|
|
161
|
+
position: sticky;
|
|
162
|
+
top: 0;
|
|
163
|
+
padding-bottom: 4px;
|
|
164
|
+
margin-bottom: -4px;
|
|
165
|
+
`;
|
|
166
|
+
const SearchInput = safeStyled(CpslInput)`
|
|
167
|
+
width: 100%;
|
|
168
|
+
--container-background-color: var(--cpsl-color-background-8);
|
|
169
|
+
--input-background-color: var(--cpsl-color-background-8);
|
|
170
|
+
`;
|
|
171
|
+
const BlurContainer = safeStyled.div`
|
|
172
|
+
position: sticky;
|
|
173
|
+
height: 56px;
|
|
174
|
+
width: 100%;
|
|
175
|
+
bottom: 0;
|
|
176
|
+
|
|
177
|
+
background: linear-gradient(0deg, var(--cpsl-color-background-0) 0%, rgba(234, 239, 211, 0) 100%);
|
|
178
|
+
pointer-events: none;
|
|
179
|
+
`;
|
|
180
|
+
export {
|
|
181
|
+
ExternalWallets
|
|
182
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Footer: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { safeStyled } from "@getpara/react-common";
|
|
5
|
+
import { CpslButton, CpslIcon, CpslText } from "@getpara/react-components";
|
|
6
|
+
import { useModalStore } from "../../stores/index.js";
|
|
7
|
+
import { PARA_CONNECT, PARA_TERMS_AND_CONDITIONS } from "../../constants/constants.js";
|
|
8
|
+
import { useMemo } from "react";
|
|
9
|
+
import { getStepHasFooter } from "../../utils/steps.js";
|
|
10
|
+
import { useAccount } from "../../../provider/index.js";
|
|
11
|
+
const Footer = () => {
|
|
12
|
+
const { embedded } = useAccount();
|
|
13
|
+
const currentStep = useModalStore((state) => state.step);
|
|
14
|
+
const accountFooter = (embedded == null ? void 0 : embedded.isConnected) && !embedded.isGuestMode;
|
|
15
|
+
const showFooter = accountFooter || getStepHasFooter(currentStep);
|
|
16
|
+
const Content = useMemo(() => {
|
|
17
|
+
if (accountFooter) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(ConnectContainer, { children: [
|
|
19
|
+
/* @__PURE__ */ jsxs(ConnectText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
|
|
20
|
+
"Access all your wallet\u2019s features at",
|
|
21
|
+
" ",
|
|
22
|
+
/* @__PURE__ */ jsx("a", { href: PARA_CONNECT, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "bodyS", weight: "medium", children: "Para Connect" }) })
|
|
23
|
+
] }),
|
|
24
|
+
/* @__PURE__ */ jsx(CpslButton, { as: "a", href: PARA_CONNECT, target: "blank", variant: "ghost", children: /* @__PURE__ */ jsx(RightChevron, { icon: "chevronUp" }) })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsxs(InlineText, { variant: "body2XS", color: "secondary", weight: "medium", children: [
|
|
29
|
+
"By logging in you agree to our",
|
|
30
|
+
" ",
|
|
31
|
+
/* @__PURE__ */ jsx("a", { href: PARA_TERMS_AND_CONDITIONS, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "body2XS", weight: "medium", children: "Terms & Conditions" }) })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ jsxs(PoweredByContainer, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(InlineText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Powered by" }),
|
|
35
|
+
/* @__PURE__ */ jsx(ParaLogo, { icon: "para" })
|
|
36
|
+
] })
|
|
37
|
+
] });
|
|
38
|
+
}, [embedded]);
|
|
39
|
+
if (!showFooter) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return /* @__PURE__ */ jsx(FooterContainer, { slot: "footer", children: /* @__PURE__ */ jsx(FooterContentContainer, { children: Content }) });
|
|
43
|
+
};
|
|
44
|
+
const FooterContainer = safeStyled.div`
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 16px;
|
|
49
|
+
padding: 8px 0px;
|
|
50
|
+
`;
|
|
51
|
+
const FooterContentContainer = safeStyled.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 8px;
|
|
56
|
+
`;
|
|
57
|
+
const PoweredByContainer = safeStyled.div`
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 5px;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
`;
|
|
63
|
+
const ConnectContainer = safeStyled.div`
|
|
64
|
+
display: flex;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
`;
|
|
69
|
+
const RightChevron = safeStyled(CpslIcon)`
|
|
70
|
+
transform: rotate(90deg);
|
|
71
|
+
|
|
72
|
+
/* --icon-color: var(--cpsl-color-text-tertiary); */
|
|
73
|
+
--height: 24px;
|
|
74
|
+
--width: 24px;
|
|
75
|
+
`;
|
|
76
|
+
const InlineText = safeStyled(CpslText)`
|
|
77
|
+
text-align: center;
|
|
78
|
+
display: inline-block;
|
|
79
|
+
`;
|
|
80
|
+
const ConnectText = safeStyled(InlineText)`
|
|
81
|
+
line-height: 20px;
|
|
82
|
+
`;
|
|
83
|
+
const ClickableText = safeStyled(InlineText)`
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
display: inline-block;
|
|
86
|
+
`;
|
|
87
|
+
const ParaLogo = safeStyled(CpslIcon)`
|
|
88
|
+
display: inline-block;
|
|
89
|
+
--icon-color: var(--cpsl-color-text-secondary);
|
|
90
|
+
--width: 49px;
|
|
91
|
+
--height: auto;
|
|
92
|
+
`;
|
|
93
|
+
export {
|
|
94
|
+
Footer
|
|
95
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Header: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { safeStyled } from "@getpara/react-common";
|
|
5
|
+
import { useStepTitle } from "./hooks/useStepTitle.js";
|
|
6
|
+
import { CenteredText } from "../common.js";
|
|
7
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
8
|
+
import { useModalStore } from "../../stores/index.js";
|
|
9
|
+
import { BODY_MOTION_VARIANTS, BODY_TRANSITION } from "../../constants/constants.js";
|
|
10
|
+
const Header = () => {
|
|
11
|
+
const { title } = useStepTitle();
|
|
12
|
+
const stepDirection = useModalStore((state) => state.stepDirection);
|
|
13
|
+
const currentStep = useModalStore((state) => state.step);
|
|
14
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", initial: false, custom: stepDirection, children: /* @__PURE__ */ jsx(
|
|
15
|
+
Container,
|
|
16
|
+
{
|
|
17
|
+
custom: stepDirection,
|
|
18
|
+
variants: BODY_MOTION_VARIANTS,
|
|
19
|
+
initial: "enter",
|
|
20
|
+
animate: "center",
|
|
21
|
+
exit: "exit",
|
|
22
|
+
transition: BODY_TRANSITION,
|
|
23
|
+
slot: "header",
|
|
24
|
+
id: "header",
|
|
25
|
+
children: /* @__PURE__ */ jsx(CenteredText, { weight: "semiBold", color: "secondary", children: title })
|
|
26
|
+
},
|
|
27
|
+
["ADD_FUNDS_BUY", "ADD_FUNDS_RECEIVE", "ADD_FUNDS_WITHDRAW"].includes(currentStep) ? "ADD_FUNDS" : currentStep
|
|
28
|
+
) });
|
|
29
|
+
};
|
|
30
|
+
const Container = safeStyled(motion.div)`
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 16px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
z-index: 2;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
gap: 8px;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
`;
|
|
41
|
+
export {
|
|
42
|
+
Header
|
|
43
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useModalStore } from "../../../stores/modal/useModalStore.js";
|
|
5
|
+
import { ModalStep } from "../../../utils/steps.js";
|
|
6
|
+
import { useExternalWallets } from "../../../../provider/providers/ExternalWalletProvider.js";
|
|
7
|
+
import { useStore } from "../../../../provider/stores/useStore.js";
|
|
8
|
+
import { useAccountLinking } from "../../../../provider/providers/AccountLinkProvider.js";
|
|
9
|
+
const useStepTitle = () => {
|
|
10
|
+
const hideWallets = useStore((state) => {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
13
|
+
});
|
|
14
|
+
const isLogin = useModalStore((state) => state.isLogin());
|
|
15
|
+
const currentStep = useModalStore((state) => state.step);
|
|
16
|
+
const { chainId } = useExternalWallets();
|
|
17
|
+
const { isEnabled: isAccountLinkingEnabled } = useAccountLinking();
|
|
18
|
+
const titles = useMemo(
|
|
19
|
+
() => ({
|
|
20
|
+
[ModalStep.AUTH_MAIN]: "",
|
|
21
|
+
[ModalStep.AUTH_MORE]: "Sign Up or Log In",
|
|
22
|
+
[ModalStep.AUTH_GUEST_SIGNUP]: "Complete Account Setup",
|
|
23
|
+
[ModalStep.EX_WALLET_MORE]: "Connect Wallet",
|
|
24
|
+
[ModalStep.VERIFICATIONS]: "Sign Up",
|
|
25
|
+
[ModalStep.AWAITING_OAUTH]: isLogin ? "Login" : "Sign Up",
|
|
26
|
+
[ModalStep.FARCASTER_OAUTH]: isLogin ? "Login" : "Sign Up",
|
|
27
|
+
[ModalStep.BIOMETRIC_CREATION]: "Sign Up",
|
|
28
|
+
[ModalStep.PASSWORD_CREATION]: "Sign Up",
|
|
29
|
+
[ModalStep.AWAITING_BIOMETRIC_CREATION]: "Sign Up",
|
|
30
|
+
[ModalStep.AWAITING_WALLET_CREATION]: isLogin ? "Login" : "Sign Up",
|
|
31
|
+
[ModalStep.AWAITING_PASSWORD_CREATION]: "Sign Up",
|
|
32
|
+
[ModalStep.WALLET_CREATION_DONE]: hideWallets ? "Account Created" : "Wallet Created",
|
|
33
|
+
[ModalStep.SECRET]: isLogin ? "Login" : "Sign Up",
|
|
34
|
+
[ModalStep.BIOMETRIC_LOGIN]: "Login",
|
|
35
|
+
[ModalStep.EMBEDDED_PASSWORD_LOGIN]: "Login",
|
|
36
|
+
[ModalStep.AWAITING_PASSWORD_LOGIN]: "Login",
|
|
37
|
+
[ModalStep.AWAITING_BIOMETRIC_LOGIN]: "Login",
|
|
38
|
+
[ModalStep.LOGIN_DONE]: "",
|
|
39
|
+
[ModalStep.SETUP_2FA]: "2FA",
|
|
40
|
+
[ModalStep.VERIFY_2FA]: "2FA",
|
|
41
|
+
[ModalStep.TWO_FACTOR_DONE]: "2FA",
|
|
42
|
+
[ModalStep.ADD_FUNDS_BUY]: "",
|
|
43
|
+
[ModalStep.ADD_FUNDS_RECEIVE]: "",
|
|
44
|
+
[ModalStep.ADD_FUNDS_WITHDRAW]: "",
|
|
45
|
+
[ModalStep.ADD_FUNDS_AWAITING]: "",
|
|
46
|
+
[ModalStep.ADD_FUNDS_SUCCESS]: "",
|
|
47
|
+
[ModalStep.ADD_FUNDS_FAILURE]: "",
|
|
48
|
+
[ModalStep.ACCOUNT_MAIN]: "",
|
|
49
|
+
[ModalStep.CHAIN_SWITCH]: "",
|
|
50
|
+
[ModalStep.ACCOUNT_PROFILE]: isAccountLinkingEnabled ? "Profile" : "Settings",
|
|
51
|
+
[ModalStep.ACCOUNT_PROFILE_LIST]: "Link Account",
|
|
52
|
+
[ModalStep.ACCOUNT_PROFILE_ADD]: "Link Account",
|
|
53
|
+
[ModalStep.ACCOUNT_PROFILE_REMOVE]: "Unlink Account",
|
|
54
|
+
[ModalStep.AWAITING_IFRAME]: isLogin ? "Login" : "Sign Up"
|
|
55
|
+
}),
|
|
56
|
+
[isLogin, chainId, hideWallets]
|
|
57
|
+
);
|
|
58
|
+
return { title: titles[currentStep] };
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
useStepTitle
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Hero: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslHero, CpslIcon, CpslIdenticon } from "@getpara/react-components";
|
|
5
|
+
import { safeStyled } from "@getpara/react-common";
|
|
6
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
7
|
+
import { useModalStore } from "../../stores/index.js";
|
|
8
|
+
import { NETWORK_NOT_SUPPORTED_ERROR } from "../../constants/constants.js";
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
import { isMobile } from "@getpara/web-sdk";
|
|
11
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
12
|
+
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
13
|
+
import { useWallet } from "../../../provider/index.js";
|
|
14
|
+
const getStepConfig = ({
|
|
15
|
+
externalWalletError
|
|
16
|
+
}) => {
|
|
17
|
+
var _a;
|
|
18
|
+
return {
|
|
19
|
+
[ModalStep.EX_WALLET_SELECTED]: {
|
|
20
|
+
variant: "externalWalletConnection",
|
|
21
|
+
topOffset: 40,
|
|
22
|
+
spacerHeight: 158,
|
|
23
|
+
hideFadeOut: true
|
|
24
|
+
},
|
|
25
|
+
[ModalStep.CHAIN_SWITCH]: {
|
|
26
|
+
variant: ((_a = externalWalletError == null ? void 0 : externalWalletError[0]) == null ? void 0 : _a.toLowerCase()) === NETWORK_NOT_SUPPORTED_ERROR ? "failed" : "externalWalletConnection",
|
|
27
|
+
topOffset: 20,
|
|
28
|
+
spacerHeight: 158,
|
|
29
|
+
hideFadeOut: true
|
|
30
|
+
},
|
|
31
|
+
[ModalStep.FARCASTER_OAUTH]: {
|
|
32
|
+
variant: "externalWalletConnection",
|
|
33
|
+
topOffset: 40,
|
|
34
|
+
spacerHeight: 158,
|
|
35
|
+
hideFadeOut: true
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const Hero = () => {
|
|
40
|
+
const para = useInternalClient();
|
|
41
|
+
const { wallet: connector, walletDisplayHelpers, avatar } = useExternalWallets();
|
|
42
|
+
const step = useModalStore((state) => state.step);
|
|
43
|
+
const externalWalletError = useModalStore((state) => state.externalWalletError);
|
|
44
|
+
const { data: activeWallet } = useWallet();
|
|
45
|
+
const [currentStep, setCurrentStep] = useState(step);
|
|
46
|
+
const stepConfig = getStepConfig({
|
|
47
|
+
externalWalletError
|
|
48
|
+
})[currentStep];
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const prevStepConfig = getStepConfig({
|
|
51
|
+
externalWalletError
|
|
52
|
+
})[currentStep];
|
|
53
|
+
const newStepConfig = getStepConfig({
|
|
54
|
+
externalWalletError
|
|
55
|
+
})[step];
|
|
56
|
+
const delay = newStepConfig && prevStepConfig ? 0 : newStepConfig && !prevStepConfig ? 0 : 200;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
setCurrentStep(step);
|
|
59
|
+
}, delay);
|
|
60
|
+
}, [step]);
|
|
61
|
+
const isExternalStep = currentStep === ModalStep.EX_WALLET_SELECTED;
|
|
62
|
+
const isChainSwitchStep = currentStep === ModalStep.CHAIN_SWITCH;
|
|
63
|
+
const isAccountStep = currentStep === ModalStep.ACCOUNT_MAIN;
|
|
64
|
+
const isFarcasterStep = currentStep === ModalStep.FARCASTER_OAUTH;
|
|
65
|
+
const { showExtension, isCosmosMobileWallet } = walletDisplayHelpers;
|
|
66
|
+
const shouldHide = !stepConfig || !isMobile() && isExternalStep && !showExtension || !isMobile() && isChainSwitchStep && isCosmosMobileWallet || !isMobile() && isFarcasterStep;
|
|
67
|
+
const { variant, topOffset, spacerHeight, hideFadeOut } = stepConfig != null ? stepConfig : {};
|
|
68
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(Container, { $top: -45 + (topOffset != null ? topOffset : 0), children: shouldHide ? null : /* @__PURE__ */ jsxs(StyledHero, { $isAccount: isAccountStep, hideFadeOut, variant, height: 480, withDefaultTheme: true, children: [
|
|
70
|
+
(isExternalStep || isChainSwitchStep) && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", src: connector == null ? void 0 : connector.iconUrl }),
|
|
71
|
+
isFarcasterStep && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", icon: "farcasterBrand" }),
|
|
72
|
+
isAccountStep && (avatar ? /* @__PURE__ */ jsx(Avatar, { slot: "image", src: avatar }) : activeWallet ? /* @__PURE__ */ jsx(IconAvatar, { slot: "image", size: "100%", hash: para.getIdenticonHash(activeWallet.id, activeWallet.type) }) : null)
|
|
73
|
+
] }) }),
|
|
74
|
+
!shouldHide && /* @__PURE__ */ jsx(Spacer, { $height: spacerHeight != null ? spacerHeight : 0 })
|
|
75
|
+
] });
|
|
76
|
+
};
|
|
77
|
+
const Container = safeStyled.div`
|
|
78
|
+
display: flex;
|
|
79
|
+
position: absolute;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
align-items: center;
|
|
82
|
+
width: 100%;
|
|
83
|
+
|
|
84
|
+
top: ${({ $top }) => `${$top}px`};
|
|
85
|
+
`;
|
|
86
|
+
const Spacer = safeStyled.div`
|
|
87
|
+
height: ${({ $height }) => `${$height}px`};
|
|
88
|
+
`;
|
|
89
|
+
const WalletLogo = safeStyled(CpslIcon)`
|
|
90
|
+
--height: 60px;
|
|
91
|
+
--width: 60px;
|
|
92
|
+
`;
|
|
93
|
+
const Avatar = safeStyled.img`
|
|
94
|
+
width: 100%;
|
|
95
|
+
height: 100%;
|
|
96
|
+
object-fit: contain;
|
|
97
|
+
`;
|
|
98
|
+
const IconAvatar = safeStyled(CpslIdenticon)`
|
|
99
|
+
border-radius: 1000px;
|
|
100
|
+
`;
|
|
101
|
+
const StyledHero = safeStyled(CpslHero)`
|
|
102
|
+
${({ $isAccount }) => $isAccount && `
|
|
103
|
+
--ring-3-size: 560px;
|
|
104
|
+
--ring-2-size: 402px;
|
|
105
|
+
--ring-1-size: 228px;
|
|
106
|
+
--ring-0-size: 104px;
|
|
107
|
+
|
|
108
|
+
--default-theme-ring-3-opacity: 0.02;
|
|
109
|
+
--default-theme-ring-2-opacity: 0.04;
|
|
110
|
+
--default-theme-ring-1-opacity: 0.06;
|
|
111
|
+
--default-theme-ring-0-opacity: 0.1;
|
|
112
|
+
`}
|
|
113
|
+
`;
|
|
114
|
+
export {
|
|
115
|
+
Hero
|
|
116
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IFrameStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { useModalStore } from "../../stores/index.js";
|
|
6
|
+
import { IFrameSteps } from "../../utils/steps.js";
|
|
7
|
+
import { safeStyled } from "@getpara/react-common";
|
|
8
|
+
import { SpinnerContainer } from "@getpara/react-common";
|
|
9
|
+
import { CpslSpinner } from "@getpara/react-components";
|
|
10
|
+
import { getPortalBaseURL } from "@getpara/web-sdk";
|
|
11
|
+
import { MOBILE_SIZE } from "../../constants/constants.js";
|
|
12
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
13
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
14
|
+
const IFrameStep = () => {
|
|
15
|
+
const iFrameUrl = useModalStore((state) => state.iFrameUrl);
|
|
16
|
+
const setIsReady = useModalStore((state) => state.setIsIFrameReady);
|
|
17
|
+
const isReady = useModalStore((state) => state.isIFrameReady);
|
|
18
|
+
const currentStep = useModalStore((state) => state.step);
|
|
19
|
+
const embeddedModal = useStore((state) => {
|
|
20
|
+
var _a;
|
|
21
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
|
|
22
|
+
});
|
|
23
|
+
const para = useInternalClient();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const handleMessage = (event) => {
|
|
26
|
+
const portalBase = getPortalBaseURL(para.ctx);
|
|
27
|
+
if (!event.origin.startsWith(portalBase)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (event.data && event.data.type === "LOADED") {
|
|
31
|
+
setIsReady(true);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
window.addEventListener("message", handleMessage);
|
|
35
|
+
return () => window.removeEventListener("message", handleMessage);
|
|
36
|
+
}, [setIsReady]);
|
|
37
|
+
return /* @__PURE__ */ jsxs(OuterContainer, { $isVisible: IFrameSteps.includes(currentStep), $embeddedModal: !!embeddedModal, children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Container, { $isReady: !!isReady, children: /* @__PURE__ */ jsx("iframe", { src: iFrameUrl }) }),
|
|
39
|
+
!isReady && /* @__PURE__ */ jsx(SpinnerContainer, { style: { width: "100%", height: "100%", flex: 1, position: "absolute" }, children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) })
|
|
40
|
+
] });
|
|
41
|
+
};
|
|
42
|
+
const OuterContainer = safeStyled.div`
|
|
43
|
+
position: relative;
|
|
44
|
+
height: ${({ $isVisible }) => $isVisible ? "528px" : "0px"};
|
|
45
|
+
width: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
|
|
46
|
+
flex: ${({ $isVisible }) => $isVisible ? 1 : "auto"};
|
|
47
|
+
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 72px 32px"};
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
|
|
52
|
+
@media (max-width: ${MOBILE_SIZE}px) {
|
|
53
|
+
padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 16px 0px"};
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
const Container = safeStyled.div`
|
|
57
|
+
height: 360px;
|
|
58
|
+
width: 100%;
|
|
59
|
+
opacity: ${({ $isReady }) => $isReady ? 1 : 0};
|
|
60
|
+
|
|
61
|
+
& > iframe {
|
|
62
|
+
height: 360px;
|
|
63
|
+
width: 100%;
|
|
64
|
+
border: none;
|
|
65
|
+
background: transparent;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
export {
|
|
69
|
+
IFrameStep
|
|
70
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
import { Heading, HeroIcon, StepContainer } from "../common.js";
|
|
6
|
+
import { ExternalWalletCard, WalletCard, WalletCards } from "../WalletCard/WalletCard.js";
|
|
7
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
8
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
9
|
+
import { useModalStore } from "../../stores/index.js";
|
|
10
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
11
|
+
const LoginDoneStep = ({ onClose }) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const para = useInternalClient();
|
|
14
|
+
const bareModal = useStore((state) => {
|
|
15
|
+
var _a2;
|
|
16
|
+
return (_a2 = state.modalConfig) == null ? void 0 : _a2.bareModal;
|
|
17
|
+
});
|
|
18
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
19
|
+
const setFlow = useModalStore((state) => state.setFlow);
|
|
20
|
+
const hideWallets = useStore((state) => {
|
|
21
|
+
var _a2;
|
|
22
|
+
return (_a2 = state.modalConfig) == null ? void 0 : _a2.hideWallets;
|
|
23
|
+
});
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
if (bareModal) {
|
|
27
|
+
setFlow("account");
|
|
28
|
+
setStep(ModalStep.ACCOUNT_MAIN);
|
|
29
|
+
} else {
|
|
30
|
+
onClose();
|
|
31
|
+
}
|
|
32
|
+
}, 1600);
|
|
33
|
+
}, []);
|
|
34
|
+
return /* @__PURE__ */ jsxs(StepContainer, { children: [
|
|
35
|
+
/* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
|
|
36
|
+
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Connected" }),
|
|
37
|
+
!hideWallets && /* @__PURE__ */ jsx(WalletCards, { children: para.externalWalletConnectionType === "CONNECTION_ONLY" || para.externalWalletConnectionType === "VERIFICATION" ? /* @__PURE__ */ jsx(ExternalWalletCard, { address: (_b = (_a = Object.values(para.externalWallets || {})[0]) == null ? void 0 : _a.address) != null ? _b : "" }) : para.currentWalletIdsArray.map(([id, type]) => {
|
|
38
|
+
return /* @__PURE__ */ jsx(WalletCard, { id, type }, `${id}-${type}`);
|
|
39
|
+
}) })
|
|
40
|
+
] });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
LoginDoneStep
|
|
44
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ParaModalProps } from '../../types/modalProps.js';
|
|
2
|
+
type ModalContentProps = Omit<ParaModalProps, 'para' | 'isOpen' | 'theme' | 'branding' | 'onModalStepChange' | 'onExpandModalChange'>;
|
|
3
|
+
export type ModalContentHandle = {
|
|
4
|
+
/**
|
|
5
|
+
* Trigger the modal close handler
|
|
6
|
+
*/
|
|
7
|
+
handleModalClose: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const ModalContent: import("react").ForwardRefExoticComponent<ModalContentProps & import("react").RefAttributes<ModalContentHandle>>;
|
|
10
|
+
export {};
|