@lifi/widget 1.14.1 → 1.16.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 (311) hide show
  1. package/App.js +21 -0
  2. package/cjs/App.js +21 -0
  3. package/cjs/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
  4. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +45 -0
  5. package/cjs/components/{SwapInProgress/SwapInProgress.d.ts → ActiveSwaps/ActiveSwaps.d.ts} +1 -1
  6. package/cjs/components/ActiveSwaps/ActiveSwaps.js +30 -0
  7. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
  8. package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +40 -0
  9. package/cjs/components/ActiveSwaps/index.d.ts +2 -0
  10. package/cjs/components/ActiveSwaps/index.js +18 -0
  11. package/cjs/components/Card/Card.d.ts +7 -4
  12. package/cjs/components/Card/Card.js +38 -28
  13. package/cjs/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +1 -1
  14. package/cjs/components/ChainSelect/ChainSelect.js +35 -0
  15. package/cjs/components/{SwapInProgress/SwapInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
  16. package/cjs/components/ChainSelect/ChainSelect.style.js +19 -0
  17. package/cjs/components/ChainSelect/index.d.ts +2 -0
  18. package/cjs/components/ChainSelect/index.js +18 -0
  19. package/cjs/components/ChainSelect/useChainSelect.d.ts +8 -0
  20. package/cjs/components/ChainSelect/useChainSelect.js +33 -0
  21. package/cjs/components/Header/Header.js +3 -11
  22. package/cjs/components/Header/NavigationHeader.js +10 -17
  23. package/cjs/components/Header/WalletHeader.js +4 -5
  24. package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  25. package/cjs/components/PoweredBy/PoweredBy.style.js +1 -0
  26. package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +10 -10
  27. package/cjs/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
  28. package/cjs/components/SelectTokenButton/SelectTokenButton.js +3 -3
  29. package/{components/SwapInProgress/SwapInProgress.d.ts → cjs/components/SendToWallet/SendToWallet.d.ts} +1 -1
  30. package/cjs/components/SendToWallet/SendToWallet.js +53 -0
  31. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +19 -0
  32. package/cjs/components/SendToWallet/SendToWallet.style.js +15 -0
  33. package/cjs/components/SendToWallet/index.d.ts +1 -0
  34. package/cjs/components/{SwapInProgress → SendToWallet}/index.js +1 -1
  35. package/cjs/components/Step/CircularProgress.js +1 -1
  36. package/cjs/components/Step/CircularProgress.style.js +1 -1
  37. package/cjs/components/Step/StepProcess.js +1 -5
  38. package/cjs/components/Step/StepProcess.style.d.ts +1 -1
  39. package/cjs/components/Step/StepTimer.d.ts +1 -0
  40. package/cjs/components/Step/StepTimer.js +6 -6
  41. package/cjs/components/SwapButton/SwapButton.js +10 -14
  42. package/cjs/components/SwapButton/types.d.ts +2 -2
  43. package/cjs/components/SwapInput/FormPriceHelperText.d.ts +1 -1
  44. package/cjs/components/SwapInput/FormPriceHelperText.js +4 -4
  45. package/cjs/components/SwapInput/SwapInput.d.ts +1 -1
  46. package/cjs/components/SwapInput/SwapInput.js +4 -4
  47. package/cjs/components/SwapInput/SwapInputAdornment.d.ts +1 -1
  48. package/cjs/components/SwapInput/SwapInputAdornment.js +4 -4
  49. package/cjs/components/SwapRouteCard/SwapRouteCard.js +5 -4
  50. package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +3 -3
  51. package/cjs/components/TokenAvatar/TokenAvatar.style.js +0 -3
  52. package/cjs/components/TokenList/TokenList.js +14 -11
  53. package/cjs/components/TokenList/types.d.ts +1 -1
  54. package/cjs/config/theme.js +24 -23
  55. package/cjs/config/version.d.ts +1 -1
  56. package/cjs/config/version.js +1 -1
  57. package/cjs/hooks/index.d.ts +3 -0
  58. package/cjs/hooks/index.js +3 -0
  59. package/cjs/hooks/useChains.d.ts +1 -97
  60. package/cjs/hooks/useChains.js +8 -15
  61. package/cjs/hooks/useNavigateBack.d.ts +4 -0
  62. package/cjs/hooks/useNavigateBack.js +18 -0
  63. package/cjs/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
  64. package/cjs/{components/Step/utils.js → hooks/useProcessMessage.js} +16 -10
  65. package/cjs/hooks/useRouteExecution.d.ts +1 -1
  66. package/cjs/hooks/useRouteExecution.js +20 -29
  67. package/cjs/hooks/useSwapRoutes.js +18 -7
  68. package/cjs/hooks/useWidgetEvents.d.ts +3 -0
  69. package/cjs/hooks/useWidgetEvents.js +13 -0
  70. package/cjs/i18n/en/translation.json +25 -15
  71. package/cjs/i18n/index.d.ts +20 -10
  72. package/cjs/index.d.ts +1 -0
  73. package/cjs/index.js +3 -1
  74. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
  75. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +18 -0
  76. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
  77. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +21 -0
  78. package/cjs/pages/ActiveSwapsPage/index.d.ts +1 -0
  79. package/cjs/pages/ActiveSwapsPage/index.js +17 -0
  80. package/cjs/pages/MainPage/MainPage.js +2 -2
  81. package/cjs/pages/MainPage/MainSwapButton.js +3 -1
  82. package/cjs/pages/MainPage/SwapRoutes.js +4 -1
  83. package/cjs/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
  84. package/cjs/pages/SelectChainPage/SelectChainPage.js +33 -0
  85. package/cjs/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
  86. package/cjs/pages/SelectChainPage/SelectChainPage.style.js +20 -0
  87. package/cjs/pages/SelectChainPage/index.d.ts +1 -0
  88. package/cjs/pages/SelectChainPage/index.js +17 -0
  89. package/cjs/pages/SelectTokenPage/SearchTokenInput.js +3 -3
  90. package/cjs/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
  91. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +4 -8
  92. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +10 -10
  93. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
  94. package/cjs/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
  95. package/cjs/pages/SettingsPage/AdvancedPreferences.js +2 -2
  96. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
  97. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  98. package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +3 -6
  99. package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +3 -5
  100. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +5 -1
  101. package/cjs/pages/SettingsPage/SettingsPage.js +2 -1
  102. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +2 -0
  103. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +22 -0
  104. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
  105. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  106. package/cjs/pages/SwapPage/StatusBottomSheet.js +29 -41
  107. package/cjs/pages/SwapPage/SwapPage.js +7 -3
  108. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  109. package/cjs/providers/SwapFormProvider/SwapFormProvider.d.ts +1 -0
  110. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +43 -9
  111. package/cjs/providers/SwapFormProvider/types.d.ts +3 -1
  112. package/cjs/providers/SwapFormProvider/types.js +1 -0
  113. package/cjs/providers/WalletProvider/WalletProvider.js +10 -4
  114. package/cjs/providers/WalletProvider/types.d.ts +4 -2
  115. package/cjs/providers/WidgetProvider/WidgetProvider.js +3 -7
  116. package/cjs/providers/index.d.ts +4 -0
  117. package/cjs/providers/index.js +20 -0
  118. package/cjs/stores/chains/index.d.ts +4 -0
  119. package/cjs/stores/chains/index.js +20 -0
  120. package/cjs/stores/chains/types.d.ts +8 -0
  121. package/cjs/stores/chains/types.js +2 -0
  122. package/cjs/stores/chains/useChainOrder.d.ts +1 -0
  123. package/cjs/stores/chains/useChainOrder.js +12 -0
  124. package/cjs/stores/chains/useChainOrderStore.d.ts +19 -0
  125. package/cjs/stores/chains/useChainOrderStore.js +42 -0
  126. package/cjs/stores/chains/useInitializeChainOrder.d.ts +1 -0
  127. package/cjs/stores/chains/useInitializeChainOrder.js +12 -0
  128. package/cjs/stores/route/index.d.ts +2 -1
  129. package/cjs/stores/route/index.js +2 -1
  130. package/cjs/stores/route/useExecutingRoutesIds.d.ts +1 -0
  131. package/cjs/stores/route/useExecutingRoutesIds.js +20 -0
  132. package/cjs/stores/route/useRouteStore.js +5 -4
  133. package/cjs/stores/route/utils.d.ts +4 -0
  134. package/cjs/stores/route/utils.js +21 -0
  135. package/cjs/stores/settings/types.d.ts +2 -1
  136. package/cjs/stores/settings/useSettingsStore.d.ts +4 -2
  137. package/cjs/stores/settings/useSettingsStore.js +6 -2
  138. package/cjs/types/events.d.ts +5 -0
  139. package/cjs/types/events.js +9 -0
  140. package/cjs/types/index.d.ts +1 -0
  141. package/cjs/types/index.js +1 -0
  142. package/cjs/types/widget.d.ts +3 -1
  143. package/cjs/utils/format.js +7 -2
  144. package/cjs/utils/navigationRoutes.d.ts +5 -0
  145. package/cjs/utils/navigationRoutes.js +31 -4
  146. package/components/ActiveSwaps/ActiveSwapItem.d.ts +5 -0
  147. package/components/ActiveSwaps/ActiveSwapItem.js +41 -0
  148. package/components/ActiveSwaps/ActiveSwaps.d.ts +3 -0
  149. package/components/ActiveSwaps/ActiveSwaps.js +26 -0
  150. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +78 -0
  151. package/components/ActiveSwaps/ActiveSwaps.style.js +37 -0
  152. package/components/ActiveSwaps/index.d.ts +2 -0
  153. package/components/ActiveSwaps/index.js +2 -0
  154. package/components/Card/Card.d.ts +7 -4
  155. package/components/Card/Card.js +39 -29
  156. package/{pages/SelectTokenPage → components/ChainSelect}/ChainSelect.d.ts +1 -1
  157. package/components/ChainSelect/ChainSelect.js +31 -0
  158. package/components/{SwapInProgress/SwapInProgress.style.d.ts → ChainSelect/ChainSelect.style.d.ts} +10 -19
  159. package/components/ChainSelect/ChainSelect.style.js +16 -0
  160. package/components/ChainSelect/index.d.ts +2 -0
  161. package/components/ChainSelect/index.js +2 -0
  162. package/components/ChainSelect/useChainSelect.d.ts +8 -0
  163. package/components/ChainSelect/useChainSelect.js +29 -0
  164. package/components/Header/Header.js +2 -10
  165. package/components/Header/NavigationHeader.js +11 -18
  166. package/components/Header/WalletHeader.js +1 -2
  167. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  168. package/components/PoweredBy/PoweredBy.style.js +1 -0
  169. package/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
  170. package/components/SelectTokenButton/SelectTokenButton.d.ts +1 -1
  171. package/components/SelectTokenButton/SelectTokenButton.js +1 -1
  172. package/components/SendToWallet/SendToWallet.d.ts +3 -0
  173. package/components/SendToWallet/SendToWallet.js +49 -0
  174. package/components/SendToWallet/SendToWallet.style.d.ts +19 -0
  175. package/components/SendToWallet/SendToWallet.style.js +12 -0
  176. package/components/SendToWallet/index.d.ts +1 -0
  177. package/components/SendToWallet/index.js +1 -0
  178. package/components/Step/CircularProgress.js +3 -3
  179. package/components/Step/CircularProgress.style.js +1 -1
  180. package/components/Step/StepProcess.js +2 -6
  181. package/components/Step/StepProcess.style.d.ts +1 -1
  182. package/components/Step/StepTimer.d.ts +1 -0
  183. package/components/Step/StepTimer.js +6 -6
  184. package/components/SwapButton/SwapButton.js +7 -11
  185. package/components/SwapButton/types.d.ts +2 -2
  186. package/components/SwapInput/FormPriceHelperText.d.ts +1 -1
  187. package/components/SwapInput/FormPriceHelperText.js +1 -1
  188. package/components/SwapInput/SwapInput.d.ts +1 -1
  189. package/components/SwapInput/SwapInput.js +1 -1
  190. package/components/SwapInput/SwapInputAdornment.d.ts +1 -1
  191. package/components/SwapInput/SwapInputAdornment.js +1 -1
  192. package/components/SwapRouteCard/SwapRouteCard.js +5 -4
  193. package/components/SwapRouteCard/SwapRouteCard.style.js +3 -3
  194. package/components/TokenAvatar/TokenAvatar.style.js +0 -3
  195. package/components/TokenList/TokenList.js +7 -4
  196. package/components/TokenList/types.d.ts +1 -1
  197. package/config/theme.js +24 -23
  198. package/config/version.d.ts +1 -1
  199. package/config/version.js +1 -1
  200. package/hooks/index.d.ts +3 -0
  201. package/hooks/index.js +3 -0
  202. package/hooks/useChains.d.ts +1 -97
  203. package/hooks/useChains.js +8 -15
  204. package/hooks/useNavigateBack.d.ts +4 -0
  205. package/hooks/useNavigateBack.js +14 -0
  206. package/{components/Step/utils.d.ts → hooks/useProcessMessage.d.ts} +4 -0
  207. package/{pages/SwapPage/utils.js → hooks/useProcessMessage.js} +15 -10
  208. package/hooks/useRouteExecution.d.ts +1 -1
  209. package/hooks/useRouteExecution.js +21 -30
  210. package/hooks/useSwapRoutes.js +18 -7
  211. package/hooks/useWidgetEvents.d.ts +3 -0
  212. package/hooks/useWidgetEvents.js +6 -0
  213. package/i18n/en/translation.json +25 -15
  214. package/i18n/index.d.ts +20 -10
  215. package/index.d.ts +1 -0
  216. package/index.js +1 -0
  217. package/package.json +17 -19
  218. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.d.ts +2 -0
  219. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +14 -0
  220. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +2 -0
  221. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +17 -0
  222. package/pages/ActiveSwapsPage/index.d.ts +1 -0
  223. package/pages/ActiveSwapsPage/index.js +1 -0
  224. package/pages/MainPage/MainPage.js +2 -2
  225. package/pages/MainPage/MainSwapButton.js +3 -1
  226. package/pages/MainPage/SwapRoutes.js +4 -1
  227. package/pages/SelectChainPage/SelectChainPage.d.ts +3 -0
  228. package/pages/SelectChainPage/SelectChainPage.js +29 -0
  229. package/pages/SelectChainPage/SelectChainPage.style.d.ts +21 -0
  230. package/pages/SelectChainPage/SelectChainPage.style.js +17 -0
  231. package/pages/SelectChainPage/index.d.ts +1 -0
  232. package/pages/SelectChainPage/index.js +1 -0
  233. package/pages/SelectTokenPage/SearchTokenInput.js +1 -1
  234. package/pages/SelectTokenPage/SelectTokenPage.d.ts +2 -4
  235. package/pages/SelectTokenPage/SelectTokenPage.js +5 -9
  236. package/pages/SelectWalletPage/SelectWalletPage.js +10 -10
  237. package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +2 -27
  238. package/pages/SelectWalletPage/SelectWalletPage.style.js +4 -14
  239. package/pages/SettingsPage/AdvancedPreferences.js +2 -2
  240. package/pages/SettingsPage/ColorSchemeButtonGroup.js +1 -1
  241. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  242. package/pages/SettingsPage/EnabledBridgesSelect.js +4 -7
  243. package/pages/SettingsPage/EnabledExchangesSelect.js +4 -6
  244. package/pages/SettingsPage/RoutePrioritySelect.js +5 -1
  245. package/pages/SettingsPage/SettingsPage.js +2 -1
  246. package/pages/SettingsPage/ShowDestinationWallet.d.ts +2 -0
  247. package/pages/SettingsPage/ShowDestinationWallet.js +18 -0
  248. package/pages/SwapDetailsPage/SwapDetailsPage.js +5 -4
  249. package/pages/SwapHistoryPage/SwapHistoryPage.js +1 -1
  250. package/pages/SwapPage/StatusBottomSheet.js +30 -42
  251. package/pages/SwapPage/SwapPage.js +9 -5
  252. package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  253. package/providers/SwapFormProvider/SwapFormProvider.d.ts +1 -0
  254. package/providers/SwapFormProvider/SwapFormProvider.js +43 -9
  255. package/providers/SwapFormProvider/types.d.ts +3 -1
  256. package/providers/SwapFormProvider/types.js +1 -0
  257. package/providers/WalletProvider/WalletProvider.js +10 -4
  258. package/providers/WalletProvider/types.d.ts +4 -2
  259. package/providers/WidgetProvider/WidgetProvider.js +3 -7
  260. package/providers/index.d.ts +4 -0
  261. package/providers/index.js +4 -0
  262. package/stores/chains/index.d.ts +4 -0
  263. package/stores/chains/index.js +4 -0
  264. package/stores/chains/types.d.ts +8 -0
  265. package/stores/chains/types.js +1 -0
  266. package/stores/chains/useChainOrder.d.ts +1 -0
  267. package/stores/chains/useChainOrder.js +5 -0
  268. package/stores/chains/useChainOrderStore.d.ts +19 -0
  269. package/stores/chains/useChainOrderStore.js +36 -0
  270. package/stores/chains/useInitializeChainOrder.d.ts +1 -0
  271. package/stores/chains/useInitializeChainOrder.js +5 -0
  272. package/stores/route/index.d.ts +2 -1
  273. package/stores/route/index.js +2 -1
  274. package/stores/route/useExecutingRoutesIds.d.ts +1 -0
  275. package/stores/route/useExecutingRoutesIds.js +13 -0
  276. package/stores/route/useRouteStore.js +5 -4
  277. package/stores/route/utils.d.ts +4 -0
  278. package/stores/route/utils.js +15 -0
  279. package/stores/settings/types.d.ts +2 -1
  280. package/stores/settings/useSettingsStore.d.ts +4 -2
  281. package/stores/settings/useSettingsStore.js +6 -2
  282. package/tsconfig.cjs.tsbuildinfo +1 -1
  283. package/types/events.d.ts +5 -0
  284. package/types/events.js +6 -0
  285. package/types/index.d.ts +1 -0
  286. package/types/index.js +1 -0
  287. package/types/widget.d.ts +3 -1
  288. package/utils/format.js +7 -2
  289. package/utils/navigationRoutes.d.ts +5 -0
  290. package/utils/navigationRoutes.js +30 -3
  291. package/cjs/components/SwapButton/SwapButton.style.d.ts +0 -65
  292. package/cjs/components/SwapButton/SwapButton.style.js +0 -15
  293. package/cjs/components/SwapInProgress/SwapInProgress.js +0 -29
  294. package/cjs/components/SwapInProgress/SwapInProgress.style.js +0 -17
  295. package/cjs/components/SwapInProgress/index.d.ts +0 -1
  296. package/cjs/pages/SelectTokenPage/ChainSelect.js +0 -32
  297. package/cjs/pages/SwapPage/utils.d.ts +0 -6
  298. package/cjs/pages/SwapPage/utils.js +0 -93
  299. package/cjs/stores/route/useExecutingRoutes.d.ts +0 -2
  300. package/cjs/stores/route/useExecutingRoutes.js +0 -13
  301. package/components/Step/utils.js +0 -89
  302. package/components/SwapButton/SwapButton.style.d.ts +0 -65
  303. package/components/SwapButton/SwapButton.style.js +0 -12
  304. package/components/SwapInProgress/SwapInProgress.js +0 -25
  305. package/components/SwapInProgress/SwapInProgress.style.js +0 -14
  306. package/components/SwapInProgress/index.d.ts +0 -1
  307. package/components/SwapInProgress/index.js +0 -1
  308. package/pages/SelectTokenPage/ChainSelect.js +0 -28
  309. package/pages/SwapPage/utils.d.ts +0 -6
  310. package/stores/route/useExecutingRoutes.d.ts +0 -2
  311. package/stores/route/useExecutingRoutes.js +0 -6
@@ -12,8 +12,7 @@ import { AccountBalanceWalletOutlined as AccountBalanceWalletIcon, Logout as Log
12
12
  import { Box, IconButton, Typography } from '@mui/material';
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import { useLocation, useNavigate } from 'react-router-dom';
15
- import { useWallet } from '../../providers/WalletProvider';
16
- import { useWidgetConfig } from '../../providers/WidgetProvider';
15
+ import { useWallet, useWidgetConfig } from '../../providers';
17
16
  import { navigationRoutes } from '../../utils';
18
17
  import { HeaderAppBar } from './Header.style';
19
18
  export const WalletHeader = () => {
@@ -2,7 +2,7 @@
2
2
  export declare const Link: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").LinkBaseProps, "classes"> & {
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").LinkClasses> | undefined;
5
- color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined>);
5
+ color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
6
6
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
7
7
  TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
8
8
  underline?: "none" | "always" | "hover" | undefined;
@@ -3,6 +3,7 @@ import { styled } from '@mui/material/styles';
3
3
  export const Link = styled(MuiLink)(({ theme }) => ({
4
4
  display: 'flex',
5
5
  alignItems: 'center',
6
+ border: 'none',
6
7
  ':hover': {
7
8
  color: theme.palette.primary.main,
8
9
  },
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { SwapHoriz as SwapHorizIcon, SwapVert as SwapVertIcon, } from '@mui/icons-material';
3
3
  import { useFormContext } from 'react-hook-form';
4
- import { SwapFormKey } from '../../providers/SwapFormProvider';
4
+ import { SwapFormKey } from '../../providers';
5
5
  import { IconButton } from './ReverseTokensButton.style';
6
6
  export const ReverseTokensButton = ({ vertical, }) => {
7
7
  const { setValue, getValues } = useFormContext();
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { SwapFormTypeProps } from '../../providers/SwapFormProvider';
2
+ import type { SwapFormTypeProps } from '../../providers';
3
3
  export declare const SelectTokenButton: React.FC<SwapFormTypeProps & {
4
4
  compact: boolean;
5
5
  }>;
@@ -5,7 +5,7 @@ import { useWatch } from 'react-hook-form';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { useNavigate } from 'react-router-dom';
7
7
  import { useChain, useToken } from '../../hooks';
8
- import { SwapFormKeyHelper } from '../../providers/SwapFormProvider';
8
+ import { SwapFormKeyHelper } from '../../providers';
9
9
  import { navigationRoutes } from '../../utils';
10
10
  import { Card, CardTitle } from '../Card';
11
11
  import { TokenAvatar } from '../TokenAvatar';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps } from '@mui/material';
3
+ export declare const SendToWallet: React.FC<BoxProps>;
@@ -0,0 +1,49 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { isAddress } from '@ethersproject/address';
12
+ import { FormHelperText } from '@mui/material';
13
+ import { useEffect } from 'react';
14
+ import { useFormContext } from 'react-hook-form';
15
+ import { useTranslation } from 'react-i18next';
16
+ import { SwapFormKey, useWallet } from '../../providers';
17
+ import { useSettings } from '../../stores';
18
+ import { Card, CardTitle } from '../Card';
19
+ import { FormControl, Input } from './SendToWallet.style';
20
+ export const SendToWallet = (props) => {
21
+ var _a;
22
+ const { t } = useTranslation();
23
+ const { showDestinationWallet } = useSettings(['showDestinationWallet']);
24
+ const { account, provider } = useWallet();
25
+ const { register, trigger, formState: { errors }, } = useFormContext();
26
+ useEffect(() => {
27
+ trigger(SwapFormKey.ToAddress);
28
+ }, [account.chainId, trigger]);
29
+ if (!showDestinationWallet) {
30
+ return null;
31
+ }
32
+ const { onChange, onBlur, name, ref } = register(SwapFormKey.ToAddress, {
33
+ validate: (value) => __awaiter(void 0, void 0, void 0, function* () {
34
+ try {
35
+ if (!value) {
36
+ return true;
37
+ }
38
+ const address = yield (provider === null || provider === void 0 ? void 0 : provider.resolveName(value));
39
+ return (isAddress(address || value) ||
40
+ t('swap.error.title.walletAddressInvalid'));
41
+ }
42
+ catch (_b) {
43
+ return t('swap.error.title.walletEnsAddressInvalid');
44
+ }
45
+ }),
46
+ onBlur: () => trigger(SwapFormKey.ToAddress),
47
+ });
48
+ return (_jsxs(Card, Object.assign({}, props, { children: [_jsx(CardTitle, { children: t('swap.sendToWallet') }), _jsxs(FormControl, Object.assign({ fullWidth: true }, { children: [_jsx(Input, { ref: ref, size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: onChange, onBlur: onBlur, name: name, placeholder: t('swap.walletAddressOrEns') }), _jsx(FormHelperText, Object.assign({ error: !!errors.toAddress }, { children: (_a = errors.toAddress) === null || _a === void 0 ? void 0 : _a.message }))] }))] })));
49
+ };
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export declare const FormControl: import("@emotion/styled").StyledComponent<{
3
+ children?: import("react").ReactNode;
4
+ classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
5
+ color?: "primary" | "secondary" | "error" | "warning" | "info" | "success" | undefined;
6
+ disabled?: boolean | undefined;
7
+ error?: boolean | undefined;
8
+ fullWidth?: boolean | undefined;
9
+ focused?: boolean | undefined;
10
+ hiddenLabel?: boolean | undefined;
11
+ margin?: "none" | "normal" | "dense" | undefined;
12
+ required?: boolean | undefined;
13
+ size?: "small" | "medium" | undefined;
14
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
+ variant?: "outlined" | "filled" | "standard" | undefined;
16
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
17
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
18
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "children" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "error" | "required" | "focused" | "hiddenLabel"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
19
+ export declare const Input: import("@emotion/styled").StyledComponent<import("@mui/material").InputBaseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,12 @@
1
+ import { FormControl as MuiFormControl, InputBase } from '@mui/material';
2
+ import { inputBaseClasses } from '@mui/material/InputBase';
3
+ import { styled } from '@mui/material/styles';
4
+ export const FormControl = styled(MuiFormControl)(({ theme }) => ({
5
+ padding: theme.spacing(1.5, 2, 1.5, 0),
6
+ }));
7
+ export const Input = styled(InputBase)(({ theme }) => ({
8
+ [`.${inputBaseClasses.input}`]: {
9
+ height: 32,
10
+ padding: theme.spacing(0, 0, 0, 2),
11
+ },
12
+ }));
@@ -0,0 +1 @@
1
+ export * from './SendToWallet';
@@ -0,0 +1 @@
1
+ export * from './SendToWallet';
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Done as DoneIcon, Info as InfoIcon, Warning as WarningIcon, } from '@mui/icons-material';
2
+ import { Done as DoneIcon, Info as InfoIcon, Warning as WarningIcon } from '@mui/icons-material';
3
3
  import { Box } from '@mui/material';
4
- import { CircularProgress as CircularProgressStyled, CircularProgressPending, } from './CircularProgress.style';
4
+ import { CircularProgress as CircularProgressStyled, CircularProgressPending } from './CircularProgress.style';
5
5
  export function CircularProgress({ status }) {
6
6
  return (_jsxs(Box, Object.assign({ sx: {
7
7
  display: 'grid',
8
8
  position: 'relative',
9
9
  placeItems: 'center',
10
- } }, { children: [_jsx(CircularProgressStyled, { variant: "determinate", status: status, size: 32, thickness: 3, value: 100 }), status === 'STARTED' || status === 'PENDING' ? (_jsx(CircularProgressPending, { size: 32, thickness: 3 })) : null, status === 'ACTION_REQUIRED' ? (_jsx(InfoIcon, { color: "primary", sx: {
10
+ } }, { children: [_jsx(CircularProgressStyled, { variant: "determinate", status: status, size: 32, thickness: 3, value: 100 }), status === 'STARTED' || status === 'PENDING' ? (_jsx(CircularProgressPending, { size: 32, thickness: 3 })) : null, status === 'ACTION_REQUIRED' ? (_jsx(InfoIcon, { color: "info", sx: {
11
11
  position: 'absolute',
12
12
  fontSize: '1rem',
13
13
  } })) : null, status === 'DONE' ? (_jsx(DoneIcon, { color: "success", sx: {
@@ -18,7 +18,7 @@ const circleAnimation = keyframes({
18
18
  const getStatusColor = (status, theme) => {
19
19
  switch (status) {
20
20
  case 'ACTION_REQUIRED':
21
- return theme.palette.primary.main;
21
+ return theme.palette.info.main;
22
22
  case 'DONE':
23
23
  return theme.palette.success.main;
24
24
  case 'FAILED':
@@ -1,15 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Link as LinkIcon } from '@mui/icons-material';
3
3
  import { Box, Link, Typography } from '@mui/material';
4
- import { useTranslation } from 'react-i18next';
5
- import { useChains } from '../../hooks';
4
+ import { useProcessMessage } from '../../hooks';
6
5
  import { CircularProgress } from './CircularProgress';
7
6
  import { LinkButton } from './StepProcess.style';
8
- import { getProcessMessage } from './utils';
9
7
  export const StepProcess = ({ step, process }) => {
10
- const { t } = useTranslation();
11
- const { getChainById } = useChains();
12
- const { title, message } = getProcessMessage(t, getChainById, step, process);
8
+ const { title, message } = useProcessMessage(step, process);
13
9
  return (_jsxs(Box, Object.assign({ px: 2, py: 1 }, { children: [_jsxs(Box, Object.assign({ sx: {
14
10
  display: 'flex',
15
11
  alignItems: 'center',
@@ -29,7 +29,7 @@ export declare const LinkButton: import("@emotion/styled").StyledComponent<{
29
29
  }, 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> & Omit<import("@mui/material").LinkBaseProps, "classes"> & {
30
30
  children?: import("react").ReactNode;
31
31
  classes?: Partial<import("@mui/material").LinkClasses> | undefined;
32
- color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<import("csstype").Property.Color | import("csstype").Property.Color[] | undefined>);
32
+ color?: import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined> | ((theme: import("@mui/material").Theme) => import("@mui/system/styleFunctionSx").ResponsiveStyleValue<string[] | import("csstype").Property.Color | undefined>);
33
33
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
34
34
  TypographyClasses?: (Partial<import("@mui/material").TypographyClasses> & Partial<import("@mui/material").ClassNameMap<never>>) | undefined;
35
35
  underline?: "none" | "always" | "hover" | undefined;
@@ -2,4 +2,5 @@
2
2
  import type { Step } from '@lifi/sdk';
3
3
  export declare const StepTimer: React.FC<{
4
4
  step: Step;
5
+ hideInProgress?: boolean;
5
6
  }>;
@@ -7,7 +7,7 @@ const getExpiryTimestamp = (step) => {
7
7
  return new Date(((_c = (_b = (_a = step.execution) === null || _a === void 0 ? void 0 : _a.process[0]) === null || _b === void 0 ? void 0 : _b.startedAt) !== null && _c !== void 0 ? _c : Date.now()) +
8
8
  step.estimate.executionDuration * 1000);
9
9
  };
10
- export const StepTimer = ({ step }) => {
10
+ export const StepTimer = ({ step, hideInProgress, }) => {
11
11
  var _a, _b;
12
12
  const { t } = useTranslation();
13
13
  const [isExpired, setExpired] = useState(false);
@@ -26,9 +26,7 @@ export const StepTimer = ({ step }) => {
26
26
  setExecutionStarted(true);
27
27
  restart(getExpiryTimestamp(step));
28
28
  }
29
- const shouldBePaused = step.execution.process.some((process) => process.status === 'ACTION_REQUIRED' ||
30
- process.status === 'CHAIN_SWITCH_REQUIRED' ||
31
- process.status === 'FAILED');
29
+ const shouldBePaused = step.execution.process.some((process) => process.status === 'ACTION_REQUIRED' || process.status === 'FAILED');
32
30
  if (isRunning && shouldBePaused) {
33
31
  pause();
34
32
  }
@@ -50,11 +48,13 @@ export const StepTimer = ({ step }) => {
50
48
  value: (step.estimate.executionDuration / 60).toFixed(0),
51
49
  }) }));
52
50
  }
51
+ const isTimerExpired = isExpired || (!minutes && !seconds);
53
52
  if (((_a = step.execution) === null || _a === void 0 ? void 0 : _a.status) === 'DONE' ||
54
- ((_b = step.execution) === null || _b === void 0 ? void 0 : _b.status) === 'FAILED') {
53
+ ((_b = step.execution) === null || _b === void 0 ? void 0 : _b.status) === 'FAILED' ||
54
+ (isTimerExpired && hideInProgress)) {
55
55
  return null;
56
56
  }
57
- return isExpired ? (_jsx(_Fragment, { children: t('swap.networkIsBusy') })) : (
57
+ return isTimerExpired ? (_jsx(_Fragment, { children: t('swap.inProgress') })) : (
58
58
  // eslint-disable-next-line react/jsx-no-useless-fragment
59
59
  _jsx(_Fragment, { children: `${minutes}:${seconds < 10 ? `0${seconds}` : seconds}` }));
60
60
  };
@@ -9,19 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
11
11
  import { ChainId } from '@lifi/sdk';
12
+ import { Button } from '@mui/material';
12
13
  import { useWatch } from 'react-hook-form';
13
14
  import { useTranslation } from 'react-i18next';
14
15
  import { useNavigate } from 'react-router-dom';
15
16
  import { useChains, useGasSufficiency } from '../../hooks';
16
- import { SwapFormKeyHelper } from '../../providers/SwapFormProvider';
17
- import { useWallet } from '../../providers/WalletProvider';
18
- import { useWidgetConfig } from '../../providers/WidgetProvider';
17
+ import { SwapFormKeyHelper, useWallet, useWidgetConfig } from '../../providers';
19
18
  import { navigationRoutes } from '../../utils';
20
- import { Button } from './SwapButton.style';
21
- export const SwapButton = ({ onClick, currentRoute, text, loading, }) => {
19
+ export const SwapButton = ({ onClick, currentRoute, text, disable, }) => {
22
20
  var _a;
23
- const navigate = useNavigate();
24
21
  const { t } = useTranslation();
22
+ const navigate = useNavigate();
25
23
  const { getChainById } = useChains();
26
24
  const config = useWidgetConfig();
27
25
  const { account, switchChain, connect: walletConnect } = useWallet();
@@ -62,9 +60,7 @@ export const SwapButton = ({ onClick, currentRoute, text, loading, }) => {
62
60
  }
63
61
  return t(`button.connectWallet`);
64
62
  };
65
- return (_jsx(Button, Object.assign({ variant: "contained", color: account.isActive ? 'primary' : 'success', onClick: handleSwapButtonClick,
66
- // loading={isLoading || isFetching}
67
- disabled: (insufficientFunds || !!insufficientGas.length || loading) &&
68
- currentRoute &&
69
- !switchChainAllowed, fullWidth: true }, { children: getButtonText() })));
63
+ return (_jsx(Button, Object.assign({ variant: "contained", color: account.isActive ? 'primary' : 'success', onClick: handleSwapButtonClick, disabled: currentRoute &&
64
+ !switchChainAllowed &&
65
+ (insufficientFunds || !!insufficientGas.length || disable), fullWidth: true }, { children: getButtonText() })));
70
66
  };
@@ -1,7 +1,7 @@
1
- import { Route } from '@lifi/sdk';
1
+ import type { Route } from '@lifi/sdk';
2
2
  export interface SwapButtonProps {
3
3
  onClick?(): void;
4
4
  currentRoute?: Route;
5
5
  text?: string;
6
- loading?: boolean;
6
+ disable?: boolean;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { SwapFormTypeProps } from '../../providers/SwapFormProvider';
2
+ import type { SwapFormTypeProps } from '../../providers';
3
3
  export declare const FormPriceHelperText: React.FC<SwapFormTypeProps & {
4
4
  selected: boolean;
5
5
  }>;
@@ -3,7 +3,7 @@ import { FormHelperText, Skeleton, Typography } from '@mui/material';
3
3
  import { useWatch } from 'react-hook-form';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useTokenBalance } from '../../hooks';
6
- import { SwapFormKeyHelper } from '../../providers/SwapFormProvider';
6
+ import { SwapFormKeyHelper } from '../../providers';
7
7
  import { formatTokenPrice } from '../../utils';
8
8
  export const FormPriceHelperText = ({ formType, selected }) => {
9
9
  const { t } = useTranslation();
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { SwapFormTypeProps } from '../../providers/SwapFormProvider';
2
+ import type { SwapFormTypeProps } from '../../providers';
3
3
  export declare const SwapInput: React.FC<SwapFormTypeProps>;
@@ -3,7 +3,7 @@ import { useLayoutEffect, useRef } from 'react';
3
3
  import { useFormContext, useWatch } from 'react-hook-form';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useChain, useToken } from '../../hooks';
6
- import { SwapFormKeyHelper } from '../../providers/SwapFormProvider';
6
+ import { SwapFormKeyHelper } from '../../providers';
7
7
  import { fitInputText, formatAmount } from '../../utils';
8
8
  import { Card, CardTitle } from '../Card';
9
9
  import { TokenAvatar } from '../TokenAvatar';
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import type { SwapFormTypeProps } from '../../providers/SwapFormProvider';
2
+ import type { SwapFormTypeProps } from '../../providers';
3
3
  export declare const SwapInputAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -3,7 +3,7 @@ import { InputAdornment, Skeleton } from '@mui/material';
3
3
  import { useFormContext, useWatch } from 'react-hook-form';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useTokenBalance } from '../../hooks';
6
- import { SwapFormKeyHelper } from '../../providers/SwapFormProvider';
6
+ import { SwapFormKeyHelper } from '../../providers';
7
7
  import { Button } from './SwapInputAdornment.style';
8
8
  export const SwapInputAdornment = ({ formType }) => {
9
9
  const { t } = useTranslation();
@@ -20,19 +20,20 @@ export const SwapRouteCard = (_a) => {
20
20
  var _b, _c;
21
21
  var { route, active, dense } = _a, other = __rest(_a, ["route", "active", "dense"]);
22
22
  const { t } = useTranslation();
23
+ const alternativeTag = t(`swap.tags.ALTERNATIVE`);
23
24
  const label = ((_b = route.tags) === null || _b === void 0 ? void 0 : _b.length)
24
- ? t(`swap.tags.${route.tags[0].toLowerCase()}`).toUpperCase()
25
- : t(`swap.tags.general`).toUpperCase();
25
+ ? t(`swap.tags.${route.tags[0]}`)
26
+ : alternativeTag;
26
27
  return (_jsxs(Card, Object.assign({ dense: dense, indented: true }, other, { children: [_jsx(Box, Object.assign({ sx: {
27
28
  display: 'flex',
28
29
  alignItems: 'center',
29
30
  justifyContent: 'space-between',
30
- }, mb: 2 }, { children: _jsx(Label, Object.assign({ active: active }, { children: label })) })), _jsx(Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount }), mb: 2 }), !dense
31
+ }, mb: 2 }, { children: _jsx(Label, Object.assign({ active: active !== null && active !== void 0 ? active : label !== alternativeTag }, { children: label })) })), _jsx(Token, { token: Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount }), mb: 2 }), !dense
31
32
  ? route.steps.map((step) => (_jsx(StepActions, { step: step, mb: 2 }, step.id)))
32
33
  : null, _jsxs(Box, Object.assign({ sx: {
33
34
  display: 'flex',
34
35
  justifyContent: 'space-between',
35
36
  } }, { children: [_jsxs(Box, { children: [_jsx(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 }) })), _jsx(Typography, Object.assign({ fontSize: 12, color: "text.secondary", lineHeight: 1, mt: 0.5 }, { children: t(`swap.gas`) }))] }), _jsxs(Box, { children: [_jsxs(Typography, Object.assign({ fontSize: 18, fontWeight: "500", display: "flex", justifyContent: "flex-end", lineHeight: 1, pt: 0.25 }, { children: ["~", (route.steps
36
37
  .map((step) => step.estimate.executionDuration)
37
- .reduce((cumulated, x) => cumulated + x) / 60).toFixed(0)] })), _jsx(Typography, Object.assign({ fontSize: 12, color: "text.secondary", textAlign: "end", lineHeight: 1, mt: 0.5 }, { children: t(`swap.minutes`) }))] })] }))] })));
38
+ .reduce((duration, x) => duration + x) / 60).toFixed(0)] })), _jsx(Typography, Object.assign({ fontSize: 12, color: "text.secondary", textAlign: "end", lineHeight: 1, mt: 0.5 }, { children: t(`swap.minutes`) }))] })] }))] })));
38
39
  };
