@getpara/react-sdk 2.0.0-dev.2 → 2.0.0-dev.3

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