@lifi/widget 1.18.8 → 1.19.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 (173) hide show
  1. package/App.js +3 -3
  2. package/cjs/App.js +3 -3
  3. package/cjs/components/ActiveSwaps/ActiveSwaps.js +1 -1
  4. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +0 -14
  5. package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +1 -9
  6. package/cjs/components/AppContainer.d.ts +11 -1
  7. package/cjs/components/AppContainer.js +3 -6
  8. package/cjs/components/BottomSheet/BottomSheet.js +9 -32
  9. package/cjs/components/BottomSheet/types.d.ts +2 -2
  10. package/cjs/components/Card/Card.js +1 -1
  11. package/cjs/components/Card/CardHeader.d.ts +1 -1
  12. package/cjs/components/ChainSelect/ChainSelect.js +1 -1
  13. package/cjs/components/ChainSelect/useChainSelect.js +2 -4
  14. package/cjs/components/Dialog.d.ts +22 -1
  15. package/cjs/components/Dialog.js +23 -20
  16. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +19 -22
  17. package/cjs/components/Header/NavigationHeader.js +1 -1
  18. package/cjs/components/Header/WalletHeader.js +2 -2
  19. package/cjs/components/PoweredBy/PoweredBy.js +1 -1
  20. package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +1 -1
  21. package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +6 -6
  22. package/cjs/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  23. package/cjs/components/SendToWallet/SendToWallet.d.ts +1 -0
  24. package/cjs/components/SendToWallet/SendToWallet.js +10 -5
  25. package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
  26. package/cjs/components/Step/StepProcess.js +1 -1
  27. package/cjs/components/SwapButton/SwapButton.js +4 -4
  28. package/cjs/components/SwapButton/types.d.ts +2 -0
  29. package/cjs/components/SwapInput/SwapInput.js +6 -2
  30. package/cjs/components/SwapInput/SwapInputAdornment.js +4 -2
  31. package/cjs/components/SwapInput/SwapInputAdornment.style.js +1 -13
  32. package/cjs/components/SwapRouteCard/SwapRouteCard.js +8 -4
  33. package/cjs/components/SwapRoutes/SwapRoutes.js +4 -4
  34. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +14 -14
  35. package/cjs/components/SwapRoutes/SwapRoutes.style.js +13 -13
  36. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
  37. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +17 -12
  38. package/cjs/components/SwapRoutes/useSetRecommendedRoute.d.ts +2 -0
  39. package/cjs/components/SwapRoutes/useSetRecommendedRoute.js +13 -0
  40. package/cjs/components/Token/Token.js +5 -5
  41. package/cjs/components/Token/Token.style.d.ts +10 -0
  42. package/cjs/components/Token/Token.style.js +13 -7
  43. package/cjs/components/TokenList/TokenList.js +10 -7
  44. package/cjs/config/theme.js +22 -8
  45. package/cjs/config/version.d.ts +1 -1
  46. package/cjs/config/version.js +1 -1
  47. package/cjs/hooks/index.d.ts +1 -0
  48. package/cjs/hooks/index.js +1 -0
  49. package/cjs/hooks/useExpandableVariant.d.ts +1 -0
  50. package/cjs/hooks/useExpandableVariant.js +14 -0
  51. package/cjs/hooks/useGasSufficiency.d.ts +3 -2
  52. package/cjs/hooks/useGasSufficiency.js +50 -26
  53. package/cjs/hooks/useSwapRoutes.js +4 -2
  54. package/cjs/hooks/useToken.js +5 -2
  55. package/cjs/hooks/useTokenBalance.js +15 -10
  56. package/cjs/hooks/useTokenSearch.d.ts +1 -3
  57. package/cjs/hooks/useTokenSearch.js +3 -5
  58. package/cjs/i18n/en/translation.json +9 -8
  59. package/cjs/i18n/index.d.ts +6 -5
  60. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +21 -4
  61. package/cjs/pages/MainPage/MainPage.js +3 -3
  62. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +1 -1
  63. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
  64. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  65. package/cjs/pages/SwapPage/StatusBottomSheet.js +4 -4
  66. package/cjs/pages/SwapPage/SwapPage.js +4 -4
  67. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +3 -2
  68. package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.d.ts +1 -0
  69. package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.js +46 -0
  70. package/cjs/providers/SwapFormProvider/types.d.ts +4 -4
  71. package/cjs/providers/SwapFormProvider/types.js +2 -2
  72. package/cjs/providers/WalletProvider/WalletFormUpdate.d.ts +5 -0
  73. package/cjs/providers/WalletProvider/WalletFormUpdate.js +64 -0
  74. package/cjs/providers/WalletProvider/WalletProvider.js +3 -58
  75. package/cjs/providers/WidgetProvider/WidgetProvider.js +12 -5
  76. package/cjs/stores/routes/index.d.ts +1 -1
  77. package/cjs/stores/routes/index.js +1 -1
  78. package/cjs/stores/routes/types.d.ts +4 -4
  79. package/cjs/stores/routes/useRecommendedRouteStore.d.ts +4 -0
  80. package/cjs/stores/routes/{useSelectedRouteStore.js → useRecommendedRouteStore.js} +4 -4
  81. package/cjs/stores/routes/useRouteExecutionStore.js +10 -2
  82. package/cjs/stores/settings/useSettingsStore.js +5 -2
  83. package/cjs/types/widget.d.ts +1 -0
  84. package/components/ActiveSwaps/ActiveSwaps.js +3 -3
  85. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +0 -14
  86. package/components/ActiveSwaps/ActiveSwaps.style.js +1 -9
  87. package/components/AppContainer.d.ts +11 -1
  88. package/components/AppContainer.js +2 -4
  89. package/components/BottomSheet/BottomSheet.js +9 -32
  90. package/components/BottomSheet/types.d.ts +2 -2
  91. package/components/Card/Card.js +1 -1
  92. package/components/Card/CardHeader.d.ts +1 -1
  93. package/components/ChainSelect/ChainSelect.js +1 -1
  94. package/components/ChainSelect/useChainSelect.js +2 -4
  95. package/components/Dialog.d.ts +22 -1
  96. package/components/Dialog.js +22 -19
  97. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +21 -24
  98. package/components/Header/NavigationHeader.js +2 -2
  99. package/components/Header/WalletHeader.js +2 -2
  100. package/components/PoweredBy/PoweredBy.js +1 -1
  101. package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +1 -1
  102. package/components/ReverseTokensButton/ReverseTokensButton.js +6 -6
  103. package/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  104. package/components/SendToWallet/SendToWallet.d.ts +1 -0
  105. package/components/SendToWallet/SendToWallet.js +9 -5
  106. package/components/SendToWallet/SendToWalletButton.js +2 -2
  107. package/components/Step/StepProcess.js +1 -1
  108. package/components/SwapButton/SwapButton.js +4 -4
  109. package/components/SwapButton/types.d.ts +2 -0
  110. package/components/SwapInput/SwapInput.js +6 -2
  111. package/components/SwapInput/SwapInputAdornment.js +4 -2
  112. package/components/SwapInput/SwapInputAdornment.style.js +2 -14
  113. package/components/SwapRouteCard/SwapRouteCard.js +9 -5
  114. package/components/SwapRoutes/SwapRoutes.js +4 -4
  115. package/components/SwapRoutes/SwapRoutes.style.d.ts +14 -14
  116. package/components/SwapRoutes/SwapRoutes.style.js +13 -13
  117. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
  118. package/components/SwapRoutes/SwapRoutesExpanded.js +16 -12
  119. package/components/SwapRoutes/useSetRecommendedRoute.d.ts +2 -0
  120. package/components/SwapRoutes/useSetRecommendedRoute.js +9 -0
  121. package/components/Token/Token.js +7 -7
  122. package/components/Token/Token.style.d.ts +10 -0
  123. package/components/Token/Token.style.js +12 -6
  124. package/components/TokenList/TokenList.js +10 -7
  125. package/config/theme.js +22 -8
  126. package/config/version.d.ts +1 -1
  127. package/config/version.js +1 -1
  128. package/hooks/index.d.ts +1 -0
  129. package/hooks/index.js +1 -0
  130. package/hooks/useExpandableVariant.d.ts +1 -0
  131. package/hooks/useExpandableVariant.js +10 -0
  132. package/hooks/useGasSufficiency.d.ts +3 -2
  133. package/hooks/useGasSufficiency.js +50 -26
  134. package/hooks/useSwapRoutes.js +4 -2
  135. package/hooks/useToken.js +5 -2
  136. package/hooks/useTokenBalance.js +15 -10
  137. package/hooks/useTokenSearch.d.ts +1 -3
  138. package/hooks/useTokenSearch.js +3 -5
  139. package/i18n/en/translation.json +9 -8
  140. package/i18n/index.d.ts +6 -5
  141. package/package.json +11 -11
  142. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +24 -7
  143. package/pages/MainPage/MainPage.js +3 -3
  144. package/pages/SelectWalletPage/SelectWalletPage.js +1 -1
  145. package/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
  146. package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  147. package/pages/SwapPage/StatusBottomSheet.js +4 -4
  148. package/pages/SwapPage/SwapPage.js +5 -5
  149. package/providers/SwapFormProvider/SwapFormProvider.js +4 -3
  150. package/providers/SwapFormProvider/URLSearchParamsBuilder.d.ts +1 -0
  151. package/providers/SwapFormProvider/URLSearchParamsBuilder.js +42 -0
  152. package/providers/SwapFormProvider/types.d.ts +4 -4
  153. package/providers/SwapFormProvider/types.js +2 -2
  154. package/providers/WalletProvider/WalletFormUpdate.d.ts +5 -0
  155. package/providers/WalletProvider/WalletFormUpdate.js +60 -0
  156. package/providers/WalletProvider/WalletProvider.js +5 -60
  157. package/providers/WidgetProvider/WidgetProvider.js +12 -5
  158. package/stores/routes/index.d.ts +1 -1
  159. package/stores/routes/index.js +1 -1
  160. package/stores/routes/types.d.ts +4 -4
  161. package/stores/routes/useRecommendedRouteStore.d.ts +4 -0
  162. package/stores/routes/useRecommendedRouteStore.js +9 -0
  163. package/stores/routes/useRouteExecutionStore.js +10 -2
  164. package/stores/settings/useSettingsStore.js +5 -2
  165. package/tsconfig.cjs.tsbuildinfo +1 -1
  166. package/types/widget.d.ts +1 -0
  167. package/cjs/components/SwapRoutes/useSetSelectedRoute.d.ts +0 -2
  168. package/cjs/components/SwapRoutes/useSetSelectedRoute.js +0 -13
  169. package/cjs/stores/routes/useSelectedRouteStore.d.ts +0 -4
  170. package/components/SwapRoutes/useSetSelectedRoute.d.ts +0 -2
  171. package/components/SwapRoutes/useSetSelectedRoute.js +0 -9
  172. package/stores/routes/useSelectedRouteStore.d.ts +0 -4
  173. package/stores/routes/useSelectedRouteStore.js +0 -9
