@getpara/react-sdk 2.0.0-alpha.7 → 2.0.0-alpha.71

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 (311) hide show
  1. package/README.md +21 -0
  2. package/dist/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
  3. package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
  4. package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
  5. package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
  6. package/dist/cosmos/actions/index.d.ts +2 -0
  7. package/dist/cosmos/actions/index.js +3 -0
  8. package/dist/cosmos/hooks/index.d.ts +2 -0
  9. package/dist/cosmos/hooks/index.js +3 -0
  10. package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
  11. package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
  12. package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
  13. package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
  14. package/dist/cosmos/index.d.ts +2 -0
  15. package/dist/cosmos/index.js +3 -0
  16. package/dist/css/modal.css +14 -1
  17. package/dist/evm/actions/getViemAccount.d.ts +22 -0
  18. package/dist/evm/actions/getViemAccount.js +20 -0
  19. package/dist/evm/actions/getViemClient.d.ts +17993 -0
  20. package/dist/evm/actions/getViemClient.js +25 -0
  21. package/dist/evm/actions/index.d.ts +2 -0
  22. package/dist/evm/actions/index.js +3 -0
  23. package/dist/evm/hooks/index.d.ts +2 -0
  24. package/dist/evm/hooks/index.js +3 -0
  25. package/dist/evm/hooks/useViemAccount.d.ts +26 -0
  26. package/dist/evm/hooks/useViemAccount.js +32 -0
  27. package/dist/evm/hooks/useViemClient.d.ts +17997 -0
  28. package/dist/evm/hooks/useViemClient.js +30 -0
  29. package/dist/evm/index.d.ts +2 -0
  30. package/dist/evm/index.js +3 -0
  31. package/dist/index.d.ts +3 -6
  32. package/dist/index.js +4 -9
  33. package/dist/provider/ParaProvider.d.ts +1 -2
  34. package/dist/provider/ParaProvider.js +17 -76
  35. package/dist/public/PPMori-Regular.woff2 +0 -0
  36. package/dist/public/PPMori-SemiBold.woff2 +0 -0
  37. package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
  38. package/dist/solana/actions/getSolanaSigner.js +15 -0
  39. package/dist/solana/actions/index.d.ts +1 -0
  40. package/dist/solana/actions/index.js +2 -0
  41. package/dist/solana/hooks/index.d.ts +1 -0
  42. package/dist/solana/hooks/index.js +2 -0
  43. package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
  44. package/dist/solana/hooks/useSolanaSigner.js +32 -0
  45. package/dist/solana/index.d.ts +2 -0
  46. package/dist/solana/index.js +3 -0
  47. package/package.json +37 -51
  48. package/styles.css/package.json +1 -1
  49. package/dist/cli/cli.mjs +0 -35
  50. package/dist/modal/ParaModal.d.ts +0 -2
  51. package/dist/modal/ParaModal.js +0 -262
  52. package/dist/modal/components/Account/Account.d.ts +0 -5
  53. package/dist/modal/components/Account/Account.js +0 -139
  54. package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -1
  55. package/dist/modal/components/AddFunds/AddFunds.js +0 -69
  56. package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +0 -1
  57. package/dist/modal/components/AddFunds/AddFundsAsset.js +0 -125
  58. package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
  59. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -78
  60. package/dist/modal/components/AddFunds/AddFundsContext.d.ts +0 -31
  61. package/dist/modal/components/AddFunds/AddFundsContext.js +0 -160
  62. package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
  63. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -49
  64. package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
  65. package/dist/modal/components/AddFunds/AddFundsProvider.js +0 -109
  66. package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
  67. package/dist/modal/components/AddFunds/AddFundsReceive.js +0 -83
  68. package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +0 -1
  69. package/dist/modal/components/AddFunds/AddFundsSettings.js +0 -237
  70. package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
  71. package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -7
  72. package/dist/modal/components/AddFunds/common.d.ts +0 -19
  73. package/dist/modal/components/AddFunds/common.js +0 -24
  74. package/dist/modal/components/AddFunds/index.d.ts +0 -3
  75. package/dist/modal/components/AddFunds/index.js +0 -4
  76. package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -6
  77. package/dist/modal/components/AuthInput/AuthInput.js +0 -262
  78. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
  79. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  80. package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
  81. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  82. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
  83. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -50
  84. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
  85. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -157
  86. package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -9
  87. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -67
  88. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
  89. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  90. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
  91. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  92. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
  93. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  94. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
  95. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -49
  96. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
  97. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -63
  98. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
  99. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -55
  100. package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
  101. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  102. package/dist/modal/components/Body/Body.d.ts +0 -11
  103. package/dist/modal/components/Body/Body.js +0 -327
  104. package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
  105. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -95
  106. package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
  107. package/dist/modal/components/ChainSwitch/config.js +0 -17
  108. package/dist/modal/components/Controls/Controls.d.ts +0 -5
  109. package/dist/modal/components/Controls/Controls.js +0 -77
  110. package/dist/modal/components/Controls/Selects.d.ts +0 -2
  111. package/dist/modal/components/Controls/Selects.js +0 -189
  112. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -1
  113. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -144
  114. package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
  115. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  116. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
  117. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -34
  118. package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
  119. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -173
  120. package/dist/modal/components/Footer/Footer.d.ts +0 -1
  121. package/dist/modal/components/Footer/Footer.js +0 -95
  122. package/dist/modal/components/Header/Header.d.ts +0 -1
  123. package/dist/modal/components/Header/Header.js +0 -43
  124. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
  125. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -54
  126. package/dist/modal/components/Hero/Hero.d.ts +0 -1
  127. package/dist/modal/components/Hero/Hero.js +0 -116
  128. package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
  129. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -59
  130. package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -1
  131. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -31
  132. package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -10
  133. package/dist/modal/components/ModalContent/ModalContent.js +0 -95
  134. package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -2
  135. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -27
  136. package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
  137. package/dist/modal/components/OAuth/OAuth.js +0 -79
  138. package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -1
  139. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -90
  140. package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
  141. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  142. package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
  143. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  144. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
  145. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -107
  146. package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
  147. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -132
  148. package/dist/modal/components/StripeComponents/StripeComponents.d.ts +0 -16
  149. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
  150. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
  151. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
  152. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -1
  153. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -143
  154. package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
  155. package/dist/modal/components/Waiting/Waiting.js +0 -17
  156. package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
  157. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  158. package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
  159. package/dist/modal/components/WalletCard/WalletCard.js +0 -128
  160. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
  161. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -73
  162. package/dist/modal/components/common.d.ts +0 -42
  163. package/dist/modal/components/common.js +0 -175
  164. package/dist/modal/components/index.d.ts +0 -1
  165. package/dist/modal/components/index.js +0 -2
  166. package/dist/modal/constants/constants.d.ts +0 -39
  167. package/dist/modal/constants/constants.js +0 -138
  168. package/dist/modal/constants/defaults.d.ts +0 -5
  169. package/dist/modal/constants/defaults.js +0 -10
  170. package/dist/modal/constants/oAuthLogos.d.ts +0 -8
  171. package/dist/modal/constants/oAuthLogos.js +0 -24
  172. package/dist/modal/hooks/useGoBack.d.ts +0 -1
  173. package/dist/modal/hooks/useGoBack.js +0 -43
  174. package/dist/modal/index.d.ts +0 -8
  175. package/dist/modal/index.js +0 -29
  176. package/dist/modal/stores/index.d.ts +0 -1
  177. package/dist/modal/stores/index.js +0 -2
  178. package/dist/modal/stores/modal/actions.d.ts +0 -3
  179. package/dist/modal/stores/modal/actions.js +0 -133
  180. package/dist/modal/stores/modal/useModalStore.d.ts +0 -102
  181. package/dist/modal/stores/modal/useModalStore.js +0 -68
  182. package/dist/modal/types/commonTypes.d.ts +0 -6
  183. package/dist/modal/types/commonTypes.js +0 -1
  184. package/dist/modal/types/externalWallets.d.ts +0 -33
  185. package/dist/modal/types/externalWallets.js +0 -32
  186. package/dist/modal/types/modalProps.d.ts +0 -124
  187. package/dist/modal/types/modalProps.js +0 -12
  188. package/dist/modal/utils/authInputHelpers.d.ts +0 -7
  189. package/dist/modal/utils/authInputHelpers.js +0 -38
  190. package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
  191. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  192. package/dist/modal/utils/countryCodes.d.ts +0 -8
  193. package/dist/modal/utils/countryCodes.js +0 -45
  194. package/dist/modal/utils/getMailtoLink.d.ts +0 -1
  195. package/dist/modal/utils/getMailtoLink.js +0 -10
  196. package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
  197. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  198. package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
  199. package/dist/modal/utils/isPasskeySupported.js +0 -15
  200. package/dist/modal/utils/openPopup.d.ts +0 -6
  201. package/dist/modal/utils/openPopup.js +0 -60
  202. package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
  203. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  204. package/dist/modal/utils/steps.d.ts +0 -120
  205. package/dist/modal/utils/steps.js +0 -247
  206. package/dist/modal/utils/stringFormatters.d.ts +0 -5
  207. package/dist/modal/utils/stringFormatters.js +0 -19
  208. package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
  209. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  210. package/dist/provider/actions/getAccount.d.ts +0 -26
  211. package/dist/provider/actions/getAccount.js +0 -51
  212. package/dist/provider/actions/getWallet.d.ts +0 -5
  213. package/dist/provider/actions/getWallet.js +0 -14
  214. package/dist/provider/actions/index.d.ts +0 -27
  215. package/dist/provider/actions/index.js +0 -59
  216. package/dist/provider/actions/utils.d.ts +0 -3
  217. package/dist/provider/actions/utils.js +0 -15
  218. package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
  219. package/dist/provider/components/CosmosWalletWrapper.js +0 -34
  220. package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
  221. package/dist/provider/components/EvmWalletWrapper.js +0 -34
  222. package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
  223. package/dist/provider/components/ExternalWalletWrapper.js +0 -139
  224. package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
  225. package/dist/provider/components/SolanaWalletWrapper.js +0 -36
  226. package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
  227. package/dist/provider/external/getParaCosmosConnector.js +0 -22
  228. package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
  229. package/dist/provider/external/getParaEvmConnector.js +0 -22
  230. package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
  231. package/dist/provider/external/getParaSolanaConnector.js +0 -22
  232. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -12
  233. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +0 -18
  234. package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -3
  235. package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +0 -21
  236. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -8
  237. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +0 -14
  238. package/dist/provider/hooks/index.d.ts +0 -3
  239. package/dist/provider/hooks/index.js +0 -4
  240. package/dist/provider/hooks/mutations/index.d.ts +0 -26
  241. package/dist/provider/hooks/mutations/index.js +0 -61
  242. package/dist/provider/hooks/mutations/utils.d.ts +0 -4
  243. package/dist/provider/hooks/mutations/utils.js +0 -22
  244. package/dist/provider/hooks/queries/index.d.ts +0 -3
  245. package/dist/provider/hooks/queries/index.js +0 -10
  246. package/dist/provider/hooks/queries/useAccount.d.ts +0 -5
  247. package/dist/provider/hooks/queries/useAccount.js +0 -21
  248. package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
  249. package/dist/provider/hooks/queries/useWallet.js +0 -22
  250. package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -6
  251. package/dist/provider/hooks/queries/useWalletBalance.js +0 -55
  252. package/dist/provider/hooks/utils/index.d.ts +0 -3
  253. package/dist/provider/hooks/utils/index.js +0 -10
  254. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
  255. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  256. package/dist/provider/hooks/utils/useClient.d.ts +0 -5
  257. package/dist/provider/hooks/utils/useClient.js +0 -10
  258. package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
  259. package/dist/provider/hooks/utils/useEventListeners.js +0 -147
  260. package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
  261. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  262. package/dist/provider/hooks/utils/useModal.d.ts +0 -8
  263. package/dist/provider/hooks/utils/useModal.js +0 -17
  264. package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
  265. package/dist/provider/hooks/utils/useWalletState.js +0 -48
  266. package/dist/provider/index.d.ts +0 -4
  267. package/dist/provider/index.js +0 -9
  268. package/dist/provider/providers/AuthProvider.d.ts +0 -35
  269. package/dist/provider/providers/AuthProvider.js +0 -498
  270. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
  271. package/dist/provider/providers/CosmosExternalWalletProvider.js +0 -66
  272. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
  273. package/dist/provider/providers/EvmExternalWalletProvider.js +0 -74
  274. package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -76
  275. package/dist/provider/providers/ExternalWalletProvider.js +0 -428
  276. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
  277. package/dist/provider/providers/SolanaExternalWalletProvider.js +0 -66
  278. package/dist/provider/stores/getters.d.ts +0 -4
  279. package/dist/provider/stores/getters.js +0 -13
  280. package/dist/provider/stores/setters.d.ts +0 -1
  281. package/dist/provider/stores/setters.js +0 -7
  282. package/dist/provider/stores/slices/client.d.ts +0 -3
  283. package/dist/provider/stores/slices/client.js +0 -9
  284. package/dist/provider/stores/slices/config.d.ts +0 -3
  285. package/dist/provider/stores/slices/config.js +0 -9
  286. package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
  287. package/dist/provider/stores/slices/externalWallets.js +0 -40
  288. package/dist/provider/stores/slices/index.d.ts +0 -4
  289. package/dist/provider/stores/slices/index.js +0 -5
  290. package/dist/provider/stores/slices/modal.d.ts +0 -3
  291. package/dist/provider/stores/slices/modal.js +0 -16
  292. package/dist/provider/stores/slices/wallet.d.ts +0 -3
  293. package/dist/provider/stores/slices/wallet.js +0 -13
  294. package/dist/provider/stores/types.d.ts +0 -64
  295. package/dist/provider/stores/types.js +0 -1
  296. package/dist/provider/stores/useStore.d.ts +0 -17
  297. package/dist/provider/stores/useStore.js +0 -28
  298. package/dist/provider/types/externalWalletProviders.d.ts +0 -12
  299. package/dist/provider/types/externalWalletProviders.js +0 -1
  300. package/dist/provider/types/provider.d.ts +0 -147
  301. package/dist/provider/types/provider.js +0 -1
  302. package/dist/provider/types/query.d.ts +0 -3
  303. package/dist/provider/types/query.js +0 -1
  304. package/dist/provider/types/utils.d.ts +0 -22
  305. package/dist/provider/types/utils.js +0 -1
  306. package/dist/provider/utils/constants.d.ts +0 -5
  307. package/dist/provider/utils/constants.js +0 -10
  308. package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
  309. package/dist/provider/utils/paraConfigTypeGuards.js +0 -13
  310. package/dist/provider/utils/renameMutations.d.ts +0 -5
  311. package/dist/provider/utils/renameMutations.js +0 -18
