@rango-dev/widget-embedded 0.20.1-next.9 → 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 (289) 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.styles.d.ts +8 -0
  58. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  59. package/dist/components/Quote/QuoteTrigger .d.ts +4 -0
  60. package/dist/components/Quote/QuoteTrigger .d.ts.map +1 -0
  61. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +16 -0
  62. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
  63. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +40 -0
  64. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
  65. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +20 -0
  66. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
  67. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +1 -0
  68. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
  69. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  70. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +16 -0
  71. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  72. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  73. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  74. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +1 -0
  75. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -1
  76. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +1 -0
  77. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
  78. package/dist/components/SearchInput/SearchInput.styles.d.ts +4 -0
  79. package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  80. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +11 -156
  81. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
  82. package/dist/components/SettingsContainer/index.d.ts +1 -1
  83. package/dist/components/SettingsContainer/index.d.ts.map +1 -1
  84. package/dist/components/Slippage/Slippage.styles.d.ts +20 -0
  85. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
  86. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  87. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  88. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  89. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  90. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +523 -1
  91. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  92. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -1
  93. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +4 -0
  94. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
  95. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +2 -1
  96. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -1
  97. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
  98. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -1
  99. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +4 -0
  100. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
  101. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +2 -0
  102. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  103. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  104. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +20 -0
  105. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  106. package/dist/components/TokenList/TokenList.styles.d.ts +68 -0
  107. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  108. package/dist/components/WalletModal/WalletModalContent.styles.d.ts +16 -0
  109. package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
  110. package/dist/components/WidgetEvents.d.ts.map +1 -1
  111. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts +4 -0
  112. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -0
  113. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.types.d.ts +4 -0
  114. package/dist/components/common/ActivateTabAlert/ActivateTabAlert.types.d.ts.map +1 -0
  115. package/dist/components/common/ActivateTabAlert/index.d.ts +2 -0
  116. package/dist/components/common/ActivateTabAlert/index.d.ts.map +1 -0
  117. package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts +4 -0
  118. package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts.map +1 -0
  119. package/dist/components/common/ActivateTabModal/ActivateTabModal.types.d.ts +6 -0
  120. package/dist/components/common/ActivateTabModal/ActivateTabModal.types.d.ts.map +1 -0
  121. package/dist/components/common/ActivateTabModal/index.d.ts +2 -0
  122. package/dist/components/common/ActivateTabModal/index.d.ts.map +1 -0
  123. package/dist/constants/index.d.ts +1 -0
  124. package/dist/constants/index.d.ts.map +1 -1
  125. package/dist/constants/quote.d.ts +12 -0
  126. package/dist/constants/quote.d.ts.map +1 -0
  127. package/dist/constants/searchParams.d.ts +6 -6
  128. package/dist/constants/searchParams.d.ts.map +1 -1
  129. package/dist/containers/App/App.d.ts.map +1 -1
  130. package/dist/containers/App/App.styles.d.ts +4 -0
  131. package/dist/containers/App/App.styles.d.ts.map +1 -1
  132. package/dist/containers/QuoteInfo/QuoteInfo.d.ts +1 -1
  133. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  134. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +10 -314
  135. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  136. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -7
  137. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  138. package/dist/containers/Widget/Widget.d.ts.map +1 -1
  139. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -1
  140. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +7 -0
  141. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -1
  142. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
  143. package/dist/hooks/useLanguage.d.ts +2 -1
  144. package/dist/hooks/useLanguage.d.ts.map +1 -1
  145. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  146. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  147. package/dist/hooks/useSyncUrlAndStore/index.d.ts +2 -0
  148. package/dist/hooks/useSyncUrlAndStore/index.d.ts.map +1 -0
  149. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts +2 -0
  150. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts.map +1 -0
  151. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.d.ts +4 -0
  152. package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.d.ts.map +1 -0
  153. package/dist/index.d.ts +4 -4
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +2 -1
  156. package/dist/index.js.map +4 -4
  157. package/dist/libs/tabManager/index.d.ts +3 -0
  158. package/dist/libs/tabManager/index.d.ts.map +1 -0
  159. package/dist/libs/tabManager/tabManager.constants.d.ts +4 -0
  160. package/dist/libs/tabManager/tabManager.constants.d.ts.map +1 -0
  161. package/dist/libs/tabManager/tabManager.d.ts +63 -0
  162. package/dist/libs/tabManager/tabManager.d.ts.map +1 -0
  163. package/dist/libs/tabManager/tabManager.types.d.ts +29 -0
  164. package/dist/libs/tabManager/tabManager.types.d.ts.map +1 -0
  165. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  166. package/dist/pages/HistoryPage.d.ts.map +1 -1
  167. package/dist/pages/Home.d.ts.map +1 -1
  168. package/dist/pages/LanguagePage.d.ts.map +1 -1
  169. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  170. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  171. package/dist/pages/SettingsPage.d.ts.map +1 -1
  172. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  173. package/dist/pages/ThemePage.d.ts.map +1 -1
  174. package/dist/pages/WalletsPage.d.ts.map +1 -1
  175. package/dist/store/AppStore.d.ts +2 -2
  176. package/dist/store/app.d.ts +2 -2
  177. package/dist/store/slices/settings.d.ts +2 -2
  178. package/dist/store/slices/settings.d.ts.map +1 -1
  179. package/dist/store/ui.d.ts +12 -10
  180. package/dist/store/ui.d.ts.map +1 -1
  181. package/dist/types/notification.d.ts +1 -2
  182. package/dist/types/notification.d.ts.map +1 -1
  183. package/dist/utils/quote.d.ts +5 -2
  184. package/dist/utils/quote.d.ts.map +1 -1
  185. package/dist/utils/swap.d.ts +5 -1
  186. package/dist/utils/swap.d.ts.map +1 -1
  187. package/dist/utils/ui.d.ts +2 -0
  188. package/dist/utils/ui.d.ts.map +1 -1
  189. package/package.json +8 -8
  190. package/src/QueueManager.tsx +4 -1
  191. package/src/components/AppRouter.tsx +1 -8
  192. package/src/components/AppRoutes.tsx +11 -0
  193. package/src/components/BlockchainList/BlockchainList.styles.ts +4 -3
  194. package/src/components/BlockchainList/BlockchainList.tsx +1 -1
  195. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +27 -96
  196. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +24 -39
  197. package/src/components/ConfirmWalletsModal/WalletList.tsx +3 -0
  198. package/src/components/CustomCollapsible/CustomCollapsible.styles.ts +75 -0
  199. package/src/components/CustomCollapsible/CustomCollapsible.tsx +55 -0
  200. package/src/components/CustomCollapsible/CustomCollapsible.types.ts +10 -0
  201. package/src/components/HeaderButtons/HeaderButtons.types.ts +0 -1
  202. package/src/components/HeaderButtons/HomeButtons.tsx +1 -2
  203. package/src/components/Layout/Layout.helpers.ts +16 -0
  204. package/src/components/Layout/Layout.styles.ts +17 -31
  205. package/src/components/Layout/Layout.tsx +60 -29
  206. package/src/components/Layout/Layout.types.ts +9 -8
  207. package/src/components/Layout/PageContainer.tsx +24 -0
  208. package/src/components/Layout/ScrollableArea.tsx +11 -0
  209. package/src/components/Layout/index.ts +2 -0
  210. package/src/components/NotificationContent/NotificationContent.tsx +10 -4
  211. package/src/components/Quote/Quote.styles.ts +44 -5
  212. package/src/components/Quote/Quote.tsx +10 -77
  213. package/src/components/Quote/Quote.types.ts +22 -0
  214. package/src/components/Quote/QuoteCostDetails.styles.ts +50 -0
  215. package/src/components/Quote/QuoteCostDetails.tsx +218 -0
  216. package/src/components/Quote/QuoteTrigger .tsx +215 -0
  217. package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +3 -1
  218. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +0 -1
  219. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +3 -1
  220. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  221. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -1
  222. package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +3 -1
  223. package/src/components/SettingsContainer/SettingsContainer.style.ts +0 -5
  224. package/src/components/SettingsContainer/index.ts +0 -1
  225. package/src/components/Slippage/Slippage.tsx +5 -5
  226. package/src/components/Slippage/SlippageTooltipContent.tsx +1 -1
  227. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +12 -13
  228. package/src/components/SwapDetails/SwapDetails.helpers.tsx +43 -3
  229. package/src/components/SwapDetails/SwapDetails.styles.ts +18 -6
  230. package/src/components/SwapDetails/SwapDetails.tsx +16 -5
  231. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +13 -7
  232. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +2 -0
  233. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +9 -1
  234. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +10 -2
  235. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +2 -0
  236. package/src/components/SwapsGroup/SwapsGroup.tsx +13 -2
  237. package/src/components/TokenList/TokenList.styles.ts +2 -0
  238. package/src/components/TokenList/TokenList.tsx +1 -1
  239. package/src/components/WidgetEvents.tsx +2 -14
  240. package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +26 -0
  241. package/src/components/common/ActivateTabAlert/ActivateTabAlert.types.ts +3 -0
  242. package/src/components/common/ActivateTabAlert/index.ts +1 -0
  243. package/src/components/common/ActivateTabModal/ActivateTabModal.tsx +31 -0
  244. package/src/components/common/ActivateTabModal/ActivateTabModal.types.ts +5 -0
  245. package/src/components/common/ActivateTabModal/index.ts +1 -0
  246. package/src/constants/index.ts +1 -0
  247. package/src/constants/quote.ts +23 -0
  248. package/src/constants/searchParams.ts +6 -6
  249. package/src/containers/App/App.styles.ts +2 -0
  250. package/src/containers/App/App.tsx +1 -4
  251. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
  252. package/src/containers/QuoteInfo/QuoteInfo.tsx +30 -77
  253. package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -7
  254. package/src/containers/Wallets/Wallets.tsx +3 -3
  255. package/src/containers/Widget/Widget.tsx +6 -1
  256. package/src/containers/WidgetInfo/WidgetInfo.tsx +13 -1
  257. package/src/containers/WidgetInfo/WidgetInfo.types.ts +7 -0
  258. package/src/containers/WidgetProvider/WidgetProvider.tsx +2 -1
  259. package/src/hooks/useLanguage.ts +6 -4
  260. package/src/hooks/useSwapInput.ts +6 -1
  261. package/src/hooks/useSyncStoresWithConfig.ts +3 -17
  262. package/src/hooks/useSyncUrlAndStore/index.ts +1 -0
  263. package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.ts +35 -0
  264. package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.ts +135 -0
  265. package/src/index.ts +2 -2
  266. package/src/libs/tabManager/index.ts +2 -0
  267. package/src/libs/tabManager/tabManager.constants.ts +3 -0
  268. package/src/libs/tabManager/tabManager.ts +222 -0
  269. package/src/libs/tabManager/tabManager.types.ts +28 -0
  270. package/src/pages/ConfirmSwapPage.tsx +55 -47
  271. package/src/pages/HistoryPage.tsx +5 -17
  272. package/src/pages/Home.tsx +47 -43
  273. package/src/pages/LanguagePage.tsx +3 -4
  274. package/src/pages/LiquiditySourcePage.tsx +3 -4
  275. package/src/pages/SelectBlockchainPage.tsx +38 -38
  276. package/src/pages/SelectSwapItemsPage.tsx +40 -38
  277. package/src/pages/SettingsPage.tsx +3 -4
  278. package/src/pages/SwapDetailsPage.tsx +21 -7
  279. package/src/pages/ThemePage.tsx +3 -4
  280. package/src/pages/WalletsPage.tsx +15 -13
  281. package/src/store/slices/settings.ts +3 -3
  282. package/src/store/ui.ts +39 -11
  283. package/src/types/notification.ts +0 -7
  284. package/src/utils/quote.ts +18 -28
  285. package/src/utils/swap.ts +35 -0
  286. package/src/utils/ui.ts +20 -0
  287. package/dist/components/UpdateUrl.d.ts +0 -2
  288. package/dist/components/UpdateUrl.d.ts.map +0 -1
  289. package/src/components/UpdateUrl.tsx +0 -158
