@lifi/widget 4.0.0-beta.12 → 4.0.0-beta.14

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 (110) hide show
  1. package/dist/esm/components/AmountInput/PriceFormHelperText.style.js +2 -2
  2. package/dist/esm/components/AmountInput/PriceFormHelperText.style.js.map +1 -1
  3. package/dist/esm/components/ButtonTertiary.js +6 -6
  4. package/dist/esm/components/ButtonTertiary.js.map +1 -1
  5. package/dist/esm/components/Card/Card.js +2 -2
  6. package/dist/esm/components/Card/Card.js.map +1 -1
  7. package/dist/esm/components/Card/CardIconButton.js +2 -2
  8. package/dist/esm/components/Card/CardIconButton.js.map +1 -1
  9. package/dist/esm/components/Card/CardLabel.js +2 -2
  10. package/dist/esm/components/Card/CardLabel.js.map +1 -1
  11. package/dist/esm/components/ContextMenu.style.js +1 -1
  12. package/dist/esm/components/ContextMenu.style.js.map +1 -1
  13. package/dist/esm/components/Header/ActivitiesButton.js +1 -0
  14. package/dist/esm/components/Header/ActivitiesButton.js.map +1 -1
  15. package/dist/esm/components/Header/ActivitiesButton.style.js +4 -4
  16. package/dist/esm/components/Header/ActivitiesButton.style.js.map +1 -1
  17. package/dist/esm/components/Header/Header.style.js +2 -2
  18. package/dist/esm/components/Header/Header.style.js.map +1 -1
  19. package/dist/esm/components/Header/SettingsButton.style.js +8 -8
  20. package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
  21. package/dist/esm/components/IconCircle/IconCircle.style.js +7 -7
  22. package/dist/esm/components/IconCircle/IconCircle.style.js.map +1 -1
  23. package/dist/esm/components/IconTypography.js +2 -2
  24. package/dist/esm/components/IconTypography.js.map +1 -1
  25. package/dist/esm/components/ListItemButton.js +1 -1
  26. package/dist/esm/components/ListItemButton.js.map +1 -1
  27. package/dist/esm/components/Messages/AlertMessage.style.js +4 -4
  28. package/dist/esm/components/Messages/AlertMessage.style.js.map +1 -1
  29. package/dist/esm/components/Messages/GasRefuelMessage.style.js +2 -2
  30. package/dist/esm/components/Messages/GasRefuelMessage.style.js.map +1 -1
  31. package/dist/esm/components/RouteCard/RouteTokens.js +1 -2
  32. package/dist/esm/components/RouteCard/RouteTokens.js.map +1 -1
  33. package/dist/esm/components/Step/CircularProgress.style.js +4 -4
  34. package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
  35. package/dist/esm/components/StepActions/StepActions.style.js +4 -4
  36. package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
  37. package/dist/esm/components/Switch.js +2 -2
  38. package/dist/esm/components/Switch.js.map +1 -1
  39. package/dist/esm/components/Tabs/NavigationTabs.js +2 -2
  40. package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -1
  41. package/dist/esm/components/Tabs/Tabs.style.js +3 -3
  42. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  43. package/dist/esm/components/Token/Token.style.js +1 -1
  44. package/dist/esm/components/Token/Token.style.js.map +1 -1
  45. package/dist/esm/components/TokenList/TokenList.style.js +1 -1
  46. package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
  47. package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js +1 -1
  48. package/dist/esm/components/TransactionCard/ActiveTransactionCard.style.js.map +1 -1
  49. package/dist/esm/config/version.d.ts +1 -1
  50. package/dist/esm/config/version.js +1 -1
  51. package/dist/esm/config/version.js.map +1 -1
  52. package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js +2 -2
  53. package/dist/esm/pages/SettingsPage/ResetSettingsButton.style.js.map +1 -1
  54. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +5 -5
  55. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js.map +1 -1
  56. package/dist/esm/pages/TransactionDetailsPage/ActionRow.style.js +2 -2
  57. package/dist/esm/pages/TransactionDetailsPage/ActionRow.style.js.map +1 -1
  58. package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.style.js +1 -1
  59. package/dist/esm/pages/TransactionDetailsPage/ReceiptsCard.style.js.map +1 -1
  60. package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js +7 -7
  61. package/dist/esm/pages/TransactionPage/StatusBottomSheet.style.js.map +1 -1
  62. package/dist/esm/stores/form/useFormRef.js +8 -0
  63. package/dist/esm/stores/form/useFormRef.js.map +1 -1
  64. package/dist/esm/stores/routes/createRouteExecutionStore.js +2 -2
  65. package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
  66. package/dist/esm/stores/routes/utils.js +1 -1
  67. package/dist/esm/stores/routes/utils.js.map +1 -1
  68. package/dist/esm/themes/createTheme.js +15 -19
  69. package/dist/esm/themes/createTheme.js.map +1 -1
  70. package/dist/esm/themes/types.d.ts +0 -11
  71. package/dist/esm/themes/types.d.ts.map +1 -1
  72. package/dist/esm/themes/watermelonLight.js +1 -1
  73. package/dist/esm/themes/watermelonLight.js.map +1 -1
  74. package/package.json +5 -5
  75. package/src/components/AmountInput/PriceFormHelperText.style.tsx +2 -2
  76. package/src/components/ButtonTertiary.tsx +6 -6
  77. package/src/components/Card/Card.tsx +2 -2
  78. package/src/components/Card/CardIconButton.tsx +2 -2
  79. package/src/components/Card/CardLabel.tsx +2 -2
  80. package/src/components/ContextMenu.style.tsx +1 -1
  81. package/src/components/Header/ActivitiesButton.style.tsx +4 -4
  82. package/src/components/Header/ActivitiesButton.tsx +1 -0
  83. package/src/components/Header/Header.style.ts +2 -2
  84. package/src/components/Header/SettingsButton.style.tsx +8 -8
  85. package/src/components/IconCircle/IconCircle.style.tsx +7 -7
  86. package/src/components/IconTypography.ts +2 -2
  87. package/src/components/ListItemButton.tsx +1 -1
  88. package/src/components/Messages/AlertMessage.style.tsx +4 -4
  89. package/src/components/Messages/GasRefuelMessage.style.ts +2 -2
  90. package/src/components/RouteCard/RouteTokens.tsx +1 -2
  91. package/src/components/Step/CircularProgress.style.tsx +4 -4
  92. package/src/components/StepActions/StepActions.style.tsx +4 -4
  93. package/src/components/Switch.tsx +2 -2
  94. package/src/components/Tabs/NavigationTabs.tsx +2 -2
  95. package/src/components/Tabs/Tabs.style.tsx +3 -3
  96. package/src/components/Token/Token.style.tsx +1 -1
  97. package/src/components/TokenList/TokenList.style.tsx +1 -1
  98. package/src/components/TransactionCard/ActiveTransactionCard.style.tsx +1 -1
  99. package/src/config/version.ts +1 -1
  100. package/src/pages/SettingsPage/ResetSettingsButton.style.tsx +2 -2
  101. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.style.tsx +5 -5
  102. package/src/pages/TransactionDetailsPage/ActionRow.style.tsx +2 -2
  103. package/src/pages/TransactionDetailsPage/ReceiptsCard.style.tsx +1 -1
  104. package/src/pages/TransactionPage/StatusBottomSheet.style.tsx +7 -7
  105. package/src/stores/form/useFormRef.ts +20 -1
  106. package/src/stores/routes/createRouteExecutionStore.ts +4 -2
  107. package/src/stores/routes/utils.ts +1 -1
  108. package/src/themes/createTheme.ts +14 -18
  109. package/src/themes/types.ts +0 -12
  110. package/src/themes/watermelonLight.ts +1 -1
