@lifi/widget 1.17.2 → 1.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) 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/ActiveSwaps/ActiveSwaps.style.js +1 -0
  11. package/cjs/components/AppContainer.d.ts +4 -5
  12. package/cjs/components/AppContainer.js +30 -29
  13. package/cjs/components/Card/Card.d.ts +1 -0
  14. package/cjs/components/Card/Card.js +13 -9
  15. package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -0
  16. package/cjs/components/ChainSelect/ChainSelect.js +3 -3
  17. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -0
  18. package/cjs/components/ChainSelect/ChainSelect.style.js +2 -2
  19. package/cjs/components/ChainSelect/useChainSelect.js +2 -2
  20. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +6 -2
  21. package/cjs/components/Header/Header.d.ts +2 -1
  22. package/cjs/components/Header/Header.js +3 -2
  23. package/cjs/components/Header/Header.style.js +3 -2
  24. package/cjs/components/Header/NavigationHeader.js +4 -1
  25. package/cjs/components/Header/WalletHeader.js +1 -1
  26. package/cjs/components/PoweredBy/PoweredBy.js +7 -0
  27. package/cjs/components/SendToWallet/SendToWallet.js +6 -10
  28. package/cjs/components/SendToWallet/SendToWalletButton.d.ts +2 -0
  29. package/cjs/components/SendToWallet/SendToWalletButton.js +24 -0
  30. package/cjs/components/SendToWallet/index.d.ts +1 -0
  31. package/cjs/components/SendToWallet/index.js +1 -0
  32. package/cjs/components/SendToWallet/store.d.ts +4 -0
  33. package/cjs/components/SendToWallet/store.js +13 -0
  34. package/cjs/components/SendToWallet/types.d.ts +6 -0
  35. package/cjs/{stores/route → components/SendToWallet}/types.js +0 -0
  36. package/cjs/components/Step/CircularProgress.d.ts +1 -0
  37. package/cjs/components/StepActions/StepActions.style.js +1 -1
  38. package/cjs/components/SwapButton/ButtonTooltip.d.ts +1 -0
  39. package/cjs/components/SwapButton/SwapButton.d.ts +1 -1
  40. package/cjs/components/SwapButton/SwapButton.js +4 -4
  41. package/cjs/components/SwapInput/SwapInputAdornment.d.ts +1 -0
  42. package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +2 -1
  43. package/cjs/components/SwapRouteCard/SwapRouteCard.js +19 -15
  44. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +30 -0
  45. package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +16 -3
  46. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +2 -12
  47. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +1 -3
  48. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -13
  49. package/cjs/components/SwapRouteCard/types.d.ts +6 -2
  50. package/cjs/{pages/MainPage → components/SwapRoutes}/SwapRoutes.d.ts +0 -0
  51. package/cjs/components/SwapRoutes/SwapRoutes.js +51 -0
  52. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +43 -0
  53. package/cjs/components/SwapRoutes/SwapRoutes.style.js +47 -0
  54. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -0
  55. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +38 -0
  56. package/cjs/components/SwapRoutes/index.d.ts +2 -0
  57. package/cjs/components/SwapRoutes/index.js +18 -0
  58. package/cjs/components/Token/Token.d.ts +2 -1
  59. package/cjs/components/Token/Token.js +10 -6
  60. package/cjs/components/Token/Token.style.js +2 -0
  61. package/cjs/config/theme.js +20 -24
  62. package/cjs/config/version.d.ts +1 -1
  63. package/cjs/config/version.js +1 -1
  64. package/cjs/hooks/useChains.js +2 -2
  65. package/cjs/hooks/useNavigateBack.js +13 -6
  66. package/cjs/hooks/useRouteExecution.js +4 -4
  67. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -0
  68. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  69. package/cjs/pages/MainPage/MainPage.js +4 -2
  70. package/cjs/pages/MainPage/MainSwapButton.js +4 -4
  71. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  72. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +4 -3
  73. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  74. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  75. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  76. package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -0
  77. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  78. package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -0
  79. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
  80. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +1 -0
  81. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +8 -5
  82. package/cjs/pages/SwapPage/SwapPage.js +5 -1
  83. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  84. package/cjs/providers/WalletProvider/WalletProvider.js +2 -2
  85. package/cjs/stores/index.d.ts +2 -1
  86. package/cjs/stores/index.js +2 -1
  87. package/cjs/stores/{route → routes}/index.d.ts +2 -1
  88. package/cjs/stores/{route → routes}/index.js +2 -1
  89. package/cjs/stores/{route → routes}/types.d.ts +4 -0
  90. package/cjs/stores/routes/types.js +2 -0
  91. package/cjs/stores/{route → routes}/useExecutingRoutesIds.d.ts +0 -0
  92. package/cjs/stores/{route → routes}/useExecutingRoutesIds.js +2 -2
  93. package/cjs/stores/{route/useRouteStore.d.ts → routes/useRouteExecutionStore.d.ts} +1 -1
  94. package/cjs/stores/{route/useRouteStore.js → routes/useRouteExecutionStore.js} +2 -2
  95. package/cjs/stores/routes/useSelectedRouteStore.d.ts +4 -0
  96. package/cjs/stores/routes/useSelectedRouteStore.js +12 -0
  97. package/cjs/stores/{route → routes}/useSetExecutableRoute.d.ts +0 -0
  98. package/cjs/stores/{route → routes}/useSetExecutableRoute.js +2 -2
  99. package/cjs/stores/{route → routes}/useSwapHistory.d.ts +0 -0
  100. package/cjs/stores/{route → routes}/useSwapHistory.js +2 -2
  101. package/cjs/stores/{route → routes}/utils.d.ts +0 -0
  102. package/cjs/stores/{route → routes}/utils.js +0 -0
  103. package/cjs/stores/settings/useSettingsStore.js +1 -1
  104. package/cjs/types/widget.d.ts +2 -0
  105. package/cjs/utils/colors.d.ts +1 -1
  106. package/cjs/utils/navigationRoutes.js +12 -12
  107. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -0
  108. package/components/ActiveSwaps/ActiveSwaps.style.js +1 -0
  109. package/components/AppContainer.d.ts +4 -5
  110. package/components/AppContainer.js +29 -28
  111. package/components/Card/Card.d.ts +1 -0
  112. package/components/Card/Card.js +13 -9
  113. package/components/ChainSelect/ChainSelect.d.ts +1 -0
  114. package/components/ChainSelect/ChainSelect.js +1 -1
  115. package/components/ChainSelect/ChainSelect.style.d.ts +1 -0
  116. package/components/ChainSelect/ChainSelect.style.js +2 -2
  117. package/components/ChainSelect/useChainSelect.js +1 -1
  118. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +6 -2
  119. package/components/Header/Header.d.ts +2 -1
  120. package/components/Header/Header.js +1 -1
  121. package/components/Header/Header.style.js +4 -3
  122. package/components/Header/NavigationHeader.js +4 -1
  123. package/components/Header/WalletHeader.js +2 -2
  124. package/components/PoweredBy/PoweredBy.js +7 -0
  125. package/components/SendToWallet/SendToWallet.js +8 -11
  126. package/components/SendToWallet/SendToWalletButton.d.ts +2 -0
  127. package/components/SendToWallet/SendToWalletButton.js +20 -0
  128. package/components/SendToWallet/index.d.ts +1 -0
  129. package/components/SendToWallet/index.js +1 -0
  130. package/components/SendToWallet/store.d.ts +4 -0
  131. package/components/SendToWallet/store.js +10 -0
  132. package/components/SendToWallet/types.d.ts +6 -0
  133. package/{stores/route → components/SendToWallet}/types.js +0 -0
  134. package/components/Step/CircularProgress.d.ts +1 -0
  135. package/components/StepActions/StepActions.style.js +1 -1
  136. package/components/SwapButton/ButtonTooltip.d.ts +1 -0
  137. package/components/SwapButton/SwapButton.d.ts +1 -1
  138. package/components/SwapButton/SwapButton.js +4 -3
  139. package/components/SwapInput/SwapInputAdornment.d.ts +1 -0
  140. package/components/SwapRouteCard/SwapRouteCard.d.ts +2 -1
  141. package/components/SwapRouteCard/SwapRouteCard.js +19 -16
  142. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +30 -0
  143. package/components/SwapRouteCard/SwapRouteCard.style.js +17 -4
  144. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +2 -12
  145. package/components/SwapRouteCard/SwapRouteNotFoundCard.d.ts +1 -3
  146. package/components/SwapRouteCard/SwapRouteNotFoundCard.js +1 -13
  147. package/components/SwapRouteCard/types.d.ts +6 -2
  148. package/{pages/MainPage → components/SwapRoutes}/SwapRoutes.d.ts +0 -0
  149. package/components/SwapRoutes/SwapRoutes.js +47 -0
  150. package/components/SwapRoutes/SwapRoutes.style.d.ts +43 -0
  151. package/components/SwapRoutes/SwapRoutes.style.js +44 -0
  152. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -0
  153. package/components/SwapRoutes/SwapRoutesExpanded.js +34 -0
  154. package/components/SwapRoutes/index.d.ts +2 -0
  155. package/components/SwapRoutes/index.js +2 -0
  156. package/components/Token/Token.d.ts +2 -1
  157. package/components/Token/Token.js +11 -7
  158. package/components/Token/Token.style.js +2 -0
  159. package/config/theme.js +20 -24
  160. package/config/version.d.ts +1 -1
  161. package/config/version.js +1 -1
  162. package/hooks/useChains.js +1 -1
  163. package/hooks/useNavigateBack.js +13 -6
  164. package/hooks/useRouteExecution.js +5 -5
  165. package/package.json +11 -11
  166. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +1 -0
  167. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -0
  168. package/pages/MainPage/MainPage.js +4 -2
  169. package/pages/MainPage/MainSwapButton.js +4 -3
  170. package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -0
  171. package/pages/SelectTokenPage/SelectTokenPage.js +4 -3
  172. package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
  173. package/pages/SettingsPage/AdvancedPreferences.d.ts +1 -0
  174. package/pages/SettingsPage/GasPriceSelect.d.ts +1 -0
  175. package/pages/SettingsPage/SettingsPage.d.ts +1 -0
  176. package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -0
  177. package/pages/SettingsPage/SlippageInput.d.ts +1 -0
  178. package/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
  179. package/pages/SwapHistoryPage/SwapHistoryEmpty.js +1 -0
  180. package/pages/SwapHistoryPage/SwapHistoryPage.js +8 -5
  181. package/pages/SwapPage/SwapPage.js +5 -1
  182. package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  183. package/providers/WalletProvider/WalletProvider.js +1 -1
  184. package/stores/index.d.ts +2 -1
  185. package/stores/index.js +2 -1
  186. package/stores/{route → routes}/index.d.ts +2 -1
  187. package/stores/{route → routes}/index.js +2 -1
  188. package/stores/{route → routes}/types.d.ts +4 -0
  189. package/stores/routes/types.js +1 -0
  190. package/stores/{route → routes}/useExecutingRoutesIds.d.ts +0 -0
  191. package/stores/{route → routes}/useExecutingRoutesIds.js +2 -2
  192. package/stores/{route/useRouteStore.d.ts → routes/useRouteExecutionStore.d.ts} +1 -1
  193. package/stores/{route/useRouteStore.js → routes/useRouteExecutionStore.js} +1 -1
  194. package/stores/routes/useSelectedRouteStore.d.ts +4 -0
  195. package/stores/routes/useSelectedRouteStore.js +9 -0
  196. package/stores/{route → routes}/useSetExecutableRoute.d.ts +0 -0
  197. package/stores/routes/useSetExecutableRoute.js +4 -0
  198. package/stores/{route → routes}/useSwapHistory.d.ts +0 -0
  199. package/stores/{route → routes}/useSwapHistory.js +2 -2
  200. package/stores/{route → routes}/utils.d.ts +0 -0
  201. package/stores/{route → routes}/utils.js +0 -0
  202. package/stores/settings/useSettingsStore.js +1 -1
  203. package/tsconfig.cjs.tsbuildinfo +1 -1
  204. package/types/widget.d.ts +2 -0
  205. package/utils/colors.d.ts +1 -1
  206. package/utils/navigationRoutes.js +12 -12
  207. package/cjs/pages/MainPage/SwapRoutes.js +0 -43
  208. package/cjs/pages/MainPage/SwapRoutes.style.d.ts +0 -11
  209. package/cjs/pages/MainPage/SwapRoutes.style.js +0 -16
  210. package/pages/MainPage/SwapRoutes.js +0 -39
  211. package/pages/MainPage/SwapRoutes.style.d.ts +0 -11
  212. package/pages/MainPage/SwapRoutes.style.js +0 -13
  213. package/stores/route/useSetExecutableRoute.js +0 -4