@@ -1,34 +1,12 @@
1
- import * as Collapsible from '@radix-ui/react-collapsible';
2
1
  import {
3
2
  Button,
4
3
  css,
5
4
  darkTheme,
6
5
  IconButton,
7
- keyframes,
8
6
  styled,
9
7
  TextField,
10
8
  } from '@rango-dev/ui';
11
9
 
12
- export const EXPANDABLE_TRANSITION_DURATION = 300;
13
-
14
- const slideDown = keyframes({
15
- from: {
16
- height: 0,
17
- },
18
- to: {
19
- height: 'var(--radix-collapsible-content-height)',
20
- },
21
- });
22
-
23
- const slideUp = keyframes({
24
- from: {
25
- height: 'var(--radix-collapsible-content-height)',
26
- },
27
- to: {
28
- height: 0,
29
- },
30
- });
31
-
32
10
  export const Title = styled('div', {
33
11
  display: 'flex',
34
12
  flexDirection: 'column',
@@ -93,16 +71,6 @@ export const ShowMoreWallets = styled(WalletButton, {
93
71
  alignSelf: 'stretch',
94
72
  minHeight: '93px',
95
73
  });
96
-
97
- export const Trigger = styled(Collapsible.Trigger, {
98
- padding: '$0',
99
- border: 'none',
100
- outline: 'none',
101
- width: '100%',
102
- backgroundColor: 'transparent',
103
- fontFamily: 'inherit',
104
- });
105
-
106
74
  export const ShowMoreHeader = styled('div', {
107
75
  padding: '$20',
108
76
  display: 'flex',
@@ -132,20 +100,36 @@ export const walletsListStyles = css({
132
100
  height: '100%',
133
101
  });
134
102
 
135
- export const CollapsibleRoot = styled(Collapsible.Root, {
136
- backgroundColor: '$neutral200',
137
- borderRadius: '$sm',
138
- variants: {
139
- selected: {
140
- true: {
141
- outlineWidth: 1,
142
- outlineColor: '$secondary500',
143
- outlineStyle: 'solid',
144
- },
145
- },
103
+ export const CustomDestination = styled('div', {
104
+ padding: '$10 $0',
105
+ '& .button__content': {
106
+ display: 'flex',
107
+ alignItems: 'center',
146
108
  },
109
+ '& .alarms': { paddingTop: '$5' },
110
+ '& .collapsible_content': {
111
+ backgroundColor: '$neutral100',
112
+ },
113
+ '& .collapsible_root': {
114
+ backgroundColor: '$neutral200',
115
+ },
116
+ });
117
+
118
+ export const alarmsStyles = css({
119
+ paddingTop: '$5',
120
+ });
121
+
122
+ export const ConfirmButton = styled('div', {
123
+ display: 'flex',
124
+ });
125
+
126
+ export const StyledTextField = styled(TextField, {
127
+ backgroundColor: '$neutral100',
128
+ padding: '$0 $15 $15 $15',
147
129
  });
148
130
 
131
+ export const Wallets = styled('div', { overflow: 'visible', width: '100%' });
132
+
149
133
  export const CustomDestinationButton = styled(Button, {
150
134
  width: '100%',
151
135
  borderRadius: '$sm !important',
@@ -174,56 +158,3 @@ export const CustomDestinationButton = styled(Button, {
174
158
  outline: 0,
175
159
  },
176
160
  });
177
-
178
- export const CustomDestination = styled('div', {
179
- padding: '$10 $0',
180
- '& .button__content': {
181
- display: 'flex',
182
- alignItems: 'center',
183
- },
184
- '& .alarms': { paddingTop: '5px' },
185
- });
186
-
187
- export const alarmsStyles = css({
188
- paddingTop: '5px',
189
- });
190
-
191
- export const ExpandedIcon = styled('div', {
192
- transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
193
- variants: {
194
- orientation: {
195
- down: {
196
- transform: 'rotate(0)',
197
- },
198
- up: {
199
- transform: 'rotate(180deg)',
200
- },
201
- },
202
- },
203
- });
204
-
205
- export const ConfirmButton = styled('div', {
206
- display: 'flex',
207
- });
208
-
209
- export const StyledTextField = styled(TextField, {
210
- backgroundColor: '$neutral100',
211
- padding: '$0 $15 $15 $15',
212
- });
213
-
214
- export const CollapsibleContent = styled(Collapsible.Content, {
215
- backgroundColor: '$neutral100',
216
- overflow: 'hidden',
217
- variants: {
218
- open: {
219
- true: {
220
- animation: `${slideDown} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
221
- },
222
- false: {
223
- animation: `${slideUp} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
224
- },
225
- },
226
- },
227
- });
228
-
229
- export const Wallets = styled('div', { overflow: 'visible', width: '100%' });
@@ -15,7 +15,7 @@ import {
15
15
  Typography,
16
16
  WalletIcon,
17
17
  } from '@rango-dev/ui';
18
- import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
18
+ import React, { useEffect, useState } from 'react';
19
19
  import { useNavigate } from 'react-router-dom';
20
20
 
21
21
  import { RANGO_SWAP_BOX_ID } from '../../constants';
@@ -26,23 +26,20 @@ import { useQuoteStore } from '../../store/quote';
26
26
  import { useWalletsStore } from '../../store/wallets';
27
27
  import { getBlockchainShortNameFor } from '../../utils/meta';
28
28
  import { confirmSwapDisabled } from '../../utils/swap';
29
+ import { CustomCollapsible } from '../CustomCollapsible/CustomCollapsible';
30
+ import { ExpandedIcon } from '../CustomCollapsible/CustomCollapsible.styles';
29
31
 
30
32
  import { getRequiredWallets, isValidAddress } from './ConfirmWallets.helpers';
31
33
  import {
32
34
  alarmsStyles,
33
- CollapsibleContent,
34
- CollapsibleRoot,
35
35
  ConfirmButton,
36
36
  CustomDestination,
37
37
  CustomDestinationButton,
38
- EXPANDABLE_TRANSITION_DURATION,
39
- ExpandedIcon,
40
38
  ListContainer,
41
39
  NavigateBack,
42
40
  ShowMoreHeader,
43
41
  StyledTextField,
44
42
  Title,
45
- Trigger,
46
43
  Wallets,
47
44
  WalletsContainer,
48
45
  walletsListStyles,
@@ -76,7 +73,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
76
73
  const [showCustomDestination, setShowCustomDestination] = useState(
77
74
  !!customDestination
78
75
  );
79
- const customDestinationRef = useRef<HTMLDivElement | null>(null);
80
76
 
81
77
  const requiredWallets = getRequiredWallets(quote);
82
78
 
@@ -231,14 +227,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
231
227
  );
232
228
  }, [connectedWallets.length]);
233
229
 
234
- useLayoutEffect(() => {
235
- if (showCustomDestination && customDestinationRef.current) {
236
- setTimeout(() => {
237
- customDestinationRef?.current?.scrollIntoView({ behavior: 'smooth' });
238
- }, EXPANDABLE_TRANSITION_DURATION);
239
- }
240
- }, [showCustomDestination]);
241
-
242
230
  const modalContainer = document.getElementById(
243
231
  RANGO_SWAP_BOX_ID
244
232
  ) as HTMLDivElement;
@@ -394,10 +382,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
394
382
  {!isLastWallet && <Divider size={32} />}
395
383
  {isLastWallet && config?.customDestination && (
396
384
  <CustomDestination>
397
- <CollapsibleRoot
398
- ref={customDestinationRef}
399
- selected={showCustomDestination}
400
- open={showCustomDestination}
385
+ <CustomCollapsible
401
386
  onOpenChange={(checked) => {
402
387
  if (!checked) {
403
388
  resetCustomDestination();
@@ -423,11 +408,11 @@ export function ConfirmWalletsModal(props: PropTypes) {
423
408
  );
424
409
  }
425
410
  }
426
- }}>
427
- <Trigger
428
- onClick={() =>
429
- setShowCustomDestination((prevState) => !prevState)
430
- }>
411
+ }}
412
+ hasSelected
413
+ open={showCustomDestination}
414
+ triggerAnchor="top"
415
+ trigger={
431
416
  <CustomDestinationButton
432
417
  fullWidth
433
418
  variant="default"
@@ -447,21 +432,21 @@ export function ConfirmWalletsModal(props: PropTypes) {
447
432
  </Typography>
448
433
  </div>
449
434
  </CustomDestinationButton>
450
- </Trigger>
451
- <CollapsibleContent open={showCustomDestination}>
452
- <>
453
- <Divider size={4} />
454
- <StyledTextField
455
- autoFocus
456
- placeholder={i18n.t('Your destination address')}
457
- value={destination}
458
- onChange={(e) => {
459
- setDestination(e.target.value);
460
- }}
461
- />
462
- </>
463
- </CollapsibleContent>
464
- </CollapsibleRoot>
435
+ }
436
+ onClickTrigger={() =>
437
+ setShowCustomDestination((prev) => !prev)
438
+ }>
439
+ <Divider size={4} />
440
+ <StyledTextField
441
+ autoFocus
442
+ placeholder={i18n.t('Your destination address')}
443
+ value={destination}
444
+ onChange={(e) => {
445
+ setDestination(e.target.value);
446
+ }}
447
+ />
448
+ </CustomCollapsible>
449
+
465
450
  {isAddressMatched && (
466
451
  <div className={alarmsStyles()}>
467
452
  <Alert
@@ -25,6 +25,7 @@ import {
25
25
  TIME_TO_IGNORE_MODAL,
26
26
  } from '../../pages/WalletsPage';
27
27
  import { useAppStore } from '../../store/AppStore';
28
+ import { useUiStore } from '../../store/ui';
28
29
  import { useWalletsStore } from '../../store/wallets';
29
30
  import { getBlockchainDisplayNameFor } from '../../utils/meta';
30
31
  import {
@@ -44,6 +45,7 @@ import {
44
45
  export function WalletList(props: PropTypes) {
45
46
  const { chain, isSelected, selectWallet, limit, onShowMore } = props;
46
47
  const { config } = useAppStore();
48
+ const isActiveTab = useUiStore.use.isActiveTab();
47
49
 
48
50
  const connectedWallets = useWalletsStore.use.connectedWallets();
49
51
  const { blockchains } = useAppStore();
@@ -289,6 +291,7 @@ export function WalletList(props: PropTypes) {
289
291
  description={connectedWalletDescription}
290
292
  onClick={onClick}
291
293
  selected={isSelected(wallet.type, chain)}
294
+ disabled={!isActiveTab}
292
295
  {...wallet}
293
296
  />
294
297
  </>
@@ -0,0 +1,75 @@
1
+ import * as Collapsible from '@radix-ui/react-collapsible';
2
+ import { keyframes, styled } from '@rango-dev/ui';
3
+
4
+ export const EXPANDABLE_TRANSITION_DURATION = 300;
5
+
6
+ const slideDown = keyframes({
7
+ from: {
8
+ height: 0,
9
+ },
10
+ to: {
11
+ height: 'var(--radix-collapsible-content-height)',
12
+ },
13
+ });
14
+
15
+ const slideUp = keyframes({
16
+ from: {
17
+ height: 'var(--radix-collapsible-content-height)',
18
+ },
19
+ to: {
20
+ height: 0,
21
+ },
22
+ });
23
+
24
+ export const CollapsibleRoot = styled(Collapsible.Root, {
25
+ borderRadius: '$sm',
26
+ variants: {
27
+ selected: {
28
+ true: {
29
+ outlineWidth: 1,
30
+ outlineColor: '$secondary500',
31
+ outlineStyle: 'solid',
32
+ },
33
+ },
34
+ },
35
+ });
36
+
37
+ export const Trigger = styled(Collapsible.Trigger, {
38
+ padding: '$0',
39
+ border: 'none',
40
+ outline: 'none',
41
+ width: '100%',
42
+ backgroundColor: 'transparent',
43
+ fontFamily: 'inherit',
44
+ cursor: 'pointer',
45
+ });
46
+
47
+ export const CollapsibleContent = styled(Collapsible.Content, {
48
+ overflow: 'hidden',
49
+ variants: {
50
+ open: {
51
+ true: {
52
+ animation: `${slideDown} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
53
+ },
54
+ false: {
55
+ animation: `${slideUp} ${EXPANDABLE_TRANSITION_DURATION}ms ease-out`,
56
+ },
57
+ },
58
+ },
59
+ });
60
+
61
+ export const ExpandedIcon = styled('div', {
62
+ transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
63
+ display: 'flex',
64
+ alignItems: 'center',
65
+ variants: {
66
+ orientation: {
67
+ down: {
68
+ transform: 'rotate(0)',
69
+ },
70
+ up: {
71
+ transform: 'rotate(180deg)',
72
+ },
73
+ },
74
+ },
75
+ });
@@ -0,0 +1,55 @@
1
+ import type { PropTypes } from './CustomCollapsible.types';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import React, { useLayoutEffect, useRef } from 'react';
5
+
6
+ import {
7
+ CollapsibleContent,
8
+ CollapsibleRoot,
9
+ EXPANDABLE_TRANSITION_DURATION,
10
+ Trigger,
11
+ } from './CustomCollapsible.styles';
12
+
13
+ export function CustomCollapsible(props: PropsWithChildren<PropTypes>) {
14
+ const {
15
+ open,
16
+ hasSelected,
17
+ onOpenChange,
18
+ children,
19
+ onClickTrigger,
20
+ trigger,
21
+ triggerAnchor,
22
+ } = props;
23
+ const ref = useRef<HTMLDivElement | null>(null);
24
+
25
+ useLayoutEffect(() => {
26
+ if (open && ref.current) {
27
+ setTimeout(() => {
28
+ ref?.current?.scrollIntoView({ behavior: 'smooth' });
29
+ }, EXPANDABLE_TRANSITION_DURATION);
30
+ }
31
+ }, [open]);
32
+
33
+ return (
34
+ <CollapsibleRoot
35
+ ref={ref}
36
+ className="collapsible_root"
37
+ selected={hasSelected && open}
38
+ open={open}
39
+ onOpenChange={onOpenChange}>
40
+ {triggerAnchor === 'top' && (
41
+ <Trigger className="collapsible_trigger" onClick={onClickTrigger}>
42
+ {trigger}
43
+ </Trigger>
44
+ )}
45
+ <CollapsibleContent className="collapsible_content" open={open}>
46
+ {children}
47
+ </CollapsibleContent>
48
+ {triggerAnchor === 'bottom' && (
49
+ <Trigger className="collapsible_trigger" onClick={onClickTrigger}>
50
+ {trigger}
51
+ </Trigger>
52
+ )}
53
+ </CollapsibleRoot>
54
+ );
55
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export type PropTypes = {
4
+ open: boolean;
5
+ hasSelected?: boolean;
6
+ onOpenChange?: (checked: boolean) => void;
7
+ onClickTrigger: () => void;
8
+ trigger: ReactNode;
9
+ triggerAnchor: 'top' | 'bottom';
10
+ };
@@ -4,7 +4,6 @@ export interface PropTypes {
4
4
  container?: HTMLElement;
5
5
  }
6
6
  export interface HomeButtonsPropTypes {
7
- layoutRef: HTMLDivElement | null;
8
7
  onClickRefresh?: () => void;
9
8
  onClickHistory?: () => void;
10
9
  onClickSettings?: () => void;
@@ -20,7 +20,7 @@ import { RefreshButton } from './RefreshButton';
20
20
  import { UnreadNotificationsBadge } from './UnreadNotificationsBadge';
21
21
 
22
22
  export function HomeButtons(props: HomeButtonsPropTypes) {
23
- const { layoutRef, onClickRefresh, onClickHistory, onClickSettings } = props;
23
+ const { onClickRefresh, onClickHistory, onClickSettings } = props;
24
24
 
25
25
  const {
26
26
  config: { features },
@@ -40,7 +40,6 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
40
40
  {!isNotificationsHidden && (
41
41
  <Popover
42
42
  align="center"
43
- collisionBoundary={layoutRef}
44
43
  collisionPadding={{ right: 20, left: 20 }}
45
44
  container={getContainer()}
46
45
  content={<NotificationContent />}>
@@ -0,0 +1,16 @@
1
+ import { getContainer } from '../../utils/common';
2
+
3
+ export function onScrollContentAttachStatusToContainer(e: Event) {
4
+ const contentElement = e.target as HTMLElement | null;
5
+
6
+ if (contentElement) {
7
+ const fromTop = contentElement.scrollTop;
8
+ const container = getContainer();
9
+
10
+ if (fromTop > 1) {
11
+ container.classList.add('rng-scrolled');
12
+ } else {
13
+ container.classList.remove('rng-scrolled');
14
+ }
15
+ }
16
+ }
@@ -1,54 +1,40 @@
1
- import { darkTheme, styled } from '@rango-dev/ui';
1
+ import { styled } from '@rango-dev/ui';
2
2
 
3
+ const WIDGET_HEIGHT = '700px';
3
4
  export const Container = styled('div', {
4
5
  position: 'relative',
5
6
  display: 'flex',
6
7
  flexDirection: 'column',
7
8
  borderRadius: '$primary',
8
- overflow: 'hidden !important',
9
- boxShadow: '15px 15px 15px 0px rgba(0, 0, 0, 0.05)',
10
- width: '100vw',
9
+ width: '100vh',
11
10
  minWidth: '300px',
12
11
  maxWidth: '390px',
13
- maxHeight: '700px',
14
- textAlign: 'left',
15
- $$color: '$colors$neutral100',
16
- [`.${darkTheme} &`]: {
17
- $$color: '$colors$neutral300',
18
- },
19
- backgroundColor: '$$color',
12
+ boxShadow: '15px 15px 15px 0px rgba(0, 0, 0, 0.05)',
13
+ overflow: 'hidden',
14
+ backgroundColor: '$background',
15
+
20
16
  variants: {
21
- fixedHeight: {
22
- true: {
23
- height: '100vh',
17
+ height: {
18
+ auto: {
19
+ height: 'auto',
20
+ maxHeight: WIDGET_HEIGHT,
24
21
  },
25
- false: {
26
- height: 'auto !important',
22
+ fixed: {
23
+ height: WIDGET_HEIGHT,
27
24
  },
28
25
  },
29
26
  },
30
27
  });
31
28
 
32
29
  export const Content = styled('div', {
33
- borderTopLeftRadius: '20px',
34
- borderTopRightRadius: '20px',
30
+ position: 'relative',
31
+ overflow: 'hidden',
32
+ flexGrow: 1,
35
33
  display: 'flex',
36
34
  flexDirection: 'column',
37
- flex: 1,
38
- padding: '$20 $20 $10 $20',
39
- backgroundColor: '$background',
40
- position: 'relative',
35
+ padding: 0,
41
36
  overflowY: 'auto',
42
- overflowX: 'hidden',
43
- variants: {
44
- noPadding: {
45
- true: {
46
- padding: '0',
47
- },
48
- },
49
- },
50
37
  });
51
-
52
38
  export const Footer = styled('div', {
53
39
  backgroundColor: '$background',
54
40
  '& .footer__content': {