@lifi/widget 1.32.7 → 2.0.0-alpha.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 (309) hide show
  1. package/App.js +3 -3
  2. package/AppDrawer.js +4 -3
  3. package/AppDrawer.style.d.ts +5 -5
  4. package/cjs/App.js +3 -3
  5. package/cjs/AppDrawer.js +4 -3
  6. package/cjs/AppDrawer.style.d.ts +5 -5
  7. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
  8. package/cjs/components/Card/CardIconButton.d.ts +29 -0
  9. package/cjs/components/Card/CardIconButton.js +17 -0
  10. package/cjs/components/Card/CardLabel.d.ts +26 -0
  11. package/cjs/components/Card/CardLabel.js +45 -0
  12. package/cjs/components/Card/CardTitle.d.ts +2 -2
  13. package/cjs/components/Card/index.d.ts +2 -0
  14. package/cjs/components/Card/index.js +2 -0
  15. package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -0
  16. package/cjs/components/GasMessage/FundsSufficiencyMessage.js +16 -0
  17. package/cjs/components/{GasSufficiencyMessage/GasSufficiencyMessage.d.ts → GasMessage/GasMessage.d.ts} +4 -2
  18. package/cjs/components/GasMessage/GasMessage.js +19 -0
  19. package/cjs/components/GasMessage/GasMessage.style.d.ts +34 -0
  20. package/cjs/components/GasMessage/GasMessage.style.js +48 -0
  21. package/cjs/components/GasMessage/GasRefuelMessage.d.ts +3 -0
  22. package/cjs/components/GasMessage/GasRefuelMessage.js +26 -0
  23. package/cjs/components/GasMessage/GasSufficiencyMessage.d.ts +7 -0
  24. package/cjs/components/GasMessage/GasSufficiencyMessage.js +21 -0
  25. package/cjs/components/GasMessage/index.d.ts +2 -0
  26. package/cjs/components/GasMessage/index.js +18 -0
  27. package/cjs/components/Header/Header.style.d.ts +5 -5
  28. package/cjs/components/Header/NavigationHeader.js +4 -4
  29. package/cjs/components/Header/WalletHeader.js +5 -5
  30. package/cjs/components/Insurance/Insurance.d.ts +3 -0
  31. package/cjs/components/Insurance/Insurance.js +11 -0
  32. package/cjs/components/Insurance/InsuranceCard.d.ts +3 -0
  33. package/cjs/components/Insurance/InsuranceCard.js +20 -0
  34. package/cjs/components/Insurance/InsuranceCollapsed.d.ts +3 -0
  35. package/cjs/components/Insurance/InsuranceCollapsed.js +32 -0
  36. package/cjs/components/Insurance/index.d.ts +1 -0
  37. package/cjs/components/{GasSufficiencyMessage → Insurance}/index.js +1 -1
  38. package/cjs/components/Insurance/types.d.ts +14 -0
  39. package/cjs/components/Insurance/types.js +2 -0
  40. package/cjs/components/NFT/NFT.style.d.ts +1 -1
  41. package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  42. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  43. package/cjs/components/SendToWallet/SendToWallet.js +31 -25
  44. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +2 -2
  45. package/cjs/components/SendToWallet/SendToWalletButton.js +3 -3
  46. package/cjs/components/SmallAvatar.d.ts +2 -2
  47. package/cjs/components/Step/CircularProgress.style.d.ts +1 -1
  48. package/cjs/components/Step/DestinationWalletAddress.js +2 -2
  49. package/cjs/components/Step/GasStepProcess.js +2 -2
  50. package/cjs/components/Step/Step.js +7 -5
  51. package/cjs/components/Step/StepList.d.ts +1 -1
  52. package/cjs/components/Step/StepProcess.style.d.ts +3 -3
  53. package/cjs/components/StepActions/StepActions.d.ts +5 -0
  54. package/cjs/components/StepActions/StepActions.js +55 -17
  55. package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
  56. package/cjs/components/SwapButton/SwapButton.js +2 -2
  57. package/cjs/components/SwapButton/types.d.ts +1 -2
  58. package/cjs/components/SwapInput/SwapInput.style.d.ts +2 -2
  59. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +3 -3
  60. package/cjs/components/SwapInput/SwapInputEndAdornment.js +18 -1
  61. package/cjs/components/SwapRouteCard/SwapRouteCard.d.ts +1 -2
  62. package/cjs/components/SwapRouteCard/SwapRouteCard.js +10 -26
  63. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +4 -36
  64. package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +7 -38
  65. package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +3 -0
  66. package/cjs/components/SwapRouteCard/SwapRouteCardEssentials.js +27 -0
  67. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +5 -5
  68. package/cjs/components/SwapRouteCard/types.d.ts +2 -2
  69. package/cjs/components/SwapRouteCard/utils.d.ts +5 -0
  70. package/cjs/components/SwapRouteCard/utils.js +32 -2
  71. package/cjs/components/SwapRoutes/SwapRoutes.js +3 -12
  72. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +3 -5
  73. package/cjs/components/SwapRoutes/{SwapRoutes.style.d.ts → SwapRoutesExpanded.style.d.ts} +0 -9
  74. package/cjs/components/SwapRoutes/{SwapRoutes.style.js → SwapRoutesExpanded.style.js} +1 -12
  75. package/cjs/components/Switch.js +4 -4
  76. package/cjs/components/TextFitter/TextFitter.js +9 -3
  77. package/cjs/components/Token/Token.style.d.ts +2 -2
  78. package/cjs/config/theme.js +1 -1
  79. package/cjs/config/version.d.ts +1 -1
  80. package/cjs/config/version.js +1 -1
  81. package/cjs/hooks/index.d.ts +4 -0
  82. package/cjs/hooks/index.js +4 -0
  83. package/cjs/hooks/useChains.js +2 -2
  84. package/cjs/hooks/useFeaturedTokens.d.ts +1 -1
  85. package/cjs/hooks/useFeaturedTokens.js +2 -2
  86. package/cjs/hooks/useFundsSufficiency.d.ts +5 -0
  87. package/cjs/hooks/useFundsSufficiency.js +73 -0
  88. package/cjs/hooks/useGasRecommendation.d.ts +2 -0
  89. package/cjs/hooks/useGasRecommendation.js +23 -0
  90. package/cjs/hooks/useGasRefuel.d.ts +7 -0
  91. package/cjs/hooks/useGasRefuel.js +61 -0
  92. package/cjs/hooks/useGasSufficiency.d.ts +2 -3
  93. package/cjs/hooks/useGasSufficiency.js +6 -37
  94. package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +3 -0
  95. package/cjs/hooks/useGetTokenBalancesWithRetry.js +33 -0
  96. package/cjs/hooks/useSwapRoutes.d.ts +7 -2
  97. package/cjs/hooks/useSwapRoutes.js +31 -11
  98. package/cjs/hooks/useTokenAddressBalance.js +4 -2
  99. package/cjs/hooks/useTokenBalance.js +4 -22
  100. package/cjs/hooks/useTokenBalances.d.ts +1 -1
  101. package/cjs/hooks/useTokenSearch.js +2 -2
  102. package/cjs/hooks/useTokens.js +2 -3
  103. package/cjs/i18n/en.json +14 -7
  104. package/cjs/i18n/it.json +6 -2
  105. package/cjs/i18n/pt.json +234 -0
  106. package/cjs/i18n/uk.json +5 -1
  107. package/cjs/icons/InsuraceLogo.d.ts +2 -0
  108. package/cjs/icons/InsuraceLogo.js +11 -0
  109. package/cjs/icons/index.d.ts +1 -0
  110. package/cjs/icons/index.js +1 -0
  111. package/cjs/index.d.ts +0 -6
  112. package/cjs/index.js +1 -6
  113. package/cjs/pages/MainPage/MainGasMessage.d.ts +3 -0
  114. package/cjs/pages/MainPage/MainGasMessage.js +12 -0
  115. package/cjs/pages/MainPage/MainPage.js +3 -2
  116. package/cjs/pages/MainPage/MainSwapButton.js +1 -1
  117. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
  118. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  119. package/cjs/pages/SettingsPage/ResetSettingsButton.js +3 -1
  120. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  121. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +4 -3
  122. package/cjs/pages/SwapPage/ExchangeRateBottomSheet.d.ts +1 -2
  123. package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +1 -14
  124. package/cjs/pages/SwapPage/StartSwapButton.d.ts +3 -2
  125. package/cjs/pages/SwapPage/StartSwapButton.js +14 -4
  126. package/cjs/pages/SwapPage/SwapPage.js +18 -7
  127. package/cjs/pages/SwapPage/types.d.ts +9 -0
  128. package/cjs/pages/SwapPage/types.js +2 -0
  129. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  130. package/cjs/providers/SDKProvider/SDKProvider.d.ts +2 -2
  131. package/cjs/providers/SDKProvider/SDKProvider.js +2 -1
  132. package/cjs/providers/SwapFormProvider/FormUpdater.js +2 -3
  133. package/cjs/providers/WidgetProvider/WidgetProvider.js +17 -4
  134. package/cjs/providers/WidgetProvider/utils.d.ts +1 -1
  135. package/cjs/providers/WidgetProvider/utils.js +2 -4
  136. package/cjs/stores/StoreProvider.js +1 -1
  137. package/cjs/stores/routes/createRouteExecutionStore.js +3 -2
  138. package/cjs/stores/routes/index.d.ts +0 -1
  139. package/cjs/stores/routes/index.js +0 -1
  140. package/cjs/stores/routes/types.d.ts +1 -5
  141. package/cjs/stores/routes/useSetExecutableRoute.d.ts +1 -1
  142. package/cjs/stores/settings/types.d.ts +3 -2
  143. package/cjs/stores/settings/useSettingsStore.js +3 -1
  144. package/cjs/types/widget.d.ts +5 -10
  145. package/cjs/utils/format.js +4 -1
  146. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
  147. package/components/Card/CardIconButton.d.ts +29 -0
  148. package/components/Card/CardIconButton.js +14 -0
  149. package/components/Card/CardLabel.d.ts +26 -0
  150. package/components/Card/CardLabel.js +42 -0
  151. package/components/Card/CardTitle.d.ts +2 -2
  152. package/components/Card/index.d.ts +2 -0
  153. package/components/Card/index.js +2 -0
  154. package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -0
  155. package/components/GasMessage/FundsSufficiencyMessage.js +12 -0
  156. package/components/{GasSufficiencyMessage/GasSufficiencyMessage.d.ts → GasMessage/GasMessage.d.ts} +4 -2
  157. package/components/GasMessage/GasMessage.js +15 -0
  158. package/components/GasMessage/GasMessage.style.d.ts +34 -0
  159. package/components/GasMessage/GasMessage.style.js +45 -0
  160. package/components/GasMessage/GasRefuelMessage.d.ts +3 -0
  161. package/components/GasMessage/GasRefuelMessage.js +22 -0
  162. package/components/GasMessage/GasSufficiencyMessage.d.ts +7 -0
  163. package/components/GasMessage/GasSufficiencyMessage.js +17 -0
  164. package/components/GasMessage/index.d.ts +2 -0
  165. package/components/GasMessage/index.js +2 -0
  166. package/components/Header/Header.style.d.ts +5 -5
  167. package/components/Header/NavigationHeader.js +4 -4
  168. package/components/Header/WalletHeader.js +6 -6
  169. package/components/Insurance/Insurance.d.ts +3 -0
  170. package/components/Insurance/Insurance.js +7 -0
  171. package/components/Insurance/InsuranceCard.d.ts +3 -0
  172. package/components/Insurance/InsuranceCard.js +16 -0
  173. package/components/Insurance/InsuranceCollapsed.d.ts +3 -0
  174. package/components/Insurance/InsuranceCollapsed.js +28 -0
  175. package/components/Insurance/index.d.ts +1 -0
  176. package/components/Insurance/index.js +1 -0
  177. package/components/Insurance/types.d.ts +14 -0
  178. package/components/Insurance/types.js +1 -0
  179. package/components/NFT/NFT.style.d.ts +1 -1
  180. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  181. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  182. package/components/SendToWallet/SendToWallet.js +34 -28
  183. package/components/SendToWallet/SendToWallet.style.d.ts +2 -2
  184. package/components/SendToWallet/SendToWalletButton.js +4 -4
  185. package/components/SmallAvatar.d.ts +2 -2
  186. package/components/Step/CircularProgress.style.d.ts +1 -1
  187. package/components/Step/DestinationWalletAddress.js +2 -2
  188. package/components/Step/GasStepProcess.js +2 -2
  189. package/components/Step/Step.js +7 -5
  190. package/components/Step/StepList.d.ts +1 -1
  191. package/components/Step/StepProcess.style.d.ts +3 -3
  192. package/components/StepActions/StepActions.d.ts +5 -0
  193. package/components/StepActions/StepActions.js +52 -16
  194. package/components/StepActions/StepActions.style.d.ts +1 -1
  195. package/components/SwapButton/SwapButton.js +2 -2
  196. package/components/SwapButton/types.d.ts +1 -2
  197. package/components/SwapInput/SwapInput.style.d.ts +2 -2
  198. package/components/SwapInput/SwapInputAdornment.style.d.ts +3 -3
  199. package/components/SwapInput/SwapInputEndAdornment.js +19 -2
  200. package/components/SwapRouteCard/SwapRouteCard.d.ts +1 -2
  201. package/components/SwapRouteCard/SwapRouteCard.js +11 -26
  202. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +4 -36
  203. package/components/SwapRouteCard/SwapRouteCard.style.js +7 -38
  204. package/components/SwapRouteCard/SwapRouteCardEssentials.d.ts +3 -0
  205. package/components/SwapRouteCard/SwapRouteCardEssentials.js +23 -0
  206. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +5 -5
  207. package/components/SwapRouteCard/types.d.ts +2 -2
  208. package/components/SwapRouteCard/utils.d.ts +5 -0
  209. package/components/SwapRouteCard/utils.js +30 -1
  210. package/components/SwapRoutes/SwapRoutes.js +5 -14
  211. package/components/SwapRoutes/SwapRoutesExpanded.js +2 -4
  212. package/components/SwapRoutes/{SwapRoutes.style.d.ts → SwapRoutesExpanded.style.d.ts} +0 -9
  213. package/components/SwapRoutes/{SwapRoutes.style.js → SwapRoutesExpanded.style.js} +1 -12
  214. package/components/Switch.js +5 -5
  215. package/components/TextFitter/TextFitter.js +9 -3
  216. package/components/Token/Token.style.d.ts +2 -2
  217. package/config/theme.js +1 -1
  218. package/config/version.d.ts +1 -1
  219. package/config/version.js +1 -1
  220. package/hooks/index.d.ts +4 -0
  221. package/hooks/index.js +4 -0
  222. package/hooks/useChains.js +2 -2
  223. package/hooks/useFeaturedTokens.d.ts +1 -1
  224. package/hooks/useFeaturedTokens.js +2 -2
  225. package/hooks/useFundsSufficiency.d.ts +5 -0
  226. package/hooks/useFundsSufficiency.js +69 -0
  227. package/hooks/useGasRecommendation.d.ts +2 -0
  228. package/hooks/useGasRecommendation.js +19 -0
  229. package/hooks/useGasRefuel.d.ts +7 -0
  230. package/hooks/useGasRefuel.js +57 -0
  231. package/hooks/useGasSufficiency.d.ts +2 -3
  232. package/hooks/useGasSufficiency.js +7 -38
  233. package/hooks/useGetTokenBalancesWithRetry.d.ts +3 -0
  234. package/hooks/useGetTokenBalancesWithRetry.js +29 -0
  235. package/hooks/useSwapRoutes.d.ts +7 -2
  236. package/hooks/useSwapRoutes.js +32 -12
  237. package/hooks/useTokenAddressBalance.js +4 -2
  238. package/hooks/useTokenBalance.js +5 -23
  239. package/hooks/useTokenBalances.d.ts +1 -1
  240. package/hooks/useTokenSearch.js +2 -2
  241. package/hooks/useTokens.js +2 -3
  242. package/i18n/en.json +14 -7
  243. package/i18n/it.json +6 -2
  244. package/i18n/pt.json +234 -0
  245. package/i18n/uk.json +5 -1
  246. package/icons/InsuraceLogo.d.ts +2 -0
  247. package/icons/InsuraceLogo.js +7 -0
  248. package/icons/index.d.ts +1 -0
  249. package/icons/index.js +1 -0
  250. package/index.d.ts +0 -6
  251. package/index.js +0 -5
  252. package/package.json +12 -11
  253. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +2 -2
  254. package/pages/MainPage/MainGasMessage.d.ts +3 -0
  255. package/pages/MainPage/MainGasMessage.js +8 -0
  256. package/pages/MainPage/MainPage.js +3 -2
  257. package/pages/MainPage/MainSwapButton.js +1 -1
  258. package/pages/SettingsPage/ColorSchemeButtonGroup.js +2 -2
  259. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  260. package/pages/SettingsPage/ResetSettingsButton.js +3 -1
  261. package/pages/SettingsPage/RoutePrioritySelect.js +1 -1
  262. package/pages/SwapDetailsPage/SwapDetailsPage.js +5 -4
  263. package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  264. package/pages/SwapPage/ExchangeRateBottomSheet.d.ts +1 -2
  265. package/pages/SwapPage/ExchangeRateBottomSheet.js +0 -12
  266. package/pages/SwapPage/StartSwapButton.d.ts +3 -2
  267. package/pages/SwapPage/StartSwapButton.js +13 -4
  268. package/pages/SwapPage/SwapPage.js +21 -10
  269. package/pages/SwapPage/types.d.ts +9 -0
  270. package/pages/SwapPage/types.js +1 -0
  271. package/pages/SwapRoutesPage/SwapRoutesPage.js +1 -1
  272. package/providers/SDKProvider/SDKProvider.d.ts +2 -2
  273. package/providers/SDKProvider/SDKProvider.js +3 -2
  274. package/providers/SwapFormProvider/FormUpdater.js +2 -3
  275. package/providers/WidgetProvider/WidgetProvider.js +17 -4
  276. package/providers/WidgetProvider/utils.d.ts +1 -1
  277. package/providers/WidgetProvider/utils.js +2 -4
  278. package/stores/StoreProvider.js +2 -2
  279. package/stores/routes/createRouteExecutionStore.js +3 -2
  280. package/stores/routes/index.d.ts +0 -1
  281. package/stores/routes/index.js +0 -1
  282. package/stores/routes/types.d.ts +1 -5
  283. package/stores/routes/useSetExecutableRoute.d.ts +1 -1
  284. package/stores/settings/types.d.ts +3 -2
  285. package/stores/settings/useSettingsStore.js +3 -1
  286. package/tsconfig.cjs.tsbuildinfo +1 -1
  287. package/types/widget.d.ts +5 -10
  288. package/utils/format.js +4 -1
  289. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +0 -31
  290. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +0 -9
  291. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.js +0 -14
  292. package/cjs/components/GasSufficiencyMessage/index.d.ts +0 -1
  293. package/cjs/components/SwapRoutes/useSetRecommendedRoute.d.ts +0 -2
  294. package/cjs/components/SwapRoutes/useSetRecommendedRoute.js +0 -13
  295. package/cjs/config/env.d.ts +0 -3
  296. package/cjs/config/env.js +0 -6
  297. package/cjs/stores/routes/useRecommendedRouteStore.d.ts +0 -10
  298. package/cjs/stores/routes/useRecommendedRouteStore.js +0 -39
  299. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +0 -27
  300. package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +0 -9
  301. package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.js +0 -11
  302. package/components/GasSufficiencyMessage/index.d.ts +0 -1
  303. package/components/GasSufficiencyMessage/index.js +0 -1
  304. package/components/SwapRoutes/useSetRecommendedRoute.d.ts +0 -2
  305. package/components/SwapRoutes/useSetRecommendedRoute.js +0 -9
  306. package/config/env.d.ts +0 -3
  307. package/config/env.js +0 -3
  308. package/stores/routes/useRecommendedRouteStore.d.ts +0 -10
  309. package/stores/routes/useRecommendedRouteStore.js +0 -32