@@ -16,9 +16,9 @@ export const AlertMessageCard: React.FC<
16
16
  whiteSpace: 'pre-line',
17
17
  width: '100%',
18
18
  paddingBottom: theme.spacing(2),
19
- backgroundColor: `rgba(${theme.vars.palette.info.mainChannel} / 0.12)`,
19
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.info.main} 12%, transparent)`,
20
20
  ...theme.applyStyles('dark', {
21
- backgroundColor: `rgba(${theme.vars.palette.info.mainChannel} / 0.16)`,
21
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.info.main} 16%, transparent)`,
22
22
  }),
23
23
  variants: [
24
24
  {
@@ -26,9 +26,9 @@ export const AlertMessageCard: React.FC<
26
26
  severity: 'warning',
27
27
  },
28
28
  style: {
29
- backgroundColor: `rgba(${theme.vars.palette.warning.mainChannel} / 0.32)`,
29
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.warning.main} 32%, transparent)`,
30
30
  ...theme.applyStyles('dark', {
31
- backgroundColor: `rgba(${theme.vars.palette.warning.mainChannel} / 0.16)`,
31
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.warning.main} 16%, transparent)`,
32
32
  }),
33
33
  },
34
34
  },
@@ -9,14 +9,14 @@ export const InfoMessageSwitch: React.FC<React.ComponentProps<typeof Switch>> =
9
9
  [`& + .${switchClasses.track}`]: {
10
10
  backgroundColor: theme.vars.palette.info.main,
11
11
  ...theme.applyStyles('dark', {
12
- backgroundColor: `rgba(${theme.vars.palette.info.mainChannel} / 0.84)`,
12
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.info.main} 84%, transparent)`,
13
13
  }),
14
14
  },
15
15
  },
16
16
  [`&.Mui-focusVisible .${switchClasses.thumb}`]: {
17
17
  color: theme.vars.palette.info.main,
18
18
  ...theme.applyStyles('dark', {
19
- color: `rgba(${theme.vars.palette.info.mainChannel} / 0.84)`,
19
+ color: `color-mix(in srgb, ${theme.vars.palette.info.main} 84%, transparent)`,
20
20
  }),
21
21
  },
22
22
  },
@@ -9,7 +9,7 @@ export const RouteTokens: React.FC<{
9
9
  route: RouteExtended
10
10
  showEssentials?: boolean
11
11
  }> = ({ route, showEssentials }) => {
12
- const { subvariant, defaultUI } = useWidgetConfig()
12
+ const { subvariant } = useWidgetConfig()
13
13
 
14
14
  const fromToken = {
15
15
  ...route.steps[0].action.fromToken,
@@ -46,7 +46,6 @@ export const RouteTokens: React.FC<{
46
46
  route={route}
47
47
  token={toToken}
48
48
  impactToken={fromToken}
49
- defaultExpanded={defaultUI?.transactionDetailsExpanded}
50
49
  showEssentials={showEssentials}
51
50
  />
52
51
  ) : null}
@@ -18,14 +18,14 @@ const getStatusColor = (
18
18
  case 'ACTION_REQUIRED':
19
19
  case 'MESSAGE_REQUIRED':
20
20
  case 'RESET_REQUIRED':
21
- return `rgba(${theme.vars.palette.info.mainChannel} / 0.12)`
21
+ return `color-mix(in srgb, ${theme.vars.palette.info.main} 12%, transparent)`
22
22
  case 'DONE':
23
23
  if (substatus === 'PARTIAL' || substatus === 'REFUNDED') {
24
- return `rgba(${theme.vars.palette.warning.mainChannel} / 0.48)`
24
+ return `color-mix(in srgb, ${theme.vars.palette.warning.main} 48%, transparent)`
25
25
  }
26
- return `rgba(${theme.vars.palette.success.mainChannel} / 0.12)`
26
+ return `color-mix(in srgb, ${theme.vars.palette.success.main} 12%, transparent)`
27
27
  case 'FAILED':
28
- return `rgba(${theme.vars.palette.error.mainChannel} / 0.12)`
28
+ return `color-mix(in srgb, ${theme.vars.palette.error.main} 12%, transparent)`
29
29
  default:
30
30
  return null
31
31
  }
@@ -20,9 +20,9 @@ export const StepConnector: React.FC<
20
20
  [`.${stepConnectorClasses.line}`]: {
21
21
  minHeight: 8,
22
22
  borderLeftWidth: 2,
23
- borderColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.12)`,
23
+ borderColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 12%, transparent)`,
24
24
  ...theme.applyStyles('dark', {
25
- borderColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.16)`,
25
+ borderColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 16%, transparent)`,
26
26
  }),
27
27
  },
28
28
  }))
@@ -66,9 +66,9 @@ export const StepContent: React.FC<
66
66
  })<{ last?: boolean }>(({ theme }) => ({
67
67
  margin: theme.spacing(0, 0, 0, 2.375),
68
68
  paddingLeft: theme.spacing(4.375),
69
- borderLeft: `2px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.12)`,
69
+ borderLeft: `2px solid color-mix(in srgb, ${theme.vars.palette.common.onBackground} 12%, transparent)`,
70
70
  ...theme.applyStyles('dark', {
71
- borderLeft: `2px solid rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.16)`,
71
+ borderLeft: `2px solid color-mix(in srgb, ${theme.vars.palette.common.onBackground} 16%, transparent)`,
72
72
  }),
73
73
  variants: [
74
74
  {
@@ -29,7 +29,7 @@ export const Switch: React.FC<React.ComponentProps<typeof MuiSwitch>> = styled(
29
29
  borderColor: theme.vars.palette.common.white,
30
30
  },
31
31
  [`&.${switchClasses.disabled} .${switchClasses.thumb}`]: {
32
- color: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.12)`,
32
+ color: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 12%, transparent)`,
33
33
  },
34
34
  [`&.${switchClasses.disabled} + .${switchClasses.track}`]: {
35
35
  opacity: 0.7,
@@ -49,6 +49,6 @@ export const Switch: React.FC<React.ComponentProps<typeof MuiSwitch>> = styled(
49
49
  transition: theme.transitions.create(['background-color'], {
50
50
  duration: theme.transitions.duration.standard,
51
51
  }),
52
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.16)`,
52
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 16%, transparent)`,
53
53
  },
54
54
  }))
@@ -26,9 +26,9 @@ export const NavigationTabs: React.FC<React.ComponentProps<typeof Tabs>> =
26
26
  height: '100%',
27
27
  width: '100%',
28
28
  borderRadius: theme.vars.shape.borderRadius,
29
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
29
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
30
30
  ...theme.applyStyles('dark', {
31
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08)`,
31
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
32
32
  }),
