@lifi/widget 3.0.0-alpha.30 → 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 (246) 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/hooks/useTransactionHistory.js +13 -6
  122. package/_esm/hooks/useTransactionHistory.js.map +1 -1
  123. package/_esm/i18n/en.json +4 -10
  124. package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +1 -0
  125. package/_esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
  126. package/_esm/pages/LanguagesPage.js +1 -0
  127. package/_esm/pages/LanguagesPage.js.map +1 -1
  128. package/_esm/pages/MainPage/MainPage.js +5 -2
  129. package/_esm/pages/MainPage/MainPage.js.map +1 -1
  130. package/_esm/pages/RoutesPage/RoutesPage.style.js +1 -1
  131. package/_esm/pages/RoutesPage/RoutesPage.style.js.map +1 -1
  132. package/_esm/pages/SelectChainPage/SelectChainPage.js +1 -0
  133. package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
  134. package/_esm/pages/SelectEnabledToolsPage.js +1 -0
  135. package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
  136. package/_esm/pages/SelectNativeTokenPage.js +1 -0
  137. package/_esm/pages/SelectNativeTokenPage.js.map +1 -1
  138. package/_esm/pages/SelectWalletPage/SelectWalletPage.js +1 -0
  139. package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -1
  140. package/_esm/pages/SendToWallet/EmptyListIndicator.js +3 -2
  141. package/_esm/pages/SendToWallet/EmptyListIndicator.js.map +1 -1
  142. package/_esm/pages/SendToWallet/SendToWalletPage.js +4 -3
  143. package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  144. package/_esm/pages/SendToWallet/SendToWalletPage.style.d.ts +24 -34
  145. package/_esm/pages/SendToWallet/SendToWalletPage.style.js +6 -43
  146. package/_esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
  147. package/_esm/pages/SettingsPage/ResetSettingsButton.js +1 -1
  148. package/_esm/pages/SettingsPage/ResetSettingsButton.style.js +2 -2
  149. package/_esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
  150. package/_esm/pages/SettingsPage/RoutePrioritySettings.js +3 -3
  151. package/_esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
  152. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +1 -4
  153. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +0 -8
  154. package/_esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
  155. package/_esm/pages/SettingsPage/SettingsPage.js +1 -1
  156. package/_esm/pages/SettingsPage/SettingsPage.js.map +1 -1
  157. package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +1 -3
  158. package/_esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
  159. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js +1 -1
  160. package/_esm/pages/TransactionDetailsPage/TransactionDetailsPage.js.map +1 -1
  161. package/_esm/providers/WalletProvider/EVMBaseProvider.js +1 -2
  162. package/_esm/providers/WalletProvider/EVMBaseProvider.js.map +1 -1
  163. package/_esm/stores/bookmarks/createBookmarkStore.js +1 -1
  164. package/_esm/stores/bookmarks/createBookmarkStore.js.map +1 -1
  165. package/_esm/stores/form/useFieldController.js +2 -2
  166. package/_esm/stores/form/useFieldController.js.map +1 -1
  167. package/_esm/stores/settings/useSettingsStore.js +5 -2
  168. package/_esm/stores/settings/useSettingsStore.js.map +1 -1
  169. package/_esm/types/widget.d.ts +0 -1
  170. package/_esm/types/widget.js +0 -1
  171. package/_esm/types/widget.js.map +1 -1
  172. package/_esm/utils/colors.d.ts +2 -2
  173. package/_esm/utils/colors.js +6 -4
  174. package/_esm/utils/colors.js.map +1 -1
  175. package/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
  176. package/components/AmountInput/PriceFormHelperText.tsx +3 -3
  177. package/components/AppContainer.tsx +3 -3
  178. package/components/Avatar/AccountAvatar.tsx +8 -4
  179. package/components/Avatar/Avatar.style.tsx +14 -4
  180. package/components/Avatar/Avatar.tsx +7 -3
  181. package/components/Avatar/TokenAvatar.tsx +4 -4
  182. package/components/Avatar/utils.ts +11 -0
  183. package/components/ButtonTertiary.tsx +19 -0
  184. package/components/Card/Card.tsx +12 -17
  185. package/components/Card/CardHeader.tsx +3 -1
  186. package/components/Card/CardIconButton.tsx +4 -7
  187. package/components/Card/CardLabel.tsx +0 -4
  188. package/components/Card/CardTitle.tsx +1 -0
  189. package/components/ChainSelect/useChainSelect.ts +1 -2
  190. package/components/Header/Header.style.ts +13 -14
  191. package/components/Header/WalletHeader.tsx +15 -13
  192. package/components/Header/WalletMenu.tsx +20 -13
  193. package/components/Input.tsx +1 -4
  194. package/components/ListItemButton.tsx +10 -7
  195. package/components/ListItemText.tsx +1 -1
  196. package/components/PageContainer.ts +9 -1
  197. package/components/PoweredBy/PoweredBy.tsx +21 -36
  198. package/components/RouteCard/RouteCard.style.ts +2 -2
  199. package/components/RouteCard/RouteCard.tsx +10 -27
  200. package/components/Routes/Routes.tsx +4 -3
  201. package/components/SelectTokenButton/SelectTokenButton.style.tsx +7 -6
  202. package/components/SelectTokenButton/SelectTokenButton.tsx +1 -1
  203. package/components/SendToWallet/SendToWallet.style.tsx +14 -9
  204. package/components/SendToWallet/SendToWalletButton.tsx +38 -19
  205. package/components/SendToWallet/SendToWalletExpandButton.tsx +2 -1
  206. package/components/SmallAvatar.tsx +4 -6
  207. package/components/Step/StepProcess.style.tsx +3 -2
  208. package/components/StepActions/StepActions.style.tsx +14 -19
  209. package/components/StepActions/StepActions.tsx +1 -3
  210. package/components/StepActions/StepFeeBreakdown.tsx +3 -2
  211. package/components/Tabs/Tabs.style.tsx +10 -19
  212. package/components/Token/Token.tsx +1 -5
  213. package/components/TokenList/TokenList.style.tsx +3 -5
  214. package/components/TokenList/TokenList.tsx +2 -1
  215. package/components/TokenList/TokenListItem.tsx +1 -1
  216. package/components/TokenList/useTokenSelect.ts +1 -3
  217. package/config/theme.ts +29 -15
  218. package/config/version.ts +1 -1
  219. package/hooks/useToAddressReset.ts +1 -1
  220. package/hooks/useTransactionHistory.ts +23 -14
  221. package/i18n/en.json +4 -10
  222. package/package.json +9 -9
  223. package/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +1 -0
  224. package/pages/LanguagesPage.tsx +1 -0
  225. package/pages/MainPage/MainPage.tsx +8 -3
  226. package/pages/RoutesPage/RoutesPage.style.ts +1 -1
  227. package/pages/SelectChainPage/SelectChainPage.tsx +1 -0
  228. package/pages/SelectEnabledToolsPage.tsx +1 -0
  229. package/pages/SelectNativeTokenPage.tsx +1 -0
  230. package/pages/SelectWalletPage/SelectWalletPage.tsx +1 -0
  231. package/pages/SendToWallet/EmptyListIndicator.tsx +5 -6
  232. package/pages/SendToWallet/SendToWalletPage.style.tsx +6 -53
  233. package/pages/SendToWallet/SendToWalletPage.tsx +11 -8
  234. package/pages/SettingsPage/ResetSettingsButton.style.tsx +2 -2
  235. package/pages/SettingsPage/ResetSettingsButton.tsx +1 -1
  236. package/pages/SettingsPage/RoutePrioritySettings.tsx +7 -7
  237. package/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +0 -9
  238. package/pages/SettingsPage/SettingsPage.tsx +1 -1
  239. package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +1 -4
  240. package/pages/TransactionDetailsPage/TransactionDetailsPage.tsx +1 -1
  241. package/providers/WalletProvider/EVMBaseProvider.tsx +0 -2
  242. package/stores/bookmarks/createBookmarkStore.ts +2 -1
  243. package/stores/form/useFieldController.ts +2 -2
  244. package/stores/settings/useSettingsStore.ts +5 -2
  245. package/types/widget.ts +0 -1
  246. package/utils/colors.ts +8 -9
