@getpara/react-sdk 1.12.0 → 2.0.0-alpha.5

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 (241) hide show
  1. package/dist/cli/cli.mjs +35 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +5 -0
  4. package/dist/modal/ParaModal.js +211 -313
  5. package/dist/modal/components/Account/Account.js +66 -12
  6. package/dist/modal/components/AddFunds/AddFunds.js +5 -6
  7. package/dist/modal/components/AddFunds/AddFundsAsset.js +15 -13
  8. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +16 -10
  9. package/dist/modal/components/AddFunds/AddFundsContext.d.ts +2 -2
  10. package/dist/modal/components/AddFunds/AddFundsContext.js +20 -14
  11. package/dist/modal/components/AddFunds/AddFundsDone.js +10 -4
  12. package/dist/modal/components/AddFunds/AddFundsProvider.js +11 -7
  13. package/dist/modal/components/AddFunds/AddFundsReceive.js +17 -13
  14. package/dist/modal/components/AddFunds/AddFundsSettings.js +10 -6
  15. package/dist/modal/components/AddFunds/common.d.ts +1 -1
  16. package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
  17. package/dist/modal/components/AuthInput/AuthInput.js +70 -91
  18. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
  19. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +4 -4
  20. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +4 -3
  21. package/dist/modal/components/AuthMainStep/AuthMainStep.js +20 -7
  22. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +4 -3
  23. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +54 -10
  24. package/dist/modal/components/AuthOptions/AuthOptions.d.ts +4 -3
  25. package/dist/modal/components/AuthOptions/AuthOptions.js +42 -8
  26. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +5 -1
  27. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +9 -4
  28. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -3
  29. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +25 -17
  30. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -1
  31. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +34 -72
  32. package/dist/modal/components/Body/Body.d.ts +4 -3
  33. package/dist/modal/components/Body/Body.js +27 -10
  34. package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
  35. package/dist/modal/components/ChainSwitch/ChainSwitch.js +5 -4
  36. package/dist/modal/components/Controls/Controls.js +5 -2
  37. package/dist/modal/components/Controls/Selects.d.ts +1 -1
  38. package/dist/modal/components/Controls/Selects.js +30 -25
  39. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
  40. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +10 -6
  41. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +7 -69
  42. package/dist/modal/components/ExternalWallets/ExternalWallets.js +7 -6
  43. package/dist/modal/components/Footer/Footer.d.ts +1 -1
  44. package/dist/modal/components/Footer/Footer.js +6 -4
  45. package/dist/modal/components/Header/hooks/useStepTitle.js +7 -3
  46. package/dist/modal/components/Hero/Hero.js +5 -5
  47. package/dist/modal/components/IFrameStep/IFrameStep.js +8 -4
  48. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +7 -4
  49. package/dist/modal/components/ModalContent/ModalContent.js +14 -243
  50. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +3 -57
  51. package/dist/modal/components/OAuth/OAuth.d.ts +2 -2
  52. package/dist/modal/components/OAuth/OAuth.js +11 -85
  53. package/dist/modal/components/OAuth/TelegramOAuthStep.js +11 -60
  54. package/dist/modal/components/OnRampComponents/AddingFunds.js +1 -1
  55. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +10 -4
  56. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +23 -32
  57. package/dist/modal/components/StripeComponents/StripeComponents.js +1 -1
  58. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +5 -2
  59. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +44 -60
  60. package/dist/modal/components/WalletCard/WalletCard.d.ts +5 -5
  61. package/dist/modal/components/WalletCard/WalletCard.js +8 -7
  62. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +33 -12
  63. package/dist/modal/components/common.d.ts +5 -5
  64. package/dist/modal/components/common.js +10 -4
  65. package/dist/modal/constants/constants.d.ts +1 -1
  66. package/dist/modal/constants/oAuthLogos.d.ts +3 -3
  67. package/dist/modal/hooks/useGoBack.js +6 -5
  68. package/dist/modal/index.d.ts +0 -3
  69. package/dist/modal/index.js +1 -5
  70. package/dist/modal/stores/index.d.ts +0 -2
  71. package/dist/modal/stores/index.js +0 -2
  72. package/dist/modal/stores/modal/actions.js +69 -16
  73. package/dist/modal/stores/modal/useModalStore.d.ts +26 -22
  74. package/dist/modal/stores/modal/useModalStore.js +9 -13
  75. package/dist/modal/types/commonTypes.d.ts +0 -52
  76. package/dist/modal/types/modalProps.d.ts +8 -32
  77. package/dist/modal/utils/authInputHelpers.d.ts +7 -0
  78. package/dist/modal/utils/authInputHelpers.js +38 -0
  79. package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
  80. package/dist/modal/{components/AuthInput → utils}/countryCodes.js +6 -3
  81. package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
  82. package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
  83. package/dist/modal/utils/isPasskeySupported.js +15 -0
  84. package/dist/modal/utils/openPopup.d.ts +2 -2
  85. package/dist/modal/utils/openPopup.js +2 -2
  86. package/dist/modal/utils/steps.d.ts +6 -0
  87. package/dist/modal/utils/steps.js +15 -0
  88. package/dist/provider/ParaProvider.d.ts +3 -1
  89. package/dist/provider/ParaProvider.js +69 -8
  90. package/dist/provider/actions/getAccount.d.ts +26 -8
  91. package/dist/provider/actions/getAccount.js +42 -14
  92. package/dist/provider/actions/getWallet.d.ts +3 -3
  93. package/dist/provider/actions/index.d.ts +27 -0
  94. package/dist/provider/actions/index.js +59 -0
  95. package/dist/provider/actions/utils.d.ts +3 -0
  96. package/dist/provider/actions/utils.js +15 -0
  97. package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
  98. package/dist/provider/components/CosmosWalletWrapper.js +34 -0
  99. package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
  100. package/dist/provider/components/EvmWalletWrapper.js +34 -0
  101. package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
  102. package/dist/provider/components/ExternalWalletWrapper.js +139 -0
  103. package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
  104. package/dist/provider/components/SolanaWalletWrapper.js +36 -0
  105. package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
  106. package/dist/provider/external/getParaCosmosConnector.js +22 -0
  107. package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
  108. package/dist/provider/external/getParaEvmConnector.js +22 -0
  109. package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
  110. package/dist/provider/external/getParaSolanaConnector.js +22 -0
  111. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +12 -0
  112. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +18 -0
  113. package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
  114. package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +21 -0
  115. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +8 -0
  116. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +14 -0
  117. package/dist/provider/hooks/mutations/index.d.ts +26 -11
  118. package/dist/provider/hooks/mutations/index.js +52 -17
  119. package/dist/provider/hooks/mutations/utils.d.ts +4 -0
  120. package/dist/provider/hooks/mutations/utils.js +22 -0
  121. package/dist/provider/hooks/queries/useAccount.d.ts +1 -7
  122. package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
  123. package/dist/provider/hooks/queries/useWalletBalance.d.ts +1 -2
  124. package/dist/provider/hooks/queries/useWalletBalance.js +40 -11
  125. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +5 -5
  126. package/dist/provider/hooks/utils/useEventListeners.d.ts +1 -1
  127. package/dist/provider/hooks/utils/useEventListeners.js +98 -56
  128. package/dist/provider/hooks/utils/useWalletState.d.ts +5 -4
  129. package/dist/provider/hooks/utils/useWalletState.js +24 -9
  130. package/dist/provider/index.d.ts +1 -0
  131. package/dist/provider/index.js +1 -0
  132. package/dist/provider/providers/AuthProvider.d.ts +35 -0
  133. package/dist/provider/providers/AuthProvider.js +498 -0
  134. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
  135. package/dist/provider/providers/CosmosExternalWalletProvider.js +66 -0
  136. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
  137. package/dist/provider/providers/EvmExternalWalletProvider.js +74 -0
  138. package/dist/provider/providers/ExternalWalletProvider.d.ts +76 -0
  139. package/dist/{modal/providers/ExternalWalletContext.js → provider/providers/ExternalWalletProvider.js} +146 -112
  140. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
  141. package/dist/provider/providers/SolanaExternalWalletProvider.js +66 -0
  142. package/dist/provider/stores/getters.d.ts +3 -3
  143. package/dist/provider/stores/setters.d.ts +1 -0
  144. package/dist/provider/stores/setters.js +7 -0
  145. package/dist/provider/stores/slices/config.d.ts +3 -0
  146. package/dist/provider/stores/slices/config.js +9 -0
  147. package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
  148. package/dist/provider/stores/slices/externalWallets.js +40 -0
  149. package/dist/provider/stores/slices/index.d.ts +1 -0
  150. package/dist/provider/stores/slices/index.js +1 -0
  151. package/dist/provider/stores/slices/modal.js +11 -4
  152. package/dist/provider/stores/types.d.ts +50 -4
  153. package/dist/provider/stores/useStore.js +4 -3
  154. package/dist/provider/types/externalWalletProviders.d.ts +12 -0
  155. package/dist/provider/types/externalWalletProviders.js +1 -0
  156. package/dist/provider/types/provider.d.ts +126 -17
  157. package/dist/provider/types/utils.d.ts +16 -0
  158. package/dist/provider/utils/constants.js +3 -4
  159. package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
  160. package/dist/provider/utils/paraConfigTypeGuards.js +13 -0
  161. package/dist/provider/utils/renameMutations.d.ts +3 -0
  162. package/dist/provider/utils/renameMutations.js +5 -3
  163. package/package.json +20 -8
  164. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -8
  165. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -124
  166. package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
  167. package/dist/modal/hooks/useActiveWallet.js +0 -15
  168. package/dist/modal/hooks/useCreateAccount.d.ts +0 -6
  169. package/dist/modal/hooks/useCreateAccount.js +0 -77
  170. package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
  171. package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -54
  172. package/dist/modal/hooks/useSetLoginURLs.d.ts +0 -8
  173. package/dist/modal/hooks/useSetLoginURLs.js +0 -49
  174. package/dist/modal/hooks/useWalletBalance.d.ts +0 -4
  175. package/dist/modal/hooks/useWalletBalance.js +0 -49
  176. package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -42
  177. package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -38
  178. package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -46
  179. package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -55
  180. package/dist/modal/providers/ExternalWalletContext.d.ts +0 -92
  181. package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -32
  182. package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -32
  183. package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
  184. package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
  185. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -22
  186. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -21
  187. package/dist/modal/stores/theme/actions.d.ts +0 -3
  188. package/dist/modal/stores/theme/actions.js +0 -28
  189. package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
  190. package/dist/modal/stores/theme/useThemeStore.js +0 -21
  191. package/dist/modal/stores/userInfo/actions.d.ts +0 -3
  192. package/dist/modal/stores/userInfo/actions.js +0 -30
  193. package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +0 -19
  194. package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
  195. package/dist/provider/actions/checkIfUserExists.d.ts +0 -9
  196. package/dist/provider/actions/checkIfUserExists.js +0 -21
  197. package/dist/provider/actions/createGuestWallets.d.ts +0 -2
  198. package/dist/provider/actions/createGuestWallets.js +0 -13
  199. package/dist/provider/actions/createUser.d.ts +0 -12
  200. package/dist/provider/actions/createUser.js +0 -26
  201. package/dist/provider/actions/getWalletBalance.d.ts +0 -2
  202. package/dist/provider/actions/getWalletBalance.js +0 -14
  203. package/dist/provider/actions/initiateLogin.d.ts +0 -4
  204. package/dist/provider/actions/initiateLogin.js +0 -20
  205. package/dist/provider/actions/keepSessionAlive.d.ts +0 -2
  206. package/dist/provider/actions/keepSessionAlive.js +0 -20
  207. package/dist/provider/actions/logout.d.ts +0 -2
  208. package/dist/provider/actions/logout.js +0 -17
  209. package/dist/provider/actions/signMessage.d.ts +0 -8
  210. package/dist/provider/actions/signMessage.js +0 -20
  211. package/dist/provider/actions/signTransaction.d.ts +0 -8
  212. package/dist/provider/actions/signTransaction.js +0 -20
  213. package/dist/provider/actions/waitForAccountCreation.d.ts +0 -2
  214. package/dist/provider/actions/waitForAccountCreation.js +0 -21
  215. package/dist/provider/actions/waitForLoginAndSetup.d.ts +0 -6
  216. package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
  217. package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +0 -2
  218. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
  219. package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +0 -13
  220. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
  221. package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +0 -15
  222. package/dist/provider/hooks/mutations/useCreateGuestWallets.js +0 -23
  223. package/dist/provider/hooks/mutations/useCreateUser.d.ts +0 -13
  224. package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
  225. package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +0 -14
  226. package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
  227. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -12
  228. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
  229. package/dist/provider/hooks/mutations/useLogout.d.ts +0 -12
  230. package/dist/provider/hooks/mutations/useLogout.js +0 -30
  231. package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -15
  232. package/dist/provider/hooks/mutations/useSignMessage.js +0 -39
  233. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -14
  234. package/dist/provider/hooks/mutations/useSignTransaction.js +0 -39
  235. package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +0 -12
  236. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
  237. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +0 -14
  238. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
  239. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +0 -13
  240. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
  241. /package/dist/modal/{components/AuthInput → utils}/countryCodes.d.ts +0 -0