33
33
  },
34
34
  }))
@@ -24,14 +24,14 @@ const Tabs = styled(MuiTabs)(({ theme }) => ({
24
24
  export const CardTabs: React.FC<React.ComponentProps<typeof MuiTabs>> = styled(
25
25
  Tabs
26
26
  )(({ theme }) => ({
27
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
27
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
28
28
  [`.${tabsClasses.indicator}`]: {
29
29
  backgroundColor: theme.vars.palette.background.paper,
30
30
  },
31
31
  ...theme.applyStyles('dark', {
32
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08)`,
32
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
33
33
  [`.${tabsClasses.indicator}`]: {
34
- backgroundColor: `rgba(${theme.vars.palette.common.backgroundChannel} / 0.56)`,
34
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.background} 56%, transparent)`,
35
35
  },
36
36
  }),
37
37
  }))
@@ -25,7 +25,7 @@ export const TextSecondary: React.FC<
25
25
  {
26
26
  props: ({ dot }) => dot,
27
27
  style: {
28
- color: `rgba(${theme.vars.palette.text.secondaryChannel} / 0.56)`,
28
+ color: `color-mix(in srgb, ${theme.vars.palette.text.secondary} 56%, transparent)`,
29
29
  },
30
30
  },
31
31
  ],
@@ -36,7 +36,7 @@ export const IconButton: React.FC<
36
36
  minWidth: 'unset',