@@ -54,7 +54,10 @@ const formatAmount = (amount = '', returnInitial = false) => {
54
54
  if (!amount) {
55
55
  return amount;
56
56
  }
57
- const formattedAmount = amount.replaceAll(',', '.');
57
+ let formattedAmount = amount.replaceAll(',', '.');
58
+ if (formattedAmount.startsWith('.')) {
59
+ formattedAmount = '0' + formattedAmount;
60
+ }
58
61
  const parsedAmount = parseFloat(formattedAmount);
59
62
  if (isNaN(Number(formattedAmount)) && !isNaN(parsedAmount)) {
60
63
  return parsedAmount.toString();
@@ -39,17 +39,17 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
39
39
  export declare const ShowAllButton: import("@emotion/styled").StyledComponent<{
40
40
  children?: import("react").ReactNode;
41
41
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
42
- color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
42
+ color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
43
43
  disabled?: boolean | undefined;
44
44
  disableElevation?: boolean | undefined;
45
45
  disableFocusRipple?: boolean | undefined;
46
46
  endIcon?: import("react").ReactNode;
47
47
  fullWidth?: boolean | undefined;
48
48
  href?: string | undefined;
49
- size?: "small" | "medium" | "large" | undefined;
49
+ size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
50
50
  startIcon?: import("react").ReactNode;
51
51
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
52
- variant?: "text" | "outlined" | "contained" | undefined;
52
+ variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
53
53
  } & Omit<{
54
54
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
55
55
  centerRipple?: boolean | undefined;
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ export declare const CardIconButton: import("@emotion/styled").StyledComponent<{
3
+ children?: import("react").ReactNode;
4
+ classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
5
+ color?: import("@mui/types").OverridableStringUnion<"inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").IconButtonPropsColorOverrides> | undefined;
6
+ disabled?: boolean | undefined;
7
+ disableFocusRipple?: boolean | undefined;
8
+ edge?: false | "end" | "start" | undefined;
9
+ size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").IconButtonPropsSizeOverrides> | undefined;
10
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
11
+ } & Omit<{
12
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
13
+ centerRipple?: boolean | undefined;
14
+ children?: import("react").ReactNode;
15
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
16
+ disabled?: boolean | undefined;
17
+ disableRipple?: boolean | undefined;
18
+ disableTouchRipple?: boolean | undefined;
19
+ focusRipple?: boolean | undefined;
20
+ focusVisibleClassName?: string | undefined;
21
+ LinkComponent?: import("react").ElementType<any> | undefined;
22
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
23
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
24
+ tabIndex?: number | undefined;
25
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
26
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
27
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
28
+ ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
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>, {}, {}>;
@@ -0,0 +1,14 @@
1
+ import { IconButton as MuiIconButton } from '@mui/material';
2
+ import { alpha, styled } from '@mui/material/styles';
3
+ export const CardIconButton = styled(MuiIconButton)(({ theme }) => {
4
+ const backgroundColor = theme.palette.mode === 'light'
5
+ ? theme.palette.common.black
6
+ : theme.palette.common.white;
7
+ return {
8
+ padding: theme.spacing(0.5),
9
+ backgroundColor: alpha(backgroundColor, 0.04),
10
+ '&:hover': {
11
+ backgroundColor: alpha(backgroundColor, 0.08),
12
+ },
13
+ };
14
+ });
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ export declare const CardLabel: 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
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
9
+ }, "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
+ type?: "active" | "insurance" | "insurance-icon" | undefined;
11
+ }, {}, {}>;
12
+ export declare const CardLabelTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
13
+ align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
14
+ children?: import("react").ReactNode;
15
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
16
+ gutterBottom?: boolean | undefined;
17
+ noWrap?: boolean | undefined;
18
+ paragraph?: boolean | undefined;
19
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
20
+ variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
21
+ variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
22
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
23
+ ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
24
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
25
+ type?: "icon" | undefined;
26
+ }, {}, {}>;
@@ -0,0 +1,42 @@
1
+ import { Box, Typography } from '@mui/material';
2
+ import { alpha, lighten, styled } from '@mui/material/styles';
3
+ export const CardLabel = styled(Box, {
4
+ shouldForwardProp: (prop) => prop !== 'type',
5
+ })(({ theme, type }) => ({
6
+ backgroundColor: type === 'active'
7
+ ? theme.palette.mode === 'light'
8
+ ? theme.palette.secondary.main
9
+ : alpha(theme.palette.secondary.main, 0.32)
10
+ : type?.includes('insurance')
11
+ ? alpha(theme.palette.success.main, theme.palette.mode === 'light' ? 0.12 : 0.24)
12
+ : theme.palette.mode === 'light'
13
+ ? alpha(theme.palette.common.black, 0.12)
14
+ : alpha(theme.palette.common.white, 0.16),
15
+ borderRadius: theme.shape.borderRadius,
16
+ color: type?.includes('insurance')
17
+ ? lighten(theme.palette.success.main, theme.palette.mode === 'light' ? 0 : 0.24)
18
+ : theme.palette.text.primary,
19
+ padding: type === 'insurance' ? theme.spacing(0, 1.5) : 0,
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ justifyContent: 'center',
23
+ height: 24,
24
+ minWidth: 24,
25
+ userSelect: 'none',
26
+ fontSize: '1rem',
27
+ marginRight: theme.spacing(1),
28
+ }));
29
+ export const CardLabelTypography = styled(Typography, {
30
+ shouldForwardProp: (prop) => prop !== 'type',
31
+ })(({ theme, type }) => ({
32
+ padding: type === 'icon'
33
+ ? theme.spacing(0.75, 0, 0.75, 0.75)
34
+ : theme.spacing(0.75, 1.5),
35
+ fontSize: 12,
36
+ lineHeight: 1,
37
+ fontWeight: '600',
38
+ textTransform: 'lowercase',
39
+ '&::first-letter': {
40
+ textTransform: 'uppercase',
41
+ },
42
+ }));
@@ -7,8 +7,8 @@ export declare const CardTitle: import("@emotion/styled").StyledComponent<import
7
7
  noWrap?: boolean | undefined;
