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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/{modal/components/AddFunds/MoonPayEmbed.js → MoonPayEmbed-Q2HP2BFI.js} +3 -1
  2. package/dist/MoonPayEmbed-Q2HP2BFI.js.br +0 -0
  3. package/dist/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
  4. package/dist/chunk-MMUBH76A.js.br +0 -0
  5. package/dist/chunk-MMUBH76A.js.gz +0 -0
  6. package/dist/index.js +6659 -6
  7. package/dist/index.js.br +0 -0
  8. package/dist/index.js.gz +0 -0
  9. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +1 -0
  10. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +2 -1
  11. package/dist/modal/components/common.d.ts +4 -0
  12. package/dist/modal/index.d.ts +1 -0
  13. package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +13 -0
  14. package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +11 -0
  15. package/dist/modal/providers/ExternalWalletContext.d.ts +15 -1
  16. package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +11 -0
  17. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +2 -0
  18. package/dist/modal/types/commonTypes.d.ts +12 -2
  19. package/dist/modal/types/externalWallets.d.ts +2 -0
  20. package/dist/modal/types/modalProps.d.ts +6 -0
  21. package/dist/modal/utils/steps.d.ts +2 -0
  22. package/dist/provider/utils/constants.d.ts +5 -0
  23. package/package.json +5 -5
  24. package/dist/modal/ParaModal.js +0 -337
  25. package/dist/modal/components/Account/Account.js +0 -69
  26. package/dist/modal/components/AddFunds/AddFunds.js +0 -220
  27. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
  28. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
  29. package/dist/modal/components/AddFunds/index.js +0 -4
  30. package/dist/modal/components/AuthInput/AuthInput.js +0 -283
  31. package/dist/modal/components/AuthInput/countryCodes.js +0 -42
  32. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  33. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  34. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
  35. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
  36. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
  37. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  38. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  39. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  40. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
  41. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -52
  42. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
  43. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  44. package/dist/modal/components/Body/Body.js +0 -304
  45. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
  46. package/dist/modal/components/ChainSwitch/config.js +0 -17
  47. package/dist/modal/components/Controls/Controls.js +0 -74
  48. package/dist/modal/components/Controls/Selects.js +0 -213
  49. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -151
  50. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  51. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
  52. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -123
  53. package/dist/modal/components/Footer/Footer.js +0 -93
  54. package/dist/modal/components/Header/Header.js +0 -43
  55. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
  56. package/dist/modal/components/Hero/Hero.js +0 -122
  57. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
  58. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
  59. package/dist/modal/components/ModalContent/ModalContent.js +0 -310
  60. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
  61. package/dist/modal/components/OAuth/OAuth.js +0 -153
  62. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
  63. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  64. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  65. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
  66. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
  67. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
  68. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
  69. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
  70. package/dist/modal/components/Waiting/Waiting.js +0 -17
  71. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  72. package/dist/modal/components/WalletCard/WalletCard.js +0 -127
  73. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
  74. package/dist/modal/components/common.js +0 -83
  75. package/dist/modal/components/index.js +0 -2
  76. package/dist/modal/constants/constants.js +0 -111
  77. package/dist/modal/constants/defaults.js +0 -10
  78. package/dist/modal/constants/oAuthLogos.js +0 -24
  79. package/dist/modal/hooks/useActiveWallet.js +0 -15
  80. package/dist/modal/hooks/useCreateAccount.js +0 -72
  81. package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -39
  82. package/dist/modal/hooks/useGoBack.js +0 -35
  83. package/dist/modal/hooks/useSetLoginURLs.js +0 -45
  84. package/dist/modal/index.js +0 -32
  85. package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -34
  86. package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -38
  87. package/dist/modal/providers/ExternalWalletContext.js +0 -275
  88. package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -19
  89. package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
  90. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -20
  91. package/dist/modal/stores/index.js +0 -4
  92. package/dist/modal/stores/modal/actions.js +0 -70
  93. package/dist/modal/stores/modal/useModalStore.js +0 -65
  94. package/dist/modal/stores/theme/actions.js +0 -28
  95. package/dist/modal/stores/theme/useThemeStore.js +0 -21
  96. package/dist/modal/stores/userInfo/actions.js +0 -30
  97. package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
  98. package/dist/modal/types/commonTypes.js +0 -1
  99. package/dist/modal/types/externalWallets.js +0 -31
  100. package/dist/modal/types/modalProps.js +0 -12
  101. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  102. package/dist/modal/utils/getMailtoLink.js +0 -10
  103. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  104. package/dist/modal/utils/openPopup.js +0 -60
  105. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  106. package/dist/modal/utils/steps.js +0 -228
  107. package/dist/modal/utils/stringFormatters.js +0 -14
  108. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  109. package/dist/provider/ParaProvider.js +0 -22
  110. package/dist/provider/actions/checkIfUserExists.js +0 -21
  111. package/dist/provider/actions/createUser.js +0 -26
  112. package/dist/provider/actions/getAccount.js +0 -22
  113. package/dist/provider/actions/getWallet.js +0 -14
  114. package/dist/provider/actions/initiateLogin.js +0 -20
  115. package/dist/provider/actions/keepSessionAlive.js +0 -20
  116. package/dist/provider/actions/logout.js +0 -17
  117. package/dist/provider/actions/signMessage.js +0 -20
  118. package/dist/provider/actions/signTransaction.js +0 -20
  119. package/dist/provider/actions/waitForAccountCreation.js +0 -21
  120. package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
  121. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
  122. package/dist/provider/hooks/index.js +0 -4
  123. package/dist/provider/hooks/mutations/index.js +0 -24
  124. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
  125. package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
  126. package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
  127. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
  128. package/dist/provider/hooks/mutations/useLogout.js +0 -30
  129. package/dist/provider/hooks/mutations/useSignMessage.js +0 -33
  130. package/dist/provider/hooks/mutations/useSignTransaction.js +0 -33
  131. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
  132. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
  133. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
  134. package/dist/provider/hooks/queries/index.js +0 -8
  135. package/dist/provider/hooks/queries/useAccount.js +0 -21
  136. package/dist/provider/hooks/queries/useWallet.js +0 -22
  137. package/dist/provider/hooks/utils/index.js +0 -10
  138. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  139. package/dist/provider/hooks/utils/useClient.js +0 -10
  140. package/dist/provider/hooks/utils/useEventListeners.js +0 -105
  141. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  142. package/dist/provider/hooks/utils/useModal.js +0 -17
  143. package/dist/provider/hooks/utils/useWalletState.js +0 -33
  144. package/dist/provider/index.js +0 -8
  145. package/dist/provider/stores/getters.js +0 -13
  146. package/dist/provider/stores/slices/client.js +0 -9
  147. package/dist/provider/stores/slices/index.js +0 -4
  148. package/dist/provider/stores/slices/modal.js +0 -9
  149. package/dist/provider/stores/slices/wallet.js +0 -11
  150. package/dist/provider/stores/types.js +0 -1
  151. package/dist/provider/stores/useStore.js +0 -27
  152. package/dist/provider/types/provider.js +0 -1
  153. package/dist/provider/types/query.js +0 -1
  154. package/dist/provider/types/utils.js +0 -1
  155. package/dist/provider/utils/renameMutations.js +0 -16
@@ -1,93 +0,0 @@
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
- };
@@ -1,43 +0,0 @@
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
- };
@@ -1,50 +0,0 @@
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
- };
@@ -1,122 +0,0 @@
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
- };
@@ -1,55 +0,0 @@
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
- };
@@ -1,28 +0,0 @@
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
- };