@graphcommerce/next-ui 3.25.1 → 4.0.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.
Files changed (138) hide show
  1. package/AnimatedRow/index.tsx +6 -3
  2. package/ApolloError/ApolloErrorAlert.tsx +20 -21
  3. package/ApolloError/ApolloErrorFullPage.tsx +3 -4
  4. package/ApolloError/ApolloErrorSnackbar.tsx +3 -3
  5. package/Blog/BlogAuthor/index.tsx +42 -48
  6. package/Blog/BlogContent/index.tsx +6 -23
  7. package/Blog/BlogHeader/index.tsx +26 -23
  8. package/Blog/BlogList/index.tsx +7 -25
  9. package/Blog/BlogListItem/index.tsx +63 -52
  10. package/Blog/BlogTags/BlogTag.tsx +27 -0
  11. package/Blog/BlogTags/index.tsx +7 -32
  12. package/Blog/BlogTitle/index.tsx +7 -21
  13. package/Button/Button.tsx +5 -0
  14. package/Button/LinkOrButton.tsx +80 -0
  15. package/Button/index.tsx +2 -177
  16. package/CHANGELOG.md +497 -636
  17. package/ChipMenu/index.tsx +71 -77
  18. package/ContainerWithHeader/index.tsx +33 -30
  19. package/FlagAvatar/index.tsx +2 -12
  20. package/Footer/Footer.tsx +105 -88
  21. package/Footer/index.ts +0 -1
  22. package/Form/Form.tsx +35 -0
  23. package/Form/FormActions.tsx +9 -14
  24. package/Form/FormDivider.tsx +8 -13
  25. package/Form/FormHeader.tsx +5 -26
  26. package/Form/FormRow.tsx +8 -13
  27. package/Form/InputCheckmark.tsx +9 -22
  28. package/FramerScroller/SidebarGallery.tsx +340 -0
  29. package/FramerScroller/SidebarSlider.tsx +107 -0
  30. package/FramerScroller/index.ts +2 -0
  31. package/FullPageMessage/index.tsx +52 -48
  32. package/Highlight/index.tsx +1 -1
  33. package/IconHeader/index.tsx +63 -58
  34. package/JsonLd/index.tsx +3 -2
  35. package/Layout/components/LayoutHeader.tsx +75 -82
  36. package/Layout/components/LayoutHeaderBack.tsx +21 -12
  37. package/Layout/components/LayoutHeaderClose.tsx +9 -22
  38. package/Layout/components/LayoutHeaderContent.tsx +190 -154
  39. package/Layout/components/LayoutHeadertypes.ts +1 -1
  40. package/Layout/components/LayoutTitle.tsx +60 -55
  41. package/LayoutDefault/components/LayoutDefault.tsx +96 -85
  42. package/LayoutOverlay/components/LayoutOverlay.tsx +2 -8
  43. package/LayoutOverlay/components/LayoutOverlayBase.tsx +233 -239
  44. package/LayoutOverlay/test/LayoutOverlayDemo.tsx +1 -1
  45. package/LayoutParts/DesktopHeaderBadge.tsx +28 -0
  46. package/LayoutParts/DesktopNavActions.tsx +15 -0
  47. package/LayoutParts/DesktopNavBar.tsx +113 -0
  48. package/LayoutParts/DesktopNavBarItem.tsx +44 -0
  49. package/{AppShell → LayoutParts}/GlobalHead.tsx +1 -2
  50. package/LayoutParts/Logo.tsx +77 -0
  51. package/LayoutParts/MenuFab.tsx +131 -0
  52. package/LayoutParts/MenuFabItem.tsx +25 -0
  53. package/LayoutParts/MenuFabSecondaryItem.tsx +37 -0
  54. package/{AppShell/PlaceholderFab/index.tsx → LayoutParts/PlaceholderFab.tsx} +1 -1
  55. package/LayoutParts/StickyBelowHeader.tsx +25 -0
  56. package/LayoutParts/index.ts +12 -0
  57. package/{AppShell → LayoutParts}/useFabAnimation.ts +0 -0
  58. package/Page/CssAndFramerMotionProvider.tsx +21 -0
  59. package/Page/index.ts +2 -0
  60. package/Page/types.ts +2 -8
  61. package/PageLoadIndicator/index.tsx +25 -30
  62. package/PageMeta/index.tsx +1 -1
  63. package/Pagination/index.tsx +37 -54
  64. package/RenderType/index.tsx +1 -1
  65. package/Row/ButtonLinkList/ButtonLinkList.tsx +35 -37
  66. package/Row/ButtonLinkList/ButtonLinkListItem.tsx +16 -33
  67. package/Row/ColumnOne/index.tsx +5 -10
  68. package/Row/ColumnOneBoxed/index.tsx +18 -19
  69. package/Row/ColumnOneCentered/index.tsx +3 -4
  70. package/Row/ColumnThree/index.tsx +62 -57
  71. package/Row/ColumnTwo/index.tsx +37 -35
  72. package/Row/ColumnTwoSpread/index.tsx +28 -37
  73. package/Row/ColumnTwoWithTop/index.tsx +37 -43
  74. package/Row/ContentLinks/index.tsx +24 -25
  75. package/Row/HeroBanner/index.tsx +98 -82
  76. package/Row/IconBlocks/IconBlock/index.tsx +45 -37
  77. package/Row/IconBlocks/index.tsx +29 -44
  78. package/Row/ImageText/index.tsx +71 -67
  79. package/Row/ImageTextBoxed/index.tsx +66 -65
  80. package/Row/ParagraphWithSidebarSlide/index.tsx +80 -76
  81. package/Row/Quote/index.tsx +3 -3
  82. package/Row/SpecialBanner/index.tsx +97 -97
  83. package/Row/index.tsx +4 -9
  84. package/SectionContainer/index.tsx +32 -31
  85. package/SectionHeader/index.tsx +41 -43
  86. package/Separator/index.tsx +19 -18
  87. package/Snackbar/MessageSnackbar.tsx +1 -2
  88. package/Snackbar/MessageSnackbarImpl.tsx +68 -115
  89. package/StarRatingField/index.tsx +24 -25
  90. package/Stepper/Stepper.tsx +34 -32
  91. package/Styles/EmotionProvider.tsx +14 -0
  92. package/Styles/breakpointVal.tsx +16 -10
  93. package/Styles/extendableComponent.ts +70 -0
  94. package/Styles/index.tsx +9 -2
  95. package/Styles/withEmotionCache.tsx +36 -0
  96. package/Styles/withTheme.tsx +15 -24
  97. package/SvgIcon/SvgIcon.tsx +60 -0
  98. package/TextInputNumber/index.tsx +49 -50
  99. package/Theme/MuiButton.ts +128 -0
  100. package/Theme/MuiSlider.ts +28 -0
  101. package/Theme/MuiSnackbar.ts +31 -0
  102. package/Theme/{types.ts → createTheme.ts} +8 -2
  103. package/Theme/index.ts +4 -0
  104. package/Theme/themeDefaults.ts +51 -0
  105. package/TimeAgo/index.tsx +1 -1
  106. package/ToggleButton/index.tsx +43 -49
  107. package/ToggleButtonGroup/index.tsx +39 -39
  108. package/UspList/UspListItem.tsx +56 -46
  109. package/UspList/index.tsx +29 -26
  110. package/docs/building-components.mdx +3 -0
  111. package/docs/components/ComponentBasic.tsx +26 -0
  112. package/docs/components/ComponentChild.tsx +48 -0
  113. package/docs/components/ComponentChildVariant.tsx +54 -0
  114. package/docs/components/ComponentChildVariantExtendable.tsx +62 -0
  115. package/docs/components/ComponentStylable.tsx +32 -0
  116. package/docs/pages/building-components.tsx +62 -0
  117. package/index.ts +27 -81
  118. package/package.json +25 -27
  119. package/types.d.ts +1 -1
  120. package/AppShell/AppShellSticky/index.tsx +0 -38
  121. package/AppShell/DesktopNavActions.tsx +0 -32
  122. package/AppShell/DesktopNavBar.tsx +0 -158
  123. package/AppShell/Logo.tsx +0 -46
  124. package/AppShell/Menu.tsx +0 -7
  125. package/AppShell/MenuFab.tsx +0 -162
  126. package/AppShell/MenuFabSecondaryItem.tsx +0 -32
  127. package/AppShell/index.ts +0 -15
  128. package/AspectRatioContainer/index.tsx +0 -27
  129. package/Footer/SocialIcon.tsx +0 -23
  130. package/Form/index.tsx +0 -67
  131. package/FramerScroller/components/SidebarGallery.tsx +0 -317
  132. package/FramerScroller/components/SidebarSlider.tsx +0 -97
  133. package/Page/App.tsx +0 -17
  134. package/Page/Document.tsx +0 -24
  135. package/StyledBadge/index.tsx +0 -20
  136. package/Styles/classesPicker.ts +0 -41
  137. package/SvgImage/SvgImageSimple.tsx +0 -100
  138. package/SvgImage/index.tsx +0 -74
