@graphcommerce/next-ui 3.21.5 → 3.21.9

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.
@@ -10,7 +10,7 @@ export default function AnimatedRow(props: AnimatedRowProps) {
10
10
  return (
11
11
  <m.div
12
12
  {...props}
13
- layout='size'
13
+ layout
14
14
  initial={{ opacity: 0, height: 0 }}
15
15
  animate={{ opacity: 1, height: 'auto' }}
16
16
  exit={{ opacity: 0, height: 0 }}
@@ -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
- link: {
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.logo}>
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.link} aria-label='Logo'>
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>
@@ -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
- '&:hover, &:focus': {
45
- background: theme.palette.text.primary,
46
- },
47
- '& svg': {
48
- color: theme.palette.background.paper,
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 { filter, opacity, scale } = useFabAnimation()
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={{ opacity, scale, filter }}>
104
+ <m.div className={classes.menuWrapper} style={{ scale, opacity }}>
93
105
  <Fab
94
- color='primary'
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 { useMediaQuery, useTheme } from '@material-ui/core'
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, scrollTo], [0.4, 1])
12
- const opacity = useTransform(scrollY, [50, scrollTo], [0, 1])
13
- const opacity1 = useTransform(scrollY, [0, scrollTo], [0, 0.08])
14
- const opacity2 = useTransform(scrollY, [0, scrollTo], [0, 0.1])
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 { useMotionTemplate, useTransform } from 'framer-motion'
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 opacity1 = useTransform(
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,30 @@
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.9](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.21.8...@graphcommerce/next-ui@3.21.9) (2021-12-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * layout overlay sometimes have a horizontal scrollbar ([a1cfe72](https://github.com/ho-nl/m2-pwa/commit/a1cfe72d207dcdf07948080b605b64e7f73939bf))
12
+ * make sure the bottomsheet has enough space on android ([02d3e63](https://github.com/ho-nl/m2-pwa/commit/02d3e639388446423149461ae52d0ed12a962f5e))
13
+
14
+
15
+
16
+
17
+
18
+ ## [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)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * logo invert darkmode and consistent logo spacing ([2a80603](https://github.com/ho-nl/m2-pwa/commit/2a80603fd3255544f78d9da28aad17fb3fca0c9c))
24
+ * menuFab, cartFab shadows, darkTheme color and opacity bug ([6c7afa7](https://github.com/ho-nl/m2-pwa/commit/6c7afa7d3b584b455476aa26d95041c4cf6c1d0c))
25
+
26
+
27
+
28
+
29
+
6
30
  ## [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
31
 
8
32
 
@@ -19,12 +19,6 @@ const useStyles = makeStyles(
19
19
  '@supports (-webkit-touch-callout: none)': {
20
20
  height: '-webkit-fill-available',
21
21
  },
22
- [theme.breakpoints.down('sm')]: {
23
- width: '100vw',
24
- },
25
- [theme.breakpoints.up('md')]: {
26
- width: '100vw',
27
- },
28
22
  },
29
23
  rootVariantSmLeft: {
30
24
  [theme.breakpoints.down('sm')]: {
@@ -118,7 +112,6 @@ const useStyles = makeStyles(
118
112
  pointerEvents: 'none',
119
113
  gridArea: 'overlay',
120
114
  scrollSnapAlign: 'start',
121
- width: 'min-content',
122
115
  minHeight: '100vh',
123
116
  '@supports (-webkit-touch-callout: none)': {
124
117
  minHeight: '-webkit-fill-available',
@@ -144,17 +137,22 @@ const useStyles = makeStyles(
144
137
  boxShadow: theme.shadows[24],
145
138
  minWidth: 'min(800px, 90vw)',
146
139
  scrollSnapAlign: 'end',
140
+
141
+ // The top bar on Google Chrome is about 56 pixels high. If we do not provide this padding we'll run into the issue that the user can't scroll to the bottom.
142
+ // We can't change this value with JS as that causes much jank
143
+ [`@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) and (max-width:${theme.breakpoints.values.sm}px)`]:
144
+ {
145
+ paddingBottom: 56,
146
+ },
147
147
  },
148
148
  overlayPaneVariantSmBottom: {
149
149
  [theme.breakpoints.down('sm')]: {
150
- width: '100vw',
151
150
  borderTopLeftRadius: theme.shape.borderRadius * 3,
152
151
  borderTopRightRadius: theme.shape.borderRadius * 3,
153
152
  },
154
153
  },
155
154
  overlayPaneVariantMdBottom: {
156
155
  [theme.breakpoints.up('md')]: {
157
- width: '100vw',
158
156
  borderTopLeftRadius: theme.shape.borderRadius * 3,
159
157
  borderTopRightRadius: theme.shape.borderRadius * 3,
160
158
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.21.5",
3
+ "version": "3.21.9",
4
4
  "author": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -10,11 +10,11 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@apollo/client": "^3.5.6",
13
- "@graphcommerce/framer-next-pages": "^2.108.7",
14
- "@graphcommerce/framer-scroller": "^1.1.15",
13
+ "@graphcommerce/framer-next-pages": "^2.108.9",
14
+ "@graphcommerce/framer-scroller": "^1.1.19",
15
15
  "@graphcommerce/framer-utils": "^2.103.20",
16
- "@graphcommerce/graphql": "^2.105.11",
17
- "@graphcommerce/image": "^2.105.10",
16
+ "@graphcommerce/graphql": "^2.105.12",
17
+ "@graphcommerce/image": "^2.105.11",
18
18
  "@lingui/macro": "^3.13.0",
19
19
  "@material-ui/core": "^4.12.3",
20
20
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -52,5 +52,5 @@
52
52
  "project": "./tsconfig.json"
53
53
  }
54
54
  },
55
- "gitHead": "ecbde6cbcb36e0e2429b6d777972c12c47822385"
55
+ "gitHead": "fbca834579f81b45ee062e85146535eb6d7ab079"
56
56
  }