@@ -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,
@@ -8,6 +8,7 @@ export declare const ChainCard: import("@emotion/styled").StyledComponent<import
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;
@@ -7,12 +7,12 @@ const Card_1 = require("../../components/Card");
7
7
  exports.ChainCard = (0, styles_1.styled)(Card_1.Card)({
8
8
  display: 'grid',
9
9
  placeItems: 'center',
10
- minWidth: 56,
10
+ minWidth: 52,
11
11
  height: 56,
12
12
  });
13
13
  exports.ChainContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
14
14
  display: 'grid',
15
- gridTemplateColumns: 'repeat(auto-fit, minmax(56px, 1fr))',
15
+ gridTemplateColumns: 'repeat(auto-fit, minmax(52px, 1fr))',
16
16
  gridAutoRows: '56px',
17
17
  justifyContent: 'space-between',
18
18
  gap: theme.spacing(1.5),
@@ -4,11 +4,11 @@ exports.useChainSelect = void 0;
4
4
  const react_hook_form_1 = require("react-hook-form");
5
5
  const hooks_1 = require("../../hooks");
6
6
  const providers_1 = require("../../providers");
7
- const chains_1 = require("../../stores/chains");
7
+ const stores_1 = require("../../stores");
8
8
  const useChainSelect = (formType) => {
9
9
  const { setValue } = (0, react_hook_form_1.useFormContext)();
10
10
  const { chains, isLoading } = (0, hooks_1.useChains)();
11
- const [chainOrder, setChainOrder] = (0, chains_1.useChainOrder)();
11
+ const [chainOrder, setChainOrder] = (0, stores_1.useChainOrder)();
12
12
  const chainKey = providers_1.SwapFormKeyHelper.getChainKey(formType);
13
13
  const getChains = () => {
14
14
  if (!chains) {
@@ -17,12 +17,14 @@ const icons_material_1 = require("@mui/icons-material");
17
17
  const material_1 = require("@mui/material");
18
18
  const react_i18next_1 = require("react-i18next");
19
19
  const hooks_1 = require("../../hooks");
20
+ const stores_1 = require("../../stores");
20
21
  const Card_1 = require("../Card");
21
22
  const GasSufficiencyMessage_style_1 = require("./GasSufficiencyMessage.style");
22
23
  const GasSufficiencyMessage = (_a) => {
23
24
  var { route } = _a, props = __rest(_a, ["route"]);
24
25
  const { t } = (0, react_i18next_1.useTranslation)();
25
- const { insufficientFunds, insufficientGas } = (0, hooks_1.useGasSufficiency)(route);
26
+ const selectedRoute = (0, stores_1.useSelectedRouteStore)((state) => state.selectedRoute);
27
+ const { insufficientFunds, insufficientGas } = (0, hooks_1.useGasSufficiency)(route !== null && route !== void 0 ? route : selectedRoute);
26
28
  if (!insufficientFunds && !(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length)) {
27
29
  return null;
28
30
  }
@@ -34,7 +36,9 @@ const GasSufficiencyMessage = (_a) => {
34
36
  : null }))) : null, (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pt: 1 }, { children: t(`swap.warning.message.insufficientGas`) }))) : null, (insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length)