@@ -30,11 +30,15 @@ const SwapInput = ({ formType }) => {
30
30
  const isSelected = !!(chain && token);
31
31
  const handleChange = (event) => {
32
32
  const { value } = event.target;
33
- setValue(amountKey, (0, utils_1.formatAmount)(value, true));
33
+ const formattedAmount = (0, utils_1.formatAmount)(value, true);
34
+ setValue(amountKey, formattedAmount, {
35
+ shouldTouch: true,
36
+ });
34
37
  };
35
38
  const handleBlur = (event) => {
36
39
  const { value } = event.target;
37
- setValue(amountKey, (0, utils_1.formatAmount)(value));
40
+ const formattedAmount = (0, utils_1.formatAmount)(value);
41
+ setValue(amountKey, formattedAmount);
38
42
  };
39
43
  (0, react_1.useLayoutEffect)(() => {
40
44
  (0, utils_1.fitInputText)(SwapInput_style_1.maxInputFontSize, SwapInput_style_1.minInputFontSize, ref.current);
@@ -20,8 +20,10 @@ const SwapInputAdornment = ({ formType }) => {
20
20
  const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
21
21
  const handleMax = () => {
22
22
  var _a;
23
- setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), (_a = token === null || token === void 0 ? void 0 : token.amount) !== null && _a !== void 0 ? _a : '');
23
+ setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), (_a = token === null || token === void 0 ? void 0 : token.amount) !== null && _a !== void 0 ? _a : '', {
24
+ shouldTouch: true,
25
+ });
24
26
  };
