@lifi/widget 1.17.2 → 1.18.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 (211) hide show
  1. package/App.js +6 -86
  2. package/AppDrawer.js +3 -2
  3. package/AppRoutes.d.ts +2 -0
  4. package/AppRoutes.js +85 -0
  5. package/cjs/App.js +5 -85
  6. package/cjs/AppDrawer.js +2 -1
  7. package/cjs/AppRoutes.d.ts +2 -0
  8. package/cjs/AppRoutes.js +89 -0
  9. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -0
  10. package/cjs/components/AppContainer.d.ts +4 -5
  11. package/cjs/components/AppContainer.js +30 -29
  12. package/cjs/components/Card/Card.d.ts +1 -0
  13. package/cjs/components/Card/Card.js +13 -9
  14. package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -0
  15. package/cjs/components/ChainSelect/ChainSelect.js +3 -3
  16. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -0
  17. package/cjs/components/ChainSelect/ChainSelect.style.js +2 -2
  18. package/cjs/components/ChainSelect/useChainSelect.js +2 -2
  19. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +6 -2
  20. package/cjs/components/Header/Header.d.ts +2 -1
  21. package/cjs/components/Header/Header.js +3 -2
  22. package/cjs/components/Header/Header.style.js +3 -2
  23. package/cjs/components/Header/NavigationHeader.js +4 -1
  24. package/cjs/components/Header/WalletHeader.js +1 -1
  25. package/cjs/components/PoweredBy/PoweredBy.js +7 -0
  26. package/cjs/components/SendToWallet/SendToWallet.js +6 -10
  27. package/cjs/components/SendToWallet/SendToWalletButton.d.ts +2 -0
  28. package/cjs/components/SendToWallet/SendToWalletButton.js +24 -0
  29. package/cjs/components/SendToWallet/index.d.ts +1 -0
  30. package/cjs/components/SendToWallet/index.js +1 -0
  31. package/cjs/components/SendToWallet/store.d.ts +4 -0
  32. package/cjs/components/SendToWallet/store.js +13 -0
  33. package/cjs/components/SendToWallet/types.d.ts +6 -0
  34. package/cjs/{stores/route → components/SendToWallet}/types.js +0 -0
  35. package/cjs/components/Step/CircularProgress.d.ts +1 -0
  36. package/cjs/components/StepActions/StepActions.style.js +1 -1
  37. package/cjs/components/SwapButton/ButtonTooltip.d.ts +1 -0
  38. package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
  39. package/cjs/components/SwapButton/SwapButton.js +4 -4
  40. package/cjs/components/SwapInput/SwapInputAdornment.d.ts +1 -0
  41. package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +2 -1
  42. package/cjs/components/SwapRouteCard/SwapRouteCard.js +19 -15
  43. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +30 -0
  44. package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +16 -3
  45. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +2 -12
  46. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +1 -3
  47. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -13
  48. package/cjs/components/SwapRouteCard/types.d.ts +6 -2
  49. package/cjs/{pages/MainPage → components/SwapRoutes}/SwapRoutes.d.ts +0 -0
  50. package/cjs/components/SwapRoutes/SwapRoutes.js +51 -0
  51. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +43 -0
  52. package/cjs/components/SwapRoutes/SwapRoutes.style.js +47 -0
  53. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -0
  54. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +38 -0
  55. package/cjs/components/SwapRoutes/index.d.ts +2 -0
  56. package/cjs/components/SwapRoutes/index.js +18 -0
  57. package/cjs/components/Token/Token.d.ts +2 -1
  58. package/cjs/components/Token/Token.js +10 -6
  59. package/cjs/components/Token/Token.style.js +2 -0
  60. package/cjs/config/theme.js +20 -24
  61. package/cjs/config/version.d.ts +1 -1
  62. package/cjs/config/version.js +1 -1
  63. package/cjs/hooks/useChains.js +2 -2
  64. package/cjs/hooks/useNavigateBack.js +13 -6
  65. package/cjs/hooks/useRouteExecution.js +4 -4
  66. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -0
  67. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  68. package/cjs/pages/MainPage/MainPage.js +4 -2
  69. package/cjs/pages/MainPage/MainSwapButton.js +4 -4
  70. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  71. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +4 -3
  72. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  73. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  74. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  75. package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -0
  76. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  77. package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -0
  78. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  79. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +1 -0
  80. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +8 -5
  81. package/cjs/pages/SwapPage/SwapPage.js +5 -1
  82. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  83. package/cjs/providers/WalletProvider/WalletProvider.js +2 -2
  84. package/cjs/stores/index.d.ts +2 -1
  85. package/cjs/stores/index.js +2 -1
  86. package/cjs/stores/{route → routes}/index.d.ts +2 -1
  87. package/cjs/stores/{route → routes}/index.js +2 -1
  88. package/cjs/stores/{route → routes}/types.d.ts +4 -0
  89. package/cjs/stores/routes/types.js +2 -0
  90. package/cjs/stores/{route → routes}/useExecutingRoutesIds.d.ts +0 -0
  91. package/cjs/stores/{route → routes}/useExecutingRoutesIds.js +2 -2
  92. package/cjs/stores/{route/useRouteStore.d.ts → routes/useRouteExecutionStore.d.ts} +1 -1
  93. package/cjs/stores/{route/useRouteStore.js → routes/useRouteExecutionStore.js} +2 -2
  94. package/cjs/stores/routes/useSelectedRouteStore.d.ts +4 -0
  95. package/cjs/stores/routes/useSelectedRouteStore.js +12 -0
  96. package/cjs/stores/{route → routes}/useSetExecutableRoute.d.ts +0 -0
  97. package/cjs/stores/{route → routes}/useSetExecutableRoute.js +2 -2
  98. package/cjs/stores/{route → routes}/useSwapHistory.d.ts +0 -0
  99. package/cjs/stores/{route → routes}/useSwapHistory.js +2 -2
  100. package/cjs/stores/{route → routes}/utils.d.ts +0 -0
  101. package/cjs/stores/{route → routes}/utils.js +0 -0
  102. package/cjs/stores/settings/useSettingsStore.js +1 -1
  103. package/cjs/types/widget.d.ts +2 -0
  104. package/cjs/utils/colors.d.ts +1 -1
  105. package/cjs/utils/navigationRoutes.js +12 -12
  106. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -0
  107. package/components/AppContainer.d.ts +4 -5
  108. package/components/AppContainer.js +29 -28
  109. package/components/Card/Card.d.ts +1 -0
  110. package/components/Card/Card.js +13 -9
  111. package/components/ChainSelect/ChainSelect.d.ts +1 -0
  112. package/components/ChainSelect/ChainSelect.js +1 -1
  113. package/components/ChainSelect/ChainSelect.style.d.ts +1 -0
  114. package/components/ChainSelect/ChainSelect.style.js +2 -2
  115. package/components/ChainSelect/useChainSelect.js +1 -1
  116. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +6 -2
  117. package/components/Header/Header.d.ts +2 -1
  118. package/components/Header/Header.js +1 -1
  119. package/components/Header/Header.style.js +4 -3
  120. package/components/Header/NavigationHeader.js +4 -1
  121. package/components/Header/WalletHeader.js +2 -2
  122. package/components/PoweredBy/PoweredBy.js +7 -0
  123. package/components/SendToWallet/SendToWallet.js +8 -11
  124. package/components/SendToWallet/SendToWalletButton.d.ts +2 -0
  125. package/components/SendToWallet/SendToWalletButton.js +20 -0
  126. package/components/SendToWallet/index.d.ts +1 -0
  127. package/components/SendToWallet/index.js +1 -0
  128. package/components/SendToWallet/store.d.ts +4 -0
  129. package/components/SendToWallet/store.js +10 -0
  130. package/components/SendToWallet/types.d.ts +6 -0
  131. package/{stores/route → components/SendToWallet}/types.js +0 -0
  132. package/components/Step/CircularProgress.d.ts +1 -0
  133. package/components/StepActions/StepActions.style.js +1 -1
  134. package/components/SwapButton/ButtonTooltip.d.ts +1 -0
  135. package/components/SwapButton/SwapButton.d.ts +1 -1
  136. package/components/SwapButton/SwapButton.js +4 -3
  137. package/components/SwapInput/SwapInputAdornment.d.ts +1 -0
  138. package/components/SwapRouteCard/SwapRouteCard.d.ts +2 -1
  139. package/components/SwapRouteCard/SwapRouteCard.js +19 -16
  140. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +30 -0
  141. package/components/SwapRouteCard/SwapRouteCard.style.js +17 -4
  142. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +2 -12
  143. package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +1 -3
  144. package/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -13
  145. package/components/SwapRouteCard/types.d.ts +6 -2
  146. package/{pages/MainPage → components/SwapRoutes}/SwapRoutes.d.ts +0 -0
  147. package/components/SwapRoutes/SwapRoutes.js +47 -0
  148. package/components/SwapRoutes/SwapRoutes.style.d.ts +43 -0
  149. package/components/SwapRoutes/SwapRoutes.style.js +44 -0
  150. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -0
  151. package/components/SwapRoutes/SwapRoutesExpanded.js +34 -0
  152. package/components/SwapRoutes/index.d.ts +2 -0
  153. package/components/SwapRoutes/index.js +2 -0
  154. package/components/Token/Token.d.ts +2 -1
  155. package/components/Token/Token.js +11 -7
  156. package/components/Token/Token.style.js +2 -0
  157. package/config/theme.js +20 -24
  158. package/config/version.d.ts +1 -1
  159. package/config/version.js +1 -1
  160. package/hooks/useChains.js +1 -1
  161. package/hooks/useNavigateBack.js +13 -6
  162. package/hooks/useRouteExecution.js +5 -5
  163. package/package.json +11 -11
  164. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -0
  165. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  166. package/pages/MainPage/MainPage.js +4 -2
  167. package/pages/MainPage/MainSwapButton.js +4 -3
  168. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  169. package/pages/SelectTokenPage/SelectTokenPage.js +4 -3
  170. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  171. package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  172. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  173. package/pages/SettingsPage/SettingsPage.d.ts +1 -0
  174. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  175. package/pages/SettingsPage/SlippageInput.d.ts +1 -0
  176. package/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
  177. package/pages/SwapHistoryPage/SwapHistoryEmpty.js +1 -0
  178. package/pages/SwapHistoryPage/SwapHistoryPage.js +8 -5
  179. package/pages/SwapPage/SwapPage.js +5 -1
  180. package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  181. package/providers/WalletProvider/WalletProvider.js +1 -1
  182. package/stores/index.d.ts +2 -1
  183. package/stores/index.js +2 -1
  184. package/stores/{route → routes}/index.d.ts +2 -1
  185. package/stores/{route → routes}/index.js +2 -1
  186. package/stores/{route → routes}/types.d.ts +4 -0
  187. package/stores/routes/types.js +1 -0
  188. package/stores/{route → routes}/useExecutingRoutesIds.d.ts +0 -0
  189. package/stores/{route → routes}/useExecutingRoutesIds.js +2 -2
  190. package/stores/{route/useRouteStore.d.ts → routes/useRouteExecutionStore.d.ts} +1 -1
  191. package/stores/{route/useRouteStore.js → routes/useRouteExecutionStore.js} +1 -1
  192. package/stores/routes/useSelectedRouteStore.d.ts +4 -0
  193. package/stores/routes/useSelectedRouteStore.js +9 -0
  194. package/stores/{route → routes}/useSetExecutableRoute.d.ts +0 -0
  195. package/stores/routes/useSetExecutableRoute.js +4 -0
  196. package/stores/{route → routes}/useSwapHistory.d.ts +0 -0
  197. package/stores/{route → routes}/useSwapHistory.js +2 -2
  198. package/stores/{route → routes}/utils.d.ts +0 -0
  199. package/stores/{route → routes}/utils.js +0 -0
  200. package/stores/settings/useSettingsStore.js +1 -1
  201. package/tsconfig.cjs.tsbuildinfo +1 -1
  202. package/types/widget.d.ts +2 -0
  203. package/utils/colors.d.ts +1 -1
  204. package/utils/navigationRoutes.js +12 -12
  205. package/cjs/pages/MainPage/SwapRoutes.js +0 -43
  206. package/cjs/pages/MainPage/SwapRoutes.style.d.ts +0 -11
  207. package/cjs/pages/MainPage/SwapRoutes.style.js +0 -16
  208. package/pages/MainPage/SwapRoutes.js +0 -39
  209. package/pages/MainPage/SwapRoutes.style.d.ts +0 -11
  210. package/pages/MainPage/SwapRoutes.style.js +0 -13
  211. package/stores/route/useSetExecutableRoute.js +0 -4
