@graphcommerce/next-ui 10.0.0-canary.67 → 10.0.0-canary.72
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.
- package/ActionCard/ActionCard.tsx +30 -21
- package/ActionCard/ActionCardAccordion.tsx +2 -2
- package/ActionCard/ActionCardLayout.tsx +4 -3
- package/ActionCard/ActionCardList.tsx +13 -6
- package/Blog/BlogAuthor/BlogAuthor.tsx +9 -7
- package/Blog/BlogContent/BlogContent.tsx +7 -4
- package/Blog/BlogHeader/BlogHeader.tsx +7 -4
- package/Blog/BlogList/BlogList.tsx +4 -3
- package/Blog/BlogListItem/BlogListItem.tsx +6 -5
- package/Blog/BlogTags/BlogTag.tsx +2 -4
- package/Blog/BlogTitle/BlogTitle.tsx +2 -6
- package/Breadcrumbs/Breadcrumbs.tsx +24 -38
- package/Breadcrumbs/BreadcrumbsList.tsx +9 -9
- package/Button/Button.tsx +4 -4
- package/Button/LinkOrButton.tsx +8 -7
- package/CHANGELOG.md +26 -0
- package/ChipMenu/ChipMenu.tsx +5 -5
- package/Container/Container.tsx +4 -4
- package/Fab/Fab.tsx +1 -1
- package/Footer/Footer.tsx +5 -5
- package/Form/Form.tsx +6 -6
- package/Form/FormDivider.tsx +1 -1
- package/Form/InputCheckmark.tsx +2 -1
- package/FramerScroller/SidebarGallery.tsx +43 -34
- package/FullPageMessage/FullPageMessage.tsx +13 -4
- package/IconHeader/IconHeader.tsx +22 -8
- package/IconSvg/IconSvg.tsx +1 -1
- package/Layout/components/LayoutHeader.tsx +7 -6
- package/Layout/components/LayoutHeaderBack.tsx +0 -2
- package/Layout/components/LayoutHeaderContent.tsx +22 -18
- package/Layout/components/LayoutTitle.tsx +4 -3
- package/LayoutDefault/components/LayoutDefault.tsx +5 -4
- package/LayoutOverlay/components/LayoutOverlayHeader.tsx +4 -3
- package/LayoutOverlay/components/LayoutOverlayHeader2.tsx +3 -9
- package/LayoutParts/DesktopHeaderBadge.tsx +4 -3
- package/LayoutParts/DesktopNavBar.tsx +10 -11
- package/LayoutParts/DesktopNavBarItem.tsx +22 -16
- package/LayoutParts/GlobalHead.tsx +1 -1
- package/LayoutParts/Logo.tsx +2 -1
- package/LayoutParts/MenuFab.tsx +36 -14
- package/LayoutParts/MenuFabItem.tsx +2 -1
- package/LayoutParts/MenuFabSecondaryItem.tsx +6 -3
- package/LayoutParts/PlaceholderFab.tsx +2 -1
- package/LayoutParts/StickyBelowHeader.tsx +4 -3
- package/MediaQuery/MediaQuery.tsx +2 -4
- package/Navigation/components/NavigationFab.tsx +31 -11
- package/Navigation/components/NavigationItem.tsx +14 -10
- package/Navigation/components/NavigationOverlay.tsx +39 -20
- package/Overlay/components/Overlay.tsx +10 -3
- package/Overlay/components/OverlayBase.tsx +21 -23
- package/Overlay/components/OverlayContainer.tsx +40 -14
- package/Overlay/components/OverlayHeader.tsx +2 -1
- package/Overlay/components/OverlayStickyBottom.tsx +2 -5
- package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +35 -31
- package/OverlayOrPopperChip/OverlayPanel.tsx +4 -5
- package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -1
- package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -1
- package/Page/types.ts +1 -4
- package/Pagination/Pagination.tsx +9 -6
- package/Pagination/PaginationExtended.tsx +4 -3
- package/RenderType/RenderType.tsx +8 -5
- package/Row/ButtonLinkList/ButtonLinkList.tsx +14 -15
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +1 -1
- package/Row/ColumnThree/ColumnThree.tsx +4 -3
- package/Row/ColumnTwo/ColumnTwo.tsx +16 -5
- package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +15 -4
- package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +22 -6
- package/Row/ContentLinks/ContentLinks.tsx +4 -3
- package/Row/HeroBanner/HeroBanner.tsx +3 -7
- package/Row/IconBlocks/IconBlock.tsx +4 -3
- package/Row/IconBlocks/IconBlocks.tsx +2 -1
- package/Row/ImageText/ImageText.tsx +5 -5
- package/Row/ImageTextBoxed/ImageTextBoxed.tsx +2 -2
- package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +1 -1
- package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +4 -3
- package/Row/RowLinks/variant/VariantInline.tsx +2 -4
- package/Row/RowLinks/variant/VariantLogoSwiper.tsx +4 -3
- package/Row/RowLinks/variant/VariantUsps.tsx +4 -3
- package/Row/SpecialBanner/SpecialBanner.tsx +2 -2
- package/SectionContainer/SectionContainer.tsx +6 -5
- package/SectionHeader/SectionHeader.tsx +4 -3
- package/Separator/Separator.tsx +4 -3
- package/SkipLink/SkipLink.tsx +2 -2
- package/Snackbar/MessageSnackbarImpl.tsx +22 -10
- package/StarRatingField/StarRatingField.tsx +1 -1
- package/Stepper/Stepper.tsx +6 -5
- package/Styles/withTheme.tsx +11 -9
- package/Tabs/TabItem.tsx +4 -5
- package/TextInputNumber/TextInputNumber.tsx +76 -50
- package/Theme/DarkLightModeThemeProvider.tsx +41 -88
- package/Theme/MuiButton.ts +23 -22
- package/Theme/MuiChip.ts +12 -13
- package/Theme/MuiFab.ts +5 -5
- package/Theme/MuiSlider.ts +5 -5
- package/Theme/createTheme.ts +1 -3
- package/Theme/themeDefaults.ts +1 -1
- package/ToggleButton/ToggleButton.tsx +10 -11
- package/ToggleButtonGroup/ToggleButtonGroup.tsx +4 -3
- package/UspList/UspList.tsx +4 -3
- package/UspList/UspListItem.tsx +4 -3
- package/package.json +15 -15
- package/types.ts +1 -0
- 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
|
-
|
|
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
|
-
|
|
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
|
/>
|
|
@@ -5,20 +5,27 @@ import type { SetOptional } from 'type-fest'
|
|
|
5
5
|
import { variantsToScrollSnapType } from '../utils/variantsToScrollSnapType'
|
|
6
6
|
import type { LayoutOverlayBaseProps } from './OverlayBase'
|
|
7
7
|
import { OverlayBase } from './OverlayBase'
|
|
8
|
+
import type { OverlayContainerProps } from './OverlayContainer'
|
|
8
9
|
import { OverlayContainer } from './OverlayContainer'
|
|
9
10
|
|
|
10
11
|
export type OverlayTmpProps = Omit<
|
|
11
12
|
SetOptional<LayoutOverlayBaseProps, 'variantSm' | 'variantMd'>,
|
|
12
13
|
'offsetPageY' | 'isPresent' | 'safeToRemove'
|
|
13
|
-
>
|
|
14
|
+
> & { overlayContainerProps?: Partial<OverlayContainerProps> }
|
|
14
15
|
|
|
15
16
|
function OverlayUsePresence(props: OverlayTmpProps) {
|
|
16
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
variantSm = 'bottom',
|
|
19
|
+
variantMd = 'right',
|
|
20
|
+
active,
|
|
21
|
+
overlayContainerProps,
|
|
22
|
+
...otherProps
|
|
23
|
+
} = props
|
|
17
24
|
const [isPresent, safeToRemove] = usePresence()
|
|
18
25
|
|
|
19
26
|
return (
|
|
20
27
|
<Portal>
|
|
21
|
-
<OverlayContainer active={active}>
|
|
28
|
+
<OverlayContainer active={active} {...overlayContainerProps}>
|
|
22
29
|
<ScrollerProvider {...variantsToScrollSnapType(props)}>
|
|
23
30
|
<OverlayBase
|
|
24
31
|
active={active}
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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,30 +1,56 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
|
+
import type { BoxProps } from '@mui/material'
|
|
1
3
|
import { Box } from '@mui/material'
|
|
2
4
|
import type { LayoutOverlayBaseProps } from './OverlayBase'
|
|
3
5
|
|
|
4
6
|
export type OverlayContainerProps = Pick<LayoutOverlayBaseProps, 'active'> & {
|
|
5
7
|
hidden?: boolean
|
|
6
8
|
children: React.ReactNode
|
|
7
|
-
}
|
|
9
|
+
} & BoxProps
|
|
8
10
|
|
|
9
11
|
export function OverlayContainer(props: OverlayContainerProps) {
|
|
10
|
-
const { children, active, hidden } = props
|
|
12
|
+
const { children, active, hidden, sx, ...rest } = props
|
|
11
13
|
|
|
12
14
|
return (
|
|
13
15
|
<Box
|
|
14
16
|
className='Overlay'
|
|
15
|
-
sx={
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
zIndex: 'drawer',
|
|
24
|
-
'& .LayoutOverlayBase-overlayPane': {
|
|
25
|
-
boxShadow: active ? undefined : 0,
|
|
17
|
+
sx={sxx(
|
|
18
|
+
{
|
|
19
|
+
position: 'fixed',
|
|
20
|
+
top: 0,
|
|
21
|
+
left: 0,
|
|
22
|
+
right: 0,
|
|
23
|
+
bottom: 0,
|
|
24
|
+
zIndex: 'drawer',
|
|
26
25
|
},
|
|
27
|
-
|
|
26
|
+
hidden
|
|
27
|
+
? {
|
|
28
|
+
transform: 'translateX(-200vw)',
|
|
29
|
+
}
|
|
30
|
+
: {
|
|
31
|
+
transform: null,
|
|
32
|
+
},
|
|
33
|
+
active
|
|
34
|
+
? {
|
|
35
|
+
pointerEvents: null,
|
|
36
|
+
}
|
|
37
|
+
: {
|
|
38
|
+
pointerEvents: 'none',
|
|
39
|
+
},
|
|
40
|
+
active
|
|
41
|
+
? {
|
|
42
|
+
'& .LayoutOverlayBase-overlayPane': {
|
|
43
|
+
boxShadow: null,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
: {
|
|
47
|
+
'& .LayoutOverlayBase-overlayPane': {
|
|
48
|
+
boxShadow: 0,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
sx,
|
|
52
|
+
)}
|
|
53
|
+
{...rest}
|
|
28
54
|
>
|
|
29
55
|
{children}
|
|
30
56
|
</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={
|
|
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,
|
|
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
|
-
|
|
79
|
+
sx={sxx(
|
|
80
|
+
{
|
|
80
81
|
'& .MuiChip-deleteIcon': {
|
|
81
82
|
ml: '0px',
|
|
82
83
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
'
|
|
94
|
-
background:
|
|
95
|
-
theme.palette.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
27
|
-
|
|
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={
|
|
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={
|
|
22
|
+
sx={sxx({ '&.noAlign': { mb: 0 } }, sx)}
|
|
22
23
|
switchPoint={-10000}
|
|
23
24
|
size='small'
|
|
24
25
|
primary={
|
package/Page/types.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { ParsedUrlQuery } from 'querystring'
|
|
2
2
|
import type { UpPage } from '@graphcommerce/framer-next-pages'
|
|
3
|
-
// todo: remove references to GraphQL
|
|
4
|
-
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
|
-
import type { NormalizedCacheObject } from '@graphcommerce/graphql'
|
|
6
3
|
import type {
|
|
7
4
|
GetServerSideProps as GetServerSidePropsNext,
|
|
8
5
|
GetStaticProps as GetStaticPropsNext,
|
|
@@ -10,7 +7,7 @@ import type {
|
|
|
10
7
|
|
|
11
8
|
type AnyObj = Record<string, unknown>
|
|
12
9
|
|
|
13
|
-
export type ApolloStateProps = { apolloState:
|
|
10
|
+
export type ApolloStateProps = { apolloState: unknown; up?: UpPage | null }
|
|
14
11
|
|
|
15
12
|
export type GetStaticProps<
|
|
16
13
|
PL extends AnyObj,
|
|
@@ -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
|
-
|
|
81
|
-
|
|
81
|
+
sx,
|
|
82
|
+
)}
|
|
82
83
|
>
|
|
83
84
|
{page === 1 ? chevronLeft : renderLink(page - 1, chevronLeft, prevBtnProps)}
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
73
|
-
|
|
73
|
+
sx,
|
|
74
|
+
)}
|
|
74
75
|
>
|
|
75
76
|
<Pagination
|
|
76
77
|
count={count}
|