@lifi/widget 3.19.0-beta.0 → 3.19.0-beta.2

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 (209) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js +2 -3
  3. package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
  4. package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +1 -1
  5. package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
  6. package/dist/esm/components/AppContainer.js +1 -1
  7. package/dist/esm/components/AppContainer.js.map +1 -1
  8. package/dist/esm/components/Avatar/Avatar.style.js +9 -9
  9. package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
  10. package/dist/esm/components/Avatar/SmallAvatar.js +1 -1
  11. package/dist/esm/components/Avatar/SmallAvatar.js.map +1 -1
  12. package/dist/esm/components/ButtonTertiary.js +5 -6
  13. package/dist/esm/components/ButtonTertiary.js.map +1 -1
  14. package/dist/esm/components/Card/Card.js +18 -18
  15. package/dist/esm/components/Card/Card.js.map +1 -1
  16. package/dist/esm/components/Card/CardButton.style.js +1 -1
  17. package/dist/esm/components/Card/CardButton.style.js.map +1 -1
  18. package/dist/esm/components/Card/CardHeader.js +2 -2
  19. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  20. package/dist/esm/components/Card/CardIconButton.js +2 -3
  21. package/dist/esm/components/Card/CardIconButton.js.map +1 -1
  22. package/dist/esm/components/Card/CardLabel.js +15 -21
  23. package/dist/esm/components/Card/CardLabel.js.map +1 -1
  24. package/dist/esm/components/Card/CardTitle.js +2 -2
  25. package/dist/esm/components/Card/CardTitle.js.map +1 -1
  26. package/dist/esm/components/Card/InputCard.d.ts +1 -1
  27. package/dist/esm/components/ContractComponent/NFT/NFT.style.js +2 -2
  28. package/dist/esm/components/ContractComponent/NFT/NFT.style.js.map +1 -1
  29. package/dist/esm/components/Dialog.js +3 -3
  30. package/dist/esm/components/Dialog.js.map +1 -1
  31. package/dist/esm/components/Header/Header.style.js +15 -7
  32. package/dist/esm/components/Header/Header.style.js.map +1 -1
  33. package/dist/esm/components/Header/SettingsButton.style.js +18 -7
  34. package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
  35. package/dist/esm/components/Header/WalletMenu.style.js +4 -4
  36. package/dist/esm/components/Header/WalletMenu.style.js.map +1 -1
  37. package/dist/esm/components/IconTypography.js +4 -4
  38. package/dist/esm/components/IconTypography.js.map +1 -1
  39. package/dist/esm/components/ListItemButton.js +2 -4
  40. package/dist/esm/components/ListItemButton.js.map +1 -1
  41. package/dist/esm/components/Menu.js +3 -3
  42. package/dist/esm/components/Menu.js.map +1 -1
  43. package/dist/esm/components/Messages/AlertMessage.style.js +18 -12
  44. package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
  45. package/dist/esm/components/Messages/GasRefuelMessage.style.js +7 -7
  46. package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
  47. package/dist/esm/components/PoweredBy/PoweredBy.style.js +1 -1
  48. package/dist/esm/components/PoweredBy/PoweredBy.style.js.map +1 -1
  49. package/dist/esm/components/ProgressToNextUpdate.js +6 -6
  50. package/dist/esm/components/ProgressToNextUpdate.js.map +1 -1
  51. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js +1 -1
  52. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.style.js.map +1 -1
  53. package/dist/esm/components/RouteCard/RouteCardSkeleton.js +1 -1
  54. package/dist/esm/components/RouteCard/RouteCardSkeleton.js.map +1 -1
  55. package/dist/esm/components/Routes/RoutesExpanded.style.js +2 -2
  56. package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
  57. package/dist/esm/components/Search/SearchInput.style.js +1 -1
  58. package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
  59. package/dist/esm/components/Search/SearchNotFound.style.js +1 -1
  60. package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
  61. package/dist/esm/components/Select.js +4 -4
  62. package/dist/esm/components/Select.js.map +1 -1
  63. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +8 -7
  64. package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
  65. package/dist/esm/components/SendToWallet/SendToWallet.style.js +2 -2
  66. package/dist/esm/components/SendToWallet/SendToWallet.style.js.map +1 -1
  67. package/dist/esm/components/Skeleton/WidgetSkeleton.js +3 -3
  68. package/dist/esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
  69. package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +1 -1
  70. package/dist/esm/components/Skeleton/WidgetSkeleton.style.js +2 -2
  71. package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
  72. package/dist/esm/components/Step/CircularProgress.js +1 -2
  73. package/dist/esm/components/Step/CircularProgress.js.map +1 -1
  74. package/dist/esm/components/Step/CircularProgress.style.js +11 -10
  75. package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
  76. package/dist/esm/components/StepActions/StepActions.style.js +10 -10
  77. package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
  78. package/dist/esm/components/Switch.js +10 -16
  79. package/dist/esm/components/Switch.js.map +1 -1
  80. package/dist/esm/components/Tabs/Tabs.style.js +10 -16
  81. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  82. package/dist/esm/components/TextFitter/TextFitter.js +1 -1
  83. package/dist/esm/components/TextFitter/TextFitter.js.map +1 -1
  84. package/dist/esm/components/Token/Token.js +5 -2
  85. package/dist/esm/components/Token/Token.js.map +1 -1
  86. package/dist/esm/components/Token/Token.style.js +6 -6
  87. package/dist/esm/components/Token/Token.style.js.map +1 -1
  88. package/dist/esm/components/TokenList/TokenList.js +5 -1
  89. package/dist/esm/components/TokenList/TokenList.js.map +1 -1
  90. package/dist/esm/components/TokenList/TokenList.style.js +2 -3
  91. package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
  92. package/dist/esm/components/TokenRate/TokenRate.style.js +1 -1
  93. package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
  94. package/dist/esm/components/TransactionDetails.js +4 -1
  95. package/dist/esm/components/TransactionDetails.js.map +1 -1
  96. package/dist/esm/config/version.d.ts +1 -1
  97. package/dist/esm/config/version.js +1 -1
  98. package/dist/esm/hooks/useRoutes.js +2 -1
  99. package/dist/esm/hooks/useRoutes.js.map +1 -1
  100. package/dist/esm/i18n/en.json +2 -1
  101. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +1 -1
  102. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js +9 -10
  103. package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
  104. package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js +2 -3
  105. package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
  106. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +18 -14
  107. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
  108. package/dist/esm/pages/SettingsPage/ThemeSettings.js +6 -6
  109. package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
  110. package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +2 -2
  111. package/dist/esm/pages/TransactionHistoryPage/TransactionHistorySkeleton.js.map +1 -1
  112. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +3 -2
  113. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
  114. package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js +19 -7
  115. package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js.map +1 -1
  116. package/dist/esm/providers/ThemeProvider/ThemeProvider.js +7 -22
  117. package/dist/esm/providers/ThemeProvider/ThemeProvider.js.map +1 -1
  118. package/dist/esm/stores/settings/types.d.ts +1 -2
  119. package/dist/esm/stores/settings/useSettingsStore.js +2 -7
  120. package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
  121. package/dist/esm/stores/settings/utils/getStateValues.js +0 -1
  122. package/dist/esm/stores/settings/utils/getStateValues.js.map +1 -1
  123. package/dist/esm/themes/createTheme.d.ts +1 -2
  124. package/dist/esm/themes/createTheme.js +108 -67
  125. package/dist/esm/themes/createTheme.js.map +1 -1
  126. package/dist/esm/themes/jumper.js +1 -1
  127. package/dist/esm/themes/jumper.js.map +1 -1
  128. package/dist/esm/themes/watermelonLight.js +1 -1
  129. package/dist/esm/themes/watermelonLight.js.map +1 -1
  130. package/dist/esm/types/widget.d.ts +21 -4
  131. package/dist/esm/types/widget.js.map +1 -1
  132. package/dist/esm/utils/percentFormatter.js +5 -1
  133. package/dist/esm/utils/percentFormatter.js.map +1 -1
  134. package/package.json +2 -2
  135. package/package.json.tmp +1 -1
  136. package/src/components/ActiveTransactions/ActiveTransactions.style.ts +2 -3
  137. package/src/components/AmountInput/AmountInputAdornment.style.tsx +1 -1
  138. package/src/components/AppContainer.tsx +1 -1
  139. package/src/components/Avatar/Avatar.style.tsx +9 -9
  140. package/src/components/Avatar/SmallAvatar.tsx +1 -1
  141. package/src/components/ButtonTertiary.tsx +5 -6
  142. package/src/components/Card/Card.tsx +18 -18
  143. package/src/components/Card/CardButton.style.tsx +1 -1
  144. package/src/components/Card/CardHeader.tsx +2 -2
  145. package/src/components/Card/CardIconButton.tsx +2 -3
  146. package/src/components/Card/CardLabel.tsx +15 -59
  147. package/src/components/Card/CardTitle.tsx +2 -2
  148. package/src/components/ContractComponent/NFT/NFT.style.ts +2 -2
  149. package/src/components/Dialog.tsx +3 -3
  150. package/src/components/Header/Header.style.ts +15 -7
  151. package/src/components/Header/SettingsButton.style.tsx +17 -10
  152. package/src/components/Header/WalletMenu.style.tsx +4 -4
  153. package/src/components/IconTypography.ts +4 -4
  154. package/src/components/ListItemButton.tsx +2 -4
  155. package/src/components/Menu.tsx +3 -3
  156. package/src/components/Messages/AlertMessage.style.tsx +18 -16
  157. package/src/components/Messages/GasRefuelMessage.style.ts +7 -7
  158. package/src/components/PoweredBy/PoweredBy.style.ts +1 -1
  159. package/src/components/ProgressToNextUpdate.tsx +6 -6
  160. package/src/components/ReverseTokensButton/ReverseTokensButton.style.tsx +1 -1
  161. package/src/components/RouteCard/RouteCardSkeleton.tsx +1 -1
  162. package/src/components/Routes/RoutesExpanded.style.ts +2 -2
  163. package/src/components/Search/SearchInput.style.tsx +1 -1
  164. package/src/components/Search/SearchNotFound.style.tsx +1 -1
  165. package/src/components/Select.tsx +4 -4
  166. package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +7 -9
  167. package/src/components/SendToWallet/SendToWallet.style.tsx +2 -2
  168. package/src/components/Skeleton/WidgetSkeleton.style.tsx +2 -2
  169. package/src/components/Skeleton/WidgetSkeleton.tsx +9 -6
  170. package/src/components/Step/CircularProgress.style.tsx +11 -11
  171. package/src/components/Step/CircularProgress.tsx +1 -2
  172. package/src/components/StepActions/StepActions.style.tsx +9 -10
  173. package/src/components/Switch.tsx +10 -21
  174. package/src/components/Tabs/Tabs.style.tsx +9 -16
  175. package/src/components/TextFitter/TextFitter.tsx +1 -1
  176. package/src/components/Token/Token.style.tsx +6 -6
  177. package/src/components/Token/Token.tsx +5 -2
  178. package/src/components/TokenList/TokenList.style.tsx +2 -3
  179. package/src/components/TokenList/TokenList.tsx +5 -1
  180. package/src/components/TokenRate/TokenRate.style.ts +1 -1
  181. package/src/components/TransactionDetails.tsx +4 -1
  182. package/src/config/version.ts +1 -1
  183. package/src/hooks/useRoutes.ts +2 -1
  184. package/src/i18n/en.json +2 -1
  185. package/src/pages/SendToWallet/SendToWalletPage.style.tsx +9 -10
  186. package/src/pages/SettingsPage/ResetSettingsButton.style.tsx +2 -3
  187. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +17 -15
  188. package/src/pages/SettingsPage/ThemeSettings.tsx +7 -6
  189. package/src/pages/TransactionHistoryPage/TransactionHistorySkeleton.tsx +2 -2
  190. package/src/pages/TransactionPage/StatusBottomSheet.style.tsx +19 -7
  191. package/src/pages/TransactionPage/StatusBottomSheet.tsx +5 -0
  192. package/src/providers/ThemeProvider/ThemeProvider.tsx +20 -27
  193. package/src/stores/settings/types.ts +1 -2
  194. package/src/stores/settings/useSettingsStore.ts +2 -7
  195. package/src/stores/settings/utils/getStateValues.ts +0 -1
  196. package/src/themes/createTheme.ts +124 -91
  197. package/src/themes/jumper.ts +1 -1
  198. package/src/themes/types.ts +1 -0
  199. package/src/themes/watermelonLight.ts +1 -1
  200. package/src/types/widget.ts +25 -3
  201. package/src/utils/percentFormatter.ts +8 -1
  202. package/dist/esm/stores/settings/useAppearance.d.ts +0 -2
  203. package/dist/esm/stores/settings/useAppearance.js +0 -11
  204. package/dist/esm/stores/settings/useAppearance.js.map +0 -1
  205. package/dist/esm/utils/colors.d.ts +0 -15
  206. package/dist/esm/utils/colors.js +0 -35
  207. package/dist/esm/utils/colors.js.map +0 -1
  208. package/src/stores/settings/useAppearance.ts +0 -15
  209. package/src/utils/colors.ts +0 -53
