@graphcommerce/next-ui 3.20.0 → 3.20.1

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
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.20.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.20.0...@graphcommerce/next-ui@3.20.1) (2021-12-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * overlay didn't initialize ([f3b4ad9](https://github.com/ho-nl/m2-pwa/commit/f3b4ad9d96656b965865008f315ffcbdd24842de))
12
+ * search page ([85cf721](https://github.com/ho-nl/m2-pwa/commit/85cf72130bce4c3d2c392a3745adf05bca8618b1))
13
+ * sidebar gallery hideScrollbar ([da68544](https://github.com/ho-nl/m2-pwa/commit/da68544c7d99b23db8cb0b96c8ae96ede32abc62))
14
+ * use standard shadows in overlay ([5383aa2](https://github.com/ho-nl/m2-pwa/commit/5383aa2ae69363ebcff1ebec7c120137a83653d0))
15
+
16
+
17
+
18
+
19
+
6
20
  # [3.20.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.19.1...@graphcommerce/next-ui@3.20.0) (2021-12-03)
7
21
 
8
22
 
@@ -76,7 +76,9 @@ export default function SidebarSlider(props: SidebarSliderProps) {
76
76
  </div>
77
77
 
78
78
  <div className={classes.scrollerContainer}>
79
- <Scroller className={classes.scroller}>{children}</Scroller>
79
+ <Scroller className={classes.scroller} hideScrollbar>
80
+ {children}
81
+ </Scroller>
80
82
  <div className={classes.centerLeft}>
81
83
  <ScrollerButton layout direction='left' className={classes.sliderButtons}>
82
84
  <SvgImageSimple src={iconChevronLeft} />
@@ -1,4 +1,3 @@
1
- import { usePageContext } from '@graphcommerce/framer-next-pages'
2
1
  import { makeStyles, Theme } from '@material-ui/core'
3
2
  import React from 'react'
4
3
  import { classesPicker } from '../../Styles/classesPicker'
@@ -8,7 +7,7 @@ import LayoutHeaderContent, { ContentProps } from './LayoutHeaderContent'
8
7
  import { FloatingProps } from './LayoutHeadertypes'
9
8
 
10
9
  export type LayoutHeaderProps = FloatingProps &
11
- Omit<ContentProps, 'leftAction' | 'rightAction'> & {
10
+ Omit<ContentProps, 'left' | 'right'> & {
12
11
  /**
13
12
  * Button to display on the left side of the title
14
13
  *
@@ -98,7 +97,7 @@ const useStyles = makeStyles(
98
97
  )
99
98
 
100
99
  export function LayoutHeader(props: LayoutHeaderProps) {
101
- const { children, additional, divider, primary, secondary, noAlign } = props
100
+ const { children, additional, divider, primary, secondary, noAlign, switchPoint } = props
102
101
  const classes = useStyles(props)
103
102
  const showBack = useShowBack()
104
103
  const showClose = useShowClose()
@@ -142,6 +141,7 @@ export function LayoutHeader(props: LayoutHeaderProps) {
142
141
  divider={divider}
143
142
  floatingMd={floatingMd}
144
143
  floatingSm={floatingSm}
144
+ switchPoint={switchPoint}
145
145
  >
146
146
  {children}
147
147
  {additional}
@@ -141,16 +141,25 @@ export type ContentProps = FloatingProps &
141
141
  left?: React.ReactNode
142
142
  right?: React.ReactNode
143
143
  divider?: React.ReactNode
144
+ switchPoint?: number
144
145
  }
145
146
 
146
147
  export default function LayoutHeaderContent(props: ContentProps) {
147
148
  const ref = useRef<HTMLDivElement>(null)
148
149
  const scroll = useScrollY()
149
150
 
150
- const { left, children, right, divider, floatingMd = false, floatingSm = false } = props
151
+ const {
152
+ left,
153
+ children,
154
+ right,
155
+ divider,
156
+ floatingMd = false,
157
+ floatingSm = false,
158
+ switchPoint = 50,
159
+ } = props
151
160
  const classes = useStyles(props)
152
161
 
153
- const scrolled = useMotionValueValue(scroll, (y) => y > 50)
162
+ const scrolled = useMotionValueValue(scroll, (y) => y >= switchPoint)
154
163
 
155
164
  const className = classesPicker<Classes>(classes, {
156
165
  floatingSm,
@@ -153,14 +153,12 @@ const useStyles = makeStyles(
153
153
  [theme.breakpoints.down('sm')]: {
154
154
  width: '100vw',
155
155
  borderRadius: 10,
156
- boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.1)',
157
156
  },
158
157
  },
159
158
  overlayPaneVariantMdBottom: {
160
159
  [theme.breakpoints.up('md')]: {
161
160
  width: '100vw',
162
161
  borderRadius: 10,
163
- boxShadow: '0px 0px 20px rgba(0, 0, 0, 0.1)',
164
162
  },
165
163
  },
166
164
  overlayPaneVariantSmLeft: {
@@ -26,9 +26,9 @@ export function useOverlayPosition() {
26
26
 
27
27
  const measure = () => {
28
28
  const positions = getScrollSnapPositions()
29
- state.open.x.set(positions.x[1])
29
+ state.open.x.set(positions.x[1] ?? 0)
30
30
  state.closed.x.set(positions.x[0])
31
- state.open.y.set(positions.y[1])
31
+ state.open.y.set(positions.y[1] ?? 0)
32
32
  state.closed.y.set(positions.y[0])
33
33
  }
34
34
  const ro = new ResizeObserver(measure)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.20.0",
3
+ "version": "3.20.1",
4
4
  "author": "",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@apollo/client": "^3.4.16",
13
13
  "@graphcommerce/framer-next-pages": "^2.108.0",
14
- "@graphcommerce/framer-scroller": "^1.1.0",
14
+ "@graphcommerce/framer-scroller": "^1.1.1",
15
15
  "@graphcommerce/framer-utils": "^2.103.16",
16
16
  "@graphcommerce/graphql": "^2.105.6",
17
17
  "@graphcommerce/image": "^2.105.5",
@@ -52,5 +52,5 @@
52
52
  "project": "./tsconfig.json"
53
53
  }
54
54
  },
55
- "gitHead": "8f156415c7f5a963e363f0d6d18fe5d6bbd5dba2"
55
+ "gitHead": "b4bdc1cd365ebdd0bad8e1ed6afd374123bb2908"
56
56
  }