@lifi/widget 3.26.1 → 3.26.2-beta.0

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 (68) hide show
  1. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js +2 -1
  2. package/dist/esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
  3. package/dist/esm/components/BottomSheet/BottomSheet.js +13 -5
  4. package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
  5. package/dist/esm/components/Header/CloseDrawerButton.js +2 -5
  6. package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
  7. package/dist/esm/components/Header/Header.style.d.ts +1 -2
  8. package/dist/esm/components/Header/Header.style.js +3 -4
  9. package/dist/esm/components/Header/Header.style.js.map +1 -1
  10. package/dist/esm/components/Header/NavigationHeader.js +17 -21
  11. package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
  12. package/dist/esm/components/Header/SplitNavigationTabs.d.ts +1 -0
  13. package/dist/esm/components/Header/{NavigationTabs.js → SplitNavigationTabs.js} +4 -5
  14. package/dist/esm/components/Header/SplitNavigationTabs.js.map +1 -0
  15. package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
  16. package/dist/esm/components/Header/WalletHeader.js +10 -14
  17. package/dist/esm/components/Header/WalletHeader.js.map +1 -1
  18. package/dist/esm/components/Step/StepProcess.js +8 -3
  19. package/dist/esm/components/Step/StepProcess.js.map +1 -1
  20. package/dist/esm/components/Tabs/NavigationTabs.d.ts +4 -0
  21. package/dist/esm/components/Tabs/NavigationTabs.js +39 -0
  22. package/dist/esm/components/Tabs/NavigationTabs.js.map +1 -0
  23. package/dist/esm/components/TokenList/TokenListItem.js +1 -0
  24. package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
  25. package/dist/esm/components/TokenList/useTokenSelect.js +9 -2
  26. package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
  27. package/dist/esm/config/version.d.ts +1 -1
  28. package/dist/esm/config/version.js +1 -1
  29. package/dist/esm/config/version.js.map +1 -1
  30. package/dist/esm/pages/MainPage/MainPage.js +8 -1
  31. package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
  32. package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +1 -1
  33. package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
  34. package/dist/esm/themes/azureLight.js +2 -3
  35. package/dist/esm/themes/azureLight.js.map +1 -1
  36. package/dist/esm/themes/createTheme.js +6 -0
  37. package/dist/esm/themes/createTheme.js.map +1 -1
  38. package/dist/esm/themes/types.d.ts +15 -1
  39. package/dist/esm/themes/watermelonLight.js +12 -0
  40. package/dist/esm/themes/watermelonLight.js.map +1 -1
  41. package/dist/esm/themes/windows95.js +11 -0
  42. package/dist/esm/themes/windows95.js.map +1 -1
  43. package/dist/esm/types/widget.d.ts +1 -1
  44. package/dist/esm/types/widget.js.map +1 -1
  45. package/package.json +4 -4
  46. package/package.json.tmp +3 -3
  47. package/src/components/BaseTransactionButton/BaseTransactionButton.tsx +2 -1
  48. package/src/components/BottomSheet/BottomSheet.tsx +14 -3
  49. package/src/components/Header/CloseDrawerButton.tsx +2 -5
  50. package/src/components/Header/Header.style.ts +3 -5
  51. package/src/components/Header/NavigationHeader.tsx +66 -73
  52. package/src/components/Header/{NavigationTabs.tsx → SplitNavigationTabs.tsx} +10 -14
  53. package/src/components/Header/WalletHeader.tsx +13 -19
  54. package/src/components/Step/StepProcess.tsx +8 -3
  55. package/src/components/Tabs/NavigationTabs.tsx +40 -0
  56. package/src/components/TokenList/TokenListItem.tsx +1 -0
  57. package/src/components/TokenList/useTokenSelect.ts +14 -2
  58. package/src/config/version.ts +1 -1
  59. package/src/pages/MainPage/MainPage.tsx +9 -1
  60. package/src/pages/SettingsPage/RoutePrioritySettings.tsx +0 -1
  61. package/src/themes/azureLight.ts +2 -3
  62. package/src/themes/createTheme.ts +6 -0
  63. package/src/themes/types.ts +20 -0
  64. package/src/themes/watermelonLight.ts +12 -0
  65. package/src/themes/windows95.ts +12 -0
  66. package/src/types/widget.ts +2 -0
  67. package/dist/esm/components/Header/NavigationTabs.d.ts +0 -1
  68. package/dist/esm/components/Header/NavigationTabs.js.map +0 -1