@@ -8,18 +8,18 @@ import {
8
8
 
9
9
  export const Menu = styled(MuiMenu)(({ theme }) => ({
10
10
  [`& .${menuClasses.paper}`]: {
11
- borderRadius: theme.shape.borderRadius,
11
+ borderRadius: theme.vars.shape.borderRadius,
12
12
  boxShadow: '0px 2px 4px rgb(0 0 0 / 8%), 0px 8px 16px rgb(0 0 0 / 8%)',
13
13
  padding: theme.spacing(2),
14
14
  [`& .${menuClasses.list}`]: {
15
15
  padding: 0,
16
16
  },
17
17
  [`& .${menuItemClasses.root}`]: {
18
- borderRadius: theme.shape.borderRadiusSecondary,
18
+ borderRadius: theme.vars.shape.borderRadiusSecondary,
19
19
  padding: theme.spacing(1, 2, 1, 1),
20
20
  [`& .${svgIconClasses.root}`]: {
21
21
  fontSize: 20,
22
- color: theme.palette.text.primary,
22
+ color: theme.vars.palette.text.primary,
23
23
  marginRight: theme.spacing(1.5),
24
24
  },
25
25
  },
@@ -1,8 +1,4 @@
1
- import { Box, alpha, darken, lighten, styled } from '@mui/material'
2
- import {
3
- getInfoBackgroundColor,
4
- getWarningBackgroundColor,
5
- } from '../../utils/colors.js'
1
+ import { Box, styled } from '@mui/material'
6
2
  import type { Severity } from './types.js'
7
3
 
8
4
  interface AlertSeverityProps {
@@ -12,19 +8,25 @@ interface AlertSeverityProps {
12
8
  export const AlertMessageCard = styled(Box, {
13
9
  shouldForwardProp: (prop) => prop !== 'severity',
14
10
  })<AlertSeverityProps>(({ theme }) => ({
15
- borderRadius: theme.shape.borderRadius,
11
+ borderRadius: theme.vars.shape.borderRadius,
16
12
  position: 'relative',
17
13
  whiteSpace: 'pre-line',
18
14
  width: '100%',
19
15
  paddingBottom: theme.spacing(2),
20
- backgroundColor: getInfoBackgroundColor(theme),
16
+ backgroundColor: `rgba(${theme.vars.palette.info.mainChannel} / 0.12)`,
17
+ ...theme.applyStyles('dark', {
18
+ backgroundColor: `rgba(${theme.vars.palette.info.mainChannel} / 0.16)`,
19
+ }),
21
20
  variants: [
22
21
  {
23
22
  props: {
24
23
  severity: 'warning',
25
24
  },
26
25
  style: {
27
- backgroundColor: getWarningBackgroundColor(theme),
26
+ backgroundColor: `rgba(${theme.vars.palette.warning.mainChannel} / 0.32)`,
27
+ ...theme.applyStyles('dark', {
28
+ backgroundColor: `rgba(${theme.vars.palette.warning.mainChannel} / 0.16)`,
29
+ }),
28
30
  },
29
31
  },
30
32
  ],
@@ -38,21 +40,21 @@ export const AlertMessageCardTitle = styled(Box, {
38
40
  paddingRight: theme.spacing(2),
39
41
  paddingTop: theme.spacing(2),
40
42
  gap: theme.spacing(1),
41
- color: lighten(theme.palette.info.main, 0.24),
43
+ color: theme.vars.palette.info.main,
44
+ ...theme.applyStyles('dark', {
45
+ color: `color-mix(in srgb, ${theme.vars.palette.info.main} 76%, white)`,
46
+ }),
42
47
  variants: [
43
48
  {
44
49
  props: {
45
50
  severity: 'warning',
46
51
  },
47
52
  style: {
48
- color:
49
- theme.palette.mode === 'light'
50
- ? darken(theme.palette.warning.main, 0.36)
51
- : alpha(theme.palette.warning.main, 1),
53
+ color: `color-mix(in srgb, ${theme.vars.palette.warning.main} 64%, black)`,
54
+ ...theme.applyStyles('dark', {
55
+ color: theme.vars.palette.warning.main,
56
+ }),
52
57
  },
53
58
  },
54
59
  ],
55
- ...theme.applyStyles('light', {
56
- color: theme.palette.info.main,
57
- }),
58
60
  }))
@@ -1,20 +1,20 @@
1
- import { alpha, styled, switchClasses } from '@mui/material'
1
+ import { styled, switchClasses } from '@mui/material'
2
2
  import { Switch } from '../Switch.js'
3
3
 
4
4
  export const InfoMessageSwitch = styled(Switch)(({ theme }) => ({
5
5
  [`.${switchClasses.switchBase}`]: {
6
6
  [`&.${switchClasses.checked}`]: {
7
7
  [`& + .${switchClasses.track}`]: {
8
- backgroundColor: alpha(theme.palette.info.main, 0.84),
9
- ...theme.applyStyles('light', {
10
- backgroundColor: theme.palette.info.main,
8
+ backgroundColor: theme.vars.palette.info.main,
9
+ ...theme.applyStyles('dark', {
10
+ backgroundColor: `rgba(${theme.vars.palette.info.mainChannel} / 0.84)`,
11
11
  }),
12
12
  },
13
13
  },
14
14
  [`&.Mui-focusVisible .${switchClasses.thumb}`]: {
15
- color: alpha(theme.palette.info.main, 0.84),
16
- ...theme.applyStyles('light', {
17
- color: theme.palette.info.main,
15
+ color: theme.vars.palette.info.main,
16
+ ...theme.applyStyles('dark', {
17
+ color: `rgba(${theme.vars.palette.info.mainChannel} / 0.84)`,
18
18
  }),
19
19
  },
20
20
  },
@@ -5,6 +5,6 @@ export const Link = styled(MuiLink)(({ theme }) => ({
5
5
  alignItems: 'center',
6
6
  border: 'none',
7
7
  ':hover': {
8
- color: theme.palette.primary.main,
8
+ color: theme.vars.palette.primary.main,
9
9
  },
10
10
  }))
@@ -67,9 +67,9 @@ export const ProgressToNextUpdate: React.FC<
67
67
  value={100}
68
68
  sx={(theme) => ({
69
69
  position: 'absolute',
70
- color: theme.palette.grey[800],
71
- ...theme.applyStyles('light', {
72
- color: theme.palette.grey[300],
70
+ color: theme.vars.palette.grey[300],
71
+ ...theme.applyStyles('dark', {
72
+ color: theme.vars.palette.grey[800],
73
73
  }),
74
74
  })}
75
75
  />
@@ -79,9 +79,9 @@ export const ProgressToNextUpdate: React.FC<
79
79
  value={value}
80
80
  sx={(theme) => ({
81
81
  opacity: value === 100 && !isLoading ? 0.5 : 1,
82
- color: theme.palette.primary.light,
83
- ...theme.applyStyles('light', {
84
- color: theme.palette.primary.main,
82
+ color: theme.vars.palette.primary.main,
83
+ ...theme.applyStyles('dark', {
84
+ color: theme.vars.palette.primary.light,
85
85
  }),
86
86
  })}
87
87
  />
@@ -8,7 +8,7 @@ export const IconCard = styled(Card)(({ theme }) => ({
8
8
  display: 'flex',
9
9
  alignItems: 'center',
10
10
  justifyContent: 'center',
11
- borderRadius: theme.shape.borderRadiusTertiary,
11
+ borderRadius: theme.vars.shape.borderRadiusTertiary,
12
12
  zIndex: 1110,
13
13
  }))
14
14
 
@@ -29,7 +29,7 @@ export const RouteCardSkeleton: React.FC<
29
29
  width={112}
30
30
  height={24}
31
31
  sx={(theme) => ({
32
- borderRadius: `${theme.shape.borderRadius}px`,
32
+ borderRadius: theme.vars.shape.borderRadius,
33
33
  })}
34
34
  />
35
35
  </Box>
@@ -33,7 +33,7 @@ interface ContainerProps extends ScopedCssBaselineProps {
33
33
  export const Container = styled(ScopedCssBaseline, {
34
34
  shouldForwardProp: (prop) => !['minimumHeight'].includes(prop as string),
35
35
  })<ContainerProps>(({ theme, minimumHeight }) => ({
36
- backgroundColor: theme.palette.background.default,
36
+ backgroundColor: theme.vars.palette.background.default,
37
37
  overflow: 'auto',
38
38
  width: 436,
39
39
  marginLeft: theme.spacing(3),
@@ -52,7 +52,7 @@ export const Container = styled(ScopedCssBaseline, {
52
52
  }))
53
53
 
54
54
  export const Header = styled(Box)(({ theme }) => ({
55
- backgroundColor: theme.palette.background.default,
55
+ backgroundColor: theme.vars.palette.background.default,
56
56
  backdropFilter: 'blur(12px)',
57
57
  display: 'flex',
58
58
  justifyContent: 'space-between',
@@ -24,7 +24,7 @@ export const StickySearchInputContainer = styled(Box, {
24
24
  paddingBottom: theme.spacing(2),
25
25
  paddingLeft: theme.spacing(3),
26
26
  paddingRight: theme.spacing(3),
27
- backgroundColor: theme.palette.background.default,
27
+ backgroundColor: theme.vars.palette.background.default,
28
28
  ...(theme.header?.position === 'fixed'
29
29
  ? {
30
30
  position: 'fixed',
@@ -22,7 +22,7 @@ export const NotFoundContainer = styled(Box, {
22
22
 
23
23
  export const NotFoundMessage = styled(Typography)(({ theme }) => ({
24
24
  fontSize: 14,
25
- color: theme.palette.text.secondary,
25
+ color: theme.vars.palette.text.secondary,
26
26
  textAlign: 'center',
27
27
  flex: 1,
28
28
  marginTop: theme.spacing(2),
@@ -10,7 +10,7 @@ import {
10
10
  export const Select = styled(MuiSelect, {
11
11
  shouldForwardProp: (prop) => prop !== 'dense',
12
12
  })<{ dense?: boolean }>(({ theme }) => ({
13
- backgroundColor: theme.palette.background.paper,
13
+ backgroundColor: theme.vars.palette.common.white,
14
14
  [`.${inputBaseClasses.input}`]: {
15
15
  padding: theme.spacing(2),
16
16
  display: 'flex',
@@ -18,7 +18,7 @@ export const Select = styled(MuiSelect, {
18
18
  },
19
19
  [`.${selectClasses.icon}`]: {
20
20
  right: 10,
21
- color: theme.palette.text.primary,
21
+ color: theme.vars.palette.text.primary,
22
22
  },
23
23
  [`.${listItemIconClasses.root}`]: {
24
24
  minWidth: 38,
@@ -26,8 +26,8 @@ export const Select = styled(MuiSelect, {
26
26
  [`.${outlinedInputClasses.notchedOutline}`]: {
27
27
  display: 'none',
28
28
  },
29
- ...theme.applyStyles('light', {
30
- backgroundColor: theme.palette.common.white,
29
+ ...theme.applyStyles('dark', {
30
+ backgroundColor: theme.vars.palette.background.paper,
31
31
  }),
32
32
  variants: [
33
33
  {
@@ -1,8 +1,6 @@
1
1
  import {
2
2
  CardContent as MuiCardContent,
3
3
  cardHeaderClasses,
4
- darken,
5
- lighten,
6
4
  styled,
7
5
  } from '@mui/material'
8
6
  import type { FormType } from '../../stores/form/types.js'
@@ -16,7 +14,7 @@ export const SelectTokenCardHeader = styled(CardHeader, {
16
14
  ({ theme, selected, compact }) => ({
17
15
  padding: theme.spacing(2),
18
16
  [`.${cardHeaderClasses.title}`]: {
19
- color: theme.palette.text.secondary,
17
+ color: theme.vars.palette.text.secondary,
20
18
  textOverflow: 'ellipsis',
21
19
  whiteSpace: 'nowrap',
22
20
  overflow: 'hidden',
@@ -41,7 +39,7 @@ export const SelectTokenCardHeader = styled(CardHeader, {
41
39
  props: ({ selected }) => selected,
42
40
  style: {
43
41
  [`.${cardHeaderClasses.title}`]: {
44
- color: theme.palette.text.primary,
42
+ color: theme.vars.palette.text.primary,
45
43
  fontWeight: 600,
46
44
  },
47
45
  },
@@ -98,16 +96,16 @@ export const CardContent = styled(MuiCardContent, {
98
96
  paddingBottom: 0,
99
97
  },
100
98
  ...(cardVariant !== 'outlined' && {
101
- backgroundColor: theme.palette.background.paper,
99
+ backgroundColor: theme.vars.palette.background.paper,
102
100
  mask: `radial-gradient(circle 20px at ${horizontal} ${vertical}, #fff0 96%, #fff) 100% 100% / 100% 100% no-repeat`,
103
101
  }),
104
102
  ...(cardVariant === 'filled' && {
105
103
  '&:hover': {
106
104
  cursor: 'pointer',
107
- backgroundColor:
108
- theme.palette.mode === 'light'
109
- ? darken(theme.palette.background.paper, 0.02)
110
- : lighten(theme.palette.background.paper, 0.02),
105
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.background.paper} 98%, white)`,
106
+ ...theme.applyStyles('dark', {
107
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.background.paper} 98%, black)`,
108
+ }),
111
109
  },
112
110
  }),
113
111
  }
@@ -6,7 +6,7 @@ export const SendToWalletCardHeader = styled(CardHeader, {
6
6
  })<{ selected?: boolean }>(({ theme }) => ({
7
7
  width: '100%',
8
8
  [`.${cardHeaderClasses.title}`]: {
9
- color: theme.palette.text.secondary,
9
+ color: theme.vars.palette.text.secondary,
10
10
  textOverflow: 'ellipsis',
11
11
  whiteSpace: 'nowrap',
12
12
  overflow: 'hidden',
@@ -36,7 +36,7 @@ export const SendToWalletCardHeader = styled(CardHeader, {
36
36
  props: ({ selected }) => selected,
37
37
  style: {
38
38
  [`.${cardHeaderClasses.title}`]: {
39
- color: theme.palette.text.primary,
39
+ color: theme.vars.palette.text.primary,
40
40
  fontWeight: 600,
41
41
  width: 224,
42
42
  [theme.breakpoints.down(theme.breakpoints.values.sm)]: {
@@ -6,7 +6,7 @@ export const SkeletonHeaderAppBar = styled(Box)(({ theme }) => ({
6
6
  flexDirection: 'row',
7
7
  justifyContent: 'flex-end',
8
8
  alignItems: 'center',
9
- color: theme.palette?.text.primary,
9
+ color: theme.vars?.palette?.text.primary,
10
10
  paddingRight: theme.navigation?.edge ? 0 : theme.spacing?.(1),
11
11
  }))
12
12
 
@@ -71,7 +71,7 @@ export const SkeletonHeaderContainer = styled(Box)(({ theme }) => {
71
71
  return {
72
72
  display: 'flex',
73
73
  flexDirection: 'column',
74
- backgroundColor: theme.palette.background.default,
74
+ backgroundColor: theme.vars.palette.background.default,
75
75
  backdropFilter: 'blur(12px)',
76
76
  position: 'relative',
77
77
  top: 0,
@@ -71,19 +71,22 @@ export const WidgetSkeleton = ({ config }: WidgetConfigPartialProps) => {
71
71
  const configTheme = config?.theme
72
72
  const prefersDarkMode = useMediaQuery('(prefers-color-scheme: dark)')
73
73
  const appearanceMode =
74
- !appearance || appearance === 'auto'
74
+ !appearance || appearance === 'system'
75
75
  ? prefersDarkMode
76
76
  ? 'dark'
77
77
  : 'light'
78
78
  : appearance
79
79
 
80
- const theme = useMemo(
81
- () => createTheme(appearanceMode, configTheme),
82
- [appearanceMode, configTheme]
83
- )
80
+ const theme = useMemo(() => createTheme(configTheme), [configTheme])
84
81
 
85
82
  return (
86
- <ThemeProvider theme={theme}>
83
+ <ThemeProvider
84
+ theme={theme}
85
+ defaultMode={appearanceMode}
86
+ modeStorageKey="li.fi-widget-mode"
87
+ colorSchemeStorageKey="li.fi-widget-color-scheme"
88
+ disableTransitionOnChange
89
+ >
87
90
  <AppExpandedContainer>
88
91
  <RelativeContainer sx={{ display: 'flex', flexDirection: 'column' }}>
89
92
  <SkeletonHeaderContainer>
@@ -3,7 +3,6 @@ import type { Theme } from '@mui/material'
3
3
  import {
4
4
  Box,
5
5
  CircularProgress as MuiCircularProgress,
6
- alpha,
7
6
  circularProgressClasses,
8
7
  keyframes,
9
8
  styled,
@@ -16,16 +15,16 @@ const getStatusColor = (
16
15
  ) => {
17
16
  switch (status) {
18
17
  case 'ACTION_REQUIRED':
19
- return alpha(theme.palette.info.main, 0.12)
18
+ return `rgba(${theme.vars.palette.info.mainChannel} / 0.12)`
20
19
  case 'DONE':
21
20
  if (substatus === 'PARTIAL' || substatus === 'REFUNDED') {
22
- return alpha(theme.palette.warning.main, 0.48)
21
+ return `rgba(${theme.vars.palette.warning.mainChannel} / 0.48)`
23
22
  }
24
- return alpha(theme.palette.success.main, 0.12)
23
+ return `rgba(${theme.vars.palette.success.mainChannel} / 0.12)`
25
24
  case 'FAILED':
26
- return alpha(theme.palette.error.main, 0.12)
25
+ return `rgba(${theme.vars.palette.error.mainChannel} / 0.12)`
27
26
  default:
28
- return theme.palette.grey[theme.palette.mode === 'light' ? 300 : 800]
27
+ return theme.vars.palette.grey[theme.palette.mode === 'light' ? 300 : 800]
29
28
  }
30
29
  }
31
30
 
@@ -35,7 +34,7 @@ export const CircularIcon = styled(Box, {
35
34
  ({ theme, status, substatus }) => ({
36
35
  backgroundColor: ['ACTION_REQUIRED', 'DONE', 'FAILED'].includes(status!)
37
36
  ? getStatusColor(theme, status, substatus)
38
- : theme.palette.background.paper,
37
+ : theme.vars.palette.background.paper,
39
38
  borderStyle: 'solid',
40
39
  borderColor: getStatusColor(theme, status, substatus),
41
40
  borderWidth: !['ACTION_REQUIRED', 'DONE', 'FAILED'].includes(status!)
@@ -68,10 +67,11 @@ const circleAnimation = keyframes`
68
67
  // This `styled()` function invokes keyframes. `styled-components` only supports keyframes
69
68
  // in string templates. Do not convert these styles in JS object as it will break.
70
69
  export const CircularProgressPending = styled(MuiCircularProgress)`
71
- color: ${({ theme }) =>
72
- theme.palette.mode === 'light'
73
- ? theme.palette.primary.main
74
- : theme.palette.primary.light};
70
+ color: ${({ theme }) => theme.vars.palette.primary.main};
71
+ ${({ theme }) =>
72
+ theme.applyStyles('dark', {
73
+ color: theme.vars.palette.primary.light,
74
+ })}
75
75
  animation-duration: 3s;
76
76
  position: absolute;
77
77
  .${circularProgressClasses.circle} {
@@ -3,7 +3,6 @@ import Done from '@mui/icons-material/Done'
3
3
  import ErrorRounded from '@mui/icons-material/ErrorRounded'
4
4
  import InfoRounded from '@mui/icons-material/InfoRounded'
5
5
  import WarningRounded from '@mui/icons-material/WarningRounded'
6
- import { darken } from '@mui/material'
7
6
  import {
8
7
  CircularIcon,
9
8
  CircularProgressPending,
@@ -30,7 +29,7 @@ export function CircularProgress({ process }: { process: Process }) {
30
29
  sx={(theme) => ({
31
30
  position: 'absolute',
32
31
  fontSize: '1.5rem',
33
- color: darken(theme.palette.warning.main, 0.32),
32
+ color: `color-mix(in srgb, ${theme.vars.palette.warning.main} 68%, black)`,
34
33
  })}
35
34
  />
36
35
  ) : process.status === 'DONE' ? (
@@ -3,7 +3,6 @@ import {
3
3
  StepConnector as MuiStepConnector,
4
4
  StepLabel as MuiStepLabel,
5
5
  Typography,
6
- alpha,
7
6
  stepConnectorClasses,
8
7
  stepLabelClasses,
9
8
  styled,
@@ -18,9 +17,9 @@ export const StepConnector = styled(MuiStepConnector, {
18
17
  [`.${stepConnectorClasses.line}`]: {
19
18
  minHeight: 8,
20
19
  borderLeftWidth: 2,
21
- borderColor: alpha(theme.palette.common.white, 0.16),
22
- ...theme.applyStyles('light', {
23
- borderColor: alpha(theme.palette.common.black, 0.12),
20
+ borderColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.12)`,
21
+ ...theme.applyStyles('dark', {
22
+ borderColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.16)`,
24
23
  }),
25
24
  },
26
25
  }))
@@ -49,16 +48,19 @@ export const StepLabelTypography = styled(Typography)(({ theme }) => ({
49
48
  fontSize: 12,
50
49
  fontWeight: 500,
51
50
  lineHeight: 1.325,
52
- color: theme.palette.text.secondary,
51
+ color: theme.vars.palette.text.secondary,
53
52
  padding: theme.spacing(0.5, 0),
54
53
  }))
55
54
 
56
55
  export const StepContent = styled(Box, {
57
56
  shouldForwardProp: (prop) => !['last'].includes(prop as string),
58
57
  })<{ last: boolean }>(({ theme }) => ({
59
- borderLeft: `2px solid ${alpha(theme.palette.common.white, 0.16)}`,
60
58
  margin: theme.spacing(0, 0, 0, 2.375),
61
59
  paddingLeft: theme.spacing(4.375),
60
+ borderLeft: `2px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.12)`,
61
+ ...theme.applyStyles('dark', {
62
+ borderLeft: `2px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.16)`,
63
+ }),
62
64
  variants: [
63
65
  {
64
66
  props: ({ last }) => last,
@@ -68,12 +70,9 @@ export const StepContent = styled(Box, {
68
70
  },
69
71
  },
70
72
  ],
71
- ...theme.applyStyles('light', {
72
- borderLeft: `2px solid ${alpha(theme.palette.common.black, 0.12)}`,
73
- }),
74
73
  }))
75
74
 
76
75
  export const StepAvatar = styled(AvatarMasked)(({ theme }) => ({
77
- color: theme.palette.text.primary,
76
+ color: theme.vars.palette.text.primary,
78
77
  backgroundColor: 'transparent',
79
78
  }))
@@ -1,9 +1,4 @@
1
- import {
2
- Switch as MuiSwitch,
3
- alpha,
4
- styled,
5
- switchClasses,
6
- } from '@mui/material'
1
+ import { Switch as MuiSwitch, styled, switchClasses } from '@mui/material'
7
2
 
8
3
  export const Switch = styled(MuiSwitch)(({ theme }) => ({
9
4
  width: 42,
@@ -15,9 +10,9 @@ export const Switch = styled(MuiSwitch)(({ theme }) => ({
15
10
  transitionDuration: theme.transitions.duration.standard,
16
11
  [`&.${switchClasses.checked}`]: {
17
12
  transform: 'translateX(18px)',
18
- color: theme.palette.common.white,
13
+ color: theme.vars.palette.common.white,
19
14
  [`& + .${switchClasses.track}`]: {
20
- backgroundColor: theme.palette.primary.main,
15
+ backgroundColor: theme.vars.palette.primary.main,
21
16
  opacity: 1,
22
17
  border: 0,
23
18
  },
@@ -26,20 +21,17 @@ export const Switch = styled(MuiSwitch)(({ theme }) => ({
26
21
  },
27
22
  },
28
23
  [`&.Mui-focusVisible .${switchClasses.thumb}`]: {
29
- color: theme.palette.primary.main,
24
+ color: theme.vars.palette.primary.main,
30
25
  border: '6px solid',
31
- borderColor: theme.palette.common.white,
26
+ borderColor: theme.vars.palette.common.white,
32
27
  },
33
28
  [`&.${switchClasses.disabled} .${switchClasses.thumb}`]: {
34
- color: alpha(theme.palette.common.white, 0.12),
35
- ...theme.applyStyles('light', {
36
- color: alpha(theme.palette.common.black, 0.12),
37
- }),
29
+ color: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.12)`,
38
30
  },
39
31
  [`&.${switchClasses.disabled} + .${switchClasses.track}`]: {
40
- opacity: 0.3,
41
- ...theme.applyStyles('light', {
42
- opacity: 0.7,
32
+ opacity: 0.7,
33
+ ...theme.applyStyles('dark', {
34
+ opacity: 0.3,
43
35
  }),
44
36
  },
45
37
  },
@@ -50,13 +42,10 @@ export const Switch = styled(MuiSwitch)(({ theme }) => ({
50
42
  },
51
43
  [`.${switchClasses.track}`]: {
52
44
  borderRadius: 24 / 2,
53
- backgroundColor: alpha(theme.palette.common.white, 0.16),
54
45
  opacity: 1,
55
46
  transition: theme.transitions.create(['background-color'], {
56
47
  duration: theme.transitions.duration.standard,
57
48
  }),
58
- ...theme.applyStyles('light', {
59
- backgroundColor: alpha(theme.palette.common.black, 0.16),
60
- }),
49
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.16)`,
61
50
  },
62
51
  }))
@@ -2,7 +2,6 @@ import type { TabProps } from '@mui/material'
2
2
  import {
3
3
  Tab as MuiTab,
4
4
  Tabs as MuiTabs,
5
- alpha,
6
5
  styled,
7
6
  tabClasses,
8
7
  tabsClasses,
@@ -22,15 +21,15 @@ export const Tabs = styled(MuiTabs)(({ theme }) => ({
22
21
  }))
23
22
 
24
23
  export const CardTabs = styled(Tabs)(({ theme }) => ({
25
- backgroundColor: alpha(theme.palette.common.white, 0.08),
24
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
26
25
  [`.${tabsClasses.indicator}`]: {
27
- backgroundColor: alpha(theme.palette.common.black, 0.56),
28
- ...theme.applyStyles('light', {
29
- backgroundColor: theme.palette.background.paper,
30
- }),
26
+ backgroundColor: theme.vars.palette.background.paper,
31
27
  },
32
- ...theme.applyStyles('light', {
33
- backgroundColor: alpha(theme.palette.common.black, 0.04),
28
+ ...theme.applyStyles('dark', {
29
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08)`,
30
+ [`.${tabsClasses.indicator}`]: {
31
+ backgroundColor: `rgba(${theme.vars.palette.common.backgroundChannel} / 0.56)`,
32
+ },
34
33
  }),
35
34
  }))
36
35
 
@@ -40,14 +39,8 @@ export const Tab = styled(MuiTab)<TabProps>(({ theme }) => ({
40
39
  textTransform: 'none',
41
40
  fontSize: '1rem',
42
41
  fontWeight: 700,
43
- color: theme.palette.common.white,
42
+ color: theme.vars.palette.common.onBackground,
44
43
  [`&.${tabClasses.selected}`]: {
45
- color: theme.palette.common.white,
46
- ...theme.applyStyles('light', {
47
- color: theme.palette.common.black,
48
- }),
44
+ color: theme.vars.palette.common.onBackground,
49
45
  },
50
- ...theme.applyStyles('light', {
51
- color: theme.palette.common.black,
52
- }),
53
46
  }))
@@ -75,7 +75,7 @@ export const TextFitter: React.FC<PropsWithChildren<TextFitterProps>> = ({
75
75
  // : height
76
76
  // }
77
77
  preserveAspectRatio={preserveAspectRatio}
78
- fill={theme.palette.text.primary}
78
+ fill={theme.vars.palette.text.primary}
79
79
  ref={ref}
80
80
  >
81
81
  <title>{children}</title>
@@ -1,4 +1,4 @@
1
- import { Box, Typography, alpha, styled } from '@mui/material'
1
+ import { Box, Typography, styled } from '@mui/material'
2
2
 
3
3
  export const TextSecondaryContainer = styled(Box)(() => ({
4
4
  display: 'flex',
@@ -13,13 +13,13 @@ export const TextSecondary = styled(Typography, {
13
13
  fontSize: 12,
14
14
  lineHeight: 1,
15
15
  fontWeight: 500,
16
- color: theme.palette.text.secondary,
16
+ color: theme.vars.palette.text.secondary,
17
17
  whiteSpace: 'nowrap',
18
18
  variants: [
19
19
  {
20
20
  props: ({ dot }) => dot,
21
21
  style: {
22
- color: alpha(theme.palette.text.secondary, 0.56),
22
+ color: `rgba(${theme.vars.palette.text.secondaryChannel} / 0.56)`,
23
23
  },
24
24
  },
25
25
  ],
@@ -29,8 +29,8 @@ export const TokenDivider = styled(Box)(({ theme }) => ({
29
29
  height: 16,
30
30
  borderLeftWidth: 2,
31
31
  borderLeftStyle: 'solid',
32
- borderColor: theme.palette.grey[800],
33
- ...theme.applyStyles('light', {
34
- borderColor: theme.palette.grey[300],
32
+ borderColor: theme.vars.palette.grey[300],
33
+ ...theme.applyStyles('dark', {
34
+ borderColor: theme.vars.palette.grey[800],
35
35
  }),
36
36
  }))