@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
@@ -1,4 +1,5 @@
1
1
  import { dvw, useMotionSelector, useMotionValueValue } from '@graphcommerce/framer-utils'
2
+ import { sxx } from '@graphcommerce/next-ui'
2
3
  import { t } from '@lingui/core/macro'
3
4
  import type { SxProps, Theme } from '@mui/material'
4
5
  import { Box, Fab, styled, useEventCallback, useTheme } from '@mui/material'
@@ -127,15 +128,15 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
127
128
  animating.set(false)
128
129
  },
129
130
  }}
130
- sx={[
131
+ sx={sxx(
131
132
  {
132
133
  zIndex: 'drawer',
133
134
  '& .LayoutOverlayBase-overlayPane': {
134
135
  minWidth: itemWidthMd,
135
136
  },
136
137
  },
137
- ...(Array.isArray(overlaySx) ? overlaySx : [overlaySx]),
138
- ]}
138
+ overlaySx,
139
+ )}
139
140
  >
140
141
  <MotionDiv layout layoutDependency={selectionValue} sx={{ display: 'grid' }}>
141
142
  <Box
@@ -189,24 +190,16 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
189
190
  <MotionDiv layout='position' layoutDependency={selectionValue} sx={{ display: 'grid' }}>
190
191
  <Box
191
192
  className={classes.wrapper}
192
- sx={[
193
+ sx={sxx(
193
194
  (theme) => ({
194
195
  display: 'grid',
195
196
  alignItems: !stretchColumns ? 'start' : undefined,
196
197
  justifyContent: 'end',
197
198
  [theme.breakpoints.down('md')]: {
198
- width:
199
- sizeSm !== 'floating'
200
- ? itemWidthSm
201
- : `calc(${itemWidthSm} - (${theme.page.horizontal} * 2))`,
202
199
  minWidth: 200,
203
200
  overflow: 'hidden',
204
201
  scrollSnapType: 'x mandatory',
205
202
  '& .NavigationItem-item': {
206
- width:
207
- sizeSm !== 'floating'
208
- ? `calc(${itemWidthSm} - (${itemPad} * 2))`
209
- : `calc(${itemWidthSm} - (${itemPad} * 2) - (${theme.page.horizontal} * 2))`,
210
203
  minWidth: `calc(200px - (${itemPad} * 2))`,
211
204
  },
212
205
  },
@@ -216,11 +209,37 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
216
209
  },
217
210
  },
218
211
  }),
219
- ]}
212
+ sizeSm !== 'floating'
213
+ ? (theme) => ({
214
+ [theme.breakpoints.down('md')]: {
215
+ width: itemWidthSm,
216
+ },
217
+ })
218
+ : (theme) => ({
219
+ [theme.breakpoints.down('md')]: {
220
+ width: `calc(${itemWidthSm} - (${theme.page.horizontal} * 2))`,
221
+ },
222
+ }),
223
+ sizeSm !== 'floating'
224
+ ? (theme) => ({
225
+ [theme.breakpoints.down('md')]: {
226
+ '& .NavigationItem-item': {
227
+ width: `calc(${itemWidthSm} - (${itemPad} * 2))`,
228
+ },
229
+ },
230
+ })
231
+ : (theme) => ({
232
+ [theme.breakpoints.down('md')]: {
233
+ '& .NavigationItem-item': {
234
+ width: `calc(${itemWidthSm} - (${itemPad} * 2) - (${theme.page.horizontal} * 2))`,
235
+ },
236
+ },
237
+ }),
238
+ )}
220
239
  >
221
240
  <Box
222
241
  className={classes.navigation}
223
- sx={[
242
+ sx={sxx(
224
243
  {
225
244
  py: itemPad,
226
245
  display: 'grid',
@@ -244,14 +263,14 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
244
263
  boxShadow: 'none',
245
264
  },
246
265
  },
247
- ...(Array.isArray(sx) ? sx : [sx]),
248
- ]}
266
+ sx,
267
+ )}
249
268
  >