35
37
  ? insufficientGas.map((item, index) => {
36
38
  var _a, _b;
37
- return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", px: 2, pb: insufficientGas.length - 1 === index ? 2 : 0, pt: 0.5 }, { children: t(`swap.tokenOnChainAmount`, {
39
+ return ((0, jsx_runtime_1.jsx)(material_1.Typography
40
+ // eslint-disable-next-line react/no-array-index-key
41
+ , Object.assign({ variant: "body2", px: 2, pb: insufficientGas.length - 1 === index ? 2 : 0, pt: 0.5 }, { children: t(`swap.tokenOnChainAmount`, {
38
42
  amount: (_a = item.insufficientAmount) === null || _a === void 0 ? void 0 : _a.toString(),
39
43
  tokenSymbol: item.token.symbol,
40
44
  chainName: (_b = item.chain) === null || _b === void 0 ? void 0 : _b.name,
@@ -1,2 +1,3 @@
1
- import type { FC } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
+ export declare const HeaderContainer: FC<PropsWithChildren<{}>>;
2
3
  export declare const Header: FC;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Header = void 0;
3
+ exports.Header = exports.HeaderContainer = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_router_dom_1 = require("react-router-dom");
6
6
  const providers_1 = require("../../providers");
@@ -12,8 +12,9 @@ const HeaderContainer = ({ children }) => {
12
12
  const { pathname } = (0, react_router_dom_1.useLocation)();
13
13
  return ((0, jsx_runtime_1.jsx)(Header_style_1.Container, Object.assign({ id: utils_1.ElementId.Header, sticky: utils_1.stickyHeaderRoutes.some((route) => pathname.includes(route)) }, { children: children })));
14
14
  };
15
+ exports.HeaderContainer = HeaderContainer;
15
16
  const Header = () => {
16
17
  const { walletManagement } = (0, providers_1.useWidgetConfig)();
17
- return ((0, jsx_runtime_1.jsxs)(HeaderContainer, { children: [!walletManagement ? (0, jsx_runtime_1.jsx)(WalletHeader_1.WalletHeader, {}) : null, (0, jsx_runtime_1.jsx)(NavigationHeader_1.NavigationHeader, {})] }));
18
+ return ((0, jsx_runtime_1.jsxs)(exports.HeaderContainer, { children: [!walletManagement ? (0, jsx_runtime_1.jsx)(WalletHeader_1.WalletHeader, {}) : null, (0, jsx_runtime_1.jsx)(NavigationHeader_1.NavigationHeader, {})] }));
18
19
  };
19
20
  exports.Header = Header;
@@ -4,7 +4,7 @@ exports.Container = exports.HeaderAppBar = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
6
  exports.HeaderAppBar = (0, styles_1.styled)(material_1.AppBar)(({ theme }) => ({
7
- backgroundColor: theme.palette.background.default,
7
+ backgroundColor: 'transparent',
8
8
  color: theme.palette.text.primary,
9
9
  flexDirection: 'row',
10
10
  alignItems: 'center',
@@ -19,7 +19,8 @@ exports.HeaderAppBar = (0, styles_1.styled)(material_1.AppBar)(({ theme }) => ({
19
19
  exports.Container = (0, styles_1.styled)(material_1.Box, {
20
20
  shouldForwardProp: (prop) => prop !== 'sticky',
21
21
  })(({ theme, sticky }) => ({
22
- backgroundColor: theme.palette.background.default,
22
+ backgroundColor: (0, styles_1.alpha)(theme.palette.background.default, 0.84),
23
+ backdropFilter: 'blur(12px)',
23
24
  position: sticky ? 'sticky' : 'relative',
24
25
  top: 0,
25
26
  zIndex: 1200,
@@ -17,7 +17,10 @@ const NavigationHeader = () => {
17
17
  const { account } = (0, providers_1.useWallet)();
18
18
  const { element } = (0, useHeaderActionStore_1.useHeaderActionStore)();
19
19
  const { pathname } = (0, react_router_dom_1.useLocation)();
20
- const path = pathname.substring(pathname.lastIndexOf('/') + 1);
20
+ const cleanedPathname = pathname.endsWith('/')
21
+ ? pathname.slice(0, -1)
22
+ : pathname;
23
+ const path = cleanedPathname.substring(cleanedPathname.lastIndexOf('/') + 1);
21
24
  const hasPath = utils_1.navigationRoutesValues.includes(path);
22
25
  const handleHeaderTitle = () => {
23
26
  switch (path) {
@@ -43,5 +43,5 @@ const ConnectButton = () => {
43
43
  }
44
44
  navigate(utils_1.navigationRoutes.selectWallet);
45
45
  });
46
- return ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "disconnect", edge: "end", onClick: !pathname.includes(utils_1.navigationRoutes.selectWallet) ? connect : undefined }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.AccountBalanceWalletOutlined, {}) })));
46
+ return ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", "aria-label": "disconnect", edge: "end", onClick: !pathname.includes(utils_1.navigationRoutes.selectWallet) ? connect : undefined }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.WalletOutlined, {}) })));
47
47
  };
@@ -3,10 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PoweredBy = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
+ const react_router_dom_1 = require("react-router-dom");
6
7
  const version_1 = require("../../config/version");
8
+ const utils_1 = require("../../utils");
7
9
  const LiFiLogo_1 = require("../LiFiLogo");
8
10
  const PoweredBy_style_1 = require("./PoweredBy.style");
9
11
  const PoweredBy = () => {
12
+ const { pathname } = (0, react_router_dom_1.useLocation)();
13
+ if (pathname.includes(utils_1.navigationRoutes.fromToken) ||
14
+ pathname.includes(utils_1.navigationRoutes.toToken)) {
15
+ return null;
16
+ }
10
17
  return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ px: 3, pt: 2, pb: 2, sx: {
11
18
  display: 'flex',
12
19
  alignItems: 'flex-end',
@@ -17,22 +17,19 @@ const react_1 = require("react");
17
17
  const react_hook_form_1 = require("react-hook-form");
18
18
  const react_i18next_1 = require("react-i18next");
19
19
  const providers_1 = require("../../providers");
20
- const stores_1 = require("../../stores");
21
20
  const Card_1 = require("../Card");
22
21
  const SendToWallet_style_1 = require("./SendToWallet.style");
23
- const SendToWallet = (props) => {
22
+ const store_1 = require("./store");
23
+ exports.SendToWallet = (0, react_1.forwardRef)((props, ref) => {
24
24
  var _a;
25
25
  const { t } = (0, react_i18next_1.useTranslation)();
26
- const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
26
+ const showSendToWallet = (0, store_1.useSendToWalletStore)((state) => state.showSendToWallet);
27
27
  const { account, provider } = (0, providers_1.useWallet)();
28
28
  const { register, trigger, formState: { errors }, } = (0, react_hook_form_1.useFormContext)();
29
29
  (0, react_1.useEffect)(() => {
30
30
  trigger(providers_1.SwapFormKey.ToAddress);
31
31
  }, [account.chainId, trigger]);
32
- if (!showDestinationWallet) {
33
- return null;
34
- }
35
- const { onChange, onBlur, name, ref } = register(providers_1.SwapFormKey.ToAddress, {
32
+ const { onChange, onBlur, name, ref: inputRef, } = register(providers_1.SwapFormKey.ToAddress, {
36
33
  validate: (value) => __awaiter(void 0, void 0, void 0, function* () {
37
34
  try {
38
35
  if (!value) {
@@ -48,6 +45,5 @@ const SendToWallet = (props) => {
48
45
  }),
49
46
  onBlur: () => trigger(providers_1.SwapFormKey.ToAddress),
50
47
  });
51
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { ref: ref, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns') }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, Object.assign({ error: !!errors.toAddress }, { children: (_a = errors.toAddress) === null || _a === void 0 ? void 0 : _a.message }))] }))] })));
52
- };
53
- exports.SendToWallet = SendToWallet;
48
+ return ((0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ timeout: 225, in: showSendToWallet }, { children: (0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { ref: ref }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.sendToWallet') }), (0, jsx_runtime_1.jsxs)(SendToWallet_style_1.FormControl, Object.assign({ fullWidth: true, sx: { paddingTop: '6px', paddingBottom: '5px' } }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_style_1.Input, { ref: inputRef, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns') }), (0, jsx_runtime_1.jsx)(material_1.FormHelperText, Object.assign({ error: !!errors.toAddress }, { children: (_a = errors.toAddress) === null || _a === void 0 ? void 0 : _a.message }))] }))] })) })));
49
+ });
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const SendToWalletButton: React.FC;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SendToWalletButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const icons_material_1 = require("@mui/icons-material");
6
+ const material_1 = require("@mui/material");
7
+ const react_i18next_1 = require("react-i18next");
8
+ const providers_1 = require("../../providers");
9
+ const stores_1 = require("../../stores");
10
+ const store_1 = require("./store");
11
+ const SendToWalletButton = () => {
12
+ const { t } = (0, react_i18next_1.useTranslation)();
13
+ const { account } = (0, providers_1.useWallet)();
14
+ const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
15
+ const { showSendToWallet, toggleSendToWallet } = (0, store_1.useSendToWalletStore)();
16
+ if (!showDestinationWallet || !account.isActive) {
17
+ return null;
18
+ }
19
+ return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t('swap.sendToWallet'), placement: "bottom-end", enterDelay: 500, enterNextDelay: 500, arrow: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: showSendToWallet ? 'contained' : 'text', onClick: toggleSendToWallet, sx: {
20
+ minWidth: 48,
21
+ marginLeft: 1,
22
+ } }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.WalletOutlined, {}) })) })));
23
+ };
24
+ exports.SendToWalletButton = SendToWalletButton;
@@ -1 +1,2 @@
1
1
  export * from './SendToWallet';