@@ -12,44 +12,46 @@ import {
12
12
  CpslSpinner,
13
13
  CpslText
14
14
  } from "@getpara/react-components";
15
- import { useRef, useState } from "react";
15
+ import { useEffect, useMemo, useRef, useState } from "react";
16
16
  import styled from "styled-components";
17
- import countryCodes from "./countryCodes.js";
18
- import { useModalStore, useUserInfoStore } from "../../stores/index.js";
19
- import { EMAIL_REGEX, MOBILE_SIZE } from "../../constants/constants.js";
17
+ import countryCodes from "../../utils/countryCodes.js";
18
+ import { MOBILE_SIZE } from "../../constants/constants.js";
20
19
  import { useDropdownPosition } from "./hooks/useDropdownPosition.js";
21
- import { ModalStep } from "../../utils/steps.js";
22
20
  import { defaultPhoneMask, phoneMasks } from "./phoneMasks.js";
23
- import { AuthMethod } from "@getpara/web-sdk";
24
21
  import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
25
- import { useSetLoginURLs } from "../../hooks/useSetLoginURLs.js";
22
+ import parsePhoneNumberFromString from "libphonenumber-js";
23
+ import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
24
+ import { useStore } from "../../../provider/stores/useStore.js";
25
+ import { isCcMatch, validateAuth } from "../../utils/authInputHelpers.js";
26
26
  const DEFAULT_COUNTRY = { label: "United States", value: "+1", selectedLabel: "US", icon: "US" };