@@ -1,237 +0,0 @@
1
- "use client";
2
- import {
3
- __spreadProps,
4
- __spreadValues
5
- } from "../../../chunk-MMUBH76A.js";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- import { useEffect, useMemo, useState } from "react";
8
- import { useAddFunds } from "./AddFundsContext.js";
9
- import { CpslButton, CpslIcon, CpslInput, CpslRow, CpslText } from "@getpara/react-components";
10
- import { AssetIcon, HeaderSelect, HeaderSelectContainer, HeaderSelectItem, NetworkIcon } from "../common.js";
11
- import { getAssetCode, getNetworkName } from "../../constants/constants.js";
12
- import { EnabledFlow, getOnRampNetworks, OnRampPurchaseType } from "@getpara/web-sdk";
13
- import { OnRampStep, useModalStore } from "../../stores/index.js";
14
- import { useStore } from "../../../provider/stores/useStore.js";
15
- import styled from "styled-components";
16
- import { contentMotionProps, NoProviders } from "./common.js";
17
- import { AnimatePresence, motion, useIsPresent } from "framer-motion";
18
- import { AddFundsAsset } from "./AddFundsAsset.js";
19
- function NetworkPill({
20
- network,
21
- gap = "4px",
22
- slot,
23
- start,
24
- fix = false
25
- }) {
26
- return /* @__PURE__ */ jsxs(CpslRow, __spreadProps(__spreadValues({ gap }, slot ? { slot } : {}), { children: [
27
- start,
28
- /* @__PURE__ */ jsx(NetworkIcon, { network, size: "24px" }),
29
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "contrast", style: fix ? { marginRight: "8px" } : void 0, children: getNetworkName(network) })
30
- ] }));
31
- }
32
- function AssetPill({ asset, gap = "4px", slot, fix }) {
33
- if (!asset) {
34
- return null;
35
- }
36
- return /* @__PURE__ */ jsxs(CpslRow, __spreadProps(__spreadValues({ gap }, slot ? { slot } : {}), { children: [
37
- /* @__PURE__ */ jsx(AssetIcon, { asset, size: "24px" }),
38
- /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "contrast", style: fix ? { marginRight: "8px" } : void 0, children: getAssetCode(asset) })
39
- ] }));
40
- }
41
- const NetworkLabel = /* @__PURE__ */ jsx(CpslText, { variant: "bodyXS", color: "secondary", style: { margin: "0 8px" }, children: "Network" });
42
- function AddFundsSettings() {
43
- const isPresent = useIsPresent();
44
- const hideWallets = useStore((state) => {
45
- var _a;
46
- return (_a = state.modalConfig) == null ? void 0 : _a.hideWallets;
47
- });
48
- const setOnRampStep = useModalStore((state) => state.setOnRampStep);
49
- const {
50
- assets,
51
- networks,
52
- asset,
53
- setAsset,
54
- network,
55
- setNetwork,
56
- fiatQuantity,
57
- setFiatQuantity,
58
- onRampConfig,
59
- activeWallet,
60
- isProviderAllowed,
61
- tab
62
- } = useAddFunds();
63
- const [value, setValue] = useState(parseFloat(fiatQuantity || "25.00").toFixed(2));
64
- const narrowedNetworks = useMemo(() => {
65
- return !asset ? networks : getOnRampNetworks(onRampConfig.assetInfo, {
66
- walletType: activeWallet == null ? void 0 : activeWallet.type,
67
- allowed: onRampConfig.allowedAssets ? Object.entries(onRampConfig.allowedAssets).filter(([_, value2]) => value2 === true || value2.includes(asset)).map(([key]) => key) : void 0,
68
- assets: [asset],
69
- providers: onRampConfig.providers,
70
- action: tab === EnabledFlow.BUY ? OnRampPurchaseType.BUY : OnRampPurchaseType.SELL
71
- });
72
- }, [networks, network, asset, activeWallet == null ? void 0 : activeWallet.type, onRampConfig.providers, tab]);
73
- const content = useMemo(() => {
74
- if (!!asset && Object.values(isProviderAllowed).every((v) => !v) || assets.length === 0) {
75
- return /* @__PURE__ */ jsx(Container, __spreadProps(__spreadValues({}, contentMotionProps), { isPresent, children: /* @__PURE__ */ jsxs(NoProviders, { isHidden: Object.values(isProviderAllowed).some((v) => !!v), variant: "bodyM", children: [
76
- "No providers are available for this ",
77
- hideWallets ? "account" : "wallet"
78
- ] }) }), "noProviders");
79
- }
80
- return !!asset ? /* @__PURE__ */ jsx(Container, __spreadProps(__spreadValues({}, contentMotionProps), { isPresent, children: assets.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
81
- /* @__PURE__ */ jsxs(CpslRow, { children: [
82
- /* @__PURE__ */ jsx(HeaderSelectContainer, { children: assets.length > 1 ? /* @__PURE__ */ jsxs(
83
- HeaderSelect,
84
- {
85
- selectedValue: asset,
86
- onCpslSelectValueChange: (e) => {
87
- setAsset(e.detail);
88
- },
89
- showFormattedSelectedItem: true,
90
- placeholder: "Choose asset...",
91
- anchorElId: "inputContainer",
92
- $width: 160,
93
- autoWidth: true,
94
- selectedItemVariant: "bodyXS",
95
- children: [
96
- asset && /* @__PURE__ */ jsx(AssetPill, { asset, slot: "selected-item" }),
97
- assets.map((a) => /* @__PURE__ */ jsx(HeaderSelectItem, { slot: "items", value: a, children: /* @__PURE__ */ jsx(AssetPill, { gap: "8px", asset: a }) }, a))
98
- ]
99
- }
100
- ) : /* @__PURE__ */ jsx(AssetPill, { asset, fix: true }) }),
101
- /* @__PURE__ */ jsx(HeaderSelectContainer, { children: narrowedNetworks.length > 1 ? /* @__PURE__ */ jsxs(
102
- HeaderSelect,
103
- {
104
- selectedValue: network,
105
- onCpslSelectValueChange: (e) => {
106
- setNetwork(e.detail);
107
- },
108
- showFormattedSelectedItem: true,
109
- placeholder: "Choose network...",
110
- $width: 160,
111
- autoWidth: true,
112
- selectedItemVariant: "bodyXS",
113
- children: [
114
- network && /* @__PURE__ */ jsx(NetworkPill, { network, start: NetworkLabel, slot: "selected-item" }),
115
- narrowedNetworks.map((n) => /* @__PURE__ */ jsx(HeaderSelectItem, { slot: "items", value: n, children: /* @__PURE__ */ jsx(NetworkPill, { gap: "8px", network: n }) }, n))
116
- ]
117
- }
118
- ) : network ? /* @__PURE__ */ jsx(NetworkPill, { network, start: NetworkLabel, fix: true }) : null })
119
- ] }),
120
- /* @__PURE__ */ jsxs(CpslRow, { col: true, gap: "16px", children: [
121
- /* @__PURE__ */ jsx(
122
- Input,
123
- {
124
- value: value || "",
125
- fitContent: true,
126
- autoselect: true,
127
- onKeyDown: (e) => {
128
- if (!/^(\d|\.)$/.test(e.key) && !["Delete", "Backspace", "Tab", "Shift"].includes(e.key)) {
129
- e.preventDefault();
130
- }
131
- },
132
- onChange: (e) => {
133
- var _a;
134
- const numericValue = (((_a = e.currentTarget) == null ? void 0 : _a.value) || "").replace(/[^0-9.]/g, "");
135
- if (numericValue !== "") {
136
- const formattedValue = parseFloat(numericValue).toFixed(2);
137
- setValue(formattedValue);
138
- } else {
139
- setValue(null);
140
- }
141
- },
142
- onBlur: (e) => {
143
- const numericValue = (e.currentTarget.value || "").replace(/[^0-9.]/g, "");
144
- if (numericValue === "") {
145
- setValue(null);
146
- } else {
147
- setValue(parseFloat(numericValue).toFixed(2));
148
- }
149
- },
150
- placeholder: "0",
151
- children: /* @__PURE__ */ jsx(CurrencySign, { slot: "start", children: "$" })
152
- },
153
- value || ""
154
- ),
155
- /* @__PURE__ */ jsx(CpslRow, { style: { width: "100%" }, children: ["25", "50", "100"].map((quantity) => {
156
- return /* @__PURE__ */ jsxs(PresetButton, { fullWidth: true, variant: "secondary", onClick: () => setValue(`${quantity}.00`), children: [
157
- "$",
158
- quantity
159
- ] }, quantity);
160
- }) })
161
- ] }),
162
- /* @__PURE__ */ jsxs(
163
- CpslButton,
164
- {
165
- fullWidth: true,
166
- disabled: value === "",
167
- onClick: () => {
168
- setFiatQuantity(value != null ? value : void 0);
169
- setOnRampStep(OnRampStep.PROVIDER);
170
- },
171
- children: [
172
- "Continue",
173
- /* @__PURE__ */ jsx(CpslIcon, { icon: "arrow" })
174
- ]
175
- }
176
- )
177
- ] }) }), "quantity") : /* @__PURE__ */ jsx(AssetContainer, __spreadProps(__spreadValues({}, contentMotionProps), { isPresent, children: /* @__PURE__ */ jsx(AddFundsAsset, {}) }), "asset");
178
- }, [asset, network, assets, narrowedNetworks, isProviderAllowed, isPresent, value]);
179
- useEffect(() => {
180
- if (!network || !narrowedNetworks.includes(network)) {
181
- setNetwork(narrowedNetworks[0]);
182
- }
183
- }, [narrowedNetworks, network, tab]);
184
- useEffect(() => {
185
- if (!!asset && !assets.includes(asset)) {
186
- setAsset(assets[0]);
187
- }
188
- }, [assets, asset, tab]);
189
- return /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: content });
190
- }
191
- const Container = styled(motion.div)`
192
- width: 100%;
193
- height: 100%;
194
- align-self: center;
195
- display: flex;
196
- flex-direction: column;
197
- align-items: center;
198
- gap: 32px;
199
- position: relative;
200
- height: 320px;
201
- ${({ isPresent }) => isPresent ? "transform: none !important;" : ""};
202
-
203
- & > * {
204
- width: 100%;
205
- }
206
- `;
207
- const AssetContainer = styled(Container)`
208
- gap: 8px;
209
- `;
210
- const CurrencySign = styled.div`
211
- font-size: 72px;
212
- color: var(--cpsl-color-text-primary);
213
- position: relative;
214
- right: -16px;
215
- `;
216
- const PresetButton = styled(CpslButton)`
217
- --button-color: var(--cpsl-color-text-contrast);
218
- --button-font-size: 24px;
219
- --button-secondary-background-color: var(--cpsl-color-background-8);
220
- --button-secondary-border-color: var(--cpsl-color-background-8);
221
- --button-secondary-hover-color: var(--cpsl-color-text-contrast);
222
- --button-secondary-hover-background-color: var(--cpsl-color-background-16);
223
- --button-secondary-hover-border-color: var(--cpsl-color-background-16);
224
- flex: 1;
225
- `;
226
- const Input = styled(CpslInput)`
227
- --container-background-color: transparent;
228
- --container-height: 90px;
229
- --container-border-width: 0;
230
- --input-background-color: transparent;
231
- --input-font-size: 72px;
232
- --input-text-align: center;
233
- --input-width: 100%;
234
- `;
235
- export {
236
- AddFundsSettings
237
- };
@@ -1,2 +0,0 @@
1
- import { MoonPayEmbed } from '@getpara/react-common';
2
- export default MoonPayEmbed;
@@ -1,7 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { MoonPayEmbed } from "@getpara/react-common";
4
- var MoonPayEmbed_default = MoonPayEmbed;
5
- export {
6
- MoonPayEmbed_default as default
7
- };
@@ -1,19 +0,0 @@
1
- export declare const contentMotionProps: {
2
- transition: {
3
- duration: number;
4
- };
5
- initial: {
6
- opacity: number;
7
- };
8
- animate: {
9
- opacity: number;
10
- };
11
- exit: {
12
- opacity: number;
13
- };
14
- };
15
- export declare const NoProviders: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Omit<Omit<any, "ref"> & import("react").RefAttributes<any>, "ref"> & {
16
- ref?: ((instance: any) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<any> | null | undefined;
17
- }, {
18
- isHidden?: boolean;
19
- }>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>, keyof import("react").Component<any, {}, any>>;
@@ -1,24 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { CpslText } from "@getpara/react-components";
4
- import styled from "styled-components";
5
- const contentMotionProps = {
6
- transition: { duration: 0.2 },
7
- initial: { opacity: 0 },
8
- animate: { opacity: 1 },
9
- exit: { opacity: 0 }
10
- };
11
- const NoProviders = styled(CpslText)`
12
- width: 100%;
13
- text-align: center;
14
- visibility: ${({ isHidden }) => isHidden ? "hidden" : "visible"};
15
- position: absolute;
16
- top: 0;
17
- left: 0;
18
- right: 0;
19
- transition: visibility 0.2s;
20
- `;
21
- export {
22
- NoProviders,
23
- contentMotionProps
24
- };
@@ -1,3 +0,0 @@
1
- export * from './AddFunds.js';
2
- export * from './AddFundsAwaiting.js';
3
- export * from './AddFundsDone.js';
@@ -1,4 +0,0 @@
1
- "use client";
2
- export * from "./AddFunds.js";
3
- export * from "./AddFundsAwaiting.js";
4
- export * from "./AddFundsDone.js";
@@ -1,6 +0,0 @@
1
- interface AuthInputProps {
2
- disableEmailLogin?: boolean;
3
- disablePhoneLogin?: boolean;
4
- }
5
- export declare const AuthInput: ({ disableEmailLogin, disablePhoneLogin }: AuthInputProps) => import("react/jsx-runtime").JSX.Element | null;
6
- export {};
@@ -1,262 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- import {
7
- CpslButton,
8
- CpslIcon,
9
- CpslInput,
10
- CpslSelect,
11
- CpslSelectItem,
12
- CpslSpinner,
13
- CpslText
14
- } from "@getpara/react-components";
15
- import { useEffect, useMemo, useRef, useState } from "react";
16
- import styled from "styled-components";
17
- import countryCodes from "../../utils/countryCodes.js";
18
- import { MOBILE_SIZE } from "../../constants/constants.js";
19
- import { useDropdownPosition } from "./hooks/useDropdownPosition.js";
20
- import { defaultPhoneMask, phoneMasks } from "./phoneMasks.js";
21
- import { useInternalClient } from "../../../provider/hooks/utils/useInternalClient.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
- const DEFAULT_COUNTRY = { label: "United States", value: "+1", selectedLabel: "US", icon: "US" };
27
- const AuthInput = ({ disableEmailLogin, disablePhoneLogin }) => {
28
- var _a, _b, _c;
29
- const inputRef = useRef(null);
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
- });
35
- const para = useInternalClient();
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");
46
- const [identifier, setIdentifier] = useState(
47
- (() => {
48
- if (!(authInfo == null ? void 0 : authInfo.authType) || ["telegram", "farcaster", "externalWallet"].includes(authInfo == null ? void 0 : authInfo.authType)) {
49
- return "";
50
- }
51
- if (authInfo.authType !== "phone") {
52
- return authInfo.identifier;
53
- }
54
- return storedNationalNumber != null ? storedNationalNumber : "";
55
- })()
56
- );
57
- const [identifierType, setIdentifierType] = useState(
58
- authInfo && (authInfo.authType === "email" || authInfo.authType === "phone") ? authInfo.authType : void 0
59
- );
60
- const [matchedCountryCode, setMatchedCountryCode] = useState(
61
- (_a = countryCodes.find((option) => isCcMatch(countryCode, option))) != null ? _a : DEFAULT_COUNTRY
62
- );
63
- const [error, setError] = useState("");
64
- const [isPending, setIsPending] = useState(isSignUpOrLogInPending);
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]);
85
- const isEmail = identifierType === "email";
86
- const isPhone = identifierType === "phone";
87
- const isUnknown = !identifierType;
88
- const filteredCountryCodes = search ? countryCodes.filter(
89
- (cc) => cc.selectedLabel.toLowerCase().includes(search.toLowerCase()) || cc.label.toLowerCase().includes(search.toLowerCase()) || cc.value.toLowerCase().includes(search.toLowerCase())
90
- ) : countryCodes;
91
- const handleSearchInput = (ev) => {
92
- setSearch(ev.detail);
93
- };
94
- const handleIdentifierInput = (ev) => {
95
- var _a2;
96
- const newIdentifier = (_a2 = ev.detail.value) != null ? _a2 : "";
97
- let isNewPhone = false, isNewEmail = false;
98
- if (!disablePhoneLogin) {
99
- const countryCodeInputMatch = countryCodes.find((option) => isCcMatch(newIdentifier, option));
100
- if (countryCodeInputMatch) {
101
- setCountryCodes(countryCodeInputMatch);
102
- setIdentifierType("phone");
103
- setIdentifier("");
104
- return;
105
- }
106
- isNewPhone = !isEmail && isPhone ? /\d+$/.test(newIdentifier) : /\d\d\d+$/.test(newIdentifier);
107
- }
108
- if (!disableEmailLogin) {
109
- isNewEmail = /\D.*$/.test(newIdentifier);
110
- }
111
- setIdentifierType(isNewEmail ? "email" : isNewPhone ? "phone" : void 0);
112
- setIdentifier(newIdentifier);
113
- };
114
- const handleCountryCodeInput = (ev) => {
115
- const matchedCountryCode2 = countryCodes.find((code) => code.selectedLabel === ev.detail);
116
- if (matchedCountryCode2) {
117
- setCountryCodes(matchedCountryCode2);
118
- }
119
- };
120
- const onSubmit = () => __async(void 0, null, function* () {
121
- setError("");
122
- let auth;
123
- try {
124
- auth = validateAuth(identifier, countryCode, identifierType);
125
- signUpOrLogIn(auth);
126
- } catch (err) {
127
- setError(err.message);
128
- }
129
- });
130
- useEffect(() => {
131
- if (isSignUpOrLogInPending) {
132
- setIsPending(true);
133
- }
134
- }, [isSignUpOrLogInPending]);
135
- useEffect(() => {
136
- setIsPending(false);
137
- }, [error]);
138
- if (disableEmailLogin && disablePhoneLogin) {
139
- return null;
140
- }
141
- return /* @__PURE__ */ jsx(
142
- "form",
143
- {
144
- onSubmit: (e) => __async(void 0, null, function* () {
145
- e.preventDefault();
146
- onSubmit();
147
- }),
148
- children: /* @__PURE__ */ jsxs(
149
- StyledInput,
150
- {
151
- ref: inputRef,
152
- id: "authInput",
153
- placeholder: isEmail || disablePhoneLogin ? "Enter email" : isPhone || disableEmailLogin ? "Enter phone" : "Enter email or phone",
154
- onCpslInput: handleIdentifierInput,
155
- value: identifier,
156
- errorText: error,
157
- autofocus: true,
158
- inputMode: "email",
159
- onKeyDown: (e) => __async(void 0, null, function* () {
160
- return e.key === "Enter" && onSubmit();
161
- }),
162
- contrastText: true,
163
- isPhone,
164
- mask: identifierType === "phone" ? (_c = phoneMasks[(_b = matchedCountryCode.selectedLabel) != null ? _b : ""]) != null ? _c : defaultPhoneMask : void 0,
165
- enterkeyhint: "go",
166
- noAutoDisable: true,
167
- disabled: isPending,
168
- "data-testid": "auth-input",
169
- children: [
170
- /* @__PURE__ */ jsxs(IconContainer, { slot: "start", children: [
171
- !disableEmailLogin && (isUnknown || isEmail) && /* @__PURE__ */ jsx(CpslIcon, { "aria-label": "email", icon: "mail" }),
172
- !disablePhoneLogin && isUnknown && /* @__PURE__ */ jsx(CpslIcon, { "aria-label": "phone", icon: "phone" }),
173
- isPhone && /* @__PURE__ */ jsxs(
174
- CountryCodeSelect,
175
- {
176
- selectedValue: matchedCountryCode.selectedLabel,
177
- onCpslSelectValueChange: handleCountryCodeInput,
178
- showFormattedSelectedItem: true,
179
- autoWidth: true,
180
- dropdownMaxHeight,
181
- anchorElId: "authInput",
182
- $width: dropdownWidth != null ? dropdownWidth : 0,
183
- showSearch: true,
184
- searchPlaceholder: "Search Countries",
185
- onCpslSearchChange: handleSearchInput,
186
- "data-testid": "country-code-select",
187
- children: [
188
- matchedCountryCode && /* @__PURE__ */ jsxs(SelectedItem, { slot: "selected-item", children: [
189
- /* @__PURE__ */ jsx(CpslText, { children: matchedCountryCode.selectedLabel }),
190
- /* @__PURE__ */ jsx(CpslText, { children: matchedCountryCode.value })
191
- ] }),
192
- filteredCountryCodes.map((cc) => /* @__PURE__ */ jsxs(StyledSelectItem, { slot: "items", value: cc.selectedLabel, children: [
193
- /* @__PURE__ */ jsx(CpslText, { children: cc.label }),
194
- /* @__PURE__ */ jsx(CpslText, { children: cc.value })
195
- ] }, cc.selectedLabel))
196
- ]
197
- }
198
- )
199
- ] }),
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" }) })
201
- ]
202
- },
203
- "email"
204
- )
205
- }
206
- );
207
- };
208
- const IconContainer = styled.div`
209
- height: 100%;
210
- display: flex;
211
- align-items: center;
212
- gap: 8px;
213
- padding-right: 12px;
214
- border-right: 1px solid var(--cpsl-color-background-16);
215
-
216
- & cpsl-icon {
217
- --icon-color: var(--cpsl-color-contrast);
218
- }
219
- `;
220
- const CountryCodeSelect = styled(CpslSelect)`
221
- --container-height: 100%;
222
- --container-padding-start: 0px;
223
- --container-padding-end: 0px;
224
- --container-border-width: 0px;
225
- --container-gap: 4px;
226
- --container-background-color: transparent;
227
- --container-box-shadow: none;
228
-
229
- &::part(dropdown) {
230
- width: ${({ $width }) => `${$width - 2}px`};
231
- }
232
-
233
- &::part(popover) {
234
- @media (max-width: ${MOBILE_SIZE}px) {
235
- top: unset !important;
236
- bottom: 16px;
237
- }
238
-
239
- cpsl-auth-modal.force-mobile-media & {
240
- top: unset !important;
241
- bottom: 16px;
242
- }
243
- }
244
- `;
245
- const StyledSelectItem = styled(CpslSelectItem)`
246
- &::part(inner-container) {
247
- justify-content: space-between;
248
- }
249
- `;
250
- const SelectedItem = styled.div`
251
- display: flex;
252
- gap: 4px;
253
- align-items: center;
254
- `;
255
- const StyledInput = styled(CpslInput)`
256
- --container-background-color: var(--cpsl-color-background-8);
257
- --input-background-color: var(--cpsl-color-background-8);
258
- --container-padding-end: 8px;
259
- `;
260
- export {
261
- AuthInput
262
- };
@@ -1,7 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- export declare const useDropdownPosition: (inputRef: MutableRefObject<HTMLCpslInputElement | HTMLDivElement | null>) => {
3
- dropdownMaxHeight: number | undefined;
4
- dropdownWidth: number | undefined;
5
- mobileAnchor: number | undefined;
6
- resize: () => void;
7
- };
@@ -1,33 +0,0 @@
1
- "use client";
2
- import "../../../../chunk-MMUBH76A.js";
3
- import { useEffect, useState } from "react";
4
- const useDropdownPosition = (inputRef) => {
5
- const [dropdownMaxHeight, setDropdownMaxHeight] = useState();
6
- const [dropdownWidth, setDropdownWidth] = useState();
7
- const [mobileAnchor, setMobileAnchor] = useState();
8
- const resize = () => {
9
- var _a, _b, _c, _d;
10
- if (typeof window !== "undefined") {
11
- const newMaxHeight = Math.max(
12
- window.innerHeight - ((_b = (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.getBoundingClientRect().bottom) != null ? _b : 0) - 20,
13
- window.innerHeight * 0.25
14
- );
15
- setDropdownMaxHeight(newMaxHeight);
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
- }
19
- };
20
- if (inputRef.current && !dropdownMaxHeight) {
21
- resize();
22
- }
23
- useEffect(() => {
24
- typeof window !== "undefined" && window.addEventListener("resize", resize);
25
- return () => {
26
- typeof window !== "undefined" && window.removeEventListener("resize", resize);
27
- };
28
- }, []);
29
- return { dropdownMaxHeight, dropdownWidth, mobileAnchor, resize };
30
- };
31
- export {
32
- useDropdownPosition
33
- };