@rango-dev/widget-embedded 0.20.1-next.8 → 0.21.0

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 (294) hide show
  1. package/dist/QueueManager.d.ts.map +1 -1
  2. package/dist/components/AppRouter.d.ts.map +1 -1
  3. package/dist/components/AppRoutes.d.ts.map +1 -1
  4. package/dist/components/BlockchainList/BlockchainList.styles.d.ts +169 -1
  5. package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
  6. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +4 -0
  7. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
  8. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +514 -1089
  9. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  10. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  11. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  12. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +12 -0
  13. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
  14. package/dist/components/CustomCollapsible/CustomCollapsible.d.ts +5 -0
  15. package/dist/components/CustomCollapsible/CustomCollapsible.d.ts.map +1 -0
  16. package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts +654 -0
  17. package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -0
  18. package/dist/components/CustomCollapsible/CustomCollapsible.types.d.ts +10 -0
  19. package/dist/components/CustomCollapsible/CustomCollapsible.types.d.ts.map +1 -0
  20. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +20 -0
  21. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
  22. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +0 -1
  23. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
  24. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
  25. package/dist/components/Layout/Layout.d.ts +2 -3
  26. package/dist/components/Layout/Layout.d.ts.map +1 -1
  27. package/dist/components/Layout/Layout.helpers.d.ts +2 -0
  28. package/dist/components/Layout/Layout.helpers.d.ts.map +1 -0
  29. package/dist/components/Layout/Layout.styles.d.ts +14 -4
  30. package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
  31. package/dist/components/Layout/Layout.types.d.ts +6 -3
  32. package/dist/components/Layout/Layout.types.d.ts.map +1 -1
  33. package/dist/components/Layout/PageContainer.d.ts +166 -0
  34. package/dist/components/Layout/PageContainer.d.ts.map +1 -0
  35. package/dist/components/Layout/ScrollableArea.d.ts +164 -0
  36. package/dist/components/Layout/ScrollableArea.d.ts.map +1 -0
  37. package/dist/components/Layout/index.d.ts +2 -0
  38. package/dist/components/Layout/index.d.ts.map +1 -1
  39. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +4 -0
  40. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
  41. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +56 -0
  42. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
  43. package/dist/components/NoResult/NoResult.styles.d.ts +12 -0
  44. package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
  45. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  46. package/dist/components/NotificationContent/NotificationContent.styles.d.ts +16 -0
  47. package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
  48. package/dist/components/Quote/Quote.d.ts.map +1 -1
  49. package/dist/components/Quote/Quote.styles.d.ts +387 -3
  50. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  51. package/dist/components/Quote/Quote.types.d.ts +19 -0
  52. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  53. package/dist/components/Quote/QuoteCostDetails.d.ts +4 -0
  54. package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -0
  55. package/dist/components/Quote/QuoteCostDetails.styles.d.ts +806 -0
  56. package/dist/components/Quote/QuoteCostDetails.styles.d.ts.map +1 -0
  57. package/dist/components/Quote/QuoteSummary.d.ts.map +1 -1
  58. package/dist/components/Quote/QuoteSummary.styles.d.ts +8 -0
  59. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  60. package/dist/components/Quote/QuoteTrigger .d.ts +4 -0
  61. package/dist/components/Quote/QuoteTrigger .d.ts.map +1 -0
  62. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +16 -0
  63. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
  64. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +40 -0
  65. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
  66. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +20 -0
  67. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
  68. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +1 -0
  69. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
  70. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  71. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +16 -0
  72. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  73. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  74. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  75. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +1 -0
  76. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -1
  77. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +1 -0
  78. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
  79. package/dist/components/SearchInput/SearchInput.styles.d.ts +4 -0
  80. package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  81. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +11 -156
  82. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
  83. package/dist/components/SettingsContainer/index.d.ts +1 -1
  84. package/dist/components/SettingsContainer/index.d.ts.map +1 -1
  85. package/dist/components/Slippage/Slippage.styles.d.ts +20 -0
  86. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
  87. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  88. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  89. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  90. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  91. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +523 -1
  92. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  93. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -1
  94. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +4 -0
  95. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
  96. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +2 -1
  97. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -1
  98. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
  99. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -1
  100. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +4 -0
  101. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
  102. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +2 -0
  103. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  104. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  105. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +20 -0
  106. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  107. package/dist/components/TokenList/TokenList.styles.d.ts +68 -0
  108. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  109. package/dist/components/WalletModal/WalletModalContent.styles.d.ts +16 -0
  110. package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
  111. package/dist/components/WidgetEvents.d.ts.map +1 -1
  112. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts +4 -0
  113. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -0
  114. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.types.d.ts +4 -0
  115. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.types.d.ts.map +1 -0
  116. package/dist/components/common/ActivateTabAlert/index.d.ts +2 -0
  117. package/dist/components/common/ActivateTabAlert/index.d.ts.map +1 -0
  118. package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts +4 -0
  119. package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts.map +1 -0
  120. package/dist/components/common/ActivateTabModal/ActivateTabModal.types.d.ts +6 -0
  121. package/dist/components/common/ActivateTabModal/ActivateTabModal.types.d.ts.map +1 -0
  122. package/dist/components/common/ActivateTabModal/index.d.ts +2 -0
  123. package/dist/components/common/ActivateTabModal/index.d.ts.map +1 -0
  124. package/dist/constants/index.d.ts +1 -0
  125. package/dist/constants/index.d.ts.map +1 -1
  126. package/dist/constants/quote.d.ts +12 -0
  127. package/dist/constants/quote.d.ts.map +1 -0
  128. package/dist/constants/searchParams.d.ts +6 -6
  129. package/dist/constants/searchParams.d.ts.map +1 -1
  130. package/dist/containers/App/App.d.ts.map +1 -1
  131. package/dist/containers/App/App.styles.d.ts +4 -0
  132. package/dist/containers/App/App.styles.d.ts.map +1 -1
  133. package/dist/containers/QuoteInfo/QuoteInfo.d.ts +1 -1
  134. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  135. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +10 -314
  136. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  137. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -7
  138. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  139. package/dist/containers/Widget/Widget.d.ts.map +1 -1
  140. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -1
  141. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +7 -0
  142. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -1
  143. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
  144. package/dist/hooks/useLanguage.d.ts +2 -1
  145. package/dist/hooks/useLanguage.d.ts.map +1 -1
  146. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  147. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  148. package/dist/hooks/useSyncUrlAndStore/index.d.ts +2 -0
  149. package/dist/hooks/useSyncUrlAndStore/index.d.ts.map +1 -0
  150. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts +2 -0
  151. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts.map +1 -0
  152. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.d.ts +4 -0
  153. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.d.ts.map +1 -0
  154. package/dist/index.d.ts +4 -4
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js +2 -1
  157. package/dist/index.js.map +4 -4
  158. package/dist/libs/tabManager/index.d.ts +3 -0
  159. package/dist/libs/tabManager/index.d.ts.map +1 -0
  160. package/dist/libs/tabManager/tabManager.constants.d.ts +4 -0
  161. package/dist/libs/tabManager/tabManager.constants.d.ts.map +1 -0
  162. package/dist/libs/tabManager/tabManager.d.ts +63 -0
  163. package/dist/libs/tabManager/tabManager.d.ts.map +1 -0
  164. package/dist/libs/tabManager/tabManager.types.d.ts +29 -0
  165. package/dist/libs/tabManager/tabManager.types.d.ts.map +1 -0
  166. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  167. package/dist/pages/HistoryPage.d.ts.map +1 -1
  168. package/dist/pages/Home.d.ts.map +1 -1
  169. package/dist/pages/LanguagePage.d.ts.map +1 -1
  170. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  171. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  172. package/dist/pages/SettingsPage.d.ts.map +1 -1
  173. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  174. package/dist/pages/ThemePage.d.ts.map +1 -1
  175. package/dist/pages/WalletsPage.d.ts.map +1 -1
  176. package/dist/store/AppStore.d.ts +2 -2
  177. package/dist/store/app.d.ts +2 -2
  178. package/dist/store/slices/settings.d.ts +2 -2
  179. package/dist/store/slices/settings.d.ts.map +1 -1
  180. package/dist/store/ui.d.ts +12 -10
  181. package/dist/store/ui.d.ts.map +1 -1
  182. package/dist/types/notification.d.ts +1 -2
  183. package/dist/types/notification.d.ts.map +1 -1
  184. package/dist/utils/date.d.ts.map +1 -1
  185. package/dist/utils/quote.d.ts +5 -2
  186. package/dist/utils/quote.d.ts.map +1 -1
  187. package/dist/utils/swap.d.ts +5 -1
  188. package/dist/utils/swap.d.ts.map +1 -1
  189. package/dist/utils/ui.d.ts +2 -0
  190. package/dist/utils/ui.d.ts.map +1 -1
  191. package/package.json +7 -7
  192. package/src/QueueManager.tsx +4 -1
  193. package/src/components/AppRouter.tsx +1 -8
  194. package/src/components/AppRoutes.tsx +11 -0
  195. package/src/components/BlockchainList/BlockchainList.styles.ts +4 -3
  196. package/src/components/BlockchainList/BlockchainList.tsx +1 -1
  197. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +27 -96
  198. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +25 -40
  199. package/src/components/ConfirmWalletsModal/WalletList.tsx +3 -0
  200. package/src/components/CustomCollapsible/CustomCollapsible.styles.ts +75 -0
  201. package/src/components/CustomCollapsible/CustomCollapsible.tsx +55 -0
  202. package/src/components/CustomCollapsible/CustomCollapsible.types.ts +10 -0
  203. package/src/components/HeaderButtons/HeaderButtons.styles.ts +4 -1
  204. package/src/components/HeaderButtons/HeaderButtons.types.ts +0 -1
  205. package/src/components/HeaderButtons/HomeButtons.tsx +1 -2
  206. package/src/components/Layout/Layout.helpers.ts +16 -0
  207. package/src/components/Layout/Layout.styles.ts +17 -31
  208. package/src/components/Layout/Layout.tsx +60 -29
  209. package/src/components/Layout/Layout.types.ts +9 -8
  210. package/src/components/Layout/PageContainer.tsx +24 -0
  211. package/src/components/Layout/ScrollableArea.tsx +11 -0
  212. package/src/components/Layout/index.ts +2 -0
  213. package/src/components/NotificationContent/NotificationContent.tsx +10 -4
  214. package/src/components/Quote/Quote.styles.ts +44 -5
  215. package/src/components/Quote/Quote.tsx +10 -77
  216. package/src/components/Quote/Quote.types.ts +22 -0
  217. package/src/components/Quote/QuoteCostDetails.styles.ts +50 -0
  218. package/src/components/Quote/QuoteCostDetails.tsx +218 -0
  219. package/src/components/Quote/QuoteSummary.tsx +3 -2
  220. package/src/components/Quote/QuoteTrigger .tsx +215 -0
  221. package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +3 -1
  222. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +0 -1
  223. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +3 -1
  224. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  225. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -1
  226. package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +3 -1
  227. package/src/components/SettingsContainer/SettingsContainer.style.ts +0 -5
  228. package/src/components/SettingsContainer/index.ts +0 -1
  229. package/src/components/Slippage/Slippage.tsx +5 -5
  230. package/src/components/Slippage/SlippageTooltipContent.tsx +1 -1
  231. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +12 -13
  232. package/src/components/SwapDetails/SwapDetails.helpers.tsx +43 -3
  233. package/src/components/SwapDetails/SwapDetails.styles.ts +18 -6
  234. package/src/components/SwapDetails/SwapDetails.tsx +16 -5
  235. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +13 -7
  236. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +2 -0
  237. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +9 -1
  238. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +10 -2
  239. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +2 -0
  240. package/src/components/SwapsGroup/SwapsGroup.tsx +18 -7
  241. package/src/components/TokenList/TokenList.styles.ts +2 -0
  242. package/src/components/TokenList/TokenList.tsx +1 -1
  243. package/src/components/WidgetEvents.tsx +2 -14
  244. package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +26 -0
  245. package/src/components/common/ActivateTabAlert/ActivateTabAlert.types.ts +3 -0
  246. package/src/components/common/ActivateTabAlert/index.ts +1 -0
  247. package/src/components/common/ActivateTabModal/ActivateTabModal.tsx +31 -0
  248. package/src/components/common/ActivateTabModal/ActivateTabModal.types.ts +5 -0
  249. package/src/components/common/ActivateTabModal/index.ts +1 -0
  250. package/src/constants/index.ts +1 -0
  251. package/src/constants/quote.ts +23 -0
  252. package/src/constants/searchParams.ts +6 -6
  253. package/src/containers/App/App.styles.ts +2 -0
  254. package/src/containers/App/App.tsx +1 -4
  255. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
  256. package/src/containers/QuoteInfo/QuoteInfo.tsx +30 -77
  257. package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -7
  258. package/src/containers/Wallets/Wallets.tsx +3 -3
  259. package/src/containers/Widget/Widget.tsx +6 -1
  260. package/src/containers/WidgetInfo/WidgetInfo.tsx +13 -1
  261. package/src/containers/WidgetInfo/WidgetInfo.types.ts +7 -0
  262. package/src/containers/WidgetProvider/WidgetProvider.tsx +2 -1
  263. package/src/hooks/useLanguage.ts +6 -4
  264. package/src/hooks/useSwapInput.ts +6 -1
  265. package/src/hooks/useSyncStoresWithConfig.ts +3 -17
  266. package/src/hooks/useSyncUrlAndStore/index.ts +1 -0
  267. package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.ts +35 -0
  268. package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.ts +135 -0
  269. package/src/index.ts +2 -2
  270. package/src/libs/tabManager/index.ts +2 -0
  271. package/src/libs/tabManager/tabManager.constants.ts +3 -0
  272. package/src/libs/tabManager/tabManager.ts +222 -0
  273. package/src/libs/tabManager/tabManager.types.ts +28 -0
  274. package/src/pages/ConfirmSwapPage.tsx +55 -47
  275. package/src/pages/HistoryPage.tsx +5 -17
  276. package/src/pages/Home.tsx +47 -43
  277. package/src/pages/LanguagePage.tsx +3 -4
  278. package/src/pages/LiquiditySourcePage.tsx +8 -6
  279. package/src/pages/SelectBlockchainPage.tsx +41 -41
  280. package/src/pages/SelectSwapItemsPage.tsx +45 -39
  281. package/src/pages/SettingsPage.tsx +3 -4
  282. package/src/pages/SwapDetailsPage.tsx +21 -7
  283. package/src/pages/ThemePage.tsx +3 -4
  284. package/src/pages/WalletsPage.tsx +15 -13
  285. package/src/store/slices/settings.ts +3 -3
  286. package/src/store/ui.ts +39 -11
  287. package/src/types/notification.ts +0 -7
  288. package/src/utils/date.ts +5 -4
  289. package/src/utils/quote.ts +18 -28
  290. package/src/utils/swap.ts +35 -0
  291. package/src/utils/ui.ts +20 -0
  292. package/dist/components/UpdateUrl.d.ts +0 -2
  293. package/dist/components/UpdateUrl.d.ts.map +0 -1
  294. package/src/components/UpdateUrl.tsx +0 -158