8
8
  paragraph?: boolean | undefined;
9
9
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
10
- variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
11
- variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
10
+ variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
11
+ variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
12
12
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
13
13
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
14
14
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
@@ -1,3 +1,5 @@
1
1
  export * from './Card';
2
2
  export * from './CardHeader';
3
+ export * from './CardIconButton';
4
+ export * from './CardLabel';
3
5
  export * from './CardTitle';
@@ -1,3 +1,5 @@
1
1
  export * from './Card';
2
2
  export * from './CardHeader';
3
+ export * from './CardIconButton';
4
+ export * from './CardLabel';
3
5
  export * from './CardTitle';
@@ -0,0 +1 @@
1
+ export declare const FundsSufficiencyMessage: () => JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import WarningRoundedIcon from '@mui/icons-material/WarningRounded';
3
+ import { Typography } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { WarningMessageCard, WarningMessageCardTitle, } from './GasMessage.style';
6
+ export const FundsSufficiencyMessage = () => {
7
+ const { t } = useTranslation();
8
+ return (_jsxs(WarningMessageCard, { display: "flex", children: [_jsx(WarningMessageCardTitle, { children: _jsx(WarningRoundedIcon, { sx: {
9
+ marginTop: 2,
10
+ marginLeft: 2,
11
+ } }) }), _jsx(Typography, { variant: "body2", px: 2, pb: 2, pt: 2, children: t(`swap.warning.message.insufficientFunds`) })] }));
12
+ };
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { Route } from '@lifi/sdk';
3
3
  import type { BoxProps } from '@mui/material';