250
269
  {selectedLevel >= 0 && (
251
270
  <Box
252
271
  sx={(theme) => ({
253
272
  gridArea: '1 / 1 / 999 / 2',
254
- boxShadow: `inset 1px 0 ${theme.palette.divider}`,
273
+ boxShadow: `inset 1px 0 ${theme.vars.palette.divider}`,
255
274
  })}
256
275
  className={classes.column}
257
276
  />
@@ -260,7 +279,7 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
260
279
  <Box
261
280
  sx={(theme) => ({
262
281
  gridArea: '1 / 2 / 999 / 3',
263
- boxShadow: `inset 1px 0 ${theme.palette.divider}`,
282
+ boxShadow: `inset 1px 0 ${theme.vars.palette.divider}`,
264
283
  })}
265
284
  className={classes.column}
266
285
  />
@@ -269,7 +288,7 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
269
288
  <Box
270
289
  sx={(theme) => ({
271
290
  gridArea: '1 / 3 / 999 / 4',
272
- boxShadow: `inset 1px 0 ${theme.palette.divider}`,
291
+ boxShadow: `inset 1px 0 ${theme.vars.palette.divider}`,
273
292
  })}
274
293
  className={classes.column}
275
294
  />
@@ -278,7 +297,7 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
278
297
  <Box
279
298
  sx={(theme) => ({
280
299
  gridArea: '1 / 4 / 999 / 5',
281
- boxShadow: `inset 1px 0 ${theme.palette.divider}`,
300
+ boxShadow: `inset 1px 0 ${theme.vars.palette.divider}`,
282
301
  })}
283
302
  className={classes.column}
284
303
  />
@@ -7,6 +7,7 @@ import {
7
7
  useElementScroll,
8
8
  useIsomorphicLayoutEffect,
9
9
  } from '@graphcommerce/framer-utils'
10
+ import { sxx } from '@graphcommerce/next-ui'
10
11
  import type { SxProps, Theme } from '@mui/material'
11
12
  import { Box, styled, useTheme, useThemeProps } from '@mui/material'
12
13
  import type { MotionProps } from 'framer-motion'
@@ -87,7 +88,7 @@ const parts = [
87
88
  const { withState } = extendableComponent<StyleProps, typeof name, typeof parts>(name, parts)
88
89
 
89
90
  /** Expose the component to be exendable in your theme.components */
90
- declare module '@mui/material/styles/components' {
91
+ declare module '@mui/material/styles' {
91
92
  interface Components {
92
93
  LayoutOverlayBase?: Pick<ExtendableComponent<OverridableProps & StyleProps>, 'defaultProps'>
93
94
  }
@@ -421,7 +422,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
421
422
  inert={active}
422
423
  className={classes.backdrop}
423
424
  style={{ opacity: positions.open.visible }}
424
- sx={[
425
+ sx={sxx(
425
426
  {
426
427
  zIndex: -1,
427
428
  position: 'fixed',
@@ -436,8 +437,8 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
436
437
  WebkitTapHighlightColor: 'transparent',
437
438
  willChange: 'opacity',
438
439
  },
439
- ...(Array.isArray(sxBackdrop) ? sxBackdrop : [sxBackdrop]),
440
- ]}
440
+ sxBackdrop,
441
+ )}
441
442
  />
442
443
  <Scroller
443
444
  inert={disableInert || active ? false : true}
@@ -446,19 +447,14 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
446
447
  onClick={onClickAway}
447
448
  disableDrag={disableDrag}
448
449
  hideScrollbar
449
- sx={[
450
+ sx={sxx(
450
451
  (theme) => ({
451
452
  overscrollBehavior: 'contain',
452
453
  display: 'grid',
453
454
  '&.canGrab': {
454
455
  cursor: 'default',
455
456
  },
456
- '&.mdSnapDirInline': {
457
- overflow: active ? 'auto' : 'hidden',
458
- },
459
-
460
457
  height: dvh(100),
461
-
462
458
  [theme.breakpoints.down('md')]: {
463
459
  '&.variantSmLeft, &.variantSmRight': {
464
460
  overscrollBehaviorX: 'none',
@@ -477,7 +473,6 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
477
473
  overscrollBehaviorY: 'none',
478
474
  gridTemplate: '"beforeOverlay" "overlay"',
479
475
  height: `calc(${dvh(100)} - 1px)`,
480
-
481
476
  '&::after': {
482
477
  content: '""',
483
478
  display: 'block',
@@ -486,7 +481,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
486
481
  height: '1px',
487
482
  top: 'calc(100% - 1px)',
488
483
  left: '0',
489
- background: theme.palette.background[bgColor],
484
+ background: theme.vars.palette.background[bgColor],
490
485
  },
491
486
  },
492
487
  },
@@ -511,8 +506,19 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
511
506
  },
512
507
  },
513
508
  }),
514
- ...(Array.isArray(sx) ? sx : [sx]),
515
- ]}
509
+ active
510
+ ? {
511
+ '&.mdSnapDirInline': {
512
+ overflow: 'auto',
513
+ },
514
+ }
515
+ : {
516
+ '&.mdSnapDirInline': {
517
+ overflow: 'hidden',
518
+ },
519
+ },
520
+ sx,
521
+ )}
516
522
  >
517
523
  <Box
518
524
  className={classes.beforeOverlay}
@@ -522,7 +528,6 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
522
528
  scrollSnapAlign: 'start',
523
529
  display: 'grid',
524
530
  alignContent: 'end',
525
-
526
531
  [theme.breakpoints.down('md')]: {
527
532
  '&.variantSmLeft, &.variantSmRight': {
528
533
  width: dvw(100),
@@ -565,7 +570,6 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
565
570
  [theme.breakpoints.up('md')]: {
566
571
  justifyContent: justifyMd,
567
572
  alignItems: justifyMd,
568
-
569
573
  '&.variantMdBottom, &.variantMdTop': {
570
574
  display: 'grid',
571
575
  },
@@ -586,14 +590,12 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
586
590
  ref={overlayPaneRef}
587
591
  sx={(theme) => ({
588
592
  pointerEvents: 'auto',
589
-
590
593
  [theme.breakpoints.down('md')]: {
591
594
  minWidth: '80vw',
592
595
  overflowY: 'auto',
593
596
  '&:not(.sizeSmFull)': {
594
597
  width: 'auto',
595
598
  },
596
-
597
599
  '&.variantSmBottom': {
598
600
  maxHeight: `calc(${dvh(100)} - ${smSpacingTop})`,
599
601
  paddingTop: smSpacingTop,
@@ -611,11 +613,9 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
611
613
  maxHeight: 'none',
612
614
  borderRadius: 0,
613
615
  },
614
-
615
616
  borderTopLeftRadius: `${theme.shape.borderRadius * 3}px`,
616
617
  borderTopRightRadius: `${theme.shape.borderRadius * 3}px`,
617
618
  },
618
-
619
619
  '&.variantSmLeft, &.variantSmRight': {
620
620
  overscrollBehaviorY: 'none',
621
621
  width: widthSm || 'max-content',
@@ -643,7 +643,6 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
643
643
  '&.variantMdBottom.sizeMdFloating:not(.justifyMdStretch)': {
644
644
  width: widthMd,
645
645
  },
646
-
647
646
  '&.variantMdBottom, &.variantMdTop': {
648
647
  maxHeight: `calc(${dvh(100)} - ${mdSpacingTop})`,
649
648
  paddingTop: mdSpacingTop,
@@ -662,7 +661,6 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
662
661
  maxHeight: 'none',
663
662
  borderRadius: 0,
664
663
  },
665
-
666
664
  borderTopLeftRadius: `${theme.shape.borderRadius * 4}px`,
667
665
  borderTopRightRadius: `${theme.shape.borderRadius * 4}px`,
668
666
  },
@@ -686,7 +684,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
686
684
  <Box
687
685
  className={classes.background}
688
686
  sx={(theme) => ({
689
- backgroundColor: theme.palette.background[bgColor],
687
+ backgroundColor: theme.vars.palette.background[bgColor],
690
688
  paddingBottom: '0.1px',
691
689
  [theme.breakpoints.down('md')]: {
692
690
  minHeight: '100%',
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import { Box } from '@mui/material'
2
3
  import type { LayoutOverlayBaseProps } from './OverlayBase'
3
4
 
@@ -12,19 +13,41 @@ export function OverlayContainer(props: OverlayContainerProps) {
12
13
  return (
13
14
  <Box
14
15
  className='Overlay'
15
- sx={{
16
- position: 'fixed',
17
- top: 0,
18
- left: 0,
19
- transform: hidden ? 'translateX(-200vw)' : undefined,
20
- pointerEvents: active ? undefined : 'none',
21
- right: 0,
22
- bottom: 0,
23
- zIndex: 'drawer',
24
- '& .LayoutOverlayBase-overlayPane': {
25
- boxShadow: active ? undefined : 0,
16
+ sx={sxx(
17
+ {
18
+ position: 'fixed',
19
+ top: 0,
20
+ left: 0,
21
+ right: 0,
22
+ bottom: 0,
23
+ zIndex: 'drawer',
26
24
  },
27
- }}
25
+ hidden
26
+ ? {
27
+ transform: 'translateX(-200vw)',
28
+ }
29
+ : {
30
+ transform: null,
31
+ },
32
+ active
33
+ ? {
34
+ pointerEvents: null,
35
+ }
36
+ : {
37
+ pointerEvents: 'none',
38
+ },
39
+ active
40
+ ? {
41
+ '& .LayoutOverlayBase-overlayPane': {
42
+ boxShadow: null,
43
+ },
44
+ }
45
+ : {
46
+ '& .LayoutOverlayBase-overlayPane': {
47
+ boxShadow: 0,
48
+ },
49
+ },
50
+ )}
28
51
  >
29
52
  {children}
30
53
  </Box>
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import React from 'react'
2
3
  import type { LayoutHeaderProps, TitleProps } from '../../Layout'
3
4
  import { LayoutTitle } from '../../Layout'
@@ -14,7 +15,7 @@ export function OverlayHeader(props: OverlayHeaderProps) {
14
15
  return (
15
16
  <LayoutOverlayHeader
16
17
  noAlign
17
- sx={[{ '&.noAlign': { mb: 0 } }, ...(Array.isArray(sx) ? sx : [sx])]}
18
+ sx={sxx({ '&.noAlign': { mb: 0 } }, sx)}
18
19
  switchPoint={-10000}
19
20
  size='responsive'
20
21
  hideBackButton
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { SxProps, Theme } from '@mui/material'
2
3
  import { styled } from '@mui/material'
3
4
  import { m, useTransform } from 'framer-motion'
@@ -15,10 +16,6 @@ export function OverlayStickyBottom(props: {
15
16
  const bottom = useTransform(scrollY, (offset) => Math.max(-200, offset > 0 ? 0 : offset))
16
17
 
17
18
  return (
18
- <MotionDiv
19
- sx={[{ position: 'sticky', zIndex: 1 }, ...(Array.isArray(sx) ? sx : [sx])]}
20
- style={{ bottom }}
21
- {...divProps}
22
- />
19
+ <MotionDiv sx={sxx({ position: 'sticky', zIndex: 1 }, sx)} style={{ bottom }} {...divProps} />
23
20
  )
24
21
  }
@@ -1,5 +1,6 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { ChipProps, SxProps, Theme } from '@mui/material'
2
- import { Badge, Chip, lighten, Typography, useEventCallback } from '@mui/material'
3
+ import { Badge, Chip, Typography, useEventCallback } from '@mui/material'
3
4
  import React, { useState } from 'react'
4
5
  import { iconChevronDown, iconChevronUp } from '../icons'
5
6
  import { IconSvg } from '../IconSvg'
@@ -75,40 +76,43 @@ export function ChipOverlayOrPopper(props: ChipOverlayOrPopperProps) {
75
76
  onClick={useEventCallback((e: React.MouseEvent<HTMLElement>) =>
76
77
  setActiveEl((el) => (el !== e.currentTarget ? e.currentTarget : null)),
77
78
  )}
78
- sx={[
79
- (theme) => ({
79
+ sx={sxx(
80
+ {
80
81
  '& .MuiChip-deleteIcon': {
81
82
  ml: '0px',
82
83
  },
83
- ...(selected
84
- ? {
85
- background:
86
- theme.palette.mode === 'light'
87
- ? lighten(theme.palette.primary.main, 1 - theme.palette.action.hoverOpacity)
88
- : lighten(
89
- theme.palette.background.default,
90
- theme.palette.action.hoverOpacity,
91
- ),
84
+ },
85
+ selected
86
+ ? (theme) => ({
87
+ background: theme.lighten(
88
+ theme.vars.palette.primary.main,
89
+ 1 - theme.vars.palette.action.hoverOpacity,
90
+ ),
91
+ border: '1px solid transparent',
92
+ ...theme.applyStyles('dark', {
93
+ background: theme.lighten(
94
+ theme.vars.palette.background.default,
95
+ theme.vars.palette.action.hoverOpacity,
96
+ ),
97
+ }),
98
+ '&.MuiChip-clickable:hover': {
99
+ background: theme.lighten(
100
+ theme.vars.palette.primary.main,
101
+ 1 - theme.vars.palette.action.hoverOpacity * 2,
102
+ ),
92
103
  border: '1px solid transparent',
93
- '&.MuiChip-clickable:hover': {
94
- background:
95
- theme.palette.mode === 'light'
96
- ? lighten(
97
- theme.palette.primary.main,
98
- 1 - theme.palette.action.hoverOpacity * 2,
99
- )
100
- : lighten(
101
- theme.palette.background.default,
102
- theme.palette.action.hoverOpacity * 2,
103
- ),
104
- border: '1px solid transparent',
105
- },
106
- }
107
- : {}),
108
- }),
109
- ...(Array.isArray(chipSx) ? chipSx : [chipSx]),
110
- ...(Array.isArray(sx) ? sx : [sx]),
111
- ]}
104
+ ...theme.applyStyles('dark', {
105
+ background: theme.lighten(
106
+ theme.vars.palette.background.default,
107
+ theme.vars.palette.action.hoverOpacity * 2,
108
+ ),
109
+ }),
110
+ },
111
+ })
112
+ : {},
113
+ chipSx,
114
+ sx,
115
+ )}
112
116
  />
113
117
  <OverlayOrPopperPanel
114
118
  {...panelProps}
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import { Overlay } from '../Overlay/components/Overlay'
2
3
  import type { OverlayProps } from '../Overlay/components/OverlaySsr'
3
4
  import { nonNullable } from '../RenderType/nonNullable'
@@ -16,17 +17,15 @@ export function OverlayPanel(props: OverlayPanelProps) {
16
17
  {...overlayProps}
17
18
  onClosed={onClose}
18
19
  active={Boolean(activeEl)}
19
- sx={[
20
+ sx={sxx(
20
21
  {
21
22
  '& .LayoutOverlayBase-overlayPane': {
22
23
  display: 'grid',
23
24
  gridTemplateRows: 'min-content auto min-content',
24
25
  },
25
26
  },
26
- ...(Array.isArray(overlayProps?.sx) ? overlayProps.sx : [overlayProps?.sx]).filter(
27
- nonNullable,
28
- ),
29
- ]}
27
+ overlayProps?.sx,
28
+ )}
30
29
  >
31
30
  {() => (
32
31
  <OverlayPanelActions onClose={onClose} {...rest}>
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import { t } from '@lingui/core/macro'
2
3
  import { Trans } from '@lingui/react/macro'
3
4
  import { Box, Button, Fab, Typography } from '@mui/material'
@@ -24,7 +25,7 @@ export function OverlayPanelActions(props: PanelActionsProps) {
24
25
  <>
25
26
  <LayoutOverlayHeader
26
27
  noAlign
27
- sx={[{ '&.noAlign': { mb: 0 } }, ...(Array.isArray(sx) ? sx : [sx])]}
28
+ sx={sxx({ '&.noAlign': { mb: 0 } }, sx)}
28
29
  switchPoint={-10000}
29
30
  size='small'
30
31
  primary={
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import { t } from '@lingui/core/macro'
2
3
  import { Trans } from '@lingui/react/macro'
3
4
  import { Box, Button, Fab, Typography } from '@mui/material'
@@ -18,7 +19,7 @@ export function PopperPanelActions(props: PanelActionsProps) {
18
19
  <>
19
20
  <LayoutHeader
20
21
  noAlign
21
- sx={[{ '&.noAlign': { mb: 0 } }, ...(Array.isArray(sx) ? sx : [sx])]}
22
+ sx={sxx({ '&.noAlign': { mb: 0 } }, sx)}
22
23
  switchPoint={-10000}
23
24
  size='small'
24
25
  primary={
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import { Trans } from '@lingui/react/macro'
2
3
  import type { PaginationProps, SxProps, Theme } from '@mui/material'
3
4
  import { Box, IconButton } from '@mui/material'
@@ -64,7 +65,7 @@ export function Pagination(props: PagePaginationProps) {
64
65
  return (
65
66
  <Box
66
67
  className={classes.root}
67
- sx={[
68
+ sx={sxx(
68
69
  (theme) => ({
69
70
  margin: '0 auto',
70
71
  marginTop: theme.spacings.lg,
@@ -77,17 +78,19 @@ export function Pagination(props: PagePaginationProps) {
77
78
  background: 'none',
78
79
  },
79
80
  }),
80
- ...(Array.isArray(sx) ? sx : [sx]),
81
- ]}
81
+ sx,
82
+ )}
82
83
  >
83
84
  {page === 1 ? chevronLeft : renderLink(page - 1, chevronLeft, prevBtnProps)}
84
-
85
- <Box typography='body1'>
85
+ <Box
86
+ sx={{
87
+ typography: 'body1',
88
+ }}
89
+ >
86
90
  <Trans>
87
91
  Page {page} of {max}
88
92
  </Trans>
89
93
  </Box>
90
-
91
94
  {page === count ? chevronRight : renderLink(page + 1, chevronRight, nextBtnProps)}
92
95
  </Box>
93
96
  )
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { PaginationProps, PaginationRenderItemParams, SxProps, Theme } from '@mui/material'
2
3
  import { Box, Pagination, PaginationItem } from '@mui/material'
3
4
  import { iconChevronLeft, iconChevronRight } from '../icons'
@@ -45,7 +46,7 @@ export function PaginationExtended(props: PaginationExtendedProps) {
45
46
  return (
46
47
  <Box
47
48
  className={classes.root}
48
- sx={[
49
+ sx={sxx(
49
50
  (theme) => ({
50
51
  margin: '0 auto',
51
52
  marginTop: theme.spacings.lg,
@@ -69,8 +70,8 @@ export function PaginationExtended(props: PaginationExtendedProps) {
69
70
  },
70
71
  },
71
72
  }),
72
- ...(Array.isArray(sx) ? sx : [sx]),
73
- ]}
73
+ sx,
74
+ )}
74
75
  >
75
76
  <Pagination
76
77
  count={count}
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { SxProps, Theme } from '@mui/material'
2
3
  import { Box, Typography } from '@mui/material'
3
4
  import React from 'react'
@@ -29,21 +30,19 @@ export function ButtonLinkList(props: ButtonLinkListProps) {
29
30
  return (
30
31
  <Row maxWidth='820px' className={classes.root} sx={sx}>
31
32
  <Box
32
- sx={[
33
- (theme) => ({
34
- position: 'relative',
35
- '&:focus': {
36
- outline: 'none',
37
- },
38
- display: 'flex',
39
- justifyContent: 'space-between',
40
- alignItems: 'center',
41
- marginTop: theme.spacings.sm,
42
- marginBottom: theme.spacings.xxs,
43
- paddingBottom: theme.spacings.xxs,
44
- borderBottom: `1px solid ${theme.palette.divider}`,
45
- }),
46
- ]}
33
+ sx={sxx((theme) => ({
34
+ position: 'relative',
35
+ '&:focus': {
36
+ outline: 'none',
37
+ },
38
+ display: 'flex',
39
+ justifyContent: 'space-between',
40
+ alignItems: 'center',
41
+ marginTop: theme.spacings.sm,
42
+ marginBottom: theme.spacings.xxs,
43
+ paddingBottom: theme.spacings.xxs,
44
+ borderBottom: `1px solid ${theme.vars.palette.divider}`,
45
+ }))}
47
46
  >
48
47
  <Typography variant='overline' color='textSecondary' component={component}>
49
48
  {title}
@@ -24,7 +24,7 @@ export function ButtonLinkListItem(props: ButtonLinkListItemProps) {
24
24
  href={url}
25
25
  sx={(theme) => ({
26
26
  padding: `${theme.spacings.xxs} 0`,
27
- borderBottom: `1px solid ${theme.palette.divider}`,
27
+ borderBottom: `1px solid ${theme.vars.palette.divider}`,
28
28
  justifyContent: 'space-between',
29
29
  })}
30
30
  {...listItemButtonProps}
@@ -1,3 +1,4 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { ContainerProps } from '@mui/material'
2
3
  import { Box } from '@mui/material'
3
4
  import React from 'react'
@@ -21,7 +22,7 @@ export function ColumnThree(props: ColumnThreeProps) {
21
22
  <Row
22
23
  className={classes.root}
23
24
  {...containerProps}
24
- sx={[
25
+ sx={sxx(
25
26
  (theme) => ({
26
27
  display: 'grid',
27
28
  gridColumnGap: theme.spacings.md,
@@ -55,8 +56,8 @@ export function ColumnThree(props: ColumnThreeProps) {
55
56
  gridTemplateAreas: '"one two three"',
56
57
  },
57
58
  }),
58
- ...(Array.isArray(sx) ? sx : [sx]),
59
- ]}
59
+ sx,
60
+ )}
60
61
  >
61
62
  <Box className={classes.colOne} sx={{ gridArea: 'one' }}>
62
63
  {colOneContent}