@@ -1,30 +1,29 @@
1
- import type { PropTypes, Ref } from './Layout.types';
1
+ import type { PropTypes } from './Layout.types';
2
+ import type { PendingSwap } from 'rango-types';
2
3
  import type { PropsWithChildren } from 'react';
3
4
 
5
+ import { useManager } from '@rango-dev/queue-manager-react';
4
6
  import { BottomLogo, Divider, Header } from '@rango-dev/ui';
5
- import React from 'react';
7
+ import React, { useEffect, useRef } from 'react';
6
8
 
7
9
  import { RANGO_SWAP_BOX_ID } from '../../constants';
8
10
  import { useNavigateBack } from '../../hooks/useNavigateBack';
9
11
  import { useTheme } from '../../hooks/useTheme';
10
12
  import { useAppStore } from '../../store/AppStore';
11
- import { useUiStore } from '../../store/ui';
13
+ import { setCurrentTabAsActive, useUiStore } from '../../store/ui';
12
14
  import { useWalletsStore } from '../../store/wallets';
13
15
  import { getContainer } from '../../utils/common';
16
+ import { getPendingSwaps } from '../../utils/queue';
14
17
  import { isFeatureHidden } from '../../utils/settings';
18
+ import { ActivateTabAlert } from '../common/ActivateTabAlert';
19
+ import { ActivateTabModal } from '../common/ActivateTabModal';
15
20
  import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