4
- export declare const GasSufficiencyMessage: React.FC<{
4
+ interface GasMessageProps extends BoxProps {
5
5
  route?: Route;
6
- } & BoxProps>;
6
+ }
7
+ export declare const GasMessage: React.FC<GasMessageProps>;
8
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Box, Collapse } from '@mui/material';
3
+ import { useFundsSufficiency, useGasRefuel, useGasSufficiency, } from '../../hooks';
4
+ import { useSettings } from '../../stores';
5
+ import { FundsSufficiencyMessage } from './FundsSufficiencyMessage';
6
+ import { GasSufficiencyMessage } from './GasSufficiencyMessage';
7
+ export const GasMessage = ({ route, ...props }) => {
8
+ const { insufficientGas } = useGasSufficiency(route);
9
+ const { insufficientFunds } = useFundsSufficiency(route);
10
+ const { enabledAutoRefuel } = useSettings(['enabledAutoRefuel']);
11
+ const { enabled, isLoading: isRefuelLoading } = useGasRefuel();
12
+ const enabledRefuel = enabled && enabledAutoRefuel;
13
+ const showGasSufficiencyMessage = insufficientGas?.length && !isRefuelLoading && !enabledRefuel;
14
+ return (_jsx(Collapse, { timeout: 225, in: Boolean(insufficientFunds || showGasSufficiencyMessage), unmountOnExit: true, mountOnEnter: true, children: _jsx(Box, { ...props, children: insufficientFunds ? (_jsx(FundsSufficiencyMessage, {})) : showGasSufficiencyMessage ? (_jsx(GasSufficiencyMessage, { insufficientGas: insufficientGas })) : null }) }));
15
+ };
@@ -0,0 +1,34 @@
1
+ /// <reference types="react" />
2
+ export declare const WarningMessageCard: 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
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
9
+ }, "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
+ export declare const WarningMessageCardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
11
+ children?: import("react").ReactNode;
12
+ component?: import("react").ElementType<any> | undefined;
13
+ ref?: import("react").Ref<unknown> | undefined;
14
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
16
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
17
+ }, "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>, {}, {}>;
18
+ export declare const InfoMessageCard: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
19
+ children?: import("react").ReactNode;
20
+ component?: import("react").ElementType<any> | undefined;
21
+ ref?: import("react").Ref<unknown> | undefined;
22
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
23
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
24
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
25
+ }, "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>, {}, {}>;
26
+ export declare const InfoMessageCardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
27
+ children?: import("react").ReactNode;
28
+ component?: import("react").ElementType<any> | undefined;
29
+ ref?: import("react").Ref<unknown> | undefined;
30
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
31
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
32
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
33
+ }, "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 InfoMessageSwitch: import("@emotion/styled").StyledComponent<import("@mui/material").SwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,45 @@
1
+ import { Box } from '@mui/material';
2
+ import { alpha, darken, lighten, styled } from '@mui/material/styles';
3
+ import { switchClasses } from '@mui/material/Switch';
4
+ import { Switch } from '../Switch';
5
+ const MessageCard = styled(Box)(({ theme }) => ({
6
+ borderRadius: theme.shape.borderRadius,
7
+ position: 'relative',
8
+ whiteSpace: 'pre-line',
9
+ }));
10
+ export const WarningMessageCard = styled(MessageCard)(({ theme }) => ({
11
+ backgroundColor: theme.palette.mode === 'light'
12
+ ? alpha(theme.palette.warning.main, 0.32)
13
+ : alpha(theme.palette.warning.main, 0.16),
14
+ }));
15
+ export const WarningMessageCardTitle = styled(Box)(({ theme }) => ({
16
+ color: theme.palette.mode === 'light'
17
+ ? darken(theme.palette.warning.main, 0.36)
18
+ : alpha(theme.palette.warning.main, 1),
19
+ }));
20
+ export const InfoMessageCard = styled(MessageCard)(({ theme }) => ({
21
+ backgroundColor: theme.palette.mode === 'light'
22
+ ? alpha(theme.palette.info.main, 0.12)
23
+ : alpha(theme.palette.info.main, 0.16),
24
+ }));
25
+ export const InfoMessageCardTitle = styled(Box)(({ theme }) => ({
26
+ color: theme.palette.mode === 'light'
27
+ ? theme.palette.info.main
28
+ : lighten(theme.palette.info.main, 0.24),
29
+ }));
30
+ export const InfoMessageSwitch = styled(Switch)(({ theme }) => ({
31
+ [`.${switchClasses.switchBase}`]: {
32
+ [`&.${switchClasses.checked}`]: {
33
+ [`& + .${switchClasses.track}`]: {
34
+ backgroundColor: theme.palette.mode === 'light'
35
+ ? theme.palette.info.main
36
+ : alpha(theme.palette.info.main, 0.84),
37
+ },
38
+ },
39
+ [`&.Mui-focusVisible .${switchClasses.thumb}`]: {
40
+ color: theme.palette.mode === 'light'
41
+ ? theme.palette.info.main
42
+ : alpha(theme.palette.info.main, 0.84),
43
+ },
44
+ },
45
+ }));
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps } from '@mui/material';
3
+ export declare const GasRefuelMessage: React.FC<BoxProps>;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import EvStationIcon from '@mui/icons-material/EvStation';
3
+ import { Box, Collapse, Typography } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { useGasRefuel } from '../../hooks';
6
+ import { useSettings, useSettingsStore } from '../../stores';
7
+ import { InfoMessageCard, InfoMessageCardTitle, InfoMessageSwitch, } from './GasMessage.style';
8
+ export const GasRefuelMessage = (props) => {
9
+ const { t } = useTranslation();
10
+ const setValue = useSettingsStore((state) => state.setValue);
11
+ const { enabledAutoRefuel } = useSettings(['enabledAutoRefuel']);
12
+ const { enabled, chain, isLoading: isRefuelLoading } = useGasRefuel();
13
+ const onChange = (_, checked) => {
14
+ setValue('enabledAutoRefuel', checked);
15
+ };
16
+ const showGasRefuelMessage = chain && enabled && !isRefuelLoading;
17
+ return (_jsx(Collapse, { timeout: 225, in: showGasRefuelMessage, unmountOnExit: true, mountOnEnter: true, children: _jsxs(InfoMessageCard, { ...props, children: [_jsxs(InfoMessageCardTitle, { display: "flex", alignItems: "center", justifyContent: "space-between", p: 2, children: [_jsxs(Box, { display: "flex", alignItems: "center", children: [_jsx(EvStationIcon, { sx: {
18
+ marginRight: 1,
19
+ } }), _jsx(Typography, { variant: "body2", fontWeight: 700, children: t(`swap.info.title.autoRefuel`) })] }), _jsx(InfoMessageSwitch, { checked: enabledAutoRefuel, onChange: onChange })] }), _jsx(Collapse, { timeout: 225, in: enabledAutoRefuel, unmountOnExit: true, mountOnEnter: true, children: _jsx(Typography, { variant: "body2", px: 2, pb: 2, children: t(`swap.info.message.autoRefuel`, {
20
+ chainName: chain?.name,
21
+ }) }) })] }) }));
22
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { GasSufficiency } from '../../hooks';
3
+ interface GasSufficiencyMessageProps {
4
+ insufficientGas?: GasSufficiency[];
5
+ }
6
+ export declare const GasSufficiencyMessage: React.FC<GasSufficiencyMessageProps>;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import EvStationIcon from '@mui/icons-material/EvStation';
3
+ import { Typography } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { WarningMessageCard, WarningMessageCardTitle, } from './GasMessage.style';
6
+ export const GasSufficiencyMessage = ({ insufficientGas, }) => {
7
+ const { t } = useTranslation();
8
+ return (_jsxs(WarningMessageCard, { children: [_jsxs(WarningMessageCardTitle, { display: "flex", alignItems: "center", px: 2, pt: 2, children: [_jsx(EvStationIcon, { sx: {
9
+ marginRight: 1,
10
+ } }), _jsx(Typography, { variant: "body2", fontWeight: 700, children: t(`swap.warning.title.insufficientGas`) })] }), _jsx(Typography, { variant: "body2", px: 2, pt: 1, children: t(`swap.warning.message.insufficientGas`) }), insufficientGas?.map((item, index) => (_jsx(Typography
11
+ // eslint-disable-next-line react/no-array-index-key
12
+ , { variant: "body2", px: 2, pb: insufficientGas?.length - 1 === index ? 2 : 0, pt: 0.5, children: t(`swap.tokenOnChainAmount`, {
13
+ amount: item.insufficientAmount?.toString(),
14
+ tokenSymbol: item.token.symbol,
15
+ chainName: item.chain?.name,
16
+ }) }, index)))] }));
17
+ };
@@ -0,0 +1,2 @@
1
+ export * from './GasMessage';
2
+ export * from './GasRefuelMessage';
@@ -0,0 +1,2 @@
1
+ export * from './GasMessage';
2
+ export * from './GasRefuelMessage';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps<"div", {}>, "classes" | "color" | "position"> & {
2
+ export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<Omit<import("@mui/material").PaperProps, "classes" | "color" | "position"> & {
3
3
  classes?: Partial<import("@mui/material").AppBarClasses> | undefined;
4
- color?: "inherit" | "transparent" | "default" | "primary" | "secondary" | undefined;
4
+ color?: import("@mui/types").OverridableStringUnion<"transparent" | import("@mui/material").PropTypes.Color, import("@mui/material").AppBarPropsColorOverrides> | undefined;
5
5
  enableColorOnDark?: boolean | undefined;
6
6
  position?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
7
7
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
@@ -21,17 +21,17 @@ export declare const Container: import("@emotion/styled").StyledComponent<import
21
21
  export declare const WalletButton: import("@emotion/styled").StyledComponent<{
22
22
  children?: import("react").ReactNode;
23
23
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
24
- color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
24
+ color?: import("@mui/types").OverridableStringUnion<"inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info", import("@mui/material").ButtonPropsColorOverrides> | undefined;
25
25
  disabled?: boolean | undefined;
26
26
  disableElevation?: boolean | undefined;
27
27
  disableFocusRipple?: boolean | undefined;
28
28
  endIcon?: import("react").ReactNode;
29
29
  fullWidth?: boolean | undefined;
30
30
  href?: string | undefined;
31
- size?: "small" | "medium" | "large" | undefined;
31
+ size?: import("@mui/types").OverridableStringUnion<"small" | "medium" | "large", import("@mui/material").ButtonPropsSizeOverrides> | undefined;
32
32
  startIcon?: import("react").ReactNode;
33
33
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
34
- variant?: "text" | "outlined" | "contained" | undefined;
34
+ variant?: import("@mui/types").OverridableStringUnion<"text" | "outlined" | "contained", import("@mui/material").ButtonPropsVariantOverrides> | undefined;
35
35
  } & Omit<{
36
36
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
37
37
  centerRipple?: boolean | undefined;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ArrowBackIcon from '@mui/icons-material/ArrowBack';
3
- import ReceiptLongRoundedIcon from '@mui/icons-material/ReceiptLongRounded';
4
- import SettingsOutlinedIcon from '@mui/icons-material/SettingsOutlined';
3
+ import ReceiptLongIcon from '@mui/icons-material/ReceiptLong';
4
+ import SettingsIcon from '@mui/icons-material/Settings';
5
5
  import { Box, IconButton, Tooltip, Typography } from '@mui/material';
6
6
  import { useTranslation } from 'react-i18next';
7
7
  import { Route, Routes, useLocation } from 'react-router-dom';
@@ -62,7 +62,7 @@ export const NavigationHeader = () => {
62
62
  }
63
63
  }
64
64
  };
65
- return (_jsxs(HeaderAppBar, { elevation: 0, children: [backButtonRoutes.includes(path) ? (_jsx(IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: _jsx(ArrowBackIcon, {}) })) : null, _jsx(Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: handleHeaderTitle() }), _jsxs(Routes, { children: [_jsx(Route, { path: navigationRoutes.home, element: _jsxs(_Fragment, { children: [account.isActive ? (_jsx(Tooltip, { title: t(`header.swapHistory`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", edge: "start", onClick: () => navigate(navigationRoutes.swapHistory), children: _jsx(ReceiptLongRoundedIcon, {}) }) })) : null, _jsx(Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", onClick: () => navigate(navigationRoutes.settings), sx: {
65
+ return (_jsxs(HeaderAppBar, { elevation: 0, children: [backButtonRoutes.includes(path) ? (_jsx(IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: _jsx(ArrowBackIcon, {}) })) : null, _jsx(Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: handleHeaderTitle() }), _jsxs(Routes, { children: [_jsx(Route, { path: navigationRoutes.home, element: _jsxs(_Fragment, { children: [account.isActive ? (_jsx(Tooltip, { title: t(`header.swapHistory`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", edge: "start", onClick: () => navigate(navigationRoutes.swapHistory), children: _jsx(ReceiptLongIcon, {}) }) })) : null, _jsx(Tooltip, { title: t(`header.settings`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", onClick: () => navigate(navigationRoutes.settings), sx: {
66
66
  marginRight: -1.25,
67
- }, children: _jsx(SettingsOutlinedIcon, {}) }) })] }) }), _jsx(Route, { path: "*", element: element || _jsx(Box, { width: 28, height: 40 }) })] })] }));
67
+ }, children: _jsx(SettingsIcon, {}) }) })] }) }), _jsx(Route, { path: "*", element: element || _jsx(Box, { width: 28, height: 40 }) })] })] }));
68
68
  };
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import ContentCopyIcon from '@mui/icons-material/ContentCopy';
2
+ import ContentCopyIcon from '@mui/icons-material/ContentCopyRounded';
3
3
  import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