27
- function isCcMatch(countryCode, option) {
28
- return countryCode === "+1" ? option.selectedLabel === "US" : option.value === countryCode;
29
- }
30
27
  const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
31
- var _a, _b;
28
+ var _a, _b, _c;
32
29
  const inputRef = useRef(null);
33
30
  const { dropdownMaxHeight, dropdownWidth } = useDropdownPosition(inputRef);
31
+ const defaultAuthIdentifier = useStore((state) => {
32
+ var _a2;
33
+ return (_a2 = state.modalConfig) == null ? void 0 : _a2.defaultAuthIdentifier;
34
+ });
34
35
  const para = useInternalClient();
35
- const setAuthInfo = useUserInfoStore((state) => state.setAuthInfo);
36
- const authInfo = useUserInfoStore((state) => state.getAuthInfo());
37
- const setFlow = useModalStore((state) => state.setFlow);
38
- const setStep = useModalStore((state) => state.setStep);
39
- const setBiometricLocationHints = useModalStore((state) => state.setBiometricLocationHints);
40
- const setLoginURLs = useSetLoginURLs();
41
- const [countryCode, setCountryCode] = useState(
42
- (authInfo == null ? void 0 : authInfo.authType) === "phone" ? authInfo.auth.countryCode || "+1" : "+1"
43
- );
36
+ const { signUpOrLogIn, isSignUpOrLogInPending } = useAuthActions();
37
+ const authInfo = para.authInfo;
38
+ const [storedNationalNumber, storedCountryCode] = useMemo(() => {
39
+ if ((authInfo == null ? void 0 : authInfo.authType) !== "phone") {
40
+ return [void 0, void 0];
41
+ }
42
+ const parsed = parsePhoneNumberFromString(authInfo.identifier);
43
+ return [parsed == null ? void 0 : parsed.nationalNumber, parsed == null ? void 0 : parsed.countryCallingCode];
44
+ }, [authInfo == null ? void 0 : authInfo.authType, authInfo == null ? void 0 : authInfo.identifier]);
45
+ const [countryCode, setCountryCode] = useState(storedCountryCode != null ? storedCountryCode : "+1");
44
46
  const [identifier, setIdentifier] = useState(
45
47
  (() => {
46
- if (!authInfo || ["telegram", "farcaster"].includes(authInfo.authType)) {
48
+ if (!(authInfo == null ? void 0 : authInfo.authType) || ["telegram", "farcaster", "externalWallet"].includes(authInfo == null ? void 0 : authInfo.authType)) {
47
49
  return "";
48
50
  }
49
51
  if (authInfo.authType !== "phone") {
50
52
  return authInfo.identifier;
51
53
  }
52
- return authInfo.auth.phone;
54
+ return storedNationalNumber != null ? storedNationalNumber : "";
53
55
  })()
54
56
  );
55
57
  const [identifierType, setIdentifierType] = useState(
@@ -58,9 +60,28 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
58
60
  const [matchedCountryCode, setMatchedCountryCode] = useState(
59
61
  (_a = countryCodes.find((option) => isCcMatch(countryCode, option))) != null ? _a : DEFAULT_COUNTRY
60
62
  );
61
- const [isLoggingIn, setIsLoggingIn] = useState(false);
62
63
  const [error, setError] = useState("");
64
+ const [isPending, setIsPending] = useState(isSignUpOrLogInPending);
63
65
  const [search, setSearch] = useState("");
66
+ const setCountryCodes = (countyCodeInput) => {
67
+ setCountryCode(countyCodeInput.value);
68
+ setMatchedCountryCode(countyCodeInput);
69
+ };
70
+ useEffect(() => {
71
+ if (defaultAuthIdentifier && !authInfo) {
72
+ const number = parsePhoneNumberFromString(defaultAuthIdentifier);
73
+ if (number) {
74
+ const countryCode2 = `+${number.countryCallingCode}`;
75
+ const countryCodeInputMatch = countryCodes.find((option) => isCcMatch(countryCode2, option));
76
+ if (countryCodeInputMatch) {
77
+ setCountryCodes(countryCodeInputMatch);
78
+ }
79
+ }
80
+ handleIdentifierInput({
81
+ detail: { value: number ? number.nationalNumber : defaultAuthIdentifier }
82
+ });
83
+ }
84
+ }, [authInfo]);
64
85
  const isEmail = identifierType === "email";
65
86
  const isPhone = identifierType === "phone";
66
87
  const isUnknown = !identifierType;
@@ -71,13 +92,13 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
71
92
  setSearch(ev.detail);
72
93
  };
73
94
  const handleIdentifierInput = (ev) => {
74
- const newIdentifier = ev.detail.value;
95
+ var _a2;
96
+ const newIdentifier = (_a2 = ev.detail.value) != null ? _a2 : "";
75
97
  let isNewPhone = false, isNewEmail = false;
76
98
  if (!disablePhoneLogin) {
77
99
  const countryCodeInputMatch = countryCodes.find((option) => isCcMatch(newIdentifier, option));
78
100
  if (countryCodeInputMatch) {
79
- setCountryCode(countryCodeInputMatch.value);
80
- setMatchedCountryCode(countryCodeInputMatch);
101
+ setCountryCodes(countryCodeInputMatch);
81
102
  setIdentifierType("phone");
82
103
  setIdentifier("");
83
104
  return;
@@ -92,70 +113,28 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
92
113
  };
93
114
  const handleCountryCodeInput = (ev) => {
94
115
  const matchedCountryCode2 = countryCodes.find((code) => code.selectedLabel === ev.detail);
95
- setCountryCode(matchedCountryCode2.value);
96
- setMatchedCountryCode(matchedCountryCode2);
116
+ if (matchedCountryCode2) {
117
+ setCountryCodes(matchedCountryCode2);
118
+ }
97
119
  };
98
- const login = () => __async(void 0, null, function* () {
120
+ const onSubmit = () => __async(void 0, null, function* () {
99
121
  setError("");
100
- if (isUnknown) {
101
- setError("Please enter a valid email or phone number!");
102
- return;
103
- }
104
122
  let auth;
105
- if (isEmail) {
106
- if (!EMAIL_REGEX.test(identifier)) {
107
- setError("Please enter a valid email!");
108
- return;
109
- }
110
- yield para.logout();
111
- auth = { email: identifier };
112
- setAuthInfo(auth);
113
- const userExists = yield para.checkIfUserExists({ email: identifier });
114
- if (userExists) {
115
- const supportedAuthMethods = yield para.initiateUserLoginV2(auth);
116
- const biometricLocationHints = supportedAuthMethods.has(AuthMethod.PASSKEY) ? yield para.getUserBiometricLocationHints() : [];
117
- yield setLoginURLs({ supportedAuthMethods, authType: "email" });
118
- setFlow("login");
119
- setStep(ModalStep.BIOMETRIC_LOGIN);
120
- setBiometricLocationHints(biometricLocationHints);
121
- return;
122
- }
123
- yield para.createUser(auth);
124
- setFlow("signUp");
125
- setStep(ModalStep.VERIFICATIONS);
126
- return;
127
- }
128
- if (isPhone) {
129
- yield para.logout();
130
- let userExists = false;
131
- try {
132
- userExists = yield para.checkIfUserExistsByPhone({ phone: identifier, countryCode });
133
- } catch (error2) {
134
- setError("Please enter a valid phone number!");
135
- return;
136
- }
137
- auth = { phone: identifier, countryCode };
138
- setAuthInfo(auth);
139
- if (userExists) {
140
- const supportedAuthMethods = yield para.initiateUserLoginV2(auth);
141
- const biometricLocationHints = supportedAuthMethods.has(AuthMethod.PASSKEY) ? yield para.getUserBiometricLocationHints() : [];
142
- yield setLoginURLs({ supportedAuthMethods, authType: "phone" });
143
- setFlow("login");
144
- setStep(ModalStep.BIOMETRIC_LOGIN);
145
- setBiometricLocationHints(biometricLocationHints);
146
- return;
147
- }
148
- yield para.createUserByPhone(auth);
149
- setFlow("signUp");
150
- setStep(ModalStep.VERIFICATIONS);
151
- return;
123
+ try {
124
+ auth = validateAuth(identifier, countryCode, identifierType);
125
+ signUpOrLogIn(auth);
126
+ } catch (err) {
127
+ setError(err.message);
152
128
  }
153
129
  });
154
- const handleSubmit = () => __async(void 0, null, function* () {
155
- setIsLoggingIn(true);
156
- yield login();
157
- setIsLoggingIn(false);
158
- });
130
+ useEffect(() => {
131
+ if (isSignUpOrLogInPending) {
132
+ setIsPending(true);
133
+ }
134
+ }, [isSignUpOrLogInPending]);
135
+ useEffect(() => {
136
+ setIsPending(false);
137
+ }, [error]);
159
138
  if (disableEmailLogin && disablePhoneLogin) {
160
139
  return null;
161
140
  }
@@ -164,7 +143,7 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
164
143
  {
165
144
  onSubmit: (e) => __async(void 0, null, function* () {
166
145
  e.preventDefault();
167
- yield handleSubmit();
146
+ onSubmit();
168
147
  }),
169
148
  children: /* @__PURE__ */ jsxs(
170
149
  StyledInput,
@@ -178,14 +157,14 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
178
157
  autofocus: true,
179
158
  inputMode: "email",
180
159
  onKeyDown: (e) => __async(void 0, null, function* () {
181
- return e.key === "Enter" && handleSubmit();
160
+ return e.key === "Enter" && onSubmit();
182
161
  }),
183
162
  contrastText: true,
184
163
  isPhone,
185
- mask: identifierType === "phone" ? (_b = phoneMasks[matchedCountryCode.selectedLabel]) != null ? _b : defaultPhoneMask : void 0,
164
+ mask: identifierType === "phone" ? (_c = phoneMasks[(_b = matchedCountryCode.selectedLabel) != null ? _b : ""]) != null ? _c : defaultPhoneMask : void 0,
186
165
  enterkeyhint: "go",
187
166
  noAutoDisable: true,
188
- disabled: isLoggingIn,
167
+ disabled: isPending,
189
168
  "data-testid": "auth-input",
190
169
  children: [
191
170
  /* @__PURE__ */ jsxs(IconContainer, { slot: "start", children: [
@@ -200,7 +179,7 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
200
179
  autoWidth: true,
201
180
  dropdownMaxHeight,
202
181
  anchorElId: "authInput",
203
- $width: dropdownWidth,
182
+ $width: dropdownWidth != null ? dropdownWidth : 0,
204
183
  showSearch: true,
205
184
  searchPlaceholder: "Search Countries",
206
185
  onCpslSearchChange: handleSearchInput,
@@ -218,7 +197,7 @@ const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
218
197
  }
219
198
  )
220
199
  ] }),
221
- identifier && /* @__PURE__ */ jsx(CpslButton, { slot: "end", size: "small", fullWidth: true, disabled: isLoggingIn, onClick: handleSubmit, children: isLoggingIn ? /* @__PURE__ */ jsx(CpslSpinner, { size: 16 }) : /* @__PURE__ */ jsx(CpslIcon, { icon: "arrowNarrow" }) })
200
+ identifier && /* @__PURE__ */ jsx(CpslButton, { slot: "end", size: "small", fullWidth: true, disabled: isPending, onClick: onSubmit, children: isPending ? /* @__PURE__ */ jsx(CpslSpinner, { size: 16 }) : /* @__PURE__ */ jsx(CpslIcon, { icon: "arrowNarrow" }) })
222
201
  ]
223
202
  },
224
203
  "email"
@@ -1,7 +1,7 @@
1
1
  import { MutableRefObject } from 'react';
2
- export declare const useDropdownPosition: (inputRef: MutableRefObject<HTMLCpslInputElement | HTMLDivElement>) => {
3
- dropdownMaxHeight: number;
4
- dropdownWidth: number;
5
- mobileAnchor: number;
2
+ export declare const useDropdownPosition: (inputRef: MutableRefObject<HTMLCpslInputElement | HTMLDivElement | null>) => {
3
+ dropdownMaxHeight: number | undefined;
4
+ dropdownWidth: number | undefined;
5
+ mobileAnchor: number | undefined;
6
6
  resize: () => void;
7
7
  };
@@ -6,15 +6,15 @@ const useDropdownPosition = (inputRef) => {
6
6
  const [dropdownWidth, setDropdownWidth] = useState();
7
7
  const [mobileAnchor, setMobileAnchor] = useState();
8
8
  const resize = () => {
9
- var _a, _b, _c;
9
+ var _a, _b, _c, _d;
10
10
  if (typeof window !== "undefined") {
11
11
  const newMaxHeight = Math.max(
12
- window.innerHeight - ((_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.getBoundingClientRect().bottom) - 20,
12
+ window.innerHeight - ((_b = (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.getBoundingClientRect().bottom) != null ? _b : 0) - 20,
13
13
  window.innerHeight * 0.25
14
14
  );
15
15
  setDropdownMaxHeight(newMaxHeight);
16
- setDropdownWidth((_b = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _b.getBoundingClientRect().width);
17
- setMobileAnchor((_c = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _c.getBoundingClientRect().height);
16
+ setDropdownWidth((_c = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _c.getBoundingClientRect().width);
17
+ setMobileAnchor((_d = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _d.getBoundingClientRect().height);
18
18
  }
19
19
  };
20
20
  if (inputRef.current && !dropdownMaxHeight) {
@@ -1,8 +1,9 @@
1
- import { OAuthMethod } from '@getpara/web-sdk';
1
+ import { TOAuthMethod } from '@getpara/web-sdk';
2
2
  interface AuthMainStepProps {
3
- oAuthMethods?: OAuthMethod[];
3
+ oAuthMethods?: TOAuthMethod[];
4
4
  disableEmailLogin: boolean;
5
5
  disablePhoneLogin: boolean;
6
+ isGuestModeEnabled?: boolean;
6
7
  }
7
- export declare const AuthMainStep: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }: AuthMainStepProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const AuthMainStep: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthMainStepProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -2,15 +2,27 @@
2
2
  import "../../../chunk-MMUBH76A.js";
3
3
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import styled from "styled-components";
5
- import { useThemeStore } from "../../stores/theme/useThemeStore.js";
6
5
  import { AuthMainStepContent } from "./AuthMainStepContent.js";
7
6
  import { CenteredText } from "../common.js";
8
- const AuthMainStep = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) => {
9
- const logo = useThemeStore((state) => state.getLogo());
10
- const appName = useThemeStore((state) => state.appName);
11
- const authLayout = useThemeStore((state) => state.authLayout);
12
- const embeddedModal = useThemeStore((state) => state.embeddedModal);
13
- const firstLayoutType = authLayout[0].split(":")[0];
7
+ import { useStore } from "../../../provider/stores/useStore.js";
8
+ import { useModalStore } from "../../stores/index.js";
9
+ const AuthMainStep = ({
10
+ oAuthMethods,
11
+ disableEmailLogin,
12
+ disablePhoneLogin,
13
+ isGuestModeEnabled = false
14
+ }) => {
15
+ const authLayout = useModalStore((state) => state.authLayout);
16
+ const embeddedModal = useStore((state) => {
17
+ var _a;
18
+ return (_a = state.modalConfig) == null ? void 0 : _a.embeddedModal;
19
+ });
20
+ const logo = useStore((state) => {
21
+ var _a;
22
+ return (_a = state.modalConfig) == null ? void 0 : _a.logo;
23
+ });
24
+ const appName = useStore((state) => state.appName);
25
+ const firstLayoutType = authLayout == null ? void 0 : authLayout[0].split(":")[0];
14
26
  const heading = firstLayoutType === "AUTH" ? "Sign Up or Login" : "Connect Wallet";
15
27
  return /* @__PURE__ */ jsxs(Fragment, { children: [
16
28
  logo && /* @__PURE__ */ jsx(Logo, { src: logo, alt: `${appName ? `${appName} -` : ""}logo` }),
@@ -20,6 +32,7 @@ const AuthMainStep = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) =>
20
32
  {
21
33
  disableEmailLogin,
22
34
  disablePhoneLogin,
35
+ isGuestModeEnabled,
23
36
  oAuthMethods
24
37
  }
25
38
  )
@@ -1,8 +1,9 @@
1
- import { OAuthMethod } from '@getpara/web-sdk';
1
+ import { TOAuthMethod } from '@getpara/web-sdk';
2
2
  interface AuthMainStepContentProps {
3
- oAuthMethods?: OAuthMethod[];
3
+ oAuthMethods?: TOAuthMethod[];
4
4
  disableEmailLogin: boolean;
5
5
  disablePhoneLogin: boolean;
6
+ isGuestModeEnabled?: boolean;
6
7
  }
7
- export declare const AuthMainStepContent: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }: AuthMainStepContentProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const AuthMainStepContent: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthMainStepContentProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -4,19 +4,33 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
4
  import { Fragment as Fragment2, useMemo } from "react";
5
5
  import { CpslButton, CpslDivider, CpslIconGroup } from "@getpara/react-components";
6
6
  import styled from "styled-components";
7
- import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
8
7
  import { ExternalWallets } from "../ExternalWallets/ExternalWallets.js";
9
- import { useModalStore, useThemeStore } from "../../stores/index.js";
8
+ import { useModalStore } from "../../stores/index.js";
10
9
  import { ModalStep } from "../../utils/steps.js";
11
10
  import { AuthLayout } from "../../types/modalProps.js";
12
11
  import { brandedOAuthLogos, oAuthLogos } from "../../constants/oAuthLogos.js";
13
12
  import { AuthOptions } from "../AuthOptions/AuthOptions.js";
14
- const AuthMainStepContent = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) => {
13
+ import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
14
+ import { useStore } from "../../../provider/stores/useStore.js";
15
+ import { useAuthActions } from "../../../provider/providers/AuthProvider.js";
16
+ import { useAccount } from "../../../provider/index.js";
17
+ const AuthMainStepContent = ({
18
+ oAuthMethods,
19
+ disableEmailLogin,
20
+ disablePhoneLogin,
21
+ isGuestModeEnabled = false
22
+ }) => {
15
23
  const { wallets } = useExternalWallets();
16
- const authLayout = useThemeStore((state) => state.authLayout);
24
+ const { createGuestWallets } = useAuthActions();
25
+ const { data: account } = useAccount();
26
+ const authLayout = useModalStore((state) => state.authLayout);
17
27
  const setStep = useModalStore((state) => state.setStep);
18
- const oAuthLogoVariant = useThemeStore((state) => state.oAuthLogoVariant);
19
- const isDark = useThemeStore((state) => state.isDark);
28
+ const oAuthLogoVariant = useStore((state) => state.oAuthLogoVariant);
29
+ const isDark = useStore((state) => {
30
+ var _a, _b;
31
+ return ((_b = (_a = state.modalConfig) == null ? void 0 : _a.theme) == null ? void 0 : _b.mode) === "dark";
32
+ });
33
+ const isGuestMode = (account == null ? void 0 : account.isConnected) && account.isGuestMode;
20
34
  const useBrandedLogos = oAuthLogoVariant === "default";
21
35
  const useDarkLogos = useBrandedLogos ? isDark : oAuthLogoVariant !== "dark";
22
36
  const handleCondensedAuthClick = () => {
@@ -27,7 +41,7 @@ const AuthMainStepContent = ({ oAuthMethods, disableEmailLogin, disablePhoneLogi
27
41
  };
28
42
  const Content = useMemo(() => {
29
43
  const methods = [];
30
- authLayout.forEach((layout) => {
44
+ authLayout == null ? void 0 : authLayout.forEach((layout) => {
31
45
  switch (layout) {
32
46
  case AuthLayout.AUTH_FULL: {
33
47
  methods.push([
@@ -36,7 +50,8 @@ const AuthMainStepContent = ({ oAuthMethods, disableEmailLogin, disablePhoneLogi
36
50
  {
37
51
  oAuthMethods,
38
52
  disableEmailLogin,
39
- disablePhoneLogin
53
+ disablePhoneLogin,
54
+ isGuestModeEnabled
40
55
  },
41
56
  "authFull"
42
57
  ),
@@ -85,8 +100,22 @@ const AuthMainStepContent = ({ oAuthMethods, disableEmailLogin, disablePhoneLogi
85
100
  reactNode,
86
101
  methods.length > 1 && index < methods.length - 1 && /* @__PURE__ */ jsx(CpslDivider, { children: "or" }, "or")
87
102
  ] }, key)) });
88
- }, [oAuthMethods, disableEmailLogin, disablePhoneLogin, wallets, authLayout]);
89
- return /* @__PURE__ */ jsx(Container, { "data-testid": "main-auth-step-content", children: Content });
103
+ }, [oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, wallets, authLayout]);
104
+ return /* @__PURE__ */ jsxs(Container, { "data-testid": "main-auth-step-content", children: [
105
+ Content,
106
+ isGuestModeEnabled && !isGuestMode && /* @__PURE__ */ jsx(
107
+ GuestMode,
108
+ {
109
+ href: "#",
110
+ isDark,
111
+ onClick: (e) => {
112
+ e.preventDefault();
113
+ createGuestWallets();
114
+ },
115
+ children: "Continue as Guest"
116
+ }
117
+ )
118
+ ] });
90
119
  };
91
120
  const Container = styled.div`
92
121
  display: flex;
@@ -108,6 +137,21 @@ const CondensedButton = styled(CpslButton)`
108
137
  max-height: 50px;
109
138
  }
110
139
  `;
140
+ const GuestMode = styled.a`
141
+ display: flex;
142
+ justify-content: center;
143
+ align-items: center;
144
+ width: 100%;
145
+ height: 50px;
146
+ color: ${({ isDark }) => isDark ? "white" : "black"};
147
+ text-decoration: underline;
148
+ font-size: 16px;
149
+ font-weight: 500;
150
+
151
+ &:hover {
152
+ text-decoration: underline;
153
+ }
154
+ `;
111
155
  export {
112
156
  AuthMainStepContent
113
157
  };
@@ -1,8 +1,9 @@
1
- import { OAuthMethod } from '@getpara/web-sdk';
1
+ import { TOAuthMethod } from '@getpara/web-sdk';
2
2
  interface AuthOptionsProps {
3
- oAuthMethods?: OAuthMethod[];
3
+ oAuthMethods?: TOAuthMethod[];
4
4
  disableEmailLogin: boolean;
5
5
  disablePhoneLogin: boolean;
6
+ isGuestModeEnabled: boolean;
6
7
  }
7
- export declare const AuthOptions: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }: AuthOptionsProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const AuthOptions: ({ oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, }: AuthOptionsProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,16 +1,27 @@
1
1
  "use client";
2
2
  import "../../../chunk-MMUBH76A.js";
3
- import { Fragment, jsx } from "react/jsx-runtime";
4
- import { useMemo } from "react";
3
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { useEffect, useMemo } from "react";
5
5
  import styled from "styled-components";
6
6
  import { OAuth } from "../OAuth/OAuth.js";
7
7
  import { AuthInput } from "../AuthInput/AuthInput.js";
8
- import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
8
+ import { useExternalWallets } from "../../../provider/providers/ExternalWalletProvider.js";
9
9
  import { useModalStore } from "../../stores/index.js";
10
- import { ModalStep } from "../../utils/steps.js";
11
- const AuthOptions = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) => {
10
+ import { CpslIcon } from "@getpara/react-components";
11
+ import { useStore } from "../../../provider/stores/useStore.js";
12
+ const AuthOptions = ({
13
+ oAuthMethods,
14
+ disableEmailLogin,
15
+ disablePhoneLogin,
16
+ isGuestModeEnabled = false
17
+ }) => {
12
18
  const { wallets } = useExternalWallets();
13
- const showAllOAuth = useModalStore((state) => state.step === ModalStep.AUTH_MORE);
19
+ const isDark = useStore((state) => {
20
+ var _a, _b;
21
+ return ((_b = (_a = state.modalConfig) == null ? void 0 : _a.theme) == null ? void 0 : _b.mode) === "dark";
22
+ });
23
+ const guestAddFundsTab = useModalStore((state) => state.guestAddFundsTab);
24
+ const setGuestAddFundsTab = useModalStore((state) => state.setGuestAddFundsTab);
14
25
  const Content = useMemo(() => {
15
26
  const Methods = [];
16
27
  if (!!(oAuthMethods == null ? void 0 : oAuthMethods.length)) {
@@ -20,14 +31,37 @@ const AuthOptions = ({ oAuthMethods, disableEmailLogin, disablePhoneLogin }) =>
20
31
  Methods.push(/* @__PURE__ */ jsx(AuthInput, { disableEmailLogin, disablePhoneLogin }, "input"));
21
32
  }
22
33
  return /* @__PURE__ */ jsx(Fragment, { children: Methods });
23
- }, [showAllOAuth, oAuthMethods, disableEmailLogin, disablePhoneLogin, wallets]);
24
- return /* @__PURE__ */ jsx(Container, { children: Content });
34
+ }, [oAuthMethods, disableEmailLogin, disablePhoneLogin, isGuestModeEnabled, wallets]);
35
+ useEffect(() => {
36
+ return () => {
37
+ setGuestAddFundsTab();
38
+ };
39
+ }, []);
40
+ return /* @__PURE__ */ jsxs(Container, { children: [
41
+ guestAddFundsTab && /* @__PURE__ */ jsxs(CompleteAccountSetup, { isDark, children: [
42
+ /* @__PURE__ */ jsx(CpslIcon, { icon: "stars02", size: "16px" }),
43
+ "Complete account setup to",
44
+ " ",
45
+ guestAddFundsTab === "BUY" ? "buy assets" : guestAddFundsTab === "WITHDRAW" ? "sell assets" : "continue",
46
+ "."
47
+ ] }),
48
+ Content
49
+ ] });
25
50
  };
26
51
  const Container = styled.div`
27
52
  display: flex;
28
53
  flex-direction: column;
29
54
  gap: 8px;
30
55
  `;
56
+ const CompleteAccountSetup = styled.div`
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ gap: 4px;
61
+ color: ${({ isDark }) => isDark ? "white" : "black"};
62
+ font-weight: 500;
63
+ font-size: 14px;
64
+ `;
31
65
  export {
32
66
  AuthOptions
33
67
  };
@@ -1 +1,5 @@
1
- export declare const AwaitingWalletCreationStep: () => import("react/jsx-runtime").JSX.Element;
1
+ type Props = {
2
+ isGuestMode?: boolean;
3
+ };
4
+ export declare const AwaitingWalletCreationStep: ({ isGuestMode }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -5,11 +5,16 @@ import { CpslIcon, CpslInfoBox, CpslText } from "@getpara/react-components";
5
5
  import { InfoBoxContent, InfoBoxHeader, StepContainer } from "../common.js";
6
6
  import { useEffect, useRef, useState } from "react";
7
7
  import { Waiting } from "../Waiting/Waiting.js";
8
- import { useThemeStore } from "../../stores/index.js";
9
- const AwaitingWalletCreationStep = () => {
10
- const hideWallets = useThemeStore((state) => state.hideWallets);
8
+ import { useStore } from "../../../provider/stores/useStore.js";
9
+ import { useAccount } from "../../../provider/index.js";
10
+ const AwaitingWalletCreationStep = ({ isGuestMode = false }) => {
11
+ const hideWallets = useStore((state) => {
12
+ var _a;
13
+ return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
14
+ });
11
15
  const [showInfoBox, setShowInfoBox] = useState(false);
12
16
  const showInfoBoxTimeout = useRef();
17
+ const { data: account } = useAccount();
13
18
  useEffect(() => {
14
19
  if (typeof window !== "undefined") {
15
20
  showInfoBoxTimeout.current = window.setTimeout(() => {
@@ -22,7 +27,7 @@ const AwaitingWalletCreationStep = () => {
22
27
  /* @__PURE__ */ jsx(
23
28
  Waiting,
24
29
  {
25
- heading: hideWallets ? "Creating Your Account" : "Creating Your Wallet",
30
+ heading: isGuestMode ? "Creating Guest Account" : (account == null ? void 0 : account.isGuestMode) ? hideWallets ? "Linking Guest Account" : "Linking Guest Wallet" : hideWallets ? "Creating Your Account" : "Creating Your Wallet",
26
31
  subheading: "This should only take a couple of seconds."
27
32
  }
28
33
  ),
@@ -1,3 +1 @@
1
- export declare const BiometricCreationStep: ({ twoFactorAuthEnabled }: {
2
- twoFactorAuthEnabled?: boolean;
3
- }) => import("react/jsx-runtime").JSX.Element;
1
+ export declare const BiometricCreationStep: () => import("react/jsx-runtime").JSX.Element | null;