@graphcommerce/next-ui 10.0.0-canary.67 → 10.0.0-canary.68

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 (100) hide show
  1. package/ActionCard/ActionCard.tsx +30 -21
  2. package/ActionCard/ActionCardAccordion.tsx +2 -2
  3. package/ActionCard/ActionCardLayout.tsx +4 -3
  4. package/ActionCard/ActionCardList.tsx +13 -6
  5. package/Blog/BlogAuthor/BlogAuthor.tsx +9 -7
  6. package/Blog/BlogContent/BlogContent.tsx +7 -4
  7. package/Blog/BlogHeader/BlogHeader.tsx +7 -4
  8. package/Blog/BlogList/BlogList.tsx +4 -3
  9. package/Blog/BlogListItem/BlogListItem.tsx +6 -5
  10. package/Blog/BlogTags/BlogTag.tsx +2 -4
  11. package/Blog/BlogTitle/BlogTitle.tsx +2 -6
  12. package/Breadcrumbs/Breadcrumbs.tsx +24 -38
  13. package/Breadcrumbs/BreadcrumbsList.tsx +9 -9
  14. package/Button/Button.tsx +4 -4
  15. package/Button/LinkOrButton.tsx +8 -7
  16. package/CHANGELOG.md +8 -0
  17. package/ChipMenu/ChipMenu.tsx +5 -5
  18. package/Container/Container.tsx +4 -4
  19. package/Fab/Fab.tsx +1 -1
  20. package/Footer/Footer.tsx +5 -5
  21. package/Form/Form.tsx +6 -6
  22. package/Form/FormDivider.tsx +1 -1
  23. package/Form/InputCheckmark.tsx +2 -1
  24. package/FramerScroller/SidebarGallery.tsx +43 -34
  25. package/FullPageMessage/FullPageMessage.tsx +13 -4
  26. package/IconHeader/IconHeader.tsx +22 -8
  27. package/IconSvg/IconSvg.tsx +1 -1
  28. package/Layout/components/LayoutHeader.tsx +7 -6
  29. package/Layout/components/LayoutHeaderBack.tsx +0 -2
  30. package/Layout/components/LayoutHeaderContent.tsx +22 -18
  31. package/Layout/components/LayoutTitle.tsx +4 -3
  32. package/LayoutDefault/components/LayoutDefault.tsx +5 -4
  33. package/LayoutOverlay/components/LayoutOverlayHeader.tsx +4 -3
  34. package/LayoutOverlay/components/LayoutOverlayHeader2.tsx +0 -6
  35. package/LayoutParts/DesktopHeaderBadge.tsx +4 -3
  36. package/LayoutParts/DesktopNavBar.tsx +10 -11
  37. package/LayoutParts/DesktopNavBarItem.tsx +22 -16
  38. package/LayoutParts/GlobalHead.tsx +1 -1
  39. package/LayoutParts/Logo.tsx +2 -1
  40. package/LayoutParts/MenuFab.tsx +36 -14
  41. package/LayoutParts/MenuFabItem.tsx +2 -1
  42. package/LayoutParts/MenuFabSecondaryItem.tsx +6 -3
  43. package/LayoutParts/PlaceholderFab.tsx +2 -1
  44. package/LayoutParts/StickyBelowHeader.tsx +4 -3
  45. package/MediaQuery/MediaQuery.tsx +2 -4
  46. package/Navigation/components/NavigationFab.tsx +31 -11
  47. package/Navigation/components/NavigationItem.tsx +14 -10
  48. package/Navigation/components/NavigationOverlay.tsx +39 -20
  49. package/Overlay/components/OverlayBase.tsx +21 -23
  50. package/Overlay/components/OverlayContainer.tsx +35 -12
  51. package/Overlay/components/OverlayHeader.tsx +2 -1
  52. package/Overlay/components/OverlayStickyBottom.tsx +2 -5
  53. package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +35 -31
  54. package/OverlayOrPopperChip/OverlayPanel.tsx +4 -5
  55. package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -1
  56. package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -1
  57. package/Pagination/Pagination.tsx +9 -6
  58. package/Pagination/PaginationExtended.tsx +4 -3
  59. package/Row/ButtonLinkList/ButtonLinkList.tsx +14 -15
  60. package/Row/ButtonLinkList/ButtonLinkListItem.tsx +1 -1
  61. package/Row/ColumnThree/ColumnThree.tsx +4 -3
  62. package/Row/ColumnTwo/ColumnTwo.tsx +16 -5
  63. package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +15 -4
  64. package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +22 -6
  65. package/Row/ContentLinks/ContentLinks.tsx +4 -3
  66. package/Row/HeroBanner/HeroBanner.tsx +3 -7
  67. package/Row/IconBlocks/IconBlock.tsx +4 -3
  68. package/Row/IconBlocks/IconBlocks.tsx +2 -1
  69. package/Row/ImageText/ImageText.tsx +5 -5
  70. package/Row/ImageTextBoxed/ImageTextBoxed.tsx +2 -2
  71. package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +1 -1
  72. package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +4 -3
  73. package/Row/RowLinks/variant/VariantInline.tsx +2 -4
  74. package/Row/RowLinks/variant/VariantLogoSwiper.tsx +4 -3
  75. package/Row/RowLinks/variant/VariantUsps.tsx +4 -3
  76. package/Row/SpecialBanner/SpecialBanner.tsx +2 -2
  77. package/SectionContainer/SectionContainer.tsx +6 -5
  78. package/SectionHeader/SectionHeader.tsx +4 -3
  79. package/Separator/Separator.tsx +4 -3
  80. package/SkipLink/SkipLink.tsx +2 -2
  81. package/Snackbar/MessageSnackbarImpl.tsx +22 -10
  82. package/StarRatingField/StarRatingField.tsx +1 -1
  83. package/Stepper/Stepper.tsx +6 -5
  84. package/Styles/withTheme.tsx +6 -5
  85. package/Tabs/TabItem.tsx +4 -5
  86. package/TextInputNumber/TextInputNumber.tsx +76 -50
  87. package/Theme/DarkLightModeThemeProvider.tsx +41 -88
  88. package/Theme/MuiButton.ts +23 -22
  89. package/Theme/MuiChip.ts +12 -13
  90. package/Theme/MuiFab.ts +5 -5
  91. package/Theme/MuiSlider.ts +5 -5
  92. package/Theme/createTheme.ts +1 -3
  93. package/Theme/themeDefaults.ts +1 -1
  94. package/ToggleButton/ToggleButton.tsx +10 -11
  95. package/ToggleButtonGroup/ToggleButtonGroup.tsx +4 -3
  96. package/UspList/UspList.tsx +4 -3
  97. package/UspList/UspListItem.tsx +4 -3
  98. package/package.json +10 -10
  99. package/types.ts +1 -0
  100. package/utils/sxx.ts +1 -1
