@graphcommerce/next-ui 3.21.4 → 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.
@@ -10,7 +10,7 @@ export default function AnimatedRow(props: AnimatedRowProps) {
10
10
  return (
11
11
  <m.div
12
12
  {...props}
13
- layout
13
+ layout='size'
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,29 @@
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
+
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)
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * animations would run on background page, make sure animations are not running when page is not active ([2fcf4b8](https://github.com/ho-nl/m2-pwa/commit/2fcf4b8a853108147477e3a67c7ea202abb2842f))
24
+
25
+
26
+
27
+
28
+
6
29
  ## [3.21.4](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.21.3...@graphcommerce/next-ui@3.21.4) (2021-12-20)
7
30
 
8
31
 
@@ -80,12 +80,12 @@ export default function SidebarSlider(props: SidebarSliderProps) {
80
80
  {children}
81
81
  </Scroller>
82
82
  <div className={classes.centerLeft}>
83
- <ScrollerButton layout direction='left' className={classes.sliderButtons}>
83
+ <ScrollerButton direction='left' className={classes.sliderButtons}>
84
84
  <SvgImageSimple src={iconChevronLeft} />
85
85
  </ScrollerButton>
86
86
  </div>
87
87
  <div className={classes.centerRight}>
88
- <ScrollerButton layout direction='right' className={classes.sliderButtons}>
88
+ <ScrollerButton direction='right' className={classes.sliderButtons}>
89
89
  <SvgImageSimple src={iconChevronRight} />
90
90
  </ScrollerButton>
91
91
  </div>
@@ -1,4 +1,4 @@
1
- import { usePageRouter, useScrollOffset } from '@graphcommerce/framer-next-pages'
1
+ import { useScrollOffset } from '@graphcommerce/framer-next-pages'
2
2
  import { makeStyles, Theme } from '@material-ui/core'
3
3
  import clsx from 'clsx'
4
4
  import { useTransform, useViewportScroll } from 'framer-motion'
@@ -2,14 +2,7 @@ import { usePageContext, usePageRouter, useScrollOffset } from '@graphcommerce/f
2
2
  import { Scroller, useScrollerContext, useScrollTo } from '@graphcommerce/framer-scroller'
3
3
  import { useElementScroll, useIsomorphicLayoutEffect } from '@graphcommerce/framer-utils'
4
4
  import { makeStyles, Theme, ClickAwayListener } from '@material-ui/core'
5
- import {
6
- m,
7
- MotionValue,
8
- useDomEvent,
9
- useMotionValue,
10
- usePresence,
11
- useTransform,
12
- } from 'framer-motion'
5
+ import { m, useDomEvent, useMotionValue, usePresence, useTransform } from 'framer-motion'
13
6
  import React, { useCallback, useEffect, useRef } from 'react'
14
7
  import LayoutProvider from '../../Layout/components/LayoutProvider'
15
8
  import { UseStyles } from '../../Styles'
@@ -335,7 +328,7 @@ export function LayoutOverlayBase(props: LayoutOverlayBaseProps) {
335
328
  // Create the exact position for the LayoutProvider which offsets the top of the overlay
336
329
  const offsetPageY = useScrollOffset().y
337
330
  const scrollWithoffset = useTransform(
338
- [scroll.y, positions.open.y, offsetY] as MotionValue<number | string>[],
331
+ [scroll.y, positions.open.y, offsetY],
339
332
  ([y, openY, offsetYv]: number[]) => Math.max(0, y - openY - offsetYv + offsetPageY),
340
333
  )
341
334
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.21.4",
3
+ "version": "3.21.8",
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.6",
14
- "@graphcommerce/framer-scroller": "^1.1.14",
13
+ "@graphcommerce/framer-next-pages": "^2.108.8",
14
+ "@graphcommerce/framer-scroller": "^1.1.18",
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": "cac49a2bf6cdcbb6131dc7b64172e90aad257c6d"
55
+ "gitHead": "5ad26fe58ae85c8d776e3f571e96832f24811d5d"
56
56
  }