@lifi/widget 4.0.0 → 4.2.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 (485) hide show
  1. package/dist/esm/App.d.ts +4 -2
  2. package/dist/esm/App.d.ts.map +1 -1
  3. package/dist/esm/App.js +4 -4
  4. package/dist/esm/App.js.map +1 -1
  5. package/dist/esm/AppDefault.js +14 -0
  6. package/dist/esm/AppDefault.js.map +1 -1
  7. package/dist/esm/AppDrawer.d.ts +1 -1
  8. package/dist/esm/AppDrawer.d.ts.map +1 -1
  9. package/dist/esm/AppDrawer.js +5 -6
  10. package/dist/esm/AppDrawer.js.map +1 -1
  11. package/dist/esm/AppDrawerContext.js +2 -2
  12. package/dist/esm/AppDrawerContext.js.map +1 -1
  13. package/dist/esm/components/ActionRow/ActionRow.style.js.map +1 -1
  14. package/dist/esm/components/AmountInput/AmountInput.js +2 -1
  15. package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
  16. package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
  17. package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +4 -2
  18. package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
  19. package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js +1 -1
  20. package/dist/esm/components/AmountInput/AmountInputEndAdornment.style.js.map +1 -1
  21. package/dist/esm/components/AmountInput/PriceFormHelperText.js +4 -2
  22. package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
  23. package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
  24. package/dist/esm/components/AmountInputCard/AmountInputCard.style.js +98 -0
  25. package/dist/esm/components/AmountInputCard/AmountInputCard.style.js.map +1 -0
  26. package/dist/esm/components/AmountInputCard/AmountInputCardPair.js +25 -0
  27. package/dist/esm/components/AmountInputCard/AmountInputCardPair.js.map +1 -0
  28. package/dist/esm/components/AmountInputCard/BalanceDisplay.js +35 -0
  29. package/dist/esm/components/AmountInputCard/BalanceDisplay.js.map +1 -0
  30. package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js +11 -0
  31. package/dist/esm/components/AmountInputCard/BalanceDisplay.style.js.map +1 -0
  32. package/dist/esm/components/AmountInputCard/FiatValueToggle.js +41 -0
  33. package/dist/esm/components/AmountInputCard/FiatValueToggle.js.map +1 -0
  34. package/dist/esm/components/AmountInputCard/PercentageChips.js +80 -0
  35. package/dist/esm/components/AmountInputCard/PercentageChips.js.map +1 -0
  36. package/dist/esm/components/AmountInputCard/PercentageChips.style.js +43 -0
  37. package/dist/esm/components/AmountInputCard/PercentageChips.style.js.map +1 -0
  38. package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js +137 -0
  39. package/dist/esm/components/AmountInputCard/ReceiveAmountCard.js.map +1 -0
  40. package/dist/esm/components/AmountInputCard/SendAmountCard.js +102 -0
  41. package/dist/esm/components/AmountInputCard/SendAmountCard.js.map +1 -0
  42. package/dist/esm/components/AppContainer.js.map +1 -1
  43. package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
  44. package/dist/esm/components/Avatar/Avatar.js +12 -3
  45. package/dist/esm/components/Avatar/Avatar.js.map +1 -1
  46. package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
  47. package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
  48. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +1 -0
  49. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
  50. package/dist/esm/components/BottomSheet/BottomSheet.js +3 -3
  51. package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
  52. package/dist/esm/components/ButtonTertiary.js.map +1 -1
  53. package/dist/esm/components/Card/Card.js.map +1 -1
  54. package/dist/esm/components/Card/CardButton.style.js.map +1 -1
  55. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  56. package/dist/esm/components/Card/CardIconButton.js.map +1 -1
  57. package/dist/esm/components/Card/CardLabel.js.map +1 -1
  58. package/dist/esm/components/Card/CardTitle.js.map +1 -1
  59. package/dist/esm/components/Card/InputCard.js.map +1 -1
  60. package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
  61. package/dist/esm/components/ChainSelect/ChainSelect.style.js.map +1 -1
  62. package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
  63. package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -1
  64. package/dist/esm/components/Chains/ChainList.js.map +1 -1
  65. package/dist/esm/components/Chains/ChainList.style.js.map +1 -1
  66. package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -1
  67. package/dist/esm/components/Chains/VirtualizedChainList.js +2 -1
  68. package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
  69. package/dist/esm/components/ContextMenu.style.js.map +1 -1
  70. package/dist/esm/components/ContractComponent/NFT/NFT.style.js.map +1 -1
  71. package/dist/esm/components/Dialog/Dialog.style.js.map +1 -1
  72. package/dist/esm/components/EmptyListIndicator/EmptyListIndicator.style.js.map +1 -1
  73. package/dist/esm/components/ExecutionStatusCard/StatusIcon.js.map +1 -1
  74. package/dist/esm/components/ExecutionStatusCard/StatusIcon.style.js.map +1 -1
  75. package/dist/esm/components/ExecutionStatusCard/iconKey.js.map +1 -1
  76. package/dist/esm/components/Expansion/Expansion.style.js.map +1 -1
  77. package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -1
  78. package/dist/esm/components/Header/CloseDrawerButton.js +1 -0
  79. package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
  80. package/dist/esm/components/Header/Header.js +7 -10
  81. package/dist/esm/components/Header/Header.js.map +1 -1
  82. package/dist/esm/components/Header/Header.style.js.map +1 -1
  83. package/dist/esm/components/Header/HeaderNavigationTabs.js +39 -0
  84. package/dist/esm/components/Header/HeaderNavigationTabs.js.map +1 -0
  85. package/dist/esm/components/Header/HeaderTabs.js +33 -0
  86. package/dist/esm/components/Header/HeaderTabs.js.map +1 -0
  87. package/dist/esm/components/Header/NavigationHeader.js +7 -5
  88. package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
  89. package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
  90. package/dist/esm/components/Header/WalletMenu.style.js.map +1 -1
  91. package/dist/esm/components/IconCircle/IconCircle.style.js +1 -1
  92. package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -1
  93. package/dist/esm/components/IconTypography.js.map +1 -1
  94. package/dist/esm/components/Input.js.map +1 -1
  95. package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js +99 -0
  96. package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.js.map +1 -0
  97. package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js +52 -0
  98. package/dist/esm/components/LimitOrderSettings/LimitOrderSettings.style.js.map +1 -0
  99. package/dist/esm/components/LimitPriceCard/LimitPriceCard.js +115 -0
  100. package/dist/esm/components/LimitPriceCard/LimitPriceCard.js.map +1 -0
  101. package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js +89 -0
  102. package/dist/esm/components/LimitPriceCard/LimitPriceCard.style.js.map +1 -0
  103. package/dist/esm/components/LimitPriceCard/LimitPricePresets.js +91 -0
  104. package/dist/esm/components/LimitPriceCard/LimitPricePresets.js.map +1 -0
  105. package/dist/esm/components/ListItem/ListItem.js.map +1 -1
  106. package/dist/esm/components/ListItem/ListItemButton.js.map +1 -1
  107. package/dist/esm/components/ListItemButton.js.map +1 -1
  108. package/dist/esm/components/ListItemText.js.map +1 -1
  109. package/dist/esm/components/Menu.js.map +1 -1
  110. package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
  111. package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
  112. package/dist/esm/components/Messages/WarningMessages.js.map +1 -1
  113. package/dist/esm/components/PageContainer.js.map +1 -1
  114. package/dist/esm/components/PoweredBy/PoweredBy.js.map +1 -1
  115. package/dist/esm/components/PoweredBy/PoweredBy.style.js.map +1 -1
  116. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +1 -0
  117. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
  118. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
  119. package/dist/esm/components/RouteCard/RouteDetails.js.map +1 -1
  120. package/dist/esm/components/RouteCard/RouteDetails.style.js +2 -2
  121. package/dist/esm/components/RouteCard/RouteDetails.style.js.map +1 -1
  122. package/dist/esm/components/RouteCard/RouteProviderCard.js +118 -0
  123. package/dist/esm/components/RouteCard/RouteProviderCard.js.map +1 -0
  124. package/dist/esm/components/RouteCard/RouteToken.style.js.map +1 -1
  125. package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -1
  126. package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
  127. package/dist/esm/components/Routes/LimitOrderRoutes.js +34 -0
  128. package/dist/esm/components/Routes/LimitOrderRoutes.js.map +1 -0
  129. package/dist/esm/components/Routes/Routes.js +2 -2
  130. package/dist/esm/components/Routes/Routes.js.map +1 -1
  131. package/dist/esm/components/Routes/RoutesContent.js.map +1 -1
  132. package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
  133. package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
  134. package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
  135. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
  136. package/dist/esm/components/SendToWallet/SendToWalletButton.style.js.map +1 -1
  137. package/dist/esm/components/SettingsListItemButton.js.map +1 -1
  138. package/dist/esm/components/SettingsPanel/SettingsPanel.js +51 -0
  139. package/dist/esm/components/SettingsPanel/SettingsPanel.js.map +1 -0
  140. package/dist/esm/components/SettingsPanel/SettingsPanel.style.js +33 -0
  141. package/dist/esm/components/SettingsPanel/SettingsPanel.style.js.map +1 -0
  142. package/dist/esm/components/SettingsPanel/utils.js +14 -0
  143. package/dist/esm/components/SettingsPanel/utils.js.map +1 -0
  144. package/dist/esm/components/Skeleton/WidgetSkeleton.js +50 -47
  145. package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
  146. package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
  147. package/dist/esm/components/Step/StepActions.js.map +1 -1
  148. package/dist/esm/components/Step/StepActions.style.js.map +1 -1
  149. package/dist/esm/components/StepActions/SentToWalletRow.style.js.map +1 -1
  150. package/dist/esm/components/StepActions/StepActionRow.style.js.map +1 -1
  151. package/dist/esm/components/SwapButton/SwapButton.js +50 -0
  152. package/dist/esm/components/SwapButton/SwapButton.js.map +1 -0
  153. package/dist/esm/components/SwapButton/SwapButton.style.js +24 -0
  154. package/dist/esm/components/SwapButton/SwapButton.style.js.map +1 -0
  155. package/dist/esm/components/Switch.js.map +1 -1
  156. package/dist/esm/components/Tabs/NavigationTabs.js +3 -0
  157. package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
  158. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  159. package/dist/esm/components/Timer/StepStatusTimer.style.js.map +1 -1
  160. package/dist/esm/components/Token/Token.style.js.map +1 -1
  161. package/dist/esm/components/TokenList/PinTokenButton.js.map +1 -1
  162. package/dist/esm/components/TokenList/TokenDetailsSheet.js +4 -4
  163. package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
  164. package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +4 -4
  165. package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
  166. package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
  167. package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
  168. package/dist/esm/components/TokenList/TokenListItem.js +2 -2
  169. package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
  170. package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
  171. package/dist/esm/components/TokenList/useTokenSelect.js +3 -3
  172. package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
  173. package/dist/esm/components/TokenPillButton/TokenPillButton.js +52 -0
  174. package/dist/esm/components/TokenPillButton/TokenPillButton.js.map +1 -0
  175. package/dist/esm/components/TokenPillButton/TokenPillButton.style.js +39 -0
  176. package/dist/esm/components/TokenPillButton/TokenPillButton.style.js.map +1 -0
  177. package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
  178. package/dist/esm/components/TransactionCard/ActiveTransactionCard.js.map +1 -1
  179. package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
  180. package/dist/esm/components/TransactionCard/TransactionCard.style.js.map +1 -1
  181. package/dist/esm/config/version.d.ts +1 -1
  182. package/dist/esm/config/version.js +1 -1
  183. package/dist/esm/config/version.js.map +1 -1
  184. package/dist/esm/hooks/timer/validate.js.map +1 -1
  185. package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
  186. package/dist/esm/hooks/useAvailableChains.js +1 -1
  187. package/dist/esm/hooks/useChainSearch.js +2 -1
  188. package/dist/esm/hooks/useChainSearch.js.map +1 -1
  189. package/dist/esm/hooks/useChains.js +1 -1
  190. package/dist/esm/hooks/useExplorer.js.map +1 -1
  191. package/dist/esm/hooks/useFilteredByTokenBalances.js +1 -1
  192. package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
  193. package/dist/esm/hooks/useFromTokenSufficiency.js.map +1 -1
  194. package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
  195. package/dist/esm/hooks/useLanguages.js +2 -2
  196. package/dist/esm/hooks/useLanguages.js.map +1 -1
  197. package/dist/esm/hooks/useLimitMarketRate.js +24 -0
  198. package/dist/esm/hooks/useLimitMarketRate.js.map +1 -0
  199. package/dist/esm/hooks/useLinkedLimitFields.js +49 -0
  200. package/dist/esm/hooks/useLinkedLimitFields.js.map +1 -0
  201. package/dist/esm/hooks/useRouteExecution.js.map +1 -1
  202. package/dist/esm/hooks/useRouteExecutionMessage.js.map +1 -1
  203. package/dist/esm/hooks/useRouteRequiredAccountConnection.js.map +1 -1
  204. package/dist/esm/hooks/useRoutes.js +23 -6
  205. package/dist/esm/hooks/useRoutes.js.map +1 -1
  206. package/dist/esm/hooks/useSwapOnly.js +2 -4
  207. package/dist/esm/hooks/useSwapOnly.js.map +1 -1
  208. package/dist/esm/hooks/useToAddressRequirements.js +2 -2
  209. package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
  210. package/dist/esm/hooks/useToken.js.map +1 -1
  211. package/dist/esm/hooks/useTokenBalance.js.map +1 -1
  212. package/dist/esm/hooks/useTokenBalances.js.map +1 -1
  213. package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -1
  214. package/dist/esm/hooks/useTokenSearch.js +1 -1
  215. package/dist/esm/hooks/useTokenSearch.js.map +1 -1
  216. package/dist/esm/hooks/useTokens.js +17 -15
  217. package/dist/esm/hooks/useTokens.js.map +1 -1
  218. package/dist/esm/hooks/useTools.js +1 -1
  219. package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
  220. package/dist/esm/hooks/useTransactionHistory.js.map +1 -1
  221. package/dist/esm/hooks/useTransactionList.js.map +1 -1
  222. package/dist/esm/hooks/useWideVariant.js +5 -2
  223. package/dist/esm/hooks/useWideVariant.js.map +1 -1
  224. package/dist/esm/i18n/en.json +25 -0
  225. package/dist/esm/index.d.ts +3 -3
  226. package/dist/esm/pages/ActivitiesPage/ActivitiesPage.js.map +1 -1
  227. package/dist/esm/pages/MainPage/LimitPageContent.js +23 -0
  228. package/dist/esm/pages/MainPage/LimitPageContent.js.map +1 -0
  229. package/dist/esm/pages/MainPage/MainPage.js +19 -22
  230. package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
  231. package/dist/esm/pages/MainPage/MainPageActions.js +28 -0
  232. package/dist/esm/pages/MainPage/MainPageActions.js.map +1 -0
  233. package/dist/esm/pages/MainPage/ReviewButton.js +11 -4
  234. package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
  235. package/dist/esm/pages/RoutePriorityPage.js +48 -0
  236. package/dist/esm/pages/RoutePriorityPage.js.map +1 -0
  237. package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
  238. package/dist/esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
  239. package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
  240. package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +3 -3
  241. package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
  242. package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +3 -3
  243. package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
  244. package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  245. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
  246. package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -2
  247. package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
  248. package/dist/esm/pages/SettingsPage/GasPriceSettings.js +1 -1
  249. package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
  250. package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +12 -27
  251. package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
  252. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
  253. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +3 -3
  254. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
  255. package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js +3 -3
  256. package/dist/esm/pages/SettingsPage/SettingsCard/SettingsAccordian.js.map +1 -1
  257. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js +133 -0
  258. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippagePage.js.map +1 -0
  259. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +14 -72
  260. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
  261. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +26 -14
  262. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
  263. package/dist/esm/pages/SettingsPage/ThemeSettings.js +4 -0
  264. package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
  265. package/dist/esm/pages/TransactionDetailsPage/ContactSupportButton.style.js.map +1 -1
  266. package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
  267. package/dist/esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
  268. package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +3 -3
  269. package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
  270. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +16 -15
  271. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
  272. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.style.js.map +1 -1
  273. package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
  274. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +3 -3
  275. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
  276. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.style.js.map +1 -1
  277. package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js +27 -31
  278. package/dist/esm/pages/TransactionPage/TransactionExecutionContent.js.map +1 -1
  279. package/dist/esm/pages/TransactionPage/TransactionReview.js +4 -1
  280. package/dist/esm/pages/TransactionPage/TransactionReview.js.map +1 -1
  281. package/dist/esm/pages/TransactionPage/utils.js.map +1 -1
  282. package/dist/esm/providers/I18nProvider/I18nProvider.js +1 -1
  283. package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
  284. package/dist/esm/providers/I18nProvider/enResource.d.ts +1 -1
  285. package/dist/esm/providers/I18nProvider/enResource.js +1 -1
  286. package/dist/esm/providers/I18nProvider/i18n.js.map +1 -1
  287. package/dist/esm/providers/I18nProvider/types.d.ts +2 -2
  288. package/dist/esm/providers/QueryClientProvider.js +2 -2
  289. package/dist/esm/providers/QueryClientProvider.js.map +1 -1
  290. package/dist/esm/providers/SDKClientProvider.js +3 -3
  291. package/dist/esm/providers/SDKClientProvider.js.map +1 -1
  292. package/dist/esm/providers/WidgetProvider/WidgetProvider.js +4 -5
  293. package/dist/esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
  294. package/dist/esm/stores/StoreProvider.js +3 -4
  295. package/dist/esm/stores/StoreProvider.js.map +1 -1
  296. package/dist/esm/stores/bookmarks/BookmarkStore.js +3 -3
  297. package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
  298. package/dist/esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
  299. package/dist/esm/stores/chains/ChainOrderStore.js +4 -4
  300. package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
  301. package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
  302. package/dist/esm/stores/form/FormStore.js +1 -1
  303. package/dist/esm/stores/form/FormStore.js.map +1 -1
  304. package/dist/esm/stores/form/URLSearchParamsBuilder.js +14 -3
  305. package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
  306. package/dist/esm/stores/form/createFormStore.js +6 -2
  307. package/dist/esm/stores/form/createFormStore.js.map +1 -1
  308. package/dist/esm/stores/form/getDefaultValuesFromQueryString.js +3 -0
  309. package/dist/esm/stores/form/getDefaultValuesFromQueryString.js.map +1 -1
  310. package/dist/esm/stores/form/types.d.ts +9 -1
  311. package/dist/esm/stores/form/types.d.ts.map +1 -1
  312. package/dist/esm/stores/form/types.js.map +1 -1
  313. package/dist/esm/stores/form/useClearAmountFields.js +1 -0
  314. package/dist/esm/stores/form/useClearAmountFields.js.map +1 -1
  315. package/dist/esm/stores/form/useFieldActions.js.map +1 -1
  316. package/dist/esm/stores/form/useFieldValues.js.map +1 -1
  317. package/dist/esm/stores/form/useFormRef.js.map +1 -1
  318. package/dist/esm/stores/form/useFormStore.js +2 -2
  319. package/dist/esm/stores/form/useFormStore.js.map +1 -1
  320. package/dist/esm/stores/header/useHeaderStore.js +3 -3
  321. package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
  322. package/dist/esm/stores/inputMode/useInputModeStore.js.map +1 -1
  323. package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js +22 -0
  324. package/dist/esm/stores/navigationTabs/useNavigationTabLabel.js.map +1 -0
  325. package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js +64 -0
  326. package/dist/esm/stores/navigationTabs/useNavigationTabsStore.js.map +1 -0
  327. package/dist/esm/stores/navigationTabs/utils.js +122 -0
  328. package/dist/esm/stores/navigationTabs/utils.js.map +1 -0
  329. package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js +3 -3
  330. package/dist/esm/stores/pinnedTokens/PinnedTokensStore.js.map +1 -1
  331. package/dist/esm/stores/pinnedTokens/createPinnedTokensStore.js.map +1 -1
  332. package/dist/esm/stores/routes/RouteExecutionStore.js +3 -3
  333. package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
  334. package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
  335. package/dist/esm/stores/routes/useIntermediateRoutesStore.js.map +1 -1
  336. package/dist/esm/stores/routes/useRouteExecutionIndicator.js.map +1 -1
  337. package/dist/esm/stores/routes/utils.js.map +1 -1
  338. package/dist/esm/stores/settings/SettingsStore.js +3 -3
  339. package/dist/esm/stores/settings/SettingsStore.js.map +1 -1
  340. package/dist/esm/stores/settings/createSettingsStore.js +122 -96
  341. package/dist/esm/stores/settings/createSettingsStore.js.map +1 -1
  342. package/dist/esm/stores/settings/types.d.ts +0 -2
  343. package/dist/esm/stores/settings/types.d.ts.map +1 -1
  344. package/dist/esm/stores/settings/types.js.map +1 -1
  345. package/dist/esm/stores/settings/useSettingsActions.js.map +1 -1
  346. package/dist/esm/themes/createTheme.js.map +1 -1
  347. package/dist/esm/themes/utils.js.map +1 -1
  348. package/dist/esm/types/events.d.ts +10 -1
  349. package/dist/esm/types/events.d.ts.map +1 -1
  350. package/dist/esm/types/events.js +2 -0
  351. package/dist/esm/types/events.js.map +1 -1
  352. package/dist/esm/types/widget.d.ts +28 -2
  353. package/dist/esm/types/widget.d.ts.map +1 -1
  354. package/dist/esm/types/widget.js.map +1 -1
  355. package/dist/esm/utils/compactNumberFormatter.js.map +1 -1
  356. package/dist/esm/utils/converters.js.map +1 -1
  357. package/dist/esm/utils/deepEqual.js.map +1 -1
  358. package/dist/esm/utils/fees.js.map +1 -1
  359. package/dist/esm/utils/format.d.ts +1 -1
  360. package/dist/esm/utils/format.d.ts.map +1 -1
  361. package/dist/esm/utils/format.js +2 -2
  362. package/dist/esm/utils/format.js.map +1 -1
  363. package/dist/esm/utils/getActionMessage.js.map +1 -1
  364. package/dist/esm/utils/getErrorMessage.js.map +1 -1
  365. package/dist/esm/utils/item.js.map +1 -1
  366. package/dist/esm/utils/limitOrder.js +61 -0
  367. package/dist/esm/utils/limitOrder.js.map +1 -0
  368. package/dist/esm/utils/{variant.js → mode.js} +2 -2
  369. package/dist/esm/utils/mode.js.map +1 -0
  370. package/dist/esm/utils/navigationRoutes.d.ts +2 -0
  371. package/dist/esm/utils/navigationRoutes.d.ts.map +1 -1
  372. package/dist/esm/utils/navigationRoutes.js +6 -0
  373. package/dist/esm/utils/navigationRoutes.js.map +1 -1
  374. package/dist/esm/utils/prepareActions.js +1 -1
  375. package/dist/esm/utils/prepareActions.js.map +1 -1
  376. package/dist/esm/utils/timer.js.map +1 -1
  377. package/dist/esm/utils/token.js +1 -1
  378. package/dist/esm/utils/token.js.map +1 -1
  379. package/dist/esm/utils/tokenList.js.map +1 -1
  380. package/package.json +13 -13
  381. package/src/App.tsx +7 -7
  382. package/src/AppDefault.tsx +16 -0
  383. package/src/AppDrawer.tsx +77 -78
  384. package/src/AppDrawerContext.ts +2 -2
  385. package/src/components/AmountInput/AmountInputEndAdornment.style.ts +1 -1
  386. package/src/components/AmountInput/AmountInputEndAdornment.tsx +5 -2
  387. package/src/components/AmountInputCard/AmountInputCard.style.tsx +157 -0
  388. package/src/components/AmountInputCard/AmountInputCardPair.tsx +25 -0
  389. package/src/components/AmountInputCard/BalanceDisplay.style.tsx +9 -0
  390. package/src/components/AmountInputCard/BalanceDisplay.tsx +46 -0
  391. package/src/components/AmountInputCard/FiatValueToggle.tsx +55 -0
  392. package/src/components/AmountInputCard/PercentageChips.style.tsx +60 -0
  393. package/src/components/AmountInputCard/PercentageChips.tsx +100 -0
  394. package/src/components/AmountInputCard/ReceiveAmountCard.tsx +219 -0
  395. package/src/components/AmountInputCard/SendAmountCard.tsx +179 -0
  396. package/src/components/Avatar/Avatar.tsx +8 -3
  397. package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +1 -0
  398. package/src/components/BottomSheet/BottomSheet.tsx +56 -52
  399. package/src/components/Header/CloseDrawerButton.tsx +5 -1
  400. package/src/components/Header/Header.tsx +20 -18
  401. package/src/components/Header/HeaderNavigationTabs.tsx +42 -0
  402. package/src/components/Header/HeaderTabs.tsx +48 -0
  403. package/src/components/Header/NavigationHeader.tsx +11 -8
  404. package/src/components/LimitOrderSettings/LimitOrderSettings.style.tsx +69 -0
  405. package/src/components/LimitOrderSettings/LimitOrderSettings.tsx +124 -0
  406. package/src/components/LimitPriceCard/LimitPriceCard.style.tsx +103 -0
  407. package/src/components/LimitPriceCard/LimitPriceCard.tsx +153 -0
  408. package/src/components/LimitPriceCard/LimitPricePresets.tsx +139 -0
  409. package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +4 -1
  410. package/src/components/RouteCard/RouteProviderCard.tsx +113 -0
  411. package/src/components/Routes/LimitOrderRoutes.tsx +64 -0
  412. package/src/components/Routes/Routes.tsx +3 -2
  413. package/src/components/SettingsPanel/SettingsPanel.style.tsx +41 -0
  414. package/src/components/SettingsPanel/SettingsPanel.tsx +73 -0
  415. package/src/components/SettingsPanel/utils.ts +27 -0
  416. package/src/components/Skeleton/WidgetSkeleton.tsx +1 -1
  417. package/src/components/SwapButton/SwapButton.style.tsx +28 -0
  418. package/src/components/SwapButton/SwapButton.tsx +71 -0
  419. package/src/components/Tabs/NavigationTabs.tsx +3 -0
  420. package/src/components/TokenList/TokenDetailsSheet.tsx +9 -7
  421. package/src/components/TokenList/TokenDetailsSheetContent.tsx +176 -177
  422. package/src/components/TokenList/useTokenSelect.ts +2 -2
  423. package/src/components/TokenPillButton/TokenPillButton.style.tsx +50 -0
  424. package/src/components/TokenPillButton/TokenPillButton.tsx +81 -0
  425. package/src/config/version.ts +1 -1
  426. package/src/hooks/useLimitMarketRate.ts +39 -0
  427. package/src/hooks/useLinkedLimitFields.ts +74 -0
  428. package/src/hooks/useRoutes.ts +45 -4
  429. package/src/hooks/useSwapOnly.ts +2 -5
  430. package/src/hooks/useToAddressRequirements.ts +2 -2
  431. package/src/hooks/useWideVariant.ts +8 -2
  432. package/src/pages/MainPage/LimitPageContent.tsx +18 -0
  433. package/src/pages/MainPage/MainPage.tsx +43 -30
  434. package/src/pages/MainPage/MainPageActions.tsx +35 -0
  435. package/src/pages/MainPage/ReviewButton.tsx +15 -3
  436. package/src/pages/RoutePriorityPage.tsx +55 -0
  437. package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +176 -185
  438. package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +9 -6
  439. package/src/pages/SettingsPage/RoutePrioritySettings.tsx +14 -38
  440. package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +58 -65
  441. package/src/pages/SettingsPage/SettingsCard/SettingsAccordian.tsx +4 -4
  442. package/src/pages/SettingsPage/SlippageSettings/SlippagePage.tsx +176 -0
  443. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +32 -25
  444. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +14 -128
  445. package/src/pages/SettingsPage/ThemeSettings.tsx +4 -0
  446. package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +9 -6
  447. package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +53 -58
  448. package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +24 -21
  449. package/src/pages/TransactionPage/TransactionExecutionContent.tsx +8 -6
  450. package/src/providers/QueryClientProvider.tsx +2 -2
  451. package/src/providers/SDKClientProvider.tsx +3 -7
  452. package/src/providers/WidgetProvider/WidgetProvider.tsx +6 -7
  453. package/src/stores/StoreProvider.tsx +3 -10
  454. package/src/stores/bookmarks/BookmarkStore.tsx +4 -4
  455. package/src/stores/chains/ChainOrderStore.tsx +4 -4
  456. package/src/stores/form/FormStore.tsx +2 -2
  457. package/src/stores/form/URLSearchParamsBuilder.tsx +25 -3
  458. package/src/stores/form/createFormStore.ts +7 -3
  459. package/src/stores/form/getDefaultValuesFromQueryString.ts +11 -0
  460. package/src/stores/form/types.ts +14 -1
  461. package/src/stores/form/useClearAmountFields.ts +1 -0
  462. package/src/stores/form/useFormStore.ts +2 -2
  463. package/src/stores/header/useHeaderStore.tsx +3 -5
  464. package/src/stores/navigationTabs/types.ts +33 -0
  465. package/src/stores/navigationTabs/useNavigationTabLabel.ts +28 -0
  466. package/src/stores/navigationTabs/useNavigationTabsStore.tsx +113 -0
  467. package/src/stores/navigationTabs/utils.ts +196 -0
  468. package/src/stores/pinnedTokens/PinnedTokensStore.tsx +4 -4
  469. package/src/stores/routes/RouteExecutionStore.tsx +4 -4
  470. package/src/stores/settings/SettingsStore.tsx +4 -4
  471. package/src/stores/settings/createSettingsStore.ts +48 -12
  472. package/src/stores/settings/types.ts +1 -16
  473. package/src/types/events.ts +12 -0
  474. package/src/types/widget.ts +40 -1
  475. package/src/utils/format.ts +6 -2
  476. package/src/utils/limitOrder.ts +88 -0
  477. package/src/utils/navigationRoutes.ts +6 -0
  478. package/dist/esm/components/Header/SplitNavigationTabs.js +0 -33
  479. package/dist/esm/components/Header/SplitNavigationTabs.js.map +0 -1
  480. package/dist/esm/stores/settings/useSplitModeStore.js +0 -36
  481. package/dist/esm/stores/settings/useSplitModeStore.js.map +0 -1
  482. package/dist/esm/utils/variant.js.map +0 -1
  483. package/src/components/Header/SplitNavigationTabs.tsx +0 -32
  484. package/src/stores/settings/useSplitModeStore.tsx +0 -58
  485. /package/src/utils/{variant.ts → mode.ts} +0 -0