4
- import OpenInNewOutlinedIcon from '@mui/icons-material/OpenInNewOutlined';
5
- import PowerSettingsNewRoundedIcon from '@mui/icons-material/PowerSettingsNewRounded';
6
- import WalletOutlinedIcon from '@mui/icons-material/WalletOutlined';
4
+ import OpenInNewIcon from '@mui/icons-material/OpenInNewRounded';
5
+ import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNewRounded';
6
+ import WalletIcon from '@mui/icons-material/Wallet';
7
7
  import { Avatar, Button, MenuItem } from '@mui/material';
8
8
  import { useState } from 'react';
9
9
  import { useTranslation } from 'react-i18next';
@@ -30,7 +30,7 @@ const ConnectButton = () => {
30
30
  }
31
31
  navigate(navigationRoutes.selectWallet);
32
32
  };
33
- return (_jsx(WalletButton, { endIcon: _jsx(WalletOutlinedIcon, {}), onClick: !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined, sx: {
33
+ return (_jsx(WalletButton, { endIcon: _jsx(WalletIcon, {}), onClick: !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined, sx: {
34
34
  marginRight: -1.25,
35
35
  }, children: t(`button.connectWallet`) }));
36
36
  };
@@ -56,7 +56,7 @@ const ConnectedButton = () => {
56
56
  };
57
57
  return (_jsxs(_Fragment, { children: [_jsx(WalletButton, { endIcon: _jsx(ExpandMoreIcon, {}), startIcon: _jsx(Avatar, { src: chain?.logoURI, alt: chain?.key, sx: { width: 24, height: 24 }, children: chain?.name[0] }), sx: {
58
58
  marginRight: -1.25,
59
- }, onClick: handleClick, children: walletAddress }), _jsxs(WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [_jsxs(MenuItem, { onClick: handleCopyAddress, children: [_jsx(ContentCopyIcon, {}), t(`button.copyAddress`)] }), _jsxs(MenuItem, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", children: [_jsx(OpenInNewOutlinedIcon, {}), t(`button.viewOnExplorer`)] }), _jsx(Button, { onClick: handleDisconnect, fullWidth: true, startIcon: _jsx(PowerSettingsNewRoundedIcon, {}), sx: {
59
+ }, onClick: handleClick, children: walletAddress }), _jsxs(WalletMenu, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: [_jsxs(MenuItem, { onClick: handleCopyAddress, children: [_jsx(ContentCopyIcon, {}), t(`button.copyAddress`)] }), _jsxs(MenuItem, { component: "a", onClick: handleClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", children: [_jsx(OpenInNewIcon, {}), t(`button.viewOnExplorer`)] }), _jsx(Button, { onClick: handleDisconnect, fullWidth: true, startIcon: _jsx(PowerSettingsNewIcon, {}), sx: {
60
60
  marginTop: 1,
61
61
  }, children: t(`button.disconnect`) })] })] }));
62
62
  };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { InsuranceProps } from './types';
