@graphcommerce/next-ui 7.0.0-canary.13 → 7.0.0-canary.21

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
@@ -1,8 +1,32 @@
1
1
  # Change Log
2
2
 
3
- ## 7.0.0-canary.13
3
+ ## 7.0.0-canary.21
4
4
 
5
- ## 7.0.0-canary.12
5
+ ## 6.2.0-canary.20
6
+
7
+ ## 6.2.0-canary.19
8
+
9
+ ## 6.2.0-canary.18
10
+
11
+ ## 6.2.0-canary.17
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1934](https://github.com/graphcommerce-org/graphcommerce/pull/1934) [`96ac0320a`](https://github.com/graphcommerce-org/graphcommerce/commit/96ac0320a30bc55a6db5d46663d28b552fda4db6) - Fixed floating overlays not closing when clicking beside the overlay ([@bramvanderholst](https://github.com/bramvanderholst))
16
+
17
+ ## 6.2.0-canary.16
18
+
19
+ ### Patch Changes
20
+
21
+ - [#1930](https://github.com/graphcommerce-org/graphcommerce/pull/1930) [`c8d023e9e`](https://github.com/graphcommerce-org/graphcommerce/commit/c8d023e9e874131cd9f8fe192b1fca5fe1a26ee3) - Fix the close menu on search and add the option to secondary menu items ([@StefanAngenent](https://github.com/StefanAngenent))
22
+
23
+ ## 6.2.0-canary.15
24
+
25
+ ## 6.2.0-canary.14
26
+
27
+ ## 6.2.0-canary.13
28
+
29
+ ## 6.2.0-canary.12
6
30
 
7
31
  ## 6.2.0-canary.11
8
32
 
@@ -1,6 +1,6 @@
1
1
  import { ListItemButton, ListItemIcon, ListItemText, SxProps, Theme } from '@mui/material'
2
2
  import { useRouter } from 'next/router'
3
- import React from 'react'
3
+ import React, { MouseEventHandler } from 'react'
4
4
  import { extendableComponent } from '../Styles'
5
5
  import { NextLink } from '../Theme'
6
6
 
@@ -9,6 +9,7 @@ export type FabMenuSecondaryItemProps = {
9
9
  children: React.ReactNode
10
10
  icon: React.ReactNode
11
11
  sx?: SxProps<Theme>
12
+ onClick?: MouseEventHandler<HTMLElement>
12
13
  }
13
14
 
14
15
  const compName = 'MenuFabSecondaryItem' as const
@@ -16,12 +17,18 @@ const parts = ['root', 'icon', 'text'] as const
16
17
  const { classes } = extendableComponent(compName, parts)
17
18
 
18
19
  export function MenuFabSecondaryItem(props: FabMenuSecondaryItemProps) {
19
- const { href, children, icon, sx = [] } = props
20
+ const { href, children, onClick, icon, sx = [] } = props
20
21
  const router = useRouter()
21
22
 
23
+ const handleClick: MouseEventHandler<HTMLElement> = (e) => {
24
+ e.preventDefault()
25
+ onClick?.(e)
26
+ return router.push(href)
27
+ }
28
+
22
29
  return (
23
30
  <ListItemButton
24
- href={href}
31
+ onClick={handleClick}
25
32
  component={NextLink}
26
33
  className={classes.root}
27
34
  sx={[{}, ...(Array.isArray(sx) ? sx : [sx])]}
@@ -331,10 +331,13 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
331
331
 
332
332
  const onClickAway = useCallback(
333
333
  (event: React.MouseEvent<HTMLDivElement>) => {
334
- const isTarget = event.target === beforeRef.current || event.target === overlayPaneRef.current
334
+ const isTarget =
335
+ event.target === beforeRef.current ||
336
+ event.target === overlayPaneRef.current ||
337
+ event.target === scrollerRef.current
335
338
  if (isTarget && snap.get()) closeOverlay()
336
339
  },
337
- [closeOverlay, snap],
340
+ [closeOverlay, snap, scrollerRef],
338
341
  )
339
342
 
340
343
  return (
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "7.0.0-canary.13",
5
+ "version": "7.0.0-canary.21",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -18,18 +18,18 @@
18
18
  "@emotion/react": "^11.10.6",
19
19
  "@emotion/server": "^11.4.0",
20
20
  "@emotion/styled": "^11.10.6",
21
- "@graphcommerce/framer-next-pages": "7.0.0-canary.13",
22
- "@graphcommerce/framer-scroller": "7.0.0-canary.13",
23
- "@graphcommerce/framer-utils": "7.0.0-canary.13",
24
- "@graphcommerce/image": "7.0.0-canary.13",
21
+ "@graphcommerce/framer-next-pages": "7.0.0-canary.21",
22
+ "@graphcommerce/framer-scroller": "7.0.0-canary.21",
23
+ "@graphcommerce/framer-utils": "7.0.0-canary.21",
24
+ "@graphcommerce/image": "7.0.0-canary.21",
25
25
  "cookie": "^0.5.0",
26
26
  "react-is": "^18.2.0",
27
27
  "schema-dts": "^1.1.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@graphcommerce/eslint-config-pwa": "7.0.0-canary.13",
31
- "@graphcommerce/prettier-config-pwa": "7.0.0-canary.13",
32
- "@graphcommerce/typescript-config-pwa": "7.0.0-canary.13",
30
+ "@graphcommerce/eslint-config-pwa": "7.0.0-canary.21",
31
+ "@graphcommerce/prettier-config-pwa": "7.0.0-canary.21",
32
+ "@graphcommerce/typescript-config-pwa": "7.0.0-canary.21",
33
33
  "@types/cookie": "^0.5.1",
34
34
  "@types/react-is": "^17.0.3",
35
35
  "typescript": "4.9.5"