@lifi/widget 3.0.0-alpha.33 → 3.0.0-alpha.34

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 (327) hide show
  1. package/App.tsx +6 -3
  2. package/AppDefault.tsx +3 -3
  3. package/AppDrawer.tsx +3 -5
  4. package/_esm/App.js +6 -3
  5. package/_esm/App.js.map +1 -1
  6. package/_esm/AppDefault.js +3 -3
  7. package/_esm/AppDefault.js.map +1 -1
  8. package/_esm/AppDrawer.js +3 -3
  9. package/_esm/AppDrawer.js.map +1 -1
  10. package/_esm/components/ActiveTransactions/ActiveTransactions.d.ts +2 -2
  11. package/_esm/components/ActiveTransactions/ActiveTransactions.js +1 -1
  12. package/_esm/components/ActiveTransactions/ActiveTransactions.js.map +1 -1
  13. package/_esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +1 -1
  14. package/_esm/components/AmountInput/AmountInput.d.ts +3 -3
  15. package/_esm/components/AmountInput/AmountInput.js +2 -2
  16. package/_esm/components/AmountInput/AmountInput.js.map +1 -1
  17. package/_esm/components/AppContainer.js +3 -2
  18. package/_esm/components/AppContainer.js.map +1 -1
  19. package/_esm/components/Avatar/AccountAvatar.d.ts +3 -1
  20. package/_esm/components/Avatar/AccountAvatar.js +3 -3
  21. package/_esm/components/Avatar/AccountAvatar.js.map +1 -1
  22. package/_esm/components/Avatar/utils.d.ts +1 -1
  23. package/_esm/components/Avatar/utils.js +1 -1
  24. package/_esm/components/Avatar/utils.js.map +1 -1
  25. package/_esm/components/Card/Card.d.ts +7 -19
  26. package/_esm/components/Card/Card.js +36 -42
  27. package/_esm/components/Card/Card.js.map +1 -1
  28. package/_esm/components/Card/CardLabel.js +5 -3
  29. package/_esm/components/Card/CardLabel.js.map +1 -1
  30. package/_esm/components/Card/InputCard.d.ts +4 -0
  31. package/_esm/components/Card/InputCard.js +7 -0
  32. package/_esm/components/Card/InputCard.js.map +1 -0
  33. package/_esm/components/ChainSelect/ChainSelect.js +1 -1
  34. package/_esm/components/ChainSelect/ChainSelect.js.map +1 -1
  35. package/_esm/components/ChainSelect/ChainSelect.style.d.ts +2 -10
  36. package/_esm/components/ContractComponent/ContractComponent.d.ts +2 -2
  37. package/_esm/components/ContractComponent/ContractComponent.js.map +1 -1
  38. package/_esm/components/ContractComponent/ItemPrice.d.ts +8 -0
  39. package/_esm/components/ContractComponent/ItemPrice.js +23 -0
  40. package/_esm/components/ContractComponent/ItemPrice.js.map +1 -0
  41. package/_esm/components/{NFT → ContractComponent/NFT}/NFT.js +5 -11
  42. package/_esm/components/ContractComponent/NFT/NFT.js.map +1 -0
  43. package/_esm/components/ContractComponent/NFT/NFT.style.js.map +1 -0
  44. package/_esm/components/{NFT → ContractComponent/NFT}/NFTBase.js +1 -1
  45. package/_esm/components/ContractComponent/NFT/NFTBase.js.map +1 -0
  46. package/_esm/components/{NFT → ContractComponent/NFT}/types.d.ts +2 -3
  47. package/_esm/components/ContractComponent/NFT/types.js.map +1 -0
  48. package/_esm/components/Dialog.d.ts +2 -9
  49. package/_esm/components/Dialog.js +1 -0
  50. package/_esm/components/Dialog.js.map +1 -1
  51. package/_esm/components/Header/BackButton.d.ts +3 -0
  52. package/_esm/components/Header/BackButton.js +8 -0
  53. package/_esm/components/Header/BackButton.js.map +1 -0
  54. package/_esm/components/Header/CloseDrawerButton.d.ts +5 -1
  55. package/_esm/components/Header/CloseDrawerButton.js +8 -2
  56. package/_esm/components/Header/CloseDrawerButton.js.map +1 -1
  57. package/_esm/components/Header/Header.style.d.ts +4 -1
  58. package/_esm/components/Header/Header.style.js +24 -16
  59. package/_esm/components/Header/Header.style.js.map +1 -1
  60. package/_esm/components/Header/NavigationHeader.js +8 -9
  61. package/_esm/components/Header/NavigationHeader.js.map +1 -1
  62. package/_esm/components/Header/NavigationTabs.js +1 -1
  63. package/_esm/components/Header/NavigationTabs.js.map +1 -1
  64. package/_esm/components/Header/SettingsButton.style.d.ts +1 -1
  65. package/_esm/components/Header/TransactionHistoryButton.js +1 -1
  66. package/_esm/components/Header/TransactionHistoryButton.js.map +1 -1
  67. package/_esm/components/Header/WalletHeader.js +4 -11
  68. package/_esm/components/Header/WalletHeader.js.map +1 -1
  69. package/_esm/components/Header/WalletMenu.js +2 -2
  70. package/_esm/components/Header/WalletMenu.js.map +1 -1
  71. package/_esm/components/Insurance/types.d.ts +3 -3
  72. package/_esm/components/ListItem/ListItem.d.ts +1 -1
  73. package/_esm/components/PageContainer.d.ts +2 -1
  74. package/_esm/components/PageContainer.js +3 -3
  75. package/_esm/components/PageContainer.js.map +1 -1
  76. package/_esm/components/ReverseTokensButton/ReverseTokensButton.js +2 -2
  77. package/_esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
  78. package/_esm/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +9 -3
  79. package/_esm/components/ReverseTokensButton/ReverseTokensButton.style.js +24 -14
  80. package/_esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
  81. package/_esm/components/RouteCard/RouteCard.js +2 -2
  82. package/_esm/components/RouteCard/RouteCard.js.map +1 -1
  83. package/_esm/components/RouteCard/RouteCardSkeleton.d.ts +2 -2
  84. package/_esm/components/RouteCard/RouteCardSkeleton.js +1 -1
  85. package/_esm/components/RouteCard/RouteCardSkeleton.js.map +1 -1
  86. package/_esm/components/Routes/Routes.d.ts +2 -2
  87. package/_esm/components/Routes/Routes.js +1 -1
  88. package/_esm/components/Routes/Routes.js.map +1 -1
  89. package/_esm/components/Routes/RoutesExpanded.js +9 -3
  90. package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
  91. package/_esm/components/Routes/RoutesExpanded.style.js +1 -0
  92. package/_esm/components/Routes/RoutesExpanded.style.js.map +1 -1
  93. package/_esm/components/SelectChainAndToken.js +3 -6
  94. package/_esm/components/SelectChainAndToken.js.map +1 -1
  95. package/_esm/components/SelectTokenButton/SelectTokenButton.js +9 -10
  96. package/_esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
  97. package/_esm/components/SelectTokenButton/SelectTokenButton.style.d.ts +10 -0
  98. package/_esm/components/SelectTokenButton/SelectTokenButton.style.js +41 -1
  99. package/_esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
  100. package/_esm/components/SendToWallet/SendToWalletButton.d.ts +2 -2
  101. package/_esm/components/SendToWallet/SendToWalletButton.js +2 -2
  102. package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  103. package/_esm/components/Step/Step.js +8 -8
  104. package/_esm/components/Step/Step.js.map +1 -1
  105. package/_esm/components/Step/StepList.js +1 -1
  106. package/_esm/components/Step/StepList.js.map +1 -1
  107. package/_esm/components/StepActions/StepActions.d.ts +4 -9
  108. package/_esm/components/StepActions/StepActions.js +13 -12
  109. package/_esm/components/StepActions/StepActions.js.map +1 -1
  110. package/_esm/components/StepActions/types.d.ts +8 -2
  111. package/_esm/components/TokenList/TokenList.js +4 -1
  112. package/_esm/components/TokenList/TokenList.js.map +1 -1
  113. package/_esm/components/TokenList/TokenList.style.d.ts +1 -1
  114. package/_esm/components/TokenList/TokenList.style.js +1 -1
  115. package/_esm/components/TokenList/TokenList.style.js.map +1 -1
  116. package/_esm/components/TokenList/VirtualizedTokenList.js +19 -18
  117. package/_esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
  118. package/_esm/components/TokenList/useTokenSelect.js +1 -1
  119. package/_esm/components/TokenList/useTokenSelect.js.map +1 -1
  120. package/_esm/components/TokenList/utils.d.ts +2 -0
  121. package/_esm/components/TokenList/utils.js +35 -0
  122. package/_esm/components/TokenList/utils.js.map +1 -0
  123. package/_esm/config/version.d.ts +1 -1
  124. package/_esm/config/version.js +1 -1
  125. package/_esm/hooks/useAddressValidation.d.ts +1 -1
  126. package/_esm/hooks/useGasRecommendation.d.ts +1 -1
  127. package/_esm/hooks/useProcessMessage.d.ts +2 -2
  128. package/_esm/hooks/useProcessMessage.js +16 -12
  129. package/_esm/hooks/useProcessMessage.js.map +1 -1
  130. package/_esm/hooks/useRoutes.d.ts +2 -2
  131. package/_esm/hooks/useRoutes.js +11 -20
  132. package/_esm/hooks/useRoutes.js.map +1 -1
  133. package/_esm/hooks/useTokenAddressBalance.d.ts +1 -1
  134. package/_esm/hooks/useTokenBalance.d.ts +1 -1
  135. package/_esm/hooks/useTokenBalances.d.ts +1 -1
  136. package/_esm/hooks/useWideVariant.d.ts +1 -0
  137. package/_esm/hooks/{useExpandableVariant.js → useWideVariant.js} +3 -3
  138. package/_esm/hooks/useWideVariant.js.map +1 -0
  139. package/_esm/i18n/en.json +9 -5
  140. package/_esm/i18n/index.js +14 -14
  141. package/_esm/i18n/index.js.map +1 -1
  142. package/_esm/index.d.ts +6 -3
  143. package/_esm/index.js +6 -3
  144. package/_esm/index.js.map +1 -1
  145. package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +9 -2
  146. package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
  147. package/_esm/pages/LanguagesPage.js +1 -0
  148. package/_esm/pages/LanguagesPage.js.map +1 -1
  149. package/_esm/pages/MainPage/MainPage.js +4 -4
  150. package/_esm/pages/MainPage/MainPage.js.map +1 -1
  151. package/_esm/pages/MainPage/ReviewButton.js +2 -2
  152. package/_esm/pages/MainPage/ReviewButton.js.map +1 -1
  153. package/_esm/pages/RoutesPage/RoutesPage.js +1 -8
  154. package/_esm/pages/RoutesPage/RoutesPage.js.map +1 -1
  155. package/_esm/pages/RoutesPage/RoutesPage.style.js +1 -1
  156. package/_esm/pages/SelectChainPage/SelectChainPage.js +1 -0
  157. package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
  158. package/_esm/pages/SelectEnabledToolsPage.js +4 -2
  159. package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
  160. package/_esm/pages/SelectNativeTokenPage.js +1 -0
  161. package/_esm/pages/SelectNativeTokenPage.js.map +1 -1
  162. package/_esm/pages/SelectTokenPage/SearchTokenInput.js +2 -2
  163. package/_esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
  164. package/_esm/pages/SelectTokenPage/SelectTokenPage.js +1 -1
  165. package/_esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
  166. package/_esm/pages/SelectWalletPage/SelectWalletPage.js +1 -0
  167. package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
  168. package/_esm/pages/SendToWallet/BookmarkAddressSheet.js +1 -1
  169. package/_esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
  170. package/_esm/pages/SendToWallet/SendToConfiguredWalletPage.js +1 -1
  171. package/_esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
  172. package/_esm/pages/SendToWallet/SendToWalletPage.js +3 -1
  173. package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  174. package/_esm/pages/SendToWallet/SendToWalletPage.style.d.ts +2 -10
  175. package/_esm/pages/SendToWallet/SendToWalletPage.style.js +3 -2
  176. package/_esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
  177. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -1
  178. package/_esm/pages/SettingsPage/SettingsPage.js +1 -1
  179. package/_esm/pages/SettingsPage/SettingsPage.js.map +1 -1
  180. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +3 -3
  181. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
  182. package/_esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +1 -1
  183. package/_esm/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js.map +1 -1
  184. package/_esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +6 -3
  185. package/_esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
  186. package/_esm/pages/TransactionPage/StatusBottomSheet.js +6 -6
  187. package/_esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
  188. package/_esm/pages/TransactionPage/TransactionPage.js +7 -7
  189. package/_esm/pages/TransactionPage/TransactionPage.js.map +1 -1
  190. package/_esm/providers/ThemeProvider/ThemeProvider.js +1 -1
  191. package/_esm/providers/ThemeProvider/ThemeProvider.js.map +1 -1
  192. package/_esm/stores/StoreProvider.js +1 -1
  193. package/_esm/stores/StoreProvider.js.map +1 -1
  194. package/_esm/stores/form/createFormStore.js +1 -6
  195. package/_esm/stores/form/createFormStore.js.map +1 -1
  196. package/_esm/stores/form/types.d.ts +4 -6
  197. package/_esm/stores/form/types.js.map +1 -1
  198. package/_esm/stores/form/useFieldController.d.ts +1 -1
  199. package/_esm/stores/form/useFieldValues.js +1 -1
  200. package/_esm/stores/form/useFieldValues.js.map +1 -1
  201. package/_esm/stores/form/useTouchedFields.d.ts +1 -4
  202. package/_esm/stores/settings/types.d.ts +4 -4
  203. package/_esm/stores/settings/useSettings.d.ts +1 -1
  204. package/_esm/themes/createTheme.d.ts +3 -0
  205. package/_esm/themes/createTheme.js +356 -0
  206. package/_esm/themes/createTheme.js.map +1 -0
  207. package/_esm/themes/jumper.d.ts +2 -0
  208. package/_esm/themes/jumper.js +36 -0
  209. package/_esm/themes/jumper.js.map +1 -0
  210. package/_esm/themes/types.d.ts +49 -0
  211. package/_esm/themes/types.js +2 -0
  212. package/_esm/{components/NFT → themes}/types.js.map +1 -1
  213. package/_esm/themes/utils.d.ts +4 -0
  214. package/_esm/themes/utils.js +9 -0
  215. package/_esm/themes/utils.js.map +1 -0
  216. package/_esm/themes/windows95.d.ts +2 -0
  217. package/_esm/themes/windows95.js +92 -0
  218. package/_esm/themes/windows95.js.map +1 -0
  219. package/_esm/types/events.d.ts +3 -1
  220. package/_esm/types/events.js +1 -0
  221. package/_esm/types/events.js.map +1 -1
  222. package/_esm/types/widget.d.ts +40 -27
  223. package/_esm/types/widget.js.map +1 -1
  224. package/_esm/utils/item.d.ts +1 -1
  225. package/components/ActiveTransactions/ActiveTransactions.tsx +3 -3
  226. package/components/AmountInput/AmountInput.tsx +6 -6
  227. package/components/AppContainer.tsx +2 -2
  228. package/components/Avatar/AccountAvatar.tsx +21 -17
  229. package/components/Avatar/utils.ts +1 -1
  230. package/components/Card/Card.tsx +45 -74
  231. package/components/Card/CardLabel.tsx +15 -3
  232. package/components/Card/InputCard.tsx +7 -0
  233. package/components/ChainSelect/ChainSelect.tsx +6 -2
  234. package/components/ContractComponent/ContractComponent.tsx +2 -2
  235. package/components/ContractComponent/ItemPrice.tsx +33 -0
  236. package/components/{NFT → ContractComponent/NFT}/NFT.tsx +5 -11
  237. package/components/{NFT → ContractComponent/NFT}/NFTBase.tsx +1 -1
  238. package/components/{NFT → ContractComponent/NFT}/types.ts +2 -3
  239. package/components/Dialog.tsx +3 -2
  240. package/components/Header/BackButton.tsx +17 -0
  241. package/components/Header/CloseDrawerButton.tsx +16 -3
  242. package/components/Header/Header.style.ts +25 -16
  243. package/components/Header/NavigationHeader.tsx +8 -11
  244. package/components/Header/NavigationTabs.tsx +1 -1
  245. package/components/Header/TransactionHistoryButton.tsx +0 -1
  246. package/components/Header/WalletHeader.tsx +5 -12
  247. package/components/Header/WalletMenu.tsx +2 -2
  248. package/components/Insurance/types.ts +3 -3
  249. package/components/PageContainer.ts +6 -5
  250. package/components/ReverseTokensButton/ReverseTokensButton.style.tsx +26 -21
  251. package/components/ReverseTokensButton/ReverseTokensButton.tsx +10 -8
  252. package/components/RouteCard/RouteCard.tsx +2 -2
  253. package/components/RouteCard/RouteCardSkeleton.tsx +5 -6
  254. package/components/Routes/Routes.tsx +3 -3
  255. package/components/Routes/RoutesExpanded.style.ts +1 -0
  256. package/components/Routes/RoutesExpanded.tsx +11 -4
  257. package/components/SelectChainAndToken.tsx +7 -13
  258. package/components/SelectTokenButton/SelectTokenButton.style.tsx +51 -1
  259. package/components/SelectTokenButton/SelectTokenButton.tsx +43 -38
  260. package/components/SendToWallet/SendToWalletButton.tsx +8 -8
  261. package/components/Step/Step.tsx +8 -8
  262. package/components/Step/StepList.tsx +1 -1
  263. package/components/StepActions/StepActions.tsx +40 -21
  264. package/components/StepActions/types.ts +12 -2
  265. package/components/TokenList/TokenList.style.tsx +1 -1
  266. package/components/TokenList/TokenList.tsx +9 -6
  267. package/components/TokenList/VirtualizedTokenList.tsx +26 -20
  268. package/components/TokenList/useTokenSelect.ts +1 -1
  269. package/components/TokenList/utils.ts +42 -0
  270. package/config/version.ts +1 -1
  271. package/hooks/useProcessMessage.ts +38 -15
  272. package/hooks/useRoutes.ts +13 -30
  273. package/hooks/{useExpandableVariant.ts → useWideVariant.ts} +2 -2
  274. package/i18n/en.json +9 -5
  275. package/i18n/index.ts +14 -14
  276. package/index.ts +6 -3
  277. package/package.json +15 -15
  278. package/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +20 -5
  279. package/pages/LanguagesPage.tsx +1 -0
  280. package/pages/MainPage/MainPage.tsx +12 -10
  281. package/pages/MainPage/ReviewButton.tsx +2 -2
  282. package/pages/RoutesPage/RoutesPage.style.ts +1 -1
  283. package/pages/RoutesPage/RoutesPage.tsx +1 -9
  284. package/pages/SelectChainPage/SelectChainPage.tsx +1 -0
  285. package/pages/SelectEnabledToolsPage.tsx +8 -1
  286. package/pages/SelectNativeTokenPage.tsx +1 -0
  287. package/pages/SelectTokenPage/SearchTokenInput.tsx +3 -3
  288. package/pages/SelectTokenPage/SelectTokenPage.tsx +1 -1
  289. package/pages/SelectWalletPage/SelectWalletPage.tsx +1 -0
  290. package/pages/SendToWallet/BookmarkAddressSheet.tsx +2 -4
  291. package/pages/SendToWallet/SendToConfiguredWalletPage.tsx +1 -0
  292. package/pages/SendToWallet/SendToWalletPage.style.tsx +3 -2
  293. package/pages/SendToWallet/SendToWalletPage.tsx +7 -2
  294. package/pages/SettingsPage/SettingsPage.tsx +1 -1
  295. package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +7 -8
  296. package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.tsx +1 -1
  297. package/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +19 -16
  298. package/pages/TransactionPage/StatusBottomSheet.tsx +7 -11
  299. package/pages/TransactionPage/TransactionPage.tsx +12 -16
  300. package/providers/ThemeProvider/ThemeProvider.tsx +1 -1
  301. package/stores/StoreProvider.tsx +1 -1
  302. package/stores/form/createFormStore.ts +1 -6
  303. package/stores/form/types.ts +4 -6
  304. package/stores/form/useFieldValues.ts +1 -1
  305. package/stores/settings/types.ts +4 -4
  306. package/themes/createTheme.ts +415 -0
  307. package/themes/jumper.ts +37 -0
  308. package/themes/types.ts +63 -0
  309. package/themes/utils.ts +18 -0
  310. package/themes/windows95.ts +98 -0
  311. package/types/events.ts +2 -0
  312. package/types/widget.ts +54 -32
  313. package/_esm/components/NFT/NFT.js.map +0 -1
  314. package/_esm/components/NFT/NFT.style.js.map +0 -1
  315. package/_esm/components/NFT/NFTBase.js.map +0 -1
  316. package/_esm/config/theme.d.ts +0 -27
  317. package/_esm/config/theme.js +0 -250
  318. package/_esm/config/theme.js.map +0 -1
  319. package/_esm/hooks/useExpandableVariant.d.ts +0 -1
  320. package/_esm/hooks/useExpandableVariant.js.map +0 -1
  321. package/config/theme.ts +0 -321
  322. /package/_esm/components/{NFT → ContractComponent/NFT}/NFT.d.ts +0 -0
  323. /package/_esm/components/{NFT → ContractComponent/NFT}/NFT.style.d.ts +0 -0
  324. /package/_esm/components/{NFT → ContractComponent/NFT}/NFT.style.js +0 -0
  325. /package/_esm/components/{NFT → ContractComponent/NFT}/NFTBase.d.ts +0 -0
  326. /package/_esm/components/{NFT → ContractComponent/NFT}/types.js +0 -0
  327. /package/components/{NFT → ContractComponent/NFT}/NFT.style.ts +0 -0