3
+ export declare const Insurance: React.FC<InsuranceProps>;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { RouteExecutionStatus } from '../../stores';
3
+ import { InsuranceCard } from './InsuranceCard';
4
+ import { InsuranceCollapsed } from './InsuranceCollapsed';
5
+ export const Insurance = ({ status, insurableRouteId, feeAmountUsd, onChange, ...props }) => {
6
+ return status === RouteExecutionStatus.Idle ? (_jsx(InsuranceCollapsed, { insurableRouteId: insurableRouteId, feeAmountUsd: feeAmountUsd, status: status, onChange: onChange, ...props })) : (_jsx(InsuranceCard, { feeAmountUsd: feeAmountUsd, status: status, ...props }));
7
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import type { InsuranceCardProps } from './types';
3
+ export declare const InsuranceCard: React.FC<InsuranceCardProps>;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import VerifiedUserIcon from '@mui/icons-material/VerifiedUser';
3
+ import { Box, Typography } from '@mui/material';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { InsuraceLogo } from '../../icons';
6
+ import { RouteExecutionStatus } from '../../stores';
7
+ import { Card, CardLabel, CardLabelTypography } from '../Card';
8
+ import { Switch } from '../Switch';
9
+ export const InsuranceCard = ({ status, feeAmountUsd, onChange, ...props }) => {
10
+ const { t } = useTranslation();
11
+ return (_jsxs(Card, { selectionColor: "secondary", indented: true, ...props, children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsxs(CardLabel, { type: 'insurance', children: [_jsx(VerifiedUserIcon, { fontSize: "inherit" }), _jsx(CardLabelTypography, { type: "icon", children: status === RouteExecutionStatus.Idle
12
+ ? t(`swap.tags.insurance`)
13
+ : t(`swap.tags.insured`) })] }), _jsx(InsuraceLogo, {})] }), _jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsx(Typography, { fontSize: 24, fontWeight: 700, lineHeight: 1, children: t('format.currency', {
14
+ value: feeAmountUsd,
15
+ }) }), status === RouteExecutionStatus.Idle ? (_jsx(Switch, { onChange: onChange })) : null] }), _jsx(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", children: _jsx(Typography, { fontSize: 12, children: "Get 100% coverage for lost tokens." }) })] }));
16
+ };
@@ -0,0 +1,3 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ import type { InsuranceProps } from './types';
3
+ export declare const InsuranceCollapsed: React.FC<PropsWithChildren<InsuranceProps>>;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Collapse } from '@mui/material';
3
+ import { useState } from 'react';
4
+ import { useSwapRoutes } from '../../hooks';
5
+ import { RouteExecutionStatus, useRouteExecutionStore, useSetExecutableRoute, } from '../../stores';
6
+ import { InsuranceCard } from './InsuranceCard';
7
+ export const InsuranceCollapsed = ({ status, insurableRouteId, feeAmountUsd, onChange, children, ...props }) => {
8
+ const [insuredRoute, setInsuredRoute] = useState();
9
+ const setExecutableRoute = useSetExecutableRoute();
10
+ const routeExecution = useRouteExecutionStore((state) => state.routes[insurableRouteId]);
11
+ useSwapRoutes({
12
+ insurableRoute: routeExecution?.route,
13
+ onSettled(data) {
14
+ if (data?.routes?.[0]) {
15
+ setInsuredRoute(data.routes[0]);
16
+ }
17
+ },
18
+ });
19
+ const toggleInsurance = (_, checked) => {
20
+ if (insuredRoute) {
21
+ if (checked) {
22
+ setExecutableRoute(insuredRoute, insurableRouteId);
23
+ }
24
+ onChange?.(checked ? insuredRoute.id : insurableRouteId);
25
+ }
26
+ };
27
+ return (_jsx(Collapse, { timeout: 225, in: insuredRoute?.insurance?.state === 'INSURED', unmountOnExit: true, mountOnEnter: true, appear: status === RouteExecutionStatus.Idle, children: _jsx(InsuranceCard, { feeAmountUsd: feeAmountUsd, status: status, onChange: toggleInsurance, ...props }) }));
28
+ };
@@ -0,0 +1 @@
1
+ export * from './Insurance';
@@ -0,0 +1 @@
1
+ export * from './Insurance';
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps } from '@mui/material';
3
+ import type { RouteExecutionStatus } from '../../stores';
4
+ export interface InsuranceProps extends Omit<BoxProps, 'onChange'> {
5
+ insurableRouteId: string;
6
+ feeAmountUsd?: string;
7
+ status?: RouteExecutionStatus;
8
+ onChange?: (routeId: string) => void;
9
+ }
10
+ export interface InsuranceCardProps {
11
+ feeAmountUsd?: string;
12
+ status?: RouteExecutionStatus;
13
+ onChange?: (_: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
14
+ }
@@ -0,0 +1 @@
1
+ export {};