37
37
  borderRadius: theme.vars.shape.borderRadiusTertiary,
38
38
  '&:hover': {
39
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
39
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
40
40
  },
41
41
  svg: {
42
42
  fontSize: 14,
@@ -24,7 +24,7 @@ export const StatusRow: React.FC<React.ComponentProps<typeof Box>> = styled(
24
24
  gap: theme.spacing(1),
25
25
  padding: theme.spacing(1),
26
26
  borderRadius: theme.vars.shape.borderRadiusTertiary,
27
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
27
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
28
28
  }))
29
29
 
30
30
  export const DeleteButton: React.FC<React.ComponentProps<typeof IconButton>> =
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '4.0.0-beta.12'
2
+ export const version = '4.0.0-beta.14'
@@ -3,10 +3,10 @@ import type React from 'react'
3
3
 
4
4
  export const ResetButtonContainer: React.FC<React.ComponentProps<typeof Box>> =
5
5
  styled(Box)(({ theme }) => ({
6
- background: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
6
+ background: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
7
7
  borderRadius: '16px',
8
8
  padding: '16px',
9
9
  svg: {
10
- fill: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.4)`,
10
+ fill: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 40%, transparent)`,
11
11
  },
12
12
  }))
@@ -16,18 +16,18 @@ export const SettingsFieldSet: React.FC<
16
16
  padding: theme.spacing(0.5),
