@graphcommerce/next-ui 3.20.1 → 3.20.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.
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.20.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.20.1...@graphcommerce/next-ui@3.20.2) (2021-12-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * aria-labels missing ([16570d1](https://github.com/ho-nl/m2-pwa/commit/16570d11efcb264eba6c620c5508c9616c2d0a2a))
12
+ * make sure the overlay can be clicked away ([5b43e2f](https://github.com/ho-nl/m2-pwa/commit/5b43e2f0568c2587be63b74271409123fc0a44e2))
13
+
14
+
15
+
16
+
17
+
6
18
  ## [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
19
 
8
20
 
@@ -1,5 +1,5 @@
1
1
  import { usePageRouter, useUp, usePrevUp, usePageContext } from '@graphcommerce/framer-next-pages'
2
- import { Trans } from '@lingui/macro'
2
+ import { t } from '@lingui/macro'
3
3
  import PageLink from 'next/link'
4
4
  import React from 'react'
5
5
  import Button, { ButtonProps } from '../../Button'
@@ -30,17 +30,25 @@ export default function LayoutHeaderBack(props: BackProps) {
30
30
  const backIcon = <SvgImageSimple src={iconChevronLeft} />
31
31
  const canClickBack = backSteps > 0 && router.asPath !== prevUp?.href
32
32
 
33
- if (canClickBack)
33
+ if (canClickBack) {
34
+ const label = up?.href === router.asPath ? up.title : t`Back`
34
35
  return (
35
- <Button onClick={() => router.back()} variant='pill-link' startIcon={backIcon} {...props}>
36
- {up?.href === router.asPath ? up.title : <Trans>Back</Trans>}
36
+ <Button
37
+ onClick={() => router.back()}
38
+ variant='pill-link'
39
+ startIcon={backIcon}
40
+ aria-label={label}
41
+ {...props}
42
+ >
43
+ {label}
37
44
  </Button>
38
45
  )
46
+ }
39
47
 
40
48
  if (up?.href && up.href !== router.asPath)
41
49
  return (
42
50
  <PageLink href={up.href} passHref>
43
- <Button variant='pill-link' startIcon={backIcon} {...props}>
51
+ <Button variant='pill-link' startIcon={backIcon} aria-label={up.title} {...props}>
44
52
  {up.title}
45
53
  </Button>
46
54
  </PageLink>
@@ -1,7 +1,7 @@
1
1
  import { usePageContext, usePageRouter, useScrollOffset } from '@graphcommerce/framer-next-pages'
2
2
  import { Scroller, useScrollerContext, useScrollTo } from '@graphcommerce/framer-scroller'
3
3
  import { useElementScroll, useIsomorphicLayoutEffect } from '@graphcommerce/framer-utils'
4
- import { makeStyles, Theme } from '@material-ui/core'
4
+ import { makeStyles, Theme, ClickAwayListener } from '@material-ui/core'
5
5
  import {
6
6
  m,
7
7
  MotionValue,
@@ -339,11 +339,13 @@ export function LayoutOverlayBase(props: LayoutOverlayBaseProps) {
339
339
  <>
340
340
  <m.div {...className('backdrop')} style={{ opacity: positions.open.visible }} />
341
341
  <Scroller {...className('root')} grid={false} hideScrollbar>
342
- <div {...className('beforeOverlay')} onClick={closeOverlay} />
342
+ <div {...className('beforeOverlay')} />
343
343
  <div {...className('overlay')} ref={overlayRef}>
344
- <div {...className('overlayPane')}>
345
- <LayoutProvider scroll={scrollWithoffset}>{children}</LayoutProvider>
346
- </div>
344
+ <ClickAwayListener onClickAway={closeOverlay}>
345
+ <div {...className('overlayPane')}>
346
+ <LayoutProvider scroll={scrollWithoffset}>{children}</LayoutProvider>
347
+ </div>
348
+ </ClickAwayListener>
347
349
  </div>
348
350
  <div {...className('afterOverlay')} />
349
351
  </Scroller>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/next-ui",
3
- "version": "3.20.1",
3
+ "version": "3.20.2",
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.1",
14
+ "@graphcommerce/framer-scroller": "^1.1.2",
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": "b4bdc1cd365ebdd0bad8e1ed6afd374123bb2908"
55
+ "gitHead": "688a7042901bf36f8ab8bbf8e1886570a5350b9e"
56
56
  }