@lifi/widget 3.0.0-alpha.31 → 3.0.0-alpha.32

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 (240) hide show
  1. package/AppDefault.tsx +0 -2
  2. package/AppDrawer.style.tsx +1 -97
  3. package/AppDrawer.tsx +7 -40
  4. package/_esm/AppDefault.js +1 -2
  5. package/_esm/AppDefault.js.map +1 -1
  6. package/_esm/AppDrawer.d.ts +1 -5
  7. package/_esm/AppDrawer.js +13 -25
  8. package/_esm/AppDrawer.js.map +1 -1
  9. package/_esm/AppDrawer.style.d.ts +0 -12
  10. package/_esm/AppDrawer.style.js +1 -76
  11. package/_esm/AppDrawer.style.js.map +1 -1
  12. package/_esm/components/ActiveTransactions/ActiveTransactions.style.d.ts +1 -1
  13. package/_esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
  14. package/_esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
  15. package/_esm/components/AmountInput/PriceFormHelperText.js +2 -2
  16. package/_esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
  17. package/_esm/components/AppContainer.d.ts +1 -1
  18. package/_esm/components/AppContainer.js +3 -3
  19. package/_esm/components/AppContainer.js.map +1 -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/Avatar.js +3 -3
  23. package/_esm/components/Avatar/Avatar.js.map +1 -1
  24. package/_esm/components/Avatar/Avatar.style.d.ts +6 -0
  25. package/_esm/components/Avatar/Avatar.style.js +11 -5
  26. package/_esm/components/Avatar/Avatar.style.js.map +1 -1
  27. package/_esm/components/Avatar/TokenAvatar.js +3 -3
  28. package/_esm/components/Avatar/TokenAvatar.js.map +1 -1
  29. package/_esm/components/Avatar/utils.d.ts +8 -0
  30. package/_esm/components/Avatar/utils.js +9 -0
  31. package/_esm/components/Avatar/utils.js.map +1 -0
  32. package/_esm/components/ButtonTertiary.d.ts +4 -0
  33. package/_esm/components/ButtonTertiary.js +19 -0
  34. package/_esm/components/ButtonTertiary.js.map +1 -0
  35. package/_esm/components/Card/Card.js +6 -7
  36. package/_esm/components/Card/Card.js.map +1 -1
  37. package/_esm/components/Card/CardHeader.js +3 -1
  38. package/_esm/components/Card/CardHeader.js.map +1 -1
  39. package/_esm/components/Card/CardIconButton.js +4 -6
  40. package/_esm/components/Card/CardIconButton.js.map +1 -1
  41. package/_esm/components/Card/CardLabel.js +0 -4
  42. package/_esm/components/Card/CardLabel.js.map +1 -1
  43. package/_esm/components/Card/CardTitle.js +1 -0
  44. package/_esm/components/Card/CardTitle.js.map +1 -1
  45. package/_esm/components/ChainSelect/useChainSelect.js +1 -2
  46. package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
  47. package/_esm/components/Header/Header.style.d.ts +4 -1
  48. package/_esm/components/Header/Header.style.js +12 -12
  49. package/_esm/components/Header/Header.style.js.map +1 -1
  50. package/_esm/components/Header/SettingsButton.style.d.ts +1 -1
  51. package/_esm/components/Header/WalletHeader.js +2 -3
  52. package/_esm/components/Header/WalletHeader.js.map +1 -1
  53. package/_esm/components/Header/WalletMenu.js +6 -4
  54. package/_esm/components/Header/WalletMenu.js.map +1 -1
  55. package/_esm/components/Input.js +1 -3
  56. package/_esm/components/Input.js.map +1 -1
  57. package/_esm/components/ListItem/ListItem.d.ts +1 -1
  58. package/_esm/components/ListItemButton.js +12 -9
  59. package/_esm/components/ListItemButton.js.map +1 -1
  60. package/_esm/components/ListItemText.js +1 -1
  61. package/_esm/components/NFT/NFT.style.d.ts +1 -1
  62. package/_esm/components/PageContainer.js +4 -1
  63. package/_esm/components/PageContainer.js.map +1 -1
  64. package/_esm/components/PoweredBy/PoweredBy.js +2 -13
  65. package/_esm/components/PoweredBy/PoweredBy.js.map +1 -1
  66. package/_esm/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  67. package/_esm/components/RouteCard/RouteCard.js +3 -7
  68. package/_esm/components/RouteCard/RouteCard.js.map +1 -1
  69. package/_esm/components/RouteCard/RouteCard.style.js +2 -2
  70. package/_esm/components/RouteCard/RouteCard.style.js.map +1 -1
  71. package/_esm/components/Routes/Routes.js +3 -2
  72. package/_esm/components/Routes/Routes.js.map +1 -1
  73. package/_esm/components/SelectTokenButton/SelectTokenButton.js +1 -1
  74. package/_esm/components/SelectTokenButton/SelectTokenButton.js.map +1 -1
  75. package/_esm/components/SelectTokenButton/SelectTokenButton.style.js +7 -6
  76. package/_esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
  77. package/_esm/components/SendToWallet/SendToWallet.style.js +14 -9
  78. package/_esm/components/SendToWallet/SendToWallet.style.js.map +1 -1
  79. package/_esm/components/SendToWallet/SendToWalletButton.d.ts +3 -1
  80. package/_esm/components/SendToWallet/SendToWalletButton.js +18 -9
  81. package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  82. package/_esm/components/SendToWallet/SendToWalletExpandButton.js +2 -1
  83. package/_esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
  84. package/_esm/components/SmallAvatar.d.ts +1 -1
  85. package/_esm/components/SmallAvatar.js +4 -6
  86. package/_esm/components/SmallAvatar.js.map +1 -1
  87. package/_esm/components/Step/StepProcess.style.d.ts +1 -1
  88. package/_esm/components/Step/StepProcess.style.js +3 -2
  89. package/_esm/components/Step/StepProcess.style.js.map +1 -1
  90. package/_esm/components/StepActions/StepActions.js +1 -3
  91. package/_esm/components/StepActions/StepActions.js.map +1 -1
  92. package/_esm/components/StepActions/StepActions.style.d.ts +4 -2
  93. package/_esm/components/StepActions/StepActions.style.js +12 -15
  94. package/_esm/components/StepActions/StepActions.style.js.map +1 -1
  95. package/_esm/components/StepActions/StepFeeBreakdown.js +2 -1
  96. package/_esm/components/StepActions/StepFeeBreakdown.js.map +1 -1
  97. package/_esm/components/Tabs/Tabs.style.d.ts +1 -1
  98. package/_esm/components/Tabs/Tabs.style.js +10 -14
  99. package/_esm/components/Tabs/Tabs.style.js.map +1 -1
  100. package/_esm/components/Token/Token.js +2 -6
  101. package/_esm/components/Token/Token.js.map +1 -1
  102. package/_esm/components/TokenList/TokenList.js +1 -1
  103. package/_esm/components/TokenList/TokenList.js.map +1 -1
  104. package/_esm/components/TokenList/TokenList.style.d.ts +2 -2
  105. package/_esm/components/TokenList/TokenList.style.js +3 -4
  106. package/_esm/components/TokenList/TokenList.style.js.map +1 -1
  107. package/_esm/components/TokenList/TokenListItem.js +1 -1
  108. package/_esm/components/TokenList/TokenListItem.js.map +1 -1
  109. package/_esm/components/TokenList/useTokenSelect.js +1 -3
  110. package/_esm/components/TokenList/useTokenSelect.js.map +1 -1
  111. package/_esm/config/theme.js +25 -13
  112. package/_esm/config/theme.js.map +1 -1
  113. package/_esm/config/version.d.ts +1 -1
  114. package/_esm/config/version.js +1 -1
  115. package/_esm/hooks/useRoutes.d.ts +1 -1
  116. package/_esm/hooks/useToAddressReset.js +1 -1
  117. package/_esm/hooks/useToAddressReset.js.map +1 -1
  118. package/_esm/hooks/useTokenAddressBalance.d.ts +1 -1
  119. package/_esm/hooks/useTokenBalance.d.ts +1 -1
  120. package/_esm/hooks/useTokenBalances.d.ts +1 -1
  121. package/_esm/i18n/en.json +4 -10
  122. package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +1 -0
  123. package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
  124. package/_esm/pages/LanguagesPage.js +1 -0
  125. package/_esm/pages/LanguagesPage.js.map +1 -1
  126. package/_esm/pages/MainPage/MainPage.js +5 -2
  127. package/_esm/pages/MainPage/MainPage.js.map +1 -1
  128. package/_esm/pages/RoutesPage/RoutesPage.style.js +1 -1
  129. package/_esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
  130. package/_esm/pages/SelectChainPage/SelectChainPage.js +1 -0
  131. package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
  132. package/_esm/pages/SelectEnabledToolsPage.js +1 -0
  133. package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
  134. package/_esm/pages/SelectNativeTokenPage.js +1 -0
  135. package/_esm/pages/SelectNativeTokenPage.js.map +1 -1
  136. package/_esm/pages/SelectWalletPage/SelectWalletPage.js +1 -0
  137. package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
  138. package/_esm/pages/SendToWallet/EmptyListIndicator.js +3 -2
  139. package/_esm/pages/SendToWallet/EmptyListIndicator.js.map +1 -1
  140. package/_esm/pages/SendToWallet/SendToWalletPage.js +4 -3
  141. package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  142. package/_esm/pages/SendToWallet/SendToWalletPage.style.d.ts +24 -34
  143. package/_esm/pages/SendToWallet/SendToWalletPage.style.js +6 -43
  144. package/_esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
  145. package/_esm/pages/SettingsPage/ResetSettingsButton.js +1 -1
  146. package/_esm/pages/SettingsPage/ResetSettingsButton.style.js +2 -2
  147. package/_esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
  148. package/_esm/pages/SettingsPage/RoutePrioritySettings.js +3 -3
  149. package/_esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
  150. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -4
  151. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +0 -8
  152. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
  153. package/_esm/pages/SettingsPage/SettingsPage.js +1 -1
  154. package/_esm/pages/SettingsPage/SettingsPage.js.map +1 -1
  155. package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +1 -3
  156. package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
  157. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +1 -1
  158. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
  159. package/_esm/stores/bookmarks/createBookmarkStore.js +1 -1
  160. package/_esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
  161. package/_esm/stores/form/useFieldController.js +2 -2
  162. package/_esm/stores/form/useFieldController.js.map +1 -1
  163. package/_esm/stores/settings/useSettingsStore.js +5 -2
  164. package/_esm/stores/settings/useSettingsStore.js.map +1 -1
  165. package/_esm/types/widget.d.ts +0 -1
  166. package/_esm/types/widget.js +0 -1
  167. package/_esm/types/widget.js.map +1 -1
  168. package/_esm/utils/colors.d.ts +2 -2
  169. package/_esm/utils/colors.js +6 -4
  170. package/_esm/utils/colors.js.map +1 -1
  171. package/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
  172. package/components/AmountInput/PriceFormHelperText.tsx +3 -3
  173. package/components/AppContainer.tsx +3 -3
  174. package/components/Avatar/AccountAvatar.tsx +8 -4
  175. package/components/Avatar/Avatar.style.tsx +14 -4
  176. package/components/Avatar/Avatar.tsx +7 -3
  177. package/components/Avatar/TokenAvatar.tsx +4 -4
  178. package/components/Avatar/utils.ts +11 -0
  179. package/components/ButtonTertiary.tsx +19 -0
  180. package/components/Card/Card.tsx +12 -17
  181. package/components/Card/CardHeader.tsx +3 -1
  182. package/components/Card/CardIconButton.tsx +4 -7
  183. package/components/Card/CardLabel.tsx +0 -4
  184. package/components/Card/CardTitle.tsx +1 -0
  185. package/components/ChainSelect/useChainSelect.ts +1 -2
  186. package/components/Header/Header.style.ts +13 -14
  187. package/components/Header/WalletHeader.tsx +15 -13
  188. package/components/Header/WalletMenu.tsx +20 -13
  189. package/components/Input.tsx +1 -4
  190. package/components/ListItemButton.tsx +10 -7
  191. package/components/ListItemText.tsx +1 -1
  192. package/components/PageContainer.ts +9 -1
  193. package/components/PoweredBy/PoweredBy.tsx +21 -36
  194. package/components/RouteCard/RouteCard.style.ts +2 -2
  195. package/components/RouteCard/RouteCard.tsx +10 -27
  196. package/components/Routes/Routes.tsx +4 -3
  197. package/components/SelectTokenButton/SelectTokenButton.style.tsx +7 -6
  198. package/components/SelectTokenButton/SelectTokenButton.tsx +1 -1
  199. package/components/SendToWallet/SendToWallet.style.tsx +14 -9
  200. package/components/SendToWallet/SendToWalletButton.tsx +38 -19
  201. package/components/SendToWallet/SendToWalletExpandButton.tsx +2 -1
  202. package/components/SmallAvatar.tsx +4 -6
  203. package/components/Step/StepProcess.style.tsx +3 -2
  204. package/components/StepActions/StepActions.style.tsx +14 -19
  205. package/components/StepActions/StepActions.tsx +1 -3
  206. package/components/StepActions/StepFeeBreakdown.tsx +3 -2
  207. package/components/Tabs/Tabs.style.tsx +10 -19
  208. package/components/Token/Token.tsx +1 -5
  209. package/components/TokenList/TokenList.style.tsx +3 -5
  210. package/components/TokenList/TokenList.tsx +2 -1
  211. package/components/TokenList/TokenListItem.tsx +1 -1
  212. package/components/TokenList/useTokenSelect.ts +1 -3
  213. package/config/theme.ts +29 -15
  214. package/config/version.ts +1 -1
  215. package/hooks/useToAddressReset.ts +1 -1
  216. package/i18n/en.json +4 -10
  217. package/package.json +9 -9
  218. package/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +1 -0
  219. package/pages/LanguagesPage.tsx +1 -0
  220. package/pages/MainPage/MainPage.tsx +8 -3
  221. package/pages/RoutesPage/RoutesPage.style.ts +1 -1
  222. package/pages/SelectChainPage/SelectChainPage.tsx +1 -0
  223. package/pages/SelectEnabledToolsPage.tsx +1 -0
  224. package/pages/SelectNativeTokenPage.tsx +1 -0
  225. package/pages/SelectWalletPage/SelectWalletPage.tsx +1 -0
  226. package/pages/SendToWallet/EmptyListIndicator.tsx +5 -6
  227. package/pages/SendToWallet/SendToWalletPage.style.tsx +6 -53
  228. package/pages/SendToWallet/SendToWalletPage.tsx +11 -8
  229. package/pages/SettingsPage/ResetSettingsButton.style.tsx +2 -2
  230. package/pages/SettingsPage/ResetSettingsButton.tsx +1 -1
  231. package/pages/SettingsPage/RoutePrioritySettings.tsx +7 -7
  232. package/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +0 -9
  233. package/pages/SettingsPage/SettingsPage.tsx +1 -1
  234. package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +1 -4
  235. package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +1 -1
  236. package/stores/bookmarks/createBookmarkStore.ts +2 -1
  237. package/stores/form/useFieldController.ts +2 -2
  238. package/stores/settings/useSettingsStore.ts +5 -2
  239. package/types/widget.ts +0 -1
  240. package/utils/colors.ts +8 -9