2
+ export * from './SendToWalletButton';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SendToWallet"), exports);
18
+ __exportStar(require("./SendToWalletButton"), exports);
@@ -0,0 +1,4 @@
1
+ import type { SendToWalletStore } from './types';
2
+ export declare const useSendToWalletStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SendToWalletStore>, "setState"> & {
3
+ setState(nextStateOrUpdater: SendToWalletStore | Partial<SendToWalletStore> | ((state: import("immer/dist/internal").WritableDraft<SendToWalletStore>) => void), shouldReplace?: boolean | undefined): void;
4
+ }>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSendToWalletStore = void 0;
4
+ const zustand_1 = require("zustand");
5
+ const immer_1 = require("zustand/middleware/immer");
6
+ exports.useSendToWalletStore = (0, zustand_1.default)()((0, immer_1.immer)((set) => ({
7
+ showSendToWallet: false,
8
+ toggleSendToWallet: () => {
9
+ set((state) => {
10
+ state.showSendToWallet = !state.showSendToWallet;
11
+ });
12
+ },
13
+ })));
@@ -0,0 +1,6 @@
1
+ export interface SendToWalletState {
2
+ showSendToWallet: boolean;
3
+ }
4
+ export interface SendToWalletStore extends SendToWalletState {
5
+ toggleSendToWallet(): void;
6
+ }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { Status } from '@lifi/sdk';
2
3
  export declare function CircularProgress({ status }: {
3
4
  status: Status;
@@ -54,6 +54,6 @@ exports.StepContent = (0, styles_1.styled)(material_1.StepContent, {
54
54
  },
55
55
  }));
