@getpara/react-sdk 1.6.0 → 1.6.1-dev.0

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.
Files changed (142) hide show
  1. package/dist/index.js +6 -6367
  2. package/dist/modal/ParaModal.js +337 -0
  3. package/dist/modal/components/Account/Account.js +69 -0
  4. package/dist/modal/components/AddFunds/AddFunds.js +220 -0
  5. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +72 -0
  6. package/dist/modal/components/AddFunds/AddFundsDone.js +43 -0
  7. package/dist/{MoonPayEmbed-Q2HP2BFI.js → modal/components/AddFunds/MoonPayEmbed.js} +1 -3
  8. package/dist/modal/components/AddFunds/index.js +4 -0
  9. package/dist/modal/components/AuthInput/AuthInput.js +283 -0
  10. package/dist/modal/components/AuthInput/countryCodes.js +42 -0
  11. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +33 -0
  12. package/dist/modal/components/AuthInput/phoneMasks.js +253 -0
  13. package/dist/modal/components/AuthMainStep/AuthMainStep.js +37 -0
  14. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +113 -0
  15. package/dist/modal/components/AuthOptions/AuthOptions.js +33 -0
  16. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +18 -0
  17. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +10 -0
  18. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +18 -0
  19. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +44 -0
  20. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +52 -0
  21. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +93 -0
  22. package/dist/modal/components/Body/AnimatedHeightWrapper.js +29 -0
  23. package/dist/modal/components/Body/Body.js +304 -0
  24. package/dist/modal/components/ChainSwitch/ChainSwitch.js +94 -0
  25. package/dist/modal/components/ChainSwitch/config.js +17 -0
  26. package/dist/modal/components/Controls/Controls.js +74 -0
  27. package/dist/modal/components/Controls/Selects.js +213 -0
  28. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +151 -0
  29. package/dist/modal/components/ExternalWalletStep/config.js +17 -0
  30. package/dist/modal/components/ExternalWallets/ExternalWallets.js +172 -0
  31. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +123 -0
  32. package/dist/modal/components/Footer/Footer.js +93 -0
  33. package/dist/modal/components/Header/Header.js +43 -0
  34. package/dist/modal/components/Header/hooks/useStepTitle.js +50 -0
  35. package/dist/modal/components/Hero/Hero.js +122 -0
  36. package/dist/modal/components/IFrameStep/IFrameStep.js +55 -0
  37. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +28 -0
  38. package/dist/modal/components/ModalContent/ModalContent.js +310 -0
  39. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +81 -0
  40. package/dist/modal/components/OAuth/OAuth.js +153 -0
  41. package/dist/modal/components/OAuth/TelegramOAuthStep.js +139 -0
  42. package/dist/modal/components/OnRampComponents/AddingFunds.js +23 -0
  43. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +77 -0
  44. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +101 -0
  45. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +141 -0
  46. package/dist/modal/components/StripeComponents/StripeComponents.js +88 -0
  47. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +24 -0
  48. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +159 -0
  49. package/dist/modal/components/Waiting/Waiting.js +17 -0
  50. package/dist/modal/components/WalletCard/PartnerIcon.js +34 -0
  51. package/dist/modal/components/WalletCard/WalletCard.js +127 -0
  52. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +52 -0
  53. package/dist/modal/components/common.js +83 -0
  54. package/dist/modal/components/index.js +2 -0
  55. package/dist/modal/constants/constants.js +111 -0
  56. package/dist/modal/constants/defaults.js +10 -0
  57. package/dist/modal/constants/oAuthLogos.js +24 -0
  58. package/dist/modal/hooks/useActiveWallet.js +15 -0
  59. package/dist/modal/hooks/useCreateAccount.js +72 -0
  60. package/dist/modal/hooks/useEmbeddedExternalConnection.js +39 -0
  61. package/dist/modal/hooks/useGoBack.js +35 -0
  62. package/dist/modal/hooks/useSetLoginURLs.d.ts +8 -0
  63. package/dist/modal/hooks/useSetLoginURLs.js +45 -0
  64. package/dist/modal/index.js +32 -0
  65. package/dist/modal/providers/CosmosExternalWalletContextStub.js +34 -0
  66. package/dist/modal/providers/EvmExternalWalletContextStub.js +38 -0
  67. package/dist/modal/providers/ExternalWalletContext.js +275 -0
  68. package/dist/modal/providers/SolanaExternalWalletContextStub.js +19 -0
  69. package/dist/modal/stores/externalWalletProvider/actions.js +10 -0
  70. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +20 -0
  71. package/dist/modal/stores/index.js +4 -0
  72. package/dist/modal/stores/modal/actions.js +70 -0
  73. package/dist/modal/stores/modal/useModalStore.js +65 -0
  74. package/dist/modal/stores/theme/actions.js +28 -0
  75. package/dist/modal/stores/theme/useThemeStore.js +21 -0
  76. package/dist/modal/stores/userInfo/actions.js +30 -0
  77. package/dist/modal/stores/userInfo/useUserInfoStore.js +17 -0
  78. package/dist/modal/types/commonTypes.js +1 -0
  79. package/dist/modal/types/externalWallets.js +31 -0
  80. package/dist/modal/types/modalProps.js +12 -0
  81. package/dist/modal/utils/authLayoutHelpers.js +8 -0
  82. package/dist/modal/utils/getMailtoLink.js +10 -0
  83. package/dist/modal/utils/getTileButtonFlex.js +20 -0
  84. package/dist/modal/utils/openPopup.js +60 -0
  85. package/dist/modal/utils/routeMobileExternalWallet.js +31 -0
  86. package/dist/modal/utils/steps.js +228 -0
  87. package/dist/modal/utils/stringFormatters.js +14 -0
  88. package/dist/modal/utils/validateOnRampConfig.js +32 -0
  89. package/dist/provider/ParaProvider.js +22 -0
  90. package/dist/provider/actions/checkIfUserExists.js +21 -0
  91. package/dist/provider/actions/createUser.js +26 -0
  92. package/dist/provider/actions/getAccount.js +22 -0
  93. package/dist/provider/actions/getWallet.js +14 -0
  94. package/dist/provider/actions/initiateLogin.js +20 -0
  95. package/dist/provider/actions/keepSessionAlive.js +20 -0
  96. package/dist/provider/actions/logout.js +17 -0
  97. package/dist/provider/actions/signMessage.js +20 -0
  98. package/dist/provider/actions/signTransaction.js +20 -0
  99. package/dist/provider/actions/waitForAccountCreation.js +21 -0
  100. package/dist/provider/actions/waitForLoginAndSetup.js +24 -0
  101. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +21 -0
  102. package/dist/provider/hooks/index.js +4 -0
  103. package/dist/provider/hooks/mutations/index.js +24 -0
  104. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +23 -0
  105. package/dist/provider/hooks/mutations/useCreateUser.js +20 -0
  106. package/dist/provider/hooks/mutations/useInitiateLogin.js +23 -0
  107. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +20 -0
  108. package/dist/provider/hooks/mutations/useLogout.js +30 -0
  109. package/dist/provider/hooks/mutations/useSignMessage.js +33 -0
  110. package/dist/provider/hooks/mutations/useSignTransaction.js +33 -0
  111. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +30 -0
  112. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +30 -0
  113. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +30 -0
  114. package/dist/provider/hooks/queries/index.js +8 -0
  115. package/dist/provider/hooks/queries/useAccount.js +21 -0
  116. package/dist/provider/hooks/queries/useWallet.js +22 -0
  117. package/dist/provider/hooks/utils/index.js +10 -0
  118. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +74 -0
  119. package/dist/provider/hooks/utils/useClient.js +10 -0
  120. package/dist/provider/hooks/utils/useEventListeners.js +105 -0
  121. package/dist/provider/hooks/utils/useInternalClient.js +10 -0
  122. package/dist/provider/hooks/utils/useModal.js +17 -0
  123. package/dist/provider/hooks/utils/useWalletState.js +33 -0
  124. package/dist/provider/index.js +8 -0
  125. package/dist/provider/stores/getters.js +13 -0
  126. package/dist/provider/stores/slices/client.js +9 -0
  127. package/dist/provider/stores/slices/index.js +4 -0
  128. package/dist/provider/stores/slices/modal.js +9 -0
  129. package/dist/provider/stores/slices/wallet.js +11 -0
  130. package/dist/provider/stores/types.js +1 -0
  131. package/dist/provider/stores/useStore.js +27 -0
  132. package/dist/provider/types/provider.js +1 -0
  133. package/dist/provider/types/query.js +1 -0
  134. package/dist/provider/types/utils.js +1 -0
  135. package/dist/provider/utils/renameMutations.js +16 -0
  136. package/package.json +2 -2
  137. package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
  138. package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
  139. package/dist/chunk-MMUBH76A.js.br +0 -0
  140. package/dist/chunk-MMUBH76A.js.gz +0 -0
  141. package/dist/index.js.br +0 -0
  142. package/dist/index.js.gz +0 -0