25
- return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 46, height: 20, sx: { borderRadius: 0.5 } })) : formType === 'from' && (token === null || token === void 0 ? void 0 : token.amount) ? ((0, jsx_runtime_1.jsx)(SwapInputAdornment_style_1.Button, Object.assign({ onClick: handleMax, variant: "outlined" }, { children: t('button.max') }))) : null })));
27
+ return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 46, height: 20, sx: { borderRadius: 0.5 } })) : formType === 'from' && (token === null || token === void 0 ? void 0 : token.amount) ? ((0, jsx_runtime_1.jsx)(SwapInputAdornment_style_1.Button, Object.assign({ onClick: handleMax }, { children: t('button.max') }))) : null })));
26
28
  };
27
29
  exports.SwapInputAdornment = SwapInputAdornment;
@@ -4,20 +4,8 @@ exports.Button = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
6
  exports.Button = (0, styles_1.styled)(material_1.Button)(({ theme }) => ({
7
- borderColor: theme.palette.mode === 'light'
8
- ? theme.palette.grey[300]
9
- : theme.palette.grey[800],
10
- color: theme.palette.text.secondary,
11
- padding: theme.spacing(0.125, 1, 0.375, 1),
7
+ padding: theme.spacing(0.5, 1, 0.625, 1),
12
8
  lineHeight: 1,
13
9
  fontSize: '0.875rem',
14
10
  minWidth: 'unset',
15
- '&:hover': {
16
- color: theme.palette.mode === 'light'
17
- ? theme.palette.primary.main
18
- : theme.palette.text.primary,
19
- borderColor: theme.palette.mode === 'light'
20
- ? (0, styles_1.lighten)(theme.palette.primary.main, 0.5)
21
- : theme.palette.text.secondary,
22
- },
23
11
  }));
@@ -34,14 +34,18 @@ const SwapRouteCard = (_a) => {
34
34
  e.stopPropagation();
35
35
  setCardExpanded((expanded) => !expanded);
36
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 === 'stretched' ? ((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 === 'stretched' ? route.steps[0] : undefined }), variant === 'stretched' && !expanded ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconButton, Object.assign({ onClick: handleExpand, size: "small" }, { children: cardExpanded ? (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: cardExpanded }, { children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) })), variant !== 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route, dense: true })) : null] })));
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 === 'stretched' ? ((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 === 'stretched' ? route.steps[0] : undefined }), variant === 'stretched' && !expanded ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconButton, Object.assign({ onClick: handleExpand, size: "small" }, { children: cardExpanded ? (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({ timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true }, { children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) })), variant !== 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route, dense: true })) : null] })));
38
38
  };
39
39
  exports.SwapRouteCard = SwapRouteCard;