56
56
  exports.StepAvatar = (0, styles_1.styled)(material_1.Avatar)(({ theme, variant }) => ({
57
- color: variant === 'square' ? theme.palette.text.primary : theme.palette.grey[900],
57
+ color: theme.palette.text.primary,
58
58
  backgroundColor: 'transparent',
59
59
  }));
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export declare const ButtonTooltip: ({ title, children, }: {
2
3
  title?: string | undefined;
3
4
  children: JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import type { SwapButtonProps } from './types';
3
- export declare const SwapButton: React.FC<SwapButtonProps>;
3
+ export declare const SwapButton: import("react").ForwardRefExoticComponent<SwapButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -12,12 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SwapButton = void 0;
13
13
  const jsx_runtime_1 = require("react/jsx-runtime");
14
14
  const material_1 = require("@mui/material");
15
+ const react_1 = require("react");
15
16
  const react_i18next_1 = require("react-i18next");
16
17
  const react_router_dom_1 = require("react-router-dom");
17
18
  const hooks_1 = require("../../hooks");
18
19
  const providers_1 = require("../../providers");
19
20
  const utils_1 = require("../../utils");
20
- const SwapButton = ({ onClick, currentRoute, text, disable, }) => {
21
+ exports.SwapButton = (0, react_1.forwardRef)(({ onClick, currentRoute, text, disable }, ref) => {
21
22
  const { t } = (0, react_i18next_1.useTranslation)();
22
23
  const navigate = (0, react_router_dom_1.useNavigate)();
23
24
  const config = (0, providers_1.useWidgetConfig)();
@@ -45,6 +46,5 @@ const SwapButton = ({ onClick, currentRoute, text, disable, }) => {
45
46
  }
46
47
  return t(`button.connectWallet`);
47
48
  };
48
- return ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: account.isActive ? 'primary' : 'success', onClick: handleSwapButtonClick, disabled: insufficientFunds || !!(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) || disable, fullWidth: true }, { children: getButtonText() })));
49
- };
50
- exports.SwapButton = SwapButton;
49
+ return ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: account.isActive ? 'primary' : 'success', onClick: handleSwapButtonClick, disabled: insufficientFunds || !!(insufficientGas === null || insufficientGas === void 0 ? void 0 : insufficientGas.length) || disable, fullWidth: true, ref: ref }, { children: getButtonText() })));
50
+ });
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  import type { SwapFormTypeProps } from '../../providers';
2
3
  export declare const SwapInputAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import type { BoxProps } from '@mui/material';
