@daimo/pay 0.3.21 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/build/index.d.ts +132 -301
  2. package/build/package.json.js +103 -0
  3. package/build/package.json.js.map +1 -0
  4. package/build/src/assets/ScanIconWithLogos.js +34 -0
  5. package/build/src/assets/ScanIconWithLogos.js.map +1 -0
  6. package/build/src/assets/browsers.js +13 -0
  7. package/build/src/assets/browsers.js.map +1 -0
  8. package/build/src/assets/chains.js +152 -0
  9. package/build/src/assets/chains.js.map +1 -0
  10. package/build/src/assets/coins.js +6 -0
  11. package/build/src/assets/coins.js.map +1 -0
  12. package/build/src/assets/crepe.js +8 -0
  13. package/build/src/assets/crepe.js.map +1 -0
  14. package/build/src/assets/icons.js +28 -0
  15. package/build/src/assets/icons.js.map +1 -0
  16. package/build/src/assets/logos.js +131 -0
  17. package/build/src/assets/logos.js.map +1 -0
  18. package/build/src/assets/wallet.js +8 -0
  19. package/build/src/assets/wallet.js.map +1 -0
  20. package/build/src/assets/wave.js +6 -0
  21. package/build/src/assets/wave.js.map +1 -0
  22. package/build/src/components/Common/Alert/index.js +10 -0
  23. package/build/src/components/Common/Alert/index.js.map +1 -0
  24. package/build/src/components/Common/Alert/styles.js +55 -0
  25. package/build/src/components/Common/Alert/styles.js.map +1 -0
  26. package/build/src/components/Common/Avatar/index.js +66 -0
  27. package/build/src/components/Common/Avatar/index.js.map +1 -0
  28. package/build/src/components/Common/Avatar/styles.js +59 -0
  29. package/build/src/components/Common/Avatar/styles.js.map +1 -0
  30. package/build/src/components/Common/BrowserIcon/index.js +28 -0
  31. package/build/src/components/Common/BrowserIcon/index.js.map +1 -0
  32. package/build/src/components/Common/BrowserIcon/styles.js +20 -0
  33. package/build/src/components/Common/BrowserIcon/styles.js.map +1 -0
  34. package/build/src/components/Common/Button/index.js +38 -0
  35. package/build/src/components/Common/Button/index.js.map +1 -0
  36. package/build/src/components/Common/Button/styles.js +291 -0
  37. package/build/src/components/Common/Button/styles.js.map +1 -0
  38. package/build/src/components/Common/Chain/index.js +25 -0
  39. package/build/src/components/Common/Chain/index.js.map +1 -0
  40. package/build/src/components/Common/Chain/styles.js +94 -0
  41. package/build/src/components/Common/Chain/styles.js.map +1 -0
  42. package/build/src/components/Common/ChainSelectList/index.js +107 -0
  43. package/build/src/components/Common/ChainSelectList/index.js.map +1 -0
  44. package/build/src/components/Common/ChainSelectList/styles.js +228 -0
  45. package/build/src/components/Common/ChainSelectList/styles.js.map +1 -0
  46. package/build/src/components/Common/ConnectorList/index.js +70 -0
  47. package/build/src/components/Common/ConnectorList/index.js.map +1 -0
  48. package/build/src/components/Common/ConnectorList/styles.js +314 -0
  49. package/build/src/components/Common/ConnectorList/styles.js.map +1 -0
  50. package/build/src/components/Common/CopyToClipboard/CopyToClipboardIcon.js +71 -0
  51. package/build/src/components/Common/CopyToClipboard/CopyToClipboardIcon.js.map +1 -0
  52. package/build/src/components/Common/CopyToClipboard/index.js +51 -0
  53. package/build/src/components/Common/CopyToClipboard/index.js.map +1 -0
  54. package/build/src/components/Common/CustomQRCode/QRCode.js +69 -0
  55. package/build/src/components/Common/CustomQRCode/QRCode.js.map +1 -0
  56. package/build/src/components/Common/CustomQRCode/index.js +22 -0
  57. package/build/src/components/Common/CustomQRCode/index.js.map +1 -0
  58. package/build/src/components/Common/CustomQRCode/styles.js +155 -0
  59. package/build/src/components/Common/CustomQRCode/styles.js.map +1 -0
  60. package/build/src/components/Common/FitText/index.js +27 -0
  61. package/build/src/components/Common/FitText/index.js.map +1 -0
  62. package/build/src/components/Common/Modal/index.js +297 -0
  63. package/build/src/components/Common/Modal/index.js.map +1 -0
  64. package/build/src/components/Common/Modal/styles.js +660 -0
  65. package/build/src/components/Common/Modal/styles.js.map +1 -0
  66. package/build/src/components/Common/OptionsList/index.js +106 -0
  67. package/build/src/components/Common/OptionsList/index.js.map +1 -0
  68. package/build/src/components/Common/OptionsList/styles.js +165 -0
  69. package/build/src/components/Common/OptionsList/styles.js.map +1 -0
  70. package/build/src/components/Common/OrderHeader/index.js +215 -0
  71. package/build/src/components/Common/OrderHeader/index.js.map +1 -0
  72. package/build/src/components/Common/Portal/index.js +31 -0
  73. package/build/src/components/Common/Portal/index.js.map +1 -0
  74. package/build/src/components/Common/PoweredByFooter/index.js +44 -0
  75. package/build/src/components/Common/PoweredByFooter/index.js.map +1 -0
  76. package/build/src/components/Common/ScrollArea/index.js +62 -0
  77. package/build/src/components/Common/ScrollArea/index.js.map +1 -0
  78. package/build/src/components/Common/ScrollArea/styles.js +168 -0
  79. package/build/src/components/Common/ScrollArea/styles.js.map +1 -0
  80. package/build/src/components/Common/Spinner/index.js +24 -0
  81. package/build/src/components/Common/Spinner/index.js.map +1 -0
  82. package/build/src/components/Common/Spinner/styles.js +22 -0
  83. package/build/src/components/Common/Spinner/styles.js.map +1 -0
  84. package/build/src/components/Common/ThemedButton/index.js +25 -0
  85. package/build/src/components/Common/ThemedButton/index.js.map +1 -0
  86. package/build/src/components/Common/ThemedButton/styles.js +152 -0
  87. package/build/src/components/Common/ThemedButton/styles.js.map +1 -0
  88. package/build/src/components/Common/Tooltip/index.js +97 -0
  89. package/build/src/components/Common/Tooltip/index.js.map +1 -0
  90. package/build/src/components/Common/Tooltip/styles.js +81 -0
  91. package/build/src/components/Common/Tooltip/styles.js.map +1 -0
  92. package/build/src/components/DaimoPay.js +232 -0
  93. package/build/src/components/DaimoPay.js.map +1 -0
  94. package/build/src/components/DaimoPayButton/index.js +129 -0
  95. package/build/src/components/DaimoPayButton/index.js.map +1 -0
  96. package/build/src/components/DaimoPayButton/styles.js +50 -0
  97. package/build/src/components/DaimoPayButton/styles.js.map +1 -0
  98. package/build/src/components/DaimoPayModal/ConnectUsing.js +45 -0
  99. package/build/src/components/DaimoPayModal/ConnectUsing.js.map +1 -0
  100. package/build/src/components/DaimoPayModal/ConnectWithInjector/index.js +202 -0
  101. package/build/src/components/DaimoPayModal/ConnectWithInjector/index.js.map +1 -0
  102. package/build/src/components/DaimoPayModal/ConnectWithInjector/styles.js +133 -0
  103. package/build/src/components/DaimoPayModal/ConnectWithInjector/styles.js.map +1 -0
  104. package/build/src/components/DaimoPayModal/ConnectWithQRCode.js +75 -0
  105. package/build/src/components/DaimoPayModal/ConnectWithQRCode.js.map +1 -0
  106. package/build/src/components/DaimoPayModal/index.js +140 -0
  107. package/build/src/components/DaimoPayModal/index.js.map +1 -0
  108. package/build/src/components/DaimoPayThemeProvider/DaimoPayThemeProvider.js +21 -0
  109. package/build/src/components/DaimoPayThemeProvider/DaimoPayThemeProvider.js.map +1 -0
  110. package/build/src/components/Pages/About/graphics.js +187 -0
  111. package/build/src/components/Pages/About/graphics.js.map +1 -0
  112. package/build/src/components/Pages/About/index.js +131 -0
  113. package/build/src/components/Pages/About/index.js.map +1 -0
  114. package/build/src/components/Pages/About/styles.js +144 -0
  115. package/build/src/components/Pages/About/styles.js.map +1 -0
  116. package/build/src/components/Pages/Confirmation/index.js +105 -0
  117. package/build/src/components/Pages/Confirmation/index.js.map +1 -0
  118. package/build/src/components/Pages/Connectors/index.js +20 -0
  119. package/build/src/components/Pages/Connectors/index.js.map +1 -0
  120. package/build/src/components/Pages/Connectors/styles.js +267 -0
  121. package/build/src/components/Pages/Connectors/styles.js.map +1 -0
  122. package/build/src/components/Pages/DownloadApp/index.js +30 -0
  123. package/build/src/components/Pages/DownloadApp/index.js.map +1 -0
  124. package/build/src/components/Pages/MobileConnectors/index.js +73 -0
  125. package/build/src/components/Pages/MobileConnectors/index.js.map +1 -0
  126. package/build/src/components/Pages/MobileConnectors/styles.js +65 -0
  127. package/build/src/components/Pages/MobileConnectors/styles.js.map +1 -0
  128. package/build/src/components/Pages/Onboarding/index.js +18 -0
  129. package/build/src/components/Pages/Onboarding/index.js.map +1 -0
  130. package/build/src/components/Pages/Onboarding/styles.js +229 -0
  131. package/build/src/components/Pages/Onboarding/styles.js.map +1 -0
  132. package/build/src/components/Pages/PayWithToken/index.js +204 -0
  133. package/build/src/components/Pages/PayWithToken/index.js.map +1 -0
  134. package/build/src/components/Pages/SelectDepositAddressChain/index.js +32 -0
  135. package/build/src/components/Pages/SelectDepositAddressChain/index.js.map +1 -0
  136. package/build/src/components/Pages/SelectMethod/index.js +113 -0
  137. package/build/src/components/Pages/SelectMethod/index.js.map +1 -0
  138. package/build/src/components/Pages/SelectToken/index.js +62 -0
  139. package/build/src/components/Pages/SelectToken/index.js.map +1 -0
  140. package/build/src/components/Pages/Solana/ConnectSolana/index.js +37 -0
  141. package/build/src/components/Pages/Solana/ConnectSolana/index.js.map +1 -0
  142. package/build/src/components/Pages/Solana/ConnectorSolana/index.js +45 -0
  143. package/build/src/components/Pages/Solana/ConnectorSolana/index.js.map +1 -0
  144. package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js +85 -0
  145. package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js.map +1 -0
  146. package/build/src/components/Pages/Solana/SelectSolanaToken/index.js +38 -0
  147. package/build/src/components/Pages/Solana/SelectSolanaToken/index.js.map +1 -0
  148. package/build/src/components/Pages/SwitchNetworks/index.js +26 -0
  149. package/build/src/components/Pages/SwitchNetworks/index.js.map +1 -0
  150. package/build/src/components/Pages/WaitingDepositAddress/index.js +51 -0
  151. package/build/src/components/Pages/WaitingDepositAddress/index.js.map +1 -0
  152. package/build/src/components/Pages/WaitingOther/index.js +91 -0
  153. package/build/src/components/Pages/WaitingOther/index.js.map +1 -0
  154. package/build/src/components/Spinners/CircleSpinner/index.js +15 -0
  155. package/build/src/components/Spinners/CircleSpinner/index.js.map +1 -0
  156. package/build/src/components/Spinners/CircleSpinner/styles.js +118 -0
  157. package/build/src/components/Spinners/CircleSpinner/styles.js.map +1 -0
  158. package/build/src/components/Spinners/SquircleSpinner/index.js +15 -0
  159. package/build/src/components/Spinners/SquircleSpinner/index.js.map +1 -0
  160. package/build/src/components/Spinners/SquircleSpinner/styles.js +66 -0
  161. package/build/src/components/Spinners/SquircleSpinner/styles.js.map +1 -0
  162. package/build/src/components/contexts/solana/index.js +11 -0
  163. package/build/src/components/contexts/solana/index.js.map +1 -0
  164. package/build/src/components/contexts/web3/index.js +46 -0
  165. package/build/src/components/contexts/web3/index.js.map +1 -0
  166. package/build/src/constants/chainConfigs.js +306 -0
  167. package/build/src/constants/chainConfigs.js.map +1 -0
  168. package/build/src/constants/defaultTheme.js +6 -0
  169. package/build/src/constants/defaultTheme.js.map +1 -0
  170. package/build/src/defaultConfig.js +59 -0
  171. package/build/src/defaultConfig.js.map +1 -0
  172. package/build/src/defaultConnectors.js +43 -0
  173. package/build/src/defaultConnectors.js.map +1 -0
  174. package/build/src/hooks/connectors/useWalletConnectUri.js +93 -0
  175. package/build/src/hooks/connectors/useWalletConnectUri.js.map +1 -0
  176. package/build/src/hooks/useChainIsSupported.js +12 -0
  177. package/build/src/hooks/useChainIsSupported.js.map +1 -0
  178. package/build/src/hooks/useChains.js +11 -0
  179. package/build/src/hooks/useChains.js.map +1 -0
  180. package/build/src/hooks/useConnect.js +45 -0
  181. package/build/src/hooks/useConnect.js.map +1 -0
  182. package/build/src/hooks/useConnectCallback.js +18 -0
  183. package/build/src/hooks/useConnectCallback.js.map +1 -0
  184. package/build/src/hooks/useConnectors.js +29 -0
  185. package/build/src/hooks/useConnectors.js.map +1 -0
  186. package/build/src/hooks/useDaimoPayStatus.js +37 -0
  187. package/build/src/hooks/useDaimoPayStatus.js.map +1 -0
  188. package/build/src/hooks/useDepositAddressOptions.js +28 -0
  189. package/build/src/hooks/useDepositAddressOptions.js.map +1 -0
  190. package/build/src/hooks/useEnsFallbackConfig.js +16 -0
  191. package/build/src/hooks/useEnsFallbackConfig.js.map +1 -0
  192. package/build/src/hooks/useExternalPaymentOptions.js +46 -0
  193. package/build/src/hooks/useExternalPaymentOptions.js.map +1 -0
  194. package/build/src/hooks/useFitText.js +148 -0
  195. package/build/src/hooks/useFitText.js.map +1 -0
  196. package/build/src/hooks/useFocusTrap.js +60 -0
  197. package/build/src/hooks/useFocusTrap.js.map +1 -0
  198. package/build/src/hooks/useGoogleFont.js +45 -0
  199. package/build/src/hooks/useGoogleFont.js.map +1 -0
  200. package/build/src/hooks/useIsMobile.js +17 -0
  201. package/build/src/hooks/useIsMobile.js.map +1 -0
  202. package/build/src/hooks/useIsMounted.js +12 -0
  203. package/build/src/hooks/useIsMounted.js.map +1 -0
  204. package/build/src/hooks/useLastConnector.js +24 -0
  205. package/build/src/hooks/useLastConnector.js.map +1 -0
  206. package/build/src/hooks/useLocales.js +67 -0
  207. package/build/src/hooks/useLocales.js.map +1 -0
  208. package/build/src/hooks/useLockBodyScroll.js +53 -0
  209. package/build/src/hooks/useLockBodyScroll.js.map +1 -0
  210. package/build/src/hooks/useModal.js +35 -0
  211. package/build/src/hooks/useModal.js.map +1 -0
  212. package/build/src/hooks/usePayWithSolanaToken.js +50 -0
  213. package/build/src/hooks/usePayWithSolanaToken.js.map +1 -0
  214. package/build/src/hooks/usePayWithToken.js +57 -0
  215. package/build/src/hooks/usePayWithToken.js.map +1 -0
  216. package/build/src/hooks/usePaymentState.js +243 -0
  217. package/build/src/hooks/usePaymentState.js.map +1 -0
  218. package/build/src/hooks/usePrevious.js +14 -0
  219. package/build/src/hooks/usePrevious.js.map +1 -0
  220. package/build/src/hooks/useSolanaPaymentOptions.js +37 -0
  221. package/build/src/hooks/useSolanaPaymentOptions.js.map +1 -0
  222. package/build/src/hooks/useWalletConnectModal.js +52 -0
  223. package/build/src/hooks/useWalletConnectModal.js.map +1 -0
  224. package/build/src/hooks/useWalletPaymentOptions.js +40 -0
  225. package/build/src/hooks/useWalletPaymentOptions.js.map +1 -0
  226. package/build/src/hooks/useWindowSize.js +23 -0
  227. package/build/src/hooks/useWindowSize.js.map +1 -0
  228. package/build/src/index.js +10 -0
  229. package/build/src/index.js.map +1 -0
  230. package/build/src/localizations/index.js +57 -0
  231. package/build/src/localizations/index.js.map +1 -0
  232. package/build/src/localizations/locales/ar-AE.js +97 -0
  233. package/build/src/localizations/locales/ar-AE.js.map +1 -0
  234. package/build/src/localizations/locales/ca-AD.js +95 -0
  235. package/build/src/localizations/locales/ca-AD.js.map +1 -0
  236. package/build/src/localizations/locales/ee-EE.js +95 -0
  237. package/build/src/localizations/locales/ee-EE.js.map +1 -0
  238. package/build/src/localizations/locales/en-US.js +95 -0
  239. package/build/src/localizations/locales/en-US.js.map +1 -0
  240. package/build/src/localizations/locales/es-ES.js +95 -0
  241. package/build/src/localizations/locales/es-ES.js.map +1 -0
  242. package/build/src/localizations/locales/fa-IR.js +95 -0
  243. package/build/src/localizations/locales/fa-IR.js.map +1 -0
  244. package/build/src/localizations/locales/fr-FR.js +95 -0
  245. package/build/src/localizations/locales/fr-FR.js.map +1 -0
  246. package/build/src/localizations/locales/ja-JP.js +95 -0
  247. package/build/src/localizations/locales/ja-JP.js.map +1 -0
  248. package/build/src/localizations/locales/pt-BR.js +95 -0
  249. package/build/src/localizations/locales/pt-BR.js.map +1 -0
  250. package/build/src/localizations/locales/ru-RU.js +95 -0
  251. package/build/src/localizations/locales/ru-RU.js.map +1 -0
  252. package/build/src/localizations/locales/tr-TR.js +95 -0
  253. package/build/src/localizations/locales/tr-TR.js.map +1 -0
  254. package/build/src/localizations/locales/vi-VN.js +95 -0
  255. package/build/src/localizations/locales/vi-VN.js.map +1 -0
  256. package/build/src/localizations/locales/zh-CN.js +95 -0
  257. package/build/src/localizations/locales/zh-CN.js.map +1 -0
  258. package/build/src/styles/defaultTheme.js +89 -0
  259. package/build/src/styles/defaultTheme.js.map +1 -0
  260. package/build/src/styles/index.js +329 -0
  261. package/build/src/styles/index.js.map +1 -0
  262. package/build/src/styles/styled/index.js +16 -0
  263. package/build/src/styles/styled/index.js.map +1 -0
  264. package/build/src/styles/themes/base.js +141 -0
  265. package/build/src/styles/themes/base.js.map +1 -0
  266. package/build/src/styles/themes/index.js +13 -0
  267. package/build/src/styles/themes/index.js.map +1 -0
  268. package/build/src/styles/themes/midnight.js +76 -0
  269. package/build/src/styles/themes/midnight.js.map +1 -0
  270. package/build/src/styles/themes/minimal.js +96 -0
  271. package/build/src/styles/themes/minimal.js.map +1 -0
  272. package/build/src/styles/themes/nouns.js +81 -0
  273. package/build/src/styles/themes/nouns.js.map +1 -0
  274. package/build/src/styles/themes/retro.js +106 -0
  275. package/build/src/styles/themes/retro.js.map +1 -0
  276. package/build/src/styles/themes/rounded.js +106 -0
  277. package/build/src/styles/themes/rounded.js.map +1 -0
  278. package/build/src/styles/themes/soft.js +71 -0
  279. package/build/src/styles/themes/soft.js.map +1 -0
  280. package/build/src/styles/themes/web95.js +132 -0
  281. package/build/src/styles/themes/web95.js.map +1 -0
  282. package/build/src/utils/exports.js +12 -0
  283. package/build/src/utils/exports.js.map +1 -0
  284. package/build/src/utils/index.js +39 -0
  285. package/build/src/utils/index.js.map +1 -0
  286. package/build/src/utils/p3.js +16 -0
  287. package/build/src/utils/p3.js.map +1 -0
  288. package/build/src/utils/platform.js +13 -0
  289. package/build/src/utils/platform.js.map +1 -0
  290. package/build/src/utils/trpc.js +14 -0
  291. package/build/src/utils/trpc.js.map +1 -0
  292. package/build/src/utils/wallets.js +14 -0
  293. package/build/src/utils/wallets.js.map +1 -0
  294. package/build/src/wallets/index.js +32 -0
  295. package/build/src/wallets/index.js.map +1 -0
  296. package/build/src/wallets/useWallets.js +86 -0
  297. package/build/src/wallets/useWallets.js.map +1 -0
  298. package/build/src/wallets/walletConfigs.js +362 -0
  299. package/build/src/wallets/walletConfigs.js.map +1 -0
  300. package/package.json +5 -5
  301. package/build/index.es.js +0 -11565
  302. package/build/index.es.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
