@getpara/react-sdk 1.8.0 → 2.0.0-alpha.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 (248) 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/cli/cli.mjs +40 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +6499 -6
  9. package/dist/index.js.br +0 -0
  10. package/dist/index.js.gz +0 -0
  11. package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
  12. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
  13. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -1
  14. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -1
  15. package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
  16. package/dist/modal/components/Controls/Selects.d.ts +1 -1
  17. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
  18. package/dist/modal/components/Footer/Footer.d.ts +1 -1
  19. package/dist/modal/components/WalletCard/WalletCard.d.ts +2 -2
  20. package/dist/modal/components/common.d.ts +7 -7
  21. package/dist/modal/constants/constants.d.ts +1 -1
  22. package/dist/modal/index.d.ts +0 -2
  23. package/dist/modal/stores/index.d.ts +0 -2
  24. package/dist/modal/stores/modal/useModalStore.d.ts +22 -20
  25. package/dist/modal/types/commonTypes.d.ts +4 -9
  26. package/dist/modal/types/externalWallets.d.ts +0 -2
  27. package/dist/modal/types/modalProps.d.ts +1 -33
  28. package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
  29. package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
  30. package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
  31. package/dist/modal/utils/openPopup.d.ts +2 -2
  32. package/dist/modal/utils/stringFormatters.d.ts +0 -1
  33. package/dist/provider/ParaProvider.d.ts +3 -1
  34. package/dist/provider/actions/getAccount.d.ts +19 -7
  35. package/dist/provider/actions/getWallet.d.ts +1 -1
  36. package/dist/provider/actions/index.d.ts +25 -0
  37. package/dist/provider/actions/utils.d.ts +3 -0
  38. package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
  39. package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
  40. package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
  41. package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
  42. package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
  43. package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
  44. package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
  45. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +12 -0
  46. package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
  47. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +8 -0
  48. package/dist/provider/hooks/mutations/index.d.ts +25 -10
  49. package/dist/provider/hooks/mutations/utils.d.ts +4 -0
  50. package/dist/provider/hooks/queries/index.d.ts +0 -1
  51. package/dist/provider/hooks/queries/useAccount.d.ts +1 -6
  52. package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
  53. package/dist/provider/hooks/utils/useWalletState.d.ts +3 -2
  54. package/dist/provider/index.d.ts +1 -0
  55. package/dist/provider/providers/AuthProvider.d.ts +31 -0
  56. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
  57. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
  58. package/dist/provider/providers/ExternalWalletProvider.d.ts +73 -0
  59. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
  60. package/dist/provider/stores/getters.d.ts +3 -3
  61. package/dist/provider/stores/setters.d.ts +1 -0
  62. package/dist/provider/stores/slices/config.d.ts +3 -0
  63. package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
  64. package/dist/provider/stores/slices/index.d.ts +1 -0
  65. package/dist/provider/stores/types.d.ts +46 -3
  66. package/dist/provider/types/externalWalletProviders.d.ts +12 -0
  67. package/dist/provider/types/provider.d.ts +119 -16
  68. package/dist/provider/types/utils.d.ts +16 -0
  69. package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
  70. package/dist/provider/utils/renameMutations.d.ts +3 -0
  71. package/package.json +19 -7
  72. package/dist/modal/ParaModal.js +0 -362
  73. package/dist/modal/components/Account/Account.js +0 -77
  74. package/dist/modal/components/AddFunds/AddFunds.js +0 -220
  75. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -72
  76. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -43
  77. package/dist/modal/components/AddFunds/index.js +0 -4
  78. package/dist/modal/components/AuthInput/AuthInput.js +0 -283
  79. package/dist/modal/components/AuthInput/countryCodes.js +0 -42
  80. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  81. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  82. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -37
  83. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -113
  84. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -33
  85. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  86. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  87. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  88. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -44
  89. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -55
  90. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -93
  91. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  92. package/dist/modal/components/Body/Body.js +0 -308
  93. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -94
  94. package/dist/modal/components/ChainSwitch/config.js +0 -17
  95. package/dist/modal/components/Controls/Controls.js +0 -74
  96. package/dist/modal/components/Controls/Selects.js +0 -234
  97. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -140
  98. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  99. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -96
  100. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -172
  101. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -8
  102. package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -124
  103. package/dist/modal/components/Footer/Footer.js +0 -93
  104. package/dist/modal/components/Header/Header.js +0 -43
  105. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -50
  106. package/dist/modal/components/Hero/Hero.js +0 -116
  107. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -55
  108. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -28
  109. package/dist/modal/components/ModalContent/ModalContent.js +0 -324
  110. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -81
  111. package/dist/modal/components/OAuth/OAuth.js +0 -153
  112. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -139
  113. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  114. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  115. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -101
  116. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -141
  117. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
  118. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -24
  119. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -159
  120. package/dist/modal/components/Waiting/Waiting.js +0 -17
  121. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  122. package/dist/modal/components/WalletCard/WalletCard.js +0 -127
  123. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -52
  124. package/dist/modal/components/common.js +0 -96
  125. package/dist/modal/components/index.js +0 -2
  126. package/dist/modal/constants/constants.js +0 -111
  127. package/dist/modal/constants/defaults.js +0 -10
  128. package/dist/modal/constants/oAuthLogos.js +0 -24
  129. package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
  130. package/dist/modal/hooks/useActiveWallet.js +0 -15
  131. package/dist/modal/hooks/useCreateAccount.d.ts +0 -4
  132. package/dist/modal/hooks/useCreateAccount.js +0 -72
  133. package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
  134. package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -54
  135. package/dist/modal/hooks/useGoBack.js +0 -42
  136. package/dist/modal/hooks/useSetLoginURLs.d.ts +0 -8
  137. package/dist/modal/hooks/useSetLoginURLs.js +0 -49
  138. package/dist/modal/hooks/useWalletBalance.d.ts +0 -4
  139. package/dist/modal/hooks/useWalletBalance.js +0 -47
  140. package/dist/modal/index.js +0 -33
  141. package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -42
  142. package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -38
  143. package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -46
  144. package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -55
  145. package/dist/modal/providers/ExternalWalletContext.d.ts +0 -92
  146. package/dist/modal/providers/ExternalWalletContext.js +0 -394
  147. package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -32
  148. package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -32
  149. package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
  150. package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
  151. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -22
  152. package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -21
  153. package/dist/modal/stores/index.js +0 -4
  154. package/dist/modal/stores/modal/actions.js +0 -70
  155. package/dist/modal/stores/modal/useModalStore.js +0 -65
  156. package/dist/modal/stores/theme/actions.d.ts +0 -3
  157. package/dist/modal/stores/theme/actions.js +0 -28
  158. package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
  159. package/dist/modal/stores/theme/useThemeStore.js +0 -21
  160. package/dist/modal/stores/userInfo/actions.d.ts +0 -3
  161. package/dist/modal/stores/userInfo/actions.js +0 -30
  162. package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +0 -19
  163. package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
  164. package/dist/modal/types/commonTypes.js +0 -1
  165. package/dist/modal/types/externalWallets.js +0 -32
  166. package/dist/modal/types/modalProps.js +0 -12
  167. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  168. package/dist/modal/utils/getMailtoLink.js +0 -10
  169. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  170. package/dist/modal/utils/openPopup.js +0 -60
  171. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  172. package/dist/modal/utils/steps.js +0 -232
  173. package/dist/modal/utils/stringFormatters.js +0 -19
  174. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  175. package/dist/package.json +0 -6
  176. package/dist/provider/ParaProvider.js +0 -22
  177. package/dist/provider/actions/checkIfUserExists.d.ts +0 -9
  178. package/dist/provider/actions/checkIfUserExists.js +0 -21
  179. package/dist/provider/actions/createUser.d.ts +0 -12
  180. package/dist/provider/actions/createUser.js +0 -26
  181. package/dist/provider/actions/getAccount.js +0 -22
  182. package/dist/provider/actions/getWallet.js +0 -14
  183. package/dist/provider/actions/getWalletBalance.d.ts +0 -2
  184. package/dist/provider/actions/getWalletBalance.js +0 -14
  185. package/dist/provider/actions/initiateLogin.d.ts +0 -4
  186. package/dist/provider/actions/initiateLogin.js +0 -20
  187. package/dist/provider/actions/keepSessionAlive.d.ts +0 -2
  188. package/dist/provider/actions/keepSessionAlive.js +0 -20
  189. package/dist/provider/actions/logout.d.ts +0 -2
  190. package/dist/provider/actions/logout.js +0 -17
  191. package/dist/provider/actions/signMessage.d.ts +0 -8
  192. package/dist/provider/actions/signMessage.js +0 -20
  193. package/dist/provider/actions/signTransaction.d.ts +0 -8
  194. package/dist/provider/actions/signTransaction.js +0 -20
  195. package/dist/provider/actions/waitForAccountCreation.d.ts +0 -2
  196. package/dist/provider/actions/waitForAccountCreation.js +0 -21
  197. package/dist/provider/actions/waitForLoginAndSetup.d.ts +0 -6
  198. package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
  199. package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +0 -2
  200. package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
  201. package/dist/provider/hooks/index.js +0 -4
  202. package/dist/provider/hooks/mutations/index.js +0 -24
  203. package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +0 -13
  204. package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
  205. package/dist/provider/hooks/mutations/useCreateUser.d.ts +0 -13
  206. package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
  207. package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +0 -14
  208. package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
  209. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -12
  210. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
  211. package/dist/provider/hooks/mutations/useLogout.d.ts +0 -12
  212. package/dist/provider/hooks/mutations/useLogout.js +0 -30
  213. package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -15
  214. package/dist/provider/hooks/mutations/useSignMessage.js +0 -39
  215. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -14
  216. package/dist/provider/hooks/mutations/useSignTransaction.js +0 -39
  217. package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +0 -12
  218. package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
  219. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +0 -14
  220. package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
  221. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +0 -13
  222. package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
  223. package/dist/provider/hooks/queries/index.js +0 -10
  224. package/dist/provider/hooks/queries/useAccount.js +0 -21
  225. package/dist/provider/hooks/queries/useWallet.js +0 -22
  226. package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -7
  227. package/dist/provider/hooks/queries/useWalletBalance.js +0 -26
  228. package/dist/provider/hooks/utils/index.js +0 -10
  229. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  230. package/dist/provider/hooks/utils/useClient.js +0 -10
  231. package/dist/provider/hooks/utils/useEventListeners.js +0 -105
  232. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  233. package/dist/provider/hooks/utils/useModal.js +0 -17
  234. package/dist/provider/hooks/utils/useWalletState.js +0 -33
  235. package/dist/provider/index.js +0 -8
  236. package/dist/provider/stores/getters.js +0 -13
  237. package/dist/provider/stores/slices/client.js +0 -9
  238. package/dist/provider/stores/slices/index.js +0 -4
  239. package/dist/provider/stores/slices/modal.js +0 -9
  240. package/dist/provider/stores/slices/wallet.js +0 -13
  241. package/dist/provider/stores/types.js +0 -1
  242. package/dist/provider/stores/useStore.js +0 -27
  243. package/dist/provider/types/provider.js +0 -1
  244. package/dist/provider/types/query.js +0 -1
  245. package/dist/provider/types/utils.js +0 -1
  246. package/dist/provider/utils/constants.d.ts +0 -5
  247. package/dist/provider/utils/constants.js +0 -11
  248. package/dist/provider/utils/renameMutations.js +0 -16