17
17
  gap: theme.spacing(0.5),
18
18
  height: '3.5rem',
19
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
19
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
20
20
  ...theme.applyStyles('dark', {
21
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08)`,
21
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
22
22
  }),
23
23
  }))
24
24
 
25
25
  const settingsControlSelected = (theme: Theme) => ({
26
26
  backgroundColor: theme.vars.palette.background.paper,
27
- boxShadow: `0px 2px 4px rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
27
+ boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
28
28
  ...theme.applyStyles('dark', {
29
- backgroundColor: `rgba(${theme.vars.palette.common.backgroundChannel} / 0.56)`,
30
- boxShadow: `0px 2px 4px rgba(${theme.vars.palette.common.backgroundChannel} / 0.04)`,
29
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.background} 56%, transparent)`,
30
+ boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.background} 4%, transparent)`,
31
31
  }),
32
32
  borderRadius: `calc(${theme.vars.shape.borderRadius} - 4px)`,
33
33
  })
@@ -8,7 +8,7 @@ export const ActionRowContainer: React.FC<React.ComponentProps<typeof Box>> =
8
8
  gap: theme.spacing(1),
9
9
  padding: theme.spacing(1),
10
10
  borderRadius: theme.vars.shape.borderRadiusTertiary,
11
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
11
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
12
12
  }))
13
13
 
14
14
  export const ActionIconCircle: React.FC<React.ComponentProps<typeof Box>> =
@@ -19,7 +19,7 @@ export const ActionIconCircle: React.FC<React.ComponentProps<typeof Box>> =
19
19
  width: 24,
20
20
  height: 24,
21
21
  borderRadius: '50%',