package/App.js CHANGED
@@ -1,96 +1,16 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useRoutes } from 'react-router-dom';
3
2
  import { AppProvider } from './AppProvider';
4
- import { AppContainer, FlexContainer } from './components/AppContainer';
3
+ import { AppRoutes } from './AppRoutes';
4
+ import { AppContainer, AppExpandedContainer, FlexContainer, } from './components/AppContainer';
5
5
  import { Header } from './components/Header';
6
6
  import { Initializer } from './components/Initializer';
7
- import { NotFound } from './components/NotFound';
8
7
  import { PoweredBy } from './components/PoweredBy';
9
- import { ActiveSwapsPage } from './pages/ActiveSwapsPage';
10
- import { MainPage } from './pages/MainPage';
11
- import { SelectChainPage } from './pages/SelectChainPage';
12
- import { SelectTokenPage } from './pages/SelectTokenPage';
13
- import { SelectWalletPage } from './pages/SelectWalletPage';
14
- import { SettingsPage } from './pages/SettingsPage';
15
- import { SwapDetailsPage } from './pages/SwapDetailsPage';
16
- import { SwapHistoryPage } from './pages/SwapHistoryPage';
17
- import { SwapPage } from './pages/SwapPage';
18
- import { SwapRoutesPage } from './pages/SwapRoutesPage';
19
- import { navigationRoutes } from './utils';
8
+ import { SwapRoutesExpanded } from './components/SwapRoutes';
9
+ import { useWidgetConfig } from './providers';
20
10
  export const App = ({ config }) => {
21
11
  return (_jsx(AppProvider, Object.assign({ config: config }, { children: _jsx(AppDefault, {}) })));
22
12
  };
