@graphcommerce/next-ui 3.19.1 → 3.20.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/AppShellSticky/index.tsx +3 -19
- package/AppShell/DesktopNavActions.tsx +3 -4
- package/AppShell/DesktopNavBar.tsx +2 -3
- package/AppShell/FixedFab.tsx +1 -6
- package/AppShell/GlobalHead.tsx +36 -0
- package/AppShell/Logo.tsx +11 -20
- package/AppShell/MenuFab.tsx +5 -3
- package/AppShell/MenuFabSecondaryItem.tsx +3 -3
- package/AppShell/PlaceholderFab/index.tsx +8 -27
- package/AppShell/index.tsx +19 -0
- package/AppShell/useFabAnimation.tsx +3 -2
- package/AppShell/useFixedFabAnimation.tsx +3 -2
- package/Blog/BlogAuthor/index.tsx +1 -1
- package/Blog/BlogHeader/index.tsx +2 -3
- package/Blog/BlogList/index.tsx +1 -1
- package/Blog/BlogListItem/index.tsx +1 -1
- package/Blog/BlogTitle/index.tsx +5 -5
- package/Button/index.tsx +26 -21
- package/CHANGELOG.md +30 -0
- package/ChipMenu/index.tsx +2 -2
- package/FlagAvatar/index.tsx +3 -3
- package/{AppShell/Footer/index.tsx → Footer/Footer.tsx} +3 -3
- package/{AppShell/Footer → Footer}/SocialIcon.tsx +3 -3
- package/Footer/index.ts +2 -0
- package/Form/InputCheckmark.tsx +3 -3
- package/Form/index.tsx +1 -1
- package/FramerScroller/components/SidebarGallery.tsx +24 -20
- package/FramerScroller/components/SidebarSlider.tsx +2 -6
- package/FullPageMessage/index.tsx +1 -1
- package/IconHeader/index.tsx +2 -15
- package/Layout/components/LayoutHeader.tsx +151 -0
- package/Layout/components/LayoutHeaderBack.tsx +50 -0
- package/Layout/components/LayoutHeaderClose.tsx +27 -0
- package/Layout/components/LayoutHeaderContent.tsx +173 -0
- package/Layout/components/LayoutHeadertypes.ts +10 -0
- package/Layout/components/LayoutProvider.tsx +17 -0
- package/{Title/index.tsx → Layout/components/LayoutTitle.tsx} +24 -15
- package/Layout/context/layoutContext.tsx +7 -0
- package/Layout/hooks/useScrollY.tsx +6 -0
- package/Layout/index.ts +5 -0
- package/Layout/types.ts +5 -0
- package/LayoutDefault/components/LayoutDefault.tsx +90 -0
- package/LayoutDefault/index.ts +1 -0
- package/LayoutOverlay/components/LayoutOverlay.tsx +25 -0
- package/LayoutOverlay/components/LayoutOverlayBase.tsx +354 -0
- package/LayoutOverlay/components/LayoutOverlayHeader.tsx +5 -0
- package/LayoutOverlay/hooks/useOverlayPosition.ts +70 -0
- package/LayoutOverlay/index.ts +2 -0
- package/Page/App.tsx +2 -0
- package/PageMeta/index.tsx +3 -0
- package/Pagination/index.tsx +0 -1
- package/Row/ButtonLinkList/index.tsx +1 -1
- package/Row/ColumnOneBoxed/index.tsx +1 -1
- package/Row/ColumnTwoWithTop/index.tsx +3 -3
- package/Row/ContentLinks/index.tsx +3 -3
- package/Row/HeroBanner/index.tsx +7 -11
- package/Row/IconBlocks/index.tsx +1 -1
- package/Row/ImageText/index.tsx +1 -1
- package/Row/ImageTextBoxed/index.tsx +1 -1
- package/Row/ParagraphWithSidebarSlide/index.tsx +1 -1
- package/Row/SpecialBanner/index.tsx +4 -3
- package/Row/index.tsx +1 -1
- package/Snackbar/MessageSnackbarImpl.tsx +1 -1
- package/StarRatingField/index.tsx +3 -4
- package/Stepper/Stepper.tsx +1 -1
- package/Styles/breakpointVal.tsx +2 -2
- package/Styles/classesPicker.ts +41 -0
- package/Styles/responsiveVal.tsx +1 -1
- package/SvgImage/SvgImageSimple.tsx +9 -8
- package/SvgImage/index.tsx +9 -11
- package/TextInputNumber/index.tsx +3 -4
- package/Theme/types.ts +14 -12
- package/ToggleButton/index.tsx +2 -4
- package/UspList/UspListItem.tsx +1 -1
- package/index.ts +9 -43
- package/package.json +8 -9
- package/AppShell/AppShellHeader/appShellHeaderContext.tsx +0 -11
- package/AppShell/AppShellHeader/index.tsx +0 -439
- package/AppShell/AppShellHeader/useAppShellHeaderContext.tsx +0 -6
- package/AppShell/AppShellProvider/index.tsx +0 -18
- package/AppShell/AppShellTitle/index.tsx +0 -45
- package/AppShell/ForwardButton.tsx +0 -53
- package/AppShell/FullPageShellBase.tsx +0 -82
- package/AppShell/MinimalPageShellBase.tsx +0 -22
- package/AppShell/PageShellHeader/index.tsx +0 -14
- package/AppShell/SheetShellBase/index.tsx +0 -114
- package/AppShell/SheetShellBase/useSheetStyles.ts +0 -18
- package/AppShell/SheetShellDragIndicator/index.tsx +0 -55
- package/AppShell/SheetShellHeader/index.tsx +0 -28
- package/AppShell/ShellBase.tsx +0 -45
- package/Debug/DebugSpacer.tsx +0 -51
- package/FramerNextPagesSlider/Slide.tsx +0 -71
- package/FramerNextPagesSlider/Slider.tsx +0 -39
- package/FramerNextPagesSlider/index.ts +0 -1
- package/FramerNextPagesSlider/types.ts +0 -3
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Container, makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
|
-
import
|
|
4
|
-
import React, { useEffect } from 'react'
|
|
5
|
-
import { useMotionValueValue } from '../../../framer-utils'
|
|
3
|
+
import React from 'react'
|
|
6
4
|
import { UseStyles } from '../../Styles'
|
|
7
|
-
import useAppShellHeaderContext from '../AppShellHeader/useAppShellHeaderContext'
|
|
8
5
|
|
|
9
6
|
const useStyles = makeStyles(
|
|
10
7
|
(theme: Theme) => ({
|
|
@@ -38,21 +35,8 @@ export default function AppShellSticky(props: AppShellStickyProps) {
|
|
|
38
35
|
const { children, headerFill = 'both' } = props
|
|
39
36
|
const classes = useStyles(props)
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (!contentHeaderRef?.current) return () => {}
|
|
46
|
-
|
|
47
|
-
const ro = new ResizeObserver(([entry]) =>
|
|
48
|
-
offsetTop.set(contentHeaderRef?.current?.clientHeight ?? 0),
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
ro.observe(contentHeaderRef.current)
|
|
52
|
-
return () => ro.disconnect()
|
|
53
|
-
}, [contentHeaderRef, offsetTop])
|
|
54
|
-
|
|
55
|
-
const top = useMotionValueValue(offsetTop, (v) => v)
|
|
38
|
+
// todo
|
|
39
|
+
const top = 0
|
|
56
40
|
|
|
57
41
|
return (
|
|
58
42
|
<Container
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
|
-
import { m } from 'framer-motion'
|
|
3
2
|
import React from 'react'
|
|
4
3
|
|
|
5
4
|
const useStyles = makeStyles(
|
|
@@ -7,11 +6,12 @@ const useStyles = makeStyles(
|
|
|
7
6
|
actions: {
|
|
8
7
|
display: 'none',
|
|
9
8
|
[theme.breakpoints.up('md')]: {
|
|
9
|
+
display: 'grid',
|
|
10
|
+
pointerEvents: 'none !important',
|
|
10
11
|
'& > *': {
|
|
11
12
|
pointerEvents: 'all',
|
|
12
13
|
},
|
|
13
14
|
alignItems: 'center',
|
|
14
|
-
display: 'grid',
|
|
15
15
|
gridAutoFlow: 'column',
|
|
16
16
|
columnGap: 6,
|
|
17
17
|
},
|
|
@@ -23,6 +23,5 @@ const useStyles = makeStyles(
|
|
|
23
23
|
export default function DesktopNavActions(props: { children?: React.ReactNode }) {
|
|
24
24
|
const { children } = props
|
|
25
25
|
const classes = useStyles()
|
|
26
|
-
|
|
27
|
-
return <m.div className={classes.actions}>{children}</m.div>
|
|
26
|
+
return <div className={classes.actions}>{children}</div>
|
|
28
27
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { usePageRouter } from '@graphcommerce/framer-next-pages'
|
|
1
2
|
import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
|
|
2
3
|
import { Link, LinkProps as MuiLinkProps, makeStyles, Theme } from '@material-ui/core'
|
|
3
|
-
import { Variant as ThemeVariant } from '@material-ui/core/styles/createTypography'
|
|
4
4
|
import clsx from 'clsx'
|
|
5
5
|
import { m } from 'framer-motion'
|
|
6
6
|
import PageLink from 'next/link'
|
|
7
|
-
import { useRouter } from 'next/router'
|
|
8
7
|
import React from 'react'
|
|
9
8
|
import { UseStyles } from '../Styles'
|
|
10
9
|
import SvgImageSimple from '../SvgImage/SvgImageSimple'
|
|
@@ -93,7 +92,7 @@ export type MenuTabsProps = MenuProps &
|
|
|
93
92
|
export default function DesktopNavBar(props: MenuTabsProps) {
|
|
94
93
|
const { menu, LinkProps, iconScrollerBtnLeft, iconScrollerBtnRight } = props
|
|
95
94
|
const classes = useStyles(props)
|
|
96
|
-
const router =
|
|
95
|
+
const router = usePageRouter()
|
|
97
96
|
|
|
98
97
|
return (
|
|
99
98
|
<ScrollerProvider scrollSnapAlign='none'>
|
package/AppShell/FixedFab.tsx
CHANGED
|
@@ -6,20 +6,15 @@ const useStyles = makeStyles(
|
|
|
6
6
|
(theme: Theme) => ({
|
|
7
7
|
root: {
|
|
8
8
|
position: 'fixed',
|
|
9
|
-
top: 'unset',
|
|
10
9
|
bottom: 20,
|
|
11
10
|
right: 20,
|
|
12
11
|
zIndex: 100,
|
|
13
12
|
boxShadow: theme.shadows[4],
|
|
14
13
|
borderRadius: 99,
|
|
15
14
|
maxWidth: 56,
|
|
16
|
-
[theme.breakpoints.down('sm')]: {
|
|
17
|
-
top: 'unset !important',
|
|
18
|
-
},
|
|
19
15
|
[theme.breakpoints.up('md')]: {
|
|
20
16
|
pointerEvents: 'all',
|
|
21
|
-
top: theme.
|
|
22
|
-
// hacky way to measure page width without scrollbar width
|
|
17
|
+
top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
|
|
23
18
|
left: `calc((100vw - (100vw - 100%)) - ${theme.page.horizontal} - 56px)`,
|
|
24
19
|
bottom: 'unset',
|
|
25
20
|
boxShadow: 'unset',
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useTheme } from '@material-ui/core'
|
|
2
|
+
import Head from 'next/head'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
export type GlobalHeadProps = { name: string }
|
|
6
|
+
|
|
7
|
+
const GlobalHead = (props: { name: string }) => {
|
|
8
|
+
const { name } = props
|
|
9
|
+
const theme = useTheme()
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Head>
|
|
13
|
+
<meta name='theme-color' content={theme.palette.background.default} key='theme-color' />
|
|
14
|
+
<meta
|
|
15
|
+
name='viewport'
|
|
16
|
+
content='minimum-scale=1, initial-scale=1, width=device-width'
|
|
17
|
+
key='viewport'
|
|
18
|
+
/>
|
|
19
|
+
<meta name='application-name' content={name} key='application-name' />
|
|
20
|
+
<meta name='apple-mobile-web-app-capable' content='yes' key='apple-mobile-web-app-capable' />
|
|
21
|
+
<meta
|
|
22
|
+
name='apple-mobile-web-app-status-bar-style'
|
|
23
|
+
content='default'
|
|
24
|
+
key='apple-mobile-web-app-status-bar-style'
|
|
25
|
+
/>
|
|
26
|
+
<meta name='apple-mobile-web-app-title' content={name} key='apple-mobile-web-app-title' />
|
|
27
|
+
<meta name='format-detection' content='telephone=no' key='format-detection' />
|
|
28
|
+
<meta name='mobile-web-app-capable' content='yes' key='mobile-web-app-capable' />
|
|
29
|
+
<link rel='apple-touch-icon' href='/manifest/icon-512-512.png' key='apple-touch-icon' />
|
|
30
|
+
<link rel='manifest' href='/manifest.webmanifest' key='manifest' />
|
|
31
|
+
<link rel='icon' href='/manifest/favicon.ico' key='icon' />
|
|
32
|
+
</Head>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default GlobalHead
|
package/AppShell/Logo.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { usePageRouter } from '@graphcommerce/framer-next-pages'
|
|
1
2
|
import { Image, ImageProps } from '@graphcommerce/image'
|
|
2
|
-
import { makeStyles, Theme
|
|
3
|
-
import clsx from 'clsx'
|
|
3
|
+
import { makeStyles, Theme } from '@material-ui/core'
|
|
4
4
|
import PageLink from 'next/link'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
import { UseStyles } from '../Styles'
|
|
@@ -21,34 +21,25 @@ const useStyles = makeStyles(
|
|
|
21
21
|
justifyContent: 'left',
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
-
logoHideOnMobile: {
|
|
25
|
-
display: 'none',
|
|
26
|
-
[theme.breakpoints.up('md')]: {
|
|
27
|
-
display: 'unset',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
24
|
}),
|
|
31
25
|
{ name: 'Logo' },
|
|
32
26
|
)
|
|
33
27
|
|
|
34
|
-
export type LogoProps = {
|
|
35
|
-
href?: `/${string}`
|
|
36
|
-
image: ImageProps
|
|
37
|
-
alwaysShow?: boolean
|
|
38
|
-
} & UseStyles<typeof useStyles>
|
|
28
|
+
export type LogoProps = { href?: `/${string}`; image: ImageProps } & UseStyles<typeof useStyles>
|
|
39
29
|
|
|
40
30
|
export default function Logo(props: LogoProps) {
|
|
41
|
-
const { href,
|
|
31
|
+
const { href, image } = props
|
|
32
|
+
const router = usePageRouter()
|
|
42
33
|
const classes = useStyles(props)
|
|
43
|
-
const theme = useTheme()
|
|
44
34
|
|
|
45
|
-
return (
|
|
35
|
+
return router.asPath === '/' ? (
|
|
36
|
+
<div className={classes.logo}>
|
|
37
|
+
<Image layout='fixed' loading='eager' {...image} className={classes.logo} />
|
|
38
|
+
</div>
|
|
39
|
+
) : (
|
|
46
40
|
<PageLink href={href ?? '/'} passHref>
|
|
47
41
|
<a className={classes.link} aria-label='Logo'>
|
|
48
|
-
<Image
|
|
49
|
-
{...{ ...image }}
|
|
50
|
-
className={clsx(classes.logo, !alwaysShow && classes.logoHideOnMobile)}
|
|
51
|
-
/>
|
|
42
|
+
<Image layout='fixed' loading='eager' {...image} className={classes.logo} />
|
|
52
43
|
</a>
|
|
53
44
|
</PageLink>
|
|
54
45
|
)
|
package/AppShell/MenuFab.tsx
CHANGED
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
} from '@material-ui/core'
|
|
11
11
|
import { m } from 'framer-motion'
|
|
12
12
|
import PageLink from 'next/link'
|
|
13
|
-
import {
|
|
13
|
+
import { useRouter } from 'next/router'
|
|
14
14
|
import React, { useEffect } from 'react'
|
|
15
15
|
import { UseStyles } from '../Styles'
|
|
16
|
-
import responsiveVal from '../Styles/responsiveVal'
|
|
16
|
+
import { responsiveVal } from '../Styles/responsiveVal'
|
|
17
17
|
import SvgImageSimple from '../SvgImage/SvgImageSimple'
|
|
18
18
|
import { iconMenu, iconClose } from '../icons'
|
|
19
19
|
import { MenuProps } from './Menu'
|
|
@@ -25,7 +25,6 @@ const useStyles = makeStyles(
|
|
|
25
25
|
position: 'fixed',
|
|
26
26
|
zIndex: 99,
|
|
27
27
|
left: theme.page.horizontal,
|
|
28
|
-
top: `calc(${theme.spacings.xxs} - 5px)`,
|
|
29
28
|
[theme.breakpoints.down('sm')]: {
|
|
30
29
|
top: 'unset',
|
|
31
30
|
left: 20,
|
|
@@ -33,6 +32,9 @@ const useStyles = makeStyles(
|
|
|
33
32
|
transform: 'none !important',
|
|
34
33
|
opacity: '1 !important',
|
|
35
34
|
},
|
|
35
|
+
[theme.breakpoints.up('md')]: {
|
|
36
|
+
top: `calc(${theme.appShell.headerHeightMd} / 2 - 28px)`,
|
|
37
|
+
},
|
|
36
38
|
},
|
|
37
39
|
menuFab: {
|
|
38
40
|
background: theme.palette.text.primary,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ListItem, ListItemIcon, ListItemText, makeStyles
|
|
1
|
+
import { ListItem, ListItemIcon, ListItemText, makeStyles } from '@material-ui/core'
|
|
2
2
|
import PageLink from 'next/link'
|
|
3
3
|
import router from 'next/router'
|
|
4
4
|
import React from 'react'
|
|
5
5
|
|
|
6
6
|
const useStyles = makeStyles(
|
|
7
|
-
|
|
7
|
+
{
|
|
8
8
|
listItemText: {},
|
|
9
9
|
icon: { minWidth: 30 },
|
|
10
|
-
}
|
|
10
|
+
},
|
|
11
11
|
{ name: 'FabMenuSecondaryItem' },
|
|
12
12
|
)
|
|
13
13
|
|
|
@@ -1,27 +1,8 @@
|
|
|
1
|
-
import { Fab, FabProps,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
background: 'none',
|
|
10
|
-
pointerEvents: 'none',
|
|
11
|
-
},
|
|
12
|
-
}),
|
|
13
|
-
{ name: 'FullPageShell' },
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
type PlaceholderFabProps = Omit<FabProps, 'children'> & UseStyles<typeof useStyles>
|
|
17
|
-
|
|
18
|
-
export default function PlaceholderFab(props: PlaceholderFabProps) {
|
|
19
|
-
const { ...fabProps } = props
|
|
20
|
-
const classes = useStyles(props)
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<Fab className={classes.placeholderCartFab} size='large' {...fabProps} aria-label='Placeholder'>
|
|
24
|
-
<></>
|
|
25
|
-
</Fab>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
1
|
+
import { Fab, FabProps, styled } from '@material-ui/core'
|
|
2
|
+
|
|
3
|
+
export const PlaceholderFab = styled((props: Omit<FabProps, 'children'>) => (
|
|
4
|
+
<Fab {...props}>
|
|
5
|
+
{/* eslint-disable-next-line react/jsx-no-useless-fragment */}
|
|
6
|
+
<></>
|
|
7
|
+
</Fab>
|
|
8
|
+
))({ visibility: 'hidden', pointerEvents: 'none' })
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as AppShellSticky } from './AppShellSticky'
|
|
2
|
+
export { default as DesktopNavActions } from './DesktopNavActions'
|
|
3
|
+
|
|
4
|
+
export * from './DesktopNavBar'
|
|
5
|
+
export { default as DesktopNavBar } from './DesktopNavBar'
|
|
6
|
+
export { default as FixedFab } from './FixedFab'
|
|
7
|
+
|
|
8
|
+
export { default as Logo } from './Logo'
|
|
9
|
+
export * from './Logo'
|
|
10
|
+
export * from './Menu'
|
|
11
|
+
export * from './MenuFab'
|
|
12
|
+
export { default as MenuFab } from './MenuFab'
|
|
13
|
+
export * from './MenuFabSecondaryItem'
|
|
14
|
+
export { default as MenuFabSecondaryItem } from './MenuFabSecondaryItem'
|
|
15
|
+
export * from './PlaceholderFab'
|
|
16
|
+
export * from './GlobalHead'
|
|
17
|
+
export { default as GlobalHead } from './GlobalHead'
|
|
18
|
+
export { default as useFabAnimation } from './useFabAnimation'
|
|
19
|
+
export { default as useFixedFabAnimation } from './useFixedFabAnimation'
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useMediaQuery, useTheme } from '@material-ui/core'
|
|
2
|
-
import { useMotionTemplate, useTransform
|
|
2
|
+
import { useMotionTemplate, useTransform } from 'framer-motion'
|
|
3
|
+
import { useScrollY } from '../Layout/hooks/useScrollY'
|
|
3
4
|
|
|
4
5
|
export default function useFabAnimation() {
|
|
5
6
|
const theme = useTheme()
|
|
6
7
|
const isMobile = useMediaQuery(theme.breakpoints.down('sm'))
|
|
7
|
-
const
|
|
8
|
+
const scrollY = useScrollY()
|
|
8
9
|
const scrollTo = isMobile ? 0 : 130
|
|
9
10
|
|
|
10
11
|
const scale = useTransform(scrollY, [50, scrollTo], [0.4, 1])
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { alpha, useTheme } from '@material-ui/core'
|
|
2
|
-
import { useMotionTemplate,
|
|
2
|
+
import { useMotionTemplate, useTransform } from 'framer-motion'
|
|
3
|
+
import { useScrollY } from '../Layout/hooks/useScrollY'
|
|
3
4
|
|
|
4
5
|
export default function useFixedFabAnimation() {
|
|
5
6
|
const theme = useTheme()
|
|
6
|
-
const
|
|
7
|
+
const scrollY = useScrollY()
|
|
7
8
|
const opacity = useTransform(scrollY, [50, 60], [0, 1])
|
|
8
9
|
const opacity1 = useTransform(
|
|
9
10
|
scrollY,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Avatar, Chip, makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { responsiveVal } from '../..'
|
|
4
3
|
import { UseStyles } from '../../Styles'
|
|
4
|
+
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
5
5
|
|
|
6
6
|
const useStyles = makeStyles(
|
|
7
7
|
(theme: Theme) => ({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { makeStyles, Theme
|
|
1
|
+
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { responsiveVal } from '../..'
|
|
4
|
-
import Row from '../../Row'
|
|
5
3
|
import { UseStyles } from '../../Styles'
|
|
4
|
+
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
6
5
|
|
|
7
6
|
const useStyles = makeStyles(
|
|
8
7
|
(theme: Theme) => ({
|
package/Blog/BlogList/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { makeStyles, Theme } from '@material-ui/core'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import Row from '../../Row'
|
|
4
4
|
import { UseStyles } from '../../Styles'
|
|
5
|
-
import responsiveVal from '../../Styles/responsiveVal'
|
|
5
|
+
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
6
6
|
|
|
7
7
|
const useStyles = makeStyles(
|
|
8
8
|
(theme: Theme) => ({
|
|
@@ -2,7 +2,7 @@ import { Link, makeStyles, Theme, Typography } from '@material-ui/core'
|
|
|
2
2
|
import PageLink from 'next/link'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { UseStyles } from '../../Styles'
|
|
5
|
-
import responsiveVal from '../../Styles/responsiveVal'
|
|
5
|
+
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
6
6
|
|
|
7
7
|
const useStyles = makeStyles(
|
|
8
8
|
(theme: Theme) => ({
|
package/Blog/BlogTitle/index.tsx
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { makeStyles
|
|
1
|
+
import { makeStyles } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import
|
|
3
|
+
import { LayoutTitle } from '../../Layout'
|
|
4
4
|
import { UseStyles } from '../../Styles'
|
|
5
5
|
|
|
6
6
|
const useStyles = makeStyles(
|
|
7
|
-
|
|
7
|
+
{
|
|
8
8
|
wrapper: {
|
|
9
9
|
maxWidth: 800,
|
|
10
10
|
margin: `0 auto`,
|
|
11
11
|
},
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
13
|
{ name: 'BlogTitle' },
|
|
14
14
|
)
|
|
15
15
|
|
|
@@ -23,7 +23,7 @@ export default function BlogTitle(props: BlogTitleProps) {
|
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<div className={classes.wrapper}>
|
|
26
|
-
<
|
|
26
|
+
<LayoutTitle variant='h1'>{title}</LayoutTitle>
|
|
27
27
|
</div>
|
|
28
28
|
)
|
|
29
29
|
}
|
package/Button/index.tsx
CHANGED
|
@@ -3,11 +3,9 @@ import {
|
|
|
3
3
|
ButtonClassKey as MuiButtonClassKey,
|
|
4
4
|
Theme,
|
|
5
5
|
makeStyles,
|
|
6
|
-
lighten,
|
|
7
6
|
} from '@material-ui/core'
|
|
8
7
|
import clsx from 'clsx'
|
|
9
8
|
import React from 'react'
|
|
10
|
-
import { responsiveVal } from '..'
|
|
11
9
|
|
|
12
10
|
type BaseButtonProps = Omit<Parameters<typeof MuiButton>['0'], 'variant' | 'classes'> & {
|
|
13
11
|
variant?: 'text' | 'outlined' | 'contained' | 'pill' | 'pill-link'
|
|
@@ -58,33 +56,40 @@ const useStyles = makeStyles<
|
|
|
58
56
|
borderRadius: '99em',
|
|
59
57
|
},
|
|
60
58
|
pillLink: {
|
|
61
|
-
[theme.breakpoints.up('
|
|
59
|
+
[theme.breakpoints.up('md')]: {
|
|
62
60
|
// manually match MuiButton and containedPrimary styles
|
|
63
61
|
textTransform: 'none',
|
|
64
62
|
...theme.typography.body2,
|
|
65
63
|
fontWeight: 400,
|
|
66
|
-
padding: `${responsiveVal(8, 10)} ${responsiveVal(16, 20)}`,
|
|
67
|
-
backgroundColor: theme.palette.secondary.main,
|
|
68
|
-
color: theme.palette.primary.contrastText,
|
|
69
64
|
borderRadius: '99em',
|
|
70
65
|
boxShadow: theme.shadows[6],
|
|
66
|
+
backgroundColor: theme.palette.background.paper,
|
|
67
|
+
color: theme.palette.text.primary,
|
|
71
68
|
'&:hover': {
|
|
72
|
-
background: theme.palette.
|
|
69
|
+
background: theme.palette.background.paper,
|
|
73
70
|
},
|
|
74
71
|
},
|
|
75
72
|
},
|
|
76
73
|
pillPrimary: {
|
|
77
|
-
|
|
74
|
+
[theme.breakpoints.up('md')]: {
|
|
75
|
+
backgroundColor: theme.palette.primary.main,
|
|
76
|
+
color: theme.palette.primary.contrastText,
|
|
77
|
+
'&:hover': {
|
|
78
|
+
background: theme.palette.primary.dark,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
78
81
|
},
|
|
79
82
|
pillSecondary: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
[theme.breakpoints.up('md')]: {
|
|
84
|
+
backgroundColor: theme.palette.secondary.main,
|
|
85
|
+
color: theme.palette.secondary.contrastText,
|
|
86
|
+
'&:hover': {
|
|
87
|
+
background: theme.palette.secondary.dark,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
87
90
|
},
|
|
91
|
+
pillSizeLarge: {},
|
|
92
|
+
pillSizeSmall: {},
|
|
88
93
|
pillNoElevation: {
|
|
89
94
|
/* disableElevation does not stop adding box shadow on active... ?! */
|
|
90
95
|
'&:active': {
|
|
@@ -152,13 +157,13 @@ export default React.forwardRef<any, ButtonProps>((props, ref) => {
|
|
|
152
157
|
disabled={loading || disabled}
|
|
153
158
|
className={clsx(
|
|
154
159
|
{
|
|
155
|
-
[pillClasses.pill]: variant
|
|
156
|
-
[pillClasses.pillPrimary]: variant === 'pill' && color === 'primary',
|
|
157
|
-
[pillClasses.pillSecondary]: variant === 'pill' && color === 'secondary',
|
|
158
|
-
[pillClasses.pillSizeLarge]: variant === 'pill' && size === 'large',
|
|
159
|
-
[pillClasses.pillSizeSmall]: variant === 'pill' && size === 'small',
|
|
160
|
-
[pillClasses.pillNoElevation]: buttonProps.disableElevation,
|
|
160
|
+
[pillClasses.pill]: variant?.startsWith('pill'),
|
|
161
161
|
[pillClasses.pillLink]: variant === 'pill-link',
|
|
162
|
+
[pillClasses.pillPrimary]: variant?.startsWith('pill') && color === 'primary',
|
|
163
|
+
[pillClasses.pillSecondary]: variant?.startsWith('pill') && color === 'secondary',
|
|
164
|
+
[pillClasses.pillSizeLarge]: variant?.startsWith('pill') && size === 'large',
|
|
165
|
+
[pillClasses.pillSizeSmall]: variant?.startsWith('pill') && size === 'small',
|
|
166
|
+
[pillClasses.pillNoElevation]: buttonProps.disableElevation,
|
|
162
167
|
[pillClasses.loading]: loading,
|
|
163
168
|
[pillClasses.withStartIcon]: withIcon,
|
|
164
169
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
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.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
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* classesPicker would sometimes return 'undefined' as a class ([baa51f1](https://github.com/ho-nl/m2-pwa/commit/baa51f1ac6d47460bfc713bd2c10ae14f1f6ecbf))
|
|
12
|
+
* close button should always be present ([32d4173](https://github.com/ho-nl/m2-pwa/commit/32d4173e44c6e77815cf483590c1f703d48a386b))
|
|
13
|
+
* horizontal scroll on page ([d025a16](https://github.com/ho-nl/m2-pwa/commit/d025a16a02b43756fc58b0b764faa404eb06da6c))
|
|
14
|
+
* make sure elements that use scroll positioning are using the right hook ([80ee33f](https://github.com/ho-nl/m2-pwa/commit/80ee33f68ecc223147d63fc37e5b9ba94df4564e))
|
|
15
|
+
* make sure galleries are scrollable properly ([8653316](https://github.com/ho-nl/m2-pwa/commit/86533167891f0ae197fdf096b84fdda8e89a0f6e))
|
|
16
|
+
* make sure it doesn't error when trying to override root ([99a69a3](https://github.com/ho-nl/m2-pwa/commit/99a69a36579b4c934f3b1be187130983bdf133bf))
|
|
17
|
+
* make sure that pill link buttons get the right background color etc. ([c142b31](https://github.com/ho-nl/m2-pwa/commit/c142b31552417d2296341785994e2f7b35462793))
|
|
18
|
+
* make sure the overlay becomes visible, even if the overlay is scrolled ([1738c98](https://github.com/ho-nl/m2-pwa/commit/1738c982ea84ec2b93daa824c4b8c86ab2a3f5ed))
|
|
19
|
+
* make the headerHeight properly configurable ([c39c942](https://github.com/ho-nl/m2-pwa/commit/c39c942a62a9bb9687ea553be28e37fb49a6b065))
|
|
20
|
+
* minHeight of page on iOS is sometimes less high than expected ([8a0bc23](https://github.com/ho-nl/m2-pwa/commit/8a0bc234d153d974ac415369483ddabfb5e7fb0c))
|
|
21
|
+
* missing CssBaseline ([d2a7126](https://github.com/ho-nl/m2-pwa/commit/d2a7126295b99b0446dc31b0cf7c60671a18f976))
|
|
22
|
+
* only apply page meta when the current page is active ([f099a51](https://github.com/ho-nl/m2-pwa/commit/f099a519d169dcc9e2653db8353ce93d7b0a138e))
|
|
23
|
+
* spacing of LayoutTItle ([7afcd31](https://github.com/ho-nl/m2-pwa/commit/7afcd3163d16e902cf2ff7917f56ee6a8798f55b))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* **framer-scroller-sheet:** created package replacing the framer-sheet package ([f9f2e91](https://github.com/ho-nl/m2-pwa/commit/f9f2e9101191f5cb5c4514ceb9534ddeb2476763))
|
|
29
|
+
* **framer-scroller:** split the grid functionality from the scroller ([81307ea](https://github.com/ho-nl/m2-pwa/commit/81307ea2652bf31a1f94e8db72af4ee161bdca2e))
|
|
30
|
+
* refactor page shell ([594bdb3](https://github.com/ho-nl/m2-pwa/commit/594bdb32927b797208b2a295bc0db9f9ceb94676))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
# [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
37
|
|
|
8
38
|
|
package/ChipMenu/index.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Chip, ChipProps,
|
|
1
|
+
import { Chip, ChipProps, makeStyles, Menu, Theme } from '@material-ui/core'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import React, { PropsWithChildren, useState } from 'react'
|
|
4
4
|
import SectionHeader from '../SectionHeader'
|
|
5
|
-
import responsiveVal from '../Styles/responsiveVal'
|
|
5
|
+
import { responsiveVal } from '../Styles/responsiveVal'
|
|
6
6
|
import SvgImageSimple from '../SvgImage/SvgImageSimple'
|
|
7
7
|
import { iconChevronDown, iconChevronUp, iconCancelAlt } from '../icons'
|
|
8
8
|
|
package/FlagAvatar/index.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { makeStyles,
|
|
1
|
+
import { makeStyles, Avatar, AvatarProps } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
const useStyles = makeStyles(
|
|
5
|
-
|
|
5
|
+
{
|
|
6
6
|
root: {},
|
|
7
|
-
}
|
|
7
|
+
},
|
|
8
8
|
{ name: 'FlagAvatar' },
|
|
9
9
|
)
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContainerProps, Theme, makeStyles, Container } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { UseStyles } from '
|
|
3
|
+
import { UseStyles } from '../Styles'
|
|
4
4
|
|
|
5
5
|
const useStyles = makeStyles(
|
|
6
6
|
(theme: Theme) => ({
|
|
@@ -80,14 +80,14 @@ const useStyles = makeStyles(
|
|
|
80
80
|
{ name: 'Footer' },
|
|
81
81
|
)
|
|
82
82
|
|
|
83
|
-
type FooterProps = UseStyles<typeof useStyles> & {
|
|
83
|
+
export type FooterProps = UseStyles<typeof useStyles> & {
|
|
84
84
|
storeSwitcher?: React.ReactNode
|
|
85
85
|
socialLinks?: React.ReactElement
|
|
86
86
|
customerService?: React.ReactNode
|
|
87
87
|
copyright?: React.ReactElement
|
|
88
88
|
} & Omit<ContainerProps, 'children'>
|
|
89
89
|
|
|
90
|
-
export
|
|
90
|
+
export function Footer(props: FooterProps) {
|
|
91
91
|
const { socialLinks, storeSwitcher, customerService, copyright, ...containerProps } = props
|
|
92
92
|
const classes = useStyles(props)
|
|
93
93
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { UseStyles } from '
|
|
4
|
-
import SvgImage, { SvgImageProps } from '
|
|
3
|
+
import { UseStyles } from '../Styles'
|
|
4
|
+
import SvgImage, { SvgImageProps } from '../SvgImage'
|
|
5
5
|
|
|
6
6
|
const useStyles = makeStyles(
|
|
7
7
|
(theme: Theme) => ({
|
|
@@ -16,7 +16,7 @@ const useStyles = makeStyles(
|
|
|
16
16
|
|
|
17
17
|
type SocialIconProps = UseStyles<typeof useStyles> & SvgImageProps
|
|
18
18
|
|
|
19
|
-
export
|
|
19
|
+
export function SocialIcon(props: SocialIconProps) {
|
|
20
20
|
const classes = useStyles(props)
|
|
21
21
|
|
|
22
22
|
return <SvgImage {...props} className={classes.root} />
|
package/Footer/index.ts
ADDED
package/Form/InputCheckmark.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeStyles
|
|
1
|
+
import { makeStyles } from '@material-ui/core'
|
|
2
2
|
import clsx from 'clsx'
|
|
3
3
|
import React, { PropsWithChildren } from 'react'
|
|
4
4
|
import SvgImageSimple from '../SvgImage/SvgImageSimple'
|
|
@@ -6,14 +6,14 @@ import { iconCheckmark } from '../icons'
|
|
|
6
6
|
|
|
7
7
|
export type InputCheckmarkProps = PropsWithChildren<{ show?: boolean; select?: boolean }>
|
|
8
8
|
const useStyles = makeStyles(
|
|
9
|
-
|
|
9
|
+
{
|
|
10
10
|
iconCheckmark: {
|
|
11
11
|
stroke: '#01D26A',
|
|
12
12
|
},
|
|
13
13
|
select: {
|
|
14
14
|
marginRight: 15,
|
|
15
15
|
},
|
|
16
|
-
}
|
|
16
|
+
},
|
|
17
17
|
{ name: 'InputCheckmark' },
|
|
18
18
|
)
|
|
19
19
|
|
package/Form/index.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
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 '..'
|
|
5
4
|
import { UseStyles } from '../Styles'
|
|
5
|
+
import { responsiveVal } from '../Styles/responsiveVal'
|
|
6
6
|
|
|
7
7
|
const useStyles = makeStyles(
|
|
8
8
|
(theme: Theme) => ({
|