3
- import type { SwapRouteCardProps } from './types';
3
+ import type { SwapRouteCardEssentialsProps, SwapRouteCardProps } from './types';
4
4
  export declare const SwapRouteCard: React.FC<SwapRouteCardProps & BoxProps>;
5
+ export declare const SwapRouteCardEssentials: React.FC<SwapRouteCardEssentialsProps>;
@@ -11,33 +11,37 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  return t;
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.SwapRouteCard = void 0;
14
+ exports.SwapRouteCardEssentials = exports.SwapRouteCard = void 0;
15
15
  const jsx_runtime_1 = require("react/jsx-runtime");
16
+ const icons_material_1 = require("@mui/icons-material");
16
17
  const material_1 = require("@mui/material");
18
+ const react_1 = require("react");
17
19
  const react_i18next_1 = require("react-i18next");
18
20
  const Card_1 = require("../Card");
19
21
  const StepActions_1 = require("../StepActions");
20
22
  const Token_1 = require("../Token");
21
23
  const SwapRouteCard_style_1 = require("./SwapRouteCard.style");
22
24
  const SwapRouteCard = (_a) => {
23
- var _b, _c;
24
- var { route, active, dense } = _a, other = __rest(_a, ["route", "active", "dense"]);
25
+ var _b;
26
+ var { route, active, variant = 'default' } = _a, other = __rest(_a, ["route", "active", "variant"]);
25
27
  const { t } = (0, react_i18next_1.useTranslation)();
28
+ const [expanded, setExpanded] = (0, react_1.useState)(variant === 'default');
26
29
  const alternativeTag = t(`swap.tags.ALTERNATIVE`);
27
30
  const label = ((_b = route.tags) === null || _b === void 0 ? void 0 : _b.length)
28
31
  ? t(`swap.tags.${route.tags[0]}`)
29
32
  : alternativeTag;
30
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ dense: dense, indented: true }, other, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: {
31
- display: 'flex',
32
- alignItems: 'center',
33
- justifyContent: 'space-between',
34
- }, mb: 2 }, { children: (0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.Label, Object.assign({ active: active !== null && active !== void 0 ? active : label !== alternativeTag }, { children: label })) })), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount }), mb: 2 }), !dense
35
- ? route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mb: 2 }, step.id)))
36
- : null, (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
37
- display: 'flex',
38
- justifyContent: 'space-between',
39
- } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: "500", lineHeight: 1, pt: 0.25 }, { children: t(`swap.currency`, { value: (_c = route.gasCostUSD) !== null && _c !== void 0 ? _c : 0 }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, color: "text.secondary", lineHeight: 1, mt: 0.5 }, { children: t(`swap.gas`) }))] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: "500", display: "flex", justifyContent: "flex-end", lineHeight: 1, pt: 0.25 }, { children: ["~", (route.steps
40
- .map((step) => step.estimate.executionDuration)
41
- .reduce((duration, x) => duration + x) / 60).toFixed(0)] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, color: "text.secondary", textAlign: "end", lineHeight: 1, mt: 0.5 }, { children: t(`swap.minutes`) }))] })] }))] })));
33
+ const handleExpand = (e) => {
34
+ e.stopPropagation();
35
+ setExpanded((expanded) => !expanded);
36
+ };
37
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ dense: variant === 'dense', variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true }, other, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.Label, Object.assign({ active: active !== null && active !== void 0 ? active : label !== alternativeTag }, { children: label })), variant === 'extended' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route })) : null] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount }), step: variant === 'extended' ? route.steps[0] : undefined }), variant === 'extended' ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconButton, Object.assign({ onClick: handleExpand, size: "small" }, { children: expanded ? (0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}) }))) : null] })), (0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ mountOnEnter: true, unmountOnExit: true, in: expanded }, { children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) })), variant !== 'extended' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route, dense: true })) : null] })));
42
38
  };