package/dist/esm/App.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { WidgetProps } from "./types/widget.js";
2
2
  import { WidgetDrawer } from "./AppDrawer.js";
3
- import { ForwardRefExoticComponent, RefAttributes } from "react";
3
+ import { JSX, Ref } from "react";
4
4
 
5
5
  //#region src/App.d.ts
6
- declare const App: ForwardRefExoticComponent<WidgetProps & RefAttributes<WidgetDrawer>>;
6
+ declare const App: (props: WidgetProps & {
7
+ ref?: Ref<WidgetDrawer>;
8
+ }) => JSX.Element;
7
9
  //#endregion
8
10
  export { App };
9
11
  //# sourceMappingURL=App.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","names":[],"sources":["../../src/App.tsx"],"mappings":";;;;;cASa,GAAA,EAAK,yBAAA,CAChB,WAAA,GAAc,aAAA,CAAc,YAAA"}
1
+ {"version":3,"file":"App.d.ts","names":[],"sources":["../../src/App.tsx"],"mappings":";;;;;cASa,GAAA,GACX,KAAA,EAAO,WAAA;EAAgB,GAAA,GAAM,GAAA,CAAI,YAAA;AAAA,MAChC,GAAA,CAAI,OAAA"}
package/dist/esm/App.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import { AppDefault } from "./AppDefault.js";
3
3
  import { AppDrawer } from "./AppDrawer.js";
4
4
  import { AppProvider } from "./AppProvider.js";
5
- import { forwardRef, useMemo } from "react";
5
+ import { useMemo } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
7
  //#region src/App.tsx