@@ -1,86 +1,47 @@
1
- import { Chip, ChipProps, makeStyles, Menu, Theme } from '@material-ui/core'
2
- import clsx from 'clsx'
1
+ import { Chip, ChipProps, Menu, MenuProps, menuClasses, SxProps, Theme } from '@mui/material'
3
2
  import React, { PropsWithChildren, useState } from 'react'
4
- import SectionHeader from '../SectionHeader'
3
+ import { SectionHeader } from '../SectionHeader'
4
+ import { extendableComponent } from '../Styles'
5
5
  import { responsiveVal } from '../Styles/responsiveVal'
6
- import SvgImageSimple from '../SvgImage/SvgImageSimple'
6
+ import { SvgIcon } from '../SvgIcon/SvgIcon'
7
7
  import { iconChevronDown, iconChevronUp, iconCancelAlt } from '../icons'
8
8
 
9
- export const useChipMenuStyles = makeStyles(
10
- (theme: Theme) => ({
11
- chip: {
12
- background: `${theme.palette.background.default} !important`,
13
- },
14
- chipSelected: {
15
- borderColor: theme.palette.text.primary,
16
- color: theme.palette.text.primary,
17
- '&:hover': {
18
- background: `${theme.palette.background.default} !important`,
19
- borderColor: theme.palette.divider,
20
- },
21
- '&:focus': {
22
- background: `${theme.palette.background.paper} !important`,
23
- },
24
- },
25
- menuPaper: {
26
- minWidth: responsiveVal(200, 560),
27
- maxWidth: 560,
28
- marginTop: theme.spacings.xxs,
29
- padding: `${theme.spacings.xs} ${theme.spacings.xs}`,
30
- [theme.breakpoints.down('xs')]: {
31
- minWidth: 0,
32
- width: '100%',
33
- maxWidth: `calc(100% - (${theme.page.horizontal} * 2))`,
34
- margin: '0 auto',
35
- marginTop: '8px',
36
- },
37
- },
38
- iconCancel: {
39
- stroke: `none !important`,
40
- fill: `${theme.palette.text.primary} !important`,
41
- },
42
- menuList: {
43
- padding: 0,
44
- '&:focus': {
45
- outline: 'none',
46
- },
47
- },
48
- sectionHeaderWrapper: {
49
- marginTop: 10,
50
- },
51
- }),
52
- { name: 'ChipMenu' },
53
- )
9
+ const { classes, selectors } = extendableComponent('FilterEqual', ['chip'] as const)
54
10
 