43
39
  exports.SwapRouteCard = SwapRouteCard;
40
+ const SwapRouteCardEssentials = ({ route, dense }) => {
41
+ var _a;
42
+ const { t } = (0, react_i18next_1.useTranslation)();
43
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: dense ? 'space-between' : 'flex-end', flex: 1, pl: dense ? 0 : 2, mt: dense ? 2 : 0 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center", pr: dense ? 0 : 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ lineHeight: 0, mr: 0.5, color: "grey.500" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.EvStationOutlined, { fontSize: dense ? 'medium' : 'small' }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1 }, { children: t(`swap.currency`, { value: (_a = route.gasCostUSD) !== null && _a !== void 0 ? _a : 0 }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center", pr: dense ? 0 : 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ lineHeight: 0, mr: 0.5, color: "grey.500" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.AccessTime, { fontSize: dense ? 'medium' : 'small' }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1 }, { children: `${(route.steps
44
+ .map((step) => step.estimate.executionDuration)
45
+ .reduce((duration, x) => duration + x) / 60).toFixed(0)}m` }))] })), !dense ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ lineHeight: 0, mr: 0.5, color: "grey.500" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.LayersOutlined, { fontSize: dense ? 'medium' : 'small' }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1 }, { children: route.steps.length }))] }))) : null] })));
46
+ };
47
+ exports.SwapRouteCardEssentials = SwapRouteCardEssentials;
@@ -14,3 +14,33 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
14
14
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("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") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
15
15
  active?: boolean | undefined;
16
16
  }, {}, {}>;
17
+ export declare const IconButton: import("@emotion/styled").StyledComponent<{
18
+ children?: import("react").ReactNode;
19
+ classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
20
+ color?: "inherit" | "default" | "primary" | "secondary" | "error" | "warning" | "info" | "success" | undefined;
21
+ disabled?: boolean | undefined;
22
+ disableFocusRipple?: boolean | undefined;
23
+ edge?: false | "end" | "start" | undefined;
24
+ size?: "small" | "medium" | "large" | undefined;
25
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
26
+ } & Omit<{
27
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
28
+ centerRipple?: boolean | undefined;
29
+ children?: import("react").ReactNode;
30
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
31
+ disabled?: boolean | undefined;
32
+ disableRipple?: boolean | undefined;
33
+ disableTouchRipple?: boolean | undefined;
34
+ focusRipple?: boolean | undefined;
35
+ focusVisibleClassName?: string | undefined;
36
+ LinkComponent?: import("react").ElementType<any> | undefined;
37
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
38
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
39
+ tabIndex?: number | undefined;
40
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
41
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
42
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
43
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
44
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
45
+ active?: boolean | undefined;
46
+ }, {}, {}>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Label = void 0;
3
+ exports.IconButton = exports.Label = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
6
  const utils_1 = require("../../utils");