@@ -1,10 +1,15 @@
1
- import { Collapse } from '@mui/material';
1
+ import { CloseRounded } from '@mui/icons-material';
2
+ import type { BoxProps } from '@mui/material';
3
+ import { Box, Collapse } from '@mui/material';
4
+ import type { MouseEventHandler } from 'react';
2
5
  import { useTranslation } from 'react-i18next';
3
6
  import { useNavigate } from 'react-router-dom';
4
7
  import { useAccount } from '../../hooks/useAccount.js';
5
8
  import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js';
6
9
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
10
+ import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js';
7
11
  import { useBookmarks } from '../../stores/bookmarks/useBookmarks.js';
12
+ import { useFieldActions } from '../../stores/form/useFieldActions.js';
8
13
  import { useFieldValues } from '../../stores/form/useFieldValues.js';
9
14
  import { useSendToWalletStore } from '../../stores/settings/useSendToWalletStore.js';
10
15
  import { DisabledUI, HiddenUI } from '../../types/widget.js';
@@ -16,11 +21,11 @@ import { navigationRoutes } from '../../utils/navigationRoutes.js';
16
21
  import { shortenAddress } from '../../utils/wallet.js';
17
22
  import { AccountAvatar } from '../Avatar/AccountAvatar.js';
18
23
  import { Card } from '../Card/Card.js';