@@ -0,0 +1,93 @@
1
+ "use client";
2
+ import "../../../chunk-MMUBH76A.js";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { styled } from "styled-components";
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
+ const Footer = () => {
11
+ const isAccount = useModalStore((state) => state.isAccount());
12
+ const currentStep = useModalStore((state) => state.step);
13
+ const showFooter = isAccount || getStepHasFooter(currentStep);
14
+ const Content = useMemo(() => {
15
+ if (isAccount) {
16
+ return /* @__PURE__ */ jsxs(ConnectContainer, { children: [
17
+ /* @__PURE__ */ jsxs(ConnectText, { variant: "bodyS", color: "secondary", weight: "medium", children: [
18
+ "Access all your wallet\u2019s features at",
19
+ " ",
20
+ /* @__PURE__ */ jsx("a", { href: PARA_CONNECT, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "bodyS", weight: "medium", children: "Para Connect" }) })
21
+ ] }),
22
+ /* @__PURE__ */ jsx(CpslButton, { as: "a", href: PARA_CONNECT, target: "blank", variant: "ghost", children: /* @__PURE__ */ jsx(RightChevron, { icon: "chevronUp" }) })
23
+ ] });
24
+ }
25
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ /* @__PURE__ */ jsxs(InlineText, { variant: "body2XS", color: "secondary", weight: "medium", children: [
27
+ "By logging in you agree to our",
28
+ " ",
29
+ /* @__PURE__ */ jsx("a", { href: PARA_TERMS_AND_CONDITIONS, target: "blank", children: /* @__PURE__ */ jsx(ClickableText, { variant: "body2XS", weight: "medium", children: "Terms & Conditions" }) })
30
+ ] }),
31
+ /* @__PURE__ */ jsxs(PoweredByContainer, { children: [
32
+ /* @__PURE__ */ jsx(InlineText, { variant: "bodyS", color: "secondary", weight: "medium", children: "Powered by" }),
33
+ /* @__PURE__ */ jsx(ParaLogo, { icon: "para" })
34
+ ] })
35
+ ] });
36
+ }, [isAccount]);
37
+ if (!showFooter) {
38
+ return null;
39
+ }
40
+ return /* @__PURE__ */ jsx(FooterContainer, { slot: "footer", children: /* @__PURE__ */ jsx(FooterContentContainer, { children: Content }) });
41
+ };
42
+ const FooterContainer = styled.div`
43
+ display: flex;
44
+ flex-direction: column;
45
+ align-items: center;
46
+ gap: 16px;
47
+ padding: 8px 0px;
48
+ `;
49
+ const FooterContentContainer = styled.div`
50
+ display: flex;
51
+ flex-direction: column;
52
+ align-items: center;
53
+ gap: 8px;
54
+ `;
55
+ const PoweredByContainer = styled.div`
56
+ display: flex;
57
+ gap: 5px;
58
+ align-items: center;
59
+ justify-content: center;
60
+ `;
61
+ const ConnectContainer = styled.div`
62
+ display: flex;
63
+ gap: 8px;
64
+ align-items: center;
65
+ justify-content: center;
66
+ `;
67
+ const RightChevron = styled(CpslIcon)`
68
+ transform: rotate(90deg);
69
+
70
+ /* --icon-color: var(--cpsl-color-text-tertiary); */
71
+ --height: 24px;
72
+ --width: 24px;
73
+ `;
74
+ const InlineText = styled(CpslText)`
75
+ text-align: center;
76
+ display: inline-block;
77
+ `;
78
+ const ConnectText = styled(InlineText)`
79
+ line-height: 20px;
80
+ `;
81
+ const ClickableText = styled(InlineText)`
82
+ cursor: pointer;
83
+ display: inline-block;
84
+ `;
85
+ const ParaLogo = styled(CpslIcon)`
86
+ display: inline-block;
87
+ --icon-color: var(--cpsl-color-text-secondary);
88
+ --width: 49px;
89
+ --height: auto;
90
+ `;
91
+ export {
92
+ Footer
93
+ };
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import "../../../chunk-MMUBH76A.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { styled } from "styled-components";
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 = styled(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,50 @@
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 "../../../providers/ExternalWalletContext.js";
7
+ import { useThemeStore } from "../../../stores/index.js";
8
+ const useStepTitle = () => {
9
+ const hideWallets = useThemeStore((state) => state.hideWallets);
10
+ const isLogin = useModalStore((state) => state.isLogin());
11
+ const currentStep = useModalStore((state) => state.step);
12
+ const { chainId } = useExternalWallets();
13
+ const titles = useMemo(
14
+ () => ({
15
+ [ModalStep.AUTH_MAIN]: "",
16
+ [ModalStep.AUTH_MORE]: "Sign Up or Log In",
17
+ [ModalStep.EX_WALLET_MORE]: "Connect Wallet",
18
+ [ModalStep.VERIFICATIONS]: "Sign Up",
19
+ [ModalStep.AWAITING_OAUTH]: isLogin ? "Login" : "Sign Up",
20
+ [ModalStep.FARCASTER_OAUTH]: isLogin ? "Login" : "Sign Up",
21
+ [ModalStep.BIOMETRIC_CREATION]: "Sign Up",
22
+ [ModalStep.PASSWORD_CREATION]: "Sign Up",
23
+ [ModalStep.AWAITING_BIOMETRIC_CREATION]: "Sign Up",
24
+ [ModalStep.AWAITING_WALLET_CREATION]: isLogin ? "Login" : "Sign Up",
25
+ [ModalStep.AWAITING_PASSWORD_CREATION]: "Sign Up",
26
+ [ModalStep.WALLET_CREATION_DONE]: hideWallets ? "Account Created" : "Wallet Created",
27
+ [ModalStep.SECRET]: isLogin ? "Login" : "Sign Up",
28
+ [ModalStep.BIOMETRIC_LOGIN]: "Login",
29
+ [ModalStep.AWAITING_PASSWORD_LOGIN]: "Login",
30
+ [ModalStep.AWAITING_BIOMETRIC_LOGIN]: "Login",
31
+ [ModalStep.LOGIN_DONE]: "",
32
+ [ModalStep.SETUP_2FA]: "2FA",
33
+ [ModalStep.VERIFY_2FA]: "2FA",
34
+ [ModalStep.TWO_FACTOR_DONE]: "2FA",
35
+ [ModalStep.ADD_FUNDS_BUY]: "",
36
+ [ModalStep.ADD_FUNDS_RECEIVE]: "",
37
+ [ModalStep.ADD_FUNDS_WITHDRAW]: "",
38
+ [ModalStep.ADD_FUNDS_AWAITING]: "",
39
+ [ModalStep.ADD_FUNDS_SUCCESS]: "",
40
+ [ModalStep.ADD_FUNDS_FAILURE]: "",
41
+ [ModalStep.ACCOUNT_MAIN]: "",
42
+ [ModalStep.CHAIN_SWITCH]: ""
43
+ }),
44
+ [isLogin, chainId, hideWallets]
45
+ );
46
+ return { title: titles[currentStep] };
47
+ };
48
+ export {
49
+ useStepTitle
50
+ };
@@ -0,0 +1,122 @@
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 styled from "styled-components";
6
+ import { ModalStep } from "../../utils/steps.js";
7
+ import { useModalStore } from "../../stores/index.js";
8
+ import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
9
+ import { NETWORK_NOT_SUPPORTED_ERROR } from "../../constants/constants.js";
10
+ import { useEffect, useState } from "react";
11
+ import { isMobile } from "@getpara/web-sdk";
12
+ import { useActiveWallet } from "../../hooks/useActiveWallet.js";
13
+ import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.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.ACCOUNT_MAIN]: {
32
+ variant: "customContent",
33
+ topOffset: 0,
34
+ spacerHeight: 104,
35
+ hideFadeOut: true
36
+ },
37
+ [ModalStep.FARCASTER_OAUTH]: {
38
+ variant: "externalWalletConnection",
39
+ topOffset: 40,
40
+ spacerHeight: 158,
41
+ hideFadeOut: true
42
+ }
43
+ };
44
+ };
45
+ const Hero = () => {
46
+ const para = useInternalClient();
47
+ const { wallet: connector, walletDisplayHelpers, avatar } = useExternalWallets();
48
+ const step = useModalStore((state) => state.step);
49
+ const externalWalletError = useModalStore((state) => state.externalWalletError);
50
+ const activeWallet = useActiveWallet();
51
+ const [currentStep, setCurrentStep] = useState(step);
52
+ const stepConfig = getStepConfig({
53
+ externalWalletError
54
+ })[currentStep];
55
+ useEffect(() => {
56
+ const prevStepConfig = getStepConfig({
57
+ externalWalletError
58
+ })[currentStep];
59
+ const newStepConfig = getStepConfig({
60
+ externalWalletError
61
+ })[step];
62
+ const delay = newStepConfig && prevStepConfig ? 0 : newStepConfig && !prevStepConfig ? 0 : 200;
63
+ setTimeout(() => {
64
+ setCurrentStep(step);
65
+ }, delay);
66
+ }, [step]);
67
+ const isExternalStep = currentStep === ModalStep.EX_WALLET_SELECTED;
68
+ const isChainSwitchStep = currentStep === ModalStep.CHAIN_SWITCH;
69
+ const isAccountStep = currentStep === ModalStep.ACCOUNT_MAIN;
70
+ const isFarcasterStep = currentStep === ModalStep.FARCASTER_OAUTH;
71
+ const { showExtension, isCosmosMobileWallet } = walletDisplayHelpers;
72
+ const shouldHide = !stepConfig || !isMobile() && isExternalStep && !showExtension || !isMobile() && isChainSwitchStep && isCosmosMobileWallet || !isMobile() && isFarcasterStep;
73
+ const { variant, topOffset, spacerHeight, hideFadeOut } = stepConfig != null ? stepConfig : {};
74
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
75
+ /* @__PURE__ */ jsx(Container, { $top: -45 + topOffset, children: shouldHide ? null : /* @__PURE__ */ jsxs(StyledHero, { $isAccount: isAccountStep, hideFadeOut, variant, height: 480, withDefaultTheme: true, children: [
76
+ (isExternalStep || isChainSwitchStep) && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", src: connector == null ? void 0 : connector.iconUrl }),
77
+ isFarcasterStep && /* @__PURE__ */ jsx(WalletLogo, { slot: "connectionLeft", icon: "farcasterBrand" }),
78
+ 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)
79
+ ] }) }),
80
+ !shouldHide && /* @__PURE__ */ jsx(Spacer, { $height: spacerHeight })
81
+ ] });
82
+ };
83
+ const Container = styled.div`
84
+ display: flex;
85
+ position: absolute;
86
+ justify-content: center;
87
+ align-items: center;
88
+ width: 100%;
89
+
90
+ top: ${({ $top }) => `${$top}px`};
91
+ `;
92
+ const Spacer = styled.div`
93
+ height: ${({ $height }) => `${$height}px`};
94
+ `;
95
+ const WalletLogo = styled(CpslIcon)`
96
+ --height: 60px;
97
+ --width: 60px;
98
+ `;
99
+ const Avatar = styled.img`
100
+ width: 100%;
101
+ height: 100%;
102
+ object-fit: contain;
103
+ `;
104
+ const IconAvatar = styled(CpslIdenticon)`
105
+ border-radius: 1000px;
106
+ `;
107
+ const StyledHero = styled(CpslHero)`
108
+ ${({ $isAccount }) => $isAccount && `
109
+ --ring-3-size: 560px;
110
+ --ring-2-size: 402px;
111
+ --ring-1-size: 228px;
112
+ --ring-0-size: 104px;
113
+
114
+ --default-theme-ring-3-opacity: 0.02;
115
+ --default-theme-ring-2-opacity: 0.04;
116
+ --default-theme-ring-1-opacity: 0.06;
117
+ --default-theme-ring-0-opacity: 0.1;
118
+ `}
119
+ `;
120
+ export {
121
+ Hero
122
+ };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import "../../../chunk-MMUBH76A.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { useModalStore, useThemeStore } from "../../stores/index.js";
5
+ import { IFrameSteps } from "../../utils/steps.js";
6
+ import styled from "styled-components";
7
+ import { SpinnerContainer } from "@getpara/react-common";
8
+ import { CpslSpinner } from "@getpara/react-components";
9
+ import { MOBILE_SIZE } from "../../constants/constants.js";
10
+ const IFrameStep = () => {
11
+ const iFrameUrl = useModalStore((state) => state.iFrameUrl);
12
+ const setIsReady = useModalStore((state) => state.setIsIFrameReady);
13
+ const isReady = useModalStore((state) => state.isIFrameReady);
14
+ const currentStep = useModalStore((state) => state.step);
15
+ const embeddedModal = useThemeStore((state) => state.embeddedModal);
16
+ return /* @__PURE__ */ jsxs(OuterContainer, { $isVisible: IFrameSteps.includes(currentStep), $embeddedModal: embeddedModal, children: [
17
+ /* @__PURE__ */ jsx(Container, { $isReady: isReady, children: /* @__PURE__ */ jsx(
18
+ "iframe",
19
+ {
20
+ src: iFrameUrl,
21
+ onLoad: () => {
22
+ setIsReady(true);
23
+ }
24
+ }
25
+ ) }),
26
+ !isReady && /* @__PURE__ */ jsx(SpinnerContainer, { style: { width: "100%", height: "100%", flex: 1 }, children: /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) })
27
+ ] });
28
+ };
29
+ const OuterContainer = styled.div`
30
+ height: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
31
+ width: ${({ $isVisible }) => $isVisible ? "100%" : "0px"};
32
+ flex: ${({ $isVisible }) => $isVisible ? 1 : "auto"};
33
+ padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 72px 32px"};
34
+ display: flex;
35
+ align-items: center;
36
+ justify-content: center;
37
+
38
+ @media (max-width: ${MOBILE_SIZE}px) {
39
+ padding: ${({ $embeddedModal, $isVisible }) => !$isVisible ? "0px" : $embeddedModal ? "12px 0px 0px" : "72px 16px 0px"};
40
+ }
41
+ `;
42
+ const Container = styled.div`
43
+ height: 100%;
44
+ width: 100%;
45
+ display: ${({ $isReady }) => $isReady ? "block" : "none"};
46
+
47
+ & > iframe {
48
+ height: 360px;
49
+ width: 100%;
50
+ border: none;
51
+ }
52
+ `;
53
+ export {
54
+ IFrameStep
55
+ };
@@ -0,0 +1,28 @@
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 { useThemeStore } from "../../stores/index.js";
8
+ import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
9
+ const LoginDoneStep = ({ onClose }) => {
10
+ var _a;
11
+ const para = useInternalClient();
12
+ const hideWallets = useThemeStore((state) => state.hideWallets);
13
+ useEffect(() => {
14
+ setTimeout(() => {
15
+ onClose();
16
+ }, 1600);
17
+ }, []);
18
+ return /* @__PURE__ */ jsxs(StepContainer, { children: [
19
+ /* @__PURE__ */ jsx(HeroIcon, { icon: "checkCircleFilled" }),
20
+ /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Connected" }),
21
+ !hideWallets && /* @__PURE__ */ jsx(WalletCards, { children: para.isUsingExternalWallet() ? /* @__PURE__ */ jsx(ExternalWalletCard, { address: (_a = Object.values(para.externalWallets || {})[0]) == null ? void 0 : _a.address }) : para.currentWalletIdsArray.map(([id, type]) => {
22
+ return /* @__PURE__ */ jsx(WalletCard, { id, type }, `${id}-${type}`);
23
+ }) })
24
+ ] });
25
+ };
26
+ export {
27
+ LoginDoneStep
28
+ };