23
13
  export const AppDefault = () => {
24
- return (_jsxs(AppContainer, { children: [_jsx(Header, {}), _jsx(FlexContainer, Object.assign({ disableGutters: true }, { children: _jsx(AppRoutes, {}) })), _jsx(PoweredBy, {}), _jsx(Initializer, {})] }));
25
- };
26
- const AppRoutes = () => {
27
- const element = useRoutes([
28
- {
29
- path: '/',
30
- element: _jsx(MainPage, {}),
31
- },
32
- {
33
- path: navigationRoutes.settings,
34
- element: _jsx(SettingsPage, {}),
35
- },
36
- {
37
- path: navigationRoutes.fromToken,
38
- element: _jsx(SelectTokenPage, { formType: "from" }),
39
- },
40
- {
41
- path: navigationRoutes.toToken,
42
- element: _jsx(SelectTokenPage, { formType: "to" }),
43
- },
44
- ...[
45
- navigationRoutes.fromChain,
46
- `${navigationRoutes.fromToken}/${navigationRoutes.fromChain}`,
47
- ].map((path) => ({
48
- path,
49
- element: _jsx(SelectChainPage, { formType: "from" }),
50
- })),
51
- ...[
52
- navigationRoutes.toChain,
53
- `${navigationRoutes.toToken}/${navigationRoutes.toChain}`,
54
- ].map((path) => ({
55
- path,
56
- element: _jsx(SelectChainPage, { formType: "to" }),
57
- })),
58
- {
59
- path: navigationRoutes.swapRoutes,
60
- element: _jsx(SwapRoutesPage, {}),
61
- },
62
- {
63
- path: navigationRoutes.activeSwaps,
64
- element: _jsx(ActiveSwapsPage, {}),
65
- },
66
- {
67
- path: navigationRoutes.swapHistory,
68
- element: _jsx(SwapHistoryPage, {}),
69
- },
70
- {
71
- path: `${navigationRoutes.swapHistory}/${navigationRoutes.swapDetails}`,
72
- element: _jsx(SwapDetailsPage, {}),
73
- },
74
- ...[
75
- navigationRoutes.selectWallet,
76
- `${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`,
77
- `${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`,
78
- ].map((path) => ({
79
- path,
80
- element: _jsx(SelectWalletPage, {}),
81
- })),
82
- ...[
83
- navigationRoutes.swapExecution,
84
- `${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}`,
85
- `${navigationRoutes.activeSwaps}/${navigationRoutes.swapExecution}`,
86
- ].map((path) => ({
87
- path,
88
- element: _jsx(SwapPage, {}),
89
- })),
90
- {
91
- path: '*',
92
- element: _jsx(NotFound, {}),
93
- },
94
- ]);
95
- return element;
14
+ const { variant } = useWidgetConfig();
15
+ return (_jsxs(AppExpandedContainer, { children: [_jsxs(AppContainer, { children: [_jsx(Header, {}), _jsx(FlexContainer, Object.assign({ disableGutters: true }, { children: _jsx(AppRoutes, {}) })), _jsx(PoweredBy, {}), _jsx(Initializer, {})] }), variant === 'expandable' ? _jsx(SwapRoutesExpanded, {}) : null] }));
96
16
  };
package/AppDrawer.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, } from '@mui/icons-material';
3
3
  import { Drawer } from '@mui/material';