40
40
  const SwapRouteCardEssentials = ({ route, dense }) => {
41
41
  var _a;
42
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] })));
43
+ const executionTimeMinutes = Math.ceil(route.steps
44
+ .map((step) => step.estimate.executionDuration)
45
+ .reduce((duration, x) => duration + x, 0) / 60);
46
+ const gasCostUSD = parseFloat((_a = route.gasCostUSD) !== null && _a !== void 0 ? _a : '') || 0.01;
47
+ 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.jsx)(material_1.Tooltip, Object.assign({ title: t(`tooltip.estimatedNetworkFee`), placement: "top", enterDelay: 400, enterNextDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center", mr: 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: gasCostUSD }) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, enterNextDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center", mr: 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: t('swap.estimatedTime', {
48
+ value: executionTimeMinutes,
49
+ }) }))] })) })), !dense ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t(`tooltip.numberOfSteps`), placement: "top", enterDelay: 400, enterNextDelay: 400, arrow: true }, { children: (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
50
  };
47
51
  exports.SwapRouteCardEssentials = SwapRouteCardEssentials;
@@ -13,14 +13,14 @@ const SwapRouteCard_1 = require("../../components/SwapRouteCard");
13
13
  const hooks_1 = require("../../hooks");
14
14
  const utils_1 = require("../../utils");
15
15
  const SwapRoutes_style_1 = require("./SwapRoutes.style");
16
- const useSetSelectedRoute_1 = require("./useSetSelectedRoute");
16
+ const useSetRecommendedRoute_1 = require("./useSetRecommendedRoute");
17
17
  const SwapRoutes = (props) => {
18
18
  const { t } = (0, react_i18next_1.useTranslation)();
19
19
  const navigate = (0, react_router_dom_1.useNavigate)();
20
20
  const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
21
21
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useSwapRoutes)();
22
22
  const currentRoute = routes === null || routes === void 0 ? void 0 : routes[0];
23
- (0, useSetSelectedRoute_1.useSetSelectedRoute)(currentRoute, isFetching);
23
+ (0, useSetRecommendedRoute_1.useSetRecommendedRoute)(currentRoute, isFetching);
24
24
  if (!currentRoute && !isLoading && !isFetching && !isFetched) {
25
25
  return null;
26
26
  }
@@ -33,9 +33,9 @@ const SwapRoutes = (props) => {
33
33
  top: 8,
34
34
  right: 8,
35
35
  } }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex' } }, { children: [(0, jsx_runtime_1.jsx)(SwapRoutes_style_1.Stack, Object.assign({ direction: "row", spacing: 2, my: 2, ml: 2, mr: routeNotFound ? 2 : 1, sx: {
36
- borderWidth: !routeNotFound && (isFetching || (routes && routes.length > 1))
36
+ borderRightWidth: !routeNotFound && (isFetching || (routes && routes.length > 1))
37
37
  ? 1
38
38
  : 0,
39
- } }, { children: isLoading || isFetching ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" }), (0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" })] })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, variant: "dense", active: true }), routes.length > 1 ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: "80%", route: routes[1], variant: "dense" })) : null] })) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ py: 1, pr: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleCardClick, size: "medium", "aria-label": "swap-routes", disabled: isValidating || !isValid }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) })) }))) : null }))] }))] })));
39
+ } }, { children: isLoading || isFetching ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" }), (0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" })] })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: routes.length > 1 ? '80%' : '100%', route: currentRoute, variant: "dense", active: true }), routes.length > 1 ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: "80%", route: routes[1], variant: "dense" })) : null] })) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !routeNotFound ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ py: 1, pr: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleCardClick, size: "medium", disabled: isValidating || !isValid }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) })) }))) : null }))] }))] })));
40
40
  };
41
41
  exports.SwapRoutes = SwapRoutes;
@@ -1,14 +1,4 @@
1
1
  /// <reference types="react" />
2
- export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
- ref?: import("react").Ref<unknown> | undefined;
4
- children?: import("react").ReactNode;
5
- direction?: import("@mui/system").ResponsiveStyleValue<"row" | "column" | "column-reverse" | "row-reverse"> | undefined;
6
- spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
7
- divider?: import("react").ReactNode;
8
- sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
10
- ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | "direction" | ("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") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
12
2
  export declare const CollapseContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
13
3
  children?: import("react").ReactNode;
14
4
  component?: import("react").ElementType<any> | undefined;
@@ -25,14 +15,14 @@ export declare const ScrollableContainer: import("@emotion/styled").StyledCompon
25
15
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
26
16
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
27
17
  }, 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>, {}, {}>;
28
- export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
18
+ export declare const Container: import("@emotion/styled").StyledComponent<{
29
19
  children?: import("react").ReactNode;
30
- component?: import("react").ElementType<any> | undefined;
31
- ref?: import("react").Ref<unknown> | undefined;
20
+ classes?: Partial<import("@mui/material").ScopedCssBaselineClasses> | undefined;
21
+ enableColorScheme?: boolean | undefined;
32
22
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
33
23
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
34
24
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
35
- }, 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>, {}, {}>;
25
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "enableColorScheme"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
36
26
  export declare const Header: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
37
27
  children?: import("react").ReactNode;
38
28
  component?: import("react").ElementType<any> | undefined;
@@ -41,3 +31,13 @@ export declare const Header: import("@emotion/styled").StyledComponent<import("@
41
31
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
42
32
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
43
33
  }, 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>, {}, {}>;
34
+ export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
35
+ ref?: import("react").Ref<unknown> | undefined;
36
+ children?: import("react").ReactNode;
37
+ direction?: import("@mui/system").ResponsiveStyleValue<"row" | "column" | "column-reverse" | "row-reverse"> | undefined;
38
+ spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
39
+ divider?: import("react").ReactNode;
40
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
41
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
42
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
43
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | "direction" | ("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") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,20 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Header = exports.Container = exports.ScrollableContainer = exports.CollapseContainer = exports.Stack = void 0;
3
+ exports.Stack = exports.Header = exports.Container = exports.ScrollableContainer = exports.CollapseContainer = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
6
  const AppContainer_1 = require("../AppContainer");
7
- exports.Stack = (0, styles_1.styled)(material_1.Stack)(({ theme }) => ({
8
- alignItems: 'stretch',
9
- display: 'flex',
10
- flex: 1,
11
- flexWrap: 'nowrap',
12
- overflow: 'hidden',
13
- borderRight: `solid ${theme.palette.mode === 'light'
14
- ? theme.palette.grey[300]
15
- : theme.palette.grey[800]}`,
16
- width: 'calc(100% - 48px)',
17
- }));
18
7
  exports.CollapseContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