8
- const App = forwardRef((props, ref) => {
8
+ const App = (props) => {
9
9
  const config = useMemo(() => {
10
10
  const config = {
11
11
  ...props,
@@ -24,7 +24,7 @@ const App = forwardRef((props, ref) => {
24
24
  config,
25
25
  formRef: props.formRef,
26
26
  children: /* @__PURE__ */ jsx(AppDrawer, {
27
- ref,
27
+ ref: props.ref,
28
28
  elementRef: props.elementRef,
29
29
  config,
30
30
  open: props.open,
@@ -37,7 +37,7 @@ const App = forwardRef((props, ref) => {
37
37
  formRef: props.formRef,
38
38
  children: /* @__PURE__ */ jsx(AppDefault, {})
39
39
  });
40
- });
40
+ };
41
41
  //#endregion
42
42
  export { App };
43
43
 
@@ -1 +1 @@
1
- {"version":3,"file":"App.js","names":[],"sources":["../../src/App.tsx"],"sourcesContent":["'use client'\nimport type { ForwardRefExoticComponent, RefAttributes } from 'react'\nimport { forwardRef, useMemo } from 'react'\nimport { AppDefault } from './AppDefault.js'\nimport type { WidgetDrawer } from './AppDrawer.js'\nimport { AppDrawer } from './AppDrawer.js'\nimport { AppProvider } from './AppProvider.js'\nimport type { WidgetConfig, WidgetProps } from './types/widget.js'\n\nexport const App: ForwardRefExoticComponent<\n WidgetProps & RefAttributes<WidgetDrawer>\n> = forwardRef<WidgetDrawer, WidgetProps>((props, ref) => {\n const config: WidgetConfig = useMemo(() => {\n const config = { ...props, ...props.config }\n if (config.variant === 'drawer') {\n config.theme = {\n ...config.theme,\n container: {\n height: '100%',\n ...config.theme?.container,\n },\n }\n }\n return config\n }, [props])\n\n if (config.variant === 'drawer') {\n return (\n <AppProvider config={config} formRef={props.formRef}>\n <AppDrawer\n ref={ref}\n elementRef={props.elementRef}\n config={config}\n open={props.open}\n onClose={props.onClose}\n >\n <AppDefault />\n </AppDrawer>\n </AppProvider>\n )\n }\n\n return (\n <AppProvider config={config} formRef={props.formRef}>\n <AppDefault />\n </AppProvider>\n )\n})\n"],"mappings":";;;;;;;AASA,MAAa,MAET,YAAuC,OAAO,QAAQ;CACxD,MAAM,SAAuB,cAAc;EACzC,MAAM,SAAS;GAAE,GAAG;GAAO,GAAG,MAAM;EAAO;EAC3C,IAAI,OAAO,YAAY,UACrB,OAAO,QAAQ;GACb,GAAG,OAAO;GACV,WAAW;IACT,QAAQ;IACR,GAAG,OAAO,OAAO;GACnB;EACF;EAEF,OAAO;CACT,GAAG,CAAC,KAAK,CAAC;CAEV,IAAI,OAAO,YAAY,UACrB,OACE,oBAAC,aAAD;EAAqB;EAAQ,SAAS,MAAM;YAC1C,oBAAC,WAAD;GACO;GACL,YAAY,MAAM;GACV;GACR,MAAM,MAAM;GACZ,SAAS,MAAM;aAEf,oBAAC,YAAD,CAAa,CAAA;EACJ,CAAA;CACA,CAAA;CAIjB,OACE,oBAAC,aAAD;EAAqB;EAAQ,SAAS,MAAM;YAC1C,oBAAC,YAAD,CAAa,CAAA;CACF,CAAA;AAEjB,CAAC"}
1
+ {"version":3,"file":"App.js","names":[],"sources":["../../src/App.tsx"],"sourcesContent":["'use client'\nimport type { JSX, Ref } from 'react'\nimport { useMemo } from 'react'\nimport { AppDefault } from './AppDefault.js'\nimport type { WidgetDrawer } from './AppDrawer.js'\nimport { AppDrawer } from './AppDrawer.js'\nimport { AppProvider } from './AppProvider.js'\nimport type { WidgetConfig, WidgetProps } from './types/widget.js'\n\nexport const App = (\n props: WidgetProps & { ref?: Ref<WidgetDrawer> }\n): JSX.Element => {\n const config: WidgetConfig = useMemo(() => {\n const config = { ...props, ...props.config }\n if (config.variant === 'drawer') {\n config.theme = {\n ...config.theme,\n container: {\n height: '100%',\n ...config.theme?.container,\n },\n }\n }\n return config\n }, [props])\n\n if (config.variant === 'drawer') {\n return (\n <AppProvider config={config} formRef={props.formRef}>\n <AppDrawer\n ref={props.ref}\n elementRef={props.elementRef}\n config={config}\n open={props.open}\n onClose={props.onClose}\n >\n <AppDefault />\n </AppDrawer>\n </AppProvider>\n )\n }\n\n return (\n <AppProvider config={config} formRef={props.formRef}>\n <AppDefault />\n </AppProvider>\n )\n}\n"],"mappings":";;;;;;;AASA,MAAa,OACX,UACgB;CAChB,MAAM,SAAuB,cAAc;EACzC,MAAM,SAAS;GAAE,GAAG;GAAO,GAAG,MAAM;EAAO;EAC3C,IAAI,OAAO,YAAY,UACrB,OAAO,QAAQ;GACb,GAAG,OAAO;GACV,WAAW;IACT,QAAQ;IACR,GAAG,OAAO,OAAO;GACnB;EACF;EAEF,OAAO;CACT,GAAG,CAAC,KAAK,CAAC;CAEV,IAAI,OAAO,YAAY,UACrB,OACE,oBAAC,aAAD;EAAqB;EAAQ,SAAS,MAAM;YAC1C,oBAAC,WAAD;GACE,KAAK,MAAM;GACX,YAAY,MAAM;GACV;GACR,MAAM,MAAM;GACZ,SAAS,MAAM;aAEf,oBAAC,YAAD,CAAa,CAAA;EACJ,CAAA;CACA,CAAA;CAIjB,OACE,oBAAC,aAAD;EAAqB;EAAQ,SAAS,MAAM;YAC1C,oBAAC,YAAD,CAAa,CAAA;CACF,CAAA;AAEjB"}
@@ -4,6 +4,7 @@ import { NotFound } from "./components/NotFound.js";
4
4
  import { ActivitiesPage } from "./pages/ActivitiesPage/ActivitiesPage.js";
5
5
  import { LanguagesPage } from "./pages/LanguagesPage.js";
6
6
  import { MainPage } from "./pages/MainPage/MainPage.js";
7
+ import { RoutePriorityPage } from "./pages/RoutePriorityPage.js";
7
8
  import { RoutesPage } from "./pages/RoutesPage/RoutesPage.js";
8
9
  import { SelectChainPage } from "./pages/SelectChainPage/SelectChainPage.js";
9
10
  import { SelectEnabledToolsPage } from "./pages/SelectEnabledToolsPage.js";
@@ -14,6 +15,7 @@ import { RecentWalletsPage } from "./pages/SendToWallet/RecentWalletsPage.js";
14
15
  import { SendToConfiguredWalletPage } from "./pages/SendToWallet/SendToConfiguredWalletPage.js";
15
16
  import { SendToWalletPage } from "./pages/SendToWallet/SendToWalletPage.js";
16
17
  import { SettingsPage } from "./pages/SettingsPage/SettingsPage.js";
18
+ import { SlippagePage } from "./pages/SettingsPage/SlippageSettings/SlippagePage.js";
17
19
  import { TransactionDetailsPage } from "./pages/TransactionDetailsPage/TransactionDetailsPage.js";
18
20
  import { TransactionPage } from "./pages/TransactionPage/TransactionPage.js";
19
21
  import { useState } from "react";
@@ -53,6 +55,16 @@ const settingsLanguagesRoute = createRoute({
53
55
  path: navigationRoutes.languages,
54
56
  component: LanguagesPage
55
57
  });
58
+ const settingsRoutePriorityRoute = createRoute({
59
+ getParentRoute: () => settingsLayoutRoute,
60
+ path: navigationRoutes.routePriority,
61
+ component: RoutePriorityPage
62
+ });
63
+ const settingsSlippageRoute = createRoute({
64
+ getParentRoute: () => settingsLayoutRoute,
65
+ path: navigationRoutes.slippage,
66
+ component: SlippagePage
67
+ });
56
68
  const fromTokenLayoutRoute = createRoute({
57
69
  getParentRoute: () => rootRoute,
58
70
  path: navigationRoutes.fromToken
@@ -179,6 +191,8 @@ const routeTree = rootRoute.addChildren([
179
191
  settingsLayoutRoute.addChildren([
180
192
  settingsIndexRoute,
181
193
  settingsLanguagesRoute,
194
+ settingsRoutePriorityRoute,
195
+ settingsSlippageRoute,
182
196
  settingsBridgesRoute,
183
197
  settingsExchangesRoute
184
198
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"AppDefault.js","names":[],"sources":["../../src/AppDefault.tsx"],"sourcesContent":["import {\n createMemoryHistory,\n createRootRoute,\n createRoute,\n createRouter,\n RouterProvider,\n} from '@tanstack/react-router'\nimport type { JSX } from 'react'\nimport { useState } from 'react'\nimport { AppLayout } from './AppLayout.js'\nimport { NotFound } from './components/NotFound.js'\nimport { ActivitiesPage } from './pages/ActivitiesPage/ActivitiesPage.js'\nimport { LanguagesPage } from './pages/LanguagesPage.js'\nimport { MainPage } from './pages/MainPage/MainPage.js'\nimport { RoutesPage } from './pages/RoutesPage/RoutesPage.js'\nimport { SelectChainPage } from './pages/SelectChainPage/SelectChainPage.js'\nimport { SelectEnabledToolsPage } from './pages/SelectEnabledToolsPage.js'\nimport { SelectTokenPage } from './pages/SelectTokenPage/SelectTokenPage.js'\nimport { BookmarksPage } from './pages/SendToWallet/BookmarksPage.js'\nimport { ConnectedWalletsPage } from './pages/SendToWallet/ConnectedWalletsPage.js'\nimport { RecentWalletsPage } from './pages/SendToWallet/RecentWalletsPage.js'\nimport { SendToConfiguredWalletPage } from './pages/SendToWallet/SendToConfiguredWalletPage.js'\nimport { SendToWalletPage } from './pages/SendToWallet/SendToWalletPage.js'\nimport { SettingsPage } from './pages/SettingsPage/SettingsPage.js'\nimport { TransactionDetailsPage } from './pages/TransactionDetailsPage/TransactionDetailsPage.js'\nimport { TransactionPage } from './pages/TransactionPage/TransactionPage.js'\nimport { navigationRoutes } from './utils/navigationRoutes.js'\n\nconst rootRoute = createRootRoute({\n component: AppLayout,\n notFoundComponent: NotFound,\n})\n\nconst indexRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.home,\n component: MainPage,\n})\n\nconst settingsLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.settings,\n})\n\nconst settingsIndexRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: '/',\n component: SettingsPage,\n})\n\nconst settingsBridgesRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.bridges,\n component: () => <SelectEnabledToolsPage type=\"Bridges\" />,\n})\n\nconst settingsExchangesRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.exchanges,\n component: () => <SelectEnabledToolsPage type=\"Exchanges\" />,\n})\n\nconst settingsLanguagesRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.languages,\n component: LanguagesPage,\n})\n\nconst fromTokenLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.fromToken,\n})\n\nconst fromTokenIndexRoute = createRoute({\n getParentRoute: () => fromTokenLayoutRoute,\n path: '/',\n component: () => <SelectTokenPage formType=\"from\" />,\n})\n\nconst fromTokenFromChainRoute = createRoute({\n getParentRoute: () => fromTokenLayoutRoute,\n path: navigationRoutes.fromChain,\n component: () => <SelectChainPage formType=\"from\" />,\n})\n\nconst toTokenLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.toToken,\n})\n\nconst toTokenIndexRoute = createRoute({\n getParentRoute: () => toTokenLayoutRoute,\n path: '/',\n component: () => <SelectTokenPage formType=\"to\" />,\n})\n\nconst toTokenToChainRoute = createRoute({\n getParentRoute: () => toTokenLayoutRoute,\n path: navigationRoutes.toChain,\n component: () => <SelectChainPage formType=\"to\" />,\n})\n\nconst toTokenNativeRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.toTokenNative,\n component: () => <SelectChainPage formType=\"to\" selectNativeToken />,\n})\n\nconst routesLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.routes,\n})\n\nconst routesIndexRoute = createRoute({\n getParentRoute: () => routesLayoutRoute,\n path: '/',\n component: RoutesPage,\n})\n\nconst routesTransactionExecutionRoute = createRoute({\n getParentRoute: () => routesLayoutRoute,\n path: navigationRoutes.transactionExecution,\n})\n\nconst routesTransactionExecutionIndexRoute = createRoute({\n getParentRoute: () => routesTransactionExecutionRoute,\n path: '/',\n component: TransactionPage,\n})\n\nconst routesTransactionExecutionDetailsRoute = createRoute({\n getParentRoute: () => routesTransactionExecutionRoute,\n path: navigationRoutes.transactionDetails,\n component: TransactionDetailsPage,\n})\n\nconst activitiesLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.activities,\n})\n\nconst activitiesIndexRoute = createRoute({\n getParentRoute: () => activitiesLayoutRoute,\n path: '/',\n component: ActivitiesPage,\n})\n\nconst activitiesDetailsRoute = createRoute({\n getParentRoute: () => activitiesLayoutRoute,\n path: navigationRoutes.transactionDetails,\n component: TransactionDetailsPage,\n})\n\nconst activitiesTransactionExecutionRoute = createRoute({\n getParentRoute: () => activitiesLayoutRoute,\n path: navigationRoutes.transactionExecution,\n component: TransactionPage,\n})\n\nconst sendToWalletLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.sendToWallet,\n})\n\nconst sendToWalletIndexRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: '/',\n component: SendToWalletPage,\n})\n\nconst sendToWalletBookmarksRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: navigationRoutes.bookmarks,\n component: BookmarksPage,\n})\n\nconst sendToWalletRecentWalletsRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: navigationRoutes.recentWallets,\n component: RecentWalletsPage,\n})\n\nconst sendToWalletConnectedWalletsRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: navigationRoutes.connectedWallets,\n component: ConnectedWalletsPage,\n})\n\nconst configuredWalletsRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.configuredWallets,\n component: SendToConfiguredWalletPage,\n})\n\nconst transactionExecutionLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.transactionExecution,\n})\n\nconst transactionExecutionIndexRoute = createRoute({\n getParentRoute: () => transactionExecutionLayoutRoute,\n path: '/',\n component: TransactionPage,\n})\n\nconst transactionExecutionDetailsRoute = createRoute({\n getParentRoute: () => transactionExecutionLayoutRoute,\n path: navigationRoutes.transactionDetails,\n component: TransactionDetailsPage,\n})\n\nconst routeTree = rootRoute.addChildren([\n indexRoute,\n settingsLayoutRoute.addChildren([\n settingsIndexRoute,\n settingsLanguagesRoute,\n settingsBridgesRoute,\n settingsExchangesRoute,\n ]),\n fromTokenLayoutRoute.addChildren([\n fromTokenIndexRoute,\n fromTokenFromChainRoute,\n ]),\n toTokenLayoutRoute.addChildren([toTokenIndexRoute, toTokenToChainRoute]),\n toTokenNativeRoute,\n routesLayoutRoute.addChildren([\n routesIndexRoute,\n routesTransactionExecutionRoute.addChildren([\n routesTransactionExecutionIndexRoute,\n routesTransactionExecutionDetailsRoute,\n ]),\n ]),\n transactionExecutionLayoutRoute.addChildren([\n transactionExecutionIndexRoute,\n transactionExecutionDetailsRoute,\n ]),\n activitiesLayoutRoute.addChildren([\n activitiesIndexRoute,\n activitiesDetailsRoute,\n activitiesTransactionExecutionRoute,\n ]),\n sendToWalletLayoutRoute.addChildren([\n sendToWalletIndexRoute,\n sendToWalletBookmarksRoute,\n sendToWalletRecentWalletsRoute,\n sendToWalletConnectedWalletsRoute,\n ]),\n configuredWalletsRoute,\n])\n\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: ReturnType<typeof createRouter>\n }\n}\n\nexport const AppDefault = (): JSX.Element => {\n const [router] = useState(() =>\n createRouter({\n routeTree,\n history: createMemoryHistory({ initialEntries: ['/'] }),\n defaultPreload: 'intent',\n })\n )\n return <RouterProvider router={router} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,YAAY,gBAAgB;CAChC,WAAW;CACX,mBAAmB;AACrB,CAAC;AAED,MAAM,aAAa,YAAY;CAC7B,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,WAAW;AACb,CAAC;AAED,MAAM,sBAAsB,YAAY;CACtC,sBAAsB;CACtB,MAAM,iBAAiB;AACzB,CAAC;AAED,MAAM,qBAAqB,YAAY;CACrC,sBAAsB;CACtB,MAAM;CACN,WAAW;AACb,CAAC;AAED,MAAM,uBAAuB,YAAY;CACvC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,iBAAiB,oBAAC,wBAAD,EAAwB,MAAK,UAAW,CAAA;AAC3D,CAAC;AAED,MAAM,yBAAyB,YAAY;CACzC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,iBAAiB,oBAAC,wBAAD,EAAwB,MAAK,YAAa,CAAA;AAC7D,CAAC;AAED,MAAM,yBAAyB,YAAY;CACzC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,WAAW;AACb,CAAC;AAED,MAAM,uBAAuB,YAAY;CACvC,sBAAsB;CACtB,MAAM,iBAAiB;AACzB,CAAC;AAED,MAAM,sBAAsB,YAAY;CACtC,sBAAsB;CACtB,MAAM;CACN,iBAAiB,oBAAC,iBAAD,EAAiB,UAAS,OAAQ,CAAA;AACrD,CAAC;AAED,MAAM,0BAA0B,YAAY;CAC1C,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,iBAAiB,oBAAC,iBAAD,EAAiB,UAAS,OAAQ,CAAA;AACrD,CAAC;AA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AA;AAC1C"}
1
+ {"version":3,"file":"AppDefault.js","names":[],"sources":["../../src/AppDefault.tsx"],"sourcesContent":["import {\n createMemoryHistory,\n createRootRoute,\n createRoute,\n createRouter,\n RouterProvider,\n} from '@tanstack/react-router'\nimport type { JSX } from 'react'\nimport { useState } from 'react'\nimport { AppLayout } from './AppLayout.js'\nimport { NotFound } from './components/NotFound.js'\nimport { ActivitiesPage } from './pages/ActivitiesPage/ActivitiesPage.js'\nimport { LanguagesPage } from './pages/LanguagesPage.js'\nimport { MainPage } from './pages/MainPage/MainPage.js'\nimport { RoutePriorityPage } from './pages/RoutePriorityPage.js'\nimport { RoutesPage } from './pages/RoutesPage/RoutesPage.js'\nimport { SelectChainPage } from './pages/SelectChainPage/SelectChainPage.js'\nimport { SelectEnabledToolsPage } from './pages/SelectEnabledToolsPage.js'\nimport { SelectTokenPage } from './pages/SelectTokenPage/SelectTokenPage.js'\nimport { BookmarksPage } from './pages/SendToWallet/BookmarksPage.js'\nimport { ConnectedWalletsPage } from './pages/SendToWallet/ConnectedWalletsPage.js'\nimport { RecentWalletsPage } from './pages/SendToWallet/RecentWalletsPage.js'\nimport { SendToConfiguredWalletPage } from './pages/SendToWallet/SendToConfiguredWalletPage.js'\nimport { SendToWalletPage } from './pages/SendToWallet/SendToWalletPage.js'\nimport { SettingsPage } from './pages/SettingsPage/SettingsPage.js'\nimport { SlippagePage } from './pages/SettingsPage/SlippageSettings/SlippagePage.js'\nimport { TransactionDetailsPage } from './pages/TransactionDetailsPage/TransactionDetailsPage.js'\nimport { TransactionPage } from './pages/TransactionPage/TransactionPage.js'\nimport { navigationRoutes } from './utils/navigationRoutes.js'\n\nconst rootRoute = createRootRoute({\n component: AppLayout,\n notFoundComponent: NotFound,\n})\n\nconst indexRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.home,\n component: MainPage,\n})\n\nconst settingsLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.settings,\n})\n\nconst settingsIndexRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: '/',\n component: SettingsPage,\n})\n\nconst settingsBridgesRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.bridges,\n component: () => <SelectEnabledToolsPage type=\"Bridges\" />,\n})\n\nconst settingsExchangesRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.exchanges,\n component: () => <SelectEnabledToolsPage type=\"Exchanges\" />,\n})\n\nconst settingsLanguagesRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.languages,\n component: LanguagesPage,\n})\n\nconst settingsRoutePriorityRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.routePriority,\n component: RoutePriorityPage,\n})\n\nconst settingsSlippageRoute = createRoute({\n getParentRoute: () => settingsLayoutRoute,\n path: navigationRoutes.slippage,\n component: SlippagePage,\n})\n\nconst fromTokenLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.fromToken,\n})\n\nconst fromTokenIndexRoute = createRoute({\n getParentRoute: () => fromTokenLayoutRoute,\n path: '/',\n component: () => <SelectTokenPage formType=\"from\" />,\n})\n\nconst fromTokenFromChainRoute = createRoute({\n getParentRoute: () => fromTokenLayoutRoute,\n path: navigationRoutes.fromChain,\n component: () => <SelectChainPage formType=\"from\" />,\n})\n\nconst toTokenLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.toToken,\n})\n\nconst toTokenIndexRoute = createRoute({\n getParentRoute: () => toTokenLayoutRoute,\n path: '/',\n component: () => <SelectTokenPage formType=\"to\" />,\n})\n\nconst toTokenToChainRoute = createRoute({\n getParentRoute: () => toTokenLayoutRoute,\n path: navigationRoutes.toChain,\n component: () => <SelectChainPage formType=\"to\" />,\n})\n\nconst toTokenNativeRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.toTokenNative,\n component: () => <SelectChainPage formType=\"to\" selectNativeToken />,\n})\n\nconst routesLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.routes,\n})\n\nconst routesIndexRoute = createRoute({\n getParentRoute: () => routesLayoutRoute,\n path: '/',\n component: RoutesPage,\n})\n\nconst routesTransactionExecutionRoute = createRoute({\n getParentRoute: () => routesLayoutRoute,\n path: navigationRoutes.transactionExecution,\n})\n\nconst routesTransactionExecutionIndexRoute = createRoute({\n getParentRoute: () => routesTransactionExecutionRoute,\n path: '/',\n component: TransactionPage,\n})\n\nconst routesTransactionExecutionDetailsRoute = createRoute({\n getParentRoute: () => routesTransactionExecutionRoute,\n path: navigationRoutes.transactionDetails,\n component: TransactionDetailsPage,\n})\n\nconst activitiesLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.activities,\n})\n\nconst activitiesIndexRoute = createRoute({\n getParentRoute: () => activitiesLayoutRoute,\n path: '/',\n component: ActivitiesPage,\n})\n\nconst activitiesDetailsRoute = createRoute({\n getParentRoute: () => activitiesLayoutRoute,\n path: navigationRoutes.transactionDetails,\n component: TransactionDetailsPage,\n})\n\nconst activitiesTransactionExecutionRoute = createRoute({\n getParentRoute: () => activitiesLayoutRoute,\n path: navigationRoutes.transactionExecution,\n component: TransactionPage,\n})\n\nconst sendToWalletLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.sendToWallet,\n})\n\nconst sendToWalletIndexRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: '/',\n component: SendToWalletPage,\n})\n\nconst sendToWalletBookmarksRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: navigationRoutes.bookmarks,\n component: BookmarksPage,\n})\n\nconst sendToWalletRecentWalletsRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: navigationRoutes.recentWallets,\n component: RecentWalletsPage,\n})\n\nconst sendToWalletConnectedWalletsRoute = createRoute({\n getParentRoute: () => sendToWalletLayoutRoute,\n path: navigationRoutes.connectedWallets,\n component: ConnectedWalletsPage,\n})\n\nconst configuredWalletsRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.configuredWallets,\n component: SendToConfiguredWalletPage,\n})\n\nconst transactionExecutionLayoutRoute = createRoute({\n getParentRoute: () => rootRoute,\n path: navigationRoutes.transactionExecution,\n})\n\nconst transactionExecutionIndexRoute = createRoute({\n getParentRoute: () => transactionExecutionLayoutRoute,\n path: '/',\n component: TransactionPage,\n})\n\nconst transactionExecutionDetailsRoute = createRoute({\n getParentRoute: () => transactionExecutionLayoutRoute,\n path: navigationRoutes.transactionDetails,\n component: TransactionDetailsPage,\n})\n\nconst routeTree = rootRoute.addChildren([\n indexRoute,\n settingsLayoutRoute.addChildren([\n settingsIndexRoute,\n settingsLanguagesRoute,\n settingsRoutePriorityRoute,\n settingsSlippageRoute,\n settingsBridgesRoute,\n settingsExchangesRoute,\n ]),\n fromTokenLayoutRoute.addChildren([\n fromTokenIndexRoute,\n fromTokenFromChainRoute,\n ]),\n toTokenLayoutRoute.addChildren([toTokenIndexRoute, toTokenToChainRoute]),\n toTokenNativeRoute,\n routesLayoutRoute.addChildren([\n routesIndexRoute,\n routesTransactionExecutionRoute.addChildren([\n routesTransactionExecutionIndexRoute,\n routesTransactionExecutionDetailsRoute,\n ]),\n ]),\n transactionExecutionLayoutRoute.addChildren([\n transactionExecutionIndexRoute,\n transactionExecutionDetailsRoute,\n ]),\n activitiesLayoutRoute.addChildren([\n activitiesIndexRoute,\n activitiesDetailsRoute,\n activitiesTransactionExecutionRoute,\n ]),\n sendToWalletLayoutRoute.addChildren([\n sendToWalletIndexRoute,\n sendToWalletBookmarksRoute,\n sendToWalletRecentWalletsRoute,\n sendToWalletConnectedWalletsRoute,\n ]),\n configuredWalletsRoute,\n])\n\ndeclare module '@tanstack/react-router' {\n interface Register {\n router: ReturnType<typeof createRouter>\n }\n}\n\nexport const AppDefault = (): JSX.Element => {\n const [router] = useState(() =>\n createRouter({\n routeTree,\n history: createMemoryHistory({ initialEntries: ['/'] }),\n defaultPreload: 'intent',\n })\n )\n return <RouterProvider router={router} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,YAAY,gBAAgB;CAChC,WAAW;CACX,mBAAmB;AACrB,CAAC;AAED,MAAM,aAAa,YAAY;CAC7B,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,WAAW;AACb,CAAC;AAED,MAAM,sBAAsB,YAAY;CACtC,sBAAsB;CACtB,MAAM,iBAAiB;AACzB,CAAC;AAED,MAAM,qBAAqB,YAAY;CACrC,sBAAsB;CACtB,MAAM;CACN,WAAW;AACb,CAAC;AAED,MAAM,uBAAuB,YAAY;CACvC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,iBAAiB,oBAAC,wBAAD,EAAwB,MAAK,UAAW,CAAA;AAC3D,CAAC;AAED,MAAM,yBAAyB,YAAY;CACzC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,iBAAiB,oBAAC,wBAAD,EAAwB,MAAK,YAAa,CAAA;AAC7D,CAAC;AAED,MAAM,yBAAyB,YAAY;CACzC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,WAAW;AACb,CAAC;AAED,MAAM,6BAA6B,YAAY;CAC7C,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,WAAW;AACb,CAAC;AAED,MAAM,wBAAwB,YAAY;CACxC,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,WAAW;AACb,CAAC;AAED,MAAM,uBAAuB,YAAY;CACvC,sBAAsB;CACtB,MAAM,iBAAiB;AACzB,CAAC;AAED,MAAM,sBAAsB,YAAY;CACtC,sBAAsB;CACtB,MAAM;CACN,iBAAiB,oBAAC,iBAAD,EAAiB,UAAS,OAAQ,CAAA;AACrD,CAAC;AAED,MAAM,0BAA0B,YAAY;CAC1C,sBAAsB;CACtB,MAAM,iBAAiB;CACvB,iBAAiB,oBAAC,iBAAD,EAAiB,UAAS,OAAQ,CAAA;AACrD,CAAC;AAED,MAAM,q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AA;AAC1C"}
@@ -1,4 +1,4 @@
1
- import { ForwardRefExoticComponent, PropsWithChildren, RefAttributes } from "react";
1
+ import { JSX, PropsWithChildren, Ref } from "react";
2
2
 
3
3
  //#region src/AppDrawer.d.ts
4
4
  interface WidgetDrawer {
@@ -1 +1 @@
1
- {"version":3,"file":"AppDrawer.d.ts","names":[],"sources":["../../src/AppDrawer.tsx"],"mappings":";;;UAkBiB,YAAA;EACf,MAAA;EACA,YAAA;EACA,UAAA;EACA,WAAA;AAAA"}
1
+ {"version":3,"file":"AppDrawer.d.ts","names":[],"sources":["../../src/AppDrawer.tsx"],"mappings":";;;UAaiB,YAAA;EACf,MAAA;EACA,YAAA;EACA,UAAA;EACA,WAAA;AAAA"}
@@ -1,9 +1,9 @@
1
1
  import { DrawerContext } from "./AppDrawerContext.js";
2
- import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
2
+ import { useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
3
3
  import { Drawer } from "@mui/material";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  //#region src/AppDrawer.tsx
6
- const AppDrawer = forwardRef(({ elementRef, open, onClose, children }, ref) => {
6
+ const AppDrawer = ({ elementRef, open, onClose, children, ref }) => {
7
7
  const openRef = useRef(Boolean(open));
8
8
  const [drawerOpen, setDrawerOpen] = useState(Boolean(open));
9
9
  const toggleDrawer = useCallback(() => {
@@ -32,9 +32,8 @@ const AppDrawer = forwardRef(({ elementRef, open, onClose, children }, ref) => {
32
32
  openDrawer,
33
33
  toggleDrawer
34
34
  ]);
35
- const drawerContext = useMemo(() => ({ closeDrawer }), [closeDrawer]);
36
- return /* @__PURE__ */ jsx(DrawerContext.Provider, {
37
- value: drawerContext,
35
+ return /* @__PURE__ */ jsx(DrawerContext, {
36
+ value: useMemo(() => ({ closeDrawer }), [closeDrawer]),
38
37
  children: /* @__PURE__ */ jsx(Drawer, {
39
38
  ref: elementRef,
40
39
  anchor: "right",
@@ -56,7 +55,7 @@ const AppDrawer = forwardRef(({ elementRef, open, onClose, children }, ref) => {
56
55
  children
57
56
  })
58
57
  });
59
- });
58
+ };
60
59
  //#endregion
61
60
  export { AppDrawer };
62
61
 
@@ -1 +1 @@
1
- {"version":3,"file":"AppDrawer.js","names":[],"sources":["../../src/AppDrawer.tsx"],"sourcesContent":["import { Drawer } from '@mui/material'\nimport type {\n ForwardRefExoticComponent,\n PropsWithChildren,\n RefAttributes,\n} from 'react'\nimport {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport type { WidgetDrawerContext } from './AppDrawerContext.js'\nimport { DrawerContext } from './AppDrawerContext.js'\nimport type { WidgetDrawerProps } from './types/widget.js'\n\nexport interface WidgetDrawer {\n isOpen(): void\n toggleDrawer(): void\n openDrawer(): void\n closeDrawer(): void\n}\n\nexport const AppDrawer: ForwardRefExoticComponent<\n PropsWithChildren<WidgetDrawerProps> & RefAttributes<WidgetDrawer>\n> = forwardRef<WidgetDrawer, PropsWithChildren<WidgetDrawerProps>>(\n ({ elementRef, open, onClose, children }, ref) => {\n const openRef = useRef(Boolean(open))\n const [drawerOpen, setDrawerOpen] = useState(Boolean(open))\n\n const toggleDrawer = useCallback(() => {\n setDrawerOpen((open) => {\n openRef.current = !open\n return openRef.current\n })\n if (!openRef.current) {\n onClose?.()\n }\n }, [onClose])\n\n const openDrawer = useCallback(() => {\n setDrawerOpen(true)\n openRef.current = true\n }, [])\n\n const closeDrawer = useCallback(() => {\n setDrawerOpen(false)\n openRef.current = false\n onClose?.()\n }, [onClose])\n\n useImperativeHandle(\n ref,\n () => ({\n isOpen: () => openRef.current,\n toggleDrawer,\n openDrawer,\n closeDrawer,\n }),\n [closeDrawer, openDrawer, toggleDrawer]\n )\n\n const drawerContext: WidgetDrawerContext = useMemo(\n () => ({\n closeDrawer,\n }),\n [closeDrawer]\n )\n\n return (\n <DrawerContext.Provider value={drawerContext}>\n <Drawer\n ref={elementRef}\n anchor=\"right\"\n open={drawerOpen}\n onClose={closeDrawer}\n slotProps={{\n paper: {\n sx: (theme) => ({\n background: theme.vars.palette.background.default,\n width: theme?.container?.width ?? '100%',\n minWidth:\n theme?.container?.minWidth ?? theme.breakpoints.values.xs,\n maxWidth:\n theme?.container?.maxWidth ?? theme.breakpoints.values.sm,\n }),\n },\n backdrop: {\n sx: {\n backgroundColor: 'rgb(0 0 0 / 48%)',\n backdropFilter: 'blur(3px)',\n },\n },\n }}\n keepMounted\n >\n {children}\n </Drawer>\n </DrawerContext.Provider>\n )\n }\n)\n"],"mappings":";;;;;AAyBA,MAAa,YAET,YACD,EAAE,YAAY,MAAM,SAAS,YAAY,QAAQ;CAChD,MAAM,UAAU,OAAO,QAAQ,IAAI,CAAC;CACpC,MAAM,CAAC,YAAY,iBAAiB,SAAS,QAAQ,IAAI,CAAC;CAE1D,MAAM,eAAe,kBAAkB;EACrC,eAAe,SAAS;GACtB,QAAQ,UAAU,CAAC;GACnB,OAAO,QAAQ;EACjB,CAAC;EACD,IAAI,CAAC,QAAQ,SACX,UAAU;CAEd,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,aAAa,kBAAkB;EACnC,cAAc,IAAI;EAClB,QAAQ,UAAU;CACpB,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,kBAAkB;EACpC,cAAc,KAAK;EACnB,QAAQ,UAAU;EAClB,UAAU;CACZ,GAAG,CAAC,OAAO,CAAC;CAEZ,oBACE,YACO;EACL,cAAc,QAAQ;EACtB;EACA;EACA;CACF,IACA;EAAC;EAAa;EAAY;CAAY,CACxC;CAEA,MAAM,gBAAqC,eAClC,EACL,YACF,IACA,CAAC,WAAW,CACd;CAEA,OACE,oBAAC,cAAc,UAAf;EAAwB,OAAO;YAC7B,oBAAC,QAAD;GACE,KAAK;GACL,QAAO;GACP,MAAM;GACN,SAAS;GACT,WAAW;IACT,OAAO,EACL,KAAK,WAAW;KACd,YAAY,MAAM,KAAK,QAAQ,WAAW;KAC1C,OAAO,OAAO,WAAW,SAAS;KAClC,UACE,OAAO,WAAW,YAAY,MAAM,YAAY,OAAO;KACzD,UACE,OAAO,WAAW,YAAY,MAAM,YAAY,OAAO;IAC3D,GACF;IACA,UAAU,EACR,IAAI;KACF,iBAAiB;KACjB,gBAAgB;IAClB,EACF;GACF;GACA,aAAA;GAEC;EACK,CAAA;CACc,CAAA;AAE5B,CACF"}
1
+ {"version":3,"file":"AppDrawer.js","names":[],"sources":["../../src/AppDrawer.tsx"],"sourcesContent":["import { Drawer } from '@mui/material'\nimport type { JSX, PropsWithChildren, Ref } from 'react'\nimport {\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport type { WidgetDrawerContext } from './AppDrawerContext.js'\nimport { DrawerContext } from './AppDrawerContext.js'\nimport type { WidgetDrawerProps } from './types/widget.js'\n\nexport interface WidgetDrawer {\n isOpen(): void\n toggleDrawer(): void\n openDrawer(): void\n closeDrawer(): void\n}\n\nexport const AppDrawer = ({\n elementRef,\n open,\n onClose,\n children,\n ref,\n}: PropsWithChildren<WidgetDrawerProps> & {\n ref?: Ref<WidgetDrawer>\n}): JSX.Element => {\n const openRef = useRef(Boolean(open))\n const [drawerOpen, setDrawerOpen] = useState(Boolean(open))\n\n const toggleDrawer = useCallback(() => {\n setDrawerOpen((open) => {\n openRef.current = !open\n return openRef.current\n })\n if (!openRef.current) {\n onClose?.()\n }\n }, [onClose])\n\n const openDrawer = useCallback(() => {\n setDrawerOpen(true)\n openRef.current = true\n }, [])\n\n const closeDrawer = useCallback(() => {\n setDrawerOpen(false)\n openRef.current = false\n onClose?.()\n }, [onClose])\n\n useImperativeHandle(\n ref,\n () => ({\n isOpen: () => openRef.current,\n toggleDrawer,\n openDrawer,\n closeDrawer,\n }),\n [closeDrawer, openDrawer, toggleDrawer]\n )\n\n const drawerContext: WidgetDrawerContext = useMemo(\n () => ({\n closeDrawer,\n }),\n [closeDrawer]\n )\n\n return (\n <DrawerContext value={drawerContext}>\n <Drawer\n ref={elementRef}\n anchor=\"right\"\n open={drawerOpen}\n onClose={closeDrawer}\n slotProps={{\n paper: {\n sx: (theme) => ({\n background: theme.vars.palette.background.default,\n width: theme?.container?.width ?? '100%',\n minWidth:\n theme?.container?.minWidth ?? theme.breakpoints.values.xs,\n maxWidth:\n theme?.container?.maxWidth ?? theme.breakpoints.values.sm,\n }),\n },\n backdrop: {\n sx: {\n backgroundColor: 'rgb(0 0 0 / 48%)',\n backdropFilter: 'blur(3px)',\n },\n },\n }}\n keepMounted\n >\n {children}\n </Drawer>\n </DrawerContext>\n )\n}\n"],"mappings":";;;;;AAoBA,MAAa,aAAa,EACxB,YACA,MACA,SACA,UACA,UAGiB;CACjB,MAAM,UAAU,OAAO,QAAQ,IAAI,CAAC;CACpC,MAAM,CAAC,YAAY,iBAAiB,SAAS,QAAQ,IAAI,CAAC;CAE1D,MAAM,eAAe,kBAAkB;EACrC,eAAe,SAAS;GACtB,QAAQ,UAAU,CAAC;GACnB,OAAO,QAAQ;EACjB,CAAC;EACD,IAAI,CAAC,QAAQ,SACX,UAAU;CAEd,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,aAAa,kBAAkB;EACnC,cAAc,IAAI;EAClB,QAAQ,UAAU;CACpB,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,kBAAkB;EACpC,cAAc,KAAK;EACnB,QAAQ,UAAU;EAClB,UAAU;CACZ,GAAG,CAAC,OAAO,CAAC;CAEZ,oBACE,YACO;EACL,cAAc,QAAQ;EACtB;EACA;EACA;CACF,IACA;EAAC;EAAa;EAAY;CAAY,CACxC;CASA,OACE,oBAAC,eAAD;EAAe,OAR0B,eAClC,EACL,YACF,IACA,CAAC,WAAW,CAIsB;YAChC,oBAAC,QAAD;GACE,KAAK;GACL,QAAO;GACP,MAAM;GACN,SAAS;GACT,WAAW;IACT,OAAO,EACL,KAAK,WAAW;KACd,YAAY,MAAM,KAAK,QAAQ,WAAW;KAC1C,OAAO,OAAO,WAAW,SAAS;KAClC,UACE,OAAO,WAAW,YAAY,MAAM,YAAY,OAAO;KACzD,UACE,OAAO,WAAW,YAAY,MAAM,YAAY,OAAO;IAC3D,GACF;IACA,UAAU,EACR,IAAI;KACF,iBAAiB;KACjB,gBAAgB;IAClB,EACF;GACF;GACA,aAAA;GAEC;EACK,CAAA;CACK,CAAA;AAEnB"}
@@ -1,7 +1,7 @@
1
- import { createContext, useContext } from "react";
1
+ import { createContext, use } from "react";
2
2
  //#region src/AppDrawerContext.ts
3
3
  const DrawerContext = createContext({});
4
- const useDrawer = () => useContext(DrawerContext);
4
+ const useDrawer = () => use(DrawerContext);
5
5
  //#endregion
6
6
  export { DrawerContext, useDrawer };
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"AppDrawerContext.js","names":[],"sources":["../../src/AppDrawerContext.ts"],"sourcesContent":["import { type Context, createContext, useContext } from 'react'\n\nexport interface WidgetDrawerContext {\n closeDrawer?(): void\n}\n\nexport const DrawerContext: Context<WidgetDrawerContext> =\n createContext<WidgetDrawerContext>({})\n\nexport const useDrawer = (): WidgetDrawerContext => useContext(DrawerContext)\n"],"mappings":";;AAMA,MAAa,gBACX,cAAmC,CAAC,CAAC;AAEvC,MAAa,kBAAuC,WAAW,aAAa"}
1
+ {"version":3,"file":"AppDrawerContext.js","names":[],"sources":["../../src/AppDrawerContext.ts"],"sourcesContent":["import { type Context, createContext, use } from 'react'\n\nexport interface WidgetDrawerContext {\n closeDrawer?(): void\n}\n\nexport const DrawerContext: Context<WidgetDrawerContext> =\n createContext<WidgetDrawerContext>({})\n\nexport const useDrawer = (): WidgetDrawerContext => use(DrawerContext)\n"],"mappings":";;AAMA,MAAa,gBACX,cAAmC,CAAC,CAAC;AAEvC,MAAa,kBAAuC,IAAI,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionRow.style.js","names":[],"sources":["../../../../src/components/ActionRow/ActionRow.style.tsx"],"sourcesContent":["import { Box, styled, Typography } from '@mui/material'\nimport type React from 'react'\n\nexport const ActionRowContainer: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n padding: theme.spacing(1),\n borderRadius: theme.vars.shape.borderRadiusTertiary,\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n }))\n\nexport const ActionRowLabel: React.FC<React.ComponentProps<typeof Typography>> =\n styled(Typography)(({ theme }) => ({\n flex: 1,\n fontSize: 12,\n fontWeight: 500,\n lineHeight: 1.3334,\n color: theme.vars.palette.text.primary,\n }))\n"],"mappings":";;AAGA,MAAa,qBACX,OAAO,GAAG,GAAG,EAAE,aAAa;CAC1B,SAAS;CACT,YAAY;CACZ,KAAK,MAAM,QAAQ,CAAC;CACpB,SAAS,MAAM,QAAQ,CAAC;CACxB,cAAc,MAAM,KAAK,MAAM;CAC/B,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa;AAChF,EAAE;AAEJ,MAAa,iBACX,OAAO,UAAU,GAAG,EAAE,aAAa;CACjC,MAAM;CACN,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,OAAO,MAAM,KAAK,QAAQ,KAAK;AACjC,EAAE"}
1
+ {"version":3,"file":"ActionRow.style.js","names":[],"sources":["../../../../src/components/ActionRow/ActionRow.style.tsx"],"sourcesContent":["import { Box, styled, Typography } from '@mui/material'\nimport type React from 'react'\n\nexport const ActionRowContainer: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(1),\n padding: theme.spacing(1),\n borderRadius: theme.vars.shape.borderRadiusTertiary,\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n }))\n\nexport const ActionRowLabel: React.FC<React.ComponentProps<typeof Typography>> =\n styled(Typography)(({ theme }) => ({\n flex: 1,\n fontSize: 12,\n fontWeight: 500,\n lineHeight: 1.3334,\n color: theme.vars.palette.text.primary,\n }))\n"],"mappings":";;AAGA,MAAa,qBACX,OAAO,GAAG,CAAC,EAAE,EAAE,aAAa;CAC1B,SAAS;CACT,YAAY;CACZ,KAAK,MAAM,QAAQ,CAAC;CACpB,SAAS,MAAM,QAAQ,CAAC;CACxB,cAAc,MAAM,KAAK,MAAM;CAC/B,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa;AAChF,EAAE;AAEJ,MAAa,iBACX,OAAO,UAAU,CAAC,EAAE,EAAE,aAAa;CACjC,MAAM;CACN,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,OAAO,MAAM,KAAK,QAAQ,KAAK;AACjC,EAAE"}
@@ -70,7 +70,8 @@ const AmountInputBase = ({ formType, token, startAdornment, bottomAdornment, dis
70
70
  let formattedValue;
71
71
  if (currentInputMode === "price") {
72
72
  formattedValue = formatInputAmount(inputValue.replace("$", ""), 2);
73
- setFieldValue(amountKey, formatInputAmount(priceToTokenAmount(formattedValue, token?.priceUSD), token?.decimals), {
73
+ const formattedAmount = formatInputAmount(priceToTokenAmount(formattedValue, token?.priceUSD), token?.decimals);
74
+ setFieldValue(amountKey, formattedAmount, {
74
75
  isDirty: true,
75
76
  isTouched: true
76
77
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AmountInput.js","names":[],"sources":["../../../../src/components/AmountInput/AmountInput.tsx"],"sourcesContent":["import type { Token } from '@lifi/sdk'\nimport type { CardProps } from '@mui/material'\nimport type { ChangeEvent, ReactNode } from 'react'\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useToken } from '../../hooks/useToken.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { FormKeyHelper, type FormTypeProps } from '../../stores/form/types.js'\nimport { useFieldActions } from '../../stores/form/useFieldActions.js'\nimport { useFieldValues } from '../../stores/form/useFieldValues.js'\nimport { useInputModeStore } from '../../stores/inputMode/useInputModeStore.js'\nimport {\n formatInputAmount,\n formatTokenPrice,\n priceToTokenAmount,\n usdDecimals,\n} from '../../utils/format.js'\nimport { fitInputText } from '../../utils/input.js'\nimport { InputCard } from '../Card/InputCard.js'\nimport {\n AmountInputCardHeader,\n AmountInputCardTitle,\n FormContainer,\n FormControl,\n Input,\n maxInputFontSize,\n minInputFontSize,\n} from './AmountInput.style.js'\nimport { AmountInputEndAdornment } from './AmountInputEndAdornment.js'\nimport { AmountInputStartAdornment } from './AmountInputStartAdornment.js'\nimport { PriceFormHelperText } from './PriceFormHelperText.js'\n\nexport const AmountInput: React.FC<FormTypeProps & CardProps> = ({\n formType,\n ...props\n}) => {\n const { disabledUI } = useWidgetConfig()\n\n const [chainId, tokenAddress] = useFieldValues(\n FormKeyHelper.getChainKey(formType),\n FormKeyHelper.getTokenKey(formType)\n )\n\n const { token } = useToken(chainId, tokenAddress)\n\n const disabled = disabledUI?.fromAmount\n return (\n <AmountInputBase\n formType={formType}\n token={token}\n bottomAdornment={<PriceFormHelperText formType={formType} />}\n disabled={disabled}\n {...props}\n />\n )\n}\n\nconst AmountInputBase: React.FC<\n FormTypeProps &\n CardProps & {\n token?: Token\n startAdornment?: ReactNode\n bottomAdornment?: ReactNode\n disabled?: boolean\n }\n> = ({\n formType,\n token,\n startAdornment,\n bottomAdornment,\n disabled,\n ...props\n}) => {\n const { t } = useTranslation()\n const { mode, modeOptions } = useWidgetConfig()\n const ref = useRef<HTMLInputElement>(null)\n\n const isEditingRef = useRef(false)\n const [formattedPriceInput, setFormattedPriceInput] = useState('')\n\n const amountKey = FormKeyHelper.getAmountKey(formType)\n const [value] = useFieldValues(amountKey)\n const { setFieldValue } = useFieldActions()\n const { inputMode } = useInputModeStore()\n\n const currentInputMode = inputMode[formType]\n let displayValue: string\n if (isEditingRef.current) {\n if (currentInputMode === 'price') {\n displayValue = formattedPriceInput\n } else {\n displayValue = value as string\n }\n } else {\n if (currentInputMode === 'price') {\n const priceValue = formatTokenPrice(value as string, token?.priceUSD)\n displayValue = formatInputAmount(\n priceValue.toFixed(usdDecimals),\n usdDecimals\n )\n } else {\n displayValue = value as string\n }\n }\n\n const handleChange = (\n event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n const { value: inputValue } = event.target\n isEditingRef.current = true\n\n let formattedValue: string\n if (currentInputMode === 'price') {\n const cleanInputValue = inputValue.replace('$', '')\n formattedValue = formatInputAmount(cleanInputValue, usdDecimals, true)\n const tokenValue = priceToTokenAmount(formattedValue, token?.priceUSD)\n setFormattedPriceInput(formattedValue)\n setFieldValue(amountKey, tokenValue, { isDirty: true, isTouched: true })\n } else {\n formattedValue = formatInputAmount(inputValue, token?.decimals, true)\n setFieldValue(amountKey, formattedValue, {\n isDirty: true,\n isTouched: true,\n })\n }\n }\n\n const handleBlur = (\n event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n const { value: inputValue } = event.target\n isEditingRef.current = false\n\n let formattedValue: string\n if (currentInputMode === 'price') {\n const cleanInputValue = inputValue.replace('$', '')\n formattedValue = formatInputAmount(cleanInputValue, usdDecimals)\n const tokenValue = priceToTokenAmount(formattedValue, token?.priceUSD)\n const formattedAmount = formatInputAmount(tokenValue, token?.decimals)\n setFieldValue(amountKey, formattedAmount, {\n isDirty: true,\n isTouched: true,\n })\n } else {\n formattedValue = formatInputAmount(inputValue, token?.decimals)\n setFieldValue(amountKey, formattedValue, {\n isDirty: true,\n isTouched: true,\n })\n }\n }\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: we need run effect on value change\n useLayoutEffect(() => {\n if (ref.current) {\n fitInputText(maxInputFontSize, minInputFontSize, ref.current)\n }\n }, [displayValue])\n\n const title =\n mode === 'custom'\n ? modeOptions?.custom?.type === 'deposit'\n ? t('header.amount')\n : t('header.youPay')\n : t('header.send')\n\n return (\n <InputCard {...props}>\n <AmountInputCardHeader>\n <AmountInputCardTitle>{title}</AmountInputCardTitle>\n </AmountInputCardHeader>\n <FormContainer>\n <AmountInputStartAdornment formType={formType} />\n <FormControl fullWidth>\n <Input\n inputRef={ref}\n size=\"small\"\n autoComplete=\"off\"\n placeholder={currentInputMode === 'price' ? '$0' : '0'}\n startAdornment={startAdornment}\n inputProps={{\n inputMode: 'decimal',\n }}\n onChange={handleChange}\n onBlur={handleBlur}\n value={\n currentInputMode === 'price'\n ? displayValue\n ? `$${displayValue}`\n : ''\n : displayValue\n }\n name={amountKey}\n disabled={disabled}\n required\n />\n {bottomAdornment}\n </FormControl>\n </FormContainer>\n {!disabled && <AmountInputEndAdornment formType={formType} />}\n </InputCard>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAa,eAAoD,EAC/D,UACA,GAAG,YACC;CACJ,MAAM,EAAE,eAAe,gBAAgB;CAEvC,MAAM,CAAC,SAAS,gBAAgB,eAC9B,cAAc,YAAY,QAAQ,GAClC,cAAc,YAAY,QAAQ,CACpC;CAEA,MAAM,EAAE,UAAU,SAAS,SAAS,YAAY;CAEhD,MAAM,WAAW,YAAY;CAC7B,OACE,oBAAC,iBAAD;EACY;EACH;EACP,iBAAiB,oBAAC,qBAAD,EAA+B,SAAW,CAAA;EACjD;EACV,GAAI;CACL,CAAA;AAEL;AAEA,MAAM,mBAQD,EACH,UACA,OACA,gBACA,iBACA,UACA,GAAG,YACC;CACJ,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,EAAE,MAAM,gBAAgB,gBAAgB;CAC9C,MAAM,MAAM,OAAyB,IAAI;CAEzC,MAAM,eAAe,OAAO,KAAK;CACjC,MAAM,CAAC,qBAAqB,0BAA0B,SAAS,EAAE;CAEjE,MAAM,YAAY,cAAc,aAAa,QAAQ;CACrD,MAAM,CAAC,SAAS,eAAe,SAAS;CACxC,MAAM,EAAE,kBAAkB,gBAAgB;CAC1C,MAAM,EAAE,cAAc,kBAAkB;CAExC,MAAM,mBAAmB,UAAU;CACnC,IAAI;CACJ,IAAI,aAAa,SACf,IAAI,qBAAqB,SACvB,eAAe;MAEf,eAAe;MAGjB,IAAI,qBAAqB,SAEvB,eAAe,kBADI,iBAAiB,O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CAAA;GACvB,qBAAC,eAAD,EAAA,UAAA,CACE,oBAAC,2BAAD,EAAqC,SAAW,CAAA,GAChD,qBAAC,aAAD;IAAa,WAAA;cAAb,CACE,oBAAC,OAAD;KACE,UAAU;KACV,MAAK;KACL,cAAa;KACb,aAAa,qBAAqB,UAAU,OAAO;KACnC;KAChB,YAAY,EACV,WAAW,UACb;KACA,UAAU;KACV,QAAQ;KACR,OACE,qBAAqB,UACjB,eACE,IAAI,iBACJ,KACF;KAEN,MAAM;KACI;KACV,UAAA;IACD,CAAA,GACA,eACU;KACA,EAAA,CAAA;GACd,CAAC,YAAY,oBAAC,yBAAD,EAAmC,SAAW,CAAA;EACnD;;AAEf"}
1
+ {"version":3,"file":"AmountInput.js","names":[],"sources":["../../../../src/components/AmountInput/AmountInput.tsx"],"sourcesContent":["import type { Token } from '@lifi/sdk'\nimport type { CardProps } from '@mui/material'\nimport type { ChangeEvent, ReactNode } from 'react'\nimport { useLayoutEffect, useRef, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useToken } from '../../hooks/useToken.js'\nimport { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js'\nimport { FormKeyHelper, type FormTypeProps } from '../../stores/form/types.js'\nimport { useFieldActions } from '../../stores/form/useFieldActions.js'\nimport { useFieldValues } from '../../stores/form/useFieldValues.js'\nimport { useInputModeStore } from '../../stores/inputMode/useInputModeStore.js'\nimport {\n formatInputAmount,\n formatTokenPrice,\n priceToTokenAmount,\n usdDecimals,\n} from '../../utils/format.js'\nimport { fitInputText } from '../../utils/input.js'\nimport { InputCard } from '../Card/InputCard.js'\nimport {\n AmountInputCardHeader,\n AmountInputCardTitle,\n FormContainer,\n FormControl,\n Input,\n maxInputFontSize,\n minInputFontSize,\n} from './AmountInput.style.js'\nimport { AmountInputEndAdornment } from './AmountInputEndAdornment.js'\nimport { AmountInputStartAdornment } from './AmountInputStartAdornment.js'\nimport { PriceFormHelperText } from './PriceFormHelperText.js'\n\nexport const AmountInput: React.FC<FormTypeProps & CardProps> = ({\n formType,\n ...props\n}) => {\n const { disabledUI } = useWidgetConfig()\n\n const [chainId, tokenAddress] = useFieldValues(\n FormKeyHelper.getChainKey(formType),\n FormKeyHelper.getTokenKey(formType)\n )\n\n const { token } = useToken(chainId, tokenAddress)\n\n const disabled = disabledUI?.fromAmount\n return (\n <AmountInputBase\n formType={formType}\n token={token}\n bottomAdornment={<PriceFormHelperText formType={formType} />}\n disabled={disabled}\n {...props}\n />\n )\n}\n\nconst AmountInputBase: React.FC<\n FormTypeProps &\n CardProps & {\n token?: Token\n startAdornment?: ReactNode\n bottomAdornment?: ReactNode\n disabled?: boolean\n }\n> = ({\n formType,\n token,\n startAdornment,\n bottomAdornment,\n disabled,\n ...props\n}) => {\n const { t } = useTranslation()\n const { mode, modeOptions } = useWidgetConfig()\n const ref = useRef<HTMLInputElement>(null)\n\n const isEditingRef = useRef(false)\n const [formattedPriceInput, setFormattedPriceInput] = useState('')\n\n const amountKey = FormKeyHelper.getAmountKey(formType)\n const [value] = useFieldValues(amountKey)\n const { setFieldValue } = useFieldActions()\n const { inputMode } = useInputModeStore()\n\n const currentInputMode = inputMode[formType]\n let displayValue: string\n if (isEditingRef.current) {\n if (currentInputMode === 'price') {\n displayValue = formattedPriceInput\n } else {\n displayValue = value as string\n }\n } else {\n if (currentInputMode === 'price') {\n const priceValue = formatTokenPrice(value as string, token?.priceUSD)\n displayValue = formatInputAmount(\n priceValue.toFixed(usdDecimals),\n usdDecimals\n )\n } else {\n displayValue = value as string\n }\n }\n\n const handleChange = (\n event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n const { value: inputValue } = event.target\n isEditingRef.current = true\n\n let formattedValue: string\n if (currentInputMode === 'price') {\n const cleanInputValue = inputValue.replace('$', '')\n formattedValue = formatInputAmount(cleanInputValue, usdDecimals, true)\n const tokenValue = priceToTokenAmount(formattedValue, token?.priceUSD)\n setFormattedPriceInput(formattedValue)\n setFieldValue(amountKey, tokenValue, { isDirty: true, isTouched: true })\n } else {\n formattedValue = formatInputAmount(inputValue, token?.decimals, true)\n setFieldValue(amountKey, formattedValue, {\n isDirty: true,\n isTouched: true,\n })\n }\n }\n\n const handleBlur = (\n event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>\n ) => {\n const { value: inputValue } = event.target\n isEditingRef.current = false\n\n let formattedValue: string\n if (currentInputMode === 'price') {\n const cleanInputValue = inputValue.replace('$', '')\n formattedValue = formatInputAmount(cleanInputValue, usdDecimals)\n const tokenValue = priceToTokenAmount(formattedValue, token?.priceUSD)\n const formattedAmount = formatInputAmount(tokenValue, token?.decimals)\n setFieldValue(amountKey, formattedAmount, {\n isDirty: true,\n isTouched: true,\n })\n } else {\n formattedValue = formatInputAmount(inputValue, token?.decimals)\n setFieldValue(amountKey, formattedValue, {\n isDirty: true,\n isTouched: true,\n })\n }\n }\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: we need run effect on value change\n useLayoutEffect(() => {\n if (ref.current) {\n fitInputText(maxInputFontSize, minInputFontSize, ref.current)\n }\n }, [displayValue])\n\n const title =\n mode === 'custom'\n ? modeOptions?.custom?.type === 'deposit'\n ? t('header.amount')\n : t('header.youPay')\n : t('header.send')\n\n return (\n <InputCard {...props}>\n <AmountInputCardHeader>\n <AmountInputCardTitle>{title}</AmountInputCardTitle>\n </AmountInputCardHeader>\n <FormContainer>\n <AmountInputStartAdornment formType={formType} />\n <FormControl fullWidth>\n <Input\n inputRef={ref}\n size=\"small\"\n autoComplete=\"off\"\n placeholder={currentInputMode === 'price' ? '$0' : '0'}\n startAdornment={startAdornment}\n inputProps={{\n inputMode: 'decimal',\n }}\n onChange={handleChange}\n onBlur={handleBlur}\n value={\n currentInputMode === 'price'\n ? displayValue\n ? `$${displayValue}`\n : ''\n : displayValue\n }\n name={amountKey}\n disabled={disabled}\n required\n />\n {bottomAdornment}\n </FormControl>\n </FormContainer>\n {!disabled && <AmountInputEndAdornment formType={formType} />}\n </InputCard>\n )\n}\n"],"mappings":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,KACF;KAEN,MAAM;KACI;KACV,UAAA;IACD,CAAA,GACA,eACU;KACA,EAAA,CAAA;GACd,CAAC,YAAY,oBAAC,yBAAD,EAAmC,SAAW,CAAA;EACnD;;AAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"AmountInput.style.js","names":["FormControl","MuiFormControl"],"sources":["../../../../src/components/AmountInput/AmountInput.style.tsx"],"sourcesContent":["import {\n Box,\n InputBase,\n inputBaseClasses,\n FormControl as MuiFormControl,\n styled,\n} from '@mui/material'\nimport type React from 'react'\nimport { CardTitle } from '../Card/CardTitle.js'\n\nexport const maxInputFontSize = 24\nexport const minInputFontSize = 14\n\nexport const FormContainer: React.FC<React.ComponentProps<typeof Box>> = styled(\n Box\n)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n padding: theme.spacing(2),\n}))\n\nexport const FormControl: React.FC<\n React.ComponentProps<typeof MuiFormControl>\n> = styled(MuiFormControl)(() => ({\n height: 40,\n}))\n\nexport const Input: React.FC<React.ComponentProps<typeof InputBase>> = styled(\n InputBase\n)(({ theme }) => ({\n fontSize: 24,\n fontWeight: 700,\n boxShadow: 'none',\n lineHeight: 1.5,\n [`.${inputBaseClasses.input}`]: {\n height: 24,\n padding: theme.spacing(0, 0, 0, 2),\n },\n '& input[type=\"number\"]::-webkit-outer-spin-button, & input[type=\"number\"]::-webkit-inner-spin-button':\n {\n WebkitAppearance: 'none',\n margin: 0,\n },\n '& input[type=\"number\"]': {\n MozAppearance: 'textfield',\n },\n [`&.${inputBaseClasses.disabled}`]: {\n color: 'inherit',\n },\n [`.${inputBaseClasses.input}.${inputBaseClasses.disabled}`]: {\n WebkitTextFillColor: 'unset',\n },\n}))\n\nexport const AmountInputCardTitle: React.FC<\n React.ComponentProps<typeof CardTitle>\n> = styled(CardTitle)(({ theme }) => ({\n padding: theme.spacing(0),\n}))\n\nexport const AmountInputCardHeader: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(({ theme }) => ({\n padding: theme.spacing(2, 2, 0, 2),\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n height: 30,\n }))\n"],"mappings":";;;AAaA,MAAa,gBAA4D,OACvE,GACF,GAAG,EAAE,aAAa;CAChB,SAAS;CACT,YAAY;CACZ,SAAS,MAAM,QAAQ,CAAC;AAC1B,EAAE;AAEF,MAAaA,gBAET,OAAOC,WAAc,SAAS,EAChC,QAAQ,GACV,EAAE;AAEF,MAAa,QAA0D,OACrE,SACF,GAAG,EAAE,aAAa;CAChB,UAAU;CACV,YAAY;CACZ,WAAW;CACX,YAAY;EACX,IAAI,iBAAiB,UAAU;EAC9B,QAAQ;EACR,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;CACnC;CACA,4GACE;EACE,kBAAkB;EAClB,QAAQ;CACV;CACF,4BAA0B,EACxB,eAAe,YACjB;EACC,KAAK,iBAAiB,aAAa,EAClC,OAAO,UACT;EACC,IAAI,iBAAiB,MAAM,GAAG,iBAAiB,aAAa,EAC3D,qBAAqB,QACvB;AACF,EAAE;AAEF,MAAa,uBAET,OAAO,SAAS,GAAG,EAAE,aAAa,EACpC,SAAS,MAAM,QAAQ,CAAC,EAC1B,EAAE;AAEF,MAAa,wBACX,OAAO,GAAG,GAAG,EAAE,aAAa;CAC1B,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;CACjC,SAAS;CACT,gBAAgB;CAChB,YAAY;CACZ,QAAQ;AACV,EAAE"}
1
+ {"version":3,"file":"AmountInput.style.js","names":["FormControl","MuiFormControl"],"sources":["../../../../src/components/AmountInput/AmountInput.style.tsx"],"sourcesContent":["import {\n Box,\n InputBase,\n inputBaseClasses,\n FormControl as MuiFormControl,\n styled,\n} from '@mui/material'\nimport type React from 'react'\nimport { CardTitle } from '../Card/CardTitle.js'\n\nexport const maxInputFontSize = 24\nexport const minInputFontSize = 14\n\nexport const FormContainer: React.FC<React.ComponentProps<typeof Box>> = styled(\n Box\n)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n padding: theme.spacing(2),\n}))\n\nexport const FormControl: React.FC<\n React.ComponentProps<typeof MuiFormControl>\n> = styled(MuiFormControl)(() => ({\n height: 40,\n}))\n\nexport const Input: React.FC<React.ComponentProps<typeof InputBase>> = styled(\n InputBase\n)(({ theme }) => ({\n fontSize: 24,\n fontWeight: 700,\n boxShadow: 'none',\n lineHeight: 1.5,\n [`.${inputBaseClasses.input}`]: {\n height: 24,\n padding: theme.spacing(0, 0, 0, 2),\n },\n '& input[type=\"number\"]::-webkit-outer-spin-button, & input[type=\"number\"]::-webkit-inner-spin-button':\n {\n WebkitAppearance: 'none',\n margin: 0,\n },\n '& input[type=\"number\"]': {\n MozAppearance: 'textfield',\n },\n [`&.${inputBaseClasses.disabled}`]: {\n color: 'inherit',\n },\n [`.${inputBaseClasses.input}.${inputBaseClasses.disabled}`]: {\n WebkitTextFillColor: 'unset',\n },\n}))\n\nexport const AmountInputCardTitle: React.FC<\n React.ComponentProps<typeof CardTitle>\n> = styled(CardTitle)(({ theme }) => ({\n padding: theme.spacing(0),\n}))\n\nexport const AmountInputCardHeader: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(({ theme }) => ({\n padding: theme.spacing(2, 2, 0, 2),\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n height: 30,\n }))\n"],"mappings":";;;AAaA,MAAa,gBAA4D,OACvE,GACF,CAAC,EAAE,EAAE,aAAa;CAChB,SAAS;CACT,YAAY;CACZ,SAAS,MAAM,QAAQ,CAAC;AAC1B,EAAE;AAEF,MAAaA,gBAET,OAAOC,WAAc,CAAC,QAAQ,EAChC,QAAQ,GACV,EAAE;AAEF,MAAa,QAA0D,OACrE,SACF,CAAC,EAAE,EAAE,aAAa;CAChB,UAAU;CACV,YAAY;CACZ,WAAW;CACX,YAAY;EACX,IAAI,iBAAiB,UAAU;EAC9B,QAAQ;EACR,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;CACnC;CACA,4GACE;EACE,kBAAkB;EAClB,QAAQ;CACV;CACF,4BAA0B,EACxB,eAAe,YACjB;EACC,KAAK,iBAAiB,aAAa,EAClC,OAAO,UACT;EACC,IAAI,iBAAiB,MAAM,GAAG,iBAAiB,aAAa,EAC3D,qBAAqB,QACvB;AACF,EAAE;AAEF,MAAa,uBAET,OAAO,SAAS,CAAC,EAAE,EAAE,aAAa,EACpC,SAAS,MAAM,QAAQ,CAAC,EAC1B,EAAE;AAEF,MAAa,wBACX,OAAO,GAAG,CAAC,EAAE,EAAE,aAAa;CAC1B,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;CACjC,SAAS;CACT,gBAAgB;CAChB,YAAY;CACZ,QAAQ;AACV,EAAE"}
@@ -9,17 +9,19 @@ import { formatUnits } from "@lifi/sdk";
9
9
  import { memo } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  import { useTranslation } from "react-i18next";
12
+ import { useAccount } from "@lifi/wallet-management";
12
13
  //#region src/components/AmountInput/AmountInputEndAdornment.tsx
13
14
  const AmountInputEndAdornment = memo(({ formType }) => {
14
15
  const { t } = useTranslation();
15
16
  const { getChainById } = useAvailableChains();
16
17
  const { setFieldValue } = useFieldActions();
17
18
  const [chainId, tokenAddress] = useFieldValues(FormKeyHelper.getChainKey(formType), FormKeyHelper.getTokenKey(formType));
19
+ const chain = getChainById(chainId);
20
+ const { account } = useAccount({ chainType: chain?.chainType });
18
21
  const { data } = useGasRecommendation(chainId);
19
22
  const { token } = useTokenAddressBalance(chainId, tokenAddress);
20
23
  const getMaxAmount = () => {
21
24
  if (!token?.amount) return 0n;
22
- const chain = getChainById(chainId);
23
25
  let maxAmount = token.amount;
24
26
  if (chain?.nativeToken.address === tokenAddress && data?.recommended) {
25
27
  const recommendedAmount = BigInt(data.recommended.amount);
@@ -38,7 +40,7 @@ const AmountInputEndAdornment = memo(({ formType }) => {
38
40
  const maxAmount = getMaxAmount();
39
41
  if (maxAmount && token?.decimals) setFieldValue(FormKeyHelper.getAmountKey(formType), formatUnits(maxAmount, token.decimals), { isTouched: true });
40
42
  };
41
- if (formType !== "from" || !token) return null;
43
+ if (formType !== "from" || !token || !account?.isConnected) return null;
42
44
  return /* @__PURE__ */ jsxs(ButtonContainer, { children: [
43
45
  /* @__PURE__ */ jsx(AmountInputButton, {
44
46
  onClick: () => handlePercentage(25),
@@ -1 +1 @@
1
- {"version":3,"file":"AmountInputEndAdornment.js","names":[],"sources":["../../../../src/components/AmountInput/AmountInputEndAdornment.tsx"],"sourcesContent":["import { formatUnits } from '@lifi/sdk'\nimport type React from 'react'\nimport { type JSX, memo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useAvailableChains } from '../../hooks/useAvailableChains.js'\nimport { useGasRecommendation } from '../../hooks/useGasRecommendation.js'\nimport { useTokenAddressBalance } from '../../hooks/useTokenAddressBalance.js'\nimport type { FormTypeProps } from '../../stores/form/types.js'\nimport { FormKeyHelper } from '../../stores/form/types.js'\nimport { useFieldActions } from '../../stores/form/useFieldActions.js'\nimport { useFieldValues } from '../../stores/form/useFieldValues.js'\nimport {\n AmountInputButton,\n ButtonContainer,\n} from './AmountInputEndAdornment.style.js'\n\nexport const AmountInputEndAdornment: React.NamedExoticComponent<FormTypeProps> =\n memo(({ formType }: FormTypeProps): JSX.Element | null => {\n const { t } = useTranslation()\n const { getChainById } = useAvailableChains()\n const { setFieldValue } = useFieldActions()\n\n const [chainId, tokenAddress] = useFieldValues(\n FormKeyHelper.getChainKey(formType),\n FormKeyHelper.getTokenKey(formType)\n )\n\n // We get gas recommendations for the source chain to make sure that after pressing the Max button\n // the user will have enough funds remaining to cover gas costs\n const { data } = useGasRecommendation(chainId)\n\n const { token } = useTokenAddressBalance(chainId, tokenAddress)\n\n const getMaxAmount = () => {\n if (!token?.amount) {\n return 0n\n }\n const chain = getChainById(chainId)\n let maxAmount = token.amount\n if (chain?.nativeToken.address === tokenAddress && data?.recommended) {\n const recommendedAmount = BigInt(data.recommended.amount)\n if (token.amount > recommendedAmount) {\n maxAmount = token.amount - recommendedAmount\n }\n }\n return maxAmount\n }\n\n const handlePercentage = (percentage: number) => {\n const maxAmount = getMaxAmount()\n if (maxAmount && token?.decimals) {\n const percentageAmount = (maxAmount * BigInt(percentage)) / 100n\n setFieldValue(\n FormKeyHelper.getAmountKey(formType),\n formatUnits(percentageAmount, token.decimals),\n {\n isTouched: true,\n }\n )\n }\n }\n\n const handleMax = () => {\n const maxAmount = getMaxAmount()\n if (maxAmount && token?.decimals) {\n setFieldValue(\n FormKeyHelper.getAmountKey(formType),\n formatUnits(maxAmount, token.decimals),\n {\n isTouched: true,\n }\n )\n }\n }\n\n if (formType !== 'from' || !token) {\n return null\n }\n\n return (\n <ButtonContainer>\n <AmountInputButton onClick={() => handlePercentage(25)}>\n 25%\n </AmountInputButton>\n <AmountInputButton onClick={() => handlePercentage(50)}>\n 50%\n </AmountInputButton>\n <AmountInputButton onClick={() => handlePercentage(75)}>\n 75%\n </AmountInputButton>\n <AmountInputButton onClick={handleMax}>\n {t('button.max')}\n </AmountInputButton>\n </ButtonContainer>\n )\n })\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAa,0BACX,MAAM,EAAE,eAAkD;CACxD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,EAAE,iBAAiB,mBAAmB;CAC5C,MAAM,EAAE,kBAAkB,gBAAgB;CAE1C,MAAM,CAAC,SAAS,gBAAgB,eAC9B,cAAc,YAAY,QAAQ,GAClC,cAAc,YAAY,QAAQ,CACpC;CAIA,MAAM,EAAE,SAAS,qBAAqB,OAAO;CAE7C,MAAM,EAAE,UAAU,uBAAuB,SAAS,YAAY;CAE9D,MAAM,qBAAqB;EACzB,IAAI,CAAC,OAAO,QACV,OAAO;EAET,MAAM,QAAQ,aAAa,OAAO;EAClC,IAAI,YAAY,MAAM;EACtB,IAAI,OAAO,YAAY,YAAY,gBAAgB,MAAM,aAAa;GACpE,MAAM,oBAAoB,OAAO,KAAK,YAAY,MAAM;GACxD,IAAI,MAAM,SAAS,mBACjB,YAAY,MAAM,SAAS;EAE/B;EACA,OAAO;CACT;CAEA,MAAM,oBAAoB,eAAuB;EAC/C,MAAM,YAAY,aAAa;EAC/B,IAAI,aAAa,OAAO,UAAU;GAChC,MAAM,mBAAoB,YAAY,OAAO,UAAU,IAAK;GAC5D,cACE,cAAc,aAAa,QAAQ,GACnC,YAAY,kBAAkB,MAAM,QAAQ,GAC5C,EACE,WAAW,KACb,CACF;EACF;CACF;CAEA,MAAM,kBAAkB;EACtB,MAAM,YAAY,aAAa;EAC/B,IAAI,aAAa,OAAO,UACtB,cACE,cAAc,aAAa,QAAQ,GACnC,YAAY,WAAW,MAAM,QAAQ,GACrC,EACE,WAAW,KACb,CACF;CAEJ;CAEA,IAAI,aAAa,UAAU,CAAC,OAC1B,OAAO;CAGT,OACE,qBAAC,iBAAD,EAAA,UAAA;EACE,oBAAC,mBAAD;GAAmB,eAAe,iBAAiB,EAAE;aAAG;EAErC,CAAA;EACnB,oBAAC,mBAAD;GAAmB,eAAe,iBAAiB,EAAE;aAAG;EAErC,CAAA;EACnB,oBAAC,mBAAD;GAAmB,eAAe,iBAAiB,EAAE;aAAG;EAErC,CAAA;EACnB,oBAAC,mBAAD;GAAmB,SAAS;aACzB,EAAE,YAAY;EACE,CAAA;CACJ,EAAA,CAAA;AAErB,CAAC"}
1
+ {"version":3,"file":"AmountInputEndAdornment.js","names":[],"sources":["../../../../src/components/AmountInput/AmountInputEndAdornment.tsx"],"sourcesContent":["import { formatUnits } from '@lifi/sdk'\nimport { useAccount } from '@lifi/wallet-management'\nimport type React from 'react'\nimport { type JSX, memo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useAvailableChains } from '../../hooks/useAvailableChains.js'\nimport { useGasRecommendation } from '../../hooks/useGasRecommendation.js'\nimport { useTokenAddressBalance } from '../../hooks/useTokenAddressBalance.js'\nimport type { FormTypeProps } from '../../stores/form/types.js'\nimport { FormKeyHelper } from '../../stores/form/types.js'\nimport { useFieldActions } from '../../stores/form/useFieldActions.js'\nimport { useFieldValues } from '../../stores/form/useFieldValues.js'\nimport {\n AmountInputButton,\n ButtonContainer,\n} from './AmountInputEndAdornment.style.js'\n\nexport const AmountInputEndAdornment: React.NamedExoticComponent<FormTypeProps> =\n memo(({ formType }: FormTypeProps): JSX.Element | null => {\n const { t } = useTranslation()\n const { getChainById } = useAvailableChains()\n const { setFieldValue } = useFieldActions()\n\n const [chainId, tokenAddress] = useFieldValues(\n FormKeyHelper.getChainKey(formType),\n FormKeyHelper.getTokenKey(formType)\n )\n\n const chain = getChainById(chainId)\n const { account } = useAccount({ chainType: chain?.chainType })\n\n // We get gas recommendations for the source chain to make sure that after pressing the Max button\n // the user will have enough funds remaining to cover gas costs\n const { data } = useGasRecommendation(chainId)\n\n const { token } = useTokenAddressBalance(chainId, tokenAddress)\n\n const getMaxAmount = () => {\n if (!token?.amount) {\n return 0n\n }\n let maxAmount = token.amount\n if (chain?.nativeToken.address === tokenAddress && data?.recommended) {\n const recommendedAmount = BigInt(data.recommended.amount)\n if (token.amount > recommendedAmount) {\n maxAmount = token.amount - recommendedAmount\n }\n }\n return maxAmount\n }\n\n const handlePercentage = (percentage: number) => {\n const maxAmount = getMaxAmount()\n if (maxAmount && token?.decimals) {\n const percentageAmount = (maxAmount * BigInt(percentage)) / 100n\n setFieldValue(\n FormKeyHelper.getAmountKey(formType),\n formatUnits(percentageAmount, token.decimals),\n {\n isTouched: true,\n }\n )\n }\n }\n\n const handleMax = () => {\n const maxAmount = getMaxAmount()\n if (maxAmount && token?.decimals) {\n setFieldValue(\n FormKeyHelper.getAmountKey(formType),\n formatUnits(maxAmount, token.decimals),\n {\n isTouched: true,\n }\n )\n }\n }\n\n if (formType !== 'from' || !token || !account?.isConnected) {\n return null\n }\n\n return (\n <ButtonContainer>\n <AmountInputButton onClick={() => handlePercentage(25)}>\n 25%\n </AmountInputButton>\n <AmountInputButton onClick={() => handlePercentage(50)}>\n 50%\n </AmountInputButton>\n <AmountInputButton onClick={() => handlePercentage(75)}>\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,OACE,qBAAC,iBAAD,EAAA,UAAA;EACE,oBAAC,mBAAD;GAAmB,eAAe,iBAAiB,EAAE;aAAG;EAErC,CAAA;EACnB,oBAAC,mBAAD;GAAmB,eAAe,iBAAiB,EAAE;aAAG;EAErC,CAAA;EACnB,oBAAC,mBAAD;GAAmB,eAAe,iBAAiB,EAAE;aAAG;EAErC,CAAA;EACnB,oBAAC,mBAAD;GAAmB,SAAS;aACzB,EAAE,YAAY;EACE,CAAA;CACJ,EAAA,CAAA;AAErB,CAAC"}
@@ -13,7 +13,7 @@ const AmountInputButton = styled(ButtonTertiary)(({ theme }) => ({
13
13
  fontWeight: 700,
14
14
  lineHeight: 1.3334,
15
15
  height: "auto",
16
- borderRadius: theme.shape.borderRadiusSecondary
16
+ borderRadius: theme.vars.shape.borderRadiusSecondary
17
17
  }));
18
18
  //#endregion
19
19
  export { AmountInputButton, ButtonContainer };
@@ -1 +1 @@
1
- {"version":3,"file":"AmountInputEndAdornment.style.js","names":[],"sources":["../../../../src/components/AmountInput/AmountInputEndAdornment.style.ts"],"sourcesContent":["import { Box, styled } from '@mui/material'\nimport type React from 'react'\nimport { ButtonTertiary } from '../ButtonTertiary.js'\n\nexport const ButtonContainer: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(({ theme }) => ({\n display: 'flex',\n gap: theme.spacing(1),\n padding: theme.spacing(0, 2, 2, 2),\n }))\n\nexport const AmountInputButton: React.FC<\n React.ComponentProps<typeof ButtonTertiary>\n> = styled(ButtonTertiary)(({ theme }) => ({\n flex: 1,\n padding: theme.spacing(0.5, 1.5),\n fontSize: 12,\n fontWeight: 700,\n lineHeight: 1.3334,\n height: 'auto',\n borderRadius: theme.shape.borderRadiusSecondary,\n}))\n"],"mappings":";;;AAIA,MAAa,kBACX,OAAO,GAAG,GAAG,EAAE,aAAa;CAC1B,SAAS;CACT,KAAK,MAAM,QAAQ,CAAC;CACpB,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;AACnC,EAAE;AAEJ,MAAa,oBAET,OAAO,cAAc,GAAG,EAAE,aAAa;CACzC,MAAM;CACN,SAAS,MAAM,QAAQ,IAAK,GAAG;CAC/B,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,cAAc,MAAM,MAAM;AAC5B,EAAE"}
1
+ {"version":3,"file":"AmountInputEndAdornment.style.js","names":[],"sources":["../../../../src/components/AmountInput/AmountInputEndAdornment.style.ts"],"sourcesContent":["import { Box, styled } from '@mui/material'\nimport type React from 'react'\nimport { ButtonTertiary } from '../ButtonTertiary.js'\n\nexport const ButtonContainer: React.FC<React.ComponentProps<typeof Box>> =\n styled(Box)(({ theme }) => ({\n display: 'flex',\n gap: theme.spacing(1),\n padding: theme.spacing(0, 2, 2, 2),\n }))\n\nexport const AmountInputButton: React.FC<\n React.ComponentProps<typeof ButtonTertiary>\n> = styled(ButtonTertiary)(({ theme }) => ({\n flex: 1,\n padding: theme.spacing(0.5, 1.5),\n fontSize: 12,\n fontWeight: 700,\n lineHeight: 1.3334,\n height: 'auto',\n borderRadius: theme.vars.shape.borderRadiusSecondary,\n}))\n"],"mappings":";;;AAIA,MAAa,kBACX,OAAO,GAAG,CAAC,EAAE,EAAE,aAAa;CAC1B,SAAS;CACT,KAAK,MAAM,QAAQ,CAAC;CACpB,SAAS,MAAM,QAAQ,GAAG,GAAG,GAAG,CAAC;AACnC,EAAE;AAEJ,MAAa,oBAET,OAAO,cAAc,CAAC,EAAE,EAAE,aAAa;CACzC,MAAM;CACN,SAAS,MAAM,QAAQ,IAAK,GAAG;CAC/B,UAAU;CACV,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,cAAc,MAAM,KAAK,MAAM;AACjC,EAAE"}
@@ -27,8 +27,10 @@ const PriceFormHelperTextBase = ({ formType, isLoading, tokenAddress, token }) =
27
27
  const currentInputMode = inputMode[formType];
28
28
  const tokenAmount = token ? formatTokenAmount(token.amount, token.decimals) : "0";
29
29
  const getPriceAmountDisplayValue = () => {
30
- if (currentInputMode === "amount") return t("format.currency", { value: formatTokenPrice(amount, token?.priceUSD, token?.decimals) });
31
- else return t("format.tokenAmount", { value: amount || "0" });
30
+ if (currentInputMode === "amount") {
31
+ const tokenPrice = formatTokenPrice(amount, token?.priceUSD, token?.decimals);
32
+ return t("format.currency", { value: tokenPrice });
33
+ } else return t("format.tokenAmount", { value: amount || "0" });
32
34
  };
33
35
  const handleToggleMode = (e) => {
34
36
  e.stopPropagation();
@@ -1 +1 @@
1
- {"version":3,"file":"PriceFormHelperText.js","names":[],"sources":["../../../../src/components/AmountInput/PriceFormHelperText.tsx"],"sourcesContent":["import type { TokenAmount } from '@lifi/sdk'\nimport SwapVertIcon from '@mui/icons-material/SwapVert'\nimport { FormHelperText, Skeleton, Typography } from '@mui/material'\nimport type React from 'react'\nimport { memo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useTokenAddressBalance } from '../../hooks/useTokenAddressBalance.js'\nimport type { FormTypeProps } from '../../stores/form/types.js'\nimport { FormKeyHelper } from '../../stores/form/types.js'\nimport { useFieldValues } from '../../stores/form/useFieldValues.js'\nimport { useInputModeStore } from '../../stores/inputMode/useInputModeStore.js'\nimport { formatTokenAmount, formatTokenPrice } from '../../utils/format.js'\nimport { InputPriceButton } from './PriceFormHelperText.style.js'\n\nexport const PriceFormHelperText: React.NamedExoticComponent<FormTypeProps> =\n memo<FormTypeProps>(({ formType }) => {\n const [chainId, tokenAddress] = useFieldValues(\n FormKeyHelper.getChainKey(formType),\n FormKeyHelper.getTokenKey(formType)\n )\n const { token, isLoading } = useTokenAddressBalance(chainId, tokenAddress)\n\n return (\n <PriceFormHelperTextBase\n formType={formType}\n isLoading={isLoading}\n tokenAddress={tokenAddress}\n token={token}\n />\n )\n })\n\nconst PriceFormHelperTextBase: React.FC<\n FormTypeProps & {\n isLoading?: boolean\n tokenAddress?: string\n token?: TokenAmount\n }\n> = ({ formType, isLoading, tokenAddress, token }) => {\n const { t } = useTranslation()\n const [amount] = useFieldValues(FormKeyHelper.getAmountKey(formType))\n const { inputMode, toggleInputMode } = useInputModeStore()\n\n const currentInputMode = inputMode[formType]\n\n const tokenAmount = token\n ? formatTokenAmount(token.amount, token.decimals)\n : '0'\n\n const getPriceAmountDisplayValue = () => {\n if (currentInputMode === 'amount') {\n const tokenPrice = formatTokenPrice(\n amount,\n token?.priceUSD,\n token?.decimals\n )\n return t('format.currency', { value: tokenPrice })\n } else {\n return t('format.tokenAmount', { value: amount || '0' })\n }\n }\n\n const handleToggleMode = (e: React.MouseEvent) => {\n e.stopPropagation()\n toggleInputMode(formType)\n }\n\n return (\n <FormHelperText\n component=\"div\"\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n margin: 0,\n marginLeft: 1.25,\n marginTop: 0.5,\n }}\n >\n <InputPriceButton\n onClick={token?.priceUSD ? handleToggleMode : undefined}\n >\n <Typography\n sx={{\n color: 'text.secondary',\n fontWeight: 500,\n fontSize: 12,\n lineHeight: 1,\n marginRight: 0.25,\n maxWidth: 136,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {getPriceAmountDisplayValue()}\n </Typography>\n {currentInputMode === 'price' && token?.symbol ? (\n <Typography\n sx={{\n color: 'text.secondary',\n fontWeight: 500,\n fontSize: 12,\n lineHeight: 1,\n wordBreak: 'break-word',\n overflowWrap: 'break-word',\n marginRight: 0.25,\n }}\n >\n {token.symbol}\n </Typography>\n ) : null}\n {token?.priceUSD && <SwapVertIcon sx={{ fontSize: 14 }} />}\n </InputPriceButton>\n {isLoading && tokenAddress ? (\n <Skeleton variant=\"text\" width={56} height={16} />\n ) : token?.amount ? (\n <Typography\n sx={{\n fontWeight: 500,\n fontSize: 12,\n color: 'text.secondary',\n lineHeight: 1,\n paddingLeft: 0.25,\n }}\n title={tokenAmount}\n >\n {`/ ${t('format.tokenAmount', {\n value: tokenAmount,\n })}`}\n </Typography>\n ) : null}\n </FormHelperText>\n )\n}\n"],"mappings":";;;;;;;;;;;;A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V,YAAY;MACZ,WAAW;MACX,cAAc;MACd,aAAa;KACf;eAEC,MAAM;IACG,CAAA,IACV;IACH,OAAO,YAAY,oBAAC,cAAD,EAAc,IAAI,EAAE,UAAU,GAAG,EAAI,CAAA;GACzC;MACjB,aAAa,eACZ,oBAAC,UAAD;GAAU,SAAQ;GAAO,OAAO;GAAI,QAAQ;EAAK,CAAA,IAC/C,OAAO,SACT,oBAAC,YAAD;GACE,IAAI;IACF,YAAY;IACZ,UAAU;IACV,OAAO;IACP,YAAY;IACZ,aAAa;GACf;GACA,OAAO;aAEN,KAAK,EAAE,sBAAsB,EAC5B,OAAO,YACT,CAAC;EACS,CAAA,IACV,IACU;;AAEpB"}
1
+ {"version":3,"file":"PriceFormHelperText.js","names":[],"sources":["../../../../src/components/AmountInput/PriceFormHelperText.tsx"],"sourcesContent":["import type { TokenAmount } from '@lifi/sdk'\nimport SwapVertIcon from '@mui/icons-material/SwapVert'\nimport { FormHelperText, Skeleton, Typography } from '@mui/material'\nimport type React from 'react'\nimport { memo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useTokenAddressBalance } from '../../hooks/useTokenAddressBalance.js'\nimport type { FormTypeProps } from '../../stores/form/types.js'\nimport { FormKeyHelper } from '../../stores/form/types.js'\nimport { useFieldValues } from '../../stores/form/useFieldValues.js'\nimport { useInputModeStore } from '../../stores/inputMode/useInputModeStore.js'\nimport { formatTokenAmount, formatTokenPrice } from '../../utils/format.js'\nimport { InputPriceButton } from './PriceFormHelperText.style.js'\n\nexport const PriceFormHelperText: React.NamedExoticComponent<FormTypeProps> =\n memo<FormTypeProps>(({ formType }) => {\n const [chainId, tokenAddress] = useFieldValues(\n FormKeyHelper.getChainKey(formType),\n FormKeyHelper.getTokenKey(formType)\n )\n const { token, isLoading } = useTokenAddressBalance(chainId, tokenAddress)\n\n return (\n <PriceFormHelperTextBase\n formType={formType}\n isLoading={isLoading}\n tokenAddress={tokenAddress}\n token={token}\n />\n )\n })\n\nconst PriceFormHelperTextBase: React.FC<\n FormTypeProps & {\n isLoading?: boolean\n tokenAddress?: string\n token?: TokenAmount\n }\n> = ({ formType, isLoading, tokenAddress, token }) => {\n const { t } = useTranslation()\n const [amount] = useFieldValues(FormKeyHelper.getAmountKey(formType))\n const { inputMode, toggleInputMode } = useInputModeStore()\n\n const currentInputMode = inputMode[formType]\n\n const tokenAmount = token\n ? formatTokenAmount(token.amount, token.decimals)\n : '0'\n\n const getPriceAmountDisplayValue = () => {\n if (currentInputMode === 'amount') {\n const tokenPrice = formatTokenPrice(\n amount,\n token?.priceUSD,\n token?.decimals\n )\n return t('format.currency', { value: tokenPrice })\n } else {\n return t('format.tokenAmount', { value: amount || '0' })\n }\n }\n\n const handleToggleMode = (e: React.MouseEvent) => {\n e.stopPropagation()\n toggleInputMode(formType)\n }\n\n return (\n <FormHelperText\n component=\"div\"\n sx={{\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n margin: 0,\n marginLeft: 1.25,\n marginTop: 0.5,\n }}\n >\n <InputPriceButton\n onClick={token?.priceUSD ? handleToggleMode : undefined}\n >\n <Typography\n sx={{\n color: 'text.secondary',\n fontWeight: 500,\n fontSize: 12,\n lineHeight: 1,\n marginRight: 0.25,\n maxWidth: 136,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }}\n >\n {getPriceAmountDisplayValue()}\n </Typography>\n {currentInputMode === 'price' && token?.symbol ? (\n <Typography\n sx={{\n color: 'text.secondary',\n fontWeight: 500,\n fontSize: 12,\n lineHeight: 1,\n wordBreak: 'break-word',\n overflowWrap: 'break-word',\n marginRight: 0.25,\n }}\n >\n {token.symbol}\n </Typography>\n ) : null}\n {token?.priceUSD && <SwapVertIcon sx={{ fontSize: 14 }} />}\n </InputPriceButton>\n {isLoading && tokenAddress ? (\n <Skeleton variant=\"text\" width={56} height={16} />\n ) : token?.amount ? (\n <Typography\n sx={{\n fontWeight: 500,\n fontSize: 12,\n color: 'text.secondary',\n lineHeight: 1,\n paddingLeft: 0.25,\n }}\n title={tokenAmount}\n >\n {`/ ${t('format.tokenAmount', {\n value: tokenAmount,\n })}`}\n </Typography>\n ) : null}\n </FormHelperText>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAcA,MAAa,sBACX,MAAqB,EAAE,eAAe;CACpC,MAAM,CAAC,SAAS,gBAAgB,eAC9B,cAAc,YAAY,QAAQ,GAClC,cAAc,YAAY,QAAQ,CACpC;CACA,MAAM,EAAE,OAAO,cAAc,uBAAuB,SAAS,YAAY;CAEzE,OACE,oBAAC,yBAAD;EACY;EACC;EACG;EACP;CACR,CAAA;AAEL,CAAC;AAEH,MAAM,2BAMD,EAAE,UAAU,WAAW,cAAc,YAAY;CACpD,MAAM,EAAE,MAAM,eAAe;CAC7B,MAAM,CAAC,UAAU,eAAe,cAAc,aAAa,QAAQ,CAAC;CACpE,MAAM,EAAE,WAAW,oBAAoB,kBAAkB;CAEzD,MAAM,mBAAmB,UAAU;CAEnC,MAAM,cAAc,QAChB,kBAAkB,MAAM,QAAQ,MAAM,QAAQ,IAC9C;CAEJ,MAAM,mCAAmC;EACvC,IAAI,qBAAqB,UAAU;GACjC,MAAM,aAAa,iBACjB,QACA,OAAO,UACP,OAAO,QACT;GACA,OAAO,EAAE,mBAAmB,EAAE,OAAO,WAAW,CAAC;EACnD,OACE,OAAO,EAAE,sBAAsB,EAAE,OAAO,UAAU,IAAI,CAAC;CAE3D;CAEA,MAAM,oBAAoB,MAAwB;EAChD,EAAE,gBAAgB;EAClB,gBAAgB,QAAQ;CAC1B;CAEA,OACE,qBAAC,gBAAD;EACE,WAAU;EACV,IAAI;GACF,SAAS;GACT,gBAAgB;GAChB,YAAY;GACZ,QAAQ;GACR,YAAY;GACZ,WAAW;EACb;YATF,CAWE,qBAAC,kBAAD;GACE,SAAS,OAAO,WAAW,mBAAmB,KAAA;aADhD;IAGE,oBAAC,YAAD;KACE,IAAI;MACF,OAAO;MACP,YAAY;MACZ,UAAU;MACV,YAAY;MACZ,aAAa;MACb,UAAU;MACV,UAAU;MACV,cAAc;MACd,YAAY;KACd;eAEC,2BAA2B;IAClB,CAAA;IACX,qBAAqB,WAAW,OAAO,SACtC,oBAAC,YAAD;KACE,IAAI;MACF,OAAO;MACP,YAAY;MACZ,UAAU;MACV,YAAY;MACZ,WAAW;MACX,cAAc;MACd,aAAa;KACf;eAEC,MAAM;IACG,CAAA,IACV;IACH,OAAO,YAAY,oBAAC,cAAD,EAAc,IAAI,EAAE,UAAU,GAAG,EAAI,CAAA;GACzC;MACjB,aAAa,eACZ,oBAAC,UAAD;GAAU,SAAQ;GAAO,OAAO;GAAI,QAAQ;EAAK,CAAA,IAC/C,OAAO,SACT,oBAAC,YAAD;GACE,IAAI;IACF,YAAY;IACZ,UAAU;IACV,OAAO;IACP,YAAY;IACZ,aAAa;GACf;GACA,OAAO;aAEN,KAAK,EAAE,sBAAsB,EAC5B,OAAO,YACT,CAAC;EACS,CAAA,IACV,IACU;;AAEpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PriceFormHelperText.style.js","names":[],"sources":["../../../../src/components/AmountInput/PriceFormHelperText.style.tsx"],"sourcesContent":["import { Button, styled } from '@mui/material'\nimport type React from 'react'\n\nexport const InputPriceButton: React.FC<React.ComponentProps<typeof Button>> =\n styled(Button)(({ theme, onClick }) => ({\n color: theme.vars.palette.text.secondary,\n padding: theme.spacing(0.25, 0.5, 0.25, 0.75),\n maxHeight: 16,\n fontSize: '0.75rem',\n fontWeight: 500,\n borderRadius: `calc(${theme.vars.shape.borderRadius} * 2)`,\n backgroundColor: 'transparent',\n minWidth: 32,\n ...(onClick\n ? {\n '&:hover': {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n },\n ...theme.applyStyles('dark', {\n backgroundColor: 'transparent',\n '&:hover': {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n },\n }),\n }\n : {\n cursor: 'text',\n userSelect: 'text',\n pointerEvents: 'none',\n ...theme.applyStyles('dark', {\n backgroundColor: 'transparent',\n }),\n }),\n }))\n"],"mappings":";;AAGA,MAAa,mBACX,OAAO,MAAM,GAAG,EAAE,OAAO,eAAe;CACtC,OAAO,MAAM,KAAK,QAAQ,KAAK;CAC/B,SAAS,MAAM,QAAQ,KAAM,IAAK,KAAM,GAAI;CAC5C,WAAW;CACX,UAAU;CACV,YAAY;CACZ,cAAc,QAAQ,MAAM,KAAK,MAAM,aAAa;CACpD,iBAAiB;CACjB,UAAU;CACV,GAAI,UACA;EACE,WAAW,EACT,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa,mBAChF;EACA,GAAG,MAAM,YAAY,QAAQ;GAC3B,iBAAiB;GACjB,WAAW,EACT,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa,mBAChF;EACF,CAAC;CACH,IACA;EACE,QAAQ;EACR,YAAY;EACZ,eAAe;EACf,GAAG,MAAM,YAAY,QAAQ,EAC3B,iBAAiB,cACnB,CAAC;CACH;AACN,EAAE"}
1
+ {"version":3,"file":"PriceFormHelperText.style.js","names":[],"sources":["../../../../src/components/AmountInput/PriceFormHelperText.style.tsx"],"sourcesContent":["import { Button, styled } from '@mui/material'\nimport type React from 'react'\n\nexport const InputPriceButton: React.FC<React.ComponentProps<typeof Button>> =\n styled(Button)(({ theme, onClick }) => ({\n color: theme.vars.palette.text.secondary,\n padding: theme.spacing(0.25, 0.5, 0.25, 0.75),\n maxHeight: 16,\n fontSize: '0.75rem',\n fontWeight: 500,\n borderRadius: `calc(${theme.vars.shape.borderRadius} * 2)`,\n backgroundColor: 'transparent',\n minWidth: 32,\n ...(onClick\n ? {\n '&:hover': {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n },\n ...theme.applyStyles('dark', {\n backgroundColor: 'transparent',\n '&:hover': {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n },\n }),\n }\n : {\n cursor: 'text',\n userSelect: 'text',\n pointerEvents: 'none',\n ...theme.applyStyles('dark', {\n backgroundColor: 'transparent',\n }),\n }),\n }))\n"],"mappings":";;AAGA,MAAa,mBACX,OAAO,MAAM,CAAC,EAAE,EAAE,OAAO,eAAe;CACtC,OAAO,MAAM,KAAK,QAAQ,KAAK;CAC/B,SAAS,MAAM,QAAQ,KAAM,IAAK,KAAM,GAAI;CAC5C,WAAW;CACX,UAAU;CACV,YAAY;CACZ,cAAc,QAAQ,MAAM,KAAK,MAAM,aAAa;CACpD,iBAAiB;CACjB,UAAU;CACV,GAAI,UACA;EACE,WAAW,EACT,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa,mBAChF;EACA,GAAG,MAAM,YAAY,QAAQ;GAC3B,iBAAiB;GACjB,WAAW,EACT,iBAAiB,sBAAsB,MAAM,KAAK,QAAQ,OAAO,aAAa,mBAChF;EACF,CAAC;CACH,IACA;EACE,QAAQ;EACR,YAAY;EACZ,eAAe;EACf,GAAG,MAAM,YAAY,QAAQ,EAC3B,iBAAiB,cACnB,CAAC;CACH;AACN,EAAE"}
@@ -0,0 +1,98 @@
1
+ import { InputCard } from "../Card/InputCard.js";
2
+ import { Box, ButtonBase, InputBase, Typography, inputBaseClasses, styled } from "@mui/material";
3
+ const AmountCard = styled(InputCard, { shouldForwardProp: (prop) => !["formType", "mask"].includes(prop) })(({ theme, formType, mask = true }) => {
4
+ const cardVariant = theme.components?.MuiCard?.defaultProps?.variant;
5
+ const vertical = formType === "to" ? "-4px" : "calc(100% + 4px)";
6
+ return {
7
+ display: "flex",
8
+ flexDirection: "column",
9
+ gap: theme.spacing(1.5),
10
+ padding: theme.spacing(2),
11
+ ...cardVariant !== "outlined" && mask && { mask: `radial-gradient(circle 22px at 50% ${vertical}, #fff0 96%, #fff) 100% 100% / 100% 100% no-repeat` }
12
+ };
13
+ });
14
+ const CardHeaderRow = styled(Box)(({ theme }) => ({
15
+ display: "flex",
16
+ justifyContent: "space-between",
17
+ alignItems: "center",
18
+ padding: 0,
19
+ height: theme.spacing(2)
20
+ }));
21
+ const CardBodyRow = styled(Box)(({ theme }) => ({
22
+ display: "flex",
23
+ alignItems: "center",
24
+ gap: theme.spacing(2)
25
+ }));
26
+ const CardFooterRow = styled(Box)(({ theme }) => ({
27
+ display: "flex",
28
+ justifyContent: "space-between",
29
+ alignItems: "center",
30
+ height: theme.spacing(2)
31
+ }));
32
+ const LargeInput = styled(InputBase)(({ theme }) => ({
33
+ fontSize: 30,
34
+ fontWeight: 700,
35
+ lineHeight: 1.4,
36
+ height: 32,
37
+ flex: 1,
38
+ minWidth: 0,
39
+ boxShadow: "none",
40
+ [`.${inputBaseClasses.input}`]: {
41
+ height: 32,
42
+ padding: 0
43
+ },
44
+ [`.${inputBaseClasses.input}::placeholder`]: {
45
+ color: theme.vars.palette.text.primary,
46
+ opacity: .5
47
+ },
48
+ "& input[type=\"number\"]::-webkit-outer-spin-button, & input[type=\"number\"]::-webkit-inner-spin-button": {
49
+ WebkitAppearance: "none",
50
+ margin: 0
51
+ },
52
+ "& input[type=\"number\"]": { MozAppearance: "textfield" },
53
+ [`&.${inputBaseClasses.disabled}`]: { color: "inherit" },
54
+ [`.${inputBaseClasses.input}.${inputBaseClasses.disabled}`]: { WebkitTextFillColor: "unset" }
55
+ }));
56
+ const AmountDisplay = styled(Typography)(() => ({
57
+ fontSize: 30,
58
+ fontWeight: 700,
59
+ lineHeight: 1.4,
60
+ height: 32,
61
+ display: "flex",
62
+ alignItems: "center",
63
+ flex: 1,
64
+ minWidth: 0,
65
+ overflow: "visible",
66
+ whiteSpace: "nowrap"
67
+ }));
68
+ const FooterText = styled(Typography)(({ theme }) => ({
69
+ fontSize: 12,
70
+ fontWeight: 500,
71
+ lineHeight: 1,
72
+ color: theme.vars.palette.text.secondary
73
+ }));
74
+ const CardContainer = styled(Box)(() => ({
75
+ display: "flex",
76
+ flexDirection: "column",
77
+ position: "relative"
78
+ }));
79
+ const ToggleButton = styled(ButtonBase, { shouldForwardProp: (prop) => prop !== "clickable" })(({ theme, clickable }) => ({
80
+ display: "flex",
81
+ alignItems: "center",
82
+ gap: theme.spacing(.25),
83
+ borderRadius: theme.vars.shape.borderRadiusSecondary,
84
+ padding: theme.spacing(.25, .5, .25, .75),
85
+ marginLeft: theme.spacing(-.75),
86
+ backgroundColor: "transparent",
87
+ ...clickable ? {
88
+ cursor: "pointer",
89
+ "&:hover": { backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)` }
90
+ } : {
91
+ cursor: "default",
92
+ pointerEvents: "none"
93
+ }
94
+ }));
95
+ //#endregion
96
+ export { AmountCard, AmountDisplay, CardBodyRow, CardContainer, CardFooterRow, CardHeaderRow, FooterText, LargeInput, ToggleButton };
97
+
98
+ //# sourceMappingURL=AmountInputCard.style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmountInputCard.style.js","names":[],"sources":["../../../../src/components/AmountInputCard/AmountInputCard.style.tsx"],"sourcesContent":["import {\n Box,\n ButtonBase,\n InputBase,\n inputBaseClasses,\n styled,\n Typography,\n} from '@mui/material'\nimport type React from 'react'\nimport type { FormType } from '../../stores/form/types.js'\nimport { InputCard } from '../Card/InputCard.js'\n\nexport const maxInputFontSize = 30\nexport const minInputFontSize = 20\nexport const amountHeight = 32\nexport const footerFontSize = 12\n\nexport const AmountCard: React.FC<\n React.ComponentProps<typeof InputCard> & {\n formType?: FormType\n mask?: boolean\n }\n> = styled(InputCard, {\n shouldForwardProp: (prop) => !['formType', 'mask'].includes(prop as string),\n})<{ formType?: FormType; mask?: boolean }>(\n ({ theme, formType, mask = true }) => {\n const cardVariant = theme.components?.MuiCard?.defaultProps?.variant\n // Notch faces the swap button between the stacked cards: bottom edge for the\n // top (send) card, top edge for the bottom (receive) card.\n const vertical = formType === 'to' ? '-4px' : 'calc(100% + 4px)'\n return {\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(1.5),\n padding: theme.spacing(2),\n ...(cardVariant !== 'outlined' &&\n mask && {\n mask: `radial-gradient(circle 22px at 50% ${vertical}, #fff0 96%, #fff) 100% 100% / 100% 100% no-repeat`,\n }),\n }\n }\n)\n\nexport const CardHeaderRow: React.FC<React.ComponentProps<typeof Box>> = styled(\n Box\n)(({ theme }) => ({\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 0,\n height: theme.spacing(2),\n}))\n\nexport const CardBodyRow: React.FC<React.ComponentProps<typeof Box>> = styled(\n Box\n)(({ theme }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(2),\n}))\n\nexport const CardFooterRow: React.FC<React.ComponentProps<typeof Box>> = styled(\n Box\n)(({ theme }) => ({\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n height: theme.spacing(2),\n}))\n\nexport const LargeInput: React.FC<React.ComponentProps<typeof InputBase>> =\n styled(InputBase)(({ theme }) => ({\n fontSize: maxInputFontSize,\n fontWeight: 700,\n lineHeight: 1.4,\n height: amountHeight,\n flex: 1,\n minWidth: 0,\n boxShadow: 'none',\n [`.${inputBaseClasses.input}`]: {\n height: amountHeight,\n padding: 0,\n },\n [`.${inputBaseClasses.input}::placeholder`]: {\n color: theme.vars.palette.text.primary,\n opacity: 0.5,\n },\n '& input[type=\"number\"]::-webkit-outer-spin-button, & input[type=\"number\"]::-webkit-inner-spin-button':\n {\n WebkitAppearance: 'none',\n margin: 0,\n },\n '& input[type=\"number\"]': {\n MozAppearance: 'textfield',\n },\n [`&.${inputBaseClasses.disabled}`]: {\n color: 'inherit',\n },\n [`.${inputBaseClasses.input}.${inputBaseClasses.disabled}`]: {\n WebkitTextFillColor: 'unset',\n },\n }))\n\nexport const AmountDisplay: React.FC<React.ComponentProps<typeof Typography>> =\n styled(Typography)(() => ({\n fontSize: maxInputFontSize,\n fontWeight: 700,\n lineHeight: 1.4,\n height: amountHeight,\n display: 'flex',\n alignItems: 'center',\n flex: 1,\n minWidth: 0,\n overflow: 'visible',\n whiteSpace: 'nowrap',\n }))\n\nexport const FooterText: React.FC<React.ComponentProps<typeof Typography>> =\n styled(Typography)(({ theme }) => ({\n fontSize: footerFontSize,\n fontWeight: 500,\n lineHeight: 1,\n color: theme.vars.palette.text.secondary,\n }))\n\nexport const CardContainer: React.FC<React.ComponentProps<typeof Box>> = styled(\n Box\n)(() => ({\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n}))\n\nexport const ToggleButton: React.FC<\n React.ComponentProps<typeof ButtonBase> & { clickable?: boolean }\n> = styled(ButtonBase, {\n shouldForwardProp: (prop) => prop !== 'clickable',\n})<{ clickable?: boolean }>(({ theme, clickable }) => ({\n display: 'flex',\n alignItems: 'center',\n gap: theme.spacing(0.25),\n borderRadius: theme.vars.shape.borderRadiusSecondary,\n padding: theme.spacing(0.25, 0.5, 0.25, 0.75),\n marginLeft: theme.spacing(-0.75),\n backgroundColor: 'transparent',\n ...(clickable\n ? {\n cursor: 'pointer',\n '&:hover': {\n backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,\n },\n }\n : {\n cursor: 'default',\n pointerEvents: 'none',\n }),\n}))\n"],"mappings":";;AAiBA,MAAa,aAKT,OAAO,WAAW,EACpB,oBAAoB,SAAS,CAAC,CAAC,YAAY,MAAM,CAAC,CAAC,SAAS,IAAc,EAC5E,CAAC,CAAC,EACC,EAAE,OAAO,UAAU,OAAO,WAAW;CACpC,MAAM,cAAc,MAAM,YAAY,SAAS,cAAc;CAG7D,MAAM,WAAW,aAAa,OAAO,SAAS;CAC9C,OAAO;EACL,SAAS;EACT,eAAe;EACf,KAAK,MAAM,QAAQ,GAAG;EACtB,SAAS,MAAM,QAAQ,CAAC;EACxB,GAAI,gBAAgB,cAClB,QAAQ,EACN,MAAM,sCAAsC,SAAS,oDACvD;CACJ;AACF,CACF;AAEA,MAAa,gBAA4D,OACvE,GACF,CAAC,EAAE,EAAE,aAAa;CAChB,SAAS;CACT,gBAAgB;CAChB,YAAY;CACZ,SAAS;CACT,Q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