@graphcommerce/next-ui 3.21.7 → 3.21.8
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/FixedFab.tsx +0 -2
- package/AppShell/Logo.tsx +3 -3
- package/AppShell/MenuFab.tsx +21 -8
- package/AppShell/useFabAnimation.ts +5 -14
- package/AppShell/useFixedFabAnimation.ts +2 -3
- package/CHANGELOG.md +12 -0
- package/package.json +3 -3
package/AppShell/FixedFab.tsx
CHANGED
|
@@ -9,7 +9,6 @@ const useStyles = makeStyles(
|
|
|
9
9
|
bottom: 20,
|
|
10
10
|
right: 20,
|
|
11
11
|
zIndex: 100,
|
|
12
|
-
boxShadow: theme.shadows[4],
|
|
13
12
|
borderRadius: 99,
|
|
14
13
|
maxWidth: 56,
|
|
15
14
|
[theme.breakpoints.up('md')]: {
|
|
@@ -17,7 +16,6 @@ const useStyles = makeStyles(
|
|
|
17
16
|
top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
|
|
18
17
|
left: `calc((100vw - (100vw - 100%)) - ${theme.page.horizontal} - 56px)`,
|
|
19
18
|
bottom: 'unset',
|
|
20
|
-
boxShadow: 'unset',
|
|
21
19
|
},
|
|
22
20
|
},
|
|
23
21
|
}),
|
package/AppShell/Logo.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { UseStyles } from '../Styles'
|
|
|
8
8
|
const useStyles = makeStyles(
|
|
9
9
|
(theme: Theme) => ({
|
|
10
10
|
logo: {},
|
|
11
|
-
|
|
11
|
+
parent: {
|
|
12
12
|
height: '100%',
|
|
13
13
|
width: 'max-content',
|
|
14
14
|
display: 'flex',
|
|
@@ -33,12 +33,12 @@ export default function Logo(props: LogoProps) {
|
|
|
33
33
|
const classes = useStyles(props)
|
|
34
34
|
|
|
35
35
|
return router.asPath === '/' ? (
|
|
36
|
-
<div className={classes.
|
|
36
|
+
<div className={classes.parent}>
|
|
37
37
|
<Image layout='fixed' loading='eager' {...image} className={classes.logo} />
|
|
38
38
|
</div>
|
|
39
39
|
) : (
|
|
40
40
|
<PageLink href={href ?? '/'} passHref>
|
|
41
|
-
<a className={classes.
|
|
41
|
+
<a className={classes.parent} aria-label='Logo'>
|
|
42
42
|
<Image layout='fixed' loading='eager' {...image} className={classes.logo} />
|
|
43
43
|
</a>
|
|
44
44
|
</PageLink>
|
package/AppShell/MenuFab.tsx
CHANGED
|
@@ -37,15 +37,27 @@ const useStyles = makeStyles(
|
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
menuFab: {
|
|
40
|
+
boxShadow: 'none',
|
|
41
|
+
'&:hover, &:focus': {
|
|
42
|
+
boxShadow: 'none',
|
|
43
|
+
background: theme.palette.text.primary,
|
|
44
|
+
},
|
|
40
45
|
background: theme.palette.text.primary,
|
|
41
46
|
width: responsiveVal(42, 56),
|
|
42
47
|
height: responsiveVal(42, 56),
|
|
43
48
|
pointerEvents: 'all',
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
color: theme.palette.background.paper,
|
|
50
|
+
},
|
|
51
|
+
shadow: {
|
|
52
|
+
pointerEvents: 'none',
|
|
53
|
+
borderRadius: '99em',
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
height: '100%',
|
|
56
|
+
width: '100%',
|
|
57
|
+
boxShadow: theme.shadows[6],
|
|
58
|
+
top: 0,
|
|
59
|
+
[theme.breakpoints.down('sm')]: {
|
|
60
|
+
opacity: '1 !important',
|
|
49
61
|
},
|
|
50
62
|
},
|
|
51
63
|
menu: {
|
|
@@ -80,7 +92,7 @@ export default function MenuFab(props: MenuFabProps) {
|
|
|
80
92
|
const router = useRouter()
|
|
81
93
|
const [openEl, setOpenEl] = React.useState<null | HTMLElement>(null)
|
|
82
94
|
|
|
83
|
-
const {
|
|
95
|
+
const { opacity, scale, shadowOpacity } = useFabAnimation()
|
|
84
96
|
|
|
85
97
|
useEffect(() => {
|
|
86
98
|
const clear = () => setOpenEl(null)
|
|
@@ -89,9 +101,9 @@ export default function MenuFab(props: MenuFabProps) {
|
|
|
89
101
|
}, [router])
|
|
90
102
|
|
|
91
103
|
return (
|
|
92
|
-
<m.div className={classes.menuWrapper} style={{
|
|
104
|
+
<m.div className={classes.menuWrapper} style={{ scale, opacity }}>
|
|
93
105
|
<Fab
|
|
94
|
-
color='
|
|
106
|
+
color='inherit'
|
|
95
107
|
aria-label='Open Menu'
|
|
96
108
|
size='medium'
|
|
97
109
|
onClick={(event) => setOpenEl(event.currentTarget)}
|
|
@@ -104,6 +116,7 @@ export default function MenuFab(props: MenuFabProps) {
|
|
|
104
116
|
<SvgImageSimple src={iconMenu} inverted style={{ display: openEl ? 'none' : 'block' }} />
|
|
105
117
|
)}
|
|
106
118
|
</Fab>
|
|
119
|
+
<m.div className={classes.shadow} style={{ opacity: shadowOpacity }} />
|
|
107
120
|
|
|
108
121
|
<Menu
|
|
109
122
|
anchorEl={openEl}
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMotionTemplate, useTransform } from 'framer-motion'
|
|
1
|
+
import { useTransform } from 'framer-motion'
|
|
3
2
|
import { useScrollY } from '../Layout/hooks/useScrollY'
|
|
4
3
|
|
|
5
4
|
export function useFabAnimation() {
|
|
6
|
-
const theme = useTheme()
|
|
7
|
-
const isMobile = useMediaQuery(theme.breakpoints.down('sm'))
|
|
8
5
|
const scrollY = useScrollY()
|
|
9
|
-
const scrollTo = isMobile ? 0 : 130
|
|
10
6
|
|
|
11
|
-
const scale = useTransform(scrollY, [50,
|
|
12
|
-
const opacity = useTransform(scrollY, [50,
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const filter = useMotionTemplate`
|
|
16
|
-
drop-shadow(0 1px 4px rgba(0,0,0,${opacity1}))
|
|
17
|
-
drop-shadow(0 4px 10px rgba(0,0,0,${opacity2}))`
|
|
18
|
-
|
|
19
|
-
return { filter, opacity, scale }
|
|
7
|
+
const scale = useTransform(scrollY, [50, 130], [0.4, 1])
|
|
8
|
+
const opacity = useTransform(scrollY, [50, 130], [0, 1])
|
|
9
|
+
const shadowOpacity = useTransform(scrollY, [131, 140], [0, 1])
|
|
10
|
+
return { opacity, scale, shadowOpacity }
|
|
20
11
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { alpha, useTheme } from '@material-ui/core'
|
|
2
|
-
import {
|
|
2
|
+
import { useTransform } from 'framer-motion'
|
|
3
3
|
import { useScrollY } from '../Layout/hooks/useScrollY'
|
|
4
4
|
|
|
5
5
|
export function useFixedFabAnimation() {
|
|
6
6
|
const theme = useTheme()
|
|
7
7
|
const scrollY = useScrollY()
|
|
8
8
|
const opacity = useTransform(scrollY, [50, 60], [0, 1])
|
|
9
|
-
const
|
|
9
|
+
const backgroundColor = useTransform(
|
|
10
10
|
scrollY,
|
|
11
11
|
[0, 10],
|
|
12
12
|
[alpha(theme.palette.background.paper, 0), alpha(theme.palette.background.paper, 1)],
|
|
13
13
|
)
|
|
14
|
-
const backgroundColor = useMotionTemplate`${opacity1}`
|
|
15
14
|
return { backgroundColor, opacity }
|
|
16
15
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.21.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.21.7...@graphcommerce/next-ui@3.21.8) (2021-12-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* logo invert darkmode and consistent logo spacing ([2a80603](https://github.com/ho-nl/m2-pwa/commit/2a80603fd3255544f78d9da28aad17fb3fca0c9c))
|
|
12
|
+
* menuFab, cartFab shadows, darkTheme color and opacity bug ([6c7afa7](https://github.com/ho-nl/m2-pwa/commit/6c7afa7d3b584b455476aa26d95041c4cf6c1d0c))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [3.21.5](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.21.4...@graphcommerce/next-ui@3.21.5) (2021-12-20)
|
|
7
19
|
|
|
8
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
|
-
"version": "3.21.
|
|
3
|
+
"version": "3.21.8",
|
|
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.108.8",
|
|
14
|
-
"@graphcommerce/framer-scroller": "^1.1.
|
|
14
|
+
"@graphcommerce/framer-scroller": "^1.1.18",
|
|
15
15
|
"@graphcommerce/framer-utils": "^2.103.20",
|
|
16
16
|
"@graphcommerce/graphql": "^2.105.12",
|
|
17
17
|
"@graphcommerce/image": "^2.105.11",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"project": "./tsconfig.json"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "5ad26fe58ae85c8d776e3f571e96832f24811d5d"
|
|
56
56
|
}
|