19
8
  height: AppContainer_1.maxHeight,
20
9
  }));
@@ -25,7 +14,7 @@ exports.ScrollableContainer = (0, styles_1.styled)(material_1.Box)({
25
14
  display: 'flex',
26
15
  flexDirection: 'column',
27
16
  });
28
- exports.Container = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
17
+ exports.Container = (0, styles_1.styled)(material_1.ScopedCssBaseline)(({ theme }) => ({
29
18
  backgroundColor: theme.palette.background.default,
30
19
  overflow: 'auto',
31
20
  width: 436,
@@ -45,3 +34,14 @@ exports.Header = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
45
34
  top: 0,
46
35
  zIndex: 1200,
47
36
  }));
37
+ exports.Stack = (0, styles_1.styled)(material_1.Stack)(({ theme }) => ({
38
+ alignItems: 'stretch',
39
+ display: 'flex',
40
+ flex: 1,
41
+ flexWrap: 'nowrap',
42
+ overflow: 'hidden',
43
+ borderRight: `solid ${theme.palette.mode === 'light'
44
+ ? theme.palette.grey[300]
45
+ : theme.palette.grey[800]}`,
46
+ width: 'calc(100% - 48px)',
47
+ }));
@@ -1,2 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  export declare const SwapRoutesExpanded: () => JSX.Element;
3
+ export declare const SwapRoutesExpandedElement: () => JSX.Element;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwapRoutesExpanded = void 0;
3
+ exports.SwapRoutesExpandedElement = exports.SwapRoutesExpanded = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const react_hook_form_1 = require("react-hook-form");
@@ -13,8 +13,19 @@ const utils_1 = require("../../utils");
13
13
  const ProgressToNextUpdate_1 = require("../ProgressToNextUpdate");
14
14
  const SwapRouteCard_1 = require("../SwapRouteCard");
15
15
  const SwapRoutes_style_1 = require("./SwapRoutes.style");
16
- const useSetSelectedRoute_1 = require("./useSetSelectedRoute");
16
+ const useSetRecommendedRoute_1 = require("./useSetRecommendedRoute");
17
+ const timeout = { enter: 225, exit: 225, appear: 0 };
17
18
  const SwapRoutesExpanded = () => {
19
+ const element = (0, react_router_dom_1.useRoutes)([
20
+ {
21
+ path: '/',
22
+ element: null,
23
+ },
24
+ ]);
25
+ return ((0, jsx_runtime_1.jsx)(SwapRoutes_style_1.CollapseContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ timeout: timeout, in: !!element, orientation: "horizontal" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({ timeout: timeout, in: !!element, mountOnEnter: true, unmountOnExit: true }, { children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(exports.SwapRoutesExpandedElement, {}) }) })) })) }));
26
+ };
27
+ exports.SwapRoutesExpanded = SwapRoutesExpanded;
28
+ const SwapRoutesExpandedElement = () => {
18
29
  const { t } = (0, react_i18next_1.useTranslation)();
19
30
  const navigate = (0, react_router_dom_1.useNavigate)();
20
31
  const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
@@ -22,13 +33,7 @@ const SwapRoutesExpanded = () => {
22
33
  const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
23
34
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useSwapRoutes)();
24
35
  const currentRoute = routes === null || routes === void 0 ? void 0 : routes[0];
25
- (0, useSetSelectedRoute_1.useSetSelectedRoute)(currentRoute, isFetching);
26
- const { pathname } = (0, react_router_dom_1.useLocation)();
27
- const cleanedPathname = pathname.endsWith('/')
28
- ? pathname.slice(0, -1)
29
- : pathname;
30
- const path = cleanedPathname.substring(cleanedPathname.lastIndexOf('/') + 1);
31
- const hasPath = utils_1.navigationRoutesValues.includes(path);
36
+ (0, useSetRecommendedRoute_1.useSetRecommendedRoute)(currentRoute, isFetching);
32
37
  const handleRouteClick = (route) => {
33
38
  if (isValid && !isValidating) {
34
39
  setExecutableRoute(route);
@@ -37,8 +42,8 @@ const SwapRoutesExpanded = () => {
37
42
  });
38
43
  }
39
44
  };
40
- const expanded = Boolean(currentRoute || isLoading || isFetching || isFetched) && !hasPath;
45
+ const expanded = Boolean(currentRoute || isLoading || isFetching || isFetched);
41
46
  const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded;