22
- backgroundColor: `color-mix(in srgb, rgb(${theme.vars.palette.success.mainChannel}) 12%, ${theme.vars.palette.background.paper})`,
22
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.success.main} 12%, ${theme.vars.palette.background.paper})`,
23
23
  }))
24
24
 
25
25
  export const ActionRowLabel: React.FC<React.ComponentProps<typeof Typography>> =
@@ -20,6 +20,6 @@ export const ExternalLink: React.FC<React.ComponentProps<typeof Link>> = styled(
20
20
  textDecoration: 'none',
21
21
  color: theme.vars.palette.text.primary,
22
22
  '&:hover': {
23
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
23
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
24
24
  },
25
25
  }))
@@ -9,14 +9,14 @@ const getStatusColor = (status: StatusColor, theme: Theme) => {
9
9
  switch (status) {
10
10
  case RouteExecutionStatus.Done:
11
11
  return {
12
- color: theme.vars.palette.success.mainChannel,
12
+ color: theme.vars.palette.success.main,
13
13
  alpha: 0.12,
14
14
  lightDarken: 0,
15
15
  darkDarken: 0,
16
16
  }
17
17
  case RouteExecutionStatus.Failed:
18
18
  return {
19
- color: theme.vars.palette.error.mainChannel,
19
+ color: theme.vars.palette.error.main,
20
20
  alpha: 0.12,
21
21
  lightDarken: 0,
22
22
  darkDarken: 0,
@@ -25,14 +25,14 @@ const getStatusColor = (status: StatusColor, theme: Theme) => {
25
25
  case RouteExecutionStatus.Done | RouteExecutionStatus.Refunded:
26
26
  case 'warning':
27
27
  return {
28
- color: theme.vars.palette.warning.mainChannel,
28
+ color: theme.vars.palette.warning.main,
29
29
  alpha: 0.48,
30
30
  lightDarken: 0.32,
31
31
  darkDarken: 0,
32
32
  }
33
33
  default:
34
34
  return {
35
- color: theme.vars.palette.primary.mainChannel,
35
+ color: theme.vars.palette.primary.main,
36
36
  alpha: 0.12,
37
37
  lightDarken: 0,
38
38
  darkDarken: 0,
@@ -57,7 +57,7 @@ export const IconCircle: React.FC<
57
57
  const statusConfig = getStatusColor(status, theme)
58
58
 
59
59
  return {
60
- backgroundColor: `rgba(${statusConfig.color} / ${statusConfig.alpha})`,
60
+ backgroundColor: `color-mix(in srgb, ${statusConfig.color} ${statusConfig.alpha * 100}%, transparent)`,
61
61
  borderRadius: '50%',
62
62
  width: 72,
63
63
  height: 72,
@@ -65,13 +65,13 @@ export const IconCircle: React.FC<
65
65
  position: 'relative',
66
66
  placeItems: 'center',
67
67
  '& > svg': {
68
- color: `color-mix(in srgb, rgb(${statusConfig.color}) ${(1 - statusConfig.lightDarken) * 100}%, black)`,
68
+ color: `color-mix(in srgb, ${statusConfig.color} ${(1 - statusConfig.lightDarken) * 100}%, black)`,
69
69
  width: 36,
70
70
  height: 36,
71
71
  },
72
72
  ...theme.applyStyles('dark', {
73
73
  '& > svg': {
74
- color: `color-mix(in srgb, rgb(${statusConfig.color}) ${(1 - statusConfig.darkDarken) * 100}%, black)`,
74
+ color: `color-mix(in srgb, ${statusConfig.color} ${(1 - statusConfig.darkDarken) * 100}%, black)`,
75
75
  width: 36,
76
76
  height: 36,
77
77
  },
@@ -1,8 +1,15 @@
1
1
  import { useImperativeHandle } from 'react'
2
+ import { widgetEvents } from '../../hooks/useWidgetEvents.js'
2
3
  import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js'
3
4
  import { formDefaultValues } from '../../stores/form/createFormStore.js'
5
+ import type { FormFieldChanged } from '../../types/events.js'
6
+ import { WidgetEvent } from '../../types/events.js'
4
7
  import type { FormRef } from '../../types/widget.js'
5
- import type { FormStoreStore, GenericFormValue } from './types.js'
8
+ import type {
9
+ FormFieldNames,
10
+ FormStoreStore,
11
+ GenericFormValue,
12
+ } from './types.js'
6
13
 
7
14
  export const useFormRef = (
8
15
  formStore: FormStoreStore,
@@ -48,9 +55,21 @@ export const useFormRef = (
48
55
  ? { isTouched: options?.setUrlSearchParam }
49
56
  : undefined
50
57
 
58
+ const oldValue = formStore
59
+ .getState()
60
+ .getFieldValues(fieldName as FormFieldNames)[0]
61
+
51
62
  formStore
52
63
  .getState()
53
64
  .setFieldValue(fieldName, sanitizedValue, fieldValueOptions)
65
+
66
+ if (sanitizedValue !== oldValue) {
67
+ widgetEvents.emit(WidgetEvent.FormFieldChanged, {
68
+ fieldName,
69
+ newValue: sanitizedValue,
70
+ oldValue,
71
+ } as FormFieldChanged)
72
+ }
54
73
  },
55
74
  }
56
75
  }, [formStore, setSelectedBookmark])
@@ -129,8 +129,10 @@ export const createRouteExecutionStore = ({
129
129
  }),
130
130
  {
131
131
  name: `${namePrefix || 'li.fi'}-widget-routes`,
132
- version: 3,
133
- migrate: (persistedState: any) => persistedState,
132
+ // Bump version on breaking changes to the stored structure.
133
+ version: 4,
134
+ // Clear stored routes on any version mismatch to avoid errors from incompatible data shapes.
135
+ migrate: () => ({ routes: {} }),
134
136
  partialize: (state) => ({ routes: state.routes }),
135
137
  merge: (persistedState: any, currentState: RouteExecutionState) => {
136
138
  const state = {
@@ -55,7 +55,7 @@ export const getUpdatedAction = (
55
55
 
56
56
  export const getSourceTxHash = (route?: RouteExtended): string | undefined => {
57
57
  const sourceAction = route?.steps[0].execution?.actions
58
- .filter(
58
+ ?.filter(
59
59
  (action) => !['RESET_ALLOWANCE', 'SET_ALLOWANCE'].includes(action.type)
60
60
  )
61
61
  .find((action) => action.txHash || action.taskId)
@@ -130,7 +130,7 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
130
130
  ...widgetTheme.navigation,
131
131
  },
132
132
  typography: {
133
- fontFamily: 'Inter var, Inter, sans-serif',
133
+ fontFamily: 'Inter, sans-serif',
134
134
  ...widgetTheme.typography,
135
135
  },
136
136
  shape: {
@@ -152,10 +152,6 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
152
152
  root: {
153
153
  fontFamily: 'Inter, sans-serif',
154
154
  ...widgetTheme.typography,
155
- '@supports (font-variation-settings: normal)': {
156
- fontFamily: 'Inter var, sans-serif',
157
- ...widgetTheme.typography,
158
- },
159
155
  },
160
156
  },
161
157
  },
@@ -212,9 +208,9 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
212
208
  ownerState.variant === 'elevation' && {
213
209
  '&:hover': {
214
210
  cursor: 'pointer',
215
- filter: `drop-shadow(0 1px 4px rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08))`,
211
+ filter: `drop-shadow(0 1px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent))`,
216
212
  ...theme.applyStyles('dark', {
217
- filter: `drop-shadow(0 1px 4px rgba(${theme.vars.palette.common.backgroundChannel} / 0.08))`,
213
+ filter: `drop-shadow(0 1px 4px color-mix(in srgb, ${theme.vars.palette.common.background} 8%, transparent))`,
218
214
  }),
219
215
  },
220
216
  }),
@@ -251,9 +247,9 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
251
247
  style: ({ theme }) => ({
252
248
  border: 'none',
253
249
  boxShadow: 'none',
254
- filter: `drop-shadow(0 1px 4px rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04))`,
250
+ filter: `drop-shadow(0 1px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent))`,
255
251
  ...theme.applyStyles('dark', {
256
- filter: `drop-shadow(0 1px 4px rgba(${theme.vars.palette.common.backgroundChannel} / 0.04))`,
252
+ filter: `drop-shadow(0 1px 4px color-mix(in srgb, ${theme.vars.palette.common.background} 4%, transparent))`,
257
253
  }),
258
254
  }),
259
255
  },
@@ -293,7 +289,7 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
293
289
  fontSize: 16,
294
290
  fontWeight: 600,
295
291
  '&.Mui-disabled, &.Mui-disabled:hover': {
296
- color: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.56)`,
292
+ color: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 56%, transparent)`,
297
293
  cursor: 'not-allowed',
298
294
  pointerEvents: 'auto',
299
295
  },
@@ -312,18 +308,18 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
312
308
  ...getStyleOverrides('MuiButton', 'root', widgetTheme, ownerState),
313
309
  }),
314
310
  text: ({ theme, ownerState }) => ({
315
- backgroundColor: `rgba(${theme.vars.palette.primary.mainChannel} / 0.08)`,
311
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.primary.main} 8%, transparent)`,
316
312
  color: theme.vars.palette.primary.main,