@@ -4,16 +4,16 @@ import { getContrastTextColor } from '../../utils';
4
4
  export const Label = styled(Typography, {
5
5
  shouldForwardProp: (prop) => prop !== 'active',
6
6
  })(({ theme, active }) => ({
7
- backgroundColor: active ? theme.palette.primary.main : 'transparent',
7
+ backgroundColor: active ? theme.palette.secondary.main : 'transparent',
8
8
  border: '1px solid',
9
9
  borderColor: active
10
- ? theme.palette.primary.main
10
+ ? theme.palette.secondary.main
11
11
  : theme.palette.mode === 'light'
12
12
  ? theme.palette.grey[500]
13
13
  : theme.palette.grey[600],
14
14
  borderRadius: theme.shape.borderRadiusSecondary,
15
15
  color: active
16
- ? getContrastTextColor(theme, theme.palette.primary.main)
16
+ ? getContrastTextColor(theme, theme.palette.secondary.main)
17
17
  : theme.palette.text.secondary,
18
18
  padding: theme.spacing(0.75),
19
19
  fontSize: 12,
@@ -3,9 +3,6 @@ import { avatarClasses } from '@mui/material/Avatar';
3
3
  import { badgeClasses } from '@mui/material/Badge';
4
4
  import { styled } from '@mui/material/styles';
5
5
  export const TokenAvatarGroup = styled(AvatarGroup)(({ theme }) => ({
6
- [`& .${avatarClasses.root}`]: {
7
- background: theme.palette.background.paper,
8
- },
9
6
  [`& .${badgeClasses.badge}:last-child .${avatarClasses.root}`]: {
10
7
  marginLeft: theme.spacing(-1),
11
8
  boxSizing: 'border-box',
@@ -3,8 +3,7 @@ import { Box } from '@mui/material';
3
3
  import { useCallback, useRef } from 'react';
4
4
  import { useFormContext, useWatch } from 'react-hook-form';
5
5
  import { useDebouncedWatch, useTokenBalances, useTokenSearch, } from '../../hooks';
6
- import { SwapFormKey, SwapFormKeyHelper, } from '../../providers/SwapFormProvider';
7
- import { useWallet } from '../../providers/WalletProvider';
6
+ import { SwapFormKey, SwapFormKeyHelper, useWallet } from '../../providers';
8
7
  import { TokenNotFound } from './TokenNotFound';
9
8
  import { VirtualizedTokenList } from './VirtualizedTokenList';
10
9
  export const TokenList = ({ formType, height, onClick, }) => {
@@ -33,7 +32,9 @@ export const TokenList = ({ formType, height, onClick, }) => {
33
32
  ? [searchedToken]
34
33
  : filteredTokens;
35
34
  const handleTokenClick = useCallback((tokenAddress) => {
36
- setValue(SwapFormKeyHelper.getTokenKey(formType), tokenAddress);
35
+ setValue(SwapFormKeyHelper.getTokenKey(formType), tokenAddress, {
36
+ shouldDirty: true,
37
+ });
37
38
  setValue(SwapFormKeyHelper.getAmountKey(formType), '');
38
39
  const oppositeFormType = formType === 'from' ? 'to' : 'from';
39
40
  const [selectedOppositeToken, selectedOppositeChain, selectedChain] = getValues([
@@ -43,7 +44,9 @@ export const TokenList = ({ formType, height, onClick, }) => {
43
44
  ]);
44
45
  if (selectedOppositeToken === tokenAddress &&
45
46
  selectedOppositeChain === selectedChain) {
46
- setValue(SwapFormKeyHelper.getTokenKey(oppositeFormType), '');
47
+ setValue(SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
48
+ shouldDirty: false,
49
+ });
47
50
  }
48
51
  onClick === null || onClick === void 0 ? void 0 : onClick();
49
52
  }, [formType, getValues, onClick, setValue]);
@@ -1,6 +1,6 @@
1
1
  import type { TokenAmount } from '@lifi/sdk';
2
2
  import type { MutableRefObject } from 'react';
3
- import type { SwapFormDirection } from '../../providers/SwapFormProvider';
3
+ import type { SwapFormDirection } from '../../providers';
4
4
  import type { Token } from '../../types';
5
5
  export interface TokenListProps {
6
6
  formType: SwapFormDirection;
package/config/theme.js CHANGED
@@ -85,7 +85,29 @@ export const createTheme = (mode, theme = {}) => {
85
85
  defaultProps: {
86
86
  disableElevation: true,
87
87
  },
88
- styleOverrides: Object.assign(Object.assign({}, (mode === 'dark'
88
+ styleOverrides: Object.assign({ root: {
89
+ borderRadius: (_v = (_u = theme.shape) === null || _u === void 0 ? void 0 : _u.borderRadiusSecondary) !== null && _v !== void 0 ? _v : shape.borderRadiusSecondary,
90
+ textTransform: 'none',
91
+ fontSize: '1rem',
92
+ '&.Mui-disabled, &.Mui-disabled:hover': {
93
+ color: mode === 'light'
94
+ ? 'rgb(0 0 0 / 70%)'
95
+ : 'rgb(255 255 255 / 70%)',
96
+ cursor: 'not-allowed',
97
+ pointerEvents: 'auto',
98
+ },
99
+ }, contained: {
100
+ '&:hover': {
101
+ color: getContrastRatio(common.white, primaryMainColor) >= 3
102
+ ? common.white
103
+ : common.black,
104
+ },
105
+ }, sizeMedium: {
106
+ padding: '10px 16px',
107
+ [`.${dialogActionsClasses.root} &`]: {
108
+ padding: '6px 12px',
109
+ },
110
+ } }, (mode === 'dark'
89
111
  ? {
90
112
  outlined: {
91
113
  color: primaryLightColor,
@@ -103,28 +125,7 @@ export const createTheme = (mode, theme = {}) => {
103
125
  },
104
126
  },
105
127
  }
106
- : {})), { root: {
107
- borderRadius: (_v = (_u = theme.shape) === null || _u === void 0 ? void 0 : _u.borderRadiusSecondary) !== null && _v !== void 0 ? _v : shape.borderRadiusSecondary,
108
- textTransform: 'none',
109
- fontSize: '1rem',
110
- padding: '10px 16px',
111
- [`.${dialogActionsClasses.root} &`]: {
112
- padding: '6px 12px',
113
- },
114
- '&.Mui-disabled, &.Mui-disabled:hover': {
115
- color: mode === 'light'
116
- ? 'rgb(0 0 0 / 70%)'
117
- : 'rgb(255 255 255 / 70%)',
118
- cursor: 'not-allowed',
119
- pointerEvents: 'auto',
120
- },
121
- }, contained: {
122
- '&:hover': {
123
- color: getContrastRatio(common.white, primaryMainColor) >= 3
124
- ? common.white
125
- : common.black,
126
- },
127
- } }),
128
+ : {})),
128
129
  },
129
130
  MuiIconButton: {
130
131
  styleOverrides: {
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.14.1";
2
+ export declare const version = "1.16.0";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '1.14.1';
2
+ export const version = '1.16.0';
package/hooks/index.d.ts CHANGED
@@ -5,6 +5,8 @@ export * from './useDebouncedWatch';
5
5
  export * from './useFeaturedTokens';
6
6
  export * from './useGasSufficiency';
7
7
  export * from './useInitializer';
8
+ export * from './useNavigateBack';
9
+ export * from './useProcessMessage';
8
10
  export * from './useRouteExecution';
9
11
  export * from './useScrollableContainer';
10
12
  export * from './useSwapRoutes';
@@ -15,3 +17,4 @@ export * from './useTokenBalances';
15
17
  export * from './useTokens';
16
18
  export * from './useTokenSearch';
17
19
  export * from './useTools';
20
+ export * from './useWidgetEvents';
package/hooks/index.js CHANGED
@@ -5,6 +5,8 @@ export * from './useDebouncedWatch';
5
5
  export * from './useFeaturedTokens';
6
6
  export * from './useGasSufficiency';
7
7
  export * from './useInitializer';
8
+ export * from './useNavigateBack';
9
+ export * from './useProcessMessage';
8
10
  export * from './useRouteExecution';
9
11
  export * from './useScrollableContainer';
10
12
  export * from './useSwapRoutes';
@@ -15,3 +17,4 @@ export * from './useTokenBalances';
15
17
  export * from './useTokens';
16
18
  export * from './useTokenSearch';
17
19
  export * from './useTools';
20
+ export * from './useWidgetEvents';