42
- return ((0, jsx_runtime_1.jsx)(SwapRoutes_style_1.CollapseContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ appear: true, timeout: 225, in: expanded, orientation: "horizontal" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({ appear: true, timeout: 225, in: expanded }, { children: (0, jsx_runtime_1.jsx)(SwapRoutes_style_1.Container, Object.assign({ sx: containerStyle }, { children: (0, jsx_runtime_1.jsxs)(SwapRoutes_style_1.ScrollableContainer, { children: [(0, jsx_runtime_1.jsxs)(SwapRoutes_style_1.Header, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: "700", flex: 1, noWrap: true }, { children: t('swap.routes') })), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: { marginRight: -1 } })] }), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ direction: "column", spacing: 2, flex: 1, paddingX: 3, paddingBottom: 3 }, { children: routeNotFound ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : isLoading || isFetching ? (Array.from({ length: 3 }).map((_, index) => ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { variant: "stretched" }, index)))) : (routes === null || routes === void 0 ? void 0 : routes.map((route, index) => ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { route: route, onClick: () => handleRouteClick(route), active: index === 0, variant: "stretched", expanded: (routes === null || routes === void 0 ? void 0 : routes.length) <= 2 }, route.id)))) }))] }) })) })) })) }));
47
+ return ((0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ timeout: timeout.enter, in: expanded, orientation: "horizontal" }, { children: (0, jsx_runtime_1.jsx)(material_1.Grow, Object.assign({ timeout: timeout.enter, in: expanded, mountOnEnter: true, unmountOnExit: true }, { children: (0, jsx_runtime_1.jsx)(SwapRoutes_style_1.Container, Object.assign({ sx: containerStyle, enableColorScheme: true }, { children: (0, jsx_runtime_1.jsxs)(SwapRoutes_style_1.ScrollableContainer, { children: [(0, jsx_runtime_1.jsxs)(SwapRoutes_style_1.Header, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: "700", flex: 1, noWrap: true }, { children: t('swap.routes') })), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: { marginRight: -1 } })] }), (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ direction: "column", spacing: 2, flex: 1, paddingX: 3, paddingBottom: 3 }, { children: routeNotFound ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : isLoading || isFetching ? (Array.from({ length: 3 }).map((_, index) => ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { variant: "stretched" }, index)))) : (routes === null || routes === void 0 ? void 0 : routes.map((route, index) => ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { route: route, onClick: () => handleRouteClick(route), active: index === 0, variant: "stretched", expanded: (routes === null || routes === void 0 ? void 0 : routes.length) <= 2 }, route.id)))) }))] }) })) })) })));
43
48
  };
44
- exports.SwapRoutesExpanded = SwapRoutesExpanded;
49
+ exports.SwapRoutesExpandedElement = SwapRoutesExpandedElement;
@@ -0,0 +1,2 @@
1
+ import type { Route } from '@lifi/sdk';
2
+ export declare const useSetRecommendedRoute: (currentRoute?: Route, isFetching?: boolean) => void;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useSetRecommendedRoute = void 0;
4
+ const react_1 = require("react");
5
+ const stores_1 = require("../../stores");
6
+ const useSetRecommendedRoute = (currentRoute, isFetching) => {
7
+ const setRecommendedRoute = (0, stores_1.useRecommendedRouteStore)((state) => state.setRecommendedRoute);
8
+ (0, react_1.useEffect)(() => {
9
+ setRecommendedRoute(!isFetching ? currentRoute : undefined);
10
+ return () => setRecommendedRoute(undefined);
11
+ }, [currentRoute, isFetching, setRecommendedRoute]);
12
+ };
13
+ exports.useSetRecommendedRoute = useSetRecommendedRoute;
@@ -28,12 +28,12 @@ const Token = (_a) => {
28
28
  const { getChainById } = (0, hooks_1.useChains)();
29
29
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ flex: 1 }, other, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", flex: 1, alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(TextFitter_1.TextFitter, Object.assign({ height: 30, textStyle: {
30
30
  fontWeight: 700,
31
- } }, { children: (0, utils_1.formatTokenAmount)(token.amount, token.decimals) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex" }, { children: [(0, jsx_runtime_1.jsx)(Token_style_1.TextSecondary, Object.assign({ connected: connected }, { children: t(`swap.tokenOnChain`, {
31
+ } }, { children: (0, utils_1.formatTokenAmount)(token.amount, token.decimals) }))] })), (0, jsx_runtime_1.jsxs)(Token_style_1.TextSecondaryContainer, Object.assign({ connected: connected, component: "span" }, { children: [(0, jsx_runtime_1.jsx)(Token_style_1.TextSecondary, Object.assign({ connected: connected }, { children: t(`swap.tokenOnChain`, {
32
32
  tokenSymbol: token.symbol,
33
33
  chainName: (_b = getChainById(token.chainId)) === null || _b === void 0 ? void 0 : _b.name,
34
- }) })), step ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "flex-end", height: 12, mt: 0.5 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, lineHeight: 1, fontWeight: 500, color: "text.secondary", px: 1 }, { children: "\u2022" })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ pr: 0.75 }, { children: (0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, Object.assign({ src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
35
- border: 0,
36
- marginBottom: -0.25,
37
- } }, { children: step.toolDetails.name[0] })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, lineHeight: 1, fontWeight: 500, color: "text.secondary" }, { children: step.toolDetails.name }))] }))) : null] }))] })));
34
+ }) })), step ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, lineHeight: 1, fontWeight: 500, color: "text.secondary", px: 1, mt: 0.5 }, { children: "\u2022" })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "flex-end", height: 12, mt: 0.5 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ pr: 0.75 }, { children: (0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, Object.assign({ src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
35
+ border: 0,
36
+ marginBottom: -0.25,
37
+ } }, { children: step.toolDetails.name[0] })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, lineHeight: 1, fontWeight: 500, color: "text.secondary" }, { children: step.toolDetails.name }))] }))] })) : null] }))] })));
38
38
  };
39
39
  exports.Token = Token;
@@ -1,4 +1,14 @@
1
1
  /// <reference types="react" />
2
+ export declare const TextSecondaryContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
+ children?: import("react").ReactNode;
4
+ component?: import("react").ElementType<any> | undefined;
5
+ ref?: import("react").Ref<unknown> | undefined;
6
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
7
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
8
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
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
+ connected?: boolean | undefined;
11
+ }, {}, {}>;
2
12
  export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
13
  align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
4
14
  children?: import("react").ReactNode;
