@graphcommerce/next-ui 3.24.2 → 3.25.2

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.
@@ -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(props: { children?: React.ReactNode }) {
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/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>
@@ -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.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.25.1...@graphcommerce/next-ui@3.25.2) (2022-02-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * change breakpoints down in footer component ([9ec181c](https://github.com/ho-nl/m2-pwa/commit/9ec181cc44f6b73450645b3b8a3ab57fd1a68d2e))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * make DesktopNavActions stylable ([db31369](https://github.com/ho-nl/m2-pwa/commit/db3136931d2ace1bfb6e7fecad0e01758aa2b397))
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+
31
+ ### Features
32
+
33
+ * add beforeHeader prop ([00501ef](https://github.com/ho-nl/m2-pwa/commit/00501efab97fae2469f783751702db95e4e2c93e))
34
+ * remove fixed fap and position cart with parent sticky ([bfd8adf](https://github.com/ho-nl/m2-pwa/commit/bfd8adf1372f77e6b27f6e0482ec03762d9148e4))
35
+
36
+
37
+
38
+
39
+
40
+ ## [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)
41
+
42
+
43
+ ### Bug Fixes
44
+
45
+ * prevent layout from breaking when url has params ([9197bf7](https://github.com/ho-nl/m2-pwa/commit/9197bf72c5c3e422d70741cadbc40b19a1ae4936))
46
+
47
+
48
+
49
+
50
+
6
51
  ## [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)
7
52
 
8
53
 
package/Footer/Footer.tsx CHANGED
@@ -15,7 +15,7 @@ const useStyles = makeStyles(
15
15
  display: 'grid',
16
16
  gap: theme.spacings.xs,
17
17
  alignItems: 'center',
18
- [theme.breakpoints.down('xs')]: {
18
+ [theme.breakpoints.down('sm')]: {
19
19
  paddingTop: theme.spacings.lg,
20
20
  paddingBottom: theme.spacings.lg,
21
21
  justifyItems: 'center',
@@ -43,7 +43,7 @@ const useStyles = makeStyles(
43
43
  gridArea: 'links',
44
44
  ...theme.typography.body2,
45
45
  gap: theme.spacings.sm,
46
- [theme.breakpoints.down('xs')]: {
46
+ [theme.breakpoints.down('sm')]: {
47
47
  gridAutoFlow: 'row',
48
48
  textAlign: 'center',
49
49
  gap: 8,
@@ -52,7 +52,7 @@ const useStyles = makeStyles(
52
52
  support: {
53
53
  gridArea: 'support',
54
54
  justifySelf: 'flex-end',
55
- [theme.breakpoints.down('xs')]: {
55
+ [theme.breakpoints.down('sm')]: {
56
56
  justifySelf: 'center',
57
57
  },
58
58
  },
@@ -65,14 +65,14 @@ const useStyles = makeStyles(
65
65
  '& > *': {
66
66
  minWidth: 'min-content',
67
67
  },
68
- [theme.breakpoints.down('xs')]: {
68
+ [theme.breakpoints.down('sm')]: {
69
69
  gap: `0 ${theme.spacings.sm}`,
70
70
  },
71
71
  },
72
72
  storeSwitcher: {
73
73
  gridArea: 'switcher',
74
74
  justifySelf: 'end',
75
- [theme.breakpoints.down('xs')]: {
75
+ [theme.breakpoints.down('sm')]: {
76
76
  justifySelf: 'center',
77
77
  },
78
78
  },
@@ -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
- <div className={classes.hideFabsOnVirtualKeyboardOpen}>
82
- {menuFab}
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.24.2",
3
+ "version": "3.25.2",
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.7",
14
+ "@graphcommerce/framer-scroller": "^1.2.11",
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": "75d3f01a066d04aa82515011971619e48048bfd4"
54
+ "gitHead": "110ddb032ee3ce6e363b9f5f7d21af71fb51b527"
55
55
  }
@@ -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
- }