@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,179 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as Fragment2, useMemo } from "react";
|
|
5
|
+
import { CpslButton, CpslDivider, CpslIcon, CpslIconGroup } from "@getpara/react-components";
|
|
6
|
+
import { safeStyled } from "@getpara/react-common";
|
|
7
|
+
import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
|
|
8
|
+
import { useModalStore } from "../../stores/index.js";
|
|
9
|
+
import { ModalStep } from "../../utils/steps.js";
|
|
10
|
+
import { AuthLayout } from "../../types/modalProps.js";
|
|
11
|
+
import { ACCOUNT_TYPES } from "../../constants/oAuthLogos.js";
|
|
12
|
+
import { AuthOptions } from "../AuthOptions/AuthOptions.js";
|
|
13
|
+
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
14
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
15
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
16
|
+
import { useAccount, useParaStatus } from "../../../provider/index.js";
|
|
17
|
+
const AuthMainStepContent = ({
|
|
18
|
+
oAuthMethods,
|
|
19
|
+
disableEmailLogin,
|
|
20
|
+
disablePhoneLogin,
|
|
21
|
+
isGuestModeEnabled = false
|
|
22
|
+
}) => {
|
|
23
|
+
const { wallets, connectFarcasterMiniApp } = useExternalWallets();
|
|
24
|
+
const { createGuestWallets } = useAuthActions();
|
|
25
|
+
const { isFarcasterMiniApp } = useParaStatus();
|
|
26
|
+
const { embedded } = useAccount();
|
|
27
|
+
const authLayout = useModalStore((state) => state.authLayout);
|
|
28
|
+
const setStep = useModalStore((state) => state.setStep);
|
|
29
|
+
const oAuthLogoVariant = useStore((state) => state.oAuthLogoVariant);
|
|
30
|
+
const isDark = useStore((state) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
return ((_b = (_a = state.modalConfig) == null ? void 0 : _a.theme) == null ? void 0 : _b.mode) === "dark";
|
|
33
|
+
});
|
|
34
|
+
const isGuestMode = (embedded == null ? void 0 : embedded.isConnected) && embedded.isGuestMode;
|
|
35
|
+
const useBrandedLogos = oAuthLogoVariant === "default";
|
|
36
|
+
const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
|
|
37
|
+
const handleCondensedAuthClick = () => {
|
|
38
|
+
setStep(ModalStep.AUTH_MORE);
|
|
39
|
+
};
|
|
40
|
+
const handleCondensedExternalClick = () => {
|
|
41
|
+
setStep(ModalStep.EX_WALLET_MORE);
|
|
42
|
+
};
|
|
43
|
+
const Content = useMemo(() => {
|
|
44
|
+
const methods = [];
|
|
45
|
+
if (isFarcasterMiniApp) {
|
|
46
|
+
methods.push([
|
|
47
|
+
/* @__PURE__ */ jsxs(FarcasterButton, { variant: "primary", fullWidth: true, onClick: connectFarcasterMiniApp, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "farcaster" }),
|
|
49
|
+
"Continue with Farcaster"
|
|
50
|
+
] }),
|
|
51
|
+
"FARCASTER"
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
authLayout == null ? void 0 : authLayout.forEach((layout) => {
|
|
55
|
+
switch (layout) {
|
|
56
|
+
case AuthLayout.AUTH_FULL: {
|
|
57
|
+
methods.push([
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
AuthOptions,
|
|
60
|
+
{
|
|
61
|
+
oAuthMethods,
|
|
62
|
+
disableEmailLogin,
|
|
63
|
+
disablePhoneLogin,
|
|
64
|
+
isGuestModeEnabled
|
|
65
|
+
},
|
|
66
|
+
"authFull"
|
|
67
|
+
),
|
|
68
|
+
layout
|
|
69
|
+
]);
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
case AuthLayout.AUTH_CONDENSED: {
|
|
73
|
+
const icons = [];
|
|
74
|
+
oAuthMethods == null ? void 0 : oAuthMethods.forEach((method) => icons.push(ACCOUNT_TYPES[method][useBrandedLogos ? "logoBranded" : "logo"]));
|
|
75
|
+
methods.push([
|
|
76
|
+
/* @__PURE__ */ jsxs(CondensedButton, { onClick: handleCondensedAuthClick, variant: "tertiary", fullWidth: true, children: [
|
|
77
|
+
/* @__PURE__ */ jsx(IconGroupSpacer, { slot: "start", icons: [], $isDark: useDarkLogos }),
|
|
78
|
+
"Sign Up or Login",
|
|
79
|
+
/* @__PURE__ */ jsx(StyledIconGroup, { slot: "end", icons: icons.splice(0, 3), $isDark: useDarkLogos })
|
|
80
|
+
] }, "authCondensed"),
|
|
81
|
+
layout
|
|
82
|
+
]);
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
case AuthLayout.EXTERNAL_FULL: {
|
|
86
|
+
if (!!wallets.length) {
|
|
87
|
+
methods.push([/* @__PURE__ */ jsx(ExternalWallets, {}, "externalWallets"), layout]);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case AuthLayout.EXTERNAL_CONDENSED: {
|
|
92
|
+
const icons = [];
|
|
93
|
+
wallets == null ? void 0 : wallets.forEach((wallet) => icons.push(wallet.iconUrl));
|
|
94
|
+
methods.push([
|
|
95
|
+
/* @__PURE__ */ jsxs(CondensedButton, { onClick: handleCondensedExternalClick, variant: "tertiary", fullWidth: true, children: [
|
|
96
|
+
/* @__PURE__ */ jsx(IconGroupSpacer, { slot: "start", icons: [], $isDark: useDarkLogos }),
|
|
97
|
+
"Connect Wallet",
|
|
98
|
+
/* @__PURE__ */ jsx(StyledIconGroup, { slot: "end", icons: icons.splice(0, 3), $isDark: useDarkLogos })
|
|
99
|
+
] }, "authCondensed"),
|
|
100
|
+
layout
|
|
101
|
+
]);
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
default: {
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return /* @__PURE__ */ jsx(Fragment, { children: methods.map(([reactNode, key], index) => /* @__PURE__ */ jsxs(Fragment2, { children: [
|
|
110
|
+
reactNode,
|
|
111
|
+
methods.length > 1 && index < methods.length - 1 && /* @__PURE__ */ jsx(CpslDivider, { children: "or" }, "or")
|
|
112
|
+
] }, key)) });
|
|
113
|
+
}, [isFarcasterMiniApp, oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, wallets, authLayout]);
|
|
114
|
+
return /* @__PURE__ */ jsxs(Container, { "data-testid": "main-auth-step-content", children: [
|
|
115
|
+
Content,
|
|
116
|
+
isGuestModeEnabled && !isGuestMode && !isFarcasterMiniApp && /* @__PURE__ */ jsx(
|
|
117
|
+
GuestMode,
|
|
118
|
+
{
|
|
119
|
+
href: "#",
|
|
120
|
+
isDark,
|
|
121
|
+
onClick: (e) => {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
createGuestWallets();
|
|
124
|
+
},
|
|
125
|
+
children: "Continue as Guest"
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
] });
|
|
129
|
+
};
|
|
130
|
+
const Container = safeStyled.div`
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
gap: 8px;
|
|
134
|
+
`;
|
|
135
|
+
const StyledIconGroup = safeStyled(CpslIconGroup)`
|
|
136
|
+
--icon-item-color: ${({ $isDark }) => $isDark ? "white" : "black"};
|
|
137
|
+
flex: 1;
|
|
138
|
+
justify-content: flex-end;
|
|
139
|
+
`;
|
|
140
|
+
const IconGroupSpacer = safeStyled(StyledIconGroup)`
|
|
141
|
+
visibility: hidden;
|
|
142
|
+
`;
|
|
143
|
+
const CondensedButton = safeStyled(CpslButton)`
|
|
144
|
+
--button-justify-content: space-between;
|
|
145
|
+
|
|
146
|
+
&::part(button-native) {
|
|
147
|
+
max-height: 50px;
|
|
148
|
+
}
|
|
149
|
+
`;
|
|
150
|
+
const GuestMode = safeStyled.a`
|
|
151
|
+
display: flex;
|
|
152
|
+
justify-content: center;
|
|
153
|
+
align-items: center;
|
|
154
|
+
width: 100%;
|
|
155
|
+
height: 50px;
|
|
156
|
+
color: ${({ isDark }) => isDark ? "white" : "black"};
|
|
157
|
+
text-decoration: none;
|
|
158
|
+
font-size: 16px;
|
|
159
|
+
font-weight: 500;
|
|
160
|
+
font-family: var(--cpsl-font-family);
|
|
161
|
+
|
|
162
|
+
&:hover {
|
|
163
|
+
text-decoration: underline;
|
|
164
|
+
}
|
|
165
|
+
`;
|
|
166
|
+
const FarcasterButton = safeStyled(CpslButton)`
|
|
167
|
+
--button-primary-icon-color: white;
|
|
168
|
+
--button-primary-hover-icon-color: white;
|
|
169
|
+
--button-primary-active-icon-color: white;
|
|
170
|
+
--button-primary-background-color: #7e50d1;
|
|
171
|
+
--button-primary-hover-background-color: #8A63D2;
|
|
172
|
+
--button-primary-active-background-color: #8A63D2;
|
|
173
|
+
--button-primary-color: white;
|
|
174
|
+
--button-primary-hover-color: white;
|
|
175
|
+
--button-primary-active-color: white;
|
|
176
|
+
`;
|
|
177
|
+
export {
|
|
178
|
+
AuthMainStepContent
|
|
179
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
+
interface AuthOptionsProps {
|
|
3
|
+
oAuthMethods?: TOAuthMethod[];
|
|
4
|
+
disableEmailLogin: boolean;
|
|
5
|
+
disablePhoneLogin: boolean;
|
|
6
|
+
isGuestModeEnabled: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuthOptions: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthOptionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo } from "react";
|
|
5
|
+
import { safeStyled } from "@getpara/react-common";
|
|
6
|
+
import { OAuth } from "../OAuth/OAuth.js";
|
|
7
|
+
import { AuthInput } from "../AuthInput/AuthInput.js";
|
|
8
|
+
import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
|
|
9
|
+
import { useModalStore } from "../../stores/index.js";
|
|
10
|
+
import { CpslIcon, CpslText } from "@getpara/react-components";
|
|
11
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
12
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
13
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
14
|
+
import { isEmail, isPhone } from "@getpara/user-management-client";
|
|
15
|
+
const AuthOptions = ({
|
|
16
|
+
oAuthMethods,
|
|
17
|
+
disableEmailLogin,
|
|
18
|
+
disablePhoneLogin,
|
|
19
|
+
isGuestModeEnabled = false
|
|
20
|
+
}) => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
const para = useInternalClient();
|
|
23
|
+
const defaultAuthIdentifier = useStore((state) => {
|
|
24
|
+
var _a2;
|
|
25
|
+
return (_a2 = state.modalConfig) == null ? void 0 : _a2.defaultAuthIdentifier;
|
|
26
|
+
});
|
|
27
|
+
const { signUpOrLogIn, isSignUpOrLogInPending } = useAuthActions();
|
|
28
|
+
const { wallets } = useExternalWallets();
|
|
29
|
+
const guestAddFundsTab = useModalStore((state) => state.guestAddFundsTab);
|
|
30
|
+
const defaultAuth = defaultAuthIdentifier ? /^\+\d+$/.test(defaultAuthIdentifier) ? { phone: defaultAuthIdentifier } : { email: defaultAuthIdentifier } : para.authInfo && (isEmail((_a = para.authInfo) == null ? void 0 : _a.auth) || isPhone((_b = para.authInfo) == null ? void 0 : _b.auth)) ? para.authInfo.auth : void 0;
|
|
31
|
+
const Content = useMemo(() => {
|
|
32
|
+
const Methods = [];
|
|
33
|
+
if (!!(oAuthMethods == null ? void 0 : oAuthMethods.length)) {
|
|
34
|
+
Methods.push(/* @__PURE__ */ jsx(OAuth, { methods: oAuthMethods }, "oAuth"));
|
|
35
|
+
}
|
|
36
|
+
if (!disableEmailLogin || !disablePhoneLogin) {
|
|
37
|
+
Methods.push(
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
AuthInput,
|
|
40
|
+
{
|
|
41
|
+
sticky: true,
|
|
42
|
+
defaultAuth,
|
|
43
|
+
disableEmailLogin,
|
|
44
|
+
disablePhoneLogin,
|
|
45
|
+
onSubmit: signUpOrLogIn,
|
|
46
|
+
isSubmitting: isSignUpOrLogInPending
|
|
47
|
+
},
|
|
48
|
+
"input"
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return /* @__PURE__ */ jsx(Fragment, { children: Methods });
|
|
53
|
+
}, [oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, wallets]);
|
|
54
|
+
return /* @__PURE__ */ jsxs(Container, { children: [
|
|
55
|
+
guestAddFundsTab && /* @__PURE__ */ jsxs(CompleteAccountSetup, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(CompleteAccountIcon, { icon: "stars02", size: "16px" }),
|
|
57
|
+
/* @__PURE__ */ jsxs(CpslText, { variant: "bodyS", weight: "bold", children: [
|
|
58
|
+
"Complete account setup to",
|
|
59
|
+
" ",
|
|
60
|
+
guestAddFundsTab === "BUY" ? "buy assets" : guestAddFundsTab === "WITHDRAW" ? "sell assets" : "continue",
|
|
61
|
+
"."
|
|
62
|
+
] })
|
|
63
|
+
] }),
|
|
64
|
+
Content
|
|
65
|
+
] });
|
|
66
|
+
};
|
|
67
|
+
const Container = safeStyled.div`
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: 8px;
|
|
71
|
+
`;
|
|
72
|
+
const CompleteAccountSetup = safeStyled.div`
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
gap: 4px;
|
|
77
|
+
color: var(--cpsl-color-text-primary);
|
|
78
|
+
margin-bottom: 8px;
|
|
79
|
+
`;
|
|
80
|
+
const CompleteAccountIcon = safeStyled(CpslIcon)`
|
|
81
|
+
--icon-color: var(--cpsl-color-text-primary);
|
|
82
|
+
`;
|
|
83
|
+
export {
|
|
84
|
+
AuthOptions
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingBiometricsStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useModalStore } from "../../stores/index.js";
|
|
5
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
+
const AwaitingBiometricsStep = () => {
|
|
7
|
+
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Waiting,
|
|
10
|
+
{
|
|
11
|
+
heading: isLogin ? "Waiting for Passkey" : "Creating Passkey",
|
|
12
|
+
subheading: "Follow the prompts presented by your browser."
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
AwaitingBiometricsStep
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingIFrameStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useModalStore } from "../../stores/index.js";
|
|
5
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
+
const AwaitingIFrameStep = () => {
|
|
7
|
+
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
+
return /* @__PURE__ */ jsx(Waiting, { heading: isLogin ? "Logging you in..." : "Creating your account..." });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
AwaitingIFrameStep
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingOAuthStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
5
|
+
const AwaitingOAuthStep = () => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Waiting, { heading: "Complete Login", subheading: "Follow the prompts presented by your browser." });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
AwaitingOAuthStep
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AwaitingPasswordStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useModalStore } from "../../stores/index.js";
|
|
5
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
6
|
+
const AwaitingPasswordStep = () => {
|
|
7
|
+
const isLogin = useModalStore((state) => state.isLogin());
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Waiting,
|
|
10
|
+
{
|
|
11
|
+
heading: isLogin ? "Waiting for Password" : "Creating Password",
|
|
12
|
+
subheading: "Follow the prompts presented by your browser."
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
AwaitingPasswordStep
|
|
18
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslIcon, CpslInfoBox, CpslText } from "@getpara/react-components";
|
|
5
|
+
import { InfoBoxContent, InfoBoxHeader, StepContainer } from "../common.js";
|
|
6
|
+
import { useEffect, useRef, useState } from "react";
|
|
7
|
+
import { Waiting } from "../Waiting/Waiting.js";
|
|
8
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
9
|
+
import { useAccount } from "../../../provider/index.js";
|
|
10
|
+
const AwaitingWalletCreationStep = ({ isGuestMode = false }) => {
|
|
11
|
+
const hideWallets = useStore((state) => {
|
|
12
|
+
var _a;
|
|
13
|
+
return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
|
|
14
|
+
});
|
|
15
|
+
const [showInfoBox, setShowInfoBox] = useState(false);
|
|
16
|
+
const showInfoBoxTimeout = useRef();
|
|
17
|
+
const { embedded } = useAccount();
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (typeof window !== "undefined") {
|
|
20
|
+
showInfoBoxTimeout.current = window.setTimeout(() => {
|
|
21
|
+
setShowInfoBox(true);
|
|
22
|
+
}, 4e3);
|
|
23
|
+
}
|
|
24
|
+
return () => clearTimeout(showInfoBoxTimeout.current);
|
|
25
|
+
}, []);
|
|
26
|
+
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
Waiting,
|
|
29
|
+
{
|
|
30
|
+
heading: isGuestMode ? "Creating Guest Account" : (embedded == null ? void 0 : embedded.isGuestMode) ? hideWallets ? "Linking Guest Account" : "Linking Guest Wallet" : hideWallets ? "Creating Your Account" : "Creating Your Wallet",
|
|
31
|
+
subheading: "This should only take a couple of seconds."
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
showInfoBox && /* @__PURE__ */ jsx(CpslInfoBox, { children: /* @__PURE__ */ jsxs(InfoBoxContent, { children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(InfoBoxHeader, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(CpslIcon, { icon: "clock" }),
|
|
37
|
+
/* @__PURE__ */ jsx(CpslText, { weight: "medium", children: "Hang on" })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ jsxs(CpslText, { variant: "bodyS", weight: "medium", color: "secondary", children: [
|
|
40
|
+
"Creating your ",
|
|
41
|
+
hideWallets ? "account" : "wallet",
|
|
42
|
+
" is taking a little longer than expected, but we're working on it!"
|
|
43
|
+
] })
|
|
44
|
+
] }) })
|
|
45
|
+
] });
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
AwaitingWalletCreationStep
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BiometricCreationStep: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslButton, CpslDivider, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
|
|
5
|
+
import { useModalStore } from "../../stores/index.js";
|
|
6
|
+
import { InnerStepContainer, StepContainer, Heading, QRContainer } from "../common.js";
|
|
7
|
+
import { useCopyToClipboard, UserIdentifier } from "@getpara/react-common";
|
|
8
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
9
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
10
|
+
import { AuthMethod } from "@getpara/web-sdk";
|
|
11
|
+
import { useStore } from "../../../provider/stores/useStore.js";
|
|
12
|
+
const BiometricCreationStep = () => {
|
|
13
|
+
const para = useInternalClient();
|
|
14
|
+
const authInfo = para.authInfo;
|
|
15
|
+
const appName = useStore((state) => state.appName);
|
|
16
|
+
const { presentSignupUi } = useAuthActions();
|
|
17
|
+
const signupState = useModalStore((state) => state.getSignupState());
|
|
18
|
+
const authStepRoute = useModalStore((state) => state.authStepRoute);
|
|
19
|
+
const [isCopied, copy] = useCopyToClipboard();
|
|
20
|
+
const handleCopy = () => {
|
|
21
|
+
if (signupState == null ? void 0 : signupState.passkeyUrl) {
|
|
22
|
+
copy(signupState.passkeyUrl);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const onClick = (method) => () => {
|
|
26
|
+
presentSignupUi(method, signupState);
|
|
27
|
+
};
|
|
28
|
+
const isBoth = !!(signupState == null ? void 0 : signupState.passkeyUrl) && !!(signupState == null ? void 0 : signupState.passwordUrl);
|
|
29
|
+
if (!signupState) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
33
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: para.isExternalWalletAuth ? `Finish setup for your${appName ? ` ${appName}` : ""} wallet` : isBoth ? "Secure Your Account" : "Create Passkey" }),
|
|
35
|
+
/* @__PURE__ */ jsx(UserIdentifier, { authInfo }),
|
|
36
|
+
/* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "secondary", weight: "medium", children: isBoth ? "Choose a password or set up a passkey" : "Your Passkey keeps your account safe." })
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
39
|
+
(signupState == null ? void 0 : signupState.isPasskeySupported) ? /* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: onClick(AuthMethod.PASSKEY), children: [
|
|
40
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
41
|
+
isBoth ? "Create Passkey" : "Create"
|
|
42
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(CpslText, { weight: "semiBold", children: "Scan with your mobile device" }),
|
|
44
|
+
/* @__PURE__ */ jsx(QRContainer, { children: !(signupState == null ? void 0 : signupState.passkeyUrl) ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: signupState.passkeyUrl }) }),
|
|
45
|
+
/* @__PURE__ */ jsxs(CpslButton, { size: "small", variant: "ghost", onClick: handleCopy, children: [
|
|
46
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isCopied ? "check" : "copy" }),
|
|
47
|
+
isCopied ? "Copied" : "Copy Link"
|
|
48
|
+
] })
|
|
49
|
+
] }),
|
|
50
|
+
isBoth && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsx(CpslDivider, { children: "or" }),
|
|
52
|
+
/* @__PURE__ */ jsxs(CpslButton, { fullWidth: true, onClick: onClick(AuthMethod.PASSWORD), disabled: !!authStepRoute, children: [
|
|
53
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "passcode" }),
|
|
54
|
+
"Choose Password"
|
|
55
|
+
] })
|
|
56
|
+
] })
|
|
57
|
+
] })
|
|
58
|
+
] });
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
BiometricCreationStep
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BiometricLoginStep: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CpslButton, CpslDivider, CpslIcon } from "@getpara/react-components";
|
|
5
|
+
import { useModalStore } from "../../stores/index.js";
|
|
6
|
+
import { Heading, StepContainer, InnerStepContainer } from "../common.js";
|
|
7
|
+
import { safeStyled } from "@getpara/react-common";
|
|
8
|
+
import { AuthMethod } from "@getpara/web-sdk";
|
|
9
|
+
import { KnownDevices, UserIdentifier } from "@getpara/react-common";
|
|
10
|
+
import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
|
|
11
|
+
import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
|
|
12
|
+
const BiometricLoginStep = () => {
|
|
13
|
+
var _a;
|
|
14
|
+
const loginState = useModalStore((state) => state.getLoginState());
|
|
15
|
+
const para = useInternalClient();
|
|
16
|
+
const { biometricHints, presentLoginUi } = useAuthActions();
|
|
17
|
+
if (!loginState) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const { passkeyUrl, passkeyKnownDeviceUrl, passwordUrl, isPasskeySupported } = loginState;
|
|
21
|
+
const { isOnKnownDevice = false, formattedHints } = biometricHints || {};
|
|
22
|
+
const isPasskey = !!passkeyUrl, isPassword = !!passwordUrl, isNeither = !isPasskey && !isPassword, hasHints = (_a = formattedHints == null ? void 0 : formattedHints.length) != null ? _a : 0 > 0, isPasskeyOnKnownDevice = isPasskeySupported && isOnKnownDevice, isPasskeyUnavailable = hasHints && !isOnKnownDevice || !isPasskeySupported || isNeither, displayKnownDevices = isPasskeyUnavailable && !!biometricHints && (hasHints || !!passkeyKnownDeviceUrl), displayWelcomeBack = isPasskeyOnKnownDevice || isPassword;
|
|
23
|
+
return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
|
|
24
|
+
/* @__PURE__ */ jsxs(InnerStepContainer, { children: [
|
|
25
|
+
displayWelcomeBack && /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Welcome back," }),
|
|
26
|
+
/* @__PURE__ */ jsx(UserIdentifier, { authInfo: para.authInfo })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxs(MainContainer, { children: [
|
|
29
|
+
isPassword && /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: () => presentLoginUi(AuthMethod.PASSWORD, loginState), children: "Login" }),
|
|
30
|
+
isPasskey && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
+
displayKnownDevices && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
|
+
/* @__PURE__ */ jsx(KnownDevices, { hints: biometricHints, link: passkeyKnownDeviceUrl }),
|
|
33
|
+
/* @__PURE__ */ jsx(CpslDivider, { children: "or" })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ jsx(CpslButton, { fullWidth: true, onClick: () => presentLoginUi(AuthMethod.PASSKEY, loginState), children: isPasskeyUnavailable ? "Continue anyway" : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "key" }),
|
|
37
|
+
"Login with passkey"
|
|
38
|
+
] }) })
|
|
39
|
+
] })
|
|
40
|
+
] })
|
|
41
|
+
] });
|
|
42
|
+
};
|
|
43
|
+
const MainContainer = safeStyled(InnerStepContainer)`
|
|
44
|
+
gap: 16px;
|
|
45
|
+
`;
|
|
46
|
+
export {
|
|
47
|
+
BiometricLoginStep
|
|
48
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "../../../chunk-MMUBH76A.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { safeStyled } from "@getpara/react-common";
|
|
7
|
+
const AnimatedHeightWrapper = ({ children, className }) => {
|
|
8
|
+
const containerRef = useRef(null);
|
|
9
|
+
const [height, setHeight] = useState("auto");
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (containerRef.current) {
|
|
12
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
13
|
+
const observedHeight = entries[0].contentRect.height;
|
|
14
|
+
setHeight(observedHeight);
|
|
15
|
+
});
|
|
16
|
+
resizeObserver.observe(containerRef.current);
|
|
17
|
+
return () => {
|
|
18
|
+
resizeObserver.disconnect();
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}, []);
|
|
22
|
+
return /* @__PURE__ */ jsx(Container, { className, style: { height }, animate: { height }, transition: { duration: 0.2 }, children: /* @__PURE__ */ jsx("div", { ref: containerRef, children }) });
|
|
23
|
+
};
|
|
24
|
+
const Container = safeStyled(motion.div)`
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
`;
|
|
27
|
+
export {
|
|
28
|
+
AnimatedHeightWrapper
|
|
29
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TOAuthMethod } from '@getpara/web-sdk';
|
|
2
|
+
interface BodyProps {
|
|
3
|
+
oAuthMethods?: TOAuthMethod[];
|
|
4
|
+
twoFactorAuthEnabled?: boolean;
|
|
5
|
+
disableEmailLogin: boolean;
|
|
6
|
+
disablePhoneLogin: boolean;
|
|
7
|
+
isGuestModeEnabled?: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Body: ({ oAuthMethods, twoFactorAuthEnabled, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, onClose, }: BodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|