@graphcommerce/next-ui 3.24.3 → 3.25.3

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
  }
@@ -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',
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.3](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.25.2...@graphcommerce/next-ui@3.25.3) (2022-02-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Removal of default style where H2 and H3 get converted to H4, style wise. ([68772ec](https://github.com/ho-nl/m2-pwa/commit/68772eccbb3d8c1f1ecd59cf0e47f3435a9f1d55))
12
+
13
+
14
+
15
+
16
+
17
+ ## [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)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * change breakpoints down in footer component ([9ec181c](https://github.com/ho-nl/m2-pwa/commit/9ec181cc44f6b73450645b3b8a3ab57fd1a68d2e))
23
+
24
+
25
+
26
+
27
+
28
+ ## [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)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * make DesktopNavActions stylable ([db31369](https://github.com/ho-nl/m2-pwa/commit/db3136931d2ace1bfb6e7fecad0e01758aa2b397))
34
+
35
+
36
+
37
+
38
+
39
+ # [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)
40
+
41
+
42
+ ### Features
43
+
44
+ * add beforeHeader prop ([00501ef](https://github.com/ho-nl/m2-pwa/commit/00501efab97fae2469f783751702db95e4e2c93e))
45
+ * remove fixed fap and position cart with parent sticky ([bfd8adf](https://github.com/ho-nl/m2-pwa/commit/bfd8adf1372f77e6b27f6e0482ec03762d9148e4))
46
+
47
+
48
+
49
+
50
+
6
51
  ## [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)
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
  },
@@ -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>
@@ -11,9 +11,6 @@ const useStyles = makeStyles(
11
11
  display: `grid`,
12
12
  gridTemplateColumns: `1fr`,
13
13
  gridTemplateAreas: `"one" "two"`,
14
- '& h2, & h3': {
15
- ...theme.typography.h4,
16
- },
17
14
  [theme.breakpoints.up('sm')]: {
18
15
  gridTemplateColumns: `1fr 1fr`,
19
16
  gridTemplateAreas: `"one two"`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.24.3",
3
+ "version": "3.25.3",
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.8",
14
+ "@graphcommerce/framer-scroller": "^1.2.12",
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": "058c76b8990aae1a2a018a5b659dc7dda0651af8"
54
+ "gitHead": "41e42c8cd6f565ab0cbba81a1954a0041dc46768"
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
- }