@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.
- 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 +8 -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 +0 -6
- 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/OverlayBase.tsx +21 -23
- package/Overlay/components/OverlayContainer.tsx +35 -12
- 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/Pagination/Pagination.tsx +9 -6
- package/Pagination/PaginationExtended.tsx +4 -3
- 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 +6 -5
- 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 +10 -10
- package/types.ts +1 -0
- package/utils/sxx.ts +1 -1
package/Container/Container.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import type { LiteralUnion } from 'type-fest'
|
|
|
5
5
|
import { extendableComponent } from '../Styles/extendableComponent'
|
|
6
6
|
import type { ContainerSizingVariant } from '../Theme/useContainerSizing'
|
|
7
7
|
import { useContainerSizing } from '../Theme/useContainerSizing'
|
|
8
|
+
import { sxx } from '../utils/sxx'
|
|
8
9
|
|
|
9
10
|
type OwnerProps = {
|
|
10
11
|
/** Can be a breakpoint, 'full' or a actual value */
|
|
@@ -74,19 +75,18 @@ export const Container = React.forwardRef(
|
|
|
74
75
|
{...rest}
|
|
75
76
|
ref={ref}
|
|
76
77
|
className={[className, classes.root].filter((v) => !!v).join(' ')}
|
|
77
|
-
sx={
|
|
78
|
+
sx={sxx(
|
|
78
79
|
{
|
|
79
80
|
width: '100%',
|
|
80
81
|
pl: !breakoutLeft ? padding : undefined,
|
|
81
82
|
pr: !breakoutRight ? padding : undefined,
|
|
82
83
|
'&.breakoutLeft': { pl: 'unset' },
|
|
83
84
|
'&.breakoutRight': { pr: 'unset' },
|
|
84
|
-
|
|
85
85
|
// Nesting containers will not have padding applied.
|
|
86
86
|
'.MuiContainer-root &': { pl: 0, pr: 0 },
|
|
87
87
|
},
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
sx,
|
|
89
|
+
)}
|
|
90
90
|
/>
|
|
91
91
|
)
|
|
92
92
|
},
|
package/Fab/Fab.tsx
CHANGED
|
@@ -36,7 +36,7 @@ export function Fab(props: FabProps) {
|
|
|
36
36
|
size={size}
|
|
37
37
|
{...fabProps}
|
|
38
38
|
disabled={disabled}
|
|
39
|
-
sx={
|
|
39
|
+
sx={sxx({ display: 'grid' }, sx)}
|
|
40
40
|
>
|
|
41
41
|
<Box sx={{ display: 'flex', placeContent: 'center', gridArea: '1/1' }}>
|
|
42
42
|
<IconSvg src={icon} size='medium' {...slotProps?.icon} />
|
package/Footer/Footer.tsx
CHANGED
|
@@ -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'
|
|
@@ -37,10 +38,10 @@ export function Footer(props: FooterProps) {
|
|
|
37
38
|
<Container
|
|
38
39
|
maxWidth={false}
|
|
39
40
|
sizing='shell'
|
|
40
|
-
sx={
|
|
41
|
+
sx={sxx(
|
|
41
42
|
(theme) => ({
|
|
42
43
|
gridTemplateColumns: '5fr 3fr',
|
|
43
|
-
borderTop: `1px solid ${theme.palette.divider}`,
|
|
44
|
+
borderTop: `1px solid ${theme.vars.palette.divider}`,
|
|
44
45
|
display: 'grid',
|
|
45
46
|
alignItems: 'center',
|
|
46
47
|
pt: theme.spacings.lg,
|
|
@@ -54,7 +55,6 @@ export function Footer(props: FooterProps) {
|
|
|
54
55
|
`,
|
|
55
56
|
gap: theme.spacings.md,
|
|
56
57
|
'& > *': { maxWidth: 'max-content' },
|
|
57
|
-
|
|
58
58
|
[theme.breakpoints.up('md')]: {
|
|
59
59
|
gap: theme.spacings.sm,
|
|
60
60
|
gridTemplateAreas: `
|
|
@@ -68,8 +68,8 @@ export function Footer(props: FooterProps) {
|
|
|
68
68
|
justifyContent: 'space-between',
|
|
69
69
|
},
|
|
70
70
|
}),
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
sx,
|
|
72
|
+
)}
|
|
73
73
|
className={classes.root}
|
|
74
74
|
{...containerProps}
|
|
75
75
|
>
|
package/Form/Form.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Theme } from '@mui/material'
|
|
2
|
-
import {
|
|
2
|
+
import { styled } from '@mui/material'
|
|
3
3
|
import { breakpointVal } from '../Styles/breakpointVal'
|
|
4
4
|
|
|
5
5
|
type FormStyleProps = {
|
|
@@ -15,13 +15,13 @@ const styles = ({ theme, contained = false, background }: { theme: Theme } & For
|
|
|
15
15
|
padding: `${theme.spacings.xxs} 0`,
|
|
16
16
|
},
|
|
17
17
|
background === 'default' && {
|
|
18
|
-
background:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
background: theme.darken(theme.vars.palette.background.default, 0.03),
|
|
19
|
+
...theme.applyStyles('dark', {
|
|
20
|
+
background: theme.lighten(theme.vars.palette.background.default, 0.1),
|
|
21
|
+
}),
|
|
22
22
|
},
|
|
23
23
|
background === 'secondary' && {
|
|
24
|
-
background: theme.palette.secondary.light,
|
|
24
|
+
background: theme.vars.palette.secondary.light,
|
|
25
25
|
},
|
|
26
26
|
contained && {
|
|
27
27
|
padding: `${theme.spacings.xxs} ${theme.spacings.sm}`,
|
package/Form/FormDivider.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from '@mui/material'
|
|
2
2
|
|
|
3
3
|
export const FormDivider = styled('div', { name: 'FormDivider' })(({ theme }) => ({
|
|
4
|
-
background: theme.palette.divider,
|
|
4
|
+
background: theme.vars.palette.divider,
|
|
5
5
|
height: 1,
|
|
6
6
|
width: '100%',
|
|
7
7
|
marginTop: theme.spacings.xxs,
|
package/Form/InputCheckmark.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import { iconCheckmark } from '../icons'
|
|
2
3
|
import type { IconSvgProps } from '../IconSvg'
|
|
3
4
|
import { IconSvg } from '../IconSvg'
|
|
@@ -24,7 +25,7 @@ export function InputCheckmark(props: InputCheckmarkProps) {
|
|
|
24
25
|
<IconSvg
|
|
25
26
|
src={iconCheckmark}
|
|
26
27
|
className='InputCheckmark'
|
|
27
|
-
sx={
|
|
28
|
+
sx={sxx({ stroke: '#01D26A' }, select && { marginRight: '15px' })}
|
|
28
29
|
/>
|
|
29
30
|
)
|
|
30
31
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from '@graphcommerce/framer-scroller'
|
|
12
12
|
import { dvh } from '@graphcommerce/framer-utils'
|
|
13
13
|
import { sidebarGallery } from '@graphcommerce/next-config/config'
|
|
14
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
14
15
|
import type { SxProps, Theme } from '@mui/material'
|
|
15
16
|
import { Box, Fab, styled, Unstable_TrapFocus as TrapFocus, useTheme } from '@mui/material'
|
|
16
17
|
import { m, useDomEvent, useMotionValue } from 'framer-motion'
|
|
@@ -148,50 +149,52 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
148
149
|
disableGutters
|
|
149
150
|
className={classes.row}
|
|
150
151
|
breakoutLeft={variantMd === 'default' && !theme.appShell.containerSizingContent}
|
|
151
|
-
sx={
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
sx={sxx(
|
|
153
|
+
(theme) => ({
|
|
154
|
+
bgcolor: 'background.paper',
|
|
155
|
+
...theme.applyStyles('light', {
|
|
156
|
+
bgcolor: 'background.image',
|
|
157
|
+
}),
|
|
158
|
+
}),
|
|
159
|
+
sx,
|
|
160
|
+
)}
|
|
155
161
|
>
|
|
156
162
|
<MotionBox
|
|
157
163
|
layout
|
|
158
164
|
layoutDependency={zoomed}
|
|
159
165
|
className={classes.root}
|
|
160
|
-
sx={
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
gridTemplate: `"left right" / 1fr ${sidebarSize}`,
|
|
168
|
-
},
|
|
166
|
+
sx={(theme) => ({
|
|
167
|
+
willChange: 'transform',
|
|
168
|
+
display: 'grid',
|
|
169
|
+
gridTemplate: '"left" "right"',
|
|
170
|
+
[theme.breakpoints.up('md')]: {
|
|
171
|
+
'&:not(.variantMdOneColumn)': {
|
|
172
|
+
gridTemplate: `"left right" / 1fr ${sidebarSize}`,
|
|
169
173
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
px: 0,
|
|
174
|
+
},
|
|
175
|
+
'&.zoomed': {
|
|
176
|
+
position: 'relative',
|
|
177
|
+
zIndex: theme.zIndex.modal,
|
|
178
|
+
marginTop: `calc(${theme.appShell.headerHeightSm} * -1)`,
|
|
179
|
+
[theme.breakpoints.up('md')]: {
|
|
180
|
+
marginTop: `calc(${theme.appShell.headerHeightMd} * -1 - ${theme.spacings.lg})`,
|
|
181
|
+
gridTemplateColumns: '1fr auto',
|
|
180
182
|
},
|
|
183
|
+
px: 0,
|
|
181
184
|
},
|
|
182
|
-
|
|
185
|
+
})}
|
|
183
186
|
>
|
|
184
187
|
<TrapFocus open={zoomed}>
|
|
185
188
|
<MotionBox
|
|
186
189
|
layout
|
|
187
190
|
layoutDependency={zoomed}
|
|
188
191
|
className={classes.scrollerContainer}
|
|
189
|
-
sx={
|
|
192
|
+
sx={sxx(
|
|
190
193
|
{
|
|
191
194
|
gridArea: 'left',
|
|
192
195
|
willChange: 'transform',
|
|
193
196
|
height: 0, // https://stackoverflow.com/questions/44770074/css-grid-row-height-safari-bug
|
|
194
|
-
backgroundColor: theme.palette.background.image,
|
|
197
|
+
backgroundColor: theme.vars.palette.background.image,
|
|
195
198
|
position: 'relative',
|
|
196
199
|
paddingTop: `min(${ratio}, ${maxHeight})`,
|
|
197
200
|
[theme.breakpoints.down('md')]: {
|
|
@@ -213,7 +216,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
213
216
|
marginTop: 0,
|
|
214
217
|
paddingTop: dvh(100),
|
|
215
218
|
},
|
|
216
|
-
|
|
219
|
+
)}
|
|
217
220
|
onLayoutAnimationComplete={() => {
|
|
218
221
|
if (!zoomed) document.body.style.overflow = ''
|
|
219
222
|
}}
|
|
@@ -224,7 +227,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
224
227
|
hideScrollbar
|
|
225
228
|
onMouseDown={onMouseDownScroller}
|
|
226
229
|
onMouseUp={onMouseUpScroller}
|
|
227
|
-
sx={
|
|
230
|
+
sx={sxx(
|
|
228
231
|
{
|
|
229
232
|
willChange: 'transform',
|
|
230
233
|
position: 'absolute',
|
|
@@ -233,13 +236,19 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
233
236
|
height: '100%',
|
|
234
237
|
gridAutoColumns: '100%',
|
|
235
238
|
gridTemplateRows: '100%',
|
|
236
|
-
cursor: disableZoom ? 'auto' : 'zoom-in',
|
|
237
239
|
},
|
|
240
|
+
disableZoom
|
|
241
|
+
? {
|
|
242
|
+
cursor: 'auto',
|
|
243
|
+
}
|
|
244
|
+
: {
|
|
245
|
+
cursor: 'zoom-in',
|
|
246
|
+
},
|
|
238
247
|
zoomed && {
|
|
239
248
|
height: 'var(--client-size-y)',
|
|
240
249
|
cursor: 'inherit',
|
|
241
250
|
},
|
|
242
|
-
|
|
251
|
+
)}
|
|
243
252
|
>
|
|
244
253
|
{images.map((image, idx) => (
|
|
245
254
|
<MotionImageAspect
|
|
@@ -361,7 +370,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
361
370
|
</TrapFocus>
|
|
362
371
|
<Box
|
|
363
372
|
className={classes.sidebarWrapper}
|
|
364
|
-
sx={
|
|
373
|
+
sx={sxx(
|
|
365
374
|
{
|
|
366
375
|
width: { xs: '100%', md: sidebarSize },
|
|
367
376
|
gridArea: 'right',
|
|
@@ -381,13 +390,13 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
381
390
|
} * 2)`,
|
|
382
391
|
},
|
|
383
392
|
},
|
|
384
|
-
|
|
393
|
+
)}
|
|
385
394
|
>
|
|
386
395
|
<MotionBox
|
|
387
396
|
layout='position'
|
|
388
397
|
layoutDependency={zoomed}
|
|
389
398
|
className={classes.sidebar}
|
|
390
|
-
sx={{
|
|
399
|
+
sx={(theme) => ({
|
|
391
400
|
boxSizing: 'border-box',
|
|
392
401
|
width: '100%',
|
|
393
402
|
'&:not(.variantMdOneColumn)': {
|
|
@@ -396,7 +405,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
396
405
|
paddingLeft: theme.spacings.lg,
|
|
397
406
|
},
|
|
398
407
|
},
|
|
399
|
-
}}
|
|
408
|
+
})}
|
|
400
409
|
>
|
|
401
410
|
{sidebar}
|
|
402
411
|
</MotionBox>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
2
3
|
import { Box, Container, Typography } from '@mui/material'
|
|
3
4
|
import React from 'react'
|
|
@@ -29,7 +30,7 @@ export function FullPageMessage(props: FullPageMessageProps) {
|
|
|
29
30
|
return (
|
|
30
31
|
<Box
|
|
31
32
|
className={classes.root}
|
|
32
|
-
sx={
|
|
33
|
+
sx={sxx(
|
|
33
34
|
(theme) => ({
|
|
34
35
|
alignItems: 'center',
|
|
35
36
|
marginTop: theme.spacings.md,
|
|
@@ -39,8 +40,8 @@ export function FullPageMessage(props: FullPageMessageProps) {
|
|
|
39
40
|
marginTop: responsiveVal(50, 250),
|
|
40
41
|
marginBottom: responsiveVal(50, 250),
|
|
41
42
|
},
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
sx,
|
|
44
|
+
)}
|
|
44
45
|
>
|
|
45
46
|
<Container
|
|
46
47
|
maxWidth='md'
|
|
@@ -60,7 +61,15 @@ export function FullPageMessage(props: FullPageMessageProps) {
|
|
|
60
61
|
<Typography variant='h3' gutterBottom>
|
|
61
62
|
{title}
|
|
62
63
|
</Typography>
|
|
63
|
-
{children &&
|
|
64
|
+
{children && (
|
|
65
|
+
<Box
|
|
66
|
+
sx={{
|
|
67
|
+
typography: 'body1',
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</Box>
|
|
72
|
+
)}
|
|
64
73
|
</Box>
|
|
65
74
|
|
|
66
75
|
<Box className={classes.button} sx={(theme) => ({ marginTop: theme.spacings.sm })}>
|
|
@@ -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 type { IconSvgProps } from '../IconSvg'
|
|
@@ -49,7 +50,7 @@ export function IconHeader(props: IconHeaderProps) {
|
|
|
49
50
|
return (
|
|
50
51
|
<Box
|
|
51
52
|
className={classes.root}
|
|
52
|
-
sx={
|
|
53
|
+
sx={sxx(
|
|
53
54
|
{
|
|
54
55
|
typography: 'subtitle1',
|
|
55
56
|
textAlign: 'center',
|
|
@@ -59,19 +60,32 @@ export function IconHeader(props: IconHeaderProps) {
|
|
|
59
60
|
marginTop: theme.spacings.sm,
|
|
60
61
|
marginBottom: theme.spacings.sm,
|
|
61
62
|
})),
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
sx,
|
|
64
|
+
)}
|
|
64
65
|
>
|
|
65
66
|
<Box
|
|
66
67
|
className={`${classes.innerContainer} ${!stayInline ? classes.breakColumnsDesktop : ''}`}
|
|
67
|
-
sx={
|
|
68
|
+
sx={sxx(
|
|
68
69
|
{
|
|
69
|
-
display: {
|
|
70
|
+
display: {
|
|
71
|
+
xs: 'flex',
|
|
72
|
+
},
|
|
70
73
|
alignItems: 'center',
|
|
71
74
|
justifyContent: 'center',
|
|
72
75
|
gap: 4,
|
|
73
76
|
},
|
|
74
|
-
|
|
77
|
+
stayInline
|
|
78
|
+
? {
|
|
79
|
+
display: {
|
|
80
|
+
md: 'flex',
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
: {
|
|
84
|
+
display: {
|
|
85
|
+
md: 'unset',
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
)}
|
|
75
89
|
>
|
|
76
90
|
<IconSvg src={src} />
|
|
77
91
|
<Typography
|
|
@@ -80,14 +94,14 @@ export function IconHeader(props: IconHeaderProps) {
|
|
|
80
94
|
className={`${ellipsis ? classes.ellipsis : ''} ${
|
|
81
95
|
size === 'medium' ? classes.mediumFontWeight : ''
|
|
82
96
|
}`}
|
|
83
|
-
sx={
|
|
97
|
+
sx={sxx(
|
|
84
98
|
ellipsis && {
|
|
85
99
|
whiteSpace: 'nowrap',
|
|
86
100
|
overflow: 'hidden',
|
|
87
101
|
textOverflow: 'ellipsis',
|
|
88
102
|
},
|
|
89
103
|
size === 'medium' && { fontWeight: 'bold' },
|
|
90
|
-
|
|
104
|
+
)}
|
|
91
105
|
>
|
|
92
106
|
{children}
|
|
93
107
|
</Typography>
|
package/IconSvg/IconSvg.tsx
CHANGED
|
@@ -18,7 +18,7 @@ type StyleProps = {
|
|
|
18
18
|
const { withState } = extendableComponent<StyleProps, typeof name, typeof parts>(name, parts)
|
|
19
19
|
|
|
20
20
|
/** Expose the component to be exendable in your theme.components */
|
|
21
|
-
declare module '@mui/material/styles
|
|
21
|
+
declare module '@mui/material/styles' {
|
|
22
22
|
interface Components {
|
|
23
23
|
IconSvg?: ExtendableComponent<StyleProps> & {
|
|
24
24
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
2
3
|
import { Box } from '@mui/material'
|
|
3
4
|
import React from 'react'
|
|
@@ -111,12 +112,10 @@ export const LayoutHeader = React.memo<LayoutHeaderProps>((props) => {
|
|
|
111
112
|
return (
|
|
112
113
|
<Box
|
|
113
114
|
className={classes.root}
|
|
114
|
-
sx={
|
|
115
|
+
sx={sxx(
|
|
115
116
|
(theme) => ({
|
|
116
|
-
zIndex: children ? theme.zIndex.appBar : theme.zIndex.appBar - 2,
|
|
117
117
|
position: 'sticky',
|
|
118
118
|
pointerEvents: 'none',
|
|
119
|
-
|
|
120
119
|
[theme.breakpoints.down('md')]: {
|
|
121
120
|
top: 0,
|
|
122
121
|
marginTop: `calc(${theme.appShell.headerHeightSm} * -1)`,
|
|
@@ -137,7 +136,6 @@ export const LayoutHeader = React.memo<LayoutHeaderProps>((props) => {
|
|
|
137
136
|
display: 'none',
|
|
138
137
|
},
|
|
139
138
|
},
|
|
140
|
-
|
|
141
139
|
[theme.breakpoints.up('md')]: {
|
|
142
140
|
top: 0,
|
|
143
141
|
height: theme.appShell.appBarHeightMd,
|
|
@@ -166,8 +164,11 @@ export const LayoutHeader = React.memo<LayoutHeaderProps>((props) => {
|
|
|
166
164
|
},
|
|
167
165
|
},
|
|
168
166
|
}),
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
children
|
|
168
|
+
? (theme) => ({ zIndex: theme.zIndex.appBar })
|
|
169
|
+
: (theme) => ({ zIndex: theme.zIndex.appBar - 2 }),
|
|
170
|
+
sx,
|
|
171
|
+
)}
|
|
171
172
|
>
|
|
172
173
|
<LayoutHeaderContent
|
|
173
174
|
size={size}
|
|
@@ -77,7 +77,6 @@ export function LayoutHeaderBack(props: BackProps) {
|
|
|
77
77
|
</LinkOrButton>
|
|
78
78
|
)
|
|
79
79
|
}
|
|
80
|
-
|
|
81
80
|
if (up?.href && up.href !== path)
|
|
82
81
|
return (
|
|
83
82
|
<LinkOrButton
|
|
@@ -93,6 +92,5 @@ export function LayoutHeaderBack(props: BackProps) {
|
|
|
93
92
|
</Box>
|
|
94
93
|
</LinkOrButton>
|
|
95
94
|
)
|
|
96
|
-
|
|
97
95
|
return null
|
|
98
96
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useMotionValueValue } from '@graphcommerce/framer-utils'
|
|
2
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
3
|
import type { SxProps, Theme } from '@mui/material'
|
|
3
4
|
import { Box, styled } from '@mui/material'
|
|
4
5
|
import type { LayoutProps } from 'framer-motion'
|
|
@@ -65,14 +66,13 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
65
66
|
<>
|
|
66
67
|
<Box
|
|
67
68
|
className={classes.bg}
|
|
68
|
-
sx={
|
|
69
|
+
sx={sxx(
|
|
69
70
|
(theme) => ({
|
|
70
71
|
position: 'absolute',
|
|
71
72
|
left: 0,
|
|
72
73
|
width: '100%',
|
|
73
|
-
backgroundColor: theme.palette.background[bgColor],
|
|
74
|
+
backgroundColor: theme.vars.palette.background[bgColor],
|
|
74
75
|
boxShadow: theme.shadows[1],
|
|
75
|
-
|
|
76
76
|
height: theme.appShell.headerHeightSm,
|
|
77
77
|
[theme.breakpoints.up('md')]: {
|
|
78
78
|
height: theme.appShell.appBarHeightMd,
|
|
@@ -80,9 +80,6 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
80
80
|
'&.sizeSmall': {
|
|
81
81
|
height: theme.appShell.headerHeightSm,
|
|
82
82
|
},
|
|
83
|
-
borderTopLeftRadius: switchPoint <= 0 ? theme.shape.borderRadius * 3 : 0,
|
|
84
|
-
borderTopRightRadius: switchPoint <= 0 ? theme.shape.borderRadius * 3 : 0,
|
|
85
|
-
|
|
86
83
|
'&.floatingSm': {
|
|
87
84
|
[theme.breakpoints.down('md')]: {
|
|
88
85
|
display: 'none',
|
|
@@ -93,26 +90,38 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
93
90
|
display: 'none',
|
|
94
91
|
},
|
|
95
92
|
},
|
|
96
|
-
|
|
97
93
|
opacity: 0,
|
|
98
94
|
transition: 'opacity 150ms',
|
|
99
95
|
'&.scrolled': {
|
|
100
96
|
opacity: 1,
|
|
101
97
|
},
|
|
102
|
-
|
|
103
98
|
'&.divider': {
|
|
104
99
|
boxShadow: 'unset',
|
|
105
100
|
},
|
|
106
101
|
}),
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
switchPoint <= 0
|
|
103
|
+
? (theme) => ({
|
|
104
|
+
borderTopLeftRadius: theme.shape.borderRadius * 3,
|
|
105
|
+
})
|
|
106
|
+
: {
|
|
107
|
+
borderTopLeftRadius: 0,
|
|
108
|
+
},
|
|
109
|
+
switchPoint <= 0
|
|
110
|
+
? (theme) => ({
|
|
111
|
+
borderTopRightRadius: theme.shape.borderRadius * 3,
|
|
112
|
+
})
|
|
113
|
+
: {
|
|
114
|
+
borderTopRightRadius: 0,
|
|
115
|
+
},
|
|
116
|
+
sxBg,
|
|
117
|
+
)}
|
|
109
118
|
/>
|
|
110
119
|
<Container
|
|
111
120
|
maxWidth={false}
|
|
112
121
|
className={classes.content}
|
|
113
122
|
sizing='shell'
|
|
114
123
|
ref={ref}
|
|
115
|
-
sx={
|
|
124
|
+
sx={sxx(
|
|
116
125
|
(theme) => ({
|
|
117
126
|
position: 'absolute',
|
|
118
127
|
inset: 0,
|
|
@@ -133,7 +142,6 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
133
142
|
px: 2,
|
|
134
143
|
},
|
|
135
144
|
},
|
|
136
|
-
|
|
137
145
|
'&.floatingSm': {
|
|
138
146
|
[theme.breakpoints.down('md')]: {
|
|
139
147
|
background: 'none',
|
|
@@ -147,8 +155,8 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
147
155
|
},
|
|
148
156
|
},
|
|
149
157
|
}),
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
sx,
|
|
159
|
+
)}
|
|
152
160
|
>
|
|
153
161
|
{left && (
|
|
154
162
|
<Box
|
|
@@ -177,20 +185,17 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
177
185
|
justifyContent: 'start',
|
|
178
186
|
overflow: 'hidden',
|
|
179
187
|
justifySelf: 'center',
|
|
180
|
-
|
|
181
188
|
transition: 'opacity 150ms',
|
|
182
189
|
opacity: 0,
|
|
183
190
|
'&.scrolled': {
|
|
184
191
|
opacity: 1,
|
|
185
192
|
'& > *': { pointerEvents: 'all' },
|
|
186
193
|
},
|
|
187
|
-
|
|
188
194
|
'&.floatingSm': {
|
|
189
195
|
[theme.breakpoints.down('md')]: {
|
|
190
196
|
display: 'none',
|
|
191
197
|
},
|
|
192
198
|
},
|
|
193
|
-
|
|
194
199
|
'&.floatingMd': {
|
|
195
200
|
[theme.breakpoints.up('md')]: {
|
|
196
201
|
display: 'none',
|
|
@@ -228,7 +233,6 @@ export function LayoutHeaderContent(props: LayoutHeaderContentProps) {
|
|
|
228
233
|
bottom: 0,
|
|
229
234
|
left: 0,
|
|
230
235
|
right: 0,
|
|
231
|
-
|
|
232
236
|
'&.floatingSm': {
|
|
233
237
|
[theme.breakpoints.down('md')]: {
|
|
234
238
|
display: 'none',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { SxProps, Theme, TypographyProps } from '@mui/material'
|
|
2
3
|
import { Box, Typography } from '@mui/material'
|
|
3
4
|
import React from 'react'
|
|
@@ -36,7 +37,7 @@ export const LayoutTitle = React.forwardRef<HTMLDivElement, TitleProps>((props,
|
|
|
36
37
|
return (
|
|
37
38
|
<Box
|
|
38
39
|
className={classes.root}
|
|
39
|
-
sx={
|
|
40
|
+
sx={sxx(
|
|
40
41
|
(theme) => ({
|
|
41
42
|
display: 'flex',
|
|
42
43
|
alignItems: 'center',
|
|
@@ -63,8 +64,8 @@ export const LayoutTitle = React.forwardRef<HTMLDivElement, TitleProps>((props,
|
|
|
63
64
|
marginBottom: theme.spacings.xl,
|
|
64
65
|
},
|
|
65
66
|
}),
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
sx,
|
|
68
|
+
)}
|
|
68
69
|
>
|
|
69
70
|
{icon && (
|
|
70
71
|
<IconSvg src={icon} size={size === 'small' ? 'large' : 'xl'} className={classes.icon} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useScrollOffset } from '@graphcommerce/framer-next-pages'
|
|
2
2
|
import { dvh } from '@graphcommerce/framer-utils'
|
|
3
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
3
4
|
import type { SxProps, Theme } from '@mui/material'
|
|
4
5
|
import { Box } from '@mui/material'
|
|
5
6
|
import { useScroll, useTransform } from 'framer-motion'
|
|
@@ -55,7 +56,7 @@ export function LayoutDefault(props: LayoutDefaultProps) {
|
|
|
55
56
|
return (
|
|
56
57
|
<Box
|
|
57
58
|
className={`${classes.root} ${className ?? ''}`}
|
|
58
|
-
sx={
|
|
59
|
+
sx={sxx(
|
|
59
60
|
(theme) => ({
|
|
60
61
|
minHeight: dvh(100),
|
|
61
62
|
'@supports (-webkit-touch-callout: none)': {
|
|
@@ -64,10 +65,10 @@ export function LayoutDefault(props: LayoutDefaultProps) {
|
|
|
64
65
|
display: 'grid',
|
|
65
66
|
gridTemplateRows: { xs: 'auto 1fr auto', md: 'auto auto 1fr auto' },
|
|
66
67
|
gridTemplateColumns: '100%',
|
|
67
|
-
background: theme.palette.background.default,
|
|
68
|
+
background: theme.vars.palette.background.default,
|
|
68
69
|
}),
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
sx,
|
|
71
|
+
)}
|
|
71
72
|
>
|
|
72
73
|
<SkipLink />
|
|
73
74
|
<LayoutProvider scroll={scrollYOffset}>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { LayoutHeaderProps } from '../../Layout'
|
|
2
3
|
import { LayoutHeader } from '../../Layout'
|
|
3
4
|
|
|
@@ -8,7 +9,7 @@ export function LayoutOverlayHeader(props: LayoutHeaderProps) {
|
|
|
8
9
|
{...props}
|
|
9
10
|
noAlign
|
|
10
11
|
switchPoint={switchPoint !== 0 ? switchPoint : -1000}
|
|
11
|
-
sx={
|
|
12
|
+
sx={sxx(
|
|
12
13
|
(theme) => ({
|
|
13
14
|
[theme.breakpoints.down('md')]: {
|
|
14
15
|
'&.noAlign': {
|
|
@@ -25,8 +26,8 @@ export function LayoutOverlayHeader(props: LayoutHeaderProps) {
|
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
28
|
}),
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
sx,
|
|
30
|
+
)}
|
|
30
31
|
/>
|
|
31
32
|
)
|
|
32
33
|
}
|