@@ -2,10 +2,21 @@ import type { CSSObject } from '@mui/material';
2
2
  import {
3
3
  AvatarGroup,
4
4
  Box,
5
+ Avatar as MuiAvatar,
6
+ Skeleton,
5
7
  avatarClasses,
6
8
  badgeClasses,
7
9
  styled,
8
10
  } from '@mui/material';
11
+ import { avatarMask16 } from './utils.js';
12
+
13
+ export const AvatarMasked = styled(MuiAvatar)(({ theme }) => ({
14
+ mask: avatarMask16,
15
+ }));
16
+
17
+ export const AvatarSkeleton = styled(Skeleton)(({ theme }) => ({
18
+ mask: avatarMask16,
19
+ }));
9
20
 
10
21
  export const TokenAvatarGroup = styled(AvatarGroup)(({ theme }) => ({
11
22
  [`& .${badgeClasses.badge}:last-child .${avatarClasses.root}`]: {
@@ -31,19 +42,18 @@ export const AvatarDefault = styled(Box)(({ theme }) => {
31
42
  height: root?.height,
32
43
  width: root?.width,
33
44
  color: theme.palette.text.secondary,
45
+ mask: avatarMask16,
34
46
  };
35
47
  });
36
48
 
37
49
  export const AvatarDefaultBadge = styled(Box)(({ theme }) => {
38
- const root = theme.components?.MuiAvatar?.styleOverrides?.root as CSSObject;
39
50
  return {
40
51
  background:
41
52
  theme.palette.mode === 'light'
42
53
  ? theme.palette.grey[300]
43
54
  : theme.palette.grey[800],
44
- border: `2px solid ${theme.palette.background.paper}`,
45
55
  borderRadius: '50%',
46
- height: ((root?.height ?? 40) as number) / 2,
47
- width: ((root?.width ?? 40) as number) / 2,
56
+ height: 16,
57
+ width: 16,
48
58
  };
49
59
  });
@@ -1,7 +1,11 @@
1
1
  import type { SxProps, Theme } from '@mui/material';
2
- import { Badge, Skeleton } from '@mui/material';
2
+ import { Badge } from '@mui/material';
3
3
  import { SmallAvatarSkeleton } from '../SmallAvatar.js';
4
- import { AvatarDefault, AvatarDefaultBadge } from './Avatar.style.js';
4
+ import {
5
+ AvatarDefault,
6
+ AvatarDefaultBadge,
7
+ AvatarSkeleton,
8
+ } from './Avatar.style.js';
5
9
 
6
10
  export const AvatarBadgedDefault: React.FC<{
7
11
  sx?: SxProps<Theme>;
@@ -28,7 +32,7 @@ export const AvatarBadgedSkeleton: React.FC<{
28
32
  badgeContent={<SmallAvatarSkeleton />}
29
33
  sx={sx}
30
34
  >
31
- <Skeleton width={40} height={40} variant="circular" />
35
+ <AvatarSkeleton width={40} height={40} variant="circular" />
32
36
  </Badge>
33
37
  );
34
38
  };
@@ -1,11 +1,11 @@
1
1
  import type { Chain, StaticToken } from '@lifi/sdk';
2
2
  import type { SxProps, Theme } from '@mui/material';
3
- import { Avatar, Badge } from '@mui/material';
3
+ import { Badge } from '@mui/material';
4
4
  import { useChain } from '../../hooks/useChain.js';
5
5
  import { useToken } from '../../hooks/useToken.js';
6
6
  import { SmallAvatar } from '../SmallAvatar.js';
7
7
  import { AvatarBadgedSkeleton } from './Avatar.js';
8
- import { AvatarDefaultBadge } from './Avatar.style.js';
8
+ import { AvatarDefaultBadge, AvatarMasked } from './Avatar.style.js';
9
9
 
10
10
  export const TokenAvatar: React.FC<{
11
11
  token?: StaticToken;
@@ -69,9 +69,9 @@ export const TokenAvatarBase: React.FC<{
69
69
  }
70
70
  sx={sx}
71
71
  >
72
- <Avatar src={token?.logoURI} alt={token?.symbol}>
72
+ <AvatarMasked src={token?.logoURI} alt={token?.symbol}>
73
73
  {token?.symbol?.[0]}
74
- </Avatar>
74
+ </AvatarMasked>
75
75
  </Badge>
76
76
  );
77
77
  };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Avatar mask for 16px badge
3
+ */
4
+ export const avatarMask16 =
5
+ 'radial-gradient(circle 10.5px at calc(100% - 5.5px) calc(100% - 5.5px), #fff0 96%, #fff) 100% 100% / 100% 100% no-repeat';
6
+
7
+ /**
8
+ * Avatar mask for 12px badge
9
+ */
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';
@@ -0,0 +1,19 @@
1
+ import { LoadingButton, loadingButtonClasses } from '@mui/lab';
2
+ import { styled } from '@mui/material';
3
+ import { getContrastAlphaColor } from '../utils/colors.js';
4
+
5
+ export const ButtonTertiary = styled(LoadingButton)(({ theme }) => ({
6
+ color: theme.palette.text.primary,
7
+ height: 40,
8
+ fontSize: 14,
9
+ backgroundColor: getContrastAlphaColor(theme, 0.04),
10
+ '&:hover, &:active': {
11
+ backgroundColor: getContrastAlphaColor(theme, 0.08),
12
+ },
13
+ [`&.${loadingButtonClasses.loading}:disabled`]: {
14
+ backgroundColor: getContrastAlphaColor(theme, 0.04),
15
+ },
16
+ [`.${loadingButtonClasses.loadingIndicator}`]: {
17
+ color: theme.palette.text.primary,
18
+ },
19
+ }));
@@ -1,12 +1,5 @@
1
1
  import type { BoxProps, Theme } from '@mui/material';
2
- import {
3
- Box,
4
- alpha,
5
- badgeClasses,
6
- darken,
7
- lighten,
8
- styled,
9
- } from '@mui/material';
2
+ import { Box, alpha, darken, lighten, styled } from '@mui/material';
10
3
  import type { MouseEventHandler } from 'react';
11
4
 
12
5
  type CardVariant = 'default' | 'selected' | 'error';
@@ -42,7 +35,7 @@ export const Card = styled(Box, {
42
35
  ),
43
36
  })<CardProps>(({
44
37
  theme,
45
- variant,
38
+ variant = 'default',
46
39
  selectionColor = 'primary',
47
40
  indented,
48
41
  pointerEvents,
@@ -56,7 +49,8 @@ export const Card = styled(Box, {
56
49
  : backgroundColor;
57
50
  return {
58
51
  backgroundColor,
59
- border: `1px solid`,
52
+ // border: variant === 'default' ? 'none' : '1px solid',
53
+ border: '1px solid',
60
54
  borderColor:
61
55
  variant === 'error'
62
56
  ? theme.palette.error.main
@@ -68,6 +62,7 @@ export const Card = styled(Box, {
68
62
  ? theme.palette.grey[300]
69
63
  : theme.palette.grey[800],
70
64
  borderRadius: theme.shape.borderRadius,
65
+ // boxShadow: '0px 1px 8px 0px rgba(0, 0, 0, 0.04)',
71
66
  overflow: 'hidden',
72
67
  position: 'relative',
73
68
  padding: indented ? theme.spacing(2) : 0,
@@ -76,13 +71,13 @@ export const Card = styled(Box, {
76
71
  cursor: onClick ? 'pointer' : 'default',
77
72
  backgroundColor: backgroundHoverColor,
78
73
  },
79
- [`&:hover .${badgeClasses.badge} > div`]: {
80
- borderColor: backgroundHoverColor,
81
- },
82
- transition: theme.transitions.create(['background-color'], {
83
- duration: theme.transitions.duration.enteringScreen,
84
- easing: theme.transitions.easing.easeOut,
85
- }),
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
+ ),
86
81
  pointerEvents,
87
82
  };
88
83
  });
@@ -10,15 +10,17 @@ export const CardHeader = styled(MuiCardHeader)(({ theme }) => ({
10
10
  alignSelf: 'center',
11
11
  },
12
12
  [`.${cardHeaderClasses.title}`]: {
13
- fontWeight: 500,
13
+ fontWeight: 600,
14
14
  fontSize: 18,
15
15
  lineHeight: 1.3334,
16
16
  color: theme.palette.text.primary,
17
+ textAlign: 'left',
17
18
  },
18
19
  [`.${cardHeaderClasses.subheader}`]: {
19
20
  fontWeight: 500,
20
21
  fontSize: 12,
21
22
  lineHeight: 1.3334,
22
23
  color: theme.palette.text.secondary,
24
+ textAlign: 'left',
23
25
  },
24
26
  }));
@@ -1,15 +1,12 @@
1
- import { IconButton as MuiIconButton, alpha, styled } from '@mui/material';
1
+ import { IconButton as MuiIconButton, styled } from '@mui/material';
2
+ import { getContrastAlphaColor } from '../../utils/colors.js';
2
3
 
3
4
  export const CardIconButton = styled(MuiIconButton)(({ theme }) => {
4
- const backgroundColor =
5
- theme.palette.mode === 'light'
6
- ? theme.palette.common.black
7
- : theme.palette.common.white;
8
5
  return {
9
6
  padding: theme.spacing(0.5),
10
- backgroundColor: alpha(backgroundColor, 0.04),
7
+ backgroundColor: getContrastAlphaColor(theme, 0.04),
11
8
  '&:hover': {
12
- backgroundColor: alpha(backgroundColor, 0.08),
9
+ backgroundColor: getContrastAlphaColor(theme, 0.08),
13
10
  },
14
11
  };
15
12
  });
@@ -44,8 +44,4 @@ export const CardLabelTypography = styled(Typography, {
44
44
  fontSize: 12,
45
45
  lineHeight: 1,
46
46
  fontWeight: '600',
47
- textTransform: 'lowercase',
48
- '&::first-letter': {
49
- textTransform: 'uppercase',
50
- },
51
47
  }));
@@ -7,6 +7,7 @@ export const CardTitle = styled(Typography, {
7
7
  lineHeight: 1,
8
8
  fontWeight: 700,
9
9
  padding: theme.spacing(2, 2, 0, 2),
10
+ textAlign: 'left',
10
11
  '&:after': {
11
12
  content: required ? '" *"' : 'none',
12
13
  color: theme.palette.error.main,
@@ -10,7 +10,7 @@ import { useFieldController } from '../../stores/form/useFieldController.js';
10
10
 
11
11
  export const useChainSelect = (formType: FormType) => {
12
12
  const chainKey = FormKeyHelper.getChainKey(formType);
13
- const { onChange, onBlur } = useFieldController({ name: chainKey });
13
+ const { onChange } = useFieldController({ name: chainKey });
14
14
 
15
15
  const { setFieldValue, getFieldValues } = useFieldActions();
16
16
  const { chains, isLoading, getChainById } = useChains(formType);
@@ -30,7 +30,6 @@ export const useChainSelect = (formType: FormType) => {
30
30
 
31
31
  const setCurrentChain = (chainId: number) => {
32
32
  onChange(chainId);
33
- onBlur();
34
33
  if (swapOnly) {
35
34
  setFieldValue(FormKeyHelper.getChainKey('to'), chainId, {
36
35
  isTouched: true,
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  AppBar,
3
+ Avatar,
3
4
  Box,
4
5
  Button,
5
6
  alpha,
6
- badgeClasses,
7
7
  buttonClasses,
8
8
  styled,
9
9
  } from '@mui/material';
10
+ import { getContrastAlphaColor } from '../../utils/colors.js';
11
+ import { avatarMask12 } from '../Avatar/utils.js';
10
12
  import { Tabs } from '../Tabs/Tabs.style.js';
11
13
 
12
14
  export const HeaderAppBar = styled(AppBar)(({ theme }) => ({
@@ -42,10 +44,7 @@ export const WalletButton = styled(Button)(({ theme }) => ({
42
44
  fontWeight: 600,
43
45
  borderRadius: theme.shape.borderRadius * 2,
44
46
  '&:hover': {
45
- backgroundColor:
46
- theme.palette.mode === 'light'
47
- ? alpha(theme.palette.common.black, 0.04)
48
- : alpha(theme.palette.common.white, 0.08),
47
+ backgroundColor: getContrastAlphaColor(theme, 0.04),
49
48
  },
50
49
  [`.${buttonClasses.endIcon} > *:nth-of-type(1)`]: {
51
50
  fontSize: '24px',
@@ -53,12 +52,6 @@ export const WalletButton = styled(Button)(({ theme }) => ({
53
52
  [`.${buttonClasses.startIcon} > *:nth-of-type(1)`]: {
54
53
  fontSize: '24px',
55
54
  },
56
- [`&:hover .${badgeClasses.badge} > div`]: {
57
- borderColor:
58
- theme.palette.mode === 'light'
59
- ? alpha(theme.palette.common.black, 0.04)
60
- : alpha(theme.palette.common.white, 0.08),
61
- },
62
55
  }));
63
56
 
64
57
  export const DrawerWalletContainer = styled(Box)(({ theme }) => ({
@@ -84,7 +77,13 @@ export const HeaderControlsContainer = styled(Box)(({ theme }) => ({
84
77
 
85
78
  export const SplitTabs = styled(Tabs)(({ theme }) => ({
86
79
  backgroundColor:
87
- theme.palette.mode === 'dark'
88
- ? theme.palette.background.paper
89
- : alpha(theme.palette.common.black, 0.04),
80
+ theme.palette.mode === 'light'
81
+ ? alpha(theme.palette.common.black, 0.04)
82
+ : theme.palette.background.paper,
83
+ }));
84
+
85
+ export const WalletAvatar = styled(Avatar)(({ theme }) => ({
86
+ mask: avatarMask12,
87
+ width: 24,
88
+ height: 24,
90
89
  }));
@@ -17,6 +17,7 @@ import { CloseDrawerButton } from './CloseDrawerButton.js';
17
17
  import {
18
18
  DrawerWalletContainer,
19
19
  HeaderAppBar,
20
+ WalletAvatar,
20
21
  WalletButton,
21
22
  } from './Header.style.js';
22
23
  import { WalletMenu } from './WalletMenu.js';
@@ -117,16 +118,6 @@ const ConnectedButton = ({ account }: { account: Account }) => {
117
118
  setAnchorEl(null);
118
119
  };
119
120
 
120
- const avatar = (
121
- <Avatar
122
- src={getConnectorIcon(account.connector)}
123
- alt={account.connector?.name}
124
- sx={{ width: 24, height: 24 }}
125
- >
126
- {account.connector?.name[0]}
127
- </Avatar>
128
- );
129
-
130
121
  return (
131
122
  <>
132
123
  <WalletButton
@@ -140,16 +131,27 @@ const ConnectedButton = ({ account }: { account: Account }) => {
140
131
  <SmallAvatar
141
132
  src={chain?.logoURI}
142
133
  alt={chain?.name}
143
- sx={{ width: 16, height: 16 }}
134
+ sx={{ width: 12, height: 12 }}
144
135
  >
145
136
  {chain?.name[0]}
146
137
  </SmallAvatar>
147
138
  }
148
139
  >
149
- {avatar}
140
+ <WalletAvatar
141
+ src={getConnectorIcon(account.connector)}
142
+ alt={account.connector?.name}
143
+ >
144
+ {account.connector?.name[0]}
145
+ </WalletAvatar>
150
146
  </Badge>
151
147
  ) : (
152
- avatar
148
+ <Avatar
149
+ src={getConnectorIcon(account.connector)}
150
+ alt={account.connector?.name}
151
+ sx={{ width: 24, height: 24 }}
152
+ >
153
+ {account.connector?.name[0]}
154
+ </Avatar>
153
155
  )
154
156
  }
155
157
  sx={{
@@ -19,6 +19,7 @@ import { useAccount } from '../../hooks/useAccount.js';
19
19
  import { useAvailableChains } from '../../hooks/useAvailableChains.js';
20
20
  import { navigationRoutes } from '../../utils/navigationRoutes.js';
21
21
  import { shortenAddress } from '../../utils/wallet.js';
22
+ import { AvatarMasked } from '../Avatar/Avatar.style.js';
22
23
  import { SmallAvatar } from '../SmallAvatar.js';
23
24
  import { EVMDisconnectIconButton } from './EVMDisconnectIconButton.js';
24
25
  import { SVMDisconnectIconButton } from './SVMDisconnectIconButton.js';
@@ -44,17 +45,7 @@ export const WalletMenu = ({ onClose }: { onClose: () => void }) => {
44
45
  await navigator.clipboard.writeText(account.address ?? '');
45
46
  onClose();
46
47
  };
47
- const avatar = (
48
- <Avatar
49
- src={getConnectorIcon(account.connector)}
50
- alt={account.connector?.name}
51
- sx={{
52
- marginRight: chain?.logoURI ? 0 : 1.5,
53
- }}
54
- >
55
- {account.connector?.name[0]}
56
- </Avatar>
57
- );
48
+
58
49
  return (
59
50
  <MenuItem key={account.address}>
60
51
  <Box flex={1} display="flex" alignItems="center">
@@ -69,10 +60,26 @@ export const WalletMenu = ({ onClose }: { onClose: () => void }) => {
69
60
  }
70
61
  sx={{ marginRight: 1.5 }}
71
62
  >
72
- {avatar}
63
+ <AvatarMasked
64
+ src={getConnectorIcon(account.connector)}
65
+ alt={account.connector?.name}
66
+ sx={{
67
+ marginRight: chain?.logoURI ? 0 : 1.5,
68
+ }}
69
+ >
70
+ {account.connector?.name[0]}
71
+ </AvatarMasked>
73
72
  </Badge>
74
73
  ) : (
75
- avatar
74
+ <Avatar
75
+ src={getConnectorIcon(account.connector)}
76
+ alt={account.connector?.name}
77
+ sx={{
78
+ marginRight: chain?.logoURI ? 0 : 1.5,
79
+ }}
80
+ >
81
+ {account.connector?.name[0]}
82
+ </Avatar>
76
83
  )}
77
84
  {walletAddress}
78
85
  </Box>
@@ -1,14 +1,11 @@
1
1
  import { InputBase, inputBaseClasses, styled } from '@mui/material';
2
2
 
3
3
  export const Input = styled(InputBase)(({ theme }) => ({
4
- backgroundColor:
5
- theme.palette.mode === 'light'
6
- ? theme.palette.common.white
7
- : theme.palette.background.paper,
8
4
  paddingRight: theme.spacing(2),
9
5
  [`.${inputBaseClasses.input}`]: {
10
6
  padding: theme.spacing(1.5, 1, 1.5, 2),
11
7
  height: '2.875em',
12
8
  boxSizing: 'inherit',
13
9
  },
10
+ fontWeight: 500,
14
11
  }));
@@ -1,15 +1,18 @@
1
1
  import { ListItemButton as MuiListItemButton, styled } from '@mui/material';
2
2
  import { getContrastAlphaColor } from '../utils/colors.js';
3
3
 
4
- export const ListItemButton = styled(MuiListItemButton)(
5
- ({ theme, disabled }) => ({
4
+ export const ListItemButton = styled(MuiListItemButton)(({
5
+ theme,
6
+ disabled,
7
+ }) => {
8
+ const backgroundHoverColor = getContrastAlphaColor(theme, 0.04);
9
+ return {
6
10
  borderRadius: theme.shape.borderRadius,
7
11
  paddingLeft: theme.spacing(1.5),
8
12
  height: 56,
9
- ...(disabled ? { opacity: 0.5, cursor: 'auto' } : {}),
10
13
  '&:hover': {
11
- backgroundColor:
12
- !disabled && getContrastAlphaColor(theme.palette.mode, '4%'),
14
+ backgroundColor: !disabled && backgroundHoverColor,
13
15
  },
14
- }),
15
- );
16
+ ...(disabled ? { opacity: 0.5, cursor: 'auto' } : {}),
17
+ };
18
+ });
@@ -6,6 +6,6 @@ import {
6
6
 
7
7
  export const ListItemText = styled(MuiListItemText)(({ theme }) => ({
8
8
  [`.${listItemTextClasses.primary}`]: {
9
- fontWeight: 400,
9
+ fontWeight: 500,
10
10
  },
11
11
  }));
@@ -10,8 +10,16 @@ export const PageContainer = styled(Container, {
10
10
  !['halfGutters', 'topBottomGutters'].includes(prop as string),
11
11
  })<PageContainerProps>(
12
12
  ({ theme, disableGutters, halfGutters, topBottomGutters }) => ({
13
+ display: 'flex',
14
+ flexDirection: 'column',
15
+ flex: 1,
13
16
  padding: disableGutters
14
17
  ? 0
15
- : theme.spacing(topBottomGutters ? 1 : 0, halfGutters ? 1.5 : 3),
18
+ : theme.spacing(
19
+ topBottomGutters ? 1 : 0,
20
+ halfGutters ? 1.5 : 3,
21
+ topBottomGutters ? 3 : 0,
22
+ halfGutters ? 1.5 : 3,
23
+ ),
16
24
  }),
17
25
  );
@@ -1,54 +1,39 @@
1
1
  import { Box, Tooltip, Typography } from '@mui/material';
2
- import { useLocation } from 'react-router-dom';
3
2
  import { version } from '../../config/version.js';
4
- import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
5
- import { HiddenUI } from '../../types/widget.js';
6
- import { navigationRoutes } from '../../utils/navigationRoutes.js';
7
3
  import { Link } from './PoweredBy.style.js';
8
4
 
9
5
  export const PoweredBy: React.FC = () => {
10
- const { hiddenUI } = useWidgetConfig();
11
- const { pathname } = useLocation();
12
- if (
13
- pathname.includes(navigationRoutes.fromToken) ||
14
- pathname.includes(navigationRoutes.toToken) ||
15
- pathname.includes(navigationRoutes.transactionHistory)
16
- ) {
17
- return null;
18
- }
19
6
  return (
20
7
  <Box
21
- px={3}
22
8
  pt={1}
23
- pb={hiddenUI?.includes(HiddenUI.PoweredBy) ? 1 : 2}
9
+ pb={2}
10
+ flex={1}
24
11
  sx={{
25
12
  display: 'flex',
26
13
  alignItems: 'flex-end',
27
14
  justifyContent: 'flex-end',
28
15
  }}
29
16
  >
30
- {!hiddenUI?.includes(HiddenUI.PoweredBy) ? (
31
- <Tooltip title={`v${version}`} placement="top" enterDelay={1000} arrow>
32
- <Link
33
- href="https://li.fi"
34
- target="_blank"
35
- underline="none"
36
- color="text.primary"
17
+ <Tooltip title={`v${version}`} placement="top" enterDelay={1000} arrow>
18
+ <Link
19
+ href="https://li.fi"
20
+ target="_blank"
21
+ underline="none"
22
+ color="text.primary"
23
+ >
24
+ <Typography
25
+ color="text.secondary"
26
+ fontSize={12}
27
+ fontWeight={500}
28
+ px={0.5}
37
29
  >
38
- <Typography
39
- color="text.secondary"
40
- fontSize={12}
41
- fontWeight={500}
42
- px={0.5}
43
- >
44
- Powered by
45
- </Typography>
46
- <Typography color="text.primary" fontSize={12} fontWeight={500}>
47
- LI.FI
48
- </Typography>
49
- </Link>
50
- </Tooltip>
51
- ) : null}
30
+ Powered by
31
+ </Typography>
32
+ <Typography color="text.primary" fontSize={12} fontWeight={600}>
33
+ LI.FI
34
+ </Typography>
35
+ </Link>
36
+ </Tooltip>
52
37
  </Box>
53
38
  );
54
39
  };
@@ -3,8 +3,8 @@ import { Box, Typography, alpha, styled } from '@mui/material';
3
3
  export const IconTypography = styled(Typography)(({ theme }) => ({
4
4
  color:
5
5
  theme.palette.mode === 'light'
6
- ? alpha(theme.palette.common.black, 0.24)
7
- : alpha(theme.palette.common.white, 0.32),
6
+ ? alpha(theme.palette.common.black, 0.32)
7
+ : alpha(theme.palette.common.white, 0.4),
8
8
  lineHeight: 0,
9
9
  }));
10
10
 
@@ -3,7 +3,7 @@ import { ExpandLess, ExpandMore, VerifiedUser } from '@mui/icons-material';
3
3
  import type { TooltipProps } from '@mui/material';
4
4
  import { Box, Collapse, Tooltip, Typography } from '@mui/material';
5
5
  import type { MouseEventHandler } from 'react';
6
- import { Fragment, useState } from 'react';
6
+ import { useState } from 'react';
7
7
  import { Trans, useTranslation } from 'react-i18next';
8
8
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
9
9
  import { formatTokenAmount } from '../../utils/format.js';
@@ -44,21 +44,20 @@ export const RouteCard: React.FC<
44
44
  ? { ...route.fromToken, amount: BigInt(route.fromAmount) }
45
45
  : { ...route.toToken, amount: BigInt(route.toAmount) };
46
46
 
47
- const RecommendedTagTooltip =
48
- route.tags?.[0] === 'RECOMMENDED' ? RecommendedTooltip : Fragment;
47
+ const tags = route.tags?.filter(
48
+ (tag) => tag === 'CHEAPEST' || tag === 'FASTEST',
49
+ );
49
50
 
50
51
  const cardContent = (
51
52
  <Box flex={1}>
52
53
  {subvariant !== 'refuel' && (insurable || route.tags?.length) ? (
53
54
  <Box display="flex" alignItems="center" mb={2}>
54
- {route.tags?.length ? (
55
- <RecommendedTagTooltip>
56
- <CardLabel type={active ? 'active' : undefined}>
57
- <CardLabelTypography>
58
- {t(`main.tags.${route.tags[0].toLowerCase()}` as any)}
59
- </CardLabelTypography>
60
- </CardLabel>
61
- </RecommendedTagTooltip>
55
+ {tags?.length ? (
56
+ <CardLabel type={active ? 'active' : undefined}>
57
+ <CardLabelTypography>
58
+ {t(`main.tags.${tags[0].toLowerCase()}` as any)}
59
+ </CardLabelTypography>
60
+ </CardLabel>
62
61
  ) : null}
63
62
  {insurable ? (
64
63
  <InsuranceTooltip
@@ -157,19 +156,3 @@ const InsuranceTooltip: React.FC<
157
156
  </Tooltip>
158
157
  );
159
158
  };
160
-
161
- const RecommendedTooltip: React.FC<Pick<TooltipProps, 'children'>> = ({
162
- children,
163
- }) => {
164
- const { t } = useTranslation();
165
- return (
166
- <Tooltip
167
- title={t('tooltip.recommended')}
168
- placement="top"
169
- enterDelay={400}
170
- arrow
171
- >
172
- {children}
173
- </Tooltip>
174
- );
175
- };