@graphcommerce/next-ui 3.13.0 → 3.14.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/AppShell/AppShellHeader/index.tsx +9 -2
- package/AppShell/Logo.tsx +2 -9
- package/AppShell/MenuFab.tsx +6 -6
- package/AppShell/PlaceholderFab/index.tsx +1 -1
- package/AppShell/SheetShellBase/index.tsx +2 -2
- package/CHANGELOG.md +51 -0
- package/ChipMenu/index.tsx +3 -1
- package/FlagAvatar/index.tsx +1 -1
- package/Form/FormActions.tsx +2 -2
- package/FramerScroller/components/SidebarGallery.tsx +6 -1
- package/IconHeader/index.tsx +1 -1
- package/Pagination/index.tsx +2 -2
- package/Row/ContentLinks/index.tsx +1 -1
- package/Snackbar/MessageSnackbarImpl.tsx +1 -6
- package/StyledBadge/index.tsx +1 -1
- package/TextInputNumber/index.tsx +1 -3
- package/package.json +4 -4
|
@@ -323,12 +323,13 @@ export default function AppShellHeader(props: AppShellHeaderProps) {
|
|
|
323
323
|
type='button'
|
|
324
324
|
classes={{ root: classes.fab }}
|
|
325
325
|
onClick={() => router.go(closeSteps * -1)}
|
|
326
|
+
aria-label='Close'
|
|
326
327
|
>
|
|
327
328
|
<SvgImageSimple src={iconClose} />
|
|
328
329
|
</Fab>
|
|
329
330
|
) : (
|
|
330
331
|
<PageLink href='/' passHref>
|
|
331
|
-
<Fab size='small' classes={{ root: classes.fab }}>
|
|
332
|
+
<Fab size='small' classes={{ root: classes.fab }} aria-label='Close'>
|
|
332
333
|
<SvgImageSimple src={iconClose} />
|
|
333
334
|
</Fab>
|
|
334
335
|
</PageLink>
|
|
@@ -345,6 +346,7 @@ export default function AppShellHeader(props: AppShellHeaderProps) {
|
|
|
345
346
|
size='small'
|
|
346
347
|
className={classes.backButton}
|
|
347
348
|
startIcon={backIcon}
|
|
349
|
+
aria-label='Back'
|
|
348
350
|
>
|
|
349
351
|
{historyOnClick ? up?.title : 'Back'}
|
|
350
352
|
</Button>
|
|
@@ -353,7 +355,12 @@ export default function AppShellHeader(props: AppShellHeaderProps) {
|
|
|
353
355
|
if (!canClickBack && up?.href) {
|
|
354
356
|
back = (
|
|
355
357
|
<PageLink href={up?.href} passHref>
|
|
356
|
-
<Button
|
|
358
|
+
<Button
|
|
359
|
+
variant='pill-link'
|
|
360
|
+
className={classes.backButton}
|
|
361
|
+
startIcon={backIcon}
|
|
362
|
+
aria-label='Back'
|
|
363
|
+
>
|
|
357
364
|
{up?.title ?? 'Back'}
|
|
358
365
|
</Button>
|
|
359
366
|
</PageLink>
|
package/AppShell/Logo.tsx
CHANGED
|
@@ -8,9 +8,6 @@ import { UseStyles } from '../Styles'
|
|
|
8
8
|
const useStyles = makeStyles(
|
|
9
9
|
(theme: Theme) => ({
|
|
10
10
|
logo: {},
|
|
11
|
-
dark: {
|
|
12
|
-
filter: 'invert(100%)',
|
|
13
|
-
},
|
|
14
11
|
link: {
|
|
15
12
|
height: '100%',
|
|
16
13
|
width: 'max-content',
|
|
@@ -47,14 +44,10 @@ export default function Logo(props: LogoProps) {
|
|
|
47
44
|
|
|
48
45
|
return (
|
|
49
46
|
<PageLink href={href ?? '/'} passHref>
|
|
50
|
-
<a className={classes.link}>
|
|
47
|
+
<a className={classes.link} aria-label='Logo'>
|
|
51
48
|
<Image
|
|
52
49
|
{...{ ...image }}
|
|
53
|
-
className={clsx(
|
|
54
|
-
classes.logo,
|
|
55
|
-
theme.palette.type === 'dark' && classes.dark,
|
|
56
|
-
!alwaysShow && classes.logoHideOnMobile,
|
|
57
|
-
)}
|
|
50
|
+
className={clsx(classes.logo, !alwaysShow && classes.logoHideOnMobile)}
|
|
58
51
|
/>
|
|
59
52
|
</a>
|
|
60
53
|
</PageLink>
|
package/AppShell/MenuFab.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { m } from 'framer-motion'
|
|
12
12
|
import PageLink from 'next/link'
|
|
13
13
|
import { Router, useRouter } from 'next/router'
|
|
14
|
-
import React from 'react'
|
|
14
|
+
import React, { useEffect } from 'react'
|
|
15
15
|
import { UseStyles } from '../Styles'
|
|
16
16
|
import responsiveVal from '../Styles/responsiveVal'
|
|
17
17
|
import SvgImageSimple from '../SvgImage/SvgImageSimple'
|
|
@@ -56,10 +56,6 @@ const useStyles = makeStyles(
|
|
|
56
56
|
...theme.typography.h3,
|
|
57
57
|
fontWeight: 550,
|
|
58
58
|
lineHeight: 1,
|
|
59
|
-
// fontSize: '1.6em',
|
|
60
|
-
// fontWeight: 550,
|
|
61
|
-
// letterSpacing: '-0.0375em',
|
|
62
|
-
// lineHeight: 1,
|
|
63
59
|
},
|
|
64
60
|
menuItem: {},
|
|
65
61
|
}),
|
|
@@ -81,7 +77,11 @@ export default function MenuFab(props: MenuFabProps) {
|
|
|
81
77
|
|
|
82
78
|
const { filter, opacity, scale } = useFabAnimation()
|
|
83
79
|
|
|
84
|
-
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const clear = () => setOpenEl(null)
|
|
82
|
+
router.events.on('routeChangeStart', clear)
|
|
83
|
+
return () => router.events.off('routeChangeStart', clear)
|
|
84
|
+
}, [router])
|
|
85
85
|
|
|
86
86
|
return (
|
|
87
87
|
<m.div className={classes.menuWrapper} style={{ opacity, scale, filter }}>
|
|
@@ -20,7 +20,7 @@ export default function PlaceholderFab(props: PlaceholderFabProps) {
|
|
|
20
20
|
const classes = useStyles(props)
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
|
-
<Fab className={classes.placeholderCartFab} size='large' {...fabProps}>
|
|
23
|
+
<Fab className={classes.placeholderCartFab} size='large' {...fabProps} aria-label='Placeholder'>
|
|
24
24
|
<></>
|
|
25
25
|
</Fab>
|
|
26
26
|
)
|
|
@@ -60,7 +60,7 @@ function SheetShellBase(props: SheetShellBaseProps) {
|
|
|
60
60
|
const sheetClasses = useSheetStyles(props)
|
|
61
61
|
const router = useRouter()
|
|
62
62
|
const pageRouter = usePageRouter()
|
|
63
|
-
const { depth, closeSteps, active } = usePageContext()
|
|
63
|
+
const { depth, closeSteps, active, direction } = usePageContext()
|
|
64
64
|
const open = depth < 0 || router.asPath === pageRouter.asPath
|
|
65
65
|
const initialLocale = useRef(router.locale)
|
|
66
66
|
|
|
@@ -95,7 +95,7 @@ function SheetShellBase(props: SheetShellBaseProps) {
|
|
|
95
95
|
<Sheet open={open} onSnap={handleSnap} variant={variant} size={size}>
|
|
96
96
|
<SheetBackdrop onTap={handleClose} classes={sheetClasses} />
|
|
97
97
|
<SheetContainer classes={sheetContainerClasses}>
|
|
98
|
-
<SheetPanel classes={sheetClasses}>
|
|
98
|
+
<SheetPanel initial={direction === -1 ? 'snapPoint1' : 'closed'} classes={sheetClasses}>
|
|
99
99
|
{/* <FocusLock returnFocus={{ preventScroll: true }} disabled={!isActive}> */}
|
|
100
100
|
{children}
|
|
101
101
|
{/* </FocusLock> */}
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,57 @@
|
|
|
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.14.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.14.0...@graphcommerce/next-ui@3.14.1) (2021-11-04)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* can't remove filters on click icon ([2528802](https://github.com/ho-nl/m2-pwa/commit/252880216994da7f8e65c1b565ff996bbab0472a))
|
|
12
|
+
* Checkout button margin consistency ([9fcf7e7](https://github.com/ho-nl/m2-pwa/commit/9fcf7e7d96172448b2d2911771d6bf70ab976594))
|
|
13
|
+
* remove hardcoded fontSize ([e4e09e1](https://github.com/ho-nl/m2-pwa/commit/e4e09e11baeb8edeff634550b8cdb88571d96911))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# [3.14.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.13.2...@graphcommerce/next-ui@3.14.0) (2021-11-04)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **menu-fab:** fix route change start event handling ([20dde65](https://github.com/ho-nl/m2-pwa/commit/20dde65f8e8ead449b21f4f5292d653d003e6ead))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **sheet-shell-base:** stop animating drawer on browser back ([c6262f1](https://github.com/ho-nl/m2-pwa/commit/c6262f1c3a0d181e57bd5d4971efb469901503b1))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
## [3.13.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.13.1...@graphcommerce/next-ui@3.13.2) (2021-11-03)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* various accessibility improvements ([47481a9](https://github.com/ho-nl/m2-pwa/commit/47481a9a882ba87968de6dd797557b0b275d75fb))
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [3.13.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.13.0...@graphcommerce/next-ui@3.13.1) (2021-11-03)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* logo shouldnt invert, because it depends on the logo if it can be inverted. ([8426b09](https://github.com/ho-nl/m2-pwa/commit/8426b09688c7c77f45f912c56684ad1f378fc263))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
6
57
|
# [3.13.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.12.4...@graphcommerce/next-ui@3.13.0) (2021-11-03)
|
|
7
58
|
|
|
8
59
|
|
package/ChipMenu/index.tsx
CHANGED
|
@@ -67,7 +67,9 @@ export default function ChipMenu(props: ChipMenuProps) {
|
|
|
67
67
|
const classes = useChipMenuStyles(props)
|
|
68
68
|
|
|
69
69
|
let deleteIcon = selected ? (
|
|
70
|
-
<
|
|
70
|
+
<div>
|
|
71
|
+
<SvgImageSimple src={iconCancelAlt} className={classes.iconCancel} />
|
|
72
|
+
</div>
|
|
71
73
|
) : (
|
|
72
74
|
<SvgImageSimple src={iconChevronDown} />
|
|
73
75
|
)
|
package/FlagAvatar/index.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export default function FlagAvatar(props: FlagAvatarProps) {
|
|
|
19
19
|
{...avatarProps}
|
|
20
20
|
classes={classes}
|
|
21
21
|
imgProps={{ loading: 'lazy' }}
|
|
22
|
-
alt=
|
|
22
|
+
alt={country}
|
|
23
23
|
src={`https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.3/flags/4x3/${country}.svg`}
|
|
24
24
|
>
|
|
25
25
|
{country.toLocaleUpperCase()}
|
package/Form/FormActions.tsx
CHANGED
|
@@ -2,8 +2,8 @@ import { styled } from '@material-ui/core'
|
|
|
2
2
|
|
|
3
3
|
const FormActions = styled('div')(
|
|
4
4
|
({ theme }) => ({
|
|
5
|
-
paddingTop: theme.spacings.
|
|
6
|
-
paddingBottom: theme.spacings.
|
|
5
|
+
paddingTop: theme.spacings.md,
|
|
6
|
+
paddingBottom: theme.spacings.lg,
|
|
7
7
|
justifyContent: 'center',
|
|
8
8
|
display: 'grid',
|
|
9
9
|
gridAutoFlow: 'column',
|
|
@@ -261,7 +261,12 @@ export default function SidebarGallery(props: SidebarGalleryProps) {
|
|
|
261
261
|
))}
|
|
262
262
|
</Scroller>
|
|
263
263
|
<m.div layout className={classes.topRight}>
|
|
264
|
-
<Fab
|
|
264
|
+
<Fab
|
|
265
|
+
size='small'
|
|
266
|
+
className={classes.toggleIcon}
|
|
267
|
+
onMouseUp={toggle}
|
|
268
|
+
aria-label='Toggle Fullscreen'
|
|
269
|
+
>
|
|
265
270
|
{!zoomed ? (
|
|
266
271
|
<SvgImageSimple src={iconFullscreen} />
|
|
267
272
|
) : (
|
package/IconHeader/index.tsx
CHANGED
|
@@ -10,8 +10,8 @@ import SvgImage, { SvgImageProps } from '../SvgImage'
|
|
|
10
10
|
const useStyles = makeStyles(
|
|
11
11
|
(theme: Theme) => ({
|
|
12
12
|
container: {
|
|
13
|
+
...theme.typography.subtitle1,
|
|
13
14
|
textAlign: 'center',
|
|
14
|
-
fontSize: responsiveVal(16, 24),
|
|
15
15
|
},
|
|
16
16
|
innerContainer: {
|
|
17
17
|
display: 'flex',
|
package/Pagination/index.tsx
CHANGED
|
@@ -66,13 +66,13 @@ export default function Pagination(props: PagePaginationProps) {
|
|
|
66
66
|
const nextBtnProps = items[items.length - 1]
|
|
67
67
|
|
|
68
68
|
const chevronLeft = (
|
|
69
|
-
<Fab size='medium' disabled={page === 1} color='inherit'>
|
|
69
|
+
<Fab size='medium' disabled={page === 1} color='inherit' aria-label='Previous page'>
|
|
70
70
|
<SvgImageSimple src={iconChevronLeft} />
|
|
71
71
|
</Fab>
|
|
72
72
|
)
|
|
73
73
|
|
|
74
74
|
const chevronRight = (
|
|
75
|
-
<Fab size='medium' disabled={page === count} color='inherit'>
|
|
75
|
+
<Fab size='medium' disabled={page === count} color='inherit' aria-label='Next page'>
|
|
76
76
|
<SvgImageSimple src={iconChevronRight} />
|
|
77
77
|
</Fab>
|
|
78
78
|
)
|
|
@@ -33,7 +33,7 @@ export default function ContentLinks(props: ContentLinksProps) {
|
|
|
33
33
|
<Container className={classes.root} maxWidth={false}>
|
|
34
34
|
<ScrollerProvider scrollSnapAlign='none'>
|
|
35
35
|
<Scroller className={classes.scroller} hideScrollbar>
|
|
36
|
-
<Typography variant='body1' component='
|
|
36
|
+
<Typography variant='body1' component='h3' className={classes.title}>
|
|
37
37
|
{title}
|
|
38
38
|
</Typography>
|
|
39
39
|
{children}
|
|
@@ -177,12 +177,7 @@ export default function MessageSnackbarImpl(props: MessageSnackbarImplProps) {
|
|
|
177
177
|
{action}
|
|
178
178
|
</div>
|
|
179
179
|
)}
|
|
180
|
-
<Fab
|
|
181
|
-
className={classes.close}
|
|
182
|
-
aria-label='Close snackbar'
|
|
183
|
-
size='small'
|
|
184
|
-
onClick={hideSnackbar}
|
|
185
|
-
>
|
|
180
|
+
<Fab className={classes.close} aria-label='Close' size='small' onClick={hideSnackbar}>
|
|
186
181
|
<SvgImageSimple src={iconClose} />
|
|
187
182
|
</Fab>
|
|
188
183
|
</>
|
package/StyledBadge/index.tsx
CHANGED
|
@@ -3,12 +3,12 @@ import { Badge, withStyles } from '@material-ui/core'
|
|
|
3
3
|
const StyledBadge = withStyles((theme) => ({
|
|
4
4
|
colorError: {},
|
|
5
5
|
badge: {
|
|
6
|
+
...theme.typography.caption,
|
|
6
7
|
right: 6,
|
|
7
8
|
top: 6,
|
|
8
9
|
padding: 3,
|
|
9
10
|
color: '#FFF',
|
|
10
11
|
borderRadius: '100%',
|
|
11
|
-
fontSize: 10,
|
|
12
12
|
[theme.breakpoints.up('md')]: {
|
|
13
13
|
padding: 6,
|
|
14
14
|
right: 8,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.1",
|
|
4
4
|
"author": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@apollo/client": "^3.4.16",
|
|
13
13
|
"@graphcommerce/framer-next-pages": "^2.107.3",
|
|
14
|
-
"@graphcommerce/framer-scroller": "^1.0.
|
|
15
|
-
"@graphcommerce/framer-sheet": "^2.
|
|
14
|
+
"@graphcommerce/framer-scroller": "^1.0.2",
|
|
15
|
+
"@graphcommerce/framer-sheet": "^2.106.0",
|
|
16
16
|
"@graphcommerce/framer-utils": "^2.103.13",
|
|
17
17
|
"@graphcommerce/graphql": "^2.105.3",
|
|
18
18
|
"@graphcommerce/image": "^2.105.2",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"project": "./tsconfig.json"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "fe3be5507a3b323564cd53fca9831fb5053373ee"
|
|
57
57
|
}
|