@graphcommerce/next-ui 3.25.3 → 4.1.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/AnimatedRow/index.tsx +6 -3
- package/ApolloError/ApolloErrorAlert.tsx +20 -21
- package/ApolloError/ApolloErrorFullPage.tsx +3 -4
- package/ApolloError/ApolloErrorSnackbar.tsx +3 -3
- package/Blog/BlogAuthor/index.tsx +42 -48
- package/Blog/BlogContent/index.tsx +6 -23
- package/Blog/BlogHeader/index.tsx +26 -23
- package/Blog/BlogList/index.tsx +7 -25
- package/Blog/BlogListItem/index.tsx +63 -52
- package/Blog/BlogTags/BlogTag.tsx +27 -0
- package/Blog/BlogTags/index.tsx +7 -32
- package/Blog/BlogTitle/index.tsx +7 -21
- package/Button/Button.tsx +5 -0
- package/Button/LinkOrButton.tsx +80 -0
- package/Button/index.tsx +2 -177
- package/CHANGELOG.md +524 -645
- package/ChipMenu/index.tsx +71 -77
- package/ContainerWithHeader/index.tsx +33 -30
- package/FlagAvatar/index.tsx +2 -12
- package/Footer/Footer.tsx +105 -88
- package/Footer/index.ts +0 -1
- package/Form/Form.tsx +35 -0
- package/Form/FormActions.tsx +9 -14
- package/Form/FormDivider.tsx +8 -13
- package/Form/FormHeader.tsx +5 -26
- package/Form/FormRow.tsx +8 -13
- package/Form/InputCheckmark.tsx +9 -22
- package/FramerScroller/SidebarGallery.tsx +340 -0
- package/FramerScroller/SidebarSlider.tsx +107 -0
- package/FramerScroller/index.ts +2 -0
- package/FullPageMessage/index.tsx +52 -48
- package/Highlight/index.tsx +1 -1
- package/IconHeader/index.tsx +63 -58
- package/JsonLd/index.tsx +3 -2
- package/Layout/components/LayoutHeader.tsx +75 -82
- package/Layout/components/LayoutHeaderBack.tsx +26 -18
- package/Layout/components/LayoutHeaderClose.tsx +9 -22
- package/Layout/components/LayoutHeaderContent.tsx +190 -154
- package/Layout/components/LayoutHeadertypes.ts +1 -1
- package/Layout/components/LayoutTitle.tsx +60 -55
- package/LayoutDefault/components/LayoutDefault.tsx +96 -85
- package/LayoutOverlay/components/LayoutOverlay.tsx +2 -8
- package/LayoutOverlay/components/LayoutOverlayBase.tsx +233 -239
- package/LayoutOverlay/test/LayoutOverlayDemo.tsx +1 -1
- package/LayoutParts/DesktopHeaderBadge.tsx +28 -0
- package/LayoutParts/DesktopNavActions.tsx +15 -0
- package/LayoutParts/DesktopNavBar.tsx +113 -0
- package/LayoutParts/DesktopNavBarItem.tsx +44 -0
- package/{AppShell → LayoutParts}/GlobalHead.tsx +1 -2
- package/LayoutParts/Logo.tsx +77 -0
- package/LayoutParts/MenuFab.tsx +132 -0
- package/LayoutParts/MenuFabItem.tsx +25 -0
- package/LayoutParts/MenuFabSecondaryItem.tsx +37 -0
- package/{AppShell/PlaceholderFab/index.tsx → LayoutParts/PlaceholderFab.tsx} +1 -1
- package/LayoutParts/StickyBelowHeader.tsx +25 -0
- package/LayoutParts/index.ts +12 -0
- package/{AppShell → LayoutParts}/useFabAnimation.ts +0 -0
- package/Page/CssAndFramerMotionProvider.tsx +21 -0
- package/Page/index.ts +2 -0
- package/Page/types.ts +2 -8
- package/PageLoadIndicator/index.tsx +25 -30
- package/PageMeta/index.tsx +1 -1
- package/Pagination/index.tsx +37 -54
- package/RenderType/index.tsx +1 -1
- package/Row/ButtonLinkList/ButtonLinkList.tsx +35 -37
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +16 -33
- package/Row/ColumnOne/index.tsx +5 -10
- package/Row/ColumnOneBoxed/index.tsx +18 -19
- package/Row/ColumnOneCentered/index.tsx +3 -4
- package/Row/ColumnThree/index.tsx +62 -57
- package/Row/ColumnTwo/index.tsx +37 -32
- package/Row/ColumnTwoSpread/index.tsx +28 -37
- package/Row/ColumnTwoWithTop/index.tsx +37 -43
- package/Row/ContentLinks/index.tsx +24 -25
- package/Row/HeroBanner/index.tsx +98 -82
- package/Row/IconBlocks/IconBlock/index.tsx +45 -37
- package/Row/IconBlocks/index.tsx +29 -44
- package/Row/ImageText/index.tsx +71 -67
- package/Row/ImageTextBoxed/index.tsx +66 -65
- package/Row/ParagraphWithSidebarSlide/index.tsx +80 -76
- package/Row/Quote/index.tsx +3 -3
- package/Row/SpecialBanner/index.tsx +97 -97
- package/Row/index.tsx +4 -9
- package/SectionContainer/index.tsx +32 -31
- package/SectionHeader/index.tsx +41 -43
- package/Separator/index.tsx +19 -18
- package/Snackbar/MessageSnackbar.tsx +1 -2
- package/Snackbar/MessageSnackbarImpl.tsx +68 -115
- package/StarRatingField/index.tsx +24 -25
- package/Stepper/Stepper.tsx +34 -32
- package/Styles/EmotionProvider.tsx +14 -0
- package/Styles/breakpointVal.tsx +16 -10
- package/Styles/extendableComponent.ts +70 -0
- package/Styles/index.tsx +9 -2
- package/Styles/withEmotionCache.tsx +36 -0
- package/Styles/withTheme.tsx +15 -24
- package/SvgIcon/SvgIcon.tsx +60 -0
- package/TextInputNumber/index.tsx +49 -50
- package/Theme/DarkLightModeThemeProvider.tsx +119 -0
- package/Theme/MuiButton.ts +128 -0
- package/Theme/MuiSlider.ts +28 -0
- package/Theme/MuiSnackbar.ts +31 -0
- package/Theme/{types.ts → createTheme.ts} +8 -2
- package/Theme/index.ts +5 -0
- package/Theme/themeDefaults.ts +51 -0
- package/TimeAgo/index.tsx +1 -1
- package/ToggleButton/index.tsx +43 -49
- package/ToggleButtonGroup/index.tsx +39 -39
- package/UspList/UspListItem.tsx +56 -46
- package/UspList/index.tsx +29 -26
- package/docs/building-components.mdx +3 -0
- package/docs/components/ComponentBasic.tsx +26 -0
- package/docs/components/ComponentChild.tsx +48 -0
- package/docs/components/ComponentChildVariant.tsx +54 -0
- package/docs/components/ComponentChildVariantExtendable.tsx +62 -0
- package/docs/components/ComponentStylable.tsx +32 -0
- package/docs/pages/building-components.tsx +62 -0
- package/icons/index.tsx +2 -0
- package/index.ts +27 -81
- package/package.json +27 -27
- package/types.d.ts +1 -1
- package/AppShell/AppShellSticky/index.tsx +0 -38
- package/AppShell/DesktopNavActions.tsx +0 -32
- package/AppShell/DesktopNavBar.tsx +0 -158
- package/AppShell/Logo.tsx +0 -46
- package/AppShell/Menu.tsx +0 -7
- package/AppShell/MenuFab.tsx +0 -162
- package/AppShell/MenuFabSecondaryItem.tsx +0 -32
- package/AppShell/index.ts +0 -15
- package/AspectRatioContainer/index.tsx +0 -27
- package/Footer/SocialIcon.tsx +0 -23
- package/Form/index.tsx +0 -67
- package/FramerScroller/components/SidebarGallery.tsx +0 -317
- package/FramerScroller/components/SidebarSlider.tsx +0 -97
- package/Page/App.tsx +0 -17
- package/Page/Document.tsx +0 -24
- package/StyledBadge/index.tsx +0 -20
- package/Styles/classesPicker.ts +0 -41
- package/SvgImage/SvgImageSimple.tsx +0 -100
- package/SvgImage/index.tsx +0 -74
package/Pagination/index.tsx
CHANGED
|
@@ -1,59 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PaginationProps, Box, SxProps, Theme, IconButton } from '@mui/material'
|
|
2
|
+
import usePagination, { UsePaginationItem } from '@mui/material/usePagination'
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
4
|
+
import { extendableComponent } from '../Styles'
|
|
5
|
+
import { SvgIcon } from '../SvgIcon/SvgIcon'
|
|
6
6
|
import { iconChevronLeft, iconChevronRight } from '../icons'
|
|
7
7
|
|
|
8
|
-
const useStyles = makeStyles((theme: Theme) => ({
|
|
9
|
-
root: {
|
|
10
|
-
margin: '0 auto',
|
|
11
|
-
marginTop: theme.spacings.lg,
|
|
12
|
-
marginBottom: theme.spacings.lg,
|
|
13
|
-
display: 'flex',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
justifyContent: 'center',
|
|
16
|
-
gap: 6,
|
|
17
|
-
'& .Mui-disabled': {
|
|
18
|
-
background: 'none',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
pagination: {
|
|
22
|
-
gridArea: 'pagination',
|
|
23
|
-
justifyContent: 'center',
|
|
24
|
-
display: 'grid',
|
|
25
|
-
gridAutoFlow: 'column',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
marginBottom: theme.spacings.xxl,
|
|
28
|
-
[theme.breakpoints.up('md')]: {
|
|
29
|
-
marginBottom: theme.spacings.lg,
|
|
30
|
-
},
|
|
31
|
-
...theme.typography.body1,
|
|
32
|
-
'& > *': {
|
|
33
|
-
whiteSpace: 'nowrap',
|
|
34
|
-
boxShadow: 'none',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
fab: {
|
|
38
|
-
color: theme.palette.text.primary,
|
|
39
|
-
},
|
|
40
|
-
}))
|
|
41
|
-
|
|
42
8
|
export type PagePaginationProps = {
|
|
43
9
|
count: number
|
|
44
10
|
page: number
|
|
45
|
-
renderLink: (page: number, icon: React.ReactNode, btnProps:
|
|
46
|
-
|
|
47
|
-
|
|
11
|
+
renderLink: (page: number, icon: React.ReactNode, btnProps: UsePaginationItem) => React.ReactNode
|
|
12
|
+
sx?: SxProps<Theme>
|
|
13
|
+
} & Omit<PaginationProps, 'count' | 'defaultPage' | 'page' | 'renderItem'>
|
|
14
|
+
|
|
15
|
+
const parts = ['root', 'button', 'icon'] as const
|
|
16
|
+
const { classes } = extendableComponent('Pagination', parts)
|
|
48
17
|
|
|
49
18
|
/**
|
|
50
19
|
* Rel="prev" and rel="next" are deprecated by Google.
|
|
51
20
|
*
|
|
52
21
|
* Read more: https://ahrefs.com/blog/rel-prev-next-pagination/
|
|
53
22
|
*/
|
|
54
|
-
export
|
|
23
|
+
export function Pagination(props: PagePaginationProps) {
|
|
55
24
|
const { count, page, renderLink, classes: styles, ...paginationProps } = props
|
|
56
|
-
|
|
25
|
+
|
|
57
26
|
const { items } = usePagination({
|
|
58
27
|
count,
|
|
59
28
|
defaultPage: 1,
|
|
@@ -65,36 +34,50 @@ export default function Pagination(props: PagePaginationProps) {
|
|
|
65
34
|
const nextBtnProps = items[items.length - 1]
|
|
66
35
|
|
|
67
36
|
const chevronLeft = (
|
|
68
|
-
<
|
|
37
|
+
<IconButton
|
|
69
38
|
size='medium'
|
|
70
39
|
disabled={page === 1}
|
|
71
40
|
color='inherit'
|
|
72
41
|
aria-label='Previous page'
|
|
73
|
-
className={classes.
|
|
42
|
+
className={classes.button}
|
|
74
43
|
>
|
|
75
|
-
<
|
|
76
|
-
</
|
|
44
|
+
<SvgIcon src={iconChevronLeft} className={classes.icon} size='medium' />
|
|
45
|
+
</IconButton>
|
|
77
46
|
)
|
|
78
47
|
|
|
79
48
|
const chevronRight = (
|
|
80
|
-
<
|
|
49
|
+
<IconButton
|
|
81
50
|
size='medium'
|
|
82
51
|
disabled={page === count}
|
|
83
52
|
color='inherit'
|
|
84
53
|
aria-label='Next page'
|
|
85
|
-
className={classes.
|
|
54
|
+
className={classes.button}
|
|
86
55
|
>
|
|
87
|
-
<
|
|
88
|
-
</
|
|
56
|
+
<SvgIcon src={iconChevronRight} className={classes.icon} size='medium' />
|
|
57
|
+
</IconButton>
|
|
89
58
|
)
|
|
90
59
|
|
|
91
60
|
return (
|
|
92
|
-
<
|
|
61
|
+
<Box
|
|
62
|
+
className={classes.root}
|
|
63
|
+
sx={(theme) => ({
|
|
64
|
+
margin: '0 auto',
|
|
65
|
+
marginTop: theme.spacings.lg,
|
|
66
|
+
marginBottom: theme.spacings.lg,
|
|
67
|
+
display: 'flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
gap: '6px',
|
|
71
|
+
'& .Mui-disabled': {
|
|
72
|
+
background: 'none',
|
|
73
|
+
},
|
|
74
|
+
})}
|
|
75
|
+
>
|
|
93
76
|
{page === 1 ? chevronLeft : renderLink(page - 1, chevronLeft, prevBtnProps)}
|
|
94
77
|
|
|
95
|
-
<
|
|
78
|
+
<Box typography='body1'>Page {`${page} of ${Math.max(1, count)}`}</Box>
|
|
96
79
|
|
|
97
80
|
{page === count ? chevronRight : renderLink(page + 1, chevronRight, nextBtnProps)}
|
|
98
|
-
</
|
|
81
|
+
</Box>
|
|
99
82
|
)
|
|
100
83
|
}
|
package/RenderType/index.tsx
CHANGED
|
@@ -27,7 +27,7 @@ export type TypeRenderer<
|
|
|
27
27
|
* A simple array with renderers but with strict typing that validates of the provided Renderer is
|
|
28
28
|
* actually able to render the Type
|
|
29
29
|
*/
|
|
30
|
-
export
|
|
30
|
+
export function RenderType<
|
|
31
31
|
T extends TypeObject,
|
|
32
32
|
A extends Record<string, unknown> = Record<string, unknown>,
|
|
33
33
|
>(props: { renderer: TypeRenderer<T, A> } & FilterTypeByTypename<T, T['__typename']> & A) {
|
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, SxProps, Theme } from '@mui/material'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import Row from '..'
|
|
4
|
-
import SectionContainer from '../../SectionContainer'
|
|
5
|
-
import {
|
|
3
|
+
import { Row } from '..'
|
|
4
|
+
import { SectionContainer } from '../../SectionContainer'
|
|
5
|
+
import { extendableComponent } from '../../Styles'
|
|
6
6
|
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
(theme: Theme) => ({
|
|
10
|
-
container: {
|
|
11
|
-
maxWidth: 820,
|
|
12
|
-
},
|
|
13
|
-
h1: {
|
|
14
|
-
textAlign: 'center',
|
|
15
|
-
...theme.typography.h2,
|
|
16
|
-
},
|
|
17
|
-
overline: {
|
|
18
|
-
display: 'block',
|
|
19
|
-
padding: `${theme.spacings.xs} 0`,
|
|
20
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
21
|
-
},
|
|
22
|
-
links: ({ containsBigLinks }: ButtonLinkListPropsBase) => ({
|
|
23
|
-
display: 'grid',
|
|
24
|
-
gridTemplateColumns: containsBigLinks
|
|
25
|
-
? undefined
|
|
26
|
-
: `repeat(auto-fill, minmax(${responsiveVal(210, 350)}, 1fr))`,
|
|
27
|
-
columnGap: theme.spacings.sm,
|
|
28
|
-
}),
|
|
29
|
-
}),
|
|
30
|
-
{ name: 'ButtonLinkList' },
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
type ButtonLinkListPropsBase = {
|
|
8
|
+
export type ButtonLinkListProps = {
|
|
34
9
|
title: string
|
|
35
10
|
children: React.ReactNode
|
|
36
|
-
|
|
37
|
-
}
|
|
11
|
+
sx?: SxProps<Theme>
|
|
12
|
+
} & OwnerState
|
|
38
13
|
|
|
39
|
-
|
|
14
|
+
type OwnerState = { containsBigLinks: boolean }
|
|
15
|
+
|
|
16
|
+
const compName = 'ButtonLinkList' as const
|
|
17
|
+
const parts = ['root', 'links'] as const
|
|
18
|
+
const { withState } = extendableComponent<OwnerState, typeof compName, typeof parts>(
|
|
19
|
+
compName,
|
|
20
|
+
parts,
|
|
21
|
+
)
|
|
40
22
|
|
|
41
23
|
export function ButtonLinkList(props: ButtonLinkListProps) {
|
|
42
|
-
const { title, children } = props
|
|
43
|
-
|
|
24
|
+
const { title, children, containsBigLinks, sx = [] } = props
|
|
25
|
+
|
|
26
|
+
const classes = withState({ containsBigLinks })
|
|
44
27
|
|
|
45
28
|
return (
|
|
46
|
-
<Row
|
|
29
|
+
<Row
|
|
30
|
+
maxWidth='md'
|
|
31
|
+
className={classes.root}
|
|
32
|
+
sx={[{ maxWidth: 820 }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
33
|
+
>
|
|
47
34
|
<SectionContainer labelLeft={title}>
|
|
48
|
-
<
|
|
35
|
+
<Box
|
|
36
|
+
className={classes.links}
|
|
37
|
+
sx={(theme) => ({
|
|
38
|
+
display: 'grid',
|
|
39
|
+
columnGap: theme.spacings.sm,
|
|
40
|
+
'&:not(.containsBigLinks)': {
|
|
41
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${responsiveVal(210, 350)}, 1fr))`,
|
|
42
|
+
},
|
|
43
|
+
})}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
</Box>
|
|
49
47
|
</SectionContainer>
|
|
50
48
|
</Row>
|
|
51
49
|
)
|
|
@@ -1,46 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import clsx from 'clsx'
|
|
1
|
+
import { Button, ButtonProps, styled } from '@mui/material'
|
|
3
2
|
import PageLink from 'next/link'
|
|
4
3
|
import React from 'react'
|
|
5
|
-
import
|
|
6
|
-
import { UseStyles } from '../../Styles'
|
|
7
|
-
import SvgImageSimple from '../../SvgImage/SvgImageSimple'
|
|
4
|
+
import { SvgIcon } from '../../SvgIcon/SvgIcon'
|
|
8
5
|
import { iconChevronRight } from '../../icons'
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
buttonLink: {
|
|
12
|
-
color: theme.palette.text.primary,
|
|
13
|
-
textDecoration: 'none',
|
|
14
|
-
padding: `${theme.spacings.xs} 0`,
|
|
15
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
16
|
-
borderRadius: 0,
|
|
17
|
-
...theme.typography.body1,
|
|
18
|
-
'& > *': {
|
|
19
|
-
display: 'grid',
|
|
20
|
-
gridAutoFlow: 'column',
|
|
21
|
-
justifyContent: 'space-between',
|
|
22
|
-
gap: `${theme.spacings.xs}`,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
}))
|
|
7
|
+
export type ButtonLinkProps = { url: string; endIcon?: React.ReactNode } & ButtonProps
|
|
26
8
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
9
|
+
const ButtonItem = styled(Button)(({ theme }) => ({
|
|
10
|
+
color: theme.palette.text.primary,
|
|
11
|
+
textDecoration: 'none',
|
|
12
|
+
padding: `${theme.spacings.xs} 0`,
|
|
13
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
14
|
+
borderRadius: 0,
|
|
15
|
+
justifyContent: 'space-between',
|
|
16
|
+
...theme.typography.body1,
|
|
17
|
+
}))
|
|
33
18
|
|
|
34
19
|
export function ButtonLinkListItem(props: ButtonLinkProps) {
|
|
35
|
-
const { children, url, endIcon
|
|
36
|
-
const classes = useStyles(props)
|
|
20
|
+
const { children, url, endIcon = <SvgIcon src={iconChevronRight} />, ...buttonProps } = props
|
|
37
21
|
|
|
38
22
|
return (
|
|
39
23
|
<PageLink href={url} passHref>
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</Button>
|
|
24
|
+
<ButtonItem {...buttonProps} endIcon={endIcon}>
|
|
25
|
+
{children}
|
|
26
|
+
</ButtonItem>
|
|
44
27
|
</PageLink>
|
|
45
28
|
)
|
|
46
29
|
}
|
package/Row/ColumnOne/index.tsx
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { Container, styled } from '@material
|
|
1
|
+
import { Container, styled } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
const ColumnOne = styled(Container)(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}),
|
|
8
|
-
{ name: 'ColumnOne' },
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
export default ColumnOne
|
|
3
|
+
export const ColumnOne = styled(Container, { name: 'ColumnOne' })(({ theme }) => ({
|
|
4
|
+
maxWidth: 820,
|
|
5
|
+
marginBottom: theme.spacings.lg,
|
|
6
|
+
}))
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Box, ContainerProps } from '@mui/material'
|
|
2
|
+
import { Row } from '..'
|
|
3
|
+
import { extendableComponent } from '../../Styles'
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
padding: theme.spacings.lg,
|
|
9
|
-
boxShadow: theme.shadows[24],
|
|
10
|
-
'& h1, & h2, & h3': {
|
|
11
|
-
marginTop: 0,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
}),
|
|
15
|
-
{ name: 'ColumnOneBoxed' },
|
|
16
|
-
)
|
|
5
|
+
const compName = 'ColumnOneBoxed' as const
|
|
6
|
+
const parts = ['root', 'boxed'] as const
|
|
7
|
+
const { classes } = extendableComponent(compName, parts)
|
|
17
8
|
|
|
18
|
-
export
|
|
9
|
+
export function ColumnOneBoxed(props: ContainerProps) {
|
|
19
10
|
const { children } = props
|
|
20
|
-
const classes = useStyles(props)
|
|
21
11
|
|
|
22
12
|
return (
|
|
23
|
-
<Row {...props}>
|
|
24
|
-
<
|
|
13
|
+
<Row {...props} className={classes.root}>
|
|
14
|
+
<Box
|
|
15
|
+
className={classes.boxed}
|
|
16
|
+
sx={(theme) => ({
|
|
17
|
+
padding: theme.spacings.lg,
|
|
18
|
+
boxShadow: theme.shadows[24],
|
|
19
|
+
'& h1, & h2, & h3': { marginTop: 0 },
|
|
20
|
+
})}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</Box>
|
|
25
24
|
</Row>
|
|
26
25
|
)
|
|
27
26
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ContainerProps, styled } from '@material
|
|
2
|
-
import
|
|
3
|
-
import ColumnOne from '../ColumnOne'
|
|
1
|
+
import { ContainerProps, styled } from '@mui/material'
|
|
2
|
+
import { ColumnOne } from '../ColumnOne'
|
|
4
3
|
|
|
5
4
|
const Wrapper = styled('div')(({ theme }) => ({
|
|
6
5
|
marginBottom: theme.spacings.lg,
|
|
@@ -11,7 +10,7 @@ const Wrapper = styled('div')(({ theme }) => ({
|
|
|
11
10
|
position: 'relative',
|
|
12
11
|
}))
|
|
13
12
|
|
|
14
|
-
export
|
|
13
|
+
export function ColumnOneCentered(props: ContainerProps) {
|
|
15
14
|
const { children } = props
|
|
16
15
|
|
|
17
16
|
return (
|
|
@@ -1,66 +1,71 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, ContainerProps } from '@mui/material'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import Row from '..'
|
|
4
|
-
import {
|
|
3
|
+
import { Row } from '..'
|
|
4
|
+
import { extendableComponent } from '../../Styles'
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
display: 'grid',
|
|
10
|
-
gridColumnGap: theme.spacings.md,
|
|
11
|
-
gridRowGap: theme.spacings.lg,
|
|
12
|
-
gridTemplateColumns: `1fr`,
|
|
13
|
-
gridTemplateAreas: `
|
|
14
|
-
"one"
|
|
15
|
-
"two"
|
|
16
|
-
"three"
|
|
17
|
-
`,
|
|
18
|
-
'& h2, & h3': {
|
|
19
|
-
...theme.typography.h4,
|
|
20
|
-
[theme.breakpoints.up('md')]: {
|
|
21
|
-
marginBottom: '-25px',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
'& p': {
|
|
25
|
-
[theme.breakpoints.up('md')]: {
|
|
26
|
-
marginTop: '65px',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
[theme.breakpoints.up('sm')]: {
|
|
30
|
-
gridTemplateColumns: `1fr 1fr`,
|
|
31
|
-
gridTemplateAreas: `
|
|
32
|
-
"one two"
|
|
33
|
-
"three three"
|
|
34
|
-
`,
|
|
35
|
-
},
|
|
36
|
-
[theme.breakpoints.up('md')]: {
|
|
37
|
-
gridTemplateColumns: `1fr 1fr 1fr`,
|
|
38
|
-
gridTemplateAreas: '"one two three"',
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
colOne: { gridArea: 'one', zIndex: 2 },
|
|
42
|
-
colTwo: { gridArea: 'two', zIndex: 2 },
|
|
43
|
-
colThree: { gridArea: 'three', zIndex: 2 },
|
|
44
|
-
}),
|
|
45
|
-
{ name: 'ColumnThree' },
|
|
46
|
-
)
|
|
6
|
+
const compName = 'ColumnThree' as const
|
|
7
|
+
const parts = ['root', 'colOne', 'colTwo', 'colThree'] as const
|
|
8
|
+
const { classes } = extendableComponent(compName, parts)
|
|
47
9
|
|
|
48
|
-
export type ColumnThreeProps =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
10
|
+
export type ColumnThreeProps = Omit<ContainerProps, 'children'> & {
|
|
11
|
+
colOneContent: React.ReactNode
|
|
12
|
+
colTwoContent: React.ReactNode
|
|
13
|
+
colThreeContent: React.ReactNode
|
|
14
|
+
}
|
|
54
15
|
|
|
55
|
-
export
|
|
56
|
-
const { colOneContent, colTwoContent, colThreeContent, ...containerProps } = props
|
|
57
|
-
const classes = useStyles(props)
|
|
16
|
+
export function ColumnThree(props: ColumnThreeProps) {
|
|
17
|
+
const { colOneContent, colTwoContent, colThreeContent, sx = [], ...containerProps } = props
|
|
58
18
|
|
|
59
19
|
return (
|
|
60
|
-
<Row
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
20
|
+
<Row
|
|
21
|
+
className={classes.root}
|
|
22
|
+
{...containerProps}
|
|
23
|
+
sx={[
|
|
24
|
+
(theme) => ({
|
|
25
|
+
display: 'grid',
|
|
26
|
+
gridColumnGap: theme.spacings.md,
|
|
27
|
+
gridRowGap: theme.spacings.lg,
|
|
28
|
+
gridTemplateColumns: `1fr`,
|
|
29
|
+
gridTemplateAreas: `
|
|
30
|
+
"one"
|
|
31
|
+
"two"
|
|
32
|
+
"three"
|
|
33
|
+
`,
|
|
34
|
+
'& h2, & h3': {
|
|
35
|
+
typography: 'h4',
|
|
36
|
+
[theme.breakpoints.up('md')]: {
|
|
37
|
+
marginBottom: '-25px',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
'& p': {
|
|
41
|
+
[theme.breakpoints.up('md')]: {
|
|
42
|
+
marginTop: '65px',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
[theme.breakpoints.up('sm')]: {
|
|
46
|
+
gridTemplateColumns: `1fr 1fr`,
|
|
47
|
+
gridTemplateAreas: `
|
|
48
|
+
"one two"
|
|
49
|
+
"three three"
|
|
50
|
+
`,
|
|
51
|
+
},
|
|
52
|
+
[theme.breakpoints.up('md')]: {
|
|
53
|
+
gridTemplateColumns: `1fr 1fr 1fr`,
|
|
54
|
+
gridTemplateAreas: '"one two three"',
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
58
|
+
]}
|
|
59
|
+
>
|
|
60
|
+
<Box className={classes.colOne} sx={{ gridArea: 'one' }}>
|
|
61
|
+
{colOneContent}
|
|
62
|
+
</Box>
|
|
63
|
+
<Box className={classes.colTwo} sx={{ gridArea: 'two' }}>
|
|
64
|
+
{colTwoContent}
|
|
65
|
+
</Box>
|
|
66
|
+
<Box className={classes.colThree} sx={{ gridArea: 'three' }}>
|
|
67
|
+
{colThreeContent}
|
|
68
|
+
</Box>
|
|
64
69
|
</Row>
|
|
65
70
|
)
|
|
66
71
|
}
|
package/Row/ColumnTwo/index.tsx
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Box, ContainerProps } from '@mui/material'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import Row from '..'
|
|
4
|
-
import {
|
|
3
|
+
import { Row } from '..'
|
|
4
|
+
import { extendableComponent } from '../../Styles'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
gridRowGap: theme.spacings.lg,
|
|
11
|
-
display: `grid`,
|
|
12
|
-
gridTemplateColumns: `1fr`,
|
|
13
|
-
gridTemplateAreas: `"one" "two"`,
|
|
14
|
-
[theme.breakpoints.up('sm')]: {
|
|
15
|
-
gridTemplateColumns: `1fr 1fr`,
|
|
16
|
-
gridTemplateAreas: `"one two"`,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
colOne: { gridArea: 'one' },
|
|
20
|
-
colTwo: { gridArea: 'two' },
|
|
21
|
-
}),
|
|
22
|
-
{ name: 'ColumnTwo' },
|
|
23
|
-
)
|
|
6
|
+
export type ColumnTwoProps = Omit<ContainerProps, 'children'> & {
|
|
7
|
+
colOneContent: React.ReactNode
|
|
8
|
+
colTwoContent: React.ReactNode
|
|
9
|
+
}
|
|
24
10
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
colTwoContent: React.ReactNode
|
|
29
|
-
}
|
|
11
|
+
const compName = 'ColumnTwo' as const
|
|
12
|
+
const parts = ['root', 'colOne', 'colTwo'] as const
|
|
13
|
+
const { classes } = extendableComponent(compName, parts)
|
|
30
14
|
|
|
31
|
-
export
|
|
32
|
-
const { colOneContent, colTwoContent, ...containerProps } = props
|
|
33
|
-
const classes = useStyles(props)
|
|
15
|
+
export function ColumnTwo(props: ColumnTwoProps) {
|
|
16
|
+
const { colOneContent, colTwoContent, sx = [], ...containerProps } = props
|
|
34
17
|
|
|
35
18
|
return (
|
|
36
|
-
<Row
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
<Row
|
|
20
|
+
maxWidth='lg'
|
|
21
|
+
{...containerProps}
|
|
22
|
+
className={classes.root}
|
|
23
|
+
sx={[
|
|
24
|
+
(theme) => ({
|
|
25
|
+
gridColumnGap: theme.spacings.md,
|
|
26
|
+
gridRowGap: theme.spacings.lg,
|
|
27
|
+
display: `grid`,
|
|
28
|
+
gridTemplateColumns: `1fr`,
|
|
29
|
+
gridTemplateAreas: `"one" "two"`,
|
|
30
|
+
[theme.breakpoints.up('sm')]: {
|
|
31
|
+
gridTemplateColumns: `1fr 1fr`,
|
|
32
|
+
gridTemplateAreas: `"one two"`,
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
36
|
+
]}
|
|
37
|
+
>
|
|
38
|
+
<Box className={classes.colOne} gridArea='one'>
|
|
39
|
+
{colOneContent}
|
|
40
|
+
</Box>
|
|
41
|
+
<Box className={classes.colTwo} gridArea='two'>
|
|
42
|
+
{colTwoContent}
|
|
43
|
+
</Box>
|
|
39
44
|
</Row>
|
|
40
45
|
)
|
|
41
46
|
}
|
|
@@ -1,41 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { UseStyles } from '../../Styles'
|
|
4
|
-
import ColumnTwo from '../ColumnTwo'
|
|
1
|
+
import { ColumnTwo, ColumnTwoProps } from '../ColumnTwo'
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
({ breakpoints }: Theme) => ({
|
|
8
|
-
root: {
|
|
9
|
-
[breakpoints.up('md')]: {
|
|
10
|
-
gridTemplateColumns: `1fr 1fr 1fr`,
|
|
11
|
-
gridTemplateAreas: ({ somethingWithNodeLength }: any) =>
|
|
12
|
-
somethingWithNodeLength ? `"one one two"` : `"one two two"`,
|
|
13
|
-
'& h2, & h3': {
|
|
14
|
-
'&:empty': {
|
|
15
|
-
display: 'block',
|
|
16
|
-
minHeight: 30,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
gridTemplateColumns: `1fr`,
|
|
21
|
-
gridTemplateAreas: `
|
|
22
|
-
"one"
|
|
23
|
-
"two"
|
|
24
|
-
`,
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
{ name: 'ColumnTwoSpread' },
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
export type ColumnTwoSpreadProps = Omit<ContainerProps, 'children'> &
|
|
31
|
-
UseStyles<typeof useStyles> & {
|
|
32
|
-
nodeLength: boolean
|
|
33
|
-
colOneContent: React.ReactNode
|
|
34
|
-
colTwoContent: React.ReactNode
|
|
35
|
-
}
|
|
3
|
+
type StyleProps = { nodeLength: boolean }
|
|
36
4
|
|
|
37
|
-
export
|
|
38
|
-
const classes = useStyles(props)
|
|
5
|
+
export type ColumnTwoSpreadProps = StyleProps & ColumnTwoProps
|
|
39
6
|
|
|
40
|
-
|
|
7
|
+
export function ColumnTwoSpread(props: ColumnTwoSpreadProps) {
|
|
8
|
+
const { nodeLength, sx = [], ...colProps } = props
|
|
9
|
+
return (
|
|
10
|
+
<ColumnTwo
|
|
11
|
+
{...colProps}
|
|
12
|
+
className='ColumnTwoSpread'
|
|
13
|
+
sx={[
|
|
14
|
+
(theme) => ({
|
|
15
|
+
[theme.breakpoints.up('md')]: {
|
|
16
|
+
gridTemplateColumns: `1fr 1fr 1fr`,
|
|
17
|
+
gridTemplateAreas: nodeLength ? `"one one two"` : `"one two two"`,
|
|
18
|
+
'& h2, & h3': {
|
|
19
|
+
'&:empty': {
|
|
20
|
+
display: 'block',
|
|
21
|
+
minHeight: 30,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
gridTemplateColumns: `1fr`,
|
|
26
|
+
gridTemplateAreas: `"one" "two"`,
|
|
27
|
+
}),
|
|
28
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
)
|
|
41
32
|
}
|