3
+ import { css } from 'styled-components';
4
+ import styled from '../../../styles/styled/index.js';
5
+ import Button from '../Button/index.js';
6
+ import CopyToClipboardIcon from './CopyToClipboardIcon.js';
7
+
8
+ const Container = styled.div `
9
+ --color: var(--ck-copytoclipboard-stroke);
10
+ --bg: var(--ck-body-background);
11
+ transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
12
+
13
+ cursor: pointer;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ margin-top: 4px;
18
+ gap: 8px;
19
+
20
+ ${(props) => props.$disabled
21
+ ? css `
22
+ cursor: not-allowed;
23
+ opacity: 0.4;
24
+ `
25
+ : css `
26
+ &:hover {
27
+ --color: var(--ck-body-color-muted);
28
+ }
29
+ `}
30
+ `;
31
+ const CopyToClipboard = ({ string, children, variant }) => {
32
+ const [clipboard, setClipboard] = useState(false);
33
+ let timeout;
34
+ const onCopy = () => {
35
+ if (!string)
36
+ return;
37
+ const str = string.trim();
38
+ if (navigator.clipboard) {
39
+ navigator.clipboard.writeText(str);
40
+ }
41
+ setClipboard(true);
42
+ clearTimeout(timeout);
43
+ timeout = setTimeout(() => setClipboard(false), 1000);
44
+ };
45
+ if (variant === "button")
46
+ return (jsx(Button, { disabled: !string, onClick: onCopy, icon: jsx(CopyToClipboardIcon, { copied: clipboard }), children: children }));
47
+ return (jsxs(Container, { onClick: onCopy, "$disabled": !string, children: [jsx(CopyToClipboardIcon, { copied: clipboard, dark: true }), children] }));
48
+ };
49
+
50
+ export { CopyToClipboard as default };
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,69 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import QRCodeUtil from 'qrcode';
3
+ import { useMemo } from 'react';
4
+
5
+ const generateMatrix = (value, errorCorrectionLevel) => {
6
+ const arr = Array.prototype.slice.call(QRCodeUtil.create(value, { errorCorrectionLevel }).modules.data, 0);
7
+ const sqrt = Math.sqrt(arr.length);
8
+ return arr.reduce((rows, key, index) => (index % sqrt === 0
9
+ ? rows.push([key])
10
+ : rows[rows.length - 1].push(key)) && rows, []);
11
+ };
12
+ function QRCode({ ecl = "M", size: sizeProp = 200, uri, clearArea = false, image, imageBackground = "transparent", }) {
13
+ const logoSize = clearArea ? 168 : 0;
14
+ const size = sizeProp - 10 * 2;
15
+ const dots = useMemo(() => {
16
+ const dots = [];
17
+ const matrix = generateMatrix(uri, ecl);
18
+ const cellSize = size / matrix.length;
19
+ let qrList = [
20
+ { x: 0, y: 0 },
21
+ { x: 1, y: 0 },
22
+ { x: 0, y: 1 },
23
+ ];
24
+ qrList.forEach(({ x, y }) => {
25
+ const x1 = (matrix.length - 7) * cellSize * x;
26
+ const y1 = (matrix.length - 7) * cellSize * y;
27
+ for (let i = 0; i < 3; i++) {
28
+ dots.push(jsx("rect", { fill: i % 2 !== 0
29
+ ? "var(--ck-qr-background, var(--ck-body-background))"
30
+ : "var(--ck-qr-dot-color)", rx: (i - 2) * -5 + (i === 0 ? 2 : 3), ry: (i - 2) * -5 + (i === 0 ? 2 : 3), width: cellSize * (7 - i * 2), height: cellSize * (7 - i * 2), x: x1 + cellSize * i, y: y1 + cellSize * i }, `${i}-${x}-${y}`));
31
+ }
32
+ });
33
+ if (image) {
34
+ const x1 = (matrix.length - 7) * cellSize * 1;
35
+ const y1 = (matrix.length - 7) * cellSize * 1;
36
+ dots.push(jsxs(Fragment, { children: [jsx("rect", { fill: imageBackground, rx: (0 - 2) * -5 + 2, ry: (0 - 2) * -5 + 2, width: cellSize * (7 - 0 * 2), height: cellSize * (7 - 0 * 2), x: x1 + cellSize * 0, y: y1 + cellSize * 0 }), jsx("foreignObject", { width: cellSize * (7 - 0 * 2), height: cellSize * (7 - 0 * 2), x: x1 + cellSize * 0, y: y1 + cellSize * 0, children: jsx("div", { style: { borderRadius: (0 - 2) * -5 + 2, overflow: "hidden" }, children: image }) })] }));
37
+ }
38
+ const clearArenaSize = Math.floor((logoSize + 25) / cellSize);
39
+ const matrixMiddleStart = matrix.length / 2 - clearArenaSize / 2;
40
+ const matrixMiddleEnd = matrix.length / 2 + clearArenaSize / 2 - 1;
41
+ matrix.forEach((row, i) => {
42
+ row.forEach((_, j) => {
43
+ if (matrix[i][j]) {
44
+ // Do not render dots under position squares
45
+ if (!((i < 7 && j < 7) ||
46
+ (i > matrix.length - 8 && j < 7) ||
47
+ (i < 7 && j > matrix.length - 8))) {
48
+ //if (image && i > matrix.length - 9 && j > matrix.length - 9) return;
49
+ if (image ||
50
+ !(i > matrixMiddleStart &&
51
+ i < matrixMiddleEnd &&
52
+ j > matrixMiddleStart &&
53
+ j < matrixMiddleEnd)) {
54
+ dots.push(jsx("circle", { cx: i * cellSize + cellSize / 2, cy: j * cellSize + cellSize / 2, fill: "var(--ck-qr-dot-color)", r: cellSize / 3 }, `circle-${i}-${j}`));
55
+ }
56
+ }
57
+ }
58
+ });
59
+ });
60
+ return dots;
61
+ }, [ecl, size, uri]);
62
+ return (jsxs("svg", { height: size, width: size, viewBox: `0 0 ${size} ${size}`, style: {
63
+ width: size,
64
+ height: size,
65
+ }, children: [jsx("rect", { fill: "transparent", height: size, width: size }), dots] }));
66
+ }
67
+
68
+ export { QRCode };
69
+ //# sourceMappingURL=QRCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QRCode.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,22 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { QRCodeContainer, QRCodeContent, LogoContainer, LogoIcon, QRPlaceholder } from './styles.js';
3
+ import { AnimatePresence, motion } from 'framer-motion';
4
+ import Tooltip from '../Tooltip/index.js';
5
+ import useWindowSize from '../../../hooks/useWindowSize.js';
6
+ import { QRCode } from './QRCode.js';
7
+
8
+ function CustomQRCode({ value, image, imageBackground, imagePosition = "center", tooltipMessage, }) {
9
+ const windowSize = useWindowSize();
10
+ const Logo = windowSize.width > 920 && tooltipMessage ? (jsx(Tooltip, { xOffset: 139, yOffset: 5, delay: 0.1, message: tooltipMessage, children: image })) : (image);
11
+ return (jsx(QRCodeContainer, { children: jsxs(QRCodeContent, { children: [image && (jsx(LogoContainer, { children: jsx(LogoIcon, { "$wcLogo": imagePosition !== "center", style: {
12
+ background: imagePosition === "center" ? imageBackground : undefined,
13
+ }, children: Logo }) })), jsx(AnimatePresence, { initial: false, children: value ? (jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0, position: "absolute", inset: [0, 0] }, transition: {
14
+ duration: 0.2,
15
+ }, children: jsx(QRCode, { uri: value, size: 576, ecl: "H", clearArea: !!(imagePosition === "center" && image) }) }, value)) : (jsxs(QRPlaceholder, { initial: { opacity: 0.1 }, animate: { opacity: 0.1 }, exit: { opacity: 0, position: "absolute", inset: [0, 0] }, transition: {
16
+ duration: 0.2,
17
+ }, children: [jsx("span", {}), jsx("span", {}), jsx("span", {}), jsx("div", {})] })) })] }) }));
18
+ }
19
+ CustomQRCode.displayName = "CustomQRCode";
20
+
21
+ export { CustomQRCode as default };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,155 @@
1
+ import { motion } from 'framer-motion';
2
+ import { keyframes, css } from 'styled-components';
3
+ import styled from '../../../styles/styled/index.js';
4
+
5
+ const QRCodeContainer = styled(motion.div) `
6
+ z-index: 3;
7
+ position: relative;
8
+ overflow: hidden;
9
+ height: 0;
10
+ padding-bottom: 100% !important;
11
+ display: flex;
12
+ align-items: center;
13
+ justify-content: center;
14
+ margin: 1px 0 2px;
15
+ border-radius: var(--ck-qr-border-radius, 24px);
16
+ background: var(--ck-qr-background, transparent);
17
+ box-shadow: 0 0 0 1px var(--ck-qr-border-color);
18
+ backface-visibility: hidden;
19
+ svg {
20
+ display: block;
21
+ max-width: 100%;
22
+ width: 100%;
23
+ height: auto;
24
+ }
25
+ `;
26
+ const QRCodeContent = styled(motion.div) `
27
+ position: absolute;
28
+ inset: 13px;
29
+ svg {
30
+ width: 100% !important;
31
+ height: auto !important;
32
+ }
33
+ `;
34
+ const PlaceholderKeyframes = keyframes `
35
+ 0%{ background-position: 100% 0; }
36
+ 100%{ background-position: -100% 0; }
37
+ `;
38
+ const QRPlaceholder = styled(motion.div) `
39
+ --color: var(--ck-qr-dot-color);
40
+ --bg: var(--ck-qr-background, var(--ck-body-background));
41
+
42
+ position: absolute;
43
+ inset: 0;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ > div {
48
+ z-index: 4;
49
+ position: relative;
50
+ width: 28%;
51
+ height: 28%;
52
+ border-radius: 20px;
53
+ background: var(--bg);
54
+ box-shadow: 0 0 0 7px var(--bg);
55
+ }
56
+ > span {
57
+ z-index: 4;
58
+ position: absolute;
59
+ background: var(--color);
60
+ border-radius: 12px;
61
+ width: 13.25%;
62
+ height: 13.25%;
63
+ box-shadow: 0 0 0 4px var(--bg);
64
+ &:before {
65
+ content: "";
66
+ position: absolute;
67
+ inset: 9px;
68
+ border-radius: 3px;
69
+ box-shadow: 0 0 0 4px var(--bg);
70
+ }
71
+ &:nth-child(1) {
72
+ top: 0;
73
+ left: 0;
74
+ }
75
+ &:nth-child(2) {
76
+ top: 0;
77
+ right: 0;
78
+ }
79
+ &:nth-child(3) {
80
+ bottom: 0;
81
+ left: 0;
82
+ }
83
+ }
84
+ &:before {
85
+ z-index: 3;
86
+ content: "";
87
+ position: absolute;
88
+ inset: 0;
89
+ background: repeat;
90
+ background-size: 1.888% 1.888%;
91
+ background-image: radial-gradient(var(--color) 41%, transparent 41%);
92
+ }
93
+ &:after {
94
+ z-index: 5;
95
+ content: "";
96
+ position: absolute;
97
+ inset: 0;
98
+ transform: scale(1.5) rotate(45deg);
99
+ background-image: linear-gradient(
100
+ 90deg,
101
+ rgba(255, 255, 255, 0) 50%,
102
+ rgba(255, 255, 255, 1),
103
+ rgba(255, 255, 255, 0)
104
+ );
105
+ background-size: 200% 100%;
106
+ animation: ${PlaceholderKeyframes} 1000ms linear infinite both;
107
+ }
108
+ `;
109
+ const LogoContainer = styled(motion.div) `
110
+ z-index: 6;
111
+ position: absolute;
112
+ top: 0;
113
+ left: 0;
114
+ width: 100%;
115
+ height: 100%;
116
+ transform: translateY(50%) scale(0.9999); // Shifting fix
117
+ `;
118
+ const LogoIcon = styled(motion.div) `
119
+ z-index: 6;
120
+ position: absolute;
121
+ left: 50%;
122
+ overflow: hidden;
123
+
124
+ transform: translate(-50%, -50%) scale(0.9999); // Shifting fix
125
+
126
+ svg {
127
+ display: block;
128
+ position: relative;
129
+ width: 100%;
130
+ height: 100%;
131
+ }
132
+
133
+ ${(props) => props.$wcLogo
134
+ ? css `
135
+ width: 29%;
136
+ height: 20.5%;
137
+ `
138
+ : css `
139
+ width: 28%;
140
+ height: 28%;
141
+ border-radius: 17px;
142
+ &:before {
143
+ pointer-events: none;
144
+ z-index: 2;
145
+ content: "";
146
+ position: absolute;
147
+ inset: 0;
148
+ border-radius: inherit;
149
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
150
+ }
151
+ `}
152
+ `;
153
+
154
+ export { LogoContainer, LogoIcon, PlaceholderKeyframes, QRCodeContainer, QRCodeContent, QRPlaceholder };
155
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,27 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import React from 'react';
3
+ import useFitText from '../../../hooks/useFitText.js';
4
+
5
+ const FitText = ({ children }) => {
6
+ const [ready, setReady] = React.useState(false);
7
+ const { fontSize, ref: textRef } = useFitText({
8
+ logLevel: "none",
9
+ maxFontSize: 100,
10
+ minFontSize: 70,
11
+ onStart: () => setReady(true),
12
+ onFinish: () => setReady(true),
13
+ });
14
+ return (jsx("div", { ref: textRef, style: {
15
+ visibility: ready ? "visible" : "hidden",
16
+ fontSize: `${fontSize}%`,
17
+ maxHeight: "100%",
18
+ maxWidth: "100%",
19
+ display: "flex",
20
+ justifyContent: "center",
21
+ alignItems: "center",
22
+ }, children: children }));
23
+ };
24
+ FitText.displayName = "FitText";
25
+
26
+ export { FitText as default };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,297 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useEffect, useState, useCallback, useRef } from 'react';
3
+ import { AnimatePresence, motion } from 'framer-motion';
4
+ import { ResetContainer } from '../../../styles/index.js';
5
+ import Portal from '../Portal/index.js';
6
+ import { isMobile, flattenChildren, isWalletConnectConnector } from '../../../utils/index.js';
7
+ import { ModalContainer, BackgroundOverlay, Container, BoxContainer, DisclaimerBackground, Disclaimer, ErrorMessage, ControllerContainer, CloseButton, BackButton, InfoButton, ModalHeading, InnerContainer, PageContents, PageContainer, TextWithHr } from './styles.js';
8
+ import useLockBodyScroll from '../../../hooks/useLockBodyScroll.js';
9
+ import { usePayContext, ROUTES } from '../../DaimoPay.js';
10
+ import { getChainName } from '@daimo/contract';
11
+ import { useTransition } from 'react-transition-state';
12
+ import { useAccount, useSwitchChain } from 'wagmi';
13
+ import FocusTrap from '../../../hooks/useFocusTrap.js';
14
+ import useLocales from '../../../hooks/useLocales.js';
15
+ import usePrevious from '../../../hooks/usePrevious.js';
16
+ import { useWallet } from '../../../wallets/useWallets.js';
17
+ import { useThemeContext } from '../../DaimoPayThemeProvider/DaimoPayThemeProvider.js';
18
+ import FitText from '../FitText/index.js';
19
+
20
+ const InfoIcon = ({ ...props }) => (jsx("svg", { "aria-hidden": "true", width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20 11C20 15.9706 15.9706 20 11 20C6.02944 20 2 15.9706 2 11C2 6.02944 6.02944 2 11 2C15.9706 2 20 6.02944 20 11ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11ZM11.6445 12.7051C11.6445 13.1348 11.3223 13.4678 10.7744 13.4678C10.2266 13.4678 9.92578 13.1885 9.92578 12.6191V12.4795C9.92578 11.4268 10.4951 10.8574 11.2686 10.3203C12.2031 9.67578 12.665 9.32129 12.665 8.59082C12.665 7.76367 12.0205 7.21582 11.043 7.21582C10.3232 7.21582 9.80762 7.57031 9.45312 8.16113C9.38282 8.24242 9.32286 8.32101 9.2667 8.39461C9.04826 8.68087 8.88747 8.8916 8.40039 8.8916C8.0459 8.8916 7.66992 8.62305 7.66992 8.15039C7.66992 7.96777 7.70215 7.7959 7.75586 7.61328C8.05664 6.625 9.27051 5.75488 11.1182 5.75488C12.9336 5.75488 14.5234 6.71094 14.5234 8.50488C14.5234 9.7832 13.7822 10.417 12.7402 11.1045C11.999 11.5986 11.6445 11.9746 11.6445 12.5762V12.7051ZM11.9131 15.5625C11.9131 16.1855 11.376 16.6797 10.7529 16.6797C10.1299 16.6797 9.59277 16.1748 9.59277 15.5625C9.59277 14.9395 10.1191 14.4453 10.7529 14.4453C11.3867 14.4453 11.9131 14.9287 11.9131 15.5625Z", fill: "currentColor" }) }));
21
+ const CloseIcon = ({ ...props }) => (jsx(motion.svg, { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M1 13L13 1M1 1L13 13", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) }));
22
+ const BackIcon = ({ ...props }) => (jsx(motion.svg, { width: 9, height: 16, viewBox: "0 0 9 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M8 1L1 8L8 15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
23
+ const contentTransitionDuration = 0.22;
24
+ const contentVariants = {
25
+ initial: {
26
+ //willChange: 'transform,opacity',
27
+ zIndex: 2,
28
+ opacity: 0,
29
+ },
30
+ animate: {
31
+ opacity: 1,
32
+ scale: 1,
33
+ transition: {
34
+ duration: contentTransitionDuration * 0.75,
35
+ delay: contentTransitionDuration * 0.25,
36
+ ease: [0.26, 0.08, 0.25, 1],
37
+ },
38
+ },
39
+ exit: {
40
+ zIndex: 1,
41
+ opacity: 0,
42
+ pointerEvents: "none",
43
+ position: "absolute",
44
+ left: ["50%", "50%"],
45
+ x: ["-50%", "-50%"],
46
+ transition: {
47
+ duration: contentTransitionDuration,
48
+ ease: [0.26, 0.08, 0.25, 1],
49
+ },
50
+ },
51
+ };
52
+ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onBack, onInfo, }) => {
53
+ const context = usePayContext();
54
+ const themeContext = useThemeContext();
55
+ const mobile = isMobile();
56
+ const { daimoPayOrder, selectedExternalOption, selectedTokenOption, selectedSolanaTokenOption, selectedDepositAddressOption, } = context.paymentState;
57
+ const wallet = useWallet(context.connector?.id);
58
+ const walletInfo = {
59
+ name: wallet?.name,
60
+ shortName: wallet?.shortName ?? wallet?.name,
61
+ icon: wallet?.iconConnector ?? wallet?.icon,
62
+ iconShape: wallet?.iconShape ?? "circle",
63
+ iconShouldShrink: wallet?.iconShouldShrink,
64
+ };
65
+ const locales = useLocales({
66
+ CONNECTORNAME: walletInfo?.name,
67
+ });
68
+ const [state, setOpen] = useTransition({
69
+ timeout: mobile ? 160 : 160, // different animations, 10ms extra to avoid final-frame drops
70
+ preEnter: true,
71
+ mountOnEnter: true,
72
+ unmountOnExit: true,
73
+ });
74
+ const mounted = !(state === "exited" || state === "unmounted");
75
+ const rendered = state === "preEnter" || state !== "exiting";
76
+ const currentDepth = context.route === ROUTES.CONNECTORS
77
+ ? 0
78
+ : context.route === ROUTES.DOWNLOAD
79
+ ? 2
80
+ : 1;
81
+ const prevDepth = usePrevious(currentDepth, currentDepth);
82
+ if (!positionInside)
83
+ useLockBodyScroll(mounted);
84
+ usePrevious(pageId, pageId);
85
+ useEffect(() => {
86
+ setOpen(open);
87
+ if (open)
88
+ setInTransition(undefined);
89
+ }, [open]);
90
+ const [dimensions, setDimensions] = useState({
91
+ width: undefined,
92
+ height: undefined,
93
+ });
94
+ const [inTransition, setInTransition] = useState(undefined);
95
+ // Calculate new content bounds
96
+ const updateBounds = (node) => {
97
+ const bounds = {
98
+ width: node?.offsetWidth,
99
+ height: node?.offsetHeight,
100
+ };
101
+ setDimensions({
102
+ width: `${bounds?.width}px`,
103
+ height: `${bounds?.height}px`,
104
+ });
105
+ };
106
+ let blockTimeout;
107
+ const contentRef = useCallback((node) => {
108
+ if (!node)
109
+ return;
110
+ ref.current = node;
111
+ // Avoid transition mixups
112
+ setInTransition(inTransition === undefined ? false : true);
113
+ clearTimeout(blockTimeout);
114
+ blockTimeout = setTimeout(() => setInTransition(false), 360);
115
+ // Calculate new content bounds
116
+ updateBounds(node);
117
+ }, [open, inTransition]);
118
+ // Update layout on chain/network switch to avoid clipping
119
+ const { chain } = useAccount();
120
+ const { switchChain } = useSwitchChain();
121
+ const ref = useRef(null);
122
+ useEffect(() => {
123
+ if (ref.current)
124
+ updateBounds(ref.current);
125
+ }, [chain, switchChain, mobile, context.options, context.resize]);
126
+ useEffect(() => {
127
+ if (!mounted) {
128
+ setDimensions({
129
+ width: undefined,
130
+ height: undefined,
131
+ });
132
+ return;
133
+ }
134
+ const listener = (e) => {
135
+ if (e.key === "Escape" && onClose)
136
+ onClose();
137
+ };
138
+ document.addEventListener("keydown", listener);
139
+ return () => {
140
+ document.removeEventListener("keydown", listener);
141
+ };
142
+ }, [mounted, onClose]);
143
+ const dimensionsCSS = {
144
+ "--height": dimensions.height,
145
+ "--width": dimensions.width,
146
+ };
147
+ function shouldUseQrcode() {
148
+ if (!wallet)
149
+ return false; // Fail states are shown in the injector flow
150
+ const useInjector = !wallet.getWalletConnectDeeplink || wallet.isInstalled;
151
+ return !useInjector;
152
+ }
153
+ function getHeading() {
154
+ switch (context.route) {
155
+ case ROUTES.ABOUT:
156
+ return locales.aboutScreen_heading;
157
+ case ROUTES.CONNECT:
158
+ if (shouldUseQrcode()) {
159
+ return isWalletConnectConnector(wallet?.connector?.id)
160
+ ? locales.scanScreen_heading
161
+ : locales.scanScreen_heading_withConnector;
162
+ }
163
+ else {
164
+ return walletInfo?.name;
165
+ }
166
+ case ROUTES.SOLANA_CONNECT:
167
+ return "Connect Solana Wallet";
168
+ case ROUTES.SOLANA_CONNECTOR:
169
+ return context.solanaConnector ?? "Solana Wallet";
170
+ case ROUTES.CONNECTORS:
171
+ return locales.connectorsScreen_heading;
172
+ case ROUTES.MOBILECONNECTORS:
173
+ return locales.mobileConnectorsScreen_heading;
174
+ case ROUTES.DOWNLOAD:
175
+ return locales.downloadAppScreen_heading;
176
+ case ROUTES.ONBOARDING:
177
+ return locales.onboardingScreen_heading;
178
+ case ROUTES.SWITCHNETWORKS:
179
+ return locales.switchNetworkScreen_heading;
180
+ case ROUTES.SELECT_METHOD:
181
+ case ROUTES.SELECT_TOKEN:
182
+ case ROUTES.SOLANA_SELECT_TOKEN:
183
+ return daimoPayOrder?.metadata.intent;
184
+ case ROUTES.SOLANA_PAY_WITH_TOKEN:
185
+ if (!selectedSolanaTokenOption)
186
+ return undefined;
187
+ return `Pay with ${selectedSolanaTokenOption.required.token.symbol}`;
188
+ case ROUTES.WAITING_OTHER:
189
+ return selectedExternalOption?.cta;
190
+ case ROUTES.SELECT_DEPOSIT_ADDRESS_CHAIN:
191
+ return "Select Chain";
192
+ case ROUTES.WAITING_DEPOSIT_ADDRESS:
193
+ if (!selectedDepositAddressOption)
194
+ return undefined;
195
+ return `Pay with ${selectedDepositAddressOption.id}`;
196
+ case ROUTES.PAY_WITH_TOKEN:
197
+ if (!selectedTokenOption)
198
+ return undefined;
199
+ const chainName = getChainName(selectedTokenOption.required.token.chainId ?? 0);
200
+ const capitalizedChainName = chainName.charAt(0).toUpperCase() + chainName.slice(1);
201
+ return `Pay with ${capitalizedChainName} ${selectedTokenOption.required.token.symbol}`;
202
+ case ROUTES.CONFIRMATION:
203
+ return "Payment Successful";
204
+ }
205
+ }
206
+ const Content = (jsx(ResetContainer, { "$useTheme": demo?.theme ?? themeContext.theme, "$useMode": demo?.mode ?? themeContext.mode, "$customTheme": demo?.customTheme ?? themeContext.customTheme, children: jsxs(ModalContainer, { role: "dialog", style: {
207
+ pointerEvents: rendered ? "auto" : "none",
208
+ position: positionInside ? "absolute" : undefined,
209
+ }, children: [!inline && (jsx(BackgroundOverlay, { "$active": rendered, onClick: onClose, "$blur": context.options?.overlayBlur })), jsxs(Container, { style: dimensionsCSS, initial: false, children: [jsx("div", { style: {
210
+ pointerEvents: inTransition ? "all" : "none", // Block interaction while transitioning
211
+ position: "absolute",
212
+ top: 0,
213
+ bottom: 0,
214
+ left: "50%",
215
+ transform: "translateX(-50%)",
216
+ width: "var(--width)",
217
+ zIndex: 9,
218
+ transition: "width 200ms ease",
219
+ } }), jsxs(BoxContainer, { className: `${rendered && "active"}`, children: [jsx(AnimatePresence, { initial: false, children: context.options?.disclaimer &&
220
+ context.route === ROUTES.CONNECTORS && (jsx(DisclaimerBackground, { initial: {
221
+ opacity: 0,
222
+ }, animate: {
223
+ opacity: 1,
224
+ }, exit: { opacity: 0 }, transition: {
225
+ delay: 0,
226
+ duration: 0.2,
227
+ ease: [0.25, 0.1, 0.25, 1.0],
228
+ }, children: jsx(Disclaimer, { children: jsx("div", { children: context.options?.disclaimer }) }) })) }), jsx(AnimatePresence, { initial: false, children: context.errorMessage && (jsxs(ErrorMessage, { initial: { y: "10%", x: "-50%" }, animate: { y: "-100%" }, exit: { y: "100%" }, transition: { duration: 0.2, ease: "easeInOut" }, children: [jsx("span", { children: context.errorMessage }), jsx("div", { onClick: () => context.displayError(null), style: {
229
+ position: "absolute",
230
+ right: 24,
231
+ top: 24,
232
+ cursor: "pointer",
233
+ }, children: jsx(CloseIcon, {}) })] })) }), jsxs(ControllerContainer, { children: [onClose && (jsx(CloseButton, { "aria-label": flattenChildren(locales.close).toString(), onClick: onClose, children: jsx(CloseIcon, {}) })), jsx("div", { style: {
234
+ position: "absolute",
235
+ top: 23,
236
+ left: 20,
237
+ width: 32,
238
+ height: 32,
239
+ }, children: jsx(AnimatePresence, { children: onBack ? (jsx(BackButton, { disabled: inTransition, "aria-label": flattenChildren(locales.back).toString(), onClick: onBack, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
240
+ duration: mobile ? 0 : 0.1,
241
+ delay: mobile ? 0.01 : 0,
242
+ }, children: jsx(BackIcon, {}) }, "backButton")) : (onInfo &&
243
+ !context.options?.hideQuestionMarkCTA && (jsx(InfoButton, { disabled: inTransition, "aria-label": flattenChildren(locales.moreInformation).toString(), onClick: onInfo, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
244
+ duration: mobile ? 0 : 0.1,
245
+ delay: mobile ? 0.01 : 0,
246
+ }, children: jsx(InfoIcon, {}) }, "infoButton"))) }) })] }), jsx(ModalHeading, { children: jsx(AnimatePresence, { children: jsx(motion.div, { style: {
247
+ position: "absolute",
248
+ top: 0,
249
+ bottom: 0,
250
+ left: 52,
251
+ right: 52,
252
+ display: "flex",
253
+ //alignItems: 'center',
254
+ justifyContent: "center",
255
+ }, initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
256
+ duration: mobile ? 0 : 0.17,
257
+ delay: mobile ? 0.01 : 0,
258
+ }, children: jsx(FitText, { children: getHeading() }) }, `${context.route}`) }) }), jsx(InnerContainer, { children: Object.keys(pages).map((key) => (jsx(Page, { open: key === pageId, initial: !positionInside && state !== "entered", enterAnim: key === pageId
259
+ ? currentDepth > prevDepth
260
+ ? "active-scale-up"
261
+ : "active"
262
+ : "", exitAnim: key !== pageId
263
+ ? currentDepth < prevDepth
264
+ ? "exit-scale-down"
265
+ : "exit"
266
+ : "", children: jsx(PageContents, { ref: contentRef, style: {
267
+ pointerEvents: key === pageId && rendered ? "auto" : "none",
268
+ }, children: pages[key] }, `inner-${key}`) }, key))) })] })] })] }) }));
269
+ return (jsx(Fragment, { children: mounted && (jsx(Fragment, { children: positionInside ? (Content) : (jsx(Fragment, { children: jsx(Portal, { children: jsx(FocusTrap, { children: Content }) }) })) })) }));
270
+ };
271
+ const Page = ({ children, open, initial, prevDepth, currentDepth, enterAnim, exitAnim, }) => {
272
+ const [state, setOpen] = useTransition({
273
+ timeout: 400,
274
+ preEnter: true,
275
+ initialEntered: open,
276
+ mountOnEnter: true,
277
+ unmountOnExit: true,
278
+ });
279
+ const mounted = !(state === "exited" || state === "unmounted");
280
+ const rendered = state === "preEnter" || state !== "exiting";
281
+ useEffect(() => {
282
+ setOpen(open);
283
+ }, [open]);
284
+ if (!mounted)
285
+ return null;
286
+ return (jsx(PageContainer, { className: `${rendered ? enterAnim : exitAnim}`, style: {
287
+ animationDuration: initial ? "0ms" : undefined,
288
+ animationDelay: initial ? "0ms" : undefined,
289
+ }, children: children }));
290
+ };
291
+ const OrDivider = ({ children }) => {
292
+ const locales = useLocales();
293
+ return (jsx(TextWithHr, { children: jsx("span", { children: children ?? locales.or }) }));
294
+ };
295
+
296
+ export { OrDivider, contentVariants, Modal as default };
297
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}