@@ -1,12 +1,40 @@
1
- import type { BaseToken, ChainType, Order, RouteOptions, SDKConfig, StaticToken, Token } from '@lifi/sdk';
1
+ import type { BaseToken, ChainType, ContractCall, Order, RouteOptions, SDKConfig, StaticToken, Token } from '@lifi/sdk';
2
2
  import type { Components, PaletteMode, PaletteOptions, Shape, Theme } from '@mui/material';
3
3
  import type { TypographyOptions } from '@mui/material/styles/createTypography.js';
4
4
  import type { CoinbaseWalletParameters, WalletConnectParameters } from '@wagmi/connectors';
5
5
  import type { CSSProperties, ReactNode, RefObject } from 'react';
6
6
  import type { LanguageKey, LanguageResources } from '../providers/I18nProvider/types.js';
7
- export type WidgetVariant = 'default' | 'expandable' | 'drawer';
8
- export type WidgetSubvariant = 'default' | 'split' | 'nft' | 'refuel';
9
- export type SplitSubvariantOptions = 'bridge' | 'swap';
7
+ export type WidgetVariant = 'compact' | 'wide' | 'drawer';
8
+ export type WidgetSubvariant = 'default' | 'split' | 'custom' | 'refuel';
9
+ export type SplitSubvariant = 'bridge' | 'swap';
10
+ export type CustomSubvariant = 'checkout' | 'deposit';
11
+ export interface SubvariantOptions {
12
+ split?: SplitSubvariant;
13
+ custom?: CustomSubvariant;
14
+ }
15
+ export type Appearance = PaletteMode | 'auto';
16
+ export interface NavigationProps {
17
+ /**
18
+ * If given, uses a negative margin to counteract the padding on sides for navigation elements like icon buttons.
19
+ * @default true
20
+ */
21
+ edge?: boolean;
22
+ /**
23
+ * If true, makes navigation header components compact.
24
+ * @default true
25
+ */
26
+ dense?: boolean;
27
+ }
28
+ export type WidgetThemeComponents = Pick<Components<Theme>, 'MuiAppBar' | 'MuiAvatar' | 'MuiButton' | 'MuiCard' | 'MuiIconButton' | 'MuiInputCard'>;
29
+ export type WidgetTheme = {
30
+ palette?: Pick<PaletteOptions, 'background' | 'grey' | 'primary' | 'secondary' | 'text'>;
31
+ shape?: Shape;
32
+ typography?: TypographyOptions;
33
+ components?: WidgetThemeComponents;
34
+ container?: CSSProperties;
35
+ playground?: CSSProperties;
36
+ navigation?: NavigationProps;
37
+ };
10
38
  export declare enum DisabledUI {
11
39
  FromAmount = "fromAmount",
12
40
  FromToken = "fromToken",
@@ -29,22 +57,11 @@ export declare enum RequiredUI {
29
57
  ToAddress = "toAddress"
30
58
  }
31
59
  export type RequiredUIType = `${RequiredUI}`;
32
- export type Appearance = PaletteMode | 'auto';
33
- export type ThemeConfig = {
34
- palette?: Pick<PaletteOptions, 'background' | 'grey' | 'primary' | 'secondary' | 'text'>;
35
- shape?: Shape;
36
- typography?: TypographyOptions;
37
- components?: Pick<Components<Omit<Theme, 'components'>>, 'MuiAvatar'>;
38
- };
39
60
  export interface WidgetWalletConfig {
40
61
  onConnect(): void;
41
62
  walletConnect?: WalletConnectParameters;
42
63
  coinbase?: CoinbaseWalletParameters;
43
64
  }
44
- export interface AllowDeny<T> {
45
- allow?: T[];
46
- deny?: T[];
47
- }
48
65
  export interface WidgetSDKConfig extends Omit<SDKConfig, 'apiKey' | 'disableVersionCheck' | 'integrator' | 'routeOptions' | 'widgetVersion'> {
49
66
  routeOptions?: Omit<RouteOptions, 'bridges' | 'exchanges' | 'insurance'>;
50
67
  }
@@ -52,18 +69,15 @@ export interface WidgetContractTool {
52
69
  logoURI: string;
53
70
  name: string;
54
71
  }
55
- export interface WidgetContract {
56
- address?: string;
57
- callData?: string;
58
- gasLimit?: string;
59
- approvalAddress?: string;
60
- outputToken?: string;
61
- fallbackAddress?: string;
62
- }
63
72
  export interface ToAddress {
64
73
  name?: string;
65
74
  address: string;
66
75
  chainType: ChainType;
76
+ logoURI?: string;
77
+ }
78
+ export interface AllowDeny<T> {
79
+ allow?: T[];
80
+ deny?: T[];
67
81
  }
68
82
  export interface WidgetConfig {
69
83
  fromChain?: number;
@@ -74,7 +88,7 @@ export interface WidgetConfig {
74
88
  toAddresses?: ToAddress[];
75
89
  fromAmount?: number | string;
76
90
  toAmount?: number | string;
77
- contract?: WidgetContract;
91
+ contractCalls?: ContractCall[];
78
92
  contractComponent?: ReactNode;
79
93
  contractSecondaryComponent?: ReactNode;
80
94
  contractCompactComponent?: ReactNode;
@@ -88,10 +102,9 @@ export interface WidgetConfig {
88
102
  insurance?: boolean;
89
103
  variant?: WidgetVariant;
90
104
  subvariant?: WidgetSubvariant;
91
- subvariantOptions?: SplitSubvariantOptions;
105
+ subvariantOptions?: SubvariantOptions;
92
106
  appearance?: Appearance;
93
- theme?: ThemeConfig;
94
- containerStyle?: CSSProperties;
107
+ theme?: WidgetTheme;
95
108
  disabledUI?: DisabledUIType[];
96
109
  hiddenUI?: HiddenUIType[];
97
110
  requiredUI?: RequiredUIType[];
@@ -1 +1 @@
1
- {"version":3,"file":"widget.js","sourceRoot":"","sources":["../../types/widget.ts"],"names":[],"mappings":"AA+BA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;AACrB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAGD,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,mDAAuC,CAAA;IACvC,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;IACrB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA;IACvB,+BAAmB,CAAA;IACnB,qCAAyB,CAAA;AAC3B,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAGD,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,qCAAuB,CAAA;AACzB,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB"}
1
+ {"version":3,"file":"widget.js","sourceRoot":"","sources":["../../types/widget.ts"],"names":[],"mappings":"AAwEA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;AACrB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAGD,MAAM,CAAN,IAAY,QASX;AATD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,mDAAuC,CAAA;IACvC,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;IACrB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA;IACvB,+BAAmB,CAAA;IACnB,qCAAyB,CAAA;AAC3B,CAAC,EATW,QAAQ,KAAR,QAAQ,QASnB;AAGD,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,qCAAuB,CAAA;AACzB,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB"}
@@ -1,2 +1,2 @@
1
1
  import type { AllowDeny } from '../types/widget.js';
2
- export declare const isItemAllowed: <T>(itemId: T, items?: AllowDeny<T> | undefined) => boolean;
2
+ export declare const isItemAllowed: <T>(itemId: T, items?: AllowDeny<T>) => boolean;
@@ -1,4 +1,4 @@
1
- import type { BoxProps } from '@mui/material';
1
+ import type { CardProps } from '@mui/material';
2
2
  import { Stack } from '@mui/material';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useNavigate } from 'react-router-dom';
@@ -9,7 +9,7 @@ import { CardTitle } from '../Card/CardTitle.js';
9
9
  import { ActiveTransactionItem } from './ActiveTransactionItem.js';
10
10
  import { ShowAllButton } from './ActiveTransactions.style.js';
11
11
 
12
- export const ActiveTransactions: React.FC<BoxProps> = (props) => {
12
+ export const ActiveTransactions: React.FC<CardProps> = (props) => {
13
13
  const { t } = useTranslation();
14
14
  const navigate = useNavigate();
15
15
  const executingRoutes = useExecutingRoutesIds();
@@ -25,7 +25,7 @@ export const ActiveTransactions: React.FC<BoxProps> = (props) => {
25
25
  const hasShowAll = executingRoutes?.length > 2;
26
26
 
27
27
  return (
28
- <Card variant="selected" selectionColor="secondary" {...props}>
28
+ <Card type="selected" selectionColor="secondary" {...props}>
29
29
  <CardTitle>{t('header.activeTransactions')}</CardTitle>
30
30
  <Stack spacing={1.5} pt={1.5} pb={hasShowAll ? 0 : 2}>
31
31
  {executingRoutes.slice(0, 2).map((routeId) => (
@@ -1,5 +1,5 @@
1
1
  import type { Token } from '@lifi/sdk';
2
- import type { BoxProps } from '@mui/material';
2
+ import type { CardProps } from '@mui/material';
3
3
  import type { ChangeEvent, ReactNode } from 'react';
4
4
  import { useLayoutEffect, useRef } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
@@ -11,8 +11,8 @@ import { useFieldValues } from '../../stores/form/useFieldValues.js';
11
11
  import { DisabledUI } from '../../types/widget.js';
12
12
  import { formatInputAmount } from '../../utils/format.js';
13
13
  import { fitInputText } from '../../utils/input.js';
14
- import { Card } from '../Card/Card.js';
15
14
  import { CardTitle } from '../Card/CardTitle.js';
15
+ import { InputCard } from '../Card/InputCard.js';
16
16
  import {
17
17
  FormContainer,
18
18
  FormControl,
@@ -24,7 +24,7 @@ import { AmountInputEndAdornment } from './AmountInputEndAdornment.js';
24
24
  import { AmountInputStartAdornment } from './AmountInputStartAdornment.js';
25
25
  import { PriceFormHelperText } from './PriceFormHelperText.js';
26
26
 
27
- export const AmountInput: React.FC<FormTypeProps & BoxProps> = ({
27
+ export const AmountInput: React.FC<FormTypeProps & CardProps> = ({
28
28
  formType,
29
29
  ...props
30
30
  }) => {
@@ -53,7 +53,7 @@ export const AmountInput: React.FC<FormTypeProps & BoxProps> = ({
53
53
 
54
54
  export const AmountInputBase: React.FC<
55
55
  FormTypeProps &
56
- BoxProps & {
56
+ CardProps & {
57
57
  token?: Token;
58
58
  startAdornment?: ReactNode;
59
59
  endAdornment?: ReactNode;
@@ -98,7 +98,7 @@ export const AmountInputBase: React.FC<
98
98
  }, [value, ref]);
99
99
 
100
100
  return (
101
- <Card {...props}>
101
+ <InputCard {...props}>
102
102
  <CardTitle>{t('main.fromAmount')}</CardTitle>
103
103
  <FormContainer>
104
104
  <AmountInputStartAdornment formType={formType} />
@@ -123,6 +123,6 @@ export const AmountInputBase: React.FC<
123
123
  {bottomAdornment}
124
124
  </FormControl>
125
125
  </FormContainer>
126
- </Card>
126
+ </InputCard>
127
127
  );
128
128
  };
@@ -29,6 +29,7 @@ const RelativeContainer = styled(Box, {
29
29
  overflow: 'auto',
30
30
  flex: 1,
31
31
  zIndex: 0,
32
+ ...theme.container,
32
33
  }));
33
34
 
34
35
  const CssBaselineContainer = styled(ScopedCssBaseline, {
@@ -53,10 +54,9 @@ export const FlexContainer = styled(Container)({
53
54
 
54
55
  export const AppContainer: React.FC<PropsWithChildren<{}>> = ({ children }) => {
55
56
  // const ref = useRef<HTMLDivElement>(null);
56
- const { containerStyle, variant, elementId } = useWidgetConfig();
57
+ const { variant, elementId } = useWidgetConfig();
57
58
  return (
58
59
  <RelativeContainer
59
- sx={containerStyle}
60
60
  variant={variant}
61
61
  id={createElementId(ElementId.RelativeContainer, elementId)}
62
62
  >
@@ -3,6 +3,7 @@ import { Wallet } from '@mui/icons-material';
3
3
  import { Badge } from '@mui/material';
4
4
  import type { Account } from '../../hooks/useAccount.js';
5
5
  import { useChain } from '../../hooks/useChain.js';
6
+ import type { ToAddress } from '../../types/widget.js';
6
7
  import { SmallAvatar } from '../SmallAvatar.js';
7
8
  import {
8
9
  AvatarDefault,
@@ -13,6 +14,7 @@ import {
13
14
  interface AccountAvatarProps {
14
15
  chainId?: number;
15
16
  account?: Account;
17
+ toAddress?: ToAddress;
16
18
  empty?: boolean;
17
19
  }
18
20
 
@@ -20,26 +22,28 @@ export const AccountAvatar = ({
20
22
  chainId,
21
23
  account,
22
24
  empty,
25
+ toAddress,
23
26
  }: AccountAvatarProps) => {
24
27
  const { chain } = useChain(chainId);
25
28
 
26
- const avatar = account ? (
27
- <AvatarMasked
28
- src={getConnectorIcon(account.connector)}
29
- alt={account.connector?.name}
30
- sx={{
31
- marginRight: chain?.logoURI ? 0 : 1.5,
32
- }}
33
- >
34
- {account.connector?.name[0]}
35
- </AvatarMasked>
36
- ) : empty ? (
37
- <AvatarDefault />
38
- ) : (
39
- <AvatarDefault>
40
- <Wallet sx={{ fontSize: 20 }} />
41
- </AvatarDefault>
42
- );
29
+ const avatar =
30
+ account?.connector || toAddress?.logoURI ? (
31
+ <AvatarMasked
32
+ src={toAddress?.logoURI || getConnectorIcon(account?.connector)}
33
+ alt={toAddress?.name || account?.connector?.name}
34
+ sx={{
35
+ marginRight: chain?.logoURI ? 0 : 1.5,
36
+ }}
37
+ >
38
+ {(toAddress?.name || account?.connector?.name)?.[0]}
39
+ </AvatarMasked>
40
+ ) : empty ? (
41
+ <AvatarDefault />
42
+ ) : (
43
+ <AvatarDefault>
44
+ <Wallet sx={{ fontSize: 20 }} />
45
+ </AvatarDefault>
46
+ );
43
47
 
44
48
  return (
45
49
  <Badge
@@ -8,4 +8,4 @@ export const avatarMask16 =
8
8
  * Avatar mask for 12px badge
9
9
  */
10
10
  export const avatarMask12 =
11
- 'radial-gradient(circle 8.5px at calc(100% - 3.5px) calc(100% - 3.5px), #fff0 96%, #fff) 100% 100%/100% 100% no-repeat';
11
+ 'radial-gradient(circle 8.5px at calc(100% - 3.5px) calc(100% - 3.5px), #fff0 96%, #fff) 100% 100% / 100% 100% no-repeat';
@@ -1,83 +1,54 @@
1
- import type { BoxProps, Theme } from '@mui/material';
2
- import { Box, alpha, darken, lighten, styled } from '@mui/material';
3
- import type { MouseEventHandler } from 'react';
1
+ import type { CardProps as MuiCardProps } from '@mui/material';
2
+ import { Card as MuiCard, alpha, darken, lighten, styled } from '@mui/material';
4
3
 
5
- type CardVariant = 'default' | 'selected' | 'error';
6
-
7
- export type CardProps = {
8
- variant?: CardVariant;
4
+ export interface CardProps extends MuiCardProps {
5
+ type?: 'default' | 'selected' | 'error';
9
6
  selectionColor?: 'primary' | 'secondary';
10
7
  indented?: boolean;
11
- onClick?: MouseEventHandler<HTMLDivElement>;
12
- pointerEvents?: 'auto' | 'none';
13
- } & BoxProps;
14
-
15
- const getBackgroundColor = (
16
- theme: Theme,
17
- variant?: CardVariant,
18
- selectionColor?: 'primary' | 'secondary',
19
- ) =>
20
- variant === 'selected'
21
- ? selectionColor === 'primary'
22
- ? theme.palette.mode === 'light'
23
- ? alpha(theme.palette.primary.main, 0.04)
24
- : alpha(theme.palette.primary.main, 0.42)
25
- : alpha(
26
- theme.palette.secondary.main,
27
- theme.palette.mode === 'light' ? 0.08 : 0.12,
28
- )
29
- : theme.palette.background.paper;
8
+ }
30
9
 
31
- export const Card = styled(Box, {
10
+ export const Card = styled(MuiCard, {
32
11
  shouldForwardProp: (prop) =>
33
- !['variant', 'indented', 'selectionColor', 'pointerEvents'].includes(
34
- prop as string,
35
- ),
36
- })<CardProps>(({
37
- theme,
38
- variant = 'default',
39
- selectionColor = 'primary',
40
- indented,
41
- pointerEvents,
42
- onClick,
43
- }) => {
44
- const backgroundColor = getBackgroundColor(theme, variant, selectionColor);
45
- const backgroundHoverColor = onClick
46
- ? theme.palette.mode === 'light'
47
- ? darken(backgroundColor, 0.02)
48
- : lighten(backgroundColor, 0.02)
49
- : backgroundColor;
12
+ !['type', 'indented', 'selectionColor'].includes(prop as string),
13
+ })<CardProps>(({ theme, indented, selectionColor, type }) => {
50
14
  return {
51
- backgroundColor,
52
- // border: variant === 'default' ? 'none' : '1px solid',
53
- border: '1px solid',
54
- borderColor:
55
- variant === 'error'
56
- ? theme.palette.error.main
57
- : variant === 'selected'
58
- ? selectionColor === 'primary'
59
- ? theme.palette.primary.main
60
- : alpha(theme.palette.secondary.main, 0.48)
61
- : theme.palette.mode === 'light'
62
- ? theme.palette.grey[300]
63
- : theme.palette.grey[800],
64
- borderRadius: theme.shape.borderRadius,
65
- // boxShadow: '0px 1px 8px 0px rgba(0, 0, 0, 0.04)',
66
- overflow: 'hidden',
67
- position: 'relative',
68
15
  padding: indented ? theme.spacing(2) : 0,
69
- boxSizing: 'border-box',
70
- '&:hover': {
71
- cursor: onClick ? 'pointer' : 'default',
72
- backgroundColor: backgroundHoverColor,
73
- },
74
- transition: theme.transitions.create(
75
- ['background-color', 'box-shadow', 'border-color'],
76
- {
77
- duration: theme.transitions.duration.enteringScreen,
78
- easing: theme.transitions.easing.easeOut,
79
- },
80
- ),
81
- pointerEvents,
16
+ ...(type === 'selected' &&
17
+ selectionColor === 'primary' && {
18
+ backgroundColor:
19
+ theme.palette.mode === 'light'
20
+ ? lighten(theme.palette.primary.main, 0.95)
21
+ : darken(theme.palette.primary.main, 0.65),
22
+ borderWidth: 1,
23
+ borderStyle: 'solid',
24
+ borderColor: theme.palette.primary.main,
25
+ '&:hover': {
26
+ backgroundColor:
27
+ theme.palette.mode === 'light'
28
+ ? lighten(theme.palette.primary.main, 0.9)
29
+ : darken(theme.palette.primary.main, 0.6),
30
+ },
31
+ }),
32
+ ...(type === 'selected' &&
33
+ selectionColor === 'secondary' && {
34
+ backgroundColor:
35
+ theme.palette.mode === 'light'
36
+ ? lighten(theme.palette.secondary.main, 0.9)
37
+ : darken(theme.palette.secondary.main, 0.85),
38
+ borderWidth: 1,
39
+ borderStyle: 'solid',
40
+ borderColor: alpha(theme.palette.secondary.main, 0.32),
41
+ '&:hover': {
42
+ backgroundColor:
43
+ theme.palette.mode === 'light'
44
+ ? lighten(theme.palette.secondary.main, 0.85)
45
+ : darken(theme.palette.secondary.main, 0.8),
46
+ },
47
+ }),
48
+ ...(type === 'error' && {
49
+ borderWidth: 1,
50
+ borderStyle: 'solid',
51
+ borderColor: theme.palette.error.main,
52
+ }),
82
53
  };
83
54
  });
@@ -1,4 +1,11 @@
1
- import { Box, Typography, alpha, lighten, styled } from '@mui/material';
1
+ import {
2
+ Box,
3
+ Typography,
4
+ alpha,
5
+ getContrastRatio,
6
+ lighten,
7
+ styled,
8
+ } from '@mui/material';
2
9
 
3
10
  export const CardLabel = styled(Box, {
4
11
  shouldForwardProp: (prop) => prop !== 'type',
@@ -7,7 +14,7 @@ export const CardLabel = styled(Box, {
7
14
  type === 'active'
8
15
  ? theme.palette.mode === 'light'
9
16
  ? theme.palette.secondary.main
10
- : alpha(theme.palette.secondary.main, 0.32)
17
+ : alpha(theme.palette.secondary.main, 0.8)
11
18
  : type?.includes('insurance')
12
19
  ? alpha(
13
20
  theme.palette.success.main,
@@ -22,7 +29,12 @@ export const CardLabel = styled(Box, {
22
29
  theme.palette.success.main,
23
30
  theme.palette.mode === 'light' ? 0 : 0.24,
24
31
  )
25
- : theme.palette.text.primary,
32
+ : getContrastRatio(
33
+ theme.palette.common.white,
34
+ alpha(theme.palette.secondary.main, 0.08),
35
+ ) >= 3
36
+ ? theme.palette.common.white
37
+ : theme.palette.common.black,
26
38
  padding: type === 'insurance' ? theme.spacing(0, 1.5) : 0,
27
39
  display: 'flex',
28
40
  alignItems: 'center',
@@ -0,0 +1,7 @@
1
+ import { styled } from '@mui/material';
2
+ import { Card } from './Card.js';
3
+
4
+ export const InputCard = styled(Card, {
5
+ name: 'MuiInputCard',
6
+ slot: 'root',
7
+ })();
@@ -58,11 +58,15 @@ export const ChainSelect = ({ formType }: FormTypeProps) => {
58
58
  title={chain.name}
59
59
  placement="top"
60
60
  enterDelay={400}
61
+ enterNextDelay={100}
62
+ disableInteractive
61
63
  arrow
62
64
  >
63
65
  <ChainCard
66
+ component="button"
64
67
  onClick={() => setCurrentChain(chain.id)}
65
- variant={chainId === chain.id ? 'selected' : 'default'}
68
+ type={chainId === chain.id ? 'selected' : 'default'}
69
+ selectionColor="primary"
66
70
  >
67
71
  <Avatar
68
72
  src={chain.logoURI}
@@ -75,7 +79,7 @@ export const ChainSelect = ({ formType }: FormTypeProps) => {
75
79
  </Tooltip>
76
80
  ))}
77
81
  {chainsToHide > 0 ? (
78
- <ChainCard onClick={showAllChains}>
82
+ <ChainCard component="button" onClick={showAllChains}>
79
83
  <Box
80
84
  sx={{
81
85
  width: 40,
@@ -1,8 +1,8 @@
1
- import type { BoxProps } from '@mui/material';
1
+ import type { CardProps } from '@mui/material';
2
2
  import type { PropsWithChildren } from 'react';
3
3
  import { Card } from '../Card/Card.js';
4
4
 
5
- export const ContractComponent: React.FC<PropsWithChildren<BoxProps>> = ({
5
+ export const ContractComponent: React.FC<PropsWithChildren<CardProps>> = ({
6
6
  children,
7
7
  ...props
8
8
  }) => {
@@ -0,0 +1,33 @@
1
+ import type { ContractCall } from '@lifi/sdk';
2
+ import { useEffect } from 'react';
3
+ import { useFieldActions } from '../../stores/form/useFieldActions.js';
4
+ import type { TokenAmount } from '../../types/token.js';
5
+ import { Token } from '../Token/Token.js';
6
+
7
+ export interface ItemPriceProps {
8
+ token: TokenAmount;
9
+ contractCalls?: ContractCall[];
10
+ }
11
+
12
+ export const ItemPrice: React.FC<ItemPriceProps> = ({
13
+ token,
14
+ contractCalls,
15
+ }) => {
16
+ const { setFieldValue } = useFieldActions();
17
+
18
+ useEffect(() => {
19
+ if (token) {
20
+ setFieldValue('toChain', token.chainId, { isTouched: true });
21
+ setFieldValue('toToken', token.address, { isTouched: true });
22
+ setFieldValue('toAmount', token.amount?.toString(), {
23
+ isTouched: true,
24
+ });
25
+ }
26
+ if (contractCalls) {
27
+ setFieldValue('contractCalls', contractCalls, {
28
+ isTouched: true,
29
+ });
30
+ }
31
+ }, [contractCalls, setFieldValue, token]);
32
+ return <Token token={token} p={2} />;
33
+ };
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- import { useFieldActions } from '../../stores/form/useFieldActions.js';
2
+ import { useFieldActions } from '../../../stores/form/useFieldActions.js';
3
3
  import { NFTBase } from './NFTBase.js';
4
4
  import type { NFTProps } from './types.js';
5
5
 
@@ -10,7 +10,7 @@ export const NFT: React.FC<NFTProps> = ({
10
10
  assetName,
11
11
  owner,
12
12
  token,
13
- contract,
13
+ contractCall,
14
14
  }) => {
15
15
  const { setFieldValue } = useFieldActions();
16
16
 
@@ -22,18 +22,12 @@ export const NFT: React.FC<NFTProps> = ({
22
22
  isTouched: true,
23
23
  });
24
24
  }
25
- if (contract) {
26
- setFieldValue('toContractAddress', contract.address, {
27
- isTouched: true,
28
- });
29
- setFieldValue('toContractCallData', contract.callData, {
30
- isTouched: true,
31
- });
32
- setFieldValue('toContractGasLimit', contract.gasLimit, {
25
+ if (contractCall) {
26
+ setFieldValue('contractCalls', [contractCall], {
33
27
  isTouched: true,
34
28
  });
35
29
  }
36
- }, [contract, setFieldValue, token]);
30
+ }, [contractCall, setFieldValue, token]);
37
31
  return (
38
32
  <NFTBase
39
33
  isLoading={isLoading}
@@ -1,6 +1,6 @@
1
1
  import { Box, Link, Skeleton, Typography } from '@mui/material';
2
2
  import { useTranslation } from 'react-i18next';
3
- import { Token } from '../Token/Token.js';
3
+ import { Token } from '../../Token/Token.js';
4
4
  import { PreviewAvatar } from './NFT.style.js';
5
5
  import type { NFTProps } from './types.js';
6
6
 
@@ -1,5 +1,4 @@
1
- import type { TokenAmount } from '@lifi/sdk';
2
- import type { WidgetContract } from '../../types/widget.js';
1
+ import type { ContractCall, TokenAmount } from '@lifi/sdk';
3
2
 
4
3
  export interface NFTBaseProps {
5
4
  imageUrl?: string;
@@ -11,7 +10,7 @@ export interface NFTBaseProps {
11
10
  }
12
11
 
13
12
  export interface NFTProps extends NFTBaseProps {
14
- contract?: WidgetContract;
13
+ contractCall?: ContractCall;
15
14
  }
16
15
 
17
16
  export interface NFTOwner {
@@ -1,4 +1,4 @@
1
- import type { DialogProps, Theme } from '@mui/material';
1
+ import type { DialogProps, PaperProps, Theme } from '@mui/material';
2
2
  import { Dialog as MuiDialog } from '@mui/material';
3
3
  import type { PropsWithChildren } from 'react';
4
4
  import { useGetScrollableContainer } from '../hooks/useScrollableContainer.js';
@@ -10,10 +10,11 @@ export const modalProps = {
10
10
  },
11
11
  };
12
12
 
13
- export const paperProps = {
13
+ export const paperProps: Partial<PaperProps> = {
14
14
  sx: (theme: Theme) => ({
15
15
  position: 'absolute',
16
16
  backgroundImage: 'none',
17
+ backgroundColor: theme.palette.background.default,
17
18
  borderTopLeftRadius: theme.shape.borderRadius,
18
19
  borderTopRightRadius: theme.shape.borderRadius,
19
20
  }),
@@ -0,0 +1,17 @@
1
+ import { ArrowBack } from '@mui/icons-material';
2
+ import type { IconButtonProps } from '@mui/material';
3
+ import { IconButton, useTheme } from '@mui/material';
4
+
5
+ export const BackButton: React.FC<IconButtonProps> = ({ onClick }) => {
6
+ const theme = useTheme();
7
+
8
+ return (
9
+ <IconButton
10
+ size="medium"
11
+ edge={theme?.navigation?.edge ? 'start' : false}
12
+ onClick={onClick}
13
+ >
14
+ <ArrowBack />
15
+ </IconButton>
16
+ );
17
+ };