@@ -12,8 +12,8 @@ exports.Label = (0, styles_1.styled)(material_1.Typography, {
12
12
  borderColor: active
13
13
  ? theme.palette.secondary.main
14
14
  : theme.palette.mode === 'light'
15
- ? theme.palette.grey[500]
16
- : theme.palette.grey[600],
15
+ ? theme.palette.grey[300]
16
+ : theme.palette.grey[700],
17
17
  borderRadius: theme.shape.borderRadiusSecondary,
18
18
  color: active
19
19
  ? (0, utils_1.getContrastTextColor)(theme, theme.palette.secondary.main)
@@ -28,3 +28,16 @@ exports.Label = (0, styles_1.styled)(material_1.Typography, {
28
28
  display: 'inline-flex',
29
29
  userSelect: 'none',
30
30
  }));
31
+ exports.IconButton = (0, styles_1.styled)(material_1.IconButton, {
32
+ shouldForwardProp: (prop) => prop !== 'active',
33
+ })(({ theme, active }) => {
34
+ const backgroundColor = theme.palette.mode === 'light'
35
+ ? theme.palette.common.black
36
+ : theme.palette.common.white;
37
+ return {
38
+ backgroundColor: (0, styles_1.alpha)(backgroundColor, 0.04),
39
+ '&:hover': {
40
+ backgroundColor: (0, styles_1.alpha)(backgroundColor, 0.08),
41
+ },
42
+ };
43
+ });
@@ -16,17 +16,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
16
16
  const material_1 = require("@mui/material");
17
17
  const Card_1 = require("../Card");
18
18
  const SwapRouteCardSkeleton = (_a) => {
19
- var { dense } = _a, other = __rest(_a, ["dense"]);
20
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ dense: dense, indented: true }, other, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 120, height: 24, sx: { borderRadius: 0.5 } }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ my: 2 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
21
- display: 'flex',
22
- alignItems: 'center',
23
- } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mr: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }) })), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 32 })] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ ml: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 102, height: 16, sx: { borderRadius: 0.5 } }) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
24
- display: 'flex',
25
- justifyContent: 'space-between',
26
- } }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 56, height: 20 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 52, height: 16 })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
27
- display: 'flex',
28
- alignItems: 'flex-end',
29
- flexDirection: 'column',
30
- } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 40, height: 20 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 16 })] }))] }))] })));
19
+ var { variant } = _a, other = __rest(_a, ["variant"]);
20
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ dense: variant === 'dense', indented: true }, other, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 118, height: 24, sx: { borderRadius: 0.5 } }), variant === 'extended' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 52, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 44, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 32, height: 24 })] }))) : null] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mr: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }) })), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 32 })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ml: 6, display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 102, height: 16, sx: { borderRadius: 0.5 } }), variant === 'extended' ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 72, height: 16, sx: { marginLeft: 1 } })) : null] }))] })), variant !== 'extended' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mt: 2, display: "flex", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 })] }))) : null] })));
31
21
  };
32
22
  exports.SwapRouteCardSkeleton = SwapRouteCardSkeleton;
@@ -1,4 +1,2 @@
1
1
  /// <reference types="react" />
2
- import type { BoxProps } from '@mui/material';
3
- import type { SwapRouteCardSkeletonProps } from './types';
4
- export declare const SwapRouteNotFoundCard: React.FC<SwapRouteCardSkeletonProps & BoxProps>;
2
+ export declare const SwapRouteNotFoundCard: React.FC;
@@ -1,23 +1,11 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.SwapRouteNotFoundCard = void 0;
15
4
  const jsx_runtime_1 = require("react/jsx-runtime");
16
5
  const icons_material_1 = require("@mui/icons-material");
17
6
  const material_1 = require("@mui/material");
18
7
  const react_i18next_1 = require("react-i18next");
19
- const SwapRouteNotFoundCard = (_a) => {
20
- var { dense } = _a, other = __rest(_a, ["dense"]);
8
+ const SwapRouteNotFoundCard = () => {
21
9
  const { t } = (0, react_i18next_1.useTranslation)();
22
10
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
23
11
  display: 'flex',
@@ -1,9 +1,13 @@
1
1
  import type { Route } from '@lifi/sdk';
2
2
  export interface SwapRouteCardProps {
3
3
  route: Route;
4
- dense?: boolean;
4
+ variant?: 'default' | 'extended' | 'dense';
5
5
  active?: boolean;
6
6
  }
7
- export interface SwapRouteCardSkeletonProps {
7
+ export interface SwapRouteCardEssentialsProps {
8
+ route: Route;
8
9
  dense?: boolean;
9
10
  }
11
+ export interface SwapRouteCardSkeletonProps {
12
+ variant?: 'default' | 'extended' | 'dense';
13
+ }