16
21
 
22
+ import { onScrollContentAttachStatusToContainer } from './Layout.helpers';
17
23
  import { Container, Content, Footer } from './Layout.styles';
18
24
 
19
- function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
20
- const {
21
- children,
22
- header,
23
- footer,
24
- noPadding,
25
- hasLogo = true,
26
- fixedHeight = true,
27
- } = props;
25
+ function Layout(props: PropsWithChildren<PropTypes>) {
26
+ const { children, header, footer, hasLogo = true, height = 'fixed' } = props;
28
27
  const connectedWallets = useWalletsStore.use.connectedWallets();
29
28
  const {
30
29
  config: { features, theme },
@@ -36,25 +35,48 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
36
35
  features
37
36
  );
38
37
 
39
- const connectWalletsButtonDisabled =
40
- useUiStore.use.connectWalletsButtonDisabled();
38
+ const {
39
+ isActiveTab,
40
+ tabManagerInitiated,
41
+ showActivateTabModal,
42
+ setShowActivateTabModal,
43
+ activateCurrentTab,
44
+ } = useUiStore();
41
45
  const navigateBack = useNavigateBack();
46
+ const { manager } = useManager();
47
+ const pendingSwaps: PendingSwap[] = getPendingSwaps(manager).map(
48
+ ({ swap }) => swap
49
+ );
50
+ const hasRunningSwap = pendingSwaps.some((swap) => swap.status === 'running');
51
+
52
+ const onActivateTab = () =>
53
+ activateCurrentTab(setCurrentTabAsActive, hasRunningSwap);
42
54
 
43
55
  const onConnectWallet = () => {
44
- if (!connectWalletsButtonDisabled && header.onWallet) {
45
- header.onWallet();
46
- }
56
+ header.onWallet?.();
47
57
  };
48
58
 
49
59
  const showBackButton =
50
60
  typeof header.hasBackButton === 'undefined' || header.hasBackButton;
51
61
 
62
+ const scrollViewRef = useRef<HTMLDivElement>(null);
63
+
64
+ useEffect(() => {
65
+ scrollViewRef.current?.addEventListener(
66
+ 'scroll',
67
+ onScrollContentAttachStatusToContainer
68
+ );
69
+
70
+ return () => {
71
+ scrollViewRef.current?.removeEventListener(
72
+ 'scroll',
73
+ onScrollContentAttachStatusToContainer
74
+ );
75
+ };
76
+ }, []);
77
+
52
78
  return (
53
- <Container
54
- ref={ref}
55
- fixedHeight={fixedHeight}
56
- id={RANGO_SWAP_BOX_ID}
57
- className={activeTheme()}>
79
+ <Container height={height} id={RANGO_SWAP_BOX_ID} className={activeTheme()}>
58
80
  <Header
59
81
  prefix={<>{showBackButton && <BackButton onClick={navigateBack} />}</>}
60
82
  title={header.title}
@@ -72,13 +94,26 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
72
94
  </>
73
95
  }
74
96
  />
75
- <Content noPadding={noPadding}>{children}</Content>
97
+ <Content ref={scrollViewRef}>{children}</Content>
98
+ <ActivateTabModal
99
+ open={showActivateTabModal}
100
+ onClose={() => setShowActivateTabModal(false)}
101
+ onConfirm={onActivateTab}
102
+ />
76
103
  {(hasLogo || footer) && (
77
104
  <Footer>
78
- <div className="footer__content">{footer}</div>
105
+ <div className="footer__content">
106
+ {footer}
107
+ {tabManagerInitiated && !isActiveTab && (
108
+ <>
109
+ <Divider size={12} />
110
+ <ActivateTabAlert onActivateTab={onActivateTab} />
111
+ </>
112
+ )}
113
+ </div>
114
+ <Divider size={12} />
79
115
  {hasLogo && (
80
116
  <div className="footer__logo">
81
- <Divider size={12} />
82
117
  <BottomLogo />
83
118
  </div>
84
119
  )}
@@ -87,8 +122,4 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
87
122
  </Container>
88
123
  );
89
124
  }
90
-
91
- const Layout = React.forwardRef(LayoutComponent);
92
- Layout.displayName = 'Layout';
93
-
94
125
  export { Layout };
@@ -1,3 +1,11 @@
1
+ import type { Container } from './Layout.styles';
2
+ import type * as Stitches from '@stitches/react';
3
+
4
+ type ContainerProps = Stitches.VariantProps<typeof Container>;
5
+ type ContainerHeightProp = NonNullable<
6
+ Exclude<ContainerProps['height'], object>
7
+ >;
8
+
1
9
  export interface PropTypes {
2
10
  header: {
3
11
  title: string;
@@ -9,12 +17,5 @@ export interface PropTypes {
9
17
  };
10
18
  hasLogo?: boolean;
11
19
  footer?: React.ReactNode;
12
- noPadding?: boolean;
13
- fixedHeight?: boolean;
20
+ height?: ContainerHeightProp;
14
21
  }
15
-
16
- export type Ref =
17
- | ((instance: HTMLDivElement | null) => void)
18
- | React.RefObject<HTMLDivElement>
19
- | null
20
- | undefined;
@@ -0,0 +1,24 @@
1
+ import { styled } from '@rango-dev/ui';
2
+
3
+ const PageContainer = styled('div', {
4
+ display: 'flex',
5
+ flexDirection: 'column',
6
+ padding: '20px 20px 10px',
7
+ flexGrow: 1,
8
+
9
+ variants: {
10
+ view: {
11
+ true: {
12
+ flexGrow: 1,
13
+ overflow: 'hidden',
14
+ },
15
+ },
16
+ compact: {
17
+ true: {
18
+ padding: 0,
19
+ },
20
+ },
21
+ },
22
+ });
23
+
24
+ export { PageContainer };
@@ -0,0 +1,11 @@
1
+ import { styled } from '@rango-dev/ui';
2
+
3
+ const CONTENT_PADDING = '$20 $20 $10 $20';
4
+
5
+ const ScrollableArea = styled('div', {
6
+ padding: CONTENT_PADDING,
7
+ overflowY: 'auto',
8
+ flexGrow: 1,
9
+ });
10
+
11
+ export { ScrollableArea, CONTENT_PADDING };
@@ -1 +1,3 @@
1
1
  export { Layout } from './Layout';
2
+ export { ScrollableArea, CONTENT_PADDING } from './ScrollableArea';
3
+ export { PageContainer } from './PageContainer';
@@ -1,6 +1,7 @@
1
1
  import type { Notification } from '../../types/notification';
2
2
 
3
3
  import { i18n } from '@lingui/core';
4
+ import { EventSeverity } from '@rango-dev/queue-manager-rango-preset';
4
5
  import {
5
6
  ChainToken,
6
7
  ChevronRightIcon,
@@ -13,7 +14,6 @@ import { useNavigate } from 'react-router-dom';
13
14
  import { navigationRoutes } from '../../constants/navigationRoutes';
14
15
  import { useAppStore } from '../../store/AppStore';
15
16
  import { useNotificationStore } from '../../store/notification';
16
- import { useUiStore } from '../../store/ui';
17
17
 
18
18
  import { Container, Images, List } from './NotificationContent.styles';
19
19
  import { NotificationNotFound } from './NotificationNotFound';
@@ -22,7 +22,6 @@ const MAX_NOTIFICATIONS_DISPLAYED = 4;
22
22
 
23
23
  export function NotificationContent() {
24
24
  const navigate = useNavigate();
25
- const setSelectedSwap = useUiStore.use.setSelectedSwap();
26
25
 
27
26
  const { getUnreadNotifications } = useNotificationStore();
28
27
 
@@ -34,7 +33,6 @@ export function NotificationContent() {
34
33
  .slice(0, MAX_NOTIFICATIONS_DISPLAYED);
35
34
 
36
35
  const handleOnClick = (requestId: Notification['requestId']) => {
37
- setSelectedSwap(requestId);
38
36
  navigate(`${navigationRoutes.swaps}/${requestId}`);
39
37
  };
40
38
 
@@ -74,7 +72,15 @@ export function NotificationContent() {
74
72
  key={notificationItem.requestId}
75
73
  onClick={() => handleOnClick(notificationItem.requestId)}
76
74
  title={
77
- <Typography variant="body" size="small" color="$neutral700">
75
+ <Typography
76
+ variant="body"
77
+ size="small"
78
+ color={
79
+ notificationItem.event.messageSeverity ===
80
+ EventSeverity.WARNING
81
+ ? '$foreground'
82
+ : '$neutral700'
83
+ }>
78
84
  {i18n.t(notificationItem.event.message)}
79
85
  </Typography>
80
86
  }
@@ -1,7 +1,7 @@
1
1
  import * as Collapsible from '@radix-ui/react-collapsible';
2
2
  import { css, darkTheme, Image, styled, Typography } from '@rango-dev/ui';
3
3
 
4
- import { CollapsibleContent } from '../ConfirmWalletsModal/ConfirmWallets.styles';
4
+ import { CollapsibleContent } from '../CustomCollapsible/CustomCollapsible.styles';
5
5
 
6
6
  export const EXPANDABLE_QUOTE_TRANSITION_DURATION = 300;
7
7
 
@@ -114,6 +114,15 @@ export const summaryStyles = css({
114
114
  cursor: 'default',
115
115
  });
116
116
 
117
+ export const rowStyles = css({
118
+ display: 'flex',
119
+ flexDirection: 'row',
120
+ justifyContent: 'center',
121
+ alignItems: 'center',
122
+ '.blockchainImage': {
123
+ marginLeft: '-$8',
124
+ },
125
+ });
117
126
  export const basicInfoStyles = css({
118
127
  paddingTop: '$10',
119
128
  display: 'flex',
@@ -127,7 +136,7 @@ export const basicInfoStyles = css({
127
136
  },
128
137
  });
129
138
 
130
- export const Chains = styled(Collapsible.Trigger, {
139
+ export const Trigger = styled(Collapsible.Trigger, {
131
140
  display: 'flex',
132
141
  width: '100%',
133
142
  justifyContent: 'space-between',
@@ -171,17 +180,27 @@ export const Chains = styled(Collapsible.Trigger, {
171
180
  },
172
181
  },
173
182
  },
174
- '& div:nth-child(1)': { display: 'flex' },
183
+ '.blockchains_section': {
184
+ display: 'none',
185
+ },
186
+ '@xs': {
187
+ '.blockchains_section': {
188
+ display: 'block',
189
+ },
190
+ },
175
191
  });
176
192
 
177
- export const ChainImageContainer = styled('div', {
193
+ export const ImageContainer = styled('div', {
178
194
  width: '18px',
179
195
  height: '18px',
180
196
  borderRadius: '100%',
181
- border: '1.5px transparent solid',
182
197
  display: 'flex',
183
198
  justifyContent: 'center',
184
199
  alignItems: 'center',
200
+ border: '1.5px transparent solid',
201
+ img: {
202
+ borderRadius: '100%',
203
+ },
185
204
  variants: {
186
205
  state: {
187
206
  error: {
@@ -252,3 +271,23 @@ export const ContainerInfoOutput = styled('div', {
252
271
  display: 'flex',
253
272
  flexWrap: 'wrap',
254
273
  });
274
+
275
+ export const MoreStep = styled('div', {
276
+ width: '18px',
277
+ height: '18px',
278
+ borderRadius: '100%',
279
+ backgroundColor: '$background',
280
+ cursor: 'default',
281
+ display: 'flex',
282
+ justifyContent: 'center',
283
+ alignItems: 'center',
284
+ border: '1.5px transparent solid',
285
+ variants: {
286
+ state: {
287
+ error: {
288
+ borderColor: '$error500',
289
+ },
290
+ warning: { borderColor: '$warning500' },
291
+ },
292
+ },
293
+ });
@@ -5,12 +5,8 @@ import type { SwapResult } from 'rango-sdk';
5
5
  import { i18n } from '@lingui/core';
6
6
  import {
7
7
  Alert,
8
- ChevronDownIcon,
9
- ChevronRightIcon,
10
8
  Divider,
11
- Image,
12
9
  InfoIcon,
13
- QuoteCost,
14
10
  StepDetails,
15
11
  TokenAmount,
16
12
  Tooltip,
@@ -20,8 +16,6 @@ import BigNumber from 'bignumber.js';
20
16
  import React, { useLayoutEffect, useRef, useState } from 'react';
21
17
 
22
18
  import {
23
- GAS_FEE_MAX_DECIMALS,
24
- GAS_FEE_MIN_DECIMALS,
25
19
  PERCENTAGE_CHANGE_MAX_DECIMALS,
26
20
  PERCENTAGE_CHANGE_MIN_DECIMALS,
27
21
  TOKEN_AMOUNT_MAX_DECIMALS,
@@ -40,32 +34,25 @@ import {
40
34
  getBlockchainShortNameFor,
41
35
  getSwapperDisplayName,
42
36
  } from '../../utils/meta';
43
- import {
44
- formatTooltipNumbers,
45
- numberToString,
46
- secondsToString,
47
- totalArrivalTime,
48
- } from '../../utils/numbers';
37
+ import { formatTooltipNumbers, numberToString } from '../../utils/numbers';
49
38
  import { getPriceImpact, getPriceImpactLevel } from '../../utils/quote';
50
- import { getTotalFeeInUsd } from '../../utils/swap';
51
39
 
52
40
  import {
53
41
  BasicInfoOutput,
54
42
  basicInfoStyles,
55
- ChainImageContainer,
56
- Chains,
57
43
  ContainerInfoOutput,
58
44
  Content,
59
45
  EXPANDABLE_QUOTE_TRANSITION_DURATION,
60
46
  FrameIcon,
61
47
  HorizontalSeparator,
62
- IconContainer,
63
48
  QuoteContainer,
64
49
  stepsDetailsStyles,
65
50
  SummaryContainer,
66
51
  summaryStyles,
67
52
  } from './Quote.styles';
53
+ import { QuoteCostDetails } from './QuoteCostDetails';
68
54
  import { QuoteSummary } from './QuoteSummary';
55
+ import { QuoteTrigger } from './QuoteTrigger ';
69
56
 
70
57
  export function Quote(props: QuoteProps) {
71
58
  const {
@@ -77,19 +64,12 @@ export function Quote(props: QuoteProps) {
77
64
  type,
78
65
  recommended = true,
79
66
  } = props;
80
- const tokens = useAppStore().tokens();
81
67
  const blockchains = useAppStore().blockchains();
82
68
  const swappers = useAppStore().swappers();
83
69
 
84
70
  const [expanded, setExpanded] = useState(props.expanded);
85
71
  const quoteRef = useRef<HTMLButtonElement | null>(null);
86
72
  const prevExpanded = useRef(expanded);
87
- const totalFee = numberToString(
88
- getTotalFeeInUsd(quote.result?.swaps ?? [], tokens),
89
- GAS_FEE_MIN_DECIMALS,
90
- GAS_FEE_MAX_DECIMALS
91
- );
92
- const totalTime = secondsToString(totalArrivalTime(quote.result?.swaps));
93
73
  const roundedInput = numberToString(
94
74
  input.value,
95
75
  TOKEN_AMOUNT_MIN_DECIMALS,
@@ -283,7 +263,6 @@ export function Quote(props: QuoteProps) {
283
263
  const steps = getQuoteSteps(quote.result?.swaps ?? []);
284
264
  const numberOfSteps = steps.length;
285
265
  const tooltipContainer = getContainer();
286
-
287
266
  useLayoutEffect(() => {
288
267
  if (expanded && !prevExpanded.current && quoteRef.current) {
289
268
  setTimeout(() => {
@@ -300,7 +279,7 @@ export function Quote(props: QuoteProps) {
300
279
  listItem={type === 'list-item'}
301
280
  basic={type === 'basic'}>
302
281
  <div className={summaryStyles()}>
303
- <QuoteCost fee={totalFee} time={totalTime} steps={numberOfSteps} />
282
+ <QuoteCostDetails steps={numberOfSteps} quote={quote} />
304
283
  {type === 'basic' && (
305
284
  <div className={basicInfoStyles()}>
306
285
  <FrameIcon>
@@ -374,59 +353,13 @@ export function Quote(props: QuoteProps) {
374
353
  recommended={recommended}
375
354
  open={expanded}
376
355
  onOpenChange={setExpanded}>
377
- <Chains
378
- ref={(ref) => (quoteRef.current = ref)}
356
+ <QuoteTrigger
357
+ quoteRef={quoteRef}
379
358
  recommended={recommended}
380
- onClick={() => setExpanded((prevState) => !prevState)}>
381
- <div>
382
- {steps.map((step, index) => {
383
- const key = `item-${index}`;
384
- const arrow = (
385
- <IconContainer>
386
- <ChevronRightIcon
387
- size={12}
388
- color="black"
389
- {...(step.state && {
390
- color: step.state === 'error' ? 'error' : 'warning',
391
- })}
392
- />
393
- </IconContainer>
394
- );
395
- return (
396
- <React.Fragment key={key}>
397
- <Tooltip
398
- container={tooltipContainer}
399
- side="bottom"
400
- sideOffset={4}
401
- content={step.from.chain.displayName}>
402
- <ChainImageContainer
403
- state={step.state || steps[index - 1]?.state}>
404
- <Image src={step.from.chain.image} size={16} />
405
- </ChainImageContainer>
406
- </Tooltip>
407
- {index === numberOfSteps - 1 && (
408
- <>
409
- {arrow}
410
- <Tooltip
411
- container={tooltipContainer}
412
- side="bottom"
413
- sideOffset={4}
414
- content={step.to.chain.displayName}>
415
- <ChainImageContainer state={step.state}>
416
- <Image src={step.to.chain.image} size={16} />
417
- </ChainImageContainer>
418
- </Tooltip>
419
- </>
420
- )}
421
- {index !== numberOfSteps - 1 && <>{arrow}</>}
422
- </React.Fragment>
423
- );
424
- })}
425
- </div>
426
- <IconContainer orientation={expanded ? 'up' : 'down'}>
427
- <ChevronDownIcon size={12} color="black" />
428
- </IconContainer>
429
- </Chains>
359
+ setExpanded={setExpanded}
360
+ expanded={expanded}
361
+ steps={steps}
362
+ />
430
363
  <Content open={expanded}>
431
364
  <HorizontalSeparator />
432
365
  <div className={stepsDetailsStyles()}>
@@ -1,4 +1,5 @@
1
1
  import type { QuoteError, QuoteWarning } from '../../types';
2
+ import type { Step } from '@rango-dev/ui';
2
3
  import type { BestRouteResponse } from 'rango-sdk';
3
4
  import type { ReactNode } from 'react';
4
5
 
@@ -13,3 +14,24 @@ export type QuoteProps = {
13
14
  output: { value: string; usdValue?: string };
14
15
  expanded?: boolean;
15
16
  };
17
+
18
+ export type QuoteTriggerProps = {
19
+ quoteRef: React.MutableRefObject<HTMLButtonElement | null>;
20
+ recommended: boolean;
21
+ setExpanded: React.Dispatch<React.SetStateAction<boolean | undefined>>;
22
+ steps: Step[];
23
+ expanded?: boolean;
24
+ };
25
+
26
+ export type QuoteTriggerImagesProps = {
27
+ content: ReactNode;
28
+ state?: 'error' | 'warning' | undefined;
29
+ src: string;
30
+ open?: boolean;
31
+ className?: string;
32
+ };
33
+
34
+ export type QuoteCostDetailsProps = {
35
+ quote: BestRouteResponse;
36
+ steps: number;
37
+ };
@@ -0,0 +1,50 @@
1
+ import { css, styled } from '@rango-dev/ui';
2
+
3
+ export const FeeSection = styled('div', {
4
+ display: 'flex',
5
+ justifyContent: 'space-between',
6
+ alignItems: 'center',
7
+ padding: '$5 0',
8
+ '&.total_payable_fee': {
9
+ padding: '$12 0',
10
+ },
11
+ });
12
+
13
+ export const Line = styled('div', {
14
+ width: '100%',
15
+ borderTop: '1px solid $neutral300',
16
+ margin: '$10 0',
17
+ });
18
+
19
+ export const ModalContainer = styled('div', {
20
+ padding: '$20 0',
21
+ display: 'flex',
22
+ flexDirection: 'column',
23
+ '& .collapsible_trigger': {
24
+ display: 'flex',
25
+ alignItems: 'center',
26
+ },
27
+ });
28
+
29
+ export const ModalHeader = styled('div', {
30
+ padding: '$20 $20 $10',
31
+ textAlign: 'center',
32
+ position: 'relative',
33
+ '._icon-button': {
34
+ position: 'absolute',
35
+ zIndex: 10,
36
+ top: '$16',
37
+ right: '$16',
38
+ },
39
+ });
40
+ export const trigger = css({
41
+ display: 'flex',
42
+ flexDirection: 'row',
43
+ alignItems: 'center',
44
+ padding: '$5',
45
+ '&:hover': {
46
+ '& ._typography, & svg': {
47
+ color: '$secondary',
48
+ },
49
+ },
50
+ });