4
- import { forwardRef, useCallback, useImperativeHandle, useRef, useState, } from 'react';
4
+ import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState, } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { AppDefault } from './App';
7
7
  import { DrawerButton, DrawerButtonTypography } from './AppDrawer.style';
@@ -26,7 +26,8 @@ export const AppDrawer = forwardRef(({ elementRef, open, config }, ref) => {
26
26
  openDrawer,
27
27
  closeDrawer,
28
28
  }), [closeDrawer, openDrawer, toggleDrawer]);
29
- return (_jsxs(AppProvider, Object.assign({ config: config }, { children: [_jsxs(DrawerButton, Object.assign({ variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config === null || config === void 0 ? void 0 : config.containerStyle }, { children: [drawerOpen ? _jsx(KeyboardArrowRightIcon, {}) : _jsx(KeyboardArrowLeftIcon, {}), _jsx(DrawerButtonTypography, { children: drawerOpen ? t('button.hide') : t('button.lifiSwap') })] })), _jsx(Drawer, Object.assign({ ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
29
+ const drawerConfig = useMemo(() => (Object.assign(Object.assign({}, config), { variant: 'drawer' })), [config]);
30
+ return (_jsxs(AppProvider, Object.assign({ config: drawerConfig }, { children: [_jsxs(DrawerButton, Object.assign({ variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config === null || config === void 0 ? void 0 : config.containerStyle }, { children: [drawerOpen ? _jsx(KeyboardArrowRightIcon, {}) : _jsx(KeyboardArrowLeftIcon, {}), _jsx(DrawerButtonTypography, { children: drawerOpen ? t('button.hide') : t('button.lifiSwap') })] })), _jsx(Drawer, Object.assign({ ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
30
31
  sx: {
31
32
  backgroundColor: 'rgb(0 0 0 / 48%)',
32
33
  backdropFilter: 'blur(3px)',
package/AppRoutes.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const AppRoutes: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
package/AppRoutes.js ADDED
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRoutes } from 'react-router-dom';
3
+ import { NotFound } from './components/NotFound';
4
+ import { ActiveSwapsPage } from './pages/ActiveSwapsPage';
5
+ import { MainPage } from './pages/MainPage';
6
+ import { SelectChainPage } from './pages/SelectChainPage';
7
+ import { SelectTokenPage } from './pages/SelectTokenPage';
8
+ import { SelectWalletPage } from './pages/SelectWalletPage';
9
+ import { SettingsPage } from './pages/SettingsPage';
10
+ import { SwapDetailsPage } from './pages/SwapDetailsPage';
11
+ import { SwapHistoryPage } from './pages/SwapHistoryPage';
12
+ import { SwapPage } from './pages/SwapPage';
13
+ import { SwapRoutesPage } from './pages/SwapRoutesPage';
14
+ import { navigationRoutes } from './utils';
15
+ export const AppRoutes = () => {
16
+ const element = useRoutes([
17
+ {
18
+ path: '/',
19
+ element: _jsx(MainPage, {}),
20
+ },
21
+ {
22
+ path: navigationRoutes.settings,
23
+ element: _jsx(SettingsPage, {}),
24
+ },
25
+ {
26
+ path: navigationRoutes.fromToken,
27
+ element: _jsx(SelectTokenPage, { formType: "from" }),
28
+ },
29
+ {
30
+ path: navigationRoutes.toToken,
31
+ element: _jsx(SelectTokenPage, { formType: "to" }),
32
+ },
33
+ ...[
34
+ navigationRoutes.fromChain,
35
+ `${navigationRoutes.fromToken}/${navigationRoutes.fromChain}`,
36
+ ].map((path) => ({
37
+ path,
38
+ element: _jsx(SelectChainPage, { formType: "from" }),
39
+ })),
40
+ ...[
41
+ navigationRoutes.toChain,
42
+ `${navigationRoutes.toToken}/${navigationRoutes.toChain}`,
43
+ ].map((path) => ({
44
+ path,
45
+ element: _jsx(SelectChainPage, { formType: "to" }),
46
+ })),
47
+ {
48
+ path: navigationRoutes.swapRoutes,
49
+ element: _jsx(SwapRoutesPage, {}),
50
+ },
51
+ {
52
+ path: navigationRoutes.activeSwaps,
53
+ element: _jsx(ActiveSwapsPage, {}),
54
+ },
55
+ {
56
+ path: navigationRoutes.swapHistory,
57
+ element: _jsx(SwapHistoryPage, {}),
58
+ },
59
+ {
60
+ path: `${navigationRoutes.swapHistory}/${navigationRoutes.swapDetails}`,
61
+ element: _jsx(SwapDetailsPage, {}),
62
+ },
63
+ ...[
64
+ navigationRoutes.selectWallet,
65
+ `${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`,
66
+ `${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}/${navigationRoutes.selectWallet}`,
67
+ ].map((path) => ({
68
+ path,
69
+ element: _jsx(SelectWalletPage, {}),
70
+ })),
71
+ ...[
72
+ navigationRoutes.swapExecution,
73
+ `${navigationRoutes.swapRoutes}/${navigationRoutes.swapExecution}`,
74
+ `${navigationRoutes.activeSwaps}/${navigationRoutes.swapExecution}`,
75
+ ].map((path) => ({
76
+ path,
77
+ element: _jsx(SwapPage, {}),
78
+ })),
79
+ {
80
+ path: '*',
81
+ element: _jsx(NotFound, {}),
82
+ },
83
+ ]);
84
+ return element;
85
+ };
package/cjs/App.js CHANGED
@@ -2,100 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppDefault = exports.App = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_router_dom_1 = require("react-router-dom");
6
5
  const AppProvider_1 = require("./AppProvider");
6
+ const AppRoutes_1 = require("./AppRoutes");
7
7
  const AppContainer_1 = require("./components/AppContainer");
8
8
  const Header_1 = require("./components/Header");
9
9
  const Initializer_1 = require("./components/Initializer");
10
- const NotFound_1 = require("./components/NotFound");
11
10
  const PoweredBy_1 = require("./components/PoweredBy");
12
- const ActiveSwapsPage_1 = require("./pages/ActiveSwapsPage");
13
- const MainPage_1 = require("./pages/MainPage");
14
- const SelectChainPage_1 = require("./pages/SelectChainPage");
15
- const SelectTokenPage_1 = require("./pages/SelectTokenPage");
16
- const SelectWalletPage_1 = require("./pages/SelectWalletPage");
17
- const SettingsPage_1 = require("./pages/SettingsPage");
18
- const SwapDetailsPage_1 = require("./pages/SwapDetailsPage");
19
- const SwapHistoryPage_1 = require("./pages/SwapHistoryPage");
20
- const SwapPage_1 = require("./pages/SwapPage");
21
- const SwapRoutesPage_1 = require("./pages/SwapRoutesPage");
22
- const utils_1 = require("./utils");
11
+ const SwapRoutes_1 = require("./components/SwapRoutes");
12
+ const providers_1 = require("./providers");
23
13
  const App = ({ config }) => {
24
14
  return ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) })));
25
15
  };
26
16
  exports.App = App;
27
17
  const AppDefault = () => {
28
- return ((0, jsx_runtime_1.jsxs)(AppContainer_1.AppContainer, { children: [(0, jsx_runtime_1.jsx)(Header_1.Header, {}), (0, jsx_runtime_1.jsx)(AppContainer_1.FlexContainer, Object.assign({ disableGutters: true }, { children: (0, jsx_runtime_1.jsx)(AppRoutes, {}) })), (0, jsx_runtime_1.jsx)(PoweredBy_1.PoweredBy, {}), (0, jsx_runtime_1.jsx)(Initializer_1.Initializer, {})] }));
18
+ const { variant } = (0, providers_1.useWidgetConfig)();
19
+ return ((0, jsx_runtime_1.jsxs)(AppContainer_1.AppExpandedContainer, { children: [(0, jsx_runtime_1.jsxs)(AppContainer_1.AppContainer, { children: [(0, jsx_runtime_1.jsx)(Header_1.Header, {}), (0, jsx_runtime_1.jsx)(AppContainer_1.FlexContainer, Object.assign({ disableGutters: true }, { children: (0, jsx_runtime_1.jsx)(AppRoutes_1.AppRoutes, {}) })), (0, jsx_runtime_1.jsx)(PoweredBy_1.PoweredBy, {}), (0, jsx_runtime_1.jsx)(Initializer_1.Initializer, {})] }), variant === 'expandable' ? (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutesExpanded, {}) : null] }));
29
20
  };
30
21
  exports.AppDefault = AppDefault;
31
- const AppRoutes = () => {
32
- const element = (0, react_router_dom_1.useRoutes)([
33
- {
34
- path: '/',
35
- element: (0, jsx_runtime_1.jsx)(MainPage_1.MainPage, {}),
36
- },
37
- {
38
- path: utils_1.navigationRoutes.settings,
39
- element: (0, jsx_runtime_1.jsx)(SettingsPage_1.SettingsPage, {}),
40
- },
41
- {
42
- path: utils_1.navigationRoutes.fromToken,
43
- element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "from" }),
44
- },
45
- {
46
- path: utils_1.navigationRoutes.toToken,
47
- element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "to" }),
48
- },
49
- ...[
50
- utils_1.navigationRoutes.fromChain,
51
- `${utils_1.navigationRoutes.fromToken}/${utils_1.navigationRoutes.fromChain}`,
52
- ].map((path) => ({
53
- path,
54
- element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "from" }),
55
- })),
56
- ...[
57
- utils_1.navigationRoutes.toChain,
58
- `${utils_1.navigationRoutes.toToken}/${utils_1.navigationRoutes.toChain}`,
59
- ].map((path) => ({
60
- path,
61
- element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to" }),
62
- })),
63
- {
64
- path: utils_1.navigationRoutes.swapRoutes,
65
- element: (0, jsx_runtime_1.jsx)(SwapRoutesPage_1.SwapRoutesPage, {}),
66
- },
67
- {
68
- path: utils_1.navigationRoutes.activeSwaps,
69
- element: (0, jsx_runtime_1.jsx)(ActiveSwapsPage_1.ActiveSwapsPage, {}),
70
- },
71
- {
72
- path: utils_1.navigationRoutes.swapHistory,
73
- element: (0, jsx_runtime_1.jsx)(SwapHistoryPage_1.SwapHistoryPage, {}),
74
- },
75
- {
76
- path: `${utils_1.navigationRoutes.swapHistory}/${utils_1.navigationRoutes.swapDetails}`,
77
- element: (0, jsx_runtime_1.jsx)(SwapDetailsPage_1.SwapDetailsPage, {}),
78
- },
79
- ...[
80
- utils_1.navigationRoutes.selectWallet,
81
- `${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.selectWallet}`,
82
- `${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.selectWallet}`,
83
- ].map((path) => ({
84
- path,
85
- element: (0, jsx_runtime_1.jsx)(SelectWalletPage_1.SelectWalletPage, {}),
86
- })),
87
- ...[
88
- utils_1.navigationRoutes.swapExecution,
89
- `${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}`,
90
- `${utils_1.navigationRoutes.activeSwaps}/${utils_1.navigationRoutes.swapExecution}`,
91
- ].map((path) => ({
92
- path,
93
- element: (0, jsx_runtime_1.jsx)(SwapPage_1.SwapPage, {}),
94
- })),
95
- {
96
- path: '*',
97
- element: (0, jsx_runtime_1.jsx)(NotFound_1.NotFound, {}),
98
- },
99
- ]);
100
- return element;
101
- };
package/cjs/AppDrawer.js CHANGED
@@ -29,7 +29,8 @@ exports.AppDrawer = (0, react_1.forwardRef)(({ elementRef, open, config }, ref)
29
29
  openDrawer,
30
30
  closeDrawer,
31
31
  }), [closeDrawer, openDrawer, toggleDrawer]);
32
- return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, Object.assign({ config: config }, { children: [(0, jsx_runtime_1.jsxs)(AppDrawer_style_1.DrawerButton, Object.assign({ variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config === null || config === void 0 ? void 0 : config.containerStyle }, { children: [drawerOpen ? (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowLeft, {}), (0, jsx_runtime_1.jsx)(AppDrawer_style_1.DrawerButtonTypography, { children: drawerOpen ? t('button.hide') : t('button.lifiSwap') })] })), (0, jsx_runtime_1.jsx)(material_1.Drawer, Object.assign({ ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
32
+ const drawerConfig = (0, react_1.useMemo)(() => (Object.assign(Object.assign({}, config), { variant: 'drawer' })), [config]);
33
+ return ((0, jsx_runtime_1.jsxs)(AppProvider_1.AppProvider, Object.assign({ config: drawerConfig }, { children: [(0, jsx_runtime_1.jsxs)(AppDrawer_style_1.DrawerButton, Object.assign({ variant: "contained", onClick: toggleDrawer, open: drawerOpen, drawerProps: config === null || config === void 0 ? void 0 : config.containerStyle }, { children: [drawerOpen ? (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowLeft, {}), (0, jsx_runtime_1.jsx)(AppDrawer_style_1.DrawerButtonTypography, { children: drawerOpen ? t('button.hide') : t('button.lifiSwap') })] })), (0, jsx_runtime_1.jsx)(material_1.Drawer, Object.assign({ ref: elementRef, anchor: "right", open: drawerOpen, onClose: closeDrawer, BackdropProps: {
33
34
  sx: {
34
35
  backgroundColor: 'rgb(0 0 0 / 48%)',
35
36
  backdropFilter: 'blur(3px)',
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const AppRoutes: () => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppRoutes = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_router_dom_1 = require("react-router-dom");
6
+ const NotFound_1 = require("./components/NotFound");
7
+ const ActiveSwapsPage_1 = require("./pages/ActiveSwapsPage");
8
+ const MainPage_1 = require("./pages/MainPage");
9
+ const SelectChainPage_1 = require("./pages/SelectChainPage");
10
+ const SelectTokenPage_1 = require("./pages/SelectTokenPage");
11
+ const SelectWalletPage_1 = require("./pages/SelectWalletPage");
12
+ const SettingsPage_1 = require("./pages/SettingsPage");
13
+ const SwapDetailsPage_1 = require("./pages/SwapDetailsPage");
14
+ const SwapHistoryPage_1 = require("./pages/SwapHistoryPage");
15
+ const SwapPage_1 = require("./pages/SwapPage");
16
+ const SwapRoutesPage_1 = require("./pages/SwapRoutesPage");
17
+ const utils_1 = require("./utils");
18
+ const AppRoutes = () => {
19
+ const element = (0, react_router_dom_1.useRoutes)([
20
+ {
21
+ path: '/',
22
+ element: (0, jsx_runtime_1.jsx)(MainPage_1.MainPage, {}),
23
+ },
24
+ {
25
+ path: utils_1.navigationRoutes.settings,
26
+ element: (0, jsx_runtime_1.jsx)(SettingsPage_1.SettingsPage, {}),
27
+ },
28
+ {
29
+ path: utils_1.navigationRoutes.fromToken,
30
+ element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "from" }),
31
+ },
32
+ {
33
+ path: utils_1.navigationRoutes.toToken,
34
+ element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "to" }),
35
+ },
36
+ ...[
37
+ utils_1.navigationRoutes.fromChain,
38
+ `${utils_1.navigationRoutes.fromToken}/${utils_1.navigationRoutes.fromChain}`,
39
+ ].map((path) => ({
40
+ path,
41
+ element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "from" }),
42
+ })),
43
+ ...[
44
+ utils_1.navigationRoutes.toChain,
45
+ `${utils_1.navigationRoutes.toToken}/${utils_1.navigationRoutes.toChain}`,
46
+ ].map((path) => ({
47
+ path,
48
+ element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to" }),
49
+ })),
50
+ {
51
+ path: utils_1.navigationRoutes.swapRoutes,
52
+ element: (0, jsx_runtime_1.jsx)(SwapRoutesPage_1.SwapRoutesPage, {}),
53
+ },
54
+ {
55
+ path: utils_1.navigationRoutes.activeSwaps,
56
+ element: (0, jsx_runtime_1.jsx)(ActiveSwapsPage_1.ActiveSwapsPage, {}),
57
+ },
58
+ {
59
+ path: utils_1.navigationRoutes.swapHistory,
60
+ element: (0, jsx_runtime_1.jsx)(SwapHistoryPage_1.SwapHistoryPage, {}),
61
+ },
62
+ {
63
+ path: `${utils_1.navigationRoutes.swapHistory}/${utils_1.navigationRoutes.swapDetails}`,
64
+ element: (0, jsx_runtime_1.jsx)(SwapDetailsPage_1.SwapDetailsPage, {}),
65
+ },
66
+ ...[
67
+ utils_1.navigationRoutes.selectWallet,
68
+ `${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.selectWallet}`,
69
+ `${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}/${utils_1.navigationRoutes.selectWallet}`,
70
+ ].map((path) => ({
71
+ path,
72
+ element: (0, jsx_runtime_1.jsx)(SelectWalletPage_1.SelectWalletPage, {}),
73
+ })),
74
+ ...[
75
+ utils_1.navigationRoutes.swapExecution,
76
+ `${utils_1.navigationRoutes.swapRoutes}/${utils_1.navigationRoutes.swapExecution}`,
77
+ `${utils_1.navigationRoutes.activeSwaps}/${utils_1.navigationRoutes.swapExecution}`,
78
+ ].map((path) => ({
79
+ path,
80
+ element: (0, jsx_runtime_1.jsx)(SwapPage_1.SwapPage, {}),
81
+ })),
82
+ {
83
+ path: '*',
84
+ element: (0, jsx_runtime_1.jsx)(NotFound_1.NotFound, {}),
85
+ },
86
+ ]);
87
+ return element;
88
+ };
89
+ exports.AppRoutes = AppRoutes;
@@ -8,6 +8,7 @@ export declare const ProgressCard: import("@emotion/styled").StyledComponent<imp
8
8
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
9
9
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
10
10
  variant?: ("default" | "error" | "selected") | undefined;
11
+ selectionColor?: "primary" | "secondary" | undefined;
11
12
  dense?: boolean | undefined;
12
13
  indented?: boolean | undefined;
13
14
  onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
@@ -1,4 +1,5 @@
1
- import type { PropsWithChildren, RefObject } from 'react';
1
+ import type { PropsWithChildren } from 'react';
2
+ export declare const maxHeight = 680;
2
3
  export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
3
4
  children?: import("react").ReactNode;
4
5
  classes?: Partial<import("@mui/material").ContainerClasses> | undefined;
@@ -7,9 +8,7 @@ export declare const FlexContainer: import("@emotion/styled").StyledComponent<{
7
8
  maxWidth?: false | import("@mui/material").Breakpoint | undefined;
8
9
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
10
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
10
- ref?: RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
12
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
12
13
  export declare const AppContainer: React.FC<PropsWithChildren<{}>>;
13
- export declare const ScrollToLocation: React.FC<{
14
- elementRef: RefObject<HTMLElement>;
15
- }>;
14
+ export declare const AppExpandedContainer: React.FC<PropsWithChildren<{}>>;
@@ -1,59 +1,60 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ScrollToLocation = exports.AppContainer = exports.FlexContainer = void 0;
3
+ exports.AppExpandedContainer = exports.AppContainer = exports.FlexContainer = exports.maxHeight = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const styles_1 = require("@mui/material/styles");
7
- const react_1 = require("react");
8
- const react_router_dom_1 = require("react-router-dom");
9
7
  const providers_1 = require("../providers");
10
8
  const utils_1 = require("../utils");
11
- const CssBaselineContainer = (0, styles_1.styled)(material_1.ScopedCssBaseline)(({ theme }) => ({
12
- // height: '100%',
9
+ exports.maxHeight = 680;
10
+ const ExpandedContainer = (0, styles_1.styled)(material_1.Box, {
11
+ shouldForwardProp: (prop) => prop !== 'variant',
12
+ })(({ variant }) => ({
13
13
  display: 'flex',
14
+ justifyContent: 'center',
15
+ alignItems: 'start',
14
16
  flex: 1,
15
- flexDirection: 'column',
16
- overflowX: 'clip',
17
- marginRight: 0,
18
- width: '100%',
17
+ height: variant === 'drawer' ? 'none' : exports.maxHeight,
19
18
  }));
20
- const RelativeContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
19
+ const RelativeContainer = (0, styles_1.styled)(material_1.Box, {
20
+ shouldForwardProp: (prop) => prop !== 'variant',
21
+ })(({ theme, variant }) => ({
21
22
  position: 'relative',
22
23
  width: '100%',
23
24
  minWidth: 375,
24
25
  maxWidth: 392,
26
+ maxHeight: variant === 'drawer' ? 'none' : exports.maxHeight,
25
27
  background: theme.palette.background.default,
26
28
  overflow: 'auto',
27
29
  flex: 1,
28
30
  boxSizing: 'border-box',
29
31
  zIndex: 0,
30
32
  }));
31
- const ScrollableContainer = (0, styles_1.styled)(material_1.Box)({
32
- // position: 'fixed',
33
+ const CssBaselineContainer = (0, styles_1.styled)(material_1.ScopedCssBaseline, {
34
+ shouldForwardProp: (prop) => prop !== 'variant',
35
+ })(({ variant }) => ({
36
+ display: 'flex',
37
+ flex: 1,
38
+ flexDirection: 'column',
39
+ overflowX: 'clip',
40
+ margin: 0,
41
+ width: '100%',
42
+ maxHeight: variant === 'drawer' ? 'none' : exports.maxHeight,
33
43
  overflowY: 'auto',
34
44
  height: '100%',
35
- flex: 1,
36
- display: 'flex',
37
- });
45
+ }));
38
46
  exports.FlexContainer = (0, styles_1.styled)(material_1.Container)({
39
47
  display: 'flex',
40
- flexBasis: 'auto',
41
48
  flexDirection: 'column',
42
- flexShrink: 0,
43
- flexGrow: 1,
49
+ flex: 1,
44
50
  });
45
51
  const AppContainer = ({ children }) => {
46
- const ref = (0, react_1.useRef)(null);
47
- const { containerStyle } = (0, providers_1.useWidgetConfig)();
48
- return ((0, jsx_runtime_1.jsxs)(RelativeContainer, Object.assign({ sx: containerStyle }, { children: [(0, jsx_runtime_1.jsx)(ScrollableContainer, Object.assign({ id: utils_1.ElementId.ScrollableContainer, ref: ref }, { children: (0, jsx_runtime_1.jsx)(CssBaselineContainer, Object.assign({ enableColorScheme: true }, { children: (0, jsx_runtime_1.jsx)(exports.FlexContainer, Object.assign({ disableGutters: true }, { children: children })) })) })), (0, jsx_runtime_1.jsx)(exports.ScrollToLocation, { elementRef: ref })] })));
52
+ // const ref = useRef<HTMLDivElement>(null);
53
+ const { containerStyle, variant } = (0, providers_1.useWidgetConfig)();
54
+ return ((0, jsx_runtime_1.jsx)(RelativeContainer, Object.assign({ sx: containerStyle, variant: variant }, { children: (0, jsx_runtime_1.jsx)(CssBaselineContainer, Object.assign({ id: utils_1.ElementId.ScrollableContainer, variant: variant, enableColorScheme: true }, { children: (0, jsx_runtime_1.jsx)(exports.FlexContainer, Object.assign({ disableGutters: true }, { children: children })) })) })));
49
55
  };
50
56
  exports.AppContainer = AppContainer;
51
- const ScrollToLocation = ({ elementRef }) => {
52
- const { pathname } = (0, react_router_dom_1.useLocation)();
53
- (0, react_1.useLayoutEffect)(() => {
54
- var _a;
55
- (_a = elementRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(0, 0);
56
- }, [elementRef, pathname]);
57
- return null;
57
+ const AppExpandedContainer = ({ children, }) => {
58
+ return (0, jsx_runtime_1.jsx)(ExpandedContainer, { children: children });
58
59
  };
59
- exports.ScrollToLocation = ScrollToLocation;
60
+ exports.AppExpandedContainer = AppExpandedContainer;
@@ -10,6 +10,7 @@ export declare const Card: import("@emotion/styled").StyledComponent<import("@mu
10
10
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
11
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
12
12
  variant?: CardVariant | undefined;
13
+ selectionColor?: "primary" | "secondary" | undefined;
13
14
  dense?: boolean | undefined;
14
15
  indented?: boolean | undefined;
15
16
  onClick?: MouseEventHandler<HTMLDivElement> | undefined;
@@ -3,22 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Card = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
- const getBackgroundColor = (theme, variant) => variant === 'selected'
7
- ? theme.palette.mode === 'light'
8
- ? (0, styles_1.alpha)(theme.palette.primary.main, 0.04)
9
- : (0, styles_1.alpha)(theme.palette.primary.main, 0.42)
6
+ const getBackgroundColor = (theme, variant, selectionColor) => variant === 'selected'
7
+ ? selectionColor === 'primary'
8
+ ? theme.palette.mode === 'light'
9
+ ? (0, styles_1.alpha)(theme.palette.primary.main, 0.04)
10
+ : (0, styles_1.alpha)(theme.palette.primary.main, 0.42)
11
+ : (0, styles_1.alpha)(theme.palette.secondary.main, 0.08)
10
12
  : theme.palette.background.paper;
11
13
  exports.Card = (0, styles_1.styled)(material_1.Box, {
12
- shouldForwardProp: (prop) => !['dense', 'variant', 'indented'].includes(prop),
13
- })(({ theme, variant, dense, indented, onClick }) => {
14
- const backgroundColor = getBackgroundColor(theme, variant);
14
+ shouldForwardProp: (prop) => !['dense', 'variant', 'indented', 'selectionColor'].includes(prop),
15
+ })(({ theme, variant, selectionColor = 'primary', dense, indented, onClick, }) => {
16
+ const backgroundColor = getBackgroundColor(theme, variant, selectionColor);
15
17
  return {
16
18
  backgroundColor,
17
19
  border: `1px solid`,
18
20
  borderColor: variant === 'error'
19
21
  ? theme.palette.error.main
20
22
  : variant === 'selected'
21
- ? theme.palette.primary.main
23
+ ? selectionColor === 'primary'
24
+ ? theme.palette.primary.main
25
+ : (0, styles_1.alpha)(theme.palette.secondary.main, 0.48)
22
26
  : theme.palette.mode === 'light'
23
27
  ? theme.palette.grey[300]
24
28
  : theme.palette.grey[800],
@@ -35,7 +39,7 @@ exports.Card = (0, styles_1.styled)(material_1.Box, {
35
39
  ? theme.palette.mode === 'light'
36
40
  ? (0, styles_1.darken)(backgroundColor, 0.02)
37
41
  : (0, styles_1.lighten)(backgroundColor, 0.02)
38
- : theme.palette.background.paper,
42
+ : backgroundColor,
39
43
  },
40
44
  transition: theme.transitions.create(['background-color'], {
41
45
  duration: theme.transitions.duration.enteringScreen,
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import type { SwapFormTypeProps } from '../../providers';
2
3
  export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -6,7 +6,7 @@ const material_1 = require("@mui/material");
6
6
  const react_hook_form_1 = require("react-hook-form");
7
7
  const react_router_dom_1 = require("react-router-dom");
8
8
  const providers_1 = require("../../providers");
9
- const chains_1 = require("../../stores/chains");
9
+ const stores_1 = require("../../stores");
10
10
  const utils_1 = require("../../utils");
11
11
  const ChainSelect_style_1 = require("./ChainSelect.style");
12
12
  const useChainSelect_1 = require("./useChainSelect");
@@ -22,9 +22,9 @@ const ChainSelect = ({ formType }) => {
22
22
  state: { formType },
23
23
  });
24
24
  };
25
- const chainsToHide = ((_a = chains === null || chains === void 0 ? void 0 : chains.length) !== null && _a !== void 0 ? _a : 0) - chains_1.maxChainToOrder;
25
+ const chainsToHide = ((_a = chains === null || chains === void 0 ? void 0 : chains.length) !== null && _a !== void 0 ? _a : 0) - stores_1.maxChainToOrder;
26
26
  return ((0, jsx_runtime_1.jsxs)(ChainSelect_style_1.ChainContainer, { children: [isLoading
27
- ? Array.from({ length: chains_1.maxChainToOrder + 1 }).map((_, index) => ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 56, height: 56, sx: { borderRadius: 1 } }, index)))
27
+ ? Array.from({ length: stores_1.maxChainToOrder + 1 }).map((_, index) => ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 56, height: 56, sx: { borderRadius: 1 } }, index)))
28
28
  : getChains().map((chain) => ((0, jsx_runtime_1.jsx)(ChainSelect_style_1.ChainCard, Object.assign({ onClick: () => setCurrentChain(chain.id), variant: chainId === chain.id ? 'selected' : 'default' }, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: chain.logoURI, alt: chain.key, sx: { width: 40, height: 40 } }, { children: chain.name[0] })) }), chain.id))), chainsToHide > 0 ? ((0, jsx_runtime_1.jsx)(ChainSelect_style_1.ChainCard, Object.assign({ onClick: showAllChains }, { children: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: {
29
29
  width: 40,
30
30
  height: 40,