@@ -1,234 +0,0 @@
1
- "use client";
2
- import {
3
- __async,
4
- __spreadProps,
5
- __spreadValues
6
- } from "../../../chunk-MMUBH76A.js";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- import { CpslButton, CpslIcon, CpslIdenticon, CpslSelect, CpslSelectItem, CpslText } from "@getpara/react-components";
9
- import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
10
- import styled from "styled-components";
11
- import { useThemeStore } from "../../stores/index.js";
12
- import { truncateAddress, WalletType } from "@getpara/web-sdk";
13
- import { useEffect, useRef } from "react";
14
- import { useDropdownPosition } from "../AuthInput/hooks/useDropdownPosition.js";
15
- import { MOBILE_SIZE } from "../../constants/constants.js";
16
- import { useActiveWallet } from "../../hooks/useActiveWallet.js";
17
- import { useWalletState } from "../../../provider/index.js";
18
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
19
- import { useCopyToClipboard } from "@getpara/react-common";
20
- const getValue = (id, type) => {
21
- return id && type ? `${id}~${type}` : void 0;
22
- };
23
- const WALLET_TYPES = {
24
- [WalletType.EVM]: "EVM",
25
- [WalletType.SOLANA]: "Solana",
26
- [WalletType.COSMOS]: "Cosmos"
27
- };
28
- const ChainSelect = () => {
29
- var _a, _b;
30
- const containerRef = useRef(null);
31
- const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
32
- const activeWallet = useActiveWallet();
33
- const { switchChain, chainId, chains, chainIdSwitchingTo } = useExternalWallets();
34
- useEffect(() => {
35
- if (dropdownMaxHeight && chainId) {
36
- resize();
37
- }
38
- }, [chainId, chainIdSwitchingTo, dropdownMaxHeight]);
39
- const handleChainChange = (chainId2) => __async(void 0, null, function* () {
40
- yield switchChain(chainId2);
41
- });
42
- if (!activeWallet || !activeWallet.isExternal || activeWallet.type === WalletType.SOLANA) {
43
- return null;
44
- }
45
- const chainIdToUse = chainIdSwitchingTo != null ? chainIdSwitchingTo : chainId;
46
- const selectedChainName = (_a = chains.find((c) => c.id.toString() === chainIdToUse)) == null ? void 0 : _a.name;
47
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(SelectContainer, { ref: containerRef, id: "inputContainer", children: /* @__PURE__ */ jsxs(
48
- StyledSelect,
49
- {
50
- selectedValue: (_b = chainIdToUse == null ? void 0 : chainIdToUse.toString()) != null ? _b : "",
51
- onCpslSelectValueChange: (e) => {
52
- handleChainChange(e.detail);
53
- },
54
- showFormattedSelectedItem: true,
55
- placeholder: "Choose chain...",
56
- anchorElId: "inputContainer",
57
- dropdownMaxHeight,
58
- $width: dropdownWidth,
59
- $top: mobileAnchor + 16 + 1,
60
- autoWidth: true,
61
- selectedItemVariant: "bodyXS",
62
- children: [
63
- chainIdToUse && /* @__PURE__ */ jsx(ChainName, { variant: "bodyXS", color: "contrast", slot: "selected-item", children: selectedChainName }),
64
- chains == null ? void 0 : chains.map((chain) => /* @__PURE__ */ jsx(StyledSelectItem, { slot: "items", value: chain.id.toString(), children: /* @__PURE__ */ jsx(ChainName, { variant: "bodyXS", color: "contrast", children: chain.name }) }, chain.id))
65
- ]
66
- }
67
- ) }) });
68
- };
69
- function getName(para, {
70
- type,
71
- isExternal,
72
- name,
73
- isMenu = false,
74
- hideWallets = false
75
- }) {
76
- if (para.isMultiWallet) {
77
- return name != null ? name : `${isExternal ? "External " : ""}${WALLET_TYPES[type]}${!hideWallets && (isMenu || isExternal) ? " Wallet" : ""}`;
78
- }
79
- return hideWallets ? "My Account" : name || "My Wallet";
80
- }
81
- const AccountSelect = () => {
82
- var _a;
83
- const hideWallets = useThemeStore((state) => state.hideWallets);
84
- const para = useInternalClient();
85
- const containerRef = useRef(null);
86
- const { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize } = useDropdownPosition(containerRef);
87
- const [isCopied, copy] = useCopyToClipboard();
88
- const { setSelectedWallet } = useWalletState();
89
- const activeWallet = useActiveWallet();
90
- const handleCopy = () => {
91
- copy(activeWallet.address ? para.getDisplayAddress(activeWallet.id, { addressType: activeWallet.type }) : "");
92
- };
93
- const ActiveWalletNode = activeWallet ? /* @__PURE__ */ jsxs(FlexRow, { slot: "selected-item", children: [
94
- /* @__PURE__ */ jsx(CpslIdenticon, { variant: "avatar", size: "14px", hash: para.getIdenticonHash(activeWallet.id, activeWallet.type) }),
95
- /* @__PURE__ */ jsx(WalletName, { variant: "bodyXS", color: "contrast", children: getName(para, __spreadProps(__spreadValues({}, activeWallet), { hideWallets })) }),
96
- !hideWallets && /* @__PURE__ */ jsxs(Fragment, { children: [
97
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", children: (_a = activeWallet.ensName) != null ? _a : para.getDisplayAddress(activeWallet.id, { truncate: true, addressType: activeWallet.type }) }),
98
- /* @__PURE__ */ jsx(
99
- CpslButton,
100
- {
101
- id: "ignore-click",
102
- size: "small",
103
- variant: "ghost",
104
- onClick: (e) => {
105
- e.stopPropagation();
106
- e.preventDefault();
107
- handleCopy();
108
- },
109
- children: /* @__PURE__ */ jsx(CpslIcon, { id: "ignore-click", slot: "start", icon: isCopied ? "check" : "copy" })
110
- }
111
- )
112
- ] })
113
- ] }) : null;
114
- useEffect(() => {
115
- if (dropdownMaxHeight && (activeWallet == null ? void 0 : activeWallet.address)) {
116
- resize();
117
- }
118
- }, [activeWallet, para.availableWallets, dropdownMaxHeight]);
119
- return /* @__PURE__ */ jsx(Container, { children: /* @__PURE__ */ jsx(SelectContainer, { ref: containerRef, id: "addressInputContainer", children: para.availableWallets.length > 1 ? /* @__PURE__ */ jsxs(
120
- StyledSelect,
121
- {
122
- selectedValue: getValue(activeWallet == null ? void 0 : activeWallet.id, activeWallet == null ? void 0 : activeWallet.type),
123
- onCpslSelectValueChange: (e) => {
124
- const [id, type] = e.detail.split("~");
125
- setSelectedWallet({ id, type });
126
- },
127
- showFormattedSelectedItem: true,
128
- placeholder: "Choose wallet...",
129
- anchorElId: "addressInputContainer",
130
- dropdownMaxHeight,
131
- $width: dropdownWidth,
132
- $top: mobileAnchor + 16 + 1,
133
- autoWidth: true,
134
- selectedItemVariant: "bodyXS",
135
- children: [
136
- activeWallet && ActiveWalletNode,
137
- para.availableWallets.map(({ address, name: _name, id, type, isExternal }) => {
138
- const key = getValue(id, type);
139
- const name = _name != null ? _name : getName(para, { type, isExternal, isMenu: true, hideWallets });
140
- return /* @__PURE__ */ jsx(StyledSelectItem, { slot: "items", value: key, children: /* @__PURE__ */ jsxs(FlexRow, { children: [
141
- /* @__PURE__ */ jsx(CpslIdenticon, { size: "40px", hash: para.getIdenticonHash(id, type) }),
142
- /* @__PURE__ */ jsxs(FlexCol, { children: [
143
- name && /* @__PURE__ */ jsx(CpslText, { variant: "bodyS", color: "contrast", children: name }),
144
- !hideWallets && /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", children: truncateAddress(address, type, { prefix: para.cosmosPrefix }) })
145
- ] })
146
- ] }) }, key);
147
- })
148
- ]
149
- }
150
- ) : ActiveWalletNode }) });
151
- };
152
- const Container = styled.div`
153
- flex: 0;
154
- width: 100%;
155
- display: flex;
156
- justify-content: center;
157
- `;
158
- const FlexRow = styled.div`
159
- display: flex;
160
- align-items: center;
161
- gap: 8px;
162
- `;
163
- const FlexCol = styled.div`
164
- display: flex;
165
- flex-direction: column;
166
- align-items: flex-start;
167
- `;
168
- const WalletName = styled(CpslText)`
169
- white-space: nowrap;
170
- `;
171
- const SelectContainer = styled.div`
172
- position: relative;
173
- display: flex;
174
- align-items: center;
175
- gap: 8px;
176
- border-radius: 1000px;
177
- background-color: var(--cpsl-color-background-8);
178
- padding: 8px;
179
- `;
180
- const ChainName = styled(CpslText)`
181
- max-width: 150px;
182
- text-transform: capitalize;
183
-
184
- &::part(text-element) {
185
- white-space: nowrap;
186
- text-overflow: ellipsis;
187
- overflow: hidden;
188
- }
189
- `;
190
- const StyledSelect = styled(CpslSelect)`
191
- --container-height: auto;
192
- --container-border-width: 0px;
193
- --container-padding-end: 0px;
194
- --container-padding-start: 0px;
195
- --container-background-color: transparent;
196
- --container-box-shadow: none;
197
- --container-gap: 2px;
198
- --icon-width: 16px;
199
- --icon-height: 16px;
200
-
201
- &::part(selected-text) {
202
- white-space: nowrap;
203
- }
204
-
205
- &::part(dropdown) {
206
- min-width: ${({ $width }) => `${$width - 2}px`};
207
- }
208
-
209
- &::part(popover) {
210
- /* Have to adjust the top of the popover here since we're using a transform on the modal which causes fixed position items to not be relative to the viewport */
211
- @media (max-width: ${MOBILE_SIZE}px) {
212
- top: ${({ $top }) => $top ? `${$top}px` : "0px"};
213
- bottom: 16px;
214
- }
215
- cpsl-auth-modal.force-mobile-media & {
216
- top: ${({ $top }) => $top ? `${$top}px` : "0px"};
217
- bottom: 16px;
218
- }
219
- }
220
-
221
- &::part(icon) {
222
- --icon-color: var(--cpsl-color-contrast);
223
- }
224
- `;
225
- const StyledSelectItem = styled(CpslSelectItem)`
226
- --outer-container-padding-start: 4px;
227
- --outer-container-padding-end: 4px;
228
- --outer-container-padding-top: 4px;
229
- --outer-container-padding-bottom: 4px;
230
- `;
231
- export {
232
- AccountSelect,
233
- ChainSelect
234
- };
@@ -1,140 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { CpslButton, CpslIcon, CpslQrCode, CpslSpinner, CpslText } from "@getpara/react-components";
7
- import { CenteredText, ErrorContainer, ErrorIcon, InnerStepContainer, QRContainer, StepContainer } from "../common.js";
8
- import { useEffect, useMemo } from "react";
9
- import { useModalStore } from "../../stores/index.js";
10
- import styled from "styled-components";
11
- import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
12
- import { useCopyToClipboard } from "@getpara/react-common";
13
- import { ModalStep } from "../../utils/steps.js";
14
- import { isMobile, isTablet, WalletType } from "@getpara/web-sdk";
15
- import { routeMobileExternalWallet } from "../../utils/routeMobileExternalWallet.js";
16
- const ExternalWalletStep = () => {
17
- const [isCopied, copy] = useCopyToClipboard();
18
- const externalWalletError = useModalStore((state) => state.externalWalletError);
19
- const setStep = useModalStore((state) => state.setStep);
20
- const { connectExternalWallet, wallet, qrUri, walletDisplayHelpers } = useExternalWallets();
21
- useEffect(() => {
22
- routeMobileExternalWallet(qrUri);
23
- }, [qrUri]);
24
- const handleTryAgainClick = () => __async(void 0, null, function* () {
25
- yield connectExternalWallet(wallet);
26
- });
27
- const handleCopy = () => {
28
- copy(qrUri);
29
- };
30
- const Content = useMemo(() => {
31
- var _a, _b, _c;
32
- if (!wallet) {
33
- return null;
34
- }
35
- const isWalletConnect = wallet.id === "walletConnect";
36
- const isMobileWalletConnect = isMobile() && isWalletConnect;
37
- if (isMobileWalletConnect) {
38
- /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(Text, { weight: "semiBold", children: "Continue in the WalletConnect modal." }) });
39
- }
40
- const { showExtension, showMobile, isSolanaMobileIOS } = walletDisplayHelpers;
41
- if (!showMobile && !showExtension || isSolanaMobileIOS && !wallet.installed) {
42
- const text = isSolanaMobileIOS ? "Solana wallets aren't available on mobile IOS browsers.\n\nPlease continue in the wallet app." : `${wallet.name} isn't supported on mobile devices.
43
-
44
- Please choose another wallet or continue on desktop.`;
45
- return /* @__PURE__ */ jsx(InnerStepContainer, { children: /* @__PURE__ */ jsx(Text, { weight: "semiBold", children: text }) });
46
- }
47
- if (showExtension) {
48
- const isInstalled = wallet.installed;
49
- return /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
50
- isInstalled && !(externalWalletError == null ? void 0 : externalWalletError.length) ? /* @__PURE__ */ jsx(CenteredText, { color: "contrast", weight: "semiBold", children: `Confirm connection request in the ${wallet.name} browser extension.` }) : /* @__PURE__ */ jsxs(ErrorContainer, { children: [
51
- /* @__PURE__ */ jsx(ErrorIcon, { icon: "alertCircle" }),
52
- /* @__PURE__ */ jsx(CpslText, { weight: "semiBold", color: "error", children: isInstalled ? externalWalletError == null ? void 0 : externalWalletError[0] : `${wallet.name} not detected` })
53
- ] }),
54
- /* @__PURE__ */ jsxs(
55
- CpslButton,
56
- {
57
- as: isInstalled ? "button" : "a",
58
- href: (_a = wallet.downloadUrl) != null ? _a : "",
59
- target: "_blank",
60
- variant: "secondary",
61
- onClick: handleTryAgainClick,
62
- children: [
63
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isInstalled ? "refresh" : "linkExternal" }),
64
- isInstalled ? "Try Again" : `Get ${wallet.name}`
65
- ]
66
- }
67
- )
68
- ] });
69
- }
70
- if (showMobile) {
71
- if (wallet.type === WalletType.SOLANA || isMobile() && !isTablet()) {
72
- const isInstalled = wallet.type !== WalletType.SOLANA || wallet.installed;
73
- return /* @__PURE__ */ jsxs(Fragment, { children: [
74
- /* @__PURE__ */ jsx(InnerStepContainer, { children: !isInstalled && /* @__PURE__ */ jsx(CpslText, { weight: "semiBold", color: "error", children: `${wallet.name} not detected` }) }),
75
- wallet.id !== "walletConnect" && /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
76
- /* @__PURE__ */ jsx(CpslButton, { onClick: () => routeMobileExternalWallet(qrUri), fullWidth: true, children: "Connect Wallet" }),
77
- /* @__PURE__ */ jsx(Link, { href: (_b = wallet.downloadUrl) != null ? _b : "", target: "_blank", children: /* @__PURE__ */ jsxs(ExternalButton, { variant: "secondary", children: [
78
- `Get ${wallet.name}`,
79
- /* @__PURE__ */ jsx(ExternalIcon, { icon: "linkExternal" })
80
- ] }) })
81
- ] })
82
- ] });
83
- }
84
- const openWCModal = () => __async(void 0, null, function* () {
85
- yield connectExternalWallet(wallet, true, true);
86
- });
87
- const GetWalletButton = /* @__PURE__ */ jsxs(ExternalButton, { variant: "secondary", onClick: isWalletConnect ? openWCModal : void 0, children: [
88
- `${isWalletConnect ? "Open" : "Get"} ${wallet.name}`,
89
- /* @__PURE__ */ jsx(ExternalIcon, { icon: "linkExternal" })
90
- ] });
91
- return /* @__PURE__ */ jsxs(Fragment, { children: [
92
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
93
- /* @__PURE__ */ jsx(CpslText, { weight: "semiBold", children: "Scan with your mobile device" }),
94
- /* @__PURE__ */ jsx(QRContainer, { children: !qrUri ? /* @__PURE__ */ jsx(CpslSpinner, { size: 100 }) : /* @__PURE__ */ jsx(CpslQrCode, { url: qrUri, imageSrc: wallet.iconUrl }) }),
95
- /* @__PURE__ */ jsxs(CpslButton, { size: "small", variant: "ghost", onClick: handleCopy, children: [
96
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: isCopied ? "check" : "copy" }),
97
- isCopied ? "Copied" : "Copy Link"
98
- ] })
99
- ] }),
100
- /* @__PURE__ */ jsx(InnerStepContainer, { children: isWalletConnect ? /* @__PURE__ */ jsx(Fragment, { children: GetWalletButton }) : /* @__PURE__ */ jsx(Link, { href: (_c = wallet.downloadUrl) != null ? _c : "", target: "_blank", children: GetWalletButton }) })
101
- ] });
102
- }
103
- }, [wallet, walletDisplayHelpers, externalWalletError, qrUri]);
104
- useEffect(() => {
105
- if (!wallet) {
106
- setStep(ModalStep.AUTH_MAIN);
107
- }
108
- }, [wallet]);
109
- if (!wallet) {
110
- return null;
111
- }
112
- return /* @__PURE__ */ jsx(Container, { children: Content });
113
- };
114
- const Container = styled(StepContainer)`
115
- flex: 1;
116
- justify-content: space-between;
117
- `;
118
- const Text = styled(CenteredText)`
119
- white-space: pre-line;
120
- `;
121
- const ExternalButton = styled(CpslButton)`
122
- display: flex;
123
- gap: 8px;
124
- align-items: center;
125
- justify-content: center;
126
- width: 100%;
127
- cursor: pointer;
128
- margin-top: 8px;
129
- text-decoration: none;
130
- `;
131
- const ExternalIcon = styled(CpslIcon)`
132
- --height: 20px;
133
- --width: 20px;
134
- `;
135
- const Link = styled.a`
136
- text-decoration: none;
137
- `;
138
- export {
139
- ExternalWalletStep
140
- };
@@ -1,17 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- var TabValue = /* @__PURE__ */ ((TabValue2) => {
4
- TabValue2["extension"] = "extension";
5
- TabValue2["mobile"] = "mobile";
6
- TabValue2["web"] = "web";
7
- return TabValue2;
8
- })(TabValue || {});
9
- const TABS = {
10
- extension: { label: "Extension", value: "extension" /* extension */, icon: "puzzlePiece" },
11
- mobile: { label: "Mobile", value: "mobile" /* mobile */, icon: "phone" },
12
- web: { label: "Web", value: "web" /* web */, icon: "globe" }
13
- };
14
- export {
15
- TABS,
16
- TabValue
17
- };
@@ -1,96 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import { CpslButton, CpslSpinner, CpslText } from "@getpara/react-components";
7
- import { useEffect, useState } from "react";
8
- import { styled } from "styled-components";
9
- import { ModalStep } from "../../utils/steps.js";
10
- import { useModalStore, useThemeStore, useUserInfoStore } from "../../stores/index.js";
11
- import { ErrorContainer, ErrorIcon, Heading, InnerStepContainer, StepContainer } from "../common.js";
12
- import { AuthMethod } from "@getpara/core-sdk";
13
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.js";
14
- import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
15
- const ExternalWalletVerificationStep = () => {
16
- const theme = useThemeStore((state) => state.theme);
17
- const authInfo = useUserInfoStore((state) => state.getAuthInfo());
18
- const setStep = useModalStore((state) => state.setStep);
19
- const setWebAuthURLForCreate = useModalStore((state) => state.setWebAuthURLForCreate);
20
- const isIFrameReady = useModalStore((state) => state.isIFrameReady);
21
- const setIsIFrameReady = useModalStore((state) => state.setIsIFrameReady);
22
- const setIFrameUrl = useModalStore((state) => state.setIFrameUrl);
23
- const externalWalletError = useModalStore((state) => state.externalWalletError);
24
- const setExternalWalletError = useModalStore((state) => state.setExternalWalletError);
25
- const para = useInternalClient();
26
- const { verifyWalletSignature } = useExternalWallets();
27
- const [shouldRouteToStep, setShouldRouteToStep] = useState();
28
- const [isVerifying, setIsVerifying] = useState(false);
29
- useEffect(() => {
30
- handleVerifyWallet();
31
- }, []);
32
- useEffect(() => {
33
- if (!!shouldRouteToStep && isIFrameReady) {
34
- setTimeout(() => {
35
- setStep(shouldRouteToStep);
36
- setIsVerifying(false);
37
- }, 200);
38
- }
39
- }, [shouldRouteToStep, isIFrameReady]);
40
- const handleVerifyWallet = () => __async(void 0, null, function* () {
41
- setIsVerifying(true);
42
- try {
43
- setIsIFrameReady(false);
44
- const supportedCreateAuthMethods = yield para.getSupportedCreateAuthMethods();
45
- const walletSignature = yield verifyWalletSignature();
46
- if (!walletSignature.signature || !walletSignature.address) {
47
- console.error("No signature or address found on the verifyWalletSignature response.");
48
- setIsVerifying(false);
49
- return;
50
- }
51
- const url = yield para.verifyExternalWallet({
52
- address: walletSignature.address,
53
- signedMessage: walletSignature.signature,
54
- cosmosPublicKeyHex: walletSignature.cosmosPublicKeyHex,
55
- cosmosSigner: walletSignature.cosmosSigner
56
- });
57
- if (supportedCreateAuthMethods.has(AuthMethod.PASSWORD) && supportedCreateAuthMethods.has(AuthMethod.PASSKEY)) {
58
- const passwordAuthUrl = yield para.getSetupPasswordURL({ authType: authInfo == null ? void 0 : authInfo.authType, theme });
59
- setWebAuthURLForCreate(yield para.shortenLoginLink(url));
60
- setIFrameUrl(yield para.shortenLoginLink(passwordAuthUrl));
61
- setShouldRouteToStep(ModalStep.BIOMETRIC_CREATION);
62
- return;
63
- } else if (supportedCreateAuthMethods.has(AuthMethod.PASSWORD)) {
64
- const url2 = yield para.getSetupPasswordURL({ authType: authInfo == null ? void 0 : authInfo.authType, theme });
65
- setIFrameUrl(yield para.shortenLoginLink(url2));
66
- setShouldRouteToStep(ModalStep.PASSWORD_CREATION);
67
- return;
68
- } else {
69
- setWebAuthURLForCreate(yield para.shortenLoginLink(url));
70
- setStep(ModalStep.BIOMETRIC_CREATION);
71
- }
72
- } catch (e) {
73
- console.error("Error verifying signature:", e);
74
- setExternalWalletError(["Signature verification failed."]);
75
- setIsVerifying(false);
76
- }
77
- });
78
- return /* @__PURE__ */ jsxs(StepContainer, { $wide: true, children: [
79
- /* @__PURE__ */ jsxs(InnerStepContainer, { children: [
80
- /* @__PURE__ */ jsx(Heading, { variant: "headingS", weight: "bold", children: "Verify Your Wallet" }),
81
- /* @__PURE__ */ jsx(InlineText, { variant: "bodyS", color: "secondary", children: "Sign the message with your wallet to complete sign up." }),
82
- !!(externalWalletError == null ? void 0 : externalWalletError[0]) && /* @__PURE__ */ jsxs(ErrorContainer, { children: [
83
- /* @__PURE__ */ jsx(ErrorIcon, { icon: "alertCircle" }),
84
- /* @__PURE__ */ jsx(CpslText, { weight: "semiBold", color: "error", children: externalWalletError == null ? void 0 : externalWalletError[0] })
85
- ] })
86
- ] }),
87
- /* @__PURE__ */ jsx(InnerStepContainer, { children: isVerifying ? /* @__PURE__ */ jsx(CpslSpinner, {}) : /* @__PURE__ */ jsx(CpslButton, { onClick: handleVerifyWallet, children: "Retry" }) })
88
- ] });
89
- };
90
- const InlineText = styled(CpslText)`
91
- text-align: center;
92
- display: inline-block;
93
- `;
94
- export {
95
- ExternalWalletVerificationStep
96
- };
@@ -1,172 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import styled from "styled-components";
7
- import { useExternalWallets } from "../../providers/ExternalWalletContext.js";
8
- import { StyledCpslTileButton } from "../common.js";
9
- import { CpslButton, CpslIcon, CpslInput, CpslText } from "@getpara/react-components";
10
- import { useModalStore, useThemeStore } from "../../stores/index.js";
11
- import { ModalStep } from "../../utils/steps.js";
12
- import { useState } from "react";
13
- import { hasEmbeddedAuth } from "../../utils/authLayoutHelpers.js";
14
- const HAS_MORE_LENGTH = 3;
15
- const ExternalWallets = () => {
16
- const { wallets, connectExternalWallet } = useExternalWallets();
17
- const setSelectedExternalWalletId = useModalStore((state) => state.setSelectedExternalWalletId);
18
- const setStep = useModalStore((state) => state.setStep);
19
- const showAll = useModalStore((state) => state.step === ModalStep.EX_WALLET_MORE);
20
- const authLayout = useThemeStore((state) => state.authLayout);
21
- const [search, setSearch] = useState("");
22
- const hasMore = wallets.length > HAS_MORE_LENGTH;
23
- const walletsToShow = showAll || !hasMore ? search ? wallets.filter((w) => w.name.toLowerCase().includes(search.toLowerCase())) : wallets : wallets.slice(0, HAS_MORE_LENGTH);
24
- const showMoreButton = !showAll && hasMore;
25
- const handleShowAll = () => {
26
- setStep(ModalStep.EX_WALLET_MORE);
27
- };
28
- const handleParaClick = () => {
29
- setStep(ModalStep.AUTH_MORE);
30
- };
31
- const handleWalletClick = (wallet) => () => {
32
- setSelectedExternalWalletId(wallet.id);
33
- setStep(ModalStep.EX_WALLET_SELECTED);
34
- if (wallet.installed) {
35
- connectExternalWallet(wallet);
36
- } else if (wallet.isMobile) {
37
- connectExternalWallet(wallet, true);
38
- }
39
- };
40
- return /* @__PURE__ */ jsxs(Container, { $maxHeight: showAll, children: [
41
- showAll && /* @__PURE__ */ jsxs(Fragment, { children: [
42
- /* @__PURE__ */ jsx(SearchInputWrapper, { children: /* @__PURE__ */ jsx(
43
- SearchInput,
44
- {
45
- placeholder: "Search for your wallet",
46
- onCpslInput: (e) => __async(void 0, null, function* () {
47
- setSearch(e.target.value);
48
- }),
49
- value: search,
50
- style: { width: "100%" },
51
- children: /* @__PURE__ */ jsx(SearchIcon, { slot: "start", icon: "search" })
52
- }
53
- ) }),
54
- hasEmbeddedAuth(authLayout) && /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, variant: "tertiary", onClick: handleParaClick, children: /* @__PURE__ */ jsxs(WalletButtonOuterContainer, { children: [
55
- /* @__PURE__ */ jsxs(WalletButtonInnerContainer, { children: [
56
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "paraIcon" }),
57
- /* @__PURE__ */ jsx(CpslText, { weight: "medium", children: "Para" })
58
- ] }),
59
- /* @__PURE__ */ jsx(Badge, { $show: true, $variant: "installed", children: /* @__PURE__ */ jsx(CpslText, { variant: "body2XS", weight: "medium", children: "Available" }) })
60
- ] }) })
61
- ] }),
62
- walletsToShow.map(
63
- (wallet) => showAll ? /* @__PURE__ */ jsx(CpslButton, { fullWidth: true, variant: "tertiary", onClick: handleWalletClick(wallet), children: /* @__PURE__ */ jsxs(WalletButtonOuterContainer, { children: [
64
- /* @__PURE__ */ jsxs(WalletButtonInnerContainer, { children: [
65
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", src: wallet.iconUrl }),
66
- /* @__PURE__ */ jsx(CpslText, { weight: "medium", children: wallet.name })
67
- ] }),
68
- /* @__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" }) })
69
- ] }) }, wallet.id) : /* @__PURE__ */ jsx(WalletTileButton, { src: wallet.iconUrl, onClick: handleWalletClick(wallet), children: /* @__PURE__ */ jsxs(TileButtonInnerContainer, { children: [
70
- wallet.installed && /* @__PURE__ */ jsx(InstalledIndicator, {}),
71
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", weight: "medium", children: wallet.name })
72
- ] }) }, wallet.id)
73
- ),
74
- showMoreButton && /* @__PURE__ */ jsxs(CpslButton, { variant: "tertiary", fullWidth: true, onClick: handleShowAll, children: [
75
- /* @__PURE__ */ jsx(CpslIcon, { slot: "start", icon: "wallet" }),
76
- "More Wallets"
77
- ] }),
78
- showAll && /* @__PURE__ */ jsx(BlurContainer, {})
79
- ] });
80
- };
81
- const Container = styled.div`
82
- position: relative;
83
- display: flex;
84
- justify-content: center;
85
- gap: 8px;
86
- flex-wrap: wrap;
87
-
88
- max-height: ${({ $maxHeight }) => $maxHeight ? "348px" : "none"};
89
- overflow-y: auto;
90
-
91
- &::-webkit-scrollbar {
92
- display: none;
93
- }
94
- -ms-overflow-style: none;
95
- scrollbar-width: none;
96
- `;
97
- const WalletTileButton = styled(StyledCpslTileButton)`
98
- flex: 1;
99
- `;
100
- const WalletButtonOuterContainer = styled.div`
101
- width: 100%;
102
- display: flex;
103
- align-items: center;
104
- gap: 8px;
105
- justify-content: space-between;
106
- `;
107
- const WalletButtonInnerContainer = styled.div`
108
- display: flex;
109
- align-items: center;
110
- gap: 8px;
111
-
112
- cpsl-icon {
113
- --icon-color: var(--cpsl-color-contrast);
114
- }
115
- cpsl-text {
116
- &::part(text-element) {
117
- color: var(--cpsl-color-contrast);
118
- }
119
- }
120
- `;
121
- const Badge = styled.div`
122
- visibility: ${({ $show }) => $show ? "visible" : "hidden"};
123
- padding: 2px 4px;
124
- border-radius: 4px;
125
- border: 1px solid;
126
- border-color: ${({ $variant }) => $variant === "installed" ? "var(--cpsl-color-utility-green)" : "var(--cpsl-color-text-primary)"};
127
- cpsl-text {
128
- &::part(text-element) {
129
- color: ${({ $variant }) => $variant === "installed" ? "var(--cpsl-color-utility-green)" : "var(--cpsl-color-text-primary)"};
130
- }
131
- }
132
- `;
133
- const InstalledIndicator = styled.span`
134
- width: 8px;
135
- height: 8px;
136
- border-radius: 100%;
137
- background-color: var(--cpsl-color-utility-green);
138
- `;
139
- const TileButtonInnerContainer = styled.div`
140
- display: flex;
141
- gap: 4px;
142
- align-items: center;
143
- `;
144
- const SearchIcon = styled(CpslIcon)`
145
- --icon-color: var(--cpsl-color-contrast);
146
- `;
147
- const SearchInputWrapper = styled.div`
148
- width: 100%;
149
- background-color: var(--cpsl-color-background-0);
150
-
151
- position: sticky;
152
- top: 0;
153
- padding-bottom: 4px;
154
- margin-bottom: -4px;
155
- `;
156
- const SearchInput = styled(CpslInput)`
157
- width: 100%;
158
- --container-background-color: var(--cpsl-color-background-8);
159
- --input-background-color: var(--cpsl-color-background-8);
160
- `;
161
- const BlurContainer = styled.div`
162
- position: sticky;
163
- height: 56px;
164
- width: 100%;
165
- bottom: 0;
166
-
167
- background: linear-gradient(0deg, var(--cpsl-color-background-0) 0%, rgba(234, 239, 211, 0) 100%);
168
- pointer-events: none;
169
- `;
170
- export {
171
- ExternalWallets
172
- };
@@ -1,8 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { TExternalWallet } from '../../types/externalWallets.js';
3
- interface ExternalWalletsWrapperProps extends PropsWithChildren {
4
- wallets?: TExternalWallet[];
5
- externalWalletsWithFullAuth?: TExternalWallet[];
6
- }
7
- export declare const ExternalWalletsWrapper: ({ children, wallets, externalWalletsWithFullAuth }: ExternalWalletsWrapperProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};