@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,154 +1,27 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
- import { Divider, makeStyles, Theme } from '@material-ui/core'
2
+ import { Box, SxProps, Theme } from '@mui/material'
3
3
  import React, { useRef } from 'react'
4
- import { UseStyles } from '../../Styles'
5
- import { classesPicker } from '../../Styles/classesPicker'
4
+ import { extendableComponent } from '../../Styles'
6
5
  import { useScrollY } from '../hooks/useScrollY'
7
6
  import { FloatingProps } from './LayoutHeadertypes'
8
7
 
9
- type Classes = 'bg' | 'content' | 'left' | 'center' | 'right' | 'divider'
10
-
11
- const time = '150ms'
12
-
13
- const useStyles = makeStyles(
14
- (theme: Theme) => ({
15
- bg: {
16
- position: 'absolute',
17
- left: 0,
18
- width: '100%',
19
- backgroundColor: theme.palette.background.paper,
20
- boxShadow: theme.shadows[1],
21
- opacity: 0,
22
- transition: `opacity ${time}`,
23
-
24
- height: theme.appShell.headerHeightSm,
25
- [theme.breakpoints.up('md')]: {
26
- height: theme.appShell.appBarHeightMd,
27
- },
28
- borderTopLeftRadius: theme.shape.borderRadius * 3,
29
- borderTopRightRadius: theme.shape.borderRadius * 3,
30
- },
31
- bgDivider: {
32
- boxShadow: 'unset',
33
- },
34
- bgFloatingSm: {
35
- [theme.breakpoints.down('sm')]: {
36
- display: 'none',
37
- },
38
- },
39
- bgFloatingMd: {
40
- [theme.breakpoints.up('md')]: {
41
- display: 'none',
42
- },
43
- },
44
- bgScrolled: {
45
- opacity: 1,
46
- },
47
- content: {
48
- position: 'absolute',
49
- left: 0,
50
- width: '100%',
51
- display: 'grid',
52
- gridTemplateAreas: `"left center right"`,
53
- gridTemplateColumns: '1fr auto 1fr',
54
- alignItems: 'center',
55
- // columnGap: theme.spacings.xs,
56
-
57
- height: theme.appShell.headerHeightSm,
58
- [theme.breakpoints.up('md')]: {
59
- padding: `0 ${theme.page.horizontal}`,
60
- height: theme.appShell.appBarHeightMd,
61
- },
62
- },
63
- contentFloatingMd: {
64
- [theme.breakpoints.up('md')]: {
65
- padding: `0 ${theme.page.horizontal}`,
66
- background: 'none',
67
- pointerEvents: 'none',
68
- },
69
- },
70
- contentFloatingSm: {
71
- [theme.breakpoints.down('sm')]: {
72
- padding: `0 ${theme.page.horizontal}`,
73
- background: 'none',
74
- pointerEvents: 'none',
75
- },
76
- },
77
- left: {
78
- '& > *': { pointerEvents: 'all' },
79
- display: 'grid',
80
- gridAutoFlow: 'column',
81
- gap: theme.spacings.sm,
82
- gridArea: 'left',
83
- justifyContent: 'start',
84
- },
85
- center: {
86
- display: 'grid',
87
- gridAutoFlow: 'column',
88
- gap: theme.spacings.sm,
89
- gridArea: 'center',
90
- justifyContent: 'start',
91
- overflow: 'hidden',
92
- transition: `opacity ${time}`,
93
- opacity: 0,
94
- },
95
- centerScrolled: {
96
- opacity: 1,
97
- '& > *': { pointerEvents: 'all' },
98
- },
99
- centerFloatingSm: {
100
- [theme.breakpoints.down('sm')]: {
101
- display: 'none',
102
- },
103
- },
104
- centerFloatingMd: {
105
- [theme.breakpoints.up('md')]: {
106
- display: 'none',
107
- },
108
- },
109
- right: {
110
- '& > *': {
111
- pointerEvents: 'all',
112
- width: 'min-content',
113
- },
114
- display: 'grid',
115
- gridAutoFlow: 'column',
116
- gap: theme.spacings.sm,
117
- gridArea: 'right',
118
- justifyContent: 'end',
119
- },
120
- divider: {
121
- position: 'absolute',
122
- bottom: 0,
123
- left: 0,
124
- right: 0,
125
- },
126
- dividerFloatingSm: {
127
- [theme.breakpoints.down('sm')]: {
128
- display: 'none',
129
- },
130
- },
131
- dividerFloatingMd: {
132
- [theme.breakpoints.up('md')]: {
133
- display: 'none',
134
- },
135
- },
136
- }),
137
- { name: 'LayoutHeaderContent' },
138
- )
139
-
140
- export type ContentProps = FloatingProps &
141
- UseStyles<typeof useStyles> & {
142
- children?: React.ReactNode
143
- left?: React.ReactNode
144
- right?: React.ReactNode
145
- divider?: React.ReactNode
146
- switchPoint?: number
147
- }
148
-
149
- export default function LayoutHeaderContent(props: ContentProps) {
8
+ export type LayoutHeaderContentProps = FloatingProps & {
9
+ children?: React.ReactNode
10
+ left?: React.ReactNode
11
+ right?: React.ReactNode
12
+ divider?: React.ReactNode
13
+ switchPoint?: number
14
+ sx?: SxProps<Theme>
15
+ sxBg?: SxProps<Theme>
16
+ }
17
+
18
+ type OwnerState = { floatingSm: boolean; floatingMd: boolean; scrolled: boolean; divider: boolean }
19
+ const name = 'LayoutHeaderContent' as const
20
+ const parts = ['bg', 'content', 'left', 'center', 'right', 'divider'] as const
21
+ const { withState } = extendableComponent<OwnerState, typeof name, typeof parts>(name, parts)
22
+
23
+ export default function LayoutHeaderContent(props: LayoutHeaderContentProps) {
150
24
  const ref = useRef<HTMLDivElement>(null)
151
- const scroll = useScrollY()
152
25
 
153
26
  const {
154
27
  left,
@@ -158,12 +31,14 @@ export default function LayoutHeaderContent(props: ContentProps) {
158
31
  floatingMd = false,
159
32
  floatingSm = false,
160
33
  switchPoint = 50,
34
+ sx = [],
35
+ sxBg = [],
161
36
  } = props
162
- const classes = useStyles(props)
163
37
 
38
+ const scroll = useScrollY()
164
39
  const scrolled = useMotionValueValue(scroll, (y) => y >= switchPoint)
165
40
 
166
- const className = classesPicker<Classes>(classes, {
41
+ const classes = withState({
167
42
  floatingSm,
168
43
  floatingMd,
169
44
  scrolled,
@@ -172,13 +47,174 @@ export default function LayoutHeaderContent(props: ContentProps) {
172
47
 
173
48
  return (
174
49
  <>
175
- <div {...className('bg')} />
176
- <div {...className('content')} ref={ref}>
177
- {left && <div {...className('left')}>{left}</div>}
178
- <div {...className('center')}>{children}</div>
179
- <div {...className('right')}>{right}</div>
180
- {divider && <div {...className('divider')}>{divider}</div>}
181
- </div>
50
+ <Box
51
+ className={classes.bg}
52
+ sx={[
53
+ (theme) => ({
54
+ position: 'absolute',
55
+ left: 0,
56
+ width: '100%',
57
+ backgroundColor: theme.palette.background.paper,
58
+ boxShadow: theme.shadows[1],
59
+
60
+ height: theme.appShell.headerHeightSm,
61
+ [theme.breakpoints.up('md')]: {
62
+ height: theme.appShell.appBarHeightMd,
63
+ },
64
+ borderTopLeftRadius: theme.shape.borderRadius * 3,
65
+ borderTopRightRadius: theme.shape.borderRadius * 3,
66
+
67
+ '&.floatingSm': {
68
+ [theme.breakpoints.down('md')]: {
69
+ display: 'none',
70
+ },
71
+ },
72
+ '&.floatingMd': {
73
+ [theme.breakpoints.up('md')]: {
74
+ display: 'none',
75
+ },
76
+ },
77
+
78
+ opacity: 0,
79
+ transition: `opacity 150ms`,
80
+ '&.scrolled': {
81
+ opacity: 1,
82
+ },
83
+
84
+ '&.divider': {
85
+ boxShadow: 'unset',
86
+ },
87
+ }),
88
+ ...(Array.isArray(sxBg) ? sxBg : [sxBg]),
89
+ ]}
90
+ />
91
+ <Box
92
+ className={classes.content}
93
+ ref={ref}
94
+ sx={[
95
+ (theme) => ({
96
+ position: 'absolute',
97
+ left: 0,
98
+ width: '100%',
99
+ display: 'grid',
100
+ gridTemplateAreas: `"left center right"`,
101
+ gridTemplateColumns: '1fr auto 1fr',
102
+ alignItems: 'center',
103
+ // columnGap: theme.spacings.xs,
104
+
105
+ height: theme.appShell.headerHeightSm,
106
+ padding: `0 ${theme.page.horizontal}`,
107
+
108
+ [theme.breakpoints.up('md')]: {
109
+ height: theme.appShell.appBarHeightMd,
110
+ },
111
+
112
+ '&.floatingSm': {
113
+ [theme.breakpoints.down('md')]: {
114
+ padding: `0 ${theme.page.horizontal}`,
115
+ background: 'none',
116
+ pointerEvents: 'none',
117
+ },
118
+ },
119
+ '&.floatingMd': {
120
+ [theme.breakpoints.up('md')]: {
121
+ padding: `0 ${theme.page.horizontal}`,
122
+ background: 'none',
123
+ pointerEvents: 'none',
124
+ },
125
+ },
126
+ }),
127
+ ...(Array.isArray(sx) ? sx : [sx]),
128
+ ]}
129
+ >
130
+ {left && (
131
+ <Box
132
+ className={classes.left}
133
+ sx={(theme) => ({
134
+ '& > *': { pointerEvents: 'all' },
135
+ display: 'grid',
136
+ gridAutoFlow: 'column',
137
+ gap: theme.spacings.sm,
138
+ gridArea: 'left',
139
+ justifyContent: 'start',
140
+ })}
141
+ >
142
+ {left}
143
+ </Box>
144
+ )}
145
+ <Box
146
+ className={classes.center}
147
+ sx={(theme) => ({
148
+ display: 'grid',
149
+ gridAutoFlow: 'column',
150
+ gap: theme.spacings.sm,
151
+ gridArea: 'center',
152
+ justifyContent: 'start',
153
+ overflow: 'hidden',
154
+
155
+ transition: `opacity 150ms`,
156
+ opacity: 0,
157
+ '&.scrolled': {
158
+ opacity: 1,
159
+ '& > *': { pointerEvents: 'all' },
160
+ },
161
+
162
+ '&.floatingSm': {
163
+ [theme.breakpoints.down('md')]: {
164
+ display: 'none',
165
+ },
166
+ },
167
+
168
+ '&.floatingMd': {
169
+ [theme.breakpoints.up('md')]: {
170
+ display: 'none',
171
+ },
172
+ },
173
+ })}
174
+ >
175
+ {children}
176
+ </Box>
177
+ <Box
178
+ className={classes.right}
179
+ sx={(theme) => ({
180
+ '& > *': {
181
+ pointerEvents: 'all',
182
+ width: 'min-content',
183
+ },
184
+ display: 'grid',
185
+ gridAutoFlow: 'column',
186
+ gap: theme.spacings.sm,
187
+ gridArea: 'right',
188
+ justifyContent: 'end',
189
+ })}
190
+ >
191
+ {right}
192
+ </Box>
193
+ {divider && (
194
+ <Box
195
+ className={classes.divider}
196
+ sx={(theme) => ({
197
+ position: 'absolute',
198
+ bottom: 0,
199
+ left: 0,
200
+ right: 0,
201
+
202
+ '&.floatingSm': {
203
+ [theme.breakpoints.down('md')]: {
204
+ display: 'none',
205
+ },
206
+ },
207
+ '&.floatingMd': {
208
+ [theme.breakpoints.up('md')]: {
209
+ display: 'none',
210
+ },
211
+ },
212
+ })}
213
+ >
214
+ {divider}
215
+ </Box>
216
+ )}
217
+ </Box>
182
218
  </>
183
219
  )
184
220
  }
@@ -1,6 +1,6 @@
1
1
  type Matrix<T extends string, M extends string> = `${T}${Capitalize<M>}`
2
2
 
3
- // Possible configurations for the AppShellHeader
3
+ // Possible configurations for the LayoutHeader
4
4
  export type Variant = 'floating'
5
5
  export type Size = 'sm' | 'md'
6
6
 
@@ -1,79 +1,84 @@
1
- import { makeStyles, Theme, Typography, TypographyProps } from '@material-ui/core'
1
+ import { Box, SxProps, Theme, Typography, TypographyProps } from '@mui/material'
2
2
  import React from 'react'
3
- import { UseStyles } from '../../Styles'
4
- import { classesPicker } from '../../Styles/classesPicker'
5
- import { responsiveVal } from '../../Styles/responsiveVal'
6
- import { SvgImageProps } from '../../SvgImage'
7
- import SvgImageSimple from '../../SvgImage/SvgImageSimple'
3
+ import { extendableComponent, responsiveVal } from '../../Styles'
4
+ import { SvgIcon, SvgIconProps } from '../../SvgIcon/SvgIcon'
8
5
 
9
- const useStyles = makeStyles(
10
- (theme: Theme) => ({
11
- container: {
12
- display: 'flex',
13
- alignItems: 'center',
14
- justifyContent: 'center',
15
- gap: 6,
16
- flexFlow: 'unset',
17
- [theme.breakpoints.up('md')]: {
18
- flexFlow: 'column',
19
- },
20
- },
21
- containerSizeSmall: {
22
- flexFlow: 'unset',
23
- overflow: 'hidden',
24
- '& svg': {
25
- width: responsiveVal(24, 28),
26
- height: responsiveVal(24, 28),
27
- strokeWidth: 1.4,
28
- },
29
- '& > *': {
30
- overflow: 'hidden',
31
- whiteSpace: 'nowrap',
32
- textOverflow: 'ellipsis',
33
- },
34
- },
35
- containerGutterTop: {
36
- marginTop: theme.spacings.xl,
37
- },
38
- containerGutterBottom: {
39
- marginBottom: theme.spacings.lg,
40
- },
41
- typography: {},
42
- }),
43
- { name: 'Title' },
6
+ type OwnerState = {
7
+ size?: 'small' | 'medium'
8
+ gutterTop?: boolean
9
+ gutterBottom?: boolean
10
+ }
11
+
12
+ const parts = ['root', 'title', 'icon'] as const
13
+ const { withState } = extendableComponent<OwnerState, 'LayoutTitle', typeof parts>(
14
+ 'LayoutTitle',
15
+ parts,
44
16
  )
45
17
 
46
18
  export type TitleProps = {
47
19
  children: React.ReactNode
48
- icon?: SvgImageProps['src']
49
- size?: 'small' | 'medium'
20
+ icon?: SvgIconProps['src']
50
21
  variant?: TypographyProps['variant']
51
- gutterTop?: boolean
52
- gutterBottom?: boolean
53
22
  component?: React.ElementType
54
- } & UseStyles<typeof useStyles>
23
+ sx?: SxProps<Theme>
24
+ } & OwnerState
55
25
 
56
26
  export const LayoutTitle = React.forwardRef<HTMLDivElement, TitleProps>((props, ref) => {
57
- const { children, icon, size = 'medium', component, variant } = props
58
- const classes = useStyles(props)
59
- const small = size === 'small'
27
+ const { children, icon, size = 'medium', component, variant, sx = [] } = props
60
28
 
61
29
  const gutterTop = !!(props.gutterTop ?? size !== 'small')
62
30
  const gutterBottom = !!(props.gutterBottom ?? size !== 'small')
63
31
 
64
- const className = classesPicker(classes, { size, gutterBottom, gutterTop })
32
+ const classes = withState({ size, gutterBottom, gutterTop })
65
33
 
66
34
  return (
67
- <div {...className('container')}>
68
- {icon && <SvgImageSimple src={icon} size={small ? 'large' : 'xl'} />}
35
+ <Box
36
+ className={classes.root}
37
+ sx={[
38
+ (theme) => ({
39
+ display: 'flex',
40
+ alignItems: 'center',
41
+ justifyContent: 'center',
42
+ gap: `6px`,
43
+ flexFlow: 'unset',
44
+ [theme.breakpoints.up('md')]: {
45
+ flexFlow: 'column',
46
+ },
47
+ '&.sizeSmall': {
48
+ flexFlow: 'unset',
49
+ overflow: 'hidden',
50
+ '& svg': {
51
+ width: responsiveVal(24, 28),
52
+ height: responsiveVal(24, 28),
53
+ strokeWidth: 1.4,
54
+ },
55
+ '& > *': {
56
+ overflow: 'hidden',
57
+ whiteSpace: 'nowrap',
58
+ textOverflow: 'ellipsis',
59
+ },
60
+ },
61
+ '&.gutterTop': {
62
+ marginTop: theme.spacings.xl,
63
+ },
64
+ '&.gutterBottom': {
65
+ marginBottom: theme.spacings.xl,
66
+ },
67
+ }),
68
+ ...(Array.isArray(sx) ? sx : [sx]),
69
+ ]}
70
+ >
71
+ {icon && (
72
+ <SvgIcon src={icon} size={size === 'small' ? 'large' : 'xl'} className={classes.icon} />
73
+ )}
69
74
  <Typography
70
75
  ref={ref}
71
- variant={variant || (small ? 'h6' : 'h3')}
76
+ variant={variant || (size === 'small' ? 'h6' : 'h3')}
72
77
  component={component ?? 'h1'}
73
- className={small ? undefined : classes.typography}
78
+ className={classes.title}
74
79
  >
75
80
  {children}
76
81
  </Typography>
77
- </div>
82
+ </Box>
78
83
  )
79
84
  })