@graphcommerce/next-ui 3.17.1 → 3.19.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.
- package/AppShell/AppShellHeader/index.tsx +2 -2
- package/AppShell/DesktopNavBar.tsx +2 -1
- package/AppShell/Footer/index.tsx +1 -1
- package/AppShell/MenuFab.tsx +14 -5
- package/AppShell/useFixedFabAnimation.tsx +3 -4
- package/Blog/BlogAuthor/index.tsx +10 -6
- package/Blog/BlogHeader/index.tsx +6 -1
- package/Blog/BlogListItem/index.tsx +1 -0
- package/Button/index.tsx +1 -1
- package/CHANGELOG.md +71 -0
- package/Form/index.tsx +8 -3
- package/FramerScroller/components/SidebarGallery.tsx +1 -1
- package/Row/HeroBanner/index.tsx +21 -10
- package/Row/ImageText/index.tsx +12 -5
- package/Row/ImageTextBoxed/index.tsx +2 -0
- package/Row/ParagraphWithSidebarSlide/index.tsx +2 -0
- package/Row/SpecialBanner/index.tsx +7 -4
- package/Snackbar/MessageSnackbarImpl.tsx +1 -0
- package/StarRatingField/index.tsx +8 -8
- package/Styles/breakpointVal.tsx +22 -0
- package/SvgImage/SvgImageSimple.tsx +11 -4
- package/ToggleButton/index.tsx +5 -10
- package/UspList/UspListItem.tsx +3 -1
- package/icons/index.tsx +2 -0
- package/index.ts +1 -0
- package/package.json +2 -2
|
@@ -131,7 +131,6 @@ const useStyles = makeStyles(
|
|
|
131
131
|
sheetHeaderFillMobileOnly: {
|
|
132
132
|
[theme.breakpoints.up('md')]: {
|
|
133
133
|
pointerEvents: 'none',
|
|
134
|
-
background: 'green',
|
|
135
134
|
position: 'fixed',
|
|
136
135
|
},
|
|
137
136
|
},
|
|
@@ -192,7 +191,7 @@ const useStyles = makeStyles(
|
|
|
192
191
|
pointerEvents: 'all',
|
|
193
192
|
},
|
|
194
193
|
'& * > button': {
|
|
195
|
-
boxShadow: theme.shadows[
|
|
194
|
+
boxShadow: theme.shadows[6],
|
|
196
195
|
},
|
|
197
196
|
[theme.breakpoints.up('md')]: {
|
|
198
197
|
position: 'fixed',
|
|
@@ -202,6 +201,7 @@ const useStyles = makeStyles(
|
|
|
202
201
|
sheetShellActionsNoButtonShadow: {
|
|
203
202
|
[theme.breakpoints.down('sm')]: {
|
|
204
203
|
'& * > button': {
|
|
204
|
+
backgroundColor: 'unset',
|
|
205
205
|
boxShadow: 'none',
|
|
206
206
|
},
|
|
207
207
|
},
|
|
@@ -62,6 +62,7 @@ const useStyles = makeStyles(
|
|
|
62
62
|
'&:hover': {
|
|
63
63
|
textDecoration: 'none',
|
|
64
64
|
},
|
|
65
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
65
66
|
paddingTop: 6,
|
|
66
67
|
},
|
|
67
68
|
line: {
|
|
@@ -101,7 +102,7 @@ export default function DesktopNavBar(props: MenuTabsProps) {
|
|
|
101
102
|
{menu.map(({ href, children, ...linkProps }) => (
|
|
102
103
|
<PageLink key={href.toString()} href={href} {...linkProps} passHref>
|
|
103
104
|
<Link
|
|
104
|
-
variant='
|
|
105
|
+
variant='subtitle1'
|
|
105
106
|
{...LinkProps}
|
|
106
107
|
className={clsx(classes.link, LinkProps?.className)}
|
|
107
108
|
>
|
package/AppShell/MenuFab.tsx
CHANGED
|
@@ -15,7 +15,7 @@ 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'
|
|
18
|
-
import { iconMenu } from '../icons'
|
|
18
|
+
import { iconMenu, iconClose } from '../icons'
|
|
19
19
|
import { MenuProps } from './Menu'
|
|
20
20
|
import useFabAnimation from './useFabAnimation'
|
|
21
21
|
|
|
@@ -36,7 +36,6 @@ const useStyles = makeStyles(
|
|
|
36
36
|
},
|
|
37
37
|
menuFab: {
|
|
38
38
|
background: theme.palette.text.primary,
|
|
39
|
-
boxShadow: theme.shadows[2],
|
|
40
39
|
width: responsiveVal(42, 56),
|
|
41
40
|
height: responsiveVal(42, 56),
|
|
42
41
|
pointerEvents: 'all',
|
|
@@ -44,13 +43,17 @@ const useStyles = makeStyles(
|
|
|
44
43
|
background: theme.palette.text.primary,
|
|
45
44
|
},
|
|
46
45
|
'& svg': {
|
|
47
|
-
|
|
46
|
+
color: theme.palette.background.paper,
|
|
48
47
|
},
|
|
49
48
|
},
|
|
50
49
|
menu: {
|
|
51
50
|
backgroundColor: theme.palette.background.paper,
|
|
52
51
|
color: theme.palette.text.primary,
|
|
53
52
|
minWidth: responsiveVal(200, 280),
|
|
53
|
+
marginTop: `calc(${responsiveVal(42, 56)} + 3px)`,
|
|
54
|
+
[theme.breakpoints.down('sm')]: {
|
|
55
|
+
marginTop: `calc((${responsiveVal(42, 56)} + 12px) * -1)`,
|
|
56
|
+
},
|
|
54
57
|
},
|
|
55
58
|
menuItemText: {
|
|
56
59
|
...theme.typography.h4,
|
|
@@ -66,10 +69,11 @@ export type MenuFabProps = MenuProps &
|
|
|
66
69
|
children?: React.ReactNode
|
|
67
70
|
search?: React.ReactNode
|
|
68
71
|
menuIcon?: React.ReactNode
|
|
72
|
+
closeIcon?: React.ReactNode
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
export default function MenuFab(props: MenuFabProps) {
|
|
72
|
-
const { menu, children, search, menuIcon } = props
|
|
76
|
+
const { menu, children, search, menuIcon, closeIcon } = props
|
|
73
77
|
const classes = useStyles(props)
|
|
74
78
|
const router = useRouter()
|
|
75
79
|
const [openEl, setOpenEl] = React.useState<null | HTMLElement>(null)
|
|
@@ -91,7 +95,12 @@ export default function MenuFab(props: MenuFabProps) {
|
|
|
91
95
|
onClick={(event) => setOpenEl(event.currentTarget)}
|
|
92
96
|
className={classes.menuFab}
|
|
93
97
|
>
|
|
94
|
-
{
|
|
98
|
+
{closeIcon ?? (
|
|
99
|
+
<SvgImageSimple src={iconClose} inverted style={{ display: openEl ? 'block' : 'none' }} />
|
|
100
|
+
)}
|
|
101
|
+
{menuIcon ?? (
|
|
102
|
+
<SvgImageSimple src={iconMenu} inverted style={{ display: openEl ? 'none' : 'block' }} />
|
|
103
|
+
)}
|
|
95
104
|
</Fab>
|
|
96
105
|
|
|
97
106
|
<Menu
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { alpha, useTheme } from '@material-ui/core'
|
|
2
|
-
import { useMotionTemplate, useTransform, useViewportScroll } from 'framer-motion'
|
|
2
|
+
import { useMotionTemplate, useMotionValue, useTransform, useViewportScroll } from 'framer-motion'
|
|
3
3
|
|
|
4
4
|
export default function useFixedFabAnimation() {
|
|
5
5
|
const theme = useTheme()
|
|
6
6
|
const { scrollY } = useViewportScroll()
|
|
7
|
-
const opacity = useTransform(scrollY, [50, 60], [0,
|
|
7
|
+
const opacity = useTransform(scrollY, [50, 60], [0, 1])
|
|
8
8
|
const opacity1 = useTransform(
|
|
9
9
|
scrollY,
|
|
10
10
|
[0, 10],
|
|
11
11
|
[alpha(theme.palette.background.paper, 0), alpha(theme.palette.background.paper, 1)],
|
|
12
12
|
)
|
|
13
|
-
const boxShadow = useMotionTemplate`0 2px 10px 0 rgba(0, 0, 0, ${opacity})`
|
|
14
13
|
const backgroundColor = useMotionTemplate`${opacity1}`
|
|
15
|
-
return {
|
|
14
|
+
return { backgroundColor, opacity }
|
|
16
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Avatar, Chip, makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { responsiveVal } from '../..'
|
|
3
4
|
import { UseStyles } from '../../Styles'
|
|
4
5
|
|
|
5
6
|
const useStyles = makeStyles(
|
|
@@ -12,20 +13,23 @@ const useStyles = makeStyles(
|
|
|
12
13
|
marginBottom: theme.spacings.md,
|
|
13
14
|
},
|
|
14
15
|
authorChip: {
|
|
15
|
-
height: 66,
|
|
16
|
+
height: responsiveVal(44, 66),
|
|
16
17
|
'& .MuiChip-label': {
|
|
17
|
-
paddingLeft: 14,
|
|
18
|
-
paddingRight: 14,
|
|
18
|
+
paddingLeft: responsiveVal(10, 14),
|
|
19
|
+
paddingRight: responsiveVal(14, 18),
|
|
19
20
|
},
|
|
20
21
|
'& .MuiAvatar-root': {
|
|
21
|
-
width: 44,
|
|
22
|
-
height: 44,
|
|
22
|
+
width: responsiveVal(28, 44),
|
|
23
|
+
height: responsiveVal(28, 44),
|
|
23
24
|
},
|
|
24
25
|
},
|
|
25
26
|
date: {
|
|
27
|
+
lineHeight: 1.4,
|
|
26
28
|
color: theme.palette.text.disabled,
|
|
27
29
|
},
|
|
28
|
-
author: {
|
|
30
|
+
author: {
|
|
31
|
+
lineHeight: 1.4,
|
|
32
|
+
},
|
|
29
33
|
}),
|
|
30
34
|
{ name: 'BlogAuthor' },
|
|
31
35
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { makeStyles, Theme, Typography } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
+
import { responsiveVal } from '../..'
|
|
3
4
|
import Row from '../../Row'
|
|
4
5
|
import { UseStyles } from '../../Styles'
|
|
5
6
|
|
|
@@ -10,7 +11,11 @@ const useStyles = makeStyles(
|
|
|
10
11
|
margin: `0 auto`,
|
|
11
12
|
marginBottom: theme.spacings.md,
|
|
12
13
|
},
|
|
13
|
-
asset: {
|
|
14
|
+
asset: {
|
|
15
|
+
'& img': {
|
|
16
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
17
|
+
},
|
|
18
|
+
},
|
|
14
19
|
}),
|
|
15
20
|
{ name: 'BlogHeader' },
|
|
16
21
|
)
|
package/Button/index.tsx
CHANGED
|
@@ -67,7 +67,7 @@ const useStyles = makeStyles<
|
|
|
67
67
|
backgroundColor: theme.palette.secondary.main,
|
|
68
68
|
color: theme.palette.primary.contrastText,
|
|
69
69
|
borderRadius: '99em',
|
|
70
|
-
boxShadow: theme.shadows[
|
|
70
|
+
boxShadow: theme.shadows[6],
|
|
71
71
|
'&:hover': {
|
|
72
72
|
background: theme.palette.secondary.dark,
|
|
73
73
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,77 @@
|
|
|
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.19.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.18.2...@graphcommerce/next-ui@3.19.0) (2021-12-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* borderRadius ([0999901](https://github.com/ho-nl/m2-pwa/commit/0999901f6a3265f40fef18e72702d80158d8c4a9))
|
|
12
|
+
* borderRadius ([b9cffcc](https://github.com/ho-nl/m2-pwa/commit/b9cffccf444cb2ff8d6257ef3a64c0ea18e30477))
|
|
13
|
+
* borderRadius toggleButton ([4a97800](https://github.com/ho-nl/m2-pwa/commit/4a97800150bbfe03692a66d7fbde5705a32b9cd7))
|
|
14
|
+
* build ([ba97378](https://github.com/ho-nl/m2-pwa/commit/ba97378d40d70b3f47c4c252600c669a53568c27))
|
|
15
|
+
* build ([b6cb704](https://github.com/ho-nl/m2-pwa/commit/b6cb7048c1208648687621000ab0d6789032d480))
|
|
16
|
+
* finetune svg stroke width ([d788d72](https://github.com/ho-nl/m2-pwa/commit/d788d72c88d5b924a14e9fdde1a52f62be7c274c))
|
|
17
|
+
* flicker on menu icon ([04d9633](https://github.com/ho-nl/m2-pwa/commit/04d96331cfdd4678a56a4eb9170141800c03a6a1))
|
|
18
|
+
* hero text spacing ([79dd6aa](https://github.com/ho-nl/m2-pwa/commit/79dd6aa2fe576104ebbbdd092f6b415d319dec48))
|
|
19
|
+
* icon OrderBefore ([25a2390](https://github.com/ho-nl/m2-pwa/commit/25a2390321c7047c5191a15a9352020b8161ff7a))
|
|
20
|
+
* icons ([c561e20](https://github.com/ho-nl/m2-pwa/commit/c561e20a247fef5ea33ac10dbecf55d1e5500dec))
|
|
21
|
+
* prevent scaling of video on mobile ([168b5b9](https://github.com/ho-nl/m2-pwa/commit/168b5b9451dbe373703ebc76c44516d1c0eb316f))
|
|
22
|
+
* Tap targets are not sized appropriately ([b3b3339](https://github.com/ho-nl/m2-pwa/commit/b3b33398c26cfe775f2e9fc4dacd8eaad2e02725))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* borderRadius based on theme.shape.borderRadius ([7c34937](https://github.com/ho-nl/m2-pwa/commit/7c349376cd41a131c628324c299106fdb7e60484))
|
|
28
|
+
* breakpointVal ([0294503](https://github.com/ho-nl/m2-pwa/commit/029450343051cf6995babad9f9b42c7e6ad1094e))
|
|
29
|
+
* closeable menu ([5f94bb5](https://github.com/ho-nl/m2-pwa/commit/5f94bb5644ce1058ec705a8acced71ba2ba95e04))
|
|
30
|
+
* icon for 404 ([ff32915](https://github.com/ho-nl/m2-pwa/commit/ff3291578719cb7105d1045d68a78952b27da7fe))
|
|
31
|
+
* introduce borderRadius ([183afbc](https://github.com/ho-nl/m2-pwa/commit/183afbc8ee269f6694c372b06afdf41302f86c09))
|
|
32
|
+
* responsiveTyp ([6108b61](https://github.com/ho-nl/m2-pwa/commit/6108b6148e76ddbbe2db1614f10aaf88423db5ca))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [3.18.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.18.1...@graphcommerce/next-ui@3.18.2) (2021-11-27)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* shadow snackbar with elevation ([8d7d011](https://github.com/ho-nl/m2-pwa/commit/8d7d0119357325f5c838def4ae8dc4ae19a43a6f))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
## [3.18.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.18.0...@graphcommerce/next-ui@3.18.1) (2021-11-22)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* green app shell header ([a0774e6](https://github.com/ho-nl/m2-pwa/commit/a0774e6da078ea1e96d7d93bccafae5b55a69792))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# [3.18.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.17.1...@graphcommerce/next-ui@3.18.0) (2021-11-22)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Bug Fixes
|
|
64
|
+
|
|
65
|
+
* remove styles ([335c8cb](https://github.com/ho-nl/m2-pwa/commit/335c8cb663bdd4c1670cdb3ea88c8a9a42bcf745))
|
|
66
|
+
* revert to SvgImageSimple ([b247c6b](https://github.com/ho-nl/m2-pwa/commit/b247c6b96979bc313e597a8ffe1275b73f38bd6a))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
* use Rating component ([ec54f45](https://github.com/ho-nl/m2-pwa/commit/ec54f4522adb2d330bbdecc2ce032f86f13fb7a6))
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
6
77
|
## [3.17.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-ui@3.17.0...@graphcommerce/next-ui@3.17.1) (2021-11-12)
|
|
7
78
|
|
|
8
79
|
|
package/Form/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { darken, makeStyles, Theme } from '@material-ui/core'
|
|
1
|
+
import { darken, lighten, makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import React from 'react'
|
|
4
|
+
import { responsiveVal } from '..'
|
|
4
5
|
import { UseStyles } from '../Styles'
|
|
5
6
|
|
|
6
7
|
const useStyles = makeStyles(
|
|
@@ -14,12 +15,16 @@ const useStyles = makeStyles(
|
|
|
14
15
|
background: theme.palette.secondary.light,
|
|
15
16
|
},
|
|
16
17
|
default: {
|
|
17
|
-
background:
|
|
18
|
+
background:
|
|
19
|
+
theme.palette.type === 'light'
|
|
20
|
+
? darken(theme.palette.background.default, 0.03)
|
|
21
|
+
: lighten(theme.palette.background.default, 0.2),
|
|
18
22
|
},
|
|
19
23
|
contained: {
|
|
20
24
|
padding: theme.spacings.sm,
|
|
25
|
+
// paddingTop: theme.spacings.md,
|
|
21
26
|
overflow: 'hidden',
|
|
22
|
-
borderRadius:
|
|
27
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 3, theme.shape.borderRadius * 4),
|
|
23
28
|
},
|
|
24
29
|
}),
|
|
25
30
|
{ name: 'Form' },
|
|
@@ -108,7 +108,7 @@ const useStyles = makeStyles(
|
|
|
108
108
|
sidebar: {
|
|
109
109
|
boxSizing: 'border-box',
|
|
110
110
|
width: '100%',
|
|
111
|
-
padding: `${theme.spacings.
|
|
111
|
+
padding: `${theme.spacings.lg} ${theme.page.horizontal}`,
|
|
112
112
|
[theme.breakpoints.up('md')]: {
|
|
113
113
|
paddingLeft: theme.spacings.lg,
|
|
114
114
|
},
|
package/Row/HeroBanner/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContainerProps, Theme, makeStyles } from '@material-ui/core'
|
|
1
|
+
import { ContainerProps, Theme, makeStyles, useTheme, useMediaQuery } from '@material-ui/core'
|
|
2
2
|
import { m, useTransform, useViewportScroll } from 'framer-motion'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import Row from '..'
|
|
@@ -7,10 +7,6 @@ import responsiveVal from '../../Styles/responsiveVal'
|
|
|
7
7
|
|
|
8
8
|
const useStyles = makeStyles(
|
|
9
9
|
(theme: Theme) => ({
|
|
10
|
-
container: {
|
|
11
|
-
paddingLeft: 0,
|
|
12
|
-
paddingRight: 0,
|
|
13
|
-
},
|
|
14
10
|
wrapper: {
|
|
15
11
|
position: 'relative',
|
|
16
12
|
},
|
|
@@ -22,6 +18,7 @@ const useStyles = makeStyles(
|
|
|
22
18
|
justifyItems: 'center',
|
|
23
19
|
alignContent: 'center',
|
|
24
20
|
padding: `${theme.spacings.lg} ${theme.spacings.md}`,
|
|
21
|
+
paddingTop: `calc(${theme.spacings.lg} - ${theme.spacings.md})`,
|
|
25
22
|
minHeight: `calc(100vh - ${theme.page.headerInnerHeight.sm})`,
|
|
26
23
|
'& > *': {
|
|
27
24
|
zIndex: 1,
|
|
@@ -38,6 +35,7 @@ const useStyles = makeStyles(
|
|
|
38
35
|
},
|
|
39
36
|
[theme.breakpoints.up('lg')]: {
|
|
40
37
|
padding: `${theme.spacings.lg} ${theme.spacings.lg}`,
|
|
38
|
+
paddingTop: `calc(${theme.spacings.lg} - ${theme.spacings.md})`,
|
|
41
39
|
width: '50%',
|
|
42
40
|
},
|
|
43
41
|
},
|
|
@@ -55,11 +53,18 @@ const useStyles = makeStyles(
|
|
|
55
53
|
objectFit: 'cover',
|
|
56
54
|
width: '100%',
|
|
57
55
|
height: '100%',
|
|
56
|
+
[theme.breakpoints.down('sm')]: {
|
|
57
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
58
|
+
},
|
|
58
59
|
},
|
|
59
60
|
[theme.breakpoints.up('md')]: {
|
|
60
61
|
height: '100%',
|
|
61
62
|
},
|
|
62
63
|
},
|
|
64
|
+
animated: {
|
|
65
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
66
|
+
overflow: 'hidden',
|
|
67
|
+
},
|
|
63
68
|
}),
|
|
64
69
|
{ name: 'HeroBanner' },
|
|
65
70
|
)
|
|
@@ -74,23 +79,29 @@ export type HeroBannerProps = UseStyles<typeof useStyles> &
|
|
|
74
79
|
export default function HeroBanner(props: HeroBannerProps) {
|
|
75
80
|
const { pageLinks, videoSrc, children, ...containerProps } = props
|
|
76
81
|
const classes = useStyles(props)
|
|
77
|
-
|
|
82
|
+
const theme = useTheme()
|
|
78
83
|
const { scrollY } = useViewportScroll()
|
|
79
|
-
const
|
|
84
|
+
const width = useTransform(
|
|
85
|
+
scrollY,
|
|
86
|
+
[10, 150],
|
|
87
|
+
[`calc(100% - ${responsiveVal(20, 60)}))`, `calc(100% - ${responsiveVal(0, 0)})`],
|
|
88
|
+
)
|
|
89
|
+
const matches = useMediaQuery(theme.breakpoints.down('sm'))
|
|
90
|
+
const borderRadius = useTransform(
|
|
80
91
|
scrollY,
|
|
81
92
|
[10, 150],
|
|
82
|
-
[
|
|
93
|
+
[`${responsiveVal(8, 12)}`, `${responsiveVal(0, 0)}`],
|
|
83
94
|
)
|
|
84
95
|
|
|
85
96
|
return (
|
|
86
|
-
<Row maxWidth={false} {...containerProps}
|
|
97
|
+
<Row maxWidth={false} {...containerProps} disableGutters>
|
|
87
98
|
<div className={classes.wrapper}>
|
|
88
99
|
<div className={classes.copy}>
|
|
89
100
|
{children}
|
|
90
101
|
{pageLinks}
|
|
91
102
|
</div>
|
|
92
103
|
<div className={classes.asset}>
|
|
93
|
-
<m.div style={{ width:
|
|
104
|
+
<m.div style={{ width: !matches ? width : 0, borderRadius }} className={classes.animated}>
|
|
94
105
|
<video src={videoSrc} autoPlay muted loop playsInline disableRemotePlayback />
|
|
95
106
|
</m.div>
|
|
96
107
|
</div>
|
package/Row/ImageText/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import Row from '..'
|
|
4
|
+
import { responsiveVal } from '../..'
|
|
4
5
|
import { UseStyles } from '../../Styles'
|
|
5
6
|
|
|
6
7
|
const useStyles = makeStyles(
|
|
@@ -13,12 +14,15 @@ const useStyles = makeStyles(
|
|
|
13
14
|
: theme.palette.background.paper,
|
|
14
15
|
justifyItems: 'center',
|
|
15
16
|
columnGap: theme.spacings.lg,
|
|
16
|
-
|
|
17
|
+
paddingTop: theme.spacings.lg,
|
|
18
|
+
paddingBottom: theme.spacings.lg,
|
|
17
19
|
[theme.breakpoints.up('md')]: {
|
|
18
|
-
|
|
20
|
+
paddingTop: 0,
|
|
21
|
+
paddingBottom: 0,
|
|
19
22
|
background: 'none',
|
|
20
23
|
gridTemplateColumns: '1fr 1fr',
|
|
21
24
|
},
|
|
25
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
22
26
|
},
|
|
23
27
|
asset: {
|
|
24
28
|
height: '100%',
|
|
@@ -27,6 +31,7 @@ const useStyles = makeStyles(
|
|
|
27
31
|
height: '100%',
|
|
28
32
|
width: '100%',
|
|
29
33
|
objectFit: 'cover',
|
|
34
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
30
35
|
},
|
|
31
36
|
},
|
|
32
37
|
copy: {
|
|
@@ -64,9 +69,11 @@ export default function ImageText(props: ImageTextProps) {
|
|
|
64
69
|
const classes = useStyles(props)
|
|
65
70
|
|
|
66
71
|
return (
|
|
67
|
-
<Row
|
|
68
|
-
<
|
|
69
|
-
|
|
72
|
+
<Row maxWidth={false}>
|
|
73
|
+
<Row className={classes.wrapper}>
|
|
74
|
+
<div className={classes.asset}>{item}</div>
|
|
75
|
+
<div className={classes.copy}>{children}</div>
|
|
76
|
+
</Row>{' '}
|
|
70
77
|
</Row>
|
|
71
78
|
)
|
|
72
79
|
}
|
|
@@ -17,6 +17,8 @@ const useStyles = makeStyles(
|
|
|
17
17
|
gridTemplateColumns: '1fr auto',
|
|
18
18
|
columnGap: `${theme.spacings.lg}`,
|
|
19
19
|
},
|
|
20
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
21
|
+
overflow: 'hidden',
|
|
20
22
|
},
|
|
21
23
|
asset: {
|
|
22
24
|
height: '100%',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContainerProps, makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import Row from '..'
|
|
3
|
+
import { responsiveVal } from '../..'
|
|
3
4
|
import { UseStyles } from '../../Styles'
|
|
4
5
|
|
|
5
6
|
const useStyles = makeStyles(
|
|
@@ -27,6 +28,7 @@ const useStyles = makeStyles(
|
|
|
27
28
|
filter: 'brightness(100%)',
|
|
28
29
|
height: '100%',
|
|
29
30
|
},
|
|
31
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
30
32
|
},
|
|
31
33
|
},
|
|
32
34
|
copy: {
|
|
@@ -10,14 +10,16 @@ const useStyles = makeStyles(
|
|
|
10
10
|
background: theme.palette.background.paper,
|
|
11
11
|
justifyItems: 'center',
|
|
12
12
|
columnGap: `${theme.spacings.lg}`,
|
|
13
|
-
|
|
13
|
+
paddingTop: theme.spacings.lg,
|
|
14
|
+
paddingBottom: theme.spacings.lg,
|
|
14
15
|
justifySelf: 'start',
|
|
16
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
15
17
|
[theme.breakpoints.up('md')]: {
|
|
16
18
|
padding: 0,
|
|
17
19
|
background: 'none',
|
|
18
20
|
justifySelf: 'center',
|
|
19
21
|
gridTemplateColumns: '1fr 1fr',
|
|
20
|
-
columnGap: `${theme.spacings.
|
|
22
|
+
columnGap: `${theme.spacings.lg}`,
|
|
21
23
|
},
|
|
22
24
|
},
|
|
23
25
|
asset: {
|
|
@@ -28,6 +30,7 @@ const useStyles = makeStyles(
|
|
|
28
30
|
width: responsiveVal(200, 900),
|
|
29
31
|
height: 'auto',
|
|
30
32
|
objectFit: 'cover',
|
|
33
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
31
34
|
},
|
|
32
35
|
[theme.breakpoints.up('lg')]: {
|
|
33
36
|
width: responsiveVal(250, 900),
|
|
@@ -91,7 +94,7 @@ export default function SpecialBanner(props: SpecialBannerProps) {
|
|
|
91
94
|
|
|
92
95
|
return (
|
|
93
96
|
<Row maxWidth={false} {...containerProps}>
|
|
94
|
-
<
|
|
97
|
+
<Row maxWidth={false} className={classes.wrapper} disableGutters>
|
|
95
98
|
<div className={classes.asset}>{asset}</div>
|
|
96
99
|
<div className={classes.copy}>
|
|
97
100
|
{topic && (
|
|
@@ -102,7 +105,7 @@ export default function SpecialBanner(props: SpecialBannerProps) {
|
|
|
102
105
|
<div className={classes.textContainer}>{children}</div>
|
|
103
106
|
<div className={classes.links}>{pageLinks}</div>
|
|
104
107
|
</div>
|
|
105
|
-
</
|
|
108
|
+
</Row>
|
|
106
109
|
</Row>
|
|
107
110
|
)
|
|
108
111
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
1
|
import { Rating, RatingProps } from '@material-ui/lab'
|
|
3
2
|
import React from 'react'
|
|
4
3
|
import { SvgImageSimple } from '..'
|
|
5
4
|
import { iconStar } from '../icons'
|
|
5
|
+
import { makeStyles, Theme } from '@material-ui/core'
|
|
6
6
|
|
|
7
7
|
export type StarRatingFieldProps = {
|
|
8
8
|
id?: string
|
|
@@ -14,13 +14,13 @@ const useStyles = makeStyles(
|
|
|
14
14
|
(theme: Theme) => ({
|
|
15
15
|
iconStar: {
|
|
16
16
|
fill: '#FFDA1C',
|
|
17
|
-
stroke: '
|
|
18
|
-
margin:
|
|
17
|
+
stroke: 'none',
|
|
18
|
+
margin: '0 3px',
|
|
19
19
|
},
|
|
20
20
|
iconStarEmpty: {
|
|
21
|
-
fill: theme.palette.
|
|
22
|
-
stroke:
|
|
23
|
-
margin:
|
|
21
|
+
fill: theme.palette.grey[300],
|
|
22
|
+
stroke: 'none',
|
|
23
|
+
margin: '0 3px',
|
|
24
24
|
},
|
|
25
25
|
}),
|
|
26
26
|
{
|
|
@@ -37,8 +37,8 @@ export default function StarRatingField(props: StarRatingFieldProps) {
|
|
|
37
37
|
name={`star-rating-${id}`}
|
|
38
38
|
max={5}
|
|
39
39
|
size='small'
|
|
40
|
-
emptyIcon={<SvgImageSimple src={iconStar} className={classes.iconStarEmpty} />}
|
|
41
|
-
icon={<SvgImageSimple src={iconStar} className={classes.iconStar} />}
|
|
40
|
+
emptyIcon={<SvgImageSimple src={iconStar} size='large' className={classes.iconStarEmpty} />}
|
|
41
|
+
icon={<SvgImageSimple src={iconStar} size='large' className={classes.iconStar} />}
|
|
42
42
|
onChange={(event, value) => {
|
|
43
43
|
onChange(id ?? '', value ?? 0)
|
|
44
44
|
}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export default function breakpointVal(
|
|
2
|
+
property: string,
|
|
3
|
+
min: number,
|
|
4
|
+
max: number,
|
|
5
|
+
breakpointsObject: object,
|
|
6
|
+
) {
|
|
7
|
+
const minSize = 320
|
|
8
|
+
const breakpoints = Object.values(breakpointsObject)
|
|
9
|
+
const spread = breakpoints[breakpoints.length - 1] - minSize
|
|
10
|
+
|
|
11
|
+
return Object.fromEntries(
|
|
12
|
+
breakpoints.map((breakpoint, index) => {
|
|
13
|
+
// Get the size between this breakpoint and the previous breakpoint
|
|
14
|
+
const between = (breakpoint + (breakpoints[index + 1] ?? breakpoint)) / 2
|
|
15
|
+
// Calculate the size of the value
|
|
16
|
+
const size = Math.max(min, ((between - minSize) / spread) * (max - min) + min)
|
|
17
|
+
const value = `${Math.round(size * 100) / 100}px`
|
|
18
|
+
|
|
19
|
+
return [`@media (min-width: ${breakpoint}px )`, { [property]: value }]
|
|
20
|
+
}),
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -21,10 +21,15 @@ const useStyles = makeStyles(
|
|
|
21
21
|
sizeInherit: {
|
|
22
22
|
fontSize: 'inherit',
|
|
23
23
|
},
|
|
24
|
+
sizeXs: {
|
|
25
|
+
width: responsiveVal(11, 13),
|
|
26
|
+
height: responsiveVal(11, 13),
|
|
27
|
+
strokeWidth: 2.1,
|
|
28
|
+
},
|
|
24
29
|
sizeSmall: {
|
|
25
30
|
width: responsiveVal(12, 16),
|
|
26
31
|
height: responsiveVal(12, 16),
|
|
27
|
-
strokeWidth: 2.
|
|
32
|
+
strokeWidth: 2.1,
|
|
28
33
|
},
|
|
29
34
|
sizeLarge: {
|
|
30
35
|
width: responsiveVal(24, 28),
|
|
@@ -34,12 +39,12 @@ const useStyles = makeStyles(
|
|
|
34
39
|
sizeXl: {
|
|
35
40
|
width: responsiveVal(38, 62),
|
|
36
41
|
height: responsiveVal(38, 62),
|
|
37
|
-
strokeWidth: 1.
|
|
42
|
+
strokeWidth: 1.4,
|
|
38
43
|
},
|
|
39
44
|
sizeXxl: {
|
|
40
45
|
width: responsiveVal(96, 148),
|
|
41
46
|
height: responsiveVal(96, 148),
|
|
42
|
-
strokeWidth:
|
|
47
|
+
strokeWidth: 0.8,
|
|
43
48
|
},
|
|
44
49
|
muted: {},
|
|
45
50
|
inverted: {},
|
|
@@ -49,7 +54,7 @@ const useStyles = makeStyles(
|
|
|
49
54
|
|
|
50
55
|
type SvgImageSimpleProps = Omit<ImageProps, 'fixed'> & {
|
|
51
56
|
/** The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size. */
|
|
52
|
-
size?: 'default' | 'inherit' | 'xxl' | 'xl' | 'large' | 'medium' | 'small'
|
|
57
|
+
size?: 'default' | 'inherit' | 'xxl' | 'xl' | 'large' | 'medium' | 'small' | 'xs'
|
|
53
58
|
fill?: boolean
|
|
54
59
|
muted?: boolean
|
|
55
60
|
inverted?: boolean
|
|
@@ -57,6 +62,7 @@ type SvgImageSimpleProps = Omit<ImageProps, 'fixed'> & {
|
|
|
57
62
|
|
|
58
63
|
const SvgImageSimple = forwardRef<HTMLImageElement, SvgImageSimpleProps>((props, ref) => {
|
|
59
64
|
const {
|
|
65
|
+
style,
|
|
60
66
|
className,
|
|
61
67
|
size = 'medium',
|
|
62
68
|
muted,
|
|
@@ -82,6 +88,7 @@ const SvgImageSimple = forwardRef<HTMLImageElement, SvgImageSimpleProps>((props,
|
|
|
82
88
|
inverted && classes.inverted,
|
|
83
89
|
)}
|
|
84
90
|
aria-hidden='true'
|
|
91
|
+
style={style}
|
|
85
92
|
>
|
|
86
93
|
<use href={`${src}#icon`}></use>
|
|
87
94
|
</svg>
|
package/ToggleButton/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { capitalize, lighten, makeStyles, Theme } from '@material-ui/core'
|
|
4
4
|
import clsx from 'clsx'
|
|
5
5
|
import React, { FormEvent } from 'react'
|
|
6
|
+
import { responsiveVal } from '..'
|
|
6
7
|
import Button, { ButtonProps } from '../Button'
|
|
7
8
|
import { UseStyles } from '../Styles'
|
|
8
9
|
|
|
@@ -12,14 +13,8 @@ export const useStyles = makeStyles(
|
|
|
12
13
|
(theme: Theme) => ({
|
|
13
14
|
/* Styles applied to the root element. */
|
|
14
15
|
root: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
theme.palette.type === 'light'
|
|
18
|
-
? theme.palette.background.default
|
|
19
|
-
: lighten(theme.palette.background.default, theme.palette.action.hoverOpacity),
|
|
20
|
-
borderRadius: 4,
|
|
21
|
-
// boxShadow: theme.shadows['1'],
|
|
22
|
-
boxShadow: `0px 0px 2px ${theme.palette.grey[400]}`,
|
|
16
|
+
borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
|
|
17
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
23
18
|
'&$disabled': {
|
|
24
19
|
borderWidth: 2,
|
|
25
20
|
},
|
|
@@ -28,8 +23,8 @@ export const useStyles = makeStyles(
|
|
|
28
23
|
},
|
|
29
24
|
disabled: {},
|
|
30
25
|
selected: ({ color = 'default' }: StyleProps) => ({
|
|
31
|
-
border: `
|
|
32
|
-
boxShadow: `
|
|
26
|
+
border: `1px solid ${theme.palette[color]?.main ?? theme.palette.primary.main}`,
|
|
27
|
+
boxShadow: `inset 0 0 0 1px ${theme.palette[color]?.main ?? theme.palette.primary.main}`,
|
|
33
28
|
}),
|
|
34
29
|
/* Styles applied to the `label` wrapper element. */
|
|
35
30
|
label: {},
|
package/UspList/UspListItem.tsx
CHANGED
|
@@ -10,13 +10,15 @@ const useStyles = makeStyles(
|
|
|
10
10
|
display: 'grid',
|
|
11
11
|
gridAutoFlow: 'column',
|
|
12
12
|
alignItems: 'center',
|
|
13
|
-
gridTemplateColumns: `${responsiveVal(
|
|
13
|
+
gridTemplateColumns: `${responsiveVal(32, 38)} auto`,
|
|
14
14
|
gap: theme.spacings.xs,
|
|
15
15
|
'& > p': {
|
|
16
16
|
...theme.typography.body2,
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
icon: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
|
|
20
22
|
'& > * > img': {
|
|
21
23
|
display: 'block',
|
|
22
24
|
},
|
package/icons/index.tsx
CHANGED
|
@@ -24,6 +24,7 @@ export { default as iconPhone } from './smartphone.svg'
|
|
|
24
24
|
export { default as iconPlus } from './plus.svg'
|
|
25
25
|
export { default as iconClose } from './close.svg'
|
|
26
26
|
export { default as iconFullscreen } from './maximise.svg'
|
|
27
|
+
export { default as iconOrderBefore } from './calendar.svg'
|
|
27
28
|
export { default as iconBox } from './box.svg'
|
|
28
29
|
export { default as iconHome } from './home-alt.svg'
|
|
29
30
|
export { default as iconId } from './credit-card.svg'
|
|
@@ -34,3 +35,4 @@ export { default as iconShutdown } from './power.svg'
|
|
|
34
35
|
export { default as iconParty } from './happy-face.svg'
|
|
35
36
|
export { default as iconStar } from './star.svg'
|
|
36
37
|
export { default as iconEmailOutline } from './envelope-alt.svg'
|
|
38
|
+
export { default as icon404 } from './explore.svg'
|
package/index.ts
CHANGED
|
@@ -146,6 +146,7 @@ export { default as Stepper } from './Stepper/Stepper'
|
|
|
146
146
|
export { default as StyledBadge } from './StyledBadge'
|
|
147
147
|
export * from './Styles'
|
|
148
148
|
export { default as responsiveVal } from './Styles/responsiveVal'
|
|
149
|
+
export { default as breakpointVal } from './Styles/breakpointVal'
|
|
149
150
|
export * from './SvgImage'
|
|
150
151
|
export { default as SvgImage } from './SvgImage'
|
|
151
152
|
export { default as SvgImageSimple } from './SvgImage/SvgImageSimple'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.0",
|
|
4
4
|
"author": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"project": "./tsconfig.json"
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "f079c0b5b96dd1a048ca4d3c1d07916353c6bc33"
|
|
57
57
|
}
|