@@ -1,15 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TokenDivider = exports.TextSecondary = void 0;
3
+ exports.TokenDivider = exports.TextSecondary = exports.TextSecondaryContainer = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
- exports.TextSecondary = (0, styles_1.styled)(material_1.Typography, {
6
+ exports.TextSecondaryContainer = (0, styles_1.styled)(material_1.Box, {
7
7
  shouldForwardProp: (prop) => prop !== 'connected',
8
8
  })(({ theme, connected }) => ({
9
- fontSize: 12,
10
- lineHeight: 1,
11
- fontWeight: 500,
12
- color: theme.palette.text.secondary,
13
9
  borderLeftWidth: connected ? 2 : 0,
14
10
  borderLeftStyle: 'solid',
15
11
  borderColor: theme.palette.mode === 'light'
@@ -17,12 +13,22 @@ exports.TextSecondary = (0, styles_1.styled)(material_1.Typography, {
17
13
  : theme.palette.grey[800],
18
14
  margin: connected
19
15
  ? theme.spacing(0.5, 0, 0, 1.875)
20
- : theme.spacing(0.5, 0, 0, 6),
16
+ : theme.spacing(0, 0, 0, 6),
21
17
  padding: connected
22
18
  ? theme.spacing(0, 0, 0, 3.875)
23
19
  : theme.spacing(0, 0, 0, 0),
24
20
  display: 'flex',
25
21
  alignItems: 'flex-start',
22
+ flexWrap: 'wrap',
23
+ }));
24
+ exports.TextSecondary = (0, styles_1.styled)(material_1.Typography, {
25
+ shouldForwardProp: (prop) => prop !== 'connected',
26
+ })(({ theme, connected }) => ({
27
+ fontSize: 12,
28
+ lineHeight: 1,
29
+ fontWeight: 500,
30
+ color: theme.palette.text.secondary,
31
+ marginTop: connected ? 0 : theme.spacing(0.5),
26
32
  }));
27
33
  exports.TokenDivider = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
28
34
  height: 12,
@@ -30,7 +30,7 @@ const TokenList = ({ formType, height, onClick, }) => {
30
30
  !filteredTokens.length &&
31
31
  !!tokenSearchFilter &&
32
32
  !!selectedChainId;
33
- const { token: searchedToken, isLoading: isSearchedTokenLoading } = (0, hooks_1.useTokenSearch)(tokenSearchFilter, selectedChainId, tokenSearchEnabled);
33
+ const { token: searchedToken, isLoading: isSearchedTokenLoading } = (0, hooks_1.useTokenSearch)(selectedChainId, tokenSearchFilter, tokenSearchEnabled);
34
34
  const isLoading = isTokensLoading || (tokenSearchEnabled && isSearchedTokenLoading);
35
35
  const tokens = filteredTokens.length
36
36
  ? filteredTokens
@@ -39,23 +39,26 @@ const TokenList = ({ formType, height, onClick, }) => {
39
39
  : filteredTokens;
40
40
  const handleTokenClick = (0, react_1.useCallback)((tokenAddress) => {
41
41
  setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), tokenAddress, {
42
- shouldDirty: true,
42
+ shouldTouch: true,
43
+ });
44
+ // Set chain again to trigger URL builder update
45
+ setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
46
+ shouldTouch: true,
43
47
  });
44
48
  setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
45
49
  const oppositeFormType = formType === 'from' ? 'to' : 'from';
46
- const [selectedOppositeToken, selectedOppositeChain, selectedChain] = getValues([
50
+ const [selectedOppositeToken, selectedOppositeChainId] = getValues([
47
51
  providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType),
48
52
  providers_1.SwapFormKeyHelper.getChainKey(oppositeFormType),
49
- providers_1.SwapFormKeyHelper.getChainKey(formType),
50
53
  ]);
51
54
  if (selectedOppositeToken === tokenAddress &&
52
- selectedOppositeChain === selectedChain) {
55
+ selectedOppositeChainId === selectedChainId) {
53
56
  setValue(providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
54
- shouldDirty: false,
57
+ shouldTouch: true,
55
58
  });
56
59
  }
57
60
  onClick === null || onClick === void 0 ? void 0 : onClick();
58
- }, [formType, getValues, onClick, setValue]);
61
+ }, [formType, getValues, onClick, selectedChainId, setValue]);
59
62
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ref: parentRef, style: { height, overflow: 'auto' } }, { children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] })));
60
63
  };
61
64
  exports.TokenList = TokenList;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTheme = void 0;
4
+ const LoadingButton_1 = require("@mui/lab/LoadingButton");
4
5
  const colors_1 = require("@mui/material/colors");
5
6
  const DialogActions_1 = require("@mui/material/DialogActions");
6
7
  const styles_1 = require("@mui/material/styles");