@@ -96,7 +96,6 @@ export const LayoutOverlayHeader2 = React.memo<LayoutOverlayHeader2Props>((props
96
96
  right: 0,
97
97
  top: 0,
98
98
  marginTop: 0,
99
-
100
99
  // Special positioning for bottom overlays
101
100
  [theme.breakpoints.down('md')]: {
102
101
  height: theme.appShell.headerHeightSm,
@@ -109,7 +108,6 @@ export const LayoutOverlayHeader2 = React.memo<LayoutOverlayHeader2Props>((props
109
108
  '.variantMdBottom.sizeMdFull &, .variantMdBottom.sizeMdMinimal &': {
110
109
  top: `calc(${theme.appShell.appBarHeightMd} * 0.5 * -1)`,
111
110
  },
112
-
113
111
  '&.sizeSmall': {
114
112
  height: theme.appShell.headerHeightSm,
115
113
  },
@@ -135,23 +133,19 @@ export const LayoutOverlayHeader2 = React.memo<LayoutOverlayHeader2Props>((props
135
133
  height: theme.appShell.headerHeightSm,
136
134
  },
137
135
  },
138
-
139
136
  // Default: center only
140
137
  gridTemplateAreas: '"center"',
141
138
  gridTemplateColumns: '1fr',
142
-
143
139
  // Left only
144
140
  '&.left:not(.right)': {
145
141
  gridTemplateAreas: '"left center"',
146
142
  gridTemplateColumns: justify === 'center' ? '1fr max-content' : 'auto 1fr',
147
143
  },
148
-
149
144
  // Right only
150
145
  '&.right:not(.left)': {
151
146
  gridTemplateAreas: '"center right"',
152
147
  gridTemplateColumns: justify === 'center' ? 'max-content 1fr' : '1fr auto',
153
148
  },
154
-
155
149
  // Both left and right
156
150
  '&.left.right': {
157
151
  gridTemplateAreas: '"left center right"',
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { BadgeProps } from '@mui/material'
2
3
  import { Badge } from '@mui/material'
3
4
 
@@ -8,7 +9,7 @@ export function DesktopHeaderBadge(props: BadgeProps) {
8
9
  return (
9
10
  <Badge
10
11
  {...props}
11
- sx={[
12
+ sx={sxx(
12
13
  {
13
14
  '& .MuiBadge-colorError': {
14
15
  bgcolor: 'text.disabled',
@@ -23,8 +24,8 @@ export function DesktopHeaderBadge(props: BadgeProps) {
23
24
  padding: { xs: '3px', md: '5px' },
24
25
  },
25
26
  },
26
- ...(Array.isArray(sx) ? sx : [sx]),
27
- ]}
27
+ sx,
28
+ )}
28
29
  />
29
30
  )
30
31
  }
@@ -1,4 +1,5 @@
1
1
  import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
2
+ import { sxx } from '@graphcommerce/next-ui'
2
3
  import type { BoxProps } from '@mui/material'
3
4
  import React from 'react'
4
5
  import { iconChevronLeft, iconChevronRight } from '../icons'
@@ -30,7 +31,7 @@ export function DesktopNavBar(props: MenuTabsProps) {
30
31
  query={(theme) => theme.breakpoints.up('md')}
31
32
  display='grid'
32
33
  className={classes.root}
33
- sx={[
34
+ sx={sxx(
34
35
  {
35
36
  width: '100%',
36
37
  alignItems: 'center',
@@ -38,8 +39,8 @@ export function DesktopNavBar(props: MenuTabsProps) {
38
39
  pointerEvents: 'all',
39
40
  gridTemplateColumns: 'auto 1fr auto',
40
41
  },
41
- ...(Array.isArray(sx) ? sx : [sx]),
42
- ]}
42
+ sx,
43
+ )}
43
44
  >
44
45
  <ScrollerProvider scrollSnapAlign='none'>
45
46
  <Scroller
@@ -61,16 +62,15 @@ export function DesktopNavBar(props: MenuTabsProps) {
61
62
  pointerEvents: 'none',
62
63
  '& > *': { pointerEvents: 'all' },
63
64
  }}
64
- sx={{
65
+ sx={(theme) => ({
65
66
  pointerEvents: 'all',
66
67
  boxShadow: 'none',
67
68
  height: 48,
68
69
  borderTopLeftRadius: 0,
69
70
  borderBottomLeftRadius: 0,
70
71
  backgroundColor: 'transparent',
71
- backgroundImage: (theme) =>
72
- `linear-gradient(to left, rgba(255,255,255,0) 0%, ${theme.palette.background.default} 35%)`,
73
- }}
72
+ backgroundImage: `linear-gradient(to left, rgba(255,255,255,0) 0%, ${theme.vars.palette.background.default} 35%)`,
73
+ })}
74
74
  direction='left'
75
75
  size='small'
76
76
  tabIndex={-1}
@@ -87,16 +87,15 @@ export function DesktopNavBar(props: MenuTabsProps) {
87
87
  pointerEvents: 'all',
88
88
  },
89
89
  }}
90
- sx={{
90
+ sx={(theme) => ({
91
91
  pointerEvents: 'all',
92
92
  boxShadow: 'none',
93
93
  height: 48,
94
94
  borderTopRightRadius: 0,
95
95
  borderBottomRightRadius: 0,
96
96
  backgroundColor: 'transparent',
97
- backgroundImage: (theme) =>
98
- `linear-gradient(to right, rgba(255,255,255,0) 0%, ${theme.palette.background.default} 35%)`,
99
- }}
97
+ backgroundImage: `linear-gradient(to right, rgba(255,255,255,0) 0%, ${theme.vars.palette.background.default} 35%)`,
98
+ })}
100
99
  direction='right'
101
100
  size='small'
102
101
  tabIndex={-1}
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { LinkProps } from '@mui/material'
2
3
  import { Box, Link } from '@mui/material'
3
4
  import { useRouter } from 'next/router'
@@ -34,10 +35,7 @@ export function DesktopNavItem(props: DesktopNavItemLinkProps | DesktopNavItemBu
34
35
  underline='none'
35
36
  {...linkProps}
36
37
  onClick={onClick}
37
- sx={[
38
- { whiteSpace: 'nowrap', paddingTop: '6px', cursor: 'pointer' },
39
- ...(Array.isArray(sx) ? sx : [sx]),
40
- ]}
38
+ sx={sxx({ whiteSpace: 'nowrap', paddingTop: '6px', cursor: 'pointer' }, sx)}
41
39
  >
42
40
  <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>{children}</Box>
43
41
  </Link>
@@ -56,23 +54,31 @@ export function DesktopNavItem(props: DesktopNavItemLinkProps | DesktopNavItemBu
56
54
  color='text.primary'
57
55
  underline='none'
58
56
  {...linkProps}
59
- sx={[{ whiteSpace: 'nowrap', paddingTop: '6px' }, ...(Array.isArray(sx) ? sx : [sx])]}
57
+ sx={sxx({ whiteSpace: 'nowrap', paddingTop: '6px' }, sx)}
60
58
  >
61
59
  <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>{children}</Box>
62
60
  <Box
63
61
  component='span'
64
62
  className={classes.line}
65
- sx={{
66
- maxWidth: 40,
67
- width: '100%',
68
- display: 'flex',
69
- justifyContent: 'center',
70
- height: 2,
71
- background: (theme) => theme.palette.primary.main,
72
- margin: '0 auto',
73
- marginTop: '6px',
74
- opacity: activeValue ? 1 : 0,
75
- }}
63
+ sx={sxx(
64
+ (theme) => ({
65
+ maxWidth: 40,
66
+ width: '100%',
67
+ display: 'flex',
68
+ justifyContent: 'center',
69
+ height: 2,
70
+ background: theme.vars.palette.primary.main,
71
+ margin: '0 auto',
72
+ marginTop: '6px',
73
+ }),
74
+ activeValue
75
+ ? {
76
+ opacity: 1,
77
+ }
78
+ : {
79
+ opacity: 0,
80
+ },
81
+ )}
76
82
  />
77
83
  </Link>
78
84
  )
@@ -13,7 +13,7 @@ export function GlobalHead(props: GlobalHeadProps) {
13
13
 
14
14
  return (
15
15
  <Head>
16
- <meta name='theme-color' content={theme.palette.background.default} key='theme-color' />
16
+ <meta name='theme-color' content={theme.vars.palette.background.default} key='theme-color' />
17
17
  <meta
18
18
  name='viewport'
19
19
  content='minimum-scale=1, initial-scale=1, width=device-width'
@@ -1,5 +1,6 @@
1
1
  import type { ImageProps } from '@graphcommerce/image'
2
2
  import { Image } from '@graphcommerce/image'
3
+ import { sxx } from '@graphcommerce/next-ui'
3
4
  import type { SxProps, Theme } from '@mui/material'
4
5
  import {
5
6
  Box,
@@ -66,7 +67,7 @@ export const Logo = forwardRef<HTMLAnchorElement, LogoProps>((props, ref) => {
66
67
  component={shouldRedirect ? LogoContainer : 'div'}
67
68
  href={shouldRedirect ? href : undefined}
68
69
  ref={ref}
69
- sx={[...(Array.isArray(sx) ? sx : [sx]), commonLogoStyles]}
70
+ sx={sxx(sx, commonLogoStyles)}
70
71
  className={classes.parent}
71
72
  >
72
73
  {img}
@@ -1,4 +1,5 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
+ import { sxx } from '@graphcommerce/next-ui'
2
3
  import type { FabProps, MenuProps as MenuPropsType, SxProps, Theme } from '@mui/material'
3
4
  import { Box, Divider, Fab, ListItem, Menu, styled } from '@mui/material'
4
5
  import { m } from 'framer-motion'
@@ -65,12 +66,7 @@ export function MenuFab(props: MenuFabProps) {
65
66
  const classes = withState({ scrolled })
66
67
 
67
68
  return (
68
- <Box
69
- sx={[
70
- { position: 'relative', width: fabIconSize, height: fabIconSize },
71
- ...(Array.isArray(sx) ? sx : [sx]),
72
- ]}
73
- >
69
+ <Box sx={sxx({ position: 'relative', width: fabIconSize, height: fabIconSize }, sx)}>
74
70
  <MotionDiv
75
71
  className={classes.wrapper}
76
72
  sx={(theme) => ({
@@ -92,20 +88,44 @@ export function MenuFab(props: MenuFabProps) {
92
88
  boxShadow: 'none',
93
89
  '&:hover, &:focus': {
94
90
  boxShadow: 'none',
95
- background: theme.palette.text.primary,
91
+ background: theme.vars.palette.text.primary,
96
92
  },
97
- background: theme.palette.text.primary,
93
+ background: theme.vars.palette.text.primary,
98
94
  pointerEvents: 'all',
99
- color: theme.palette.background.paper,
95
+ color: theme.vars.palette.background.paper,
100
96
  })}
101
97
  className={classes.fab}
102
98
  {...fabProps}
103
99
  >
104
100
  {closeIcon ?? (
105
- <IconSvg src={iconClose} size='large' sx={{ display: openEl ? 'block' : 'none' }} />
101
+ <IconSvg
102
+ src={iconClose}
103
+ size='large'
104
+ sx={sxx(
105
+ openEl
106
+ ? {
107
+ display: 'block',
108
+ }
109
+ : {
110
+ display: 'none',
111
+ },
112
+ )}
113
+ />
106
114
  )}
107
115
  {menuIcon ?? (
108
- <IconSvg src={iconMenu} size='large' sx={{ display: openEl ? 'none' : 'block' }} />
116
+ <IconSvg
117
+ src={iconMenu}
118
+ size='large'
119
+ sx={sxx(
120
+ openEl
121
+ ? {
122
+ display: 'none',
123
+ }
124
+ : {
125
+ display: 'block',
126
+ },
127
+ )}
128
+ />
109
129
  )}
110
130
  </Fab>
111
131
  <MotionDiv
@@ -132,9 +152,9 @@ export function MenuFab(props: MenuFabProps) {
132
152
  transitionDuration={{ appear: 175, enter: 175, exit: 175 }}
133
153
  PaperProps={{
134
154
  sx: (theme) => ({
135
- backgroundColor: theme.palette.background.paper,
155
+ backgroundColor: theme.vars.palette.background.paper,
136
156
  backgroundImage: 'unset',
137
- color: theme.palette.text.primary,
157
+ color: theme.vars.palette.text.primary,
138
158
  minWidth: responsiveVal(200, 280),
139
159
  marginTop: '12px',
140
160
  [theme.breakpoints.down('md')]: {
@@ -143,8 +163,10 @@ export function MenuFab(props: MenuFabProps) {
143
163
  }),
144
164
  }}
145
165
  className={classes.menu}
146
- MenuListProps={{ dense: true }}
147
166
  {...MenuProps}
167
+ slotProps={{
168
+ list: { dense: true },
169
+ }}
148
170
  >
149
171
  {[
150
172
  search ? (
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { ListItemButtonProps } from '@mui/material'
2
3
  import { ListItemButton, ListItemText } from '@mui/material'
3
4
  import { useRouter } from 'next/router'
@@ -20,7 +21,7 @@ export function MenuFabItem(props: MenuFabItemProps) {
20
21
  return (
21
22
  <ListItemButton href={href} component={NextLink} dense selected={active} {...listItemProps}>
22
23
  <ListItemText
23
- sx={[{ typography: 'h4', lineHeight: 1.1 }, ...(Array.isArray(sx) ? sx : [sx])]}
24
+ sx={sxx({ typography: 'h4', lineHeight: 1.1 }, sx)}
24
25
  disableTypography
25
26
  primary={children}
26
27
  />
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { SxProps, Theme } from '@mui/material'
2
3
  import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
3
4
  import { useRouter } from 'next/router'
@@ -34,7 +35,7 @@ export function MenuFabSecondaryItem(props: FabMenuSecondaryItemProps) {
34
35
  component={NextLink}
35
36
  href={href}
36
37
  className={classes.root}
37
- sx={[{}, ...(Array.isArray(sx) ? sx : [sx])]}
38
+ sx={sx}
38
39
  dense
39
40
  selected={router.asPath.startsWith(href)}
40
41
  >
@@ -45,8 +46,10 @@ export function MenuFabSecondaryItem(props: FabMenuSecondaryItemProps) {
45
46
  )}
46
47
  <ListItemText
47
48
  className={classes.icon}
48
- primaryTypographyProps={{
49
- sx: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },
49
+ slotProps={{
50
+ primary: {
51
+ sx: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' },
52
+ },
50
53
  }}
51
54
  >
52
55
  {children}
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { FabProps } from '@mui/material'
2
3
  import { Fab } from '@mui/material'
3
4
 
@@ -7,7 +8,7 @@ export function PlaceholderFab(props: Omit<FabProps, 'children'>) {
7
8
  <Fab
8
9
  size='responsive'
9
10
  {...props}
10
- sx={[{ visibility: 'hidden', pointerEvents: 'none' }, ...(Array.isArray(sx) ? sx : [sx])]}
11
+ sx={sxx({ visibility: 'hidden', pointerEvents: 'none' }, sx)}
11
12
  />
12
13
  )
13
14
  }
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { SxProps, Theme } from '@mui/material'
2
3
  import { Container } from '@mui/material'
3
4
  import React from 'react'
@@ -18,7 +19,7 @@ export function StickyBelowHeader(props: StickyBelowHeaderProps) {
18
19
  className={classes.root}
19
20
  maxWidth={false}
20
21
  {...props}
21
- sx={[
22
+ sx={sxx(
22
23
  (theme) => ({
23
24
  position: 'sticky',
24
25
  top: { xs: theme.appShell.headerHeightSm, md: `${theme.page.vertical} !important` },
@@ -28,8 +29,8 @@ export function StickyBelowHeader(props: StickyBelowHeaderProps) {
28
29
  pointerEvents: 'auto',
29
30
  },
30
31
  }),
31
- ...(Array.isArray(sx) ? sx : [sx]),
32
- ]}
32
+ sx,
33
+ )}
33
34
  />
34
35
  )
35
36
  }
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { BoxProps, Theme } from '@mui/material'
2
3
  import { Box, useTheme } from '@mui/material'
3
4
  import type { CSSProperties } from 'react'
@@ -84,10 +85,7 @@ function MediaQueryBase(props: MediaQueryProps) {
84
85
  return () => controller.abort()
85
86
  }, [matchMedia])
86
87
 
87
- const sxVal = [
88
- { display: 'none', [queryString]: { display } },
89
- ...(Array.isArray(sx) ? sx : [sx]),
90
- ]
88
+ const sxVal = sxx({ display: 'none', [queryString]: { display } }, sx)
91
89
 
92
90
  if (typeof window === 'undefined' || matches) {
93
91
  return (
@@ -1,4 +1,5 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
+ import { sxx } from '@graphcommerce/next-ui'
2
3
  import type { FabProps, SxProps, Theme } from '@mui/material'
3
4
  import { Box, Fab, styled, useTheme } from '@mui/material'
4
5
  import { m } from 'framer-motion'
@@ -49,12 +50,7 @@ export function NavigationFab(props: NavigationFabProps) {
49
50
  const classes = withState({ scrolled })
50
51
 
51
52
  return (
52
- <Box
53
- sx={[
54
- { position: 'relative', width: fabIconSize, height: fabIconSize },
55
- ...(Array.isArray(sx) ? sx : [sx]),
56
- ]}
57
- >
53
+ <Box sx={sxx({ position: 'relative', width: fabIconSize, height: fabIconSize }, sx)}>
58
54
  <MotionDiv
59
55
  className={classes.wrapper}
60
56
  sx={{
@@ -73,20 +69,44 @@ export function NavigationFab(props: NavigationFabProps) {
73
69
  boxShadow: 'none',
74
70
  '&:hover, &:focus': {
75
71
  boxShadow: 'none',
76
- background: theme.palette.text.primary,
72
+ background: theme.vars.palette.text.primary,
77
73
  },
78
- background: theme.palette.text.primary,
74
+ background: theme.vars.palette.text.primary,
79
75
  pointerEvents: 'all',
80
- color: theme.palette.background.paper,
76
+ color: theme.vars.palette.background.paper,
81
77
  }}
82
78
  className={classes.fab}
83
79
  {...fabProps}
84
80
  >
85
81
  {closeIcon ?? (
86
- <IconSvg src={iconClose} size='large' sx={{ display: openEl ? 'block' : 'none' }} />
82
+ <IconSvg
83
+ src={iconClose}
84
+ size='large'
85
+ sx={sxx(
86
+ openEl
87
+ ? {
88
+ display: 'block',
89
+ }
90
+ : {
91
+ display: 'none',
92
+ },
93
+ )}
94
+ />
87
95
  )}
88
96
  {menuIcon ?? (
89
- <IconSvg src={iconMenu} size='large' sx={{ display: openEl ? 'none' : 'block' }} />
97
+ <IconSvg
98
+ src={iconMenu}
99
+ size='large'
100
+ sx={sxx(
101
+ openEl
102
+ ? {
103
+ display: 'none',
104
+ }
105
+ : {
106
+ display: 'block',
107
+ },
108
+ )}
109
+ />
90
110
  )}
91
111
  </Fab>
92
112
  <MotionDiv
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-use-before-define */
2
2
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
3
- import { alpha, Box, ListItemButton, styled, useEventCallback } from '@mui/material'
3
+ import { sxx } from '@graphcommerce/next-ui'
4
+ import { Box, ListItemButton, styled, useEventCallback } from '@mui/material'
4
5
  import React from 'react'
5
6
  import { useMatchMedia } from '../../hooks'
6
7
  import { iconChevronRight } from '../../icons'
@@ -89,17 +90,23 @@ export const NavigationItem = React.memo<NavigationItemProps>((props) => {
89
90
  href={href}
90
91
  className={classes.item}
91
92
  role='button'
92
- sx={[
93
+ sx={sxx(
93
94
  (theme) => ({
94
95
  gridRowStart: row,
95
96
  gridColumnStart: column,
96
97
  gap: theme.spacings.xxs,
97
- display: hideItem ? 'none' : 'flex',
98
98
  '&.Mui-disabled': {
99
99
  opacity: 1,
100
- background: alpha(theme.palette.action.hover, 0.025),
100
+ background: theme.alpha(theme.vars.palette.action.hover, 0.025),
101
101
  },
102
102
  }),
103
+ hideItem
104
+ ? {
105
+ display: 'none',
106
+ }
107
+ : {
108
+ display: 'flex',
109
+ },
103
110
  mouseEvent === 'hover'
104
111
  ? {
105
112
  '&.Mui-disabled': {
@@ -108,7 +115,7 @@ export const NavigationItem = React.memo<NavigationItemProps>((props) => {
108
115
  },
109
116
  }
110
117
  : {},
111
- ]}
118
+ )}
112
119
  disabled={isSelected}
113
120
  tabIndex={tabIndex}
114
121
  onClick={(e) => {
@@ -141,7 +148,6 @@ export const NavigationItem = React.memo<NavigationItemProps>((props) => {
141
148
  </Box>
142
149
  <IconSvg src={iconChevronRight} sx={{ flexShrink: 0 }} />
143
150
  </ListItemButton>
144
-
145
151
  {!skipChildren && (
146
152
  <NavigationList
147
153
  items={childItems}
@@ -158,7 +164,7 @@ export const NavigationItem = React.memo<NavigationItemProps>((props) => {
158
164
  const { name, href } = props
159
165
 
160
166
  return (
161
- <NavigationLI sx={[hideItem && { display: 'none' }]} className={classes.li}>
167
+ <NavigationLI sx={sxx(hideItem && { display: 'none' })} className={classes.li}>
162
168
  <ListItemButton
163
169
  component={NextLink}
164
170
  prefetch={false}
@@ -190,17 +196,15 @@ export const NavigationItem = React.memo<NavigationItemProps>((props) => {
190
196
  if (isNavigationComponent(props)) {
191
197
  const { component } = props
192
198
  return (
193
- <NavigationLI sx={[hideItem && { display: 'none' }]} className={classes.li}>
199
+ <NavigationLI sx={sxx(hideItem && { display: 'none' })} className={classes.li}>
194
200
  <Box sx={{ gridRowStart: row, gridColumnStart: column }} className={classes.item}>
195
201
  {component}
196
202
  </Box>
197
203
  </NavigationLI>
198
204
  )
199
205
  }
200
-
201
206
  return null
202
207
  })
203
-
204
208
  if (process.env.NODE_ENV !== 'production') {
205
209
  NavigationItem.displayName = 'NavigationItem'
206
210
  }