55
11
  export type ChipMenuProps = PropsWithChildren<Omit<ChipProps, 'children'>> & {
56
12
  selectedLabel?: React.ReactNode
57
13
  selected: boolean
58
14
  onClose?: () => void
59
15
  labelRight?: React.ReactNode
16
+ sx?: SxProps<Theme>
17
+ menuProps?: Partial<MenuProps>
60
18
  }
61
19
 
62
- export default function ChipMenu(props: ChipMenuProps) {
63
- const { children, selected, onDelete, label, labelRight, onClose, selectedLabel, ...chipProps } =
64
- props
20
+ export function ChipMenu(props: ChipMenuProps) {
21
+ const {
22
+ children,
23
+ selected,
24
+ onDelete,
25
+ label,
26
+ labelRight,
27
+ onClose,
28
+ selectedLabel,
29
+ menuProps,
30
+ ...chipProps
31
+ } = props
32
+
65
33
  const [openEl, setOpenEl] = useState<null | HTMLElement>(null)
66
- const classes = useChipMenuStyles(props)
67
34
 
68
- let deleteIcon = selected ? (
69
- <div>
70
- <SvgImageSimple src={iconCancelAlt} className={classes.iconCancel} />
71
- </div>
72
- ) : (
73
- <SvgImageSimple src={iconChevronDown} />
74
- )
75
- if (openEl) deleteIcon = <SvgImageSimple src={iconChevronUp} />
35
+ let deleteIcon = <SvgIcon src={iconChevronDown} size='medium' />
36
+ if (selected) deleteIcon = <SvgIcon src={iconCancelAlt} size='medium' fillIcon />
37
+ if (openEl) deleteIcon = <SvgIcon src={iconChevronUp} size='medium' />
76
38
 
77
- const selectedAndMenuHidden = selected && !openEl && selectedLabel
39
+ const selectedAndMenuHidden = selected && !openEl && !!selectedLabel
78
40
 
79
41
  return (
80
42
  <>
81
43
  <Chip
82
- variant='default'
83
- color={selected || openEl ? 'primary' : 'default'}
44
+ color='default'
84
45
  clickable
85
46
  onDelete={onDelete || ((event) => setOpenEl(event.currentTarget.parentElement))}
86
47
  onClick={(event) => {
@@ -89,12 +50,26 @@ export default function ChipMenu(props: ChipMenuProps) {
89
50
  deleteIcon={deleteIcon}
90
51
  {...chipProps}
91
52
  label={selectedLabel ?? label}
92
- className={clsx(
93
- classes.chip,
94
- chipProps.className,
95
- selectedAndMenuHidden && classes.chipSelected,
96
- )}
53
+ className={`${classes.chip} ${chipProps.className ?? ''} ${
54
+ selectedAndMenuHidden ? 'MuiChip-selected' : ''
55
+ }`}
56
+ sx={[
57
+ { bgcolor: 'background.default' },
58
+ selectedAndMenuHidden &&
59
+ ((theme) => ({
60
+ borderColor: 'text.primary',
61
+ color: 'text.primary',
62
+ '&:hover': {
63
+ background: `${theme.palette.background.default} !important`,
64
+ borderColor: `${theme.palette.divider} !important`,
65
+ },
66
+ '&:focus': {
67
+ background: `${theme.palette.background.paper} !important`,
68
+ },
69
+ })),
70
+ ]}
97
71
  />
72
+
98
73
  <Menu
99
74
  anchorEl={openEl}
100
75
  open={!!openEl}
@@ -102,19 +77,38 @@ export default function ChipMenu(props: ChipMenuProps) {
102
77
  if (onClose) onClose()
103
78
  setOpenEl(null)
104
79
  }}
105
- getContentAnchorEl={null} // https://github.com/mui-org/material-ui/issues/7961#issuecomment-326116559
106
80
  anchorPosition={{ top: 6, left: 0 }}
107
81
  anchorOrigin={{ horizontal: 'left', vertical: 'bottom' }}
108
- classes={{ paper: classes.menuPaper, list: classes.menuList }}
82
+ {...menuProps}
83
+ sx={[
84
+ (theme) => ({
85
+ marginTop: theme.spacings.xxs,
86
+ [`& .${menuClasses.list}`]: {
87
+ padding: 0,
88
+ '&:focus': { outline: 'none' },
89
+ },
90
+ [`& .${menuClasses.paper}`]: {
91
+ minWidth: responsiveVal(200, 560),
92
+ maxWidth: 560,
93
+ padding: `0 ${theme.spacings.xs} ${theme.spacings.xs}`,
94
+ margin: 0,
95
+ [theme.breakpoints.down('sm')]: {
96
+ minWidth: 0,
97
+ width: '100%',
98
+ maxWidth: `calc(100% - (${theme.page.horizontal} * 2))`,
99
+ margin: '0 auto',
100
+ },
101
+ },
102
+ }),
103
+ // eslint-disable-next-line no-nested-ternary
104
+ ...(menuProps?.sx ? (Array.isArray(menuProps.sx) ? menuProps.sx : [menuProps.sx]) : []),
105
+ ]}
109
106
  >
110
- <SectionHeader
111
- labelLeft={label ?? ''}
112
- labelRight={labelRight ?? ''}
113
- usePadding
114
- classes={{ sectionHeaderWrapper: classes.sectionHeaderWrapper }}
115
- />
107
+ <SectionHeader labelLeft={label ?? ''} labelRight={labelRight ?? ''} usePadding />
116
108
  {children}
117
109
  </Menu>
118
110
  </>
119
111
  )
120
112
  }
113
+
114
+ ChipMenu.selectors = selectors
@@ -1,49 +1,52 @@
1
- import { makeStyles, Theme, Typography } from '@material-ui/core'
1
+ import { Box, SxProps, Theme, Typography } from '@mui/material'
2
2
  import React from 'react'
3
- import Row from '../Row'
4
- import { UseStyles } from '../Styles'
3
+ import { Row } from '../Row'
4
+ import { extendableComponent } from '../Styles'
5
5
 
6
- const useStyles = makeStyles(
7
- (theme: Theme) => ({
8
- head: {
9
- display: 'grid',
10
- justifyContent: 'space-between',
11
- gridTemplateColumns: 'auto auto',
12
- alignItems: 'end',
13
- marginBottom: theme.spacings.md,
14
- },
15
- title: {
16
- lineHeight: 1,
17
- textTransform: 'uppercase',
18
- },
19
- right: {
20
- lineHeight: 1,
21
- },
22
- }),
23
- { name: 'ContainerWithHeader' },
24
- )
6
+ const { selectors, classes } = extendableComponent('ContainerWithHeader', [
7
+ 'root',
8
+ 'head',
9
+ 'title',
10
+ 'right',
11
+ ] as const)
25
12
 
26
13
  export type ContainerWithHeaderProps = {
27
14
  title: string
28
15
  rightArea: React.ReactNode
29
16
  children: React.ReactNode
30
- } & UseStyles<typeof useStyles>
17
+ sx?: SxProps<Theme>
18
+ }
31
19
 
32
- export default function ContainerWithHeader(props: ContainerWithHeaderProps) {
33
- const { title, rightArea, children } = props
34
- const classes = useStyles(props)
20
+ export function ContainerWithHeader(props: ContainerWithHeaderProps) {
21
+ const { title, rightArea, children, sx } = props
35
22
 
36
23
  return (
37
- <Row>
38
- <div className={classes.head}>
39
- <Typography variant='h5' component='h2' className={classes.title}>
24
+ <Row className={classes.root} sx={sx}>
25
+ <Box
26
+ className={classes.head}
27
+ sx={(theme) => ({
28
+ display: 'grid',
29
+ justifyContent: 'space-between',
30
+ gridTemplateColumns: 'auto auto',
31
+ alignItems: 'end',
32
+ marginBottom: theme.spacings.md,
33
+ })}
34
+ >
35
+ <Typography
36
+ variant='h5'
37
+ component='h2'
38
+ className={classes.title}
39
+ sx={{ lineHeight: 1, textTransform: 'uppercase' }}
40
+ >
40
41
  {title}
41
42
  </Typography>
42
43
  <Typography component='div' variant='subtitle1' className={classes.right}>
43
44
  {rightArea}
44
45
  </Typography>
45
- </div>
46
+ </Box>
46
47
  {children}
47
48
  </Row>
48
49
  )
49
50
  }
51
+
52
+ ContainerWithHeader.selectors = selectors
@@ -1,23 +1,13 @@
1
- import { makeStyles, Avatar, AvatarProps } from '@material-ui/core'
2
- import React from 'react'
3
-
4
- const useStyles = makeStyles(
5
- {
6
- root: {},
7
- },
8
- { name: 'FlagAvatar' },
9
- )
1
+ import { Avatar, AvatarProps } from '@mui/material'
10
2
 
11
3
  export type FlagAvatarProps = { country: string } & Omit<AvatarProps, 'src'>
12
4
 
13
- export default function FlagAvatar(props: FlagAvatarProps) {
5
+ export function FlagAvatar(props: FlagAvatarProps) {
14
6
  const { country, ...avatarProps } = props
15
- const classes = useStyles(props)
16
7
 
17
8
  return (
18
9
  <Avatar
19
10
  {...avatarProps}
20
- classes={classes}
21
11
  imgProps={{ loading: 'lazy' }}
22
12
  alt={country}
23
13
  src={`https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.4.3/flags/1x1/${country}.svg`}
package/Footer/Footer.tsx CHANGED
@@ -1,102 +1,119 @@
1
- import { ContainerProps, Theme, makeStyles, Container } from '@material-ui/core'
1
+ import { ContainerProps, Container, Box } from '@mui/material'
2
2
  import React from 'react'
3
- import { UseStyles } from '../Styles'
3
+ import { extendableComponent } from '../Styles'
4
4
 
5
- const useStyles = makeStyles(
6
- (theme: Theme) => ({
7
- footer: {
8
- gridTemplateColumns: '5fr 3fr',
9
- gridTemplateAreas: `
10
- 'social switcher'
11
- 'links support'
12
- `,
13
- borderTop: `1px solid ${theme.palette.divider}`,
14
- padding: `${theme.page.vertical} ${theme.page.horizontal}`,
15
- display: 'grid',
16
- gap: theme.spacings.xs,
17
- alignItems: 'center',
18
- [theme.breakpoints.down('xs')]: {
19
- paddingTop: theme.spacings.lg,
20
- paddingBottom: theme.spacings.lg,
21
- justifyItems: 'center',
22
- gridTemplateAreas: `
23
- 'switcher switcher'
24
- 'support support'
25
- 'social social'
26
- 'links links'
27
- `,
28
- gap: theme.spacings.md,
29
- '& > *': {
30
- maxWidth: 'max-content',
31
- },
32
- },
33
- [theme.breakpoints.up('md')]: {
34
- gridTemplateColumns: 'auto auto',
35
- gridTemplateRows: 'auto',
36
- justifyContent: 'space-between',
37
- },
38
- },
39
- copyright: {
40
- display: 'grid',
41
- gridAutoFlow: 'column',
42
- alignContent: 'center',
43
- gridArea: 'links',
44
- ...theme.typography.body2,
45
- gap: theme.spacings.sm,
46
- [theme.breakpoints.down('xs')]: {
47
- gridAutoFlow: 'row',
48
- textAlign: 'center',
49
- gap: 8,
50
- },
51
- },
52
- support: {
53
- gridArea: 'support',
54
- justifySelf: 'flex-end',
55
- [theme.breakpoints.down('xs')]: {
56
- justifySelf: 'center',
57
- },
58
- },
59
- social: {
60
- display: 'grid',
61
- justifyContent: 'start',
62
- gridAutoFlow: 'column',
63
- gridArea: 'social',
64
- gap: `0 ${theme.spacings.xs}`,
65
- '& > *': {
66
- minWidth: 'min-content',
67
- },
68
- [theme.breakpoints.down('xs')]: {
69
- gap: `0 ${theme.spacings.sm}`,
70
- },
71
- },
72
- storeSwitcher: {
73
- gridArea: 'switcher',
74
- justifySelf: 'end',
75
- [theme.breakpoints.down('xs')]: {
76
- justifySelf: 'center',
77
- },
78
- },
79
- }),
80
- { name: 'Footer' },
81
- )
82
-
83
- export type FooterProps = UseStyles<typeof useStyles> & {
5
+ export type FooterProps = {
84
6
  storeSwitcher?: React.ReactNode
85
- socialLinks?: React.ReactElement
7
+ socialLinks?: React.ReactNode
86
8
  customerService?: React.ReactNode
87
9
  copyright?: React.ReactElement
88
10
  } & Omit<ContainerProps, 'children'>
89
11
 
12
+ const { classes, selectors } = extendableComponent('Footer', [
13
+ 'root',
14
+ 'social',
15
+ 'storeSwitcher',
16
+ 'support',
17
+ 'copyright',
18
+ ] as const)
19
+
90
20
  export function Footer(props: FooterProps) {
91
21
  const { socialLinks, storeSwitcher, customerService, copyright, ...containerProps } = props
92
- const classes = useStyles(props)
93
22
 
94
23
  return (
95
- <Container maxWidth={false} className={classes.footer} {...containerProps}>
96
- <div className={classes.social}>{socialLinks}</div>
97
- <div className={classes.storeSwitcher}>{storeSwitcher}</div>
98
- <div className={classes.support}>{customerService}</div>
99
- <div className={classes.copyright}>{copyright}</div>
24
+ <Container
25
+ sx={(theme) => ({
26
+ gridTemplateColumns: '5fr 3fr',
27
+ borderTop: `1px solid ${theme.palette.divider}`,
28
+ display: 'grid',
29
+ alignItems: 'center',
30
+
31
+ padding: `${theme.spacings.lg} ${theme.page.horizontal} ${theme.page.vertical}`,
32
+ justifyItems: 'center',
33
+ gridTemplateAreas: `
34
+ 'switcher switcher'
35
+ 'support support'
36
+ 'social social'
37
+ 'links links'
38
+ `,
39
+ gap: theme.spacings.md,
40
+ '& > *': { maxWidth: 'max-content' },
41
+
42
+ [theme.breakpoints.up('sm')]: {
43
+ gridTemplateAreas: `
44
+ 'social switcher'
45
+ 'links support'
46
+ `,
47
+ justifyItems: 'start',
48
+ padding: `${theme.page.vertical} ${theme.page.horizontal}`,
49
+ gridTemplateColumns: 'auto auto',
50
+ gridTemplateRows: 'auto',
51
+ justifyContent: 'space-between',
52
+ },
53
+ })}
54
+ maxWidth={false}
55
+ className={classes.root}
56
+ {...containerProps}
57
+ >
58
+ <Box
59
+ sx={(theme) => ({
60
+ display: 'grid',
61
+ justifyContent: 'start',
62
+ gridAutoFlow: 'column',
63
+ gridArea: 'social',
64
+ gap: { xs: `0 ${theme.spacings.xs}`, md: `0 ${theme.spacings.sm}` },
65
+ '& > *': {
66
+ minWidth: 'min-content',
67
+ },
68
+ })}
69
+ className={classes.social}
70
+ >
71
+ {socialLinks}
72
+ </Box>
73
+ <Box
74
+ sx={(theme) => ({
75
+ gridArea: 'switcher',
76
+ justifySelf: 'end',
77
+ [theme.breakpoints.down('sm')]: {
78
+ justifySelf: 'center',
79
+ },
80
+ })}
81
+ className={classes.storeSwitcher}
82
+ >
83
+ {storeSwitcher}
84
+ </Box>
85
+ <Box
86
+ sx={(theme) => ({
87
+ gridArea: 'support',
88
+ justifySelf: 'flex-end',
89
+ [theme.breakpoints.down('sm')]: {
90
+ justifySelf: 'center',
91
+ },
92
+ })}
93
+ className={classes.support}
94
+ >
95
+ {customerService}
96
+ </Box>
97
+ <Box
98
+ sx={(theme) => ({
99
+ typography: 'body2',
100
+ display: 'grid',
101
+ gridAutoFlow: 'column',
102
+ alignContent: 'center',
103
+ gridArea: 'links',
104
+ gap: theme.spacings.sm,
105
+ [theme.breakpoints.down('sm')]: {
106
+ gridAutoFlow: 'row',
107
+ textAlign: 'center',
108
+ gap: `8px`,
109
+ },
110
+ })}
111
+ className={classes.copyright}
112
+ >
113
+ {copyright}
114
+ </Box>
100
115
  </Container>
101
116
  )
102
117
  }
118
+
119
+ Footer.selectors = selectors
package/Footer/index.ts CHANGED
@@ -1,2 +1 @@
1
1
  export * from './Footer'
2
- export * from './SocialIcon'
package/Form/Form.tsx ADDED
@@ -0,0 +1,35 @@
1
+ import { darken, lighten, styled, experimental_sx, Theme } from '@mui/material'
2
+ import { responsiveVal } from '../Styles/responsiveVal'
3
+
4
+ type FormStyleProps = {
5
+ contained?: boolean
6
+ background?: 'secondary' | 'default'
7
+ }
8
+
9
+ const styles = ({ theme, contained = false, background }: { theme: Theme } & FormStyleProps) =>
10
+ experimental_sx([
11
+ {
12
+ display: 'grid',
13
+ alignItems: 'center',
14
+ padding: `${theme.spacings.xxs} 0`,
15
+ },
16
+ background === 'default' && {
17
+ background:
18
+ theme.palette.mode === 'light'
19
+ ? darken(theme.palette.background.default, 0.03)
20
+ : lighten(theme.palette.background.default, 0.1),
21
+ },
22
+ background === 'secondary' && {
23
+ background: theme.palette.secondary.light,
24
+ },
25
+ contained && {
26
+ padding: `${theme.spacings.xxs} ${theme.spacings.sm}`,
27
+ // paddingTop: theme.spacings.md,
28
+ overflow: 'hidden',
29
+ borderRadius: responsiveVal(theme.shape.borderRadius * 3, theme.shape.borderRadius * 4),
30
+ },
31
+ ])
32
+
33
+ export const Form = styled('form')<FormStyleProps>(styles)
34
+
35
+ export const FormDiv = styled('div')<FormStyleProps>(styles)
@@ -1,15 +1,10 @@
1
- import { styled } from '@material-ui/core'
1
+ import { styled } from '@mui/material'
2
2
 
3
- const FormActions = styled('div')(
4
- ({ theme }) => ({
5
- paddingTop: theme.spacings.md,
6
- paddingBottom: theme.spacings.lg,
7
- justifyContent: 'center',
8
- display: 'grid',
9
- gridAutoFlow: 'column',
10
- gap: `calc(${theme.spacings.xxs} * 2)`,
11
- }),
12
- { name: 'FormActions' },
13
- )
14
-
15
- export default FormActions
3
+ export const FormActions = styled('div', { name: 'FormActions' })(({ theme }) => ({
4
+ paddingTop: theme.spacings.md,
5
+ paddingBottom: theme.spacings.lg,
6
+ justifyContent: 'center',
7
+ display: 'grid',
8
+ gridAutoFlow: 'column',
9
+ gap: `calc(${theme.spacings.xxs} * 2)`,
10
+ }))
@@ -1,14 +1,9 @@
1
- import { styled } from '@material-ui/core'
1
+ import { styled } from '@mui/material'
2
2
 
3
- const FormDivider = styled('div')(
4
- ({ theme }) => ({
5
- background: theme.palette.divider,
6
- height: 1,
7
- width: '100%',
8
- marginTop: theme.spacings.xxs,
9
- marginBottom: theme.spacings.xxs,
10
- }),
11
- { name: 'FormDivider' },
12
- )
13
-
14
- export default FormDivider
3
+ export const FormDivider = styled('div', { name: 'FormDivider' })(({ theme }) => ({
4
+ background: theme.palette.divider,
5
+ height: 1,
6
+ width: '100%',
7
+ marginTop: theme.spacings.xxs,
8
+ marginBottom: theme.spacings.xxs,
9
+ }))
@@ -1,27 +1,6 @@
1
- import { makeStyles, Theme, Typography, TypographyProps } from '@material-ui/core'
2
- import React from 'react'
3
- import { UseStyles } from '../Styles'
1
+ import { styled, Typography } from '@mui/material'
4
2
 
5
- const useStyles = makeStyles(
6
- (theme: Theme) => ({
7
- heading: {
8
- marginBottom: `calc(${theme.spacings.xxs} * -1)`,
9
- marginTop: theme.spacings.xxs,
10
- },
11
- }),
12
- { name: 'FormHeader' },
13
- )
14
-
15
- export type FormHeaderProps = TypographyProps &
16
- UseStyles<typeof useStyles> & { children: React.ReactNode }
17
-
18
- export default function FormHeader(props: FormHeaderProps) {
19
- const { children, ...typographyProps } = props
20
- const classes = useStyles(props)
21
-
22
- return (
23
- <Typography {...typographyProps} className={classes.heading}>
24
- {children}
25
- </Typography>
26
- )
27
- }
3
+ export const FormHeader = styled(Typography, { name: 'FormHeader' })(({ theme }) => ({
4
+ marginBottom: `calc(${theme.spacings.xxs} * -1)`,
5
+ marginTop: theme.spacings.xxs,
6
+ }))
package/Form/FormRow.tsx CHANGED
@@ -1,14 +1,9 @@
1
- import { styled } from '@material-ui/core'
1
+ import { styled } from '@mui/material'
2
2
 
3
- const FormRow = styled('div')(
4
- ({ theme }) => ({
5
- paddingTop: theme.spacings.xxs,
6
- paddingBottom: theme.spacings.xxs,
7
- display: 'grid',
8
- gridTemplateColumns: `repeat(auto-fit, minmax(200px, 1fr))`,
9
- gap: `calc(${theme.spacings.xxs} * 2)`,
10
- }),
11
- { name: 'FormRow' },
12
- )
13
-
14
- export default FormRow
3
+ export const FormRow = styled('div', { name: 'FormRow' })(({ theme }) => ({
4
+ paddingTop: theme.spacings.xxs,
5
+ paddingBottom: theme.spacings.xxs,
6
+ display: 'grid',
7
+ gridTemplateColumns: `repeat(auto-fit, minmax(200px, 1fr))`,
8
+ gap: `calc(${theme.spacings.xxs} * 2)`,
9
+ }))