@graphcommerce/next-ui 3.24.3 → 3.25.0

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.
@@ -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,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.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)
7
+
8
+
9
+ ### Features
10
+
11
+ * add beforeHeader prop ([00501ef](https://github.com/ho-nl/m2-pwa/commit/00501efab97fae2469f783751702db95e4e2c93e))
12
+ * remove fixed fap and position cart with parent sticky ([bfd8adf](https://github.com/ho-nl/m2-pwa/commit/bfd8adf1372f77e6b27f6e0482ec03762d9148e4))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [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
19
 
8
20
 
@@ -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.3",
3
+ "version": "3.25.0",
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.9",
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": "64e5665f27e32fde21e5bc3a6d1b322e065d7718"
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
- }