@@ -13,13 +13,13 @@ import {
13
13
  import { BackButton } from './BackButton.js'
14
14
  import { CloseDrawerButton } from './CloseDrawerButton.js'
15
15
  import { HeaderAppBar, HeaderControlsContainer } from './Header.style.js'
16
- import { NavigationTabs } from './NavigationTabs.js'
17
16
  import { SettingsButton } from './SettingsButton.js'
17
+ import { SplitNavigationTabs } from './SplitNavigationTabs.js'
18
18
  import { TransactionHistoryButton } from './TransactionHistoryButton.js'
19
- import { SplitWalletMenuButton } from './WalletHeader.js'
20
19
 
21
20
  export const NavigationHeader: React.FC = () => {
22
- const { subvariant, hiddenUI, variant, defaultUI } = useWidgetConfig()
21
+ const { subvariant, hiddenUI, variant, defaultUI, subvariantOptions } =
22
+ useWidgetConfig()
23
23
  const { navigateBack } = useNavigateBack()
24
24
  const { account } = useAccount()
25
25
  const { element, title } = useHeaderStore((state) => state)
@@ -31,77 +31,70 @@ export const NavigationHeader: React.FC = () => {
31
31
  const path = cleanedPathname.substring(cleanedPathname.lastIndexOf('/') + 1)
32
32
  const hasPath = navigationRoutesValues.includes(path)
33
33
 
34
- const splitSubvariant = subvariant === 'split' && !hasPath
34
+ const showSplitOptions =
35
+ subvariant === 'split' && !hasPath && !subvariantOptions?.split
35
36
 
36
37
  return (
37
- <>
38
- <HeaderAppBar elevation={0}>
39
- {backButtonRoutes.includes(path) ? (
40
- <BackButton
41
- onClick={() =>
42
- navigateBack(
43
- // From transaction details page, navigate to home page
44
- path === navigationRoutes.transactionDetails
45
- ? navigationRoutes.home
46
- : undefined
47
- )
48
- }
49
- />
50
- ) : null}
51
- {splitSubvariant ? (
52
- <Box
53
- sx={{
54
- flex: 1,
55
- }}
56
- >
57
- <SplitWalletMenuButton />
58
- </Box>
59
- ) : (
60
- <Typography
61
- align={hasPath ? 'center' : 'left'}
62
- noWrap={defaultUI?.navigationHeaderTitleNoWrap ?? true}
63
- sx={{
64
- fontSize: hasPath ? 18 : 24,
65
- fontWeight: '700',
66
- flex: 1,
67
- }}
68
- >
69
- {title}
70
- </Typography>
71
- )}
72
- <Routes>
73
- <Route
74
- path={navigationRoutes.home}
75
- element={
76
- <HeaderControlsContainer>
77
- {account.isConnected &&
78
- !hiddenUI?.includes(HiddenUI.History) ? (
79
- <TransactionHistoryButton />
80
- ) : null}
81
- <SettingsButton />
82
- {variant === 'drawer' &&
83
- !hiddenUI?.includes(HiddenUI.DrawerCloseButton) ? (
84
- <CloseDrawerButton header="navigation" />
85
- ) : null}
86
- </HeaderControlsContainer>
87
- }
88
- />
89
- <Route
90
- path="*"
91
- element={
92
- element || (
93
- <Box
94
- sx={{
95
- width: 28,
96
- height: 40,
97
- }}
98
- />
99
- )
100
- }
101
- />
102
- </Routes>
103
- </HeaderAppBar>
104
- {splitSubvariant ? <NavigationTabs /> : null}
105
- </>
38
+ <HeaderAppBar elevation={0} sx={{ paddingTop: 1, paddingBottom: 0.5 }}>
39
+ {backButtonRoutes.includes(path) ? (
40
+ <BackButton
41
+ onClick={() =>
42
+ navigateBack(
43
+ // From transaction details page, navigate to home page
44
+ path === navigationRoutes.transactionDetails
45
+ ? navigationRoutes.home
46
+ : undefined
47
+ )
48
+ }
49
+ />
50
+ ) : null}
51
+ {showSplitOptions ? (
52
+ <Box sx={{ flex: 1, marginRight: 1 }}>
53
+ <SplitNavigationTabs />
54
+ </Box>
55
+ ) : (
56
+ <Typography
57
+ align={hasPath ? 'center' : 'left'}
58
+ noWrap={defaultUI?.navigationHeaderTitleNoWrap ?? true}
59
+ sx={{
60
+ fontSize: hasPath ? 18 : 24,
61
+ fontWeight: '700',
62
+ flex: 1,
63
+ }}
64
+ >
65
+ {title}
66
+ </Typography>
67
+ )}
68
+ <Routes>
69
+ <Route
70
+ path={navigationRoutes.home}
71
+ element={
72
+ <HeaderControlsContainer>
73
+ {account.isConnected && !hiddenUI?.includes(HiddenUI.History) && (
74
+ <TransactionHistoryButton />
75
+ )}
76
+ <SettingsButton />
77
+ {variant === 'drawer' &&
78
+ !hiddenUI?.includes(HiddenUI.DrawerCloseButton) ? (
79
+ <CloseDrawerButton header="navigation" />
80
+ ) : null}
81
+ </HeaderControlsContainer>
82
+ }
83
+ />
84
+ <Route
85
+ path="*"
86
+ element={
87
+ element || (
88
+ <Box
89
+ sx={{
90
+ width: 28,
91
+ height: 40,
92
+ }}
93
+ />
94
+ )
95
+ }
96
+ />
97
+ </Routes>
98
+ </HeaderAppBar>
106
99
  )
107
100
  }
@@ -1,10 +1,9 @@
1
1
  import { useTranslation } from 'react-i18next'
2
2
  import { useFieldActions } from '../../stores/form/useFieldActions.js'
3
3
  import { useSplitSubvariantStore } from '../../stores/settings/useSplitSubvariantStore.js'
4
- import { Tab, Tabs } from '../Tabs/Tabs.style.js'
5
- import { HeaderAppBar } from './Header.style.js'
4
+ import { NavigationTab, NavigationTabs } from '../Tabs/NavigationTabs.js'
6
5
 
7
- export const NavigationTabs = () => {
6
+ export const SplitNavigationTabs = () => {
8
7
  const { t } = useTranslation()
9
8
  const [state, setState] = useSplitSubvariantStore((state) => [
10
9
  state.state,
@@ -20,16 +19,13 @@ export const NavigationTabs = () => {
20
19
  }
21
20
 
22
21
  return (
23
- <HeaderAppBar elevation={0} sx={{ paddingTop: 1, paddingBottom: 0.5 }}>
24
- <Tabs
25
- value={state === 'swap' ? 0 : 1}
26
- onChange={handleChange}
27
- aria-label="tabs"
28
- indicatorColor="primary"
29
- >
30
- <Tab label={t('header.swap')} disableRipple />
31
- <Tab label={t('header.bridge')} disableRipple />
32
- </Tabs>
33
- </HeaderAppBar>
22
+ <NavigationTabs
23
+ value={state === 'swap' ? 0 : 1}
24
+ onChange={handleChange}
25
+ aria-label="tabs"
26
+ >
27
+ <NavigationTab label={t('header.swap')} disableRipple />
28
+ <NavigationTab label={t('header.bridge')} disableRipple />
29
+ </NavigationTabs>
34
30
  )
35
31
  }
@@ -27,10 +27,9 @@ import { WalletMenu } from './WalletMenu.js'
27
27
  import { WalletMenuContainer } from './WalletMenu.style.js'
28
28
 
29
29
  const useInternalWalletManagement = () => {
30
- const { subvariant, hiddenUI } = useWidgetConfig()
30
+ const { hiddenUI } = useWidgetConfig()
31
31
  const { useExternalWalletProvidersOnly } = useExternalWalletProvider()
32
32
 
33
- const isSplitVariant = subvariant === 'split'
34
33
  const isWalletMenuHidden = hiddenUI?.includes(HiddenUI.WalletMenu)
35
34
 
36
35
  const shouldShowWalletMenu =
@@ -38,25 +37,19 @@ const useInternalWalletManagement = () => {
38
37
 
39
38
  return {
40
39
  shouldShowWalletMenu,
41
- isSplitVariant,
42
40
  }
43
41
  }
44
42
 
45
43
  export const WalletHeader: React.FC = () => {
46
- const { shouldShowWalletMenu, isSplitVariant } = useInternalWalletManagement()
44
+ const { shouldShowWalletMenu } = useInternalWalletManagement()
47
45
 
48
- return shouldShowWalletMenu && !isSplitVariant ? (
46
+ return shouldShowWalletMenu ? (
49
47
  <HeaderAppBar elevation={0} sx={{ justifyContent: 'flex-end' }}>
50
48
  <WalletMenuButton />
51
49
  </HeaderAppBar>
52
50
  ) : null
53
51
  }
54
52
 
55
- export const SplitWalletMenuButton: React.FC = () => {
56
- const { shouldShowWalletMenu, isSplitVariant } = useInternalWalletManagement()
57
- return shouldShowWalletMenu && isSplitVariant ? <WalletMenuButton /> : null
58
- }
59
-
60
53
  export const WalletMenuButton: React.FC = () => {
61
54
  const { variant, hiddenUI } = useWidgetConfig()
62
55
  const { account, accounts } = useAccount()
@@ -92,24 +85,25 @@ export const WalletMenuButton: React.FC = () => {
92
85
 
93
86
  const ConnectButton = () => {
94
87
  const { t } = useTranslation()
95
- const { walletConfig, subvariant, variant } = useWidgetConfig()
88
+ const { walletConfig, variant } = useWidgetConfig()
96
89
  const { openWalletMenu } = useWalletMenu()
97
- const connect = async () => {
90
+ const connect = async (event: React.MouseEvent<HTMLElement>) => {
98
91
  if (!walletConfig?.usePartialWalletManagement && walletConfig?.onConnect) {
99
92
  walletConfig.onConnect()
100
93
  return
101
94
  }
102
95
  openWalletMenu()
96
+ event.currentTarget.blur() // Remove focus to prevent accessibility issues when opening drawer
103
97
  }
104
98
 
99
+ const walletPosition = variant === 'drawer' ? 'start' : 'end'
100
+
105
101
  return (
106
102
  <WalletButton
107
- subvariant={subvariant}
108
- endIcon={
109
- variant !== 'drawer' && subvariant !== 'split' ? <Wallet /> : undefined
110
- }
103
+ withOffset={walletPosition === 'end'}
104
+ endIcon={walletPosition === 'end' ? <Wallet /> : undefined}
111
105
  startIcon={
112
- variant === 'drawer' || subvariant === 'split' ? (
106
+ walletPosition === 'start' ? (
113
107
  <Wallet sx={{ marginLeft: -0.25 }} />
114
108
  ) : undefined
115
109
  }
@@ -121,13 +115,13 @@ const ConnectButton = () => {
121
115
  }
122
116
 
123
117
  const ConnectedButton = ({ account }: { account: Account }) => {
124
- const { subvariant } = useWidgetConfig()
125
118
  const { chain } = useChain(account.chainId)
126
119
  const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null)
127
120
  const walletAddress = shortenAddress(account.address)
128
121
 
129
122
  const handleClick = (event: React.MouseEvent<HTMLElement>) => {
130
123
  setAnchorEl(event.currentTarget)
124
+ event.currentTarget.blur() // Remove focus to prevent accessibility issues when opening drawer
131
125
  }
132
126
 
133
127
  const handleClose = () => {
@@ -137,7 +131,7 @@ const ConnectedButton = ({ account }: { account: Account }) => {
137
131
  return (
138
132
  <>
139
133
  <WalletButton
140
- subvariant={subvariant}
134
+ withOffset
141
135
  endIcon={<ExpandMore />}
142
136
  startIcon={
143
137
  chain?.logoURI ? (
@@ -13,12 +13,17 @@ export const StepProcess: React.FC<{
13
13
  const { title, message } = useProcessMessage(step, process)
14
14
  const { getTransactionLink } = useExplorer()
15
15
 
16
- const transactionLink = process.txLink
16
+ const transactionLink = process.txHash
17
17
  ? getTransactionLink({
18
- txLink: process.txLink,
18
+ txHash: process.txHash,
19
19
  chain: process.chainId,
20
20
  })
21
- : undefined
21
+ : process.txLink
22
+ ? getTransactionLink({
23
+ txLink: process.txLink,
24
+ chain: process.chainId,
25
+ })
26
+ : undefined
22
27
 
23
28
  return (
24
29
  <Box
@@ -0,0 +1,40 @@
1
+ import { styled, Tabs, tabsClasses } from '@mui/material'
2
+ import { Tab } from './Tabs.style.js'
3
+
4
+ export const NavigationTabs = styled(Tabs, {
5
+ name: 'MuiNavigationTabs',
6
+ slot: 'root',
7
+ })(({ theme }) => ({
8
+ overflow: 'visible', // Prevent shadows from being cut off
9
+ width: 'fit-content',
10
+ minHeight: theme.spacing(5),
11
+ maxHeight: theme.spacing(5),
12
+ background: 'transparent',
13
+ ...theme.applyStyles('dark', {
14
+ backgroundColor: 'transparent',
15
+ }),
16
+ [`& .${tabsClasses.scroller}`]: {
17
+ padding: 0,
18
+ overflow: 'visible !important', // Enforce since overflow is set dynamically
19
+ },
20
+ [`& .${tabsClasses.indicator}`]: {
21
+ boxShadow: 'none',
22
+ top: 0,
23
+ left: 0,
24
+ height: '100%',
25
+ width: '100%',
26
+ borderRadius: theme.vars.shape.borderRadius,
27
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.04)`,
28
+ ...theme.applyStyles('dark', {
29
+ backgroundColor: `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08)`,
30
+ }),
31
+ },
32
+ }))
33
+
34
+ export const NavigationTab = styled(Tab, {
35
+ name: 'MuiNavigationTab',
36
+ slot: 'root',
37
+ })(({ theme }) => ({
38
+ minHeight: theme.spacing(5),
39
+ maxHeight: theme.spacing(5),
40
+ }))
@@ -102,6 +102,7 @@ const OpenTokenDetailsButton = ({
102
102
  size="small"
103
103
  onClick={(e) => {
104
104
  e.stopPropagation()
105
+ e.currentTarget.blur() // Remove focus to prevent accessibility issues when opening drawer
105
106
  onClick(tokenAddress, withoutContractAddress)
106
107
  }}
107
108
  >
@@ -6,6 +6,7 @@ import { useChainOrderStoreContext } from '../../stores/chains/ChainOrderStore.j
6
6
  import type { FormType } from '../../stores/form/types.js'
7
7
  import { FormKeyHelper } from '../../stores/form/types.js'
8
8
  import { useFieldActions } from '../../stores/form/useFieldActions.js'
9
+ import { useSplitSubvariantStore } from '../../stores/settings/useSplitSubvariantStore.js'
9
10
  import { WidgetEvent } from '../../types/events.js'
10
11
  import type { DisabledUI } from '../../types/widget.js'
11
12
 
@@ -16,6 +17,7 @@ export type UseTokenSelectArgs = {
16
17
 
17
18
  export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
18
19
  const { subvariant, disabledUI } = useWidgetConfig()
20
+ const splitSubvariant = useSplitSubvariantStore((store) => store.state)
19
21
  const emitter = useWidgetEvents()
20
22
  const { setFieldValue, getFieldValues } = useFieldActions()
21
23
  const autoPopulateToAddress = useToAddressAutoPopulate()
@@ -47,10 +49,19 @@ export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
47
49
  FormKeyHelper.getChainKey(oppositeFormType),
48
50
  'toAddress'
49
51
  )
52
+
50
53
  // TODO: remove when we enable same chain/token transfers
51
- if (
54
+ const isSameTokenTransfer =
52
55
  selectedOppositeTokenAddress === tokenAddress &&
53
- selectedOppositeChainId === selectedChainId &&
56
+ selectedOppositeChainId === selectedChainId
57
+
58
+ const isBridgeToSameChain =
59
+ subvariant === 'split' &&
60
+ splitSubvariant === 'bridge' &&
61
+ selectedOppositeChainId === selectedChainId
62
+
63
+ if (
64
+ (isSameTokenTransfer || isBridgeToSameChain) &&
54
65
  subvariant !== 'custom'
55
66
  ) {
56
67
  setFieldValue(FormKeyHelper.getTokenKey(oppositeFormType), '', {
@@ -106,6 +117,7 @@ export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
106
117
  onClick,
107
118
  setFieldValue,
108
119
  subvariant,
120
+ splitSubvariant,
109
121
  tokenKey,
110
122
  ]
111
123
  )
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '3.26.1'
2
+ export const version = '3.26.2-beta.0'
@@ -25,12 +25,20 @@ export const MainPage: React.FC = () => {
25
25
  const custom = subvariant === 'custom'
26
26
  const showPoweredBy = !hiddenUI?.includes(HiddenUI.PoweredBy)
27
27
 
28
+ const splitTitle =
29
+ subvariantOptions?.split === 'bridge'
30
+ ? t('header.bridge')
31
+ : subvariantOptions?.split === 'swap'
32
+ ? t('header.swap')
33
+ : undefined
28
34
  const title =
29
35
  subvariant === 'custom'
30
36
  ? t(`header.${subvariantOptions?.custom ?? 'checkout'}`)
31
37
  : subvariant === 'refuel'
32
38
  ? t('header.gas')
33
- : t('header.exchange')
39
+ : subvariant === 'split' && splitTitle
40
+ ? splitTitle
41
+ : t('header.exchange')
34
42
 
35
43
  useHeader(title)
36
44
 
@@ -39,7 +39,6 @@ export const RoutePrioritySettings: React.FC = () => {
39
39
  aria-label="tabs"
40
40
  indicatorColor="primary"
41
41
  onChange={handleRoutePriorityChange}
42
- orientation="vertical"
43
42
  sx={{ mt: 1.5 }}
44
43
  >
45
44
  {Priorities.map((priority) => {
@@ -48,12 +48,11 @@ export const azureLightTheme: WidgetTheme = {
48
48
  defaultProps: { variant: 'filled' },
49
49
  },
50
50
  // Used only for 'split' subvariant and can be safely removed if not used
51
- MuiTabs: {
51
+ MuiNavigationTabs: {
52
52
  styleOverrides: {
53
53
  root: {
54
- backgroundColor: '#f8f8fa',
55
54
  [`.${tabsClasses.indicator}`]: {
56
- backgroundColor: '#ffffff',
55
+ backgroundColor: '#f8f8fa',
57
56
  },
58
57
  },
59
58
  },
@@ -469,6 +469,12 @@ export const createTheme = (widgetTheme: WidgetTheme = {}) => {
469
469
  },
470
470
  },
471
471
  },
472
+ MuiNavigationTabs: {
473
+ ...widgetTheme.components?.MuiNavigationTabs,
474
+ },
475
+ MuiNavigationTab: {
476
+ ...widgetTheme.components?.MuiNavigationTab,
477
+ },
472
478
  },
473
479
  })
474
480
 
@@ -3,6 +3,8 @@ import type {
3
3
  ComponentsOverrides,
4
4
  ComponentsVariants,
5
5
  SimplePaletteColorOptions,
6
+ TabProps,
7
+ TabsProps,
6
8
  } from '@mui/material'
7
9
  import type {} from '@mui/material/themeCssVarsAugmentation'
8
10
  import type { CSSProperties } from 'react'
@@ -42,9 +44,13 @@ declare module '@mui/material/styles' {
42
44
  }
43
45
  interface ComponentNameToClassKey {
44
46
  MuiInputCard: 'root'
47
+ MuiNavigationTabs: 'root'
48
+ MuiNavigationTab: 'root'
45
49
  }
46
50
  interface ComponentsPropsList {
47
51
  MuiInputCard: Partial<CardProps>
52
+ MuiNavigationTabs: Partial<TabsProps>
53
+ MuiNavigationTab: Partial<TabProps>
48
54
  }
49
55
  interface Components {
50
56
  MuiInputCard?: {
@@ -54,6 +60,20 @@ declare module '@mui/material/styles' {
54
60
  >['MuiInputCard']
55
61
  variants?: ComponentsVariants['MuiInputCard']
56
62
  }
63
+ MuiNavigationTabs?: {
64
+ defaultProps?: ComponentsPropsList['MuiNavigationTabs']
65
+ styleOverrides?: ComponentsOverrides<
66
+ Omit<Theme, 'components'>
67
+ >['MuiNavigationTabs']
68
+ variants?: ComponentsVariants['MuiNavigationTabs']
69
+ }
70
+ MuiNavigationTab?: {
71
+ defaultProps?: ComponentsPropsList['MuiNavigationTab']
72
+ styleOverrides?: ComponentsOverrides<
73
+ Omit<Theme, 'components'>
74
+ >['MuiNavigationTab']
75
+ variants?: ComponentsVariants['MuiNavigationTab']
76
+ }
57
77
  }
58
78
  interface Palette {
59
79
  playground: Palette['primary']
@@ -1,3 +1,4 @@
1
+ import { tabsClasses } from '@mui/material'
1
2
  import type { WidgetTheme } from '../types/widget.js'
2
3
 
3
4
  export const watermelonLightTheme: WidgetTheme = {
@@ -46,6 +47,17 @@ export const watermelonLightTheme: WidgetTheme = {
46
47
  MuiCard: {
47
48
  defaultProps: { variant: 'elevation' },
48
49
  },
50
+ MuiNavigationTabs: {
51
+ styleOverrides: {
52
+ root: ({ theme }) => ({
53
+ [`.${tabsClasses.indicator}`]: {
54
+ backgroundColor: '#ffffff',
55
+ filter: `drop-shadow(0 1px 4px rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.08))`,
56
+ borderRadius: '16px',
57
+ },
58
+ }),
59
+ },
60
+ },
49
61
  // MuiIconButton: {
50
62
  // styleOverrides: {
51
63
  // root: ({ theme }) => ({
@@ -1,3 +1,4 @@
1
+ import { tabsClasses } from '@mui/material'
1
2
  import type { WidgetTheme } from '../types/widget.js'
2
3
 
3
4
  export const windows95Theme: WidgetTheme = {
@@ -84,6 +85,17 @@ export const windows95Theme: WidgetTheme = {
84
85
  },
85
86
  },
86
87
  },
88
+ MuiNavigationTabs: {
89
+ styleOverrides: {
90
+ root: {
91
+ [`.${tabsClasses.indicator}`]: {
92
+ backgroundColor: '#dfdfdf',
93
+ boxShadow:
94
+ 'inset -1px -1px #0a0a0a, inset 1px 1px #ffffff, inset -2px -2px #808080, inset 2px 2px #dfdfdf',
95
+ },
96
+ },
97
+ },
98
+ },
87
99
  MuiIconButton: {
88
100
  defaultProps: {
89
101
  // disableRipple: true,
@@ -62,6 +62,8 @@ export type WidgetThemeComponents = Partial<
62
62
  | 'MuiCard'
63
63
  | 'MuiIconButton'
64
64
  | 'MuiInputCard'
65
+ | 'MuiNavigationTabs'
66
+ | 'MuiNavigationTab'
65
67
  | 'MuiTabs'
66
68
  >
67
69
  >
@@ -1 +0,0 @@
1
- export declare const NavigationTabs: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"NavigationTabs.js","sourceRoot":"","sources":["../../../../src/components/Header/NavigationTabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAA;AAC1F,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,uBAAuB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QAC3D,KAAK,CAAC,KAAK;QACX,KAAK,CAAC,QAAQ;KACf,CAAC,CAAA;IAEF,MAAM,EAAE,aAAa,EAAE,GAAG,eAAe,EAAE,CAAA;IAC3C,MAAM,YAAY,GAAG,CAAC,CAAuB,EAAE,KAAa,EAAE,EAAE;QAC9D,aAAa,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;QAC/B,aAAa,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;QAC9B,aAAa,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;QAC5B,QAAQ,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAC3C,CAAC,CAAA;IAED,OAAO,CACL,KAAC,YAAY,IAAC,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,aAAa,EAAE,GAAG,EAAE,YACnE,MAAC,IAAI,IACH,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC/B,QAAQ,EAAE,YAAY,gBACX,MAAM,EACjB,cAAc,EAAC,SAAS,aAExB,KAAC,GAAG,IAAC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC,EAAE,aAAa,SAAG,EAC9C,KAAC,GAAG,IAAC,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,aAAa,SAAG,IAC3C,GACM,CAChB,CAAA;AACH,CAAC,CAAA"}