@@ -48,6 +49,9 @@ const createTheme = (mode, theme = {}) => {
48
49
  const primaryMainColor = (_c = (_b = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) !== null && _c !== void 0 ? _c : palette.primary.main;
49
50
  const primaryLightColor = (0, styles_1.lighten)((_f = (_e = (_d = theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : palette.primary.main, 0.5);
50
51
  const primaryDarkColor = (0, styles_1.darken)((_j = (_h = (_g = theme.palette) === null || _g === void 0 ? void 0 : _g.primary) === null || _h === void 0 ? void 0 : _h.main) !== null && _j !== void 0 ? _j : palette.primary.main, 0.2);
52
+ const contrastButtonColor = (0, styles_1.getContrastRatio)(colors_1.common.white, primaryMainColor) >= 3
53
+ ? colors_1.common.white
54
+ : colors_1.common.black;
51
55
  return (0, styles_1.createTheme)({
52
56
  typography: Object.assign({ fontFamily: 'Inter var, Inter, sans-serif' }, theme.typography),
53
57
  palette: Object.assign(Object.assign(Object.assign({ mode }, palette), { primary: {
@@ -83,13 +87,25 @@ const createTheme = (mode, theme = {}) => {
83
87
  borderRadius: (_v = (_u = theme.shape) === null || _u === void 0 ? void 0 : _u.borderRadiusSecondary) !== null && _v !== void 0 ? _v : shape.borderRadiusSecondary,
84
88
  textTransform: 'none',
85
89
  fontSize: '1rem',
86
- '&.Mui-disabled, &.Mui-disabled:hover': {
90
+ [`&.Mui-disabled, &.Mui-disabled:hover`]: {
87
91
  color: mode === 'light'
88
- ? 'rgb(0 0 0 / 70%)'
89
- : 'rgb(255 255 255 / 70%)',
92
+ ? 'rgb(0 0 0 / 56%)'
93
+ : 'rgb(255 255 255 / 56%)',
90
94
  cursor: 'not-allowed',
91
95
  pointerEvents: 'auto',
92
96
  },
97
+ [`&.${LoadingButton_1.loadingButtonClasses.loading}.Mui-disabled`]: {
98
+ backgroundColor: primaryMainColor,
99
+ color: contrastButtonColor,
100
+ cursor: 'auto',
101
+ pointerEvents: 'auto',
102
+ },
103
+ [`.${LoadingButton_1.loadingButtonClasses.loadingIndicator}`]: {
104
+ color: contrastButtonColor,
105
+ },
106
+ [`&.${LoadingButton_1.loadingButtonClasses.root}.${LoadingButton_1.loadingButtonClasses.loading}`]: {
107
+ color: 'transparent',
108
+ },
93
109
  }, text: {
94
110
  backgroundColor: (0, styles_1.alpha)(primaryMainColor, 0.08),
95
111
  '&:hover': {
@@ -97,9 +113,7 @@ const createTheme = (mode, theme = {}) => {
97
113
  },
98
114
  }, contained: {
99
115
  '&:hover': {
100
- color: (0, styles_1.getContrastRatio)(colors_1.common.white, primaryMainColor) >= 3
101
- ? colors_1.common.white
102
- : colors_1.common.black,
116
+ color: contrastButtonColor,
103
117
  },
104
118
  }, sizeMedium: {
105
119
  padding: '10px 16px',
@@ -117,10 +131,10 @@ const createTheme = (mode, theme = {}) => {
117
131
  },
118
132
  },
119
133
  text: {
120
- backgroundColor: paletteDark.background.paper,
134
+ backgroundColor: (0, styles_1.lighten)(paletteDark.background.paper, 0.08),
121
135
  color: colors_1.common.white,
122
136
  '&:hover': {
123
- backgroundColor: (0, styles_1.lighten)(paletteDark.background.paper, 0.02),
137
+ backgroundColor: (0, styles_1.lighten)(paletteDark.background.paper, 0.12),
124
138
  },
125
139
  },
126
140
  }
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.18.8";
2
+ export declare const version = "1.19.0";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '1.18.8';
5
+ exports.version = '1.19.0';
@@ -2,6 +2,7 @@ export * from './useChain';
2
2
  export * from './useChains';
3
3
  export * from './useContentHeight';
4
4
  export * from './useDebouncedWatch';
5
+ export * from './useExpandableVariant';
5
6
  export * from './useFeaturedTokens';
6
7
  export * from './useGasSufficiency';
7
8
  export * from './useInitializer';
@@ -18,6 +18,7 @@ __exportStar(require("./useChain"), exports);
18
18
  __exportStar(require("./useChains"), exports);
19
19
  __exportStar(require("./useContentHeight"), exports);
20
20
  __exportStar(require("./useDebouncedWatch"), exports);
21
+ __exportStar(require("./useExpandableVariant"), exports);
21
22
  __exportStar(require("./useFeaturedTokens"), exports);
22
23
  __exportStar(require("./useGasSufficiency"), exports);
23
24
  __exportStar(require("./useInitializer"), exports);
@@ -0,0 +1 @@
1
+ export declare const useExpandableVariant: () => boolean;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useExpandableVariant = void 0;
4
+ const material_1 = require("@mui/material");
5
+ const providers_1 = require("../providers");
6
+ const defaultExpandableWidth = 852;
7
+ const useExpandableVariant = () => {
8
+ const { variant } = (0, providers_1.useWidgetConfig)();
9
+ const expandableAllowed = (0, material_1.useMediaQuery)((theme) => {
10
+ return theme.breakpoints.up(defaultExpandableWidth);
11
+ });
12
+ return variant === 'expandable' && expandableAllowed;
13
+ };
14
+ exports.useExpandableVariant = useExpandableVariant;
@@ -9,7 +9,8 @@ interface GasSufficiency {
9
9
  chain?: EVMChain;
10
10
  }
11
11
  export declare const useGasSufficiency: (route?: Route) => {
12
- insufficientGas: GasSufficiency[] | undefined;
13
- insufficientFunds: boolean;
12
+ insufficientGas: GasSufficiency[] | null | undefined;
13
+ insufficientFunds: boolean | null | undefined;
14
+ isLoading: boolean;
14
15
  };
15
16
  export {};