19
- import { CardRowContainer } from '../Card/CardButton.style.js';
24
+ import { CardIconButton } from '../Card/CardIconButton.js';
20
25
  import { CardTitle } from '../Card/CardTitle.js';
21
26
  import { SendToWalletCardHeader } from './SendToWallet.style.js';
22
27
 
23
- export const SendToWalletButton = () => {
28
+ export const SendToWalletButton: React.FC<BoxProps> = (props) => {
24
29
  const { t } = useTranslation();
25
30
  const navigate = useNavigate();
26
31
  const { disabledUI, hiddenUI, toAddress, toAddresses } = useWidgetConfig();
@@ -30,7 +35,9 @@ export const SendToWalletButton = () => {
30
35
  'toChain',
31
36
  'toToken',
32
37
  );
38
+ const { setFieldValue } = useFieldActions();
33
39
  const { selectedBookmark } = useBookmarks();
40
+ const { setSelectedBookmark } = useBookmarkActions();
34
41
  const { accounts } = useAccount();
35
42
  const { requiredToAddress } = useToAddressRequirements();
36
43
  const disabledToAddress = disabledUI?.includes(DisabledUI.ToAddress);
@@ -66,7 +73,9 @@ export const SendToWalletButton = () => {
66
73
  ? defaultChainIdsByType[chainType]
67
74
  : undefined;
68
75
 
69
- const isConnectedAccount = selectedBookmark?.isConnectedAccount;
76
+ const isConnectedAccount =
77
+ selectedBookmark?.isConnectedAccount &&
78
+ matchingConnectedAccount?.isConnected;
70
79
  const connectedAccountName = matchingConnectedAccount?.connector?.name;
71
80
  const bookmarkName = selectedBookmark?.name;
72
81
 
@@ -77,6 +86,10 @@ export const SendToWalletButton = () => {
77
86
  const headerSubheader =
78
87
  isConnectedAccount || bookmarkName || connectedAccountName ? address : null;
79
88
 
89
+ const isSelected = !!toAddressFieldValue && !(toAddress && disabledToAddress);
90
+
91
+ const disabledForChanges = Boolean(toAddress) && disabledToAddress;
92
+
80
93
  const handleOnClick = () => {
81
94
  navigate(
82
95
  toAddresses?.length
@@ -85,6 +98,12 @@ export const SendToWalletButton = () => {
85
98
  );
86
99
  };
87
100
 
101
+ const clearSelectedBookmark: MouseEventHandler<HTMLButtonElement> = (e) => {
102
+ e.stopPropagation();
103
+ setFieldValue('toAddress', '', { isTouched: true });
104
+ setSelectedBookmark();
105
+ };
106
+
88
107
  return (
89
108
  <Collapse
90
109
  timeout={showInstantly ? 0 : 225}
@@ -94,19 +113,14 @@ export const SendToWalletButton = () => {
94
113
  >
95
114
  <Card
96
115
  component="button"
97
- onClick={!!toAddress && disabledToAddress ? undefined : handleOnClick}
98
- sx={{ mb: 2 }}
116
+ onClick={disabledForChanges ? undefined : handleOnClick}
117
+ width="100%"
118
+ {...props}
99
119
  >
100
- <CardRowContainer
101
- sx={{
102
- flexDirection: 'column',
103
- padding: 0,
104
- alignItems: 'flex-start',
105
- }}
106
- >
107
- <CardTitle required={requiredToAddress}>
108
- {t('header.sendToWallet')}
109
- </CardTitle>
120
+ <CardTitle required={requiredToAddress}>
121
+ {t('header.sendToWallet')}
122
+ </CardTitle>
123
+ <Box display="flex" justifyContent="center" alignItems="center">
110
124
  <SendToWalletCardHeader
111
125
  avatar={
112
126
  <AccountAvatar
@@ -117,11 +131,16 @@ export const SendToWalletButton = () => {
117
131
  }
118
132
  title={headerTitle}
119
133
  subheader={headerSubheader}
120
- selected={
121
- !!toAddressFieldValue && !(toAddress && disabledToAddress)
134
+ selected={isSelected}
135
+ action={
136
+ isSelected && !disabledForChanges ? (
137
+ <CardIconButton onClick={clearSelectedBookmark} size="small">
138
+ <CloseRounded fontSize="inherit" />
139
+ </CardIconButton>
140
+ ) : null
122
141
  }
123
142
  />
124
- </CardRowContainer>
143
+ </Box>
125
144
  </Card>
126
145
  </Collapse>
127
146
  );
@@ -52,7 +52,8 @@ export const SendToWalletExpandButton: React.FC = () => {
52
52
  onClick={handleClick}
53
53
  sx={{
54
54
  minWidth: 48,
55
- marginLeft: 1,
55
+ width: 48,
56
+ height: 48,
56
57
  }}
57
58
  >
58
59
  <Wallet />
@@ -2,15 +2,13 @@ import { Avatar, Box, Skeleton, styled } from '@mui/material';
2
2
 
3
3
  export const SmallAvatar = styled(Avatar)(({ theme }) => ({
4
4
  background: theme.palette.background.paper,
5
- width: 20,
6
- height: 20,
7
- border: `2px solid ${theme.palette.background.paper}`,
5
+ width: 16,
6
+ height: 16,
8
7
  }));
9
8
 
10
9
  export const SmallAvatarSkeletonBase = styled(Skeleton)(({ theme }) => ({
11
- border: `2px solid ${theme.palette.background.paper}`,
12
- width: 20,
13
- height: 20,
10
+ width: 16,
11
+ height: 16,
14
12
  }));
15
13
 
16
14
  export const SmallAvatarSkeletonContainer = styled(Box)(({ theme }) => ({
@@ -1,7 +1,8 @@
1
1
  import type { IconButtonProps, LinkProps } from '@mui/material';
2
- import { IconButton, styled } from '@mui/material';
2
+ import { styled } from '@mui/material';
3
+ import { CardIconButton } from '../Card/CardIconButton.js';
3
4
 
4
- export const LinkButton = styled(IconButton)<IconButtonProps & LinkProps>(
5
+ export const LinkButton = styled(CardIconButton)<IconButtonProps & LinkProps>(
5
6
  ({ theme }) => ({
6
7
  padding: theme.spacing(0.5),
7
8
  }),
@@ -1,27 +1,14 @@
1
1
  import {
2
- Avatar,
3
2
  Box,
4
3
  StepConnector as MuiStepConnector,
5
4
  StepLabel as MuiStepLabel,
6
5
  Typography,
6
+ alpha,
7
7
  stepConnectorClasses,
8
8
  stepLabelClasses,
9
9
  styled,
10
10
  } from '@mui/material';
11
-
12
- export const StepIcon = styled('span', {
13
- shouldForwardProp: (prop) =>
14
- !['active', 'completed', 'error'].includes(prop as string),
15
- })(({ theme }) => ({
16
- width: 12,
17
- height: 12,
18
- borderRadius: '50%',
19
- border: `2px solid ${
20
- theme.palette.mode === 'light'
21
- ? theme.palette.grey[300]
22
- : theme.palette.grey[800]
23
- }`,
24
- }));
11
+ import { AvatarMasked } from '../Avatar/Avatar.style.js';
25
12
 
26
13
  export const StepConnector = styled(MuiStepConnector, {
27
14
  shouldForwardProp: (prop) =>
@@ -43,10 +30,10 @@ export const StepLabel = styled(MuiStepLabel, {
43
30
  !['active', 'completed', 'error', 'disabled'].includes(prop as string),
44
31
  })(({ theme }) => ({
45
32
  padding: 0,
46
- alignItems: 'flex-start',
33
+ alignItems: 'center',
47
34
  [`.${stepLabelClasses.iconContainer}`]: {
48
- paddingLeft: theme.spacing(1),
49
- paddingRight: theme.spacing(3),
35
+ paddingLeft: theme.spacing(1.25),
36
+ paddingRight: theme.spacing(3.25),
50
37
  },
51
38
  [`.${stepLabelClasses.labelContainer}`]: {
52
39
  minHeight: 24,
@@ -80,7 +67,15 @@ export const StepContent = styled(Box, {
80
67
  paddingLeft: last ? theme.spacing(4.625) : theme.spacing(4.375),
81
68
  }));
82
69
 
83
- export const StepAvatar = styled(Avatar)(({ theme, variant }) => ({
70
+ export const StepAvatar = styled(AvatarMasked)(({ theme }) => ({
84
71
  color: theme.palette.text.primary,
85
72
  backgroundColor: 'transparent',
86
73
  }));
74
+
75
+ export const IconTypography = styled(Typography)(({ theme }) => ({
76
+ color:
77
+ theme.palette.mode === 'light'
78
+ ? alpha(theme.palette.common.black, 0.32)
79
+ : alpha(theme.palette.common.white, 0.4),
80
+ lineHeight: 0,
81
+ }));
@@ -113,9 +113,7 @@ export const IncludedSteps: React.FC<{
113
113
  <SmallAvatar
114
114
  src={tool.toolDetails.logoURI}
115
115
  alt={tool.toolDetails.name}
116
- sx={{
117
- boxSizing: 'content-box',
118
- }}
116
+ sx={{ width: 20, height: 20 }}
119
117
  >
120
118
  {tool.toolDetails.name[0]}
121
119
  </SmallAvatar>
@@ -5,6 +5,7 @@ import type { ReactNode } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { formatUnits } from 'viem';
7
7
  import { getStepFeeCostsBreakdown } from '../../utils/fees.js';
8
+ import { IconTypography } from './StepActions.style.js';
8
9
 
9
10
  export const StepFeeBreakdown: React.FC<{
10
11
  step: LiFiStepExtended;
@@ -87,9 +88,9 @@ export const StepFeeBreakdown: React.FC<{
87
88
  return (
88
89
  <Box mt={1.5}>
89
90
  <Box display="flex" alignItems="center">
90
- <Typography ml={1} mr={3} height={24} color="text.secondary">
91
+ <IconTypography ml={1} mr={3} height={24}>
91
92
  <MonetizationOn />
92
- </Typography>
93
+ </IconTypography>
93
94
  <Typography
94
95
  fontSize={16}
95
96
  color="text.primary"
@@ -11,41 +11,32 @@ import { getCardFieldsetBackgroundColor } from '../../utils/colors.js';
11
11
 
12
12
  export const Tabs = styled(MuiTabs)(({ theme }) => ({
13
13
  backgroundColor: getCardFieldsetBackgroundColor(theme),
14
- borderRadius: Math.max(
15
- theme.shape.borderRadius,
16
- theme.shape.borderRadiusSecondary,
17
- ),
14
+ borderRadius: theme.shape.borderRadius,
18
15
  padding: theme.spacing(0.5),
19
16
  flex: 1,
20
17
  [`.${tabsClasses.indicator}`]: {
21
18
  height: '100%',
22
19
  width: '100%',
23
- backgroundColor:
24
- theme.palette.mode === 'dark'
25
- ? theme.palette.background.default
26
- : theme.palette.common.white,
27
- borderRadius:
28
- Math.max(theme.shape.borderRadius, theme.shape.borderRadiusSecondary) - 4,
20
+ backgroundColor: theme.palette.background.paper,
21
+ borderRadius: theme.shape.borderRadius - 4,
29
22
  boxShadow: `0px 2px 4px ${alpha(theme.palette.common.black, 0.04)}`,
30
23
  },
31
24
  }));
32
25
 
33
- export const Tab = styled(MuiTab, {
34
- shouldForwardProp: (prop) => prop !== 'isDarkMode',
35
- })<TabProps>(({ theme }) => ({
26
+ export const Tab = styled(MuiTab)<TabProps>(({ theme }) => ({
36
27
  zIndex: 1,
37
28
  flex: 1,
38
29
  textTransform: 'none',
39
30
  fontSize: '1rem',
40
31
  fontWeight: 700,
41
32
  color:
42
- theme.palette.mode === 'dark'
43
- ? theme.palette.common.white
44
- : theme.palette.common.black,
33
+ theme.palette.mode === 'light'
34
+ ? theme.palette.common.black
35
+ : theme.palette.common.white,
45
36
  [`&.${tabClasses.selected}`]: {
46
37
  color:
47
- theme.palette.mode === 'dark'
48
- ? theme.palette.common.white
49
- : theme.palette.common.black,
38
+ theme.palette.mode === 'light'
39
+ ? theme.palette.common.black
40
+ : theme.palette.common.white,
50
41
  },
51
42
  }));
@@ -64,6 +64,7 @@ export const TokenBase: FC<TokenProps & BoxProps> = ({
64
64
  token={token}
65
65
  step={step}
66
66
  disableDescription={disableDescription}
67
+ {...other}
67
68
  />
68
69
  );
69
70
  }
@@ -165,11 +166,6 @@ const TokenStep: FC<PropsWithChildren<Partial<TokenProps>>> = ({
165
166
  <SmallAvatar
166
167
  src={step?.toolDetails.logoURI}
167
168
  alt={step?.toolDetails.name}
168
- sx={{
169
- width: 16,
170
- height: 16,
171
- border: 0,
172
- }}
173
169
  >
174
170
  {step?.toolDetails.name[0]}
175
171
  </SmallAvatar>
@@ -1,5 +1,6 @@
1
1
  import type { IconButtonProps, LinkProps } from '@mui/material';
2
- import { IconButton as MuiIconButton, alpha, styled } from '@mui/material';
2
+ import { IconButton as MuiIconButton, styled } from '@mui/material';
3
+ import { getContrastAlphaColor } from '../../utils/colors.js';
3
4
  import { ListItem as ListItemBase } from '../ListItem/ListItem.js';
4
5
 
5
6
  export const ListItem = styled(ListItemBase)(({ theme }) => ({
@@ -20,10 +21,7 @@ export const IconButton = styled(MuiIconButton)<IconButtonProps & LinkProps>(
20
21
  minWidth: 'unset',
21
22
  borderRadius: '50%',
22
23
  '&:hover': {
23
- backgroundColor:
24
- theme.palette.mode === 'light'
25
- ? alpha(theme.palette.common.black, 0.04)
26
- : alpha(theme.palette.common.white, 0.08),
24
+ backgroundColor: getContrastAlphaColor(theme, 0.04),
27
25
  },
28
26
  svg: {
29
27
  fontSize: 14,
@@ -43,10 +43,11 @@ export const TokenList: FC<TokenListProps> = ({
43
43
  []) as TokenAmount[];
44
44
  const normalizedSearchFilter = tokenSearchFilter?.replaceAll('$', '');
45
45
  const searchFilter = normalizedSearchFilter?.toUpperCase() ?? '';
46
+
46
47
  filteredTokens = tokenSearchFilter
47
48
  ? filteredTokens.filter(
48
49
  (token) =>
49
- token.name.toUpperCase().includes(searchFilter) ||
50
+ token.name?.toUpperCase().includes(searchFilter) ||
50
51
  token.symbol.toUpperCase().includes(searchFilter) ||
51
52
  token.address.toUpperCase().includes(searchFilter),
52
53
  )
@@ -148,7 +148,7 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
148
148
  ) : (
149
149
  <Box sx={{ textAlign: 'right' }}>
150
150
  {token.amount ? (
151
- <Typography variant="body1" noWrap>
151
+ <Typography fontWeight={600} noWrap>
152
152
  {t('format.number', {
153
153
  value: formatTokenAmount(token.amount, token.decimals),
154
154
  })}
@@ -9,7 +9,7 @@ import { WidgetEvent } from '../../types/events.js';
9
9
 
10
10
  export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
11
11
  const tokenKey = FormKeyHelper.getTokenKey(formType);
12
- const { onChange, onBlur } = useFieldController({ name: tokenKey });
12
+ const { onChange } = useFieldController({ name: tokenKey });
13
13
  const { setFieldValue, getFieldValues } = useFieldActions();
14
14
  const { subvariant } = useWidgetConfig();
15
15
  const emitter = useWidgetEvents();
@@ -17,7 +17,6 @@ export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
17
17
  return useCallback(
18
18
  (tokenAddress: string, chainId?: number) => {
19
19
  onChange(tokenAddress);
20
- onBlur();
21
20
  const selectedChainId =
22
21
  chainId ?? getFieldValues(FormKeyHelper.getChainKey(formType))[0];
23
22
  // Set chain again to trigger URL builder update
@@ -60,7 +59,6 @@ export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
60
59
  emitter,
61
60
  formType,
62
61
  getFieldValues,
63
- onBlur,
64
62
  onChange,
65
63
  onClick,
66
64
  setFieldValue,
package/config/theme.ts CHANGED
@@ -45,9 +45,9 @@ declare module '@mui/material/Typography' {
45
45
 
46
46
  const palette = {
47
47
  primary: {
48
- main: '#3F49E1',
49
- light: lighten('#3F49E1', 0.5),
50
- dark: darken('#3F49E1', 0.2),
48
+ main: '#5C67FF',
49
+ light: lighten('#5C67FF', 0.5),
50
+ dark: darken('#5C67FF', 0.2),
51
51
  },
52
52
  secondary: {
53
53
  main: '#F5B5FF',
@@ -73,6 +73,9 @@ const palette = {
73
73
  };
74
74
 
75
75
  const paletteLight = {
76
+ // background: {
77
+ // default: '#F5F5F5',
78
+ // },
76
79
  text: {
77
80
  primary: '#000000',
78
81
  secondary: '#747474',
@@ -87,7 +90,7 @@ const paletteDark = {
87
90
 
88
91
  const shape = {
89
92
  borderRadius: 12,
90
- borderRadiusSecondary: 8,
93
+ borderRadiusSecondary: 12,
91
94
  };
92
95
 
93
96
  const enterKeyframe = keyframes`
@@ -123,6 +126,8 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
123
126
  getContrastRatio(palette.common.white, alpha(primaryMainColor, 0.08)) >= 3
124
127
  ? palette.common.white
125
128
  : palette.common.black;
129
+ const borderRadiusSecondary =
130
+ theme.shape?.borderRadiusSecondary ?? shape.borderRadiusSecondary;
126
131
  return createMuiTheme({
127
132
  typography: {
128
133
  fontFamily: 'Inter var, Inter, sans-serif',
@@ -160,8 +165,8 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
160
165
  },
161
166
  breakpoints: {
162
167
  values: {
163
- xs: 0,
164
- sm: 392,
168
+ xs: 360,
169
+ sm: 416,
165
170
  md: 900,
166
171
  lg: 1200,
167
172
  xl: 1536,
@@ -199,15 +204,15 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
199
204
  },
200
205
  styleOverrides: {
201
206
  root: {
202
- borderRadius:
203
- theme.shape?.borderRadiusSecondary ?? shape.borderRadiusSecondary,
207
+ borderRadius: borderRadiusSecondary,
204
208
  textTransform: 'none',
205
- fontSize: '1rem',
209
+ fontSize: 16,
210
+ fontWeight: 600,
206
211
  [`&.Mui-disabled, &.Mui-disabled:hover`]: {
207
- color:
208
- mode === 'light'
209
- ? alpha(palette.common.black, 0.56)
210
- : alpha(palette.common.white, 0.56),
212
+ color: alpha(
213
+ mode === 'light' ? palette.common.black : palette.common.white,
214
+ 0.56,
215
+ ),
211
216
  cursor: 'not-allowed',
212
217
  pointerEvents: 'auto',
213
218
  },
@@ -255,8 +260,17 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
255
260
  MuiIconButton: {
256
261
  styleOverrides: {
257
262
  root: {
263
+ // backgroundColor: alpha(
264
+ // mode === 'light' ? palette.common.black : palette.common.white,
265
+ // 0.04,
266
+ // ),
258
267
  color: 'inherit',
268
+ // borderRadius: borderRadiusSecondary,
259
269
  '&:hover': {
270
+ // backgroundColor: alpha(
271
+ // mode === 'light' ? palette.common.black : palette.common.white,
272
+ // 0.08,
273
+ // ),
260
274
  color: 'inherit',
261
275
  },
262
276
  },
@@ -277,13 +291,13 @@ export const createTheme = (mode: PaletteMode, theme: ThemeConfig = {}) => {
277
291
  MuiListItemText: {
278
292
  styleOverrides: {
279
293
  primary: ({ theme }) => ({
280
- fontWeight: '500',
294
+ fontWeight: 600,
281
295
  fontSize: '1.125rem',
282
296
  lineHeight: '1.2778',
283
297
  color: theme.palette.text.primary,
284
298
  }),
285
299
  secondary: ({ theme }) => ({
286
- fontWeight: '400',
300
+ fontWeight: 500,
287
301
  fontSize: '0.75rem',
288
302
  color: theme.palette.text.secondary,
289
303
  }),
package/config/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '3.0.0-alpha.31';
2
+ export const version = '3.0.0-alpha.32';
@@ -27,8 +27,8 @@ export const useToAddressReset = () => {
27
27
  // prevents cases when after we switch the chain from one type to another "Send to wallet" field hides,
28
28
  // but it keeps toAddress value set for the previous chain pair.
29
29
  if (shouldResetToAddress) {
30
- setSelectedBookmark();
31
30
  setFieldValue('toAddress', '');
31
+ setSelectedBookmark();
32
32
  }
33
33
  };
34
34
 
package/i18n/en.json CHANGED
@@ -28,10 +28,7 @@
28
28
  "done": "Done",
29
29
  "exchange": "Exchange",
30
30
  "getGas": "Get gas",
31
- "hide": "Hide",
32
31
  "learnMore": "Learn more",
33
- "lifiCheckout": "LI.FI Checkout",
34
- "lifiExchange": "LI.FI Exchange",
35
32
  "light": "Light",
36
33
  "max": "max",
37
34
  "ok": "Ok",
@@ -168,7 +165,6 @@
168
165
  },
169
166
  "numberOfSteps": "A number of exchange steps. Each step can contain 1-2 transactions that require a signature.",
170
167
  "progressToNextUpdate": "Quotes will update in {{value}} seconds. <0/> Click here to update now.",
171
- "recommended": "A cheap route that balances complexity and ease of use.",
172
168
  "settingsModified": "Settings (modified)",
173
169
  "selectAll": "Select all",
174
170
  "deselectAll": "Deselect all"
@@ -247,13 +243,11 @@
247
243
  "supportId": "Support ID",
248
244
  "swapStepDetails": "Swap on {{chain}} via {{tool}}",
249
245
  "tags": {
250
- "cheapest": "Cheap",
251
- "fastest": "Fast",
246
+ "cheapest": "Best Return",
247
+ "fastest": "Fastest",
252
248
  "insurable": "Insurable",
253
249
  "insurance": "Insurance",
254
- "insured": "Insured",
255
- "recommended": "Recommended",
256
- "safest": "Safe"
250
+ "insured": "Insured"
257
251
  },
258
252
  "to": "To",
259
253
  "tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
@@ -280,7 +274,7 @@
280
274
  "routePriority": "Route priority",
281
275
  "slippage": "Slippage",
282
276
  "custom": "Custom",
283
- "resetSettings": "You're using custom setting limiting the number of available routes."
277
+ "resetSettings": "You're using custom settings that can affect the number or sorting of available routes."
284
278
  },
285
279
  "sendToWallet": {
286
280
  "addBookmark": "Add bookmark",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "3.0.0-alpha.31",
3
+ "version": "3.0.0-alpha.32",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "type": "module",
6
6
  "main": "./_esm/index.js",
@@ -35,7 +35,7 @@
35
35
  "@emotion/react": "^11.11.3",
36
36
  "@emotion/styled": "^11.11.0",
37
37
  "@lifi/sdk": "^3.0.0-alpha.56",
38
- "@lifi/wallet-management": "^3.0.0-alpha.21",
38
+ "@lifi/wallet-management": "^3.0.0-alpha.22",
39
39
  "@mui/icons-material": "^5.15.10",
40
40
  "@mui/lab": "^5.0.0-alpha.165",
41
41
  "@mui/material": "^5.15.10",
@@ -43,21 +43,21 @@
43
43
  "@solana/wallet-adapter-react": "^0.15.35",
44
44
  "@solana/wallet-adapter-wallets": "^0.19.26",
45
45
  "@solana/web3.js": "^1.90.0",
46
- "@tanstack/react-query": "^5.20.5",
47
- "@tanstack/react-virtual": "^3.0.4",
48
- "i18next": "^23.8.2",
46
+ "@tanstack/react-query": "^5.22.2",
47
+ "@tanstack/react-virtual": "^3.1.2",
48
+ "i18next": "^23.10.0",
49
49
  "microdiff": "^1.3.2",
50
50
  "mitt": "^3.0.1",
51
51
  "react": "^18.2.0",
52
52
  "react-dom": "^18.2.0",
53
53
  "react-i18next": "^14.0.5",
54
- "react-intersection-observer": "^9.8.0",
55
- "react-router-dom": "^6.22.0",
54
+ "react-intersection-observer": "^9.8.1",
55
+ "react-router-dom": "^6.22.1",
56
56
  "react-timer-hook": "^3.0.7",
57
57
  "uuid": "^9.0.1",
58
- "viem": "^2.7.9",
58
+ "viem": "^2.7.13",
59
59
  "wagmi": "2.5.7",
60
- "zustand": "^4.5.0"
60
+ "zustand": "^4.5.1"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@tanstack/react-query": "^5.17.0",
@@ -49,6 +49,7 @@ export const ActiveTransactionsPage = () => {
49
49
  sx={{
50
50
  paddingLeft: 1.5,
51
51
  paddingRight: 1.5,
52
+ paddingBottom: 1.5,
52
53
  }}
53
54
  >
54
55
  {executingRoutes.map((routeId) => (
@@ -22,6 +22,7 @@ export const LanguagesPage: React.FC = () => {
22
22
  sx={{
23
23
  paddingLeft: 1.5,
24
24
  paddingRight: 1.5,
25
+ paddingBottom: 1.5,
25
26
  }}
26
27
  >
27
28
  {availableLanguages.map((language) => (