317
313
  '&:hover': {
318
- backgroundColor: `rgba(${theme.vars.palette.primary.mainChannel} / 0.12)`,
314
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.primary.main} 12%, transparent)`,
319
315
  },
320
316
  ...theme.applyStyles('dark', {
321
- backgroundColor: `rgba(${theme.vars.palette.primary.mainChannel} / 0.42)`,
317
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.primary.main} 42%, transparent)`,
322
318
  color: theme.palette.getContrastText(
323
319
  alpha(theme.palette.primary.main, 0.08)
324
320
  ),
325
321
  '&:hover': {
326
- backgroundColor: `rgba(${theme.vars.palette.primary.mainChannel} / 0.56)`,
322
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.primary.main} 56%, transparent)`,
327
323
  },
328
324
  }),
329
325
  ...getStyleOverrides('MuiButton', 'text', widgetTheme, ownerState),
@@ -448,22 +444,22 @@ export const createTheme = (widgetTheme: WidgetTheme = {}): Theme => {
448
444
  ownerState
449
445
  )
450
446
  return {
451
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
447
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
452
448
  ...theme.applyStyles('dark', {
453
- backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08)`,
449
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent)`,
454
450
  }),
455
451
  borderRadius: theme.vars.shape.borderRadius,
456
452
  ...rootStyleOverrides,
457
453
  [`.${tabsClasses.indicator}`]: {
458
454
  backgroundColor: theme.vars.palette.background.paper,
459
455
  ...theme.applyStyles('dark', {
460
- backgroundColor: `rgba(${theme.vars.palette.common.backgroundChannel} / 0.56)`,
456
+ backgroundColor: `color-mix(in srgb, ${theme.vars.palette.common.background} 56%, transparent)`,
461
457
  }),
462
458
  borderRadius:
463
459
  theme.shape.borderRadius > 0
464
460
  ? `calc(${theme.vars.shape.borderRadius} - 4px)`
465
461
  : theme.vars.shape.borderRadius,
466
- boxShadow: `0px 2px 4px rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
462
+ boxShadow: `0px 2px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 4%, transparent)`,
467
463
  ...rootStyleOverrides?.[`.${tabsClasses.indicator}`],
468
464
  },
469
465
  }
@@ -12,12 +12,6 @@ import type { NavigationProps } from '../types/widget.js'
12
12
 
13
13
  // https://mui.com/customization/palette/
14
14
  declare module '@mui/material/styles' {
15
- interface TypographyVariants {
16
- '@supports (font-variation-settings: normal)': React.CSSProperties
17
- }
18
- interface TypographyVariantsOptions {
19
- '@supports (font-variation-settings: normal)'?: React.CSSProperties
20
- }
21
15
  interface Shape {
22
16
  borderRadius: number
23
17
  borderRadiusSecondary: number
@@ -86,9 +80,3 @@ declare module '@mui/material/Paper' {
86
80
  filled: true
87
81
  }
88
82
  }
89
-
90
- declare module '@mui/material/Typography' {
91
- interface TypographyPropsVariantOverrides {
92
- '@supports (font-variation-settings: normal)': true
93
- }
94
- }
@@ -52,7 +52,7 @@ export const watermelonLightTheme: WidgetTheme = {
52
52
  root: ({ theme }) => ({
53
53
  [`.${tabsClasses.indicator}`]: {
54
54
  backgroundColor: '#ffffff',
55
- filter: `drop-shadow(0 1px 4px rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08))`,
55
+ filter: `drop-shadow(0 1px 4px color-mix(in srgb, ${theme.vars.palette.common.onBackground} 8%, transparent))`,
56
56
  borderRadius: '16px',
57
57
  },
58
58
  }),