@graphcommerce/next-ui 3.24.1 → 3.25.1
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/AppShell/DesktopNavActions.tsx +7 -2
- package/AppShell/GlobalHead.tsx +1 -1
- package/AppShell/Logo.tsx +1 -1
- package/AppShell/MenuFab.tsx +1 -9
- package/AppShell/index.ts +0 -1
- package/CHANGELOG.md +45 -0
- package/Layout/components/LayoutHeader.tsx +3 -1
- package/LayoutDefault/components/LayoutDefault.tsx +28 -8
- package/package.json +3 -3
- package/AppShell/FixedFab.tsx +0 -34
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { UseStyles } from '../Styles'
|
|
3
4
|
|
|
4
5
|
const useStyles = makeStyles(
|
|
5
6
|
(theme: Theme) => ({
|
|
@@ -20,8 +21,12 @@ const useStyles = makeStyles(
|
|
|
20
21
|
{ name: 'DesktopNavActions' },
|
|
21
22
|
)
|
|
22
23
|
|
|
23
|
-
export default function DesktopNavActions(
|
|
24
|
+
export default function DesktopNavActions(
|
|
25
|
+
props: {
|
|
26
|
+
children?: React.ReactNode
|
|
27
|
+
} & UseStyles<typeof useStyles>,
|
|
28
|
+
) {
|
|
24
29
|
const { children } = props
|
|
25
|
-
const classes = useStyles()
|
|
30
|
+
const classes = useStyles(props)
|
|
26
31
|
return <div className={classes.actions}>{children}</div>
|
|
27
32
|
}
|
package/AppShell/GlobalHead.tsx
CHANGED
|
@@ -27,7 +27,7 @@ export function GlobalHead(props: GlobalHeadProps) {
|
|
|
27
27
|
<meta name='format-detection' content='telephone=no' key='format-detection' />
|
|
28
28
|
<meta name='mobile-web-app-capable' content='yes' key='mobile-web-app-capable' />
|
|
29
29
|
<link rel='icon' href='/favicon.ico' sizes='any' />
|
|
30
|
-
<link rel='icon' href='/
|
|
30
|
+
<link rel='icon' href='/favicon.svg' type='image/svg+xml' />
|
|
31
31
|
<link rel='apple-touch-icon' href='/apple-touch-icon.png' />
|
|
32
32
|
<link rel='manifest' href='/manifest.webmanifest' key='manifest' />
|
|
33
33
|
</Head>
|
package/AppShell/Logo.tsx
CHANGED
|
@@ -32,7 +32,7 @@ export default function Logo(props: LogoProps) {
|
|
|
32
32
|
const router = useRouter()
|
|
33
33
|
const classes = useStyles(props)
|
|
34
34
|
|
|
35
|
-
return router.asPath === '/' ? (
|
|
35
|
+
return router.asPath.split('?')[0] === '/' ? (
|
|
36
36
|
<div className={classes.parent}>
|
|
37
37
|
<Image layout='fixed' loading='eager' {...image} className={classes.logo} />
|
|
38
38
|
</div>
|
package/AppShell/MenuFab.tsx
CHANGED
|
@@ -22,19 +22,11 @@ import { useFabAnimation } from './useFabAnimation'
|
|
|
22
22
|
const useStyles = makeStyles(
|
|
23
23
|
(theme: Theme) => ({
|
|
24
24
|
menuWrapper: {
|
|
25
|
-
position: 'fixed',
|
|
26
|
-
zIndex: 99,
|
|
27
25
|
left: theme.page.horizontal,
|
|
28
26
|
[theme.breakpoints.down('sm')]: {
|
|
29
|
-
top: 'unset',
|
|
30
|
-
left: 20,
|
|
31
|
-
bottom: 20,
|
|
32
27
|
transform: 'none !important',
|
|
33
28
|
opacity: '1 !important',
|
|
34
29
|
},
|
|
35
|
-
[theme.breakpoints.up('md')]: {
|
|
36
|
-
top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
|
|
37
|
-
},
|
|
38
30
|
},
|
|
39
31
|
menuFab: {
|
|
40
32
|
boxShadow: 'none',
|
|
@@ -140,7 +132,7 @@ export default function MenuFab(props: MenuFabProps) {
|
|
|
140
132
|
<ListItem
|
|
141
133
|
button
|
|
142
134
|
dense
|
|
143
|
-
selected={router.asPath === '/'}
|
|
135
|
+
selected={router.asPath.split('?')[0] === '/'}
|
|
144
136
|
classes={{ root: classes.menuItem }}
|
|
145
137
|
>
|
|
146
138
|
<ListItemText classes={{ primary: classes.menuItemText }}>Home</ListItemText>
|
package/AppShell/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ export { default as DesktopNavActions } from './DesktopNavActions'
|
|
|
3
3
|
|
|
4
4
|
export * from './DesktopNavBar'
|
|
5
5
|
export { default as DesktopNavBar } from './DesktopNavBar'
|
|
6
|
-
export { default as FixedFab } from './FixedFab'
|
|
7
6
|
|
|
8
7
|
export { default as Logo } from './Logo'
|
|
9
8
|
export * from './Logo'
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,51 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.25.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.25.0...@graphcommerce/next-ui@3.25.1) (2022-02-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* make DesktopNavActions stylable ([db31369](https://github.com/ho-nl/m2-pwa/commit/db3136931d2ace1bfb6e7fecad0e01758aa2b397))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.25.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.24.3...@graphcommerce/next-ui@3.25.0) (2022-01-25)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add beforeHeader prop ([00501ef](https://github.com/ho-nl/m2-pwa/commit/00501efab97fae2469f783751702db95e4e2c93e))
|
|
23
|
+
* remove fixed fap and position cart with parent sticky ([bfd8adf](https://github.com/ho-nl/m2-pwa/commit/bfd8adf1372f77e6b27f6e0482ec03762d9148e4))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## [3.24.3](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.24.2...@graphcommerce/next-ui@3.24.3) (2022-01-21)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* prevent layout from breaking when url has params ([9197bf7](https://github.com/ho-nl/m2-pwa/commit/9197bf72c5c3e422d70741cadbc40b19a1ae4936))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## [3.24.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.24.1...@graphcommerce/next-ui@3.24.2) (2022-01-21)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* favicon.svg path ([fefe20b](https://github.com/ho-nl/m2-pwa/commit/fefe20bd1d8392b9d39632c6335395dd4931af2f))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
6
51
|
## [3.24.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.24.0...@graphcommerce/next-ui@3.24.1) (2022-01-18)
|
|
7
52
|
|
|
8
53
|
|
|
@@ -131,7 +131,7 @@ export function LayoutHeader(props: LayoutHeaderProps) {
|
|
|
131
131
|
divider: !!divider,
|
|
132
132
|
})
|
|
133
133
|
|
|
134
|
-
return (
|
|
134
|
+
return children ? (
|
|
135
135
|
<div {...className('sticky')}>
|
|
136
136
|
<LayoutHeaderContent
|
|
137
137
|
left={left}
|
|
@@ -144,5 +144,7 @@ export function LayoutHeader(props: LayoutHeaderProps) {
|
|
|
144
144
|
{children}
|
|
145
145
|
</LayoutHeaderContent>
|
|
146
146
|
</div>
|
|
147
|
+
) : (
|
|
148
|
+
<></>
|
|
147
149
|
)
|
|
148
150
|
}
|
|
@@ -4,7 +4,7 @@ import clsx from 'clsx'
|
|
|
4
4
|
import { useTransform, useViewportScroll } from 'framer-motion'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
import LayoutProvider from '../../Layout/components/LayoutProvider'
|
|
7
|
-
import { UseStyles } from '../../Styles'
|
|
7
|
+
import { responsiveVal, UseStyles } from '../../Styles'
|
|
8
8
|
|
|
9
9
|
const useStyles = makeStyles(
|
|
10
10
|
(theme: Theme) => ({
|
|
@@ -19,12 +19,31 @@ const useStyles = makeStyles(
|
|
|
19
19
|
background: theme.palette.background.default,
|
|
20
20
|
},
|
|
21
21
|
hideFabsOnVirtualKeyboardOpen: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
width: '100%',
|
|
25
|
+
height: 0,
|
|
26
|
+
zIndex: 2,
|
|
27
|
+
[theme.breakpoints.up('sm')]: {
|
|
28
|
+
padding: `0 ${theme.page.horizontal}`,
|
|
29
|
+
position: 'sticky',
|
|
30
|
+
marginTop: `calc(${theme.appShell.headerHeightMd} * -1 + calc(${responsiveVal(
|
|
31
|
+
42,
|
|
32
|
+
56,
|
|
33
|
+
)} / 2))`,
|
|
34
|
+
top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
|
|
35
|
+
},
|
|
22
36
|
[theme.breakpoints.down('sm')]: {
|
|
37
|
+
position: 'fixed',
|
|
38
|
+
top: 'unset',
|
|
39
|
+
bottom: `calc(20px + ${responsiveVal(42, 56)})`,
|
|
40
|
+
padding: `0 20px`,
|
|
23
41
|
'@media (max-height: 530px)': {
|
|
24
42
|
display: 'none',
|
|
25
43
|
},
|
|
26
44
|
},
|
|
27
45
|
},
|
|
46
|
+
|
|
28
47
|
header: {
|
|
29
48
|
zIndex: theme.zIndex.appBar - 1,
|
|
30
49
|
display: 'flex',
|
|
@@ -44,6 +63,7 @@ const useStyles = makeStyles(
|
|
|
44
63
|
width: '100%',
|
|
45
64
|
},
|
|
46
65
|
},
|
|
66
|
+
|
|
47
67
|
headerSticky: {
|
|
48
68
|
[theme.breakpoints.down('sm')]: {
|
|
49
69
|
position: 'sticky',
|
|
@@ -56,6 +76,7 @@ const useStyles = makeStyles(
|
|
|
56
76
|
|
|
57
77
|
export type LayoutDefaultProps = {
|
|
58
78
|
className?: string
|
|
79
|
+
beforeHeader?: React.ReactNode
|
|
59
80
|
header: React.ReactNode
|
|
60
81
|
footer: React.ReactNode
|
|
61
82
|
menuFab?: React.ReactNode
|
|
@@ -65,7 +86,7 @@ export type LayoutDefaultProps = {
|
|
|
65
86
|
} & UseStyles<typeof useStyles>
|
|
66
87
|
|
|
67
88
|
export function LayoutDefault(props: LayoutDefaultProps) {
|
|
68
|
-
const { children, header, footer, menuFab, cartFab, noSticky, className } = props
|
|
89
|
+
const { children, header, beforeHeader, footer, menuFab, cartFab, noSticky, className } = props
|
|
69
90
|
const classes = useStyles(props)
|
|
70
91
|
|
|
71
92
|
const offset = useScrollOffset().y
|
|
@@ -74,16 +95,15 @@ export function LayoutDefault(props: LayoutDefaultProps) {
|
|
|
74
95
|
return (
|
|
75
96
|
<div className={clsx(classes.root, className)}>
|
|
76
97
|
<LayoutProvider scroll={scrollWithOffset}>
|
|
98
|
+
{beforeHeader}
|
|
77
99
|
<header className={clsx(classes.header, !noSticky && classes.headerSticky)}>
|
|
78
100
|
{header}
|
|
79
101
|
</header>
|
|
80
|
-
<div>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{cartFab}
|
|
84
|
-
</div>
|
|
85
|
-
{children}
|
|
102
|
+
<div className={classes.hideFabsOnVirtualKeyboardOpen}>
|
|
103
|
+
{menuFab}
|
|
104
|
+
{cartFab}
|
|
86
105
|
</div>
|
|
106
|
+
<div>{children}</div>
|
|
87
107
|
<div>{footer}</div>
|
|
88
108
|
</LayoutProvider>
|
|
89
109
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.1",
|
|
4
4
|
"author": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apollo/client": "^3.5.6",
|
|
13
13
|
"@graphcommerce/framer-next-pages": "^2.109.2",
|
|
14
|
-
"@graphcommerce/framer-scroller": "^1.2.
|
|
14
|
+
"@graphcommerce/framer-scroller": "^1.2.10",
|
|
15
15
|
"@graphcommerce/framer-utils": "^2.103.21",
|
|
16
16
|
"@graphcommerce/graphql": "^2.105.13",
|
|
17
17
|
"@graphcommerce/image": "^2.105.13",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"project": "./tsconfig.json"
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "4f7fd2440fa20b9ad619b1172bc12deaaf8b2456"
|
|
55
55
|
}
|
package/AppShell/FixedFab.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
|
-
import { m } from 'framer-motion'
|
|
3
|
-
import { UseStyles } from '../Styles'
|
|
4
|
-
|
|
5
|
-
const useStyles = makeStyles(
|
|
6
|
-
(theme: Theme) => ({
|
|
7
|
-
root: {
|
|
8
|
-
position: 'fixed',
|
|
9
|
-
bottom: 20,
|
|
10
|
-
right: 20,
|
|
11
|
-
zIndex: 100,
|
|
12
|
-
borderRadius: 99,
|
|
13
|
-
maxWidth: 56,
|
|
14
|
-
[theme.breakpoints.up('md')]: {
|
|
15
|
-
pointerEvents: 'all',
|
|
16
|
-
top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
|
|
17
|
-
left: `calc((100vw - (100vw - 100%)) - ${theme.page.horizontal} - 56px)`,
|
|
18
|
-
bottom: 'unset',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
{ name: 'FixedFab' },
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
type FixedFabProps = {
|
|
26
|
-
children: React.ReactNode
|
|
27
|
-
} & UseStyles<typeof useStyles>
|
|
28
|
-
|
|
29
|
-
export default function FixedFab(props: FixedFabProps) {
|
|
30
|
-
const { children } = props
|
|
31
|
-
const classes = useStyles(props)
|
|
32
|
-
|
|
33
|
-
return <m.div className={classes.root}>{children}</m.div>
|
|
34
|
-
}
|