@graphcommerce/next-ui 9.0.0-canary.99 → 9.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 (189) hide show
  1. package/ActionCard/ActionCard.tsx +219 -203
  2. package/ActionCard/ActionCardAccordion.tsx +4 -2
  3. package/ActionCard/ActionCardLayout.tsx +3 -2
  4. package/ActionCard/ActionCardList.tsx +6 -5
  5. package/Blog/BlogAuthor/BlogAuthor.tsx +5 -4
  6. package/Blog/BlogContent/BlogContent.tsx +3 -2
  7. package/Blog/BlogHeader/BlogHeader.tsx +4 -3
  8. package/Blog/BlogList/BlogList.tsx +3 -3
  9. package/Blog/BlogListItem/BlogListItem.tsx +6 -5
  10. package/Blog/BlogTags/BlogTag.tsx +3 -2
  11. package/Blog/BlogTags/BlogTags.tsx +1 -1
  12. package/Breadcrumbs/Breadcrumbs.tsx +25 -19
  13. package/Breadcrumbs/BreadcrumbsList.tsx +3 -2
  14. package/Breadcrumbs/jsonLdBreadcrumb.tsx +1 -1
  15. package/Breadcrumbs/types.ts +1 -2
  16. package/Button/Button.tsx +2 -1
  17. package/Button/LinkOrButton.tsx +4 -2
  18. package/CHANGELOG.md +294 -1344
  19. package/ChipMenu/ChipMenu.tsx +3 -2
  20. package/Config.graphqls +28 -10
  21. package/Container/Container.tsx +90 -0
  22. package/ContainerWithHeader/ContainerWithHeader.tsx +2 -1
  23. package/Document/DocumentBodyEnd.tsx +1 -1
  24. package/Document/DocumentBodyStart.tsx +1 -1
  25. package/Document/DocumentHeadEnd.tsx +1 -1
  26. package/Document/DocumentHeadStart.tsx +1 -1
  27. package/Fab/Fab.tsx +15 -17
  28. package/FlagAvatar/FlagAvatar.tsx +2 -1
  29. package/Footer/Footer.tsx +14 -10
  30. package/Form/Form.tsx +2 -1
  31. package/Form/FormHeader.tsx +1 -1
  32. package/Form/FormRow.tsx +1 -1
  33. package/Form/InputCheckmark.tsx +2 -1
  34. package/FramerScroller/ItemScroller.tsx +5 -8
  35. package/FramerScroller/SidebarGallery.tsx +23 -30
  36. package/FramerScroller/SidebarSlider.tsx +8 -7
  37. package/FullPageMessage/FullPageMessage.tsx +2 -1
  38. package/IconHeader/IconHeader.tsx +5 -3
  39. package/IconSvg/IconSvg.tsx +8 -7
  40. package/Intl/DateTimeFormat/DateFormat.tsx +6 -4
  41. package/Intl/DateTimeFormat/DateTimeFormat.tsx +10 -14
  42. package/Intl/DateTimeFormat/TimeFormat.tsx +6 -4
  43. package/Intl/DateTimeFormat/index.ts +1 -0
  44. package/Intl/DateTimeFormat/useIntlDateTimeFormat.ts +13 -0
  45. package/Intl/DisplayNames/DisplayNames.tsx +5 -13
  46. package/Intl/DisplayNames/index.ts +1 -0
  47. package/Intl/DisplayNames/useIntlDisplayNames.ts +12 -0
  48. package/Intl/{ListFormat.tsx → ListFormat/ListFormat.tsx} +8 -13
  49. package/Intl/ListFormat/index.ts +2 -0
  50. package/Intl/ListFormat/useIntlListFormat.ts +15 -0
  51. package/Intl/NumberFormat/CurrencyFormat.tsx +4 -2
  52. package/Intl/NumberFormat/NumberFormat.tsx +15 -17
  53. package/Intl/NumberFormat/PercentFormat.tsx +6 -2
  54. package/Intl/NumberFormat/UnitFormat.tsx +5 -5
  55. package/Intl/NumberFormat/index.ts +1 -0
  56. package/Intl/NumberFormat/useIntlNumberFormat.ts +17 -0
  57. package/Intl/RelativeTimeFormat/RelativeTimeFormat.tsx +6 -13
  58. package/Intl/RelativeTimeFormat/RelativeToTimeFormat.tsx +4 -2
  59. package/Intl/RelativeTimeFormat/index.ts +1 -0
  60. package/Intl/RelativeTimeFormat/useIntlRelativeTimeFormat.ts +15 -0
  61. package/Intl/useIntlLocalesArgument.ts +16 -0
  62. package/Layout/components/LayoutHeader.tsx +7 -4
  63. package/Layout/components/LayoutHeaderBack.tsx +6 -4
  64. package/Layout/components/LayoutHeaderClose.tsx +1 -1
  65. package/Layout/components/LayoutHeaderContent.tsx +11 -12
  66. package/Layout/components/LayoutProvider.tsx +1 -1
  67. package/Layout/components/LayoutTitle.tsx +5 -3
  68. package/Layout/context/layoutContext.tsx +1 -1
  69. package/Layout/types.ts +1 -1
  70. package/LayoutDefault/components/LayoutDefault.tsx +12 -10
  71. package/LayoutOverlay/components/LayoutOverlay.tsx +3 -2
  72. package/LayoutOverlay/components/LayoutOverlayHeader.tsx +2 -1
  73. package/LayoutOverlay/test/LayoutOverlayDemo.tsx +4 -1
  74. package/LayoutParts/DesktopHeaderBadge.tsx +2 -1
  75. package/LayoutParts/DesktopNavBar.tsx +26 -22
  76. package/LayoutParts/DesktopNavBarItem.tsx +11 -7
  77. package/LayoutParts/Logo.tsx +5 -5
  78. package/LayoutParts/MenuFab.tsx +7 -13
  79. package/LayoutParts/MenuFabItem.tsx +6 -1
  80. package/LayoutParts/MenuFabSecondaryItem.tsx +11 -7
  81. package/LayoutParts/MobileTopRight.tsx +24 -0
  82. package/LayoutParts/PlaceholderFab.tsx +2 -1
  83. package/LayoutParts/StickyBelowHeader.tsx +2 -1
  84. package/LayoutParts/index.ts +1 -0
  85. package/LazyHydrate/LazyHydrate.tsx +18 -21
  86. package/MediaQuery/MediaQuery.tsx +111 -0
  87. package/MediaQuery/index.ts +1 -0
  88. package/Navigation/components/NavigationFab.tsx +3 -2
  89. package/Navigation/components/NavigationItem.tsx +3 -3
  90. package/Navigation/components/NavigationList.tsx +4 -3
  91. package/Navigation/components/NavigationOverlay.tsx +18 -11
  92. package/Navigation/components/NavigationProvider.tsx +9 -8
  93. package/Navigation/components/NavigationTitle.tsx +5 -5
  94. package/Navigation/hooks/useNavigation.ts +4 -2
  95. package/Overlay/components/Overlay.tsx +3 -2
  96. package/Overlay/components/OverlayBase.tsx +71 -30
  97. package/Overlay/components/OverlayContainer.tsx +2 -2
  98. package/Overlay/components/OverlayHeader.tsx +7 -4
  99. package/Overlay/components/OverlaySsr.tsx +2 -1
  100. package/Overlay/components/OverlayStickyBottom.tsx +2 -1
  101. package/Overlay/utils/variantsToScrollSnapType.ts +2 -2
  102. package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +5 -12
  103. package/OverlayOrPopperChip/OverlayOrPopperPanel.tsx +3 -3
  104. package/OverlayOrPopperChip/OverlayPanel.tsx +13 -7
  105. package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -2
  106. package/OverlayOrPopperChip/PopperPanel.tsx +3 -2
  107. package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -2
  108. package/OverlayOrPopperChip/types.ts +2 -2
  109. package/OverlayOrPopperChip/useHandleClickNotDrag.ts +3 -1
  110. package/Page/CssAndFramerMotionProvider.tsx +2 -1
  111. package/Page/types.ts +5 -5
  112. package/PageLoadIndicator/PageLoadIndicator.tsx +3 -2
  113. package/PageMeta/PageMeta.tsx +3 -2
  114. package/PageMeta/canonicalize.ts +7 -3
  115. package/Pagination/Pagination.tsx +4 -2
  116. package/Pagination/PaginationExtended.tsx +2 -9
  117. package/RenderType/RenderType.tsx +6 -0
  118. package/Row/ButtonLinkList/ButtonLinkList.tsx +4 -7
  119. package/Row/ButtonLinkList/ButtonLinkListItem.tsx +2 -1
  120. package/Row/ColumnOne/variant/VariantMessage.tsx +2 -4
  121. package/Row/ColumnOneBoxed/ColumnOneBoxed.tsx +4 -2
  122. package/Row/ColumnOneCentered/ColumnOneCentered.tsx +4 -2
  123. package/Row/ColumnThree/ColumnThree.tsx +6 -5
  124. package/Row/ColumnTwo/ColumnTwo.tsx +8 -7
  125. package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +7 -5
  126. package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +5 -4
  127. package/Row/ContentLinks/ContentLinks.tsx +4 -3
  128. package/Row/HeroBanner/HeroBanner.tsx +3 -2
  129. package/Row/IconBlocks/IconBlock.tsx +3 -2
  130. package/Row/IconBlocks/IconBlocks.tsx +3 -2
  131. package/Row/ImageText/ImageText.tsx +3 -2
  132. package/Row/ImageTextBoxed/ImageTextBoxed.tsx +4 -3
  133. package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +3 -2
  134. package/Row/Quote/Quote.tsx +1 -1
  135. package/Row/Row.tsx +2 -1
  136. package/Row/RowLinks/RowLinks.tsx +36 -34
  137. package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +6 -2
  138. package/Row/RowLinks/variant/VariantInline.tsx +6 -2
  139. package/Row/RowLinks/variant/VariantLogoSwiper.tsx +2 -1
  140. package/Row/RowLinks/variant/VariantUsps.tsx +2 -1
  141. package/Row/SpecialBanner/SpecialBanner.tsx +3 -2
  142. package/SectionContainer/SectionContainer.tsx +3 -2
  143. package/SectionHeader/SectionHeader.tsx +2 -1
  144. package/Separator/Separator.tsx +3 -2
  145. package/Snackbar/DismissibleSnackbar.tsx +1 -1
  146. package/Snackbar/ErrorSnackbar.tsx +1 -1
  147. package/Snackbar/MessageSnackbarImpl.tsx +7 -16
  148. package/StarRatingField/StarRatingField.tsx +3 -2
  149. package/Stepper/Stepper.tsx +3 -2
  150. package/Styles/__tests__/spreadVal.test.ts +4 -4
  151. package/Styles/extendableComponent.ts +4 -3
  152. package/Styles/withEmotionCache.tsx +2 -2
  153. package/Styles/withTheme.tsx +4 -1
  154. package/TextInputNumber/TextInputNumber.tsx +5 -8
  155. package/Theme/DarkLightModeThemeProvider.tsx +10 -7
  156. package/Theme/MuiButton.ts +2 -1
  157. package/Theme/MuiChip.ts +2 -1
  158. package/Theme/MuiFab.ts +2 -1
  159. package/Theme/MuiSlider.ts +3 -3
  160. package/Theme/MuiSnackbar.ts +1 -1
  161. package/Theme/NextLink.tsx +35 -15
  162. package/Theme/createTheme.ts +6 -0
  163. package/Theme/index.ts +1 -0
  164. package/Theme/themeDefaults.ts +10 -10
  165. package/Theme/useContainerSizing.ts +20 -0
  166. package/TimeAgo/TimeAgo.tsx +3 -3
  167. package/ToggleButton/ToggleButton.tsx +6 -4
  168. package/ToggleButtonGroup/ToggleButtonGroup.tsx +99 -94
  169. package/UspList/UspList.tsx +3 -2
  170. package/UspList/UspListItem.tsx +3 -2
  171. package/hooks/memoDeep.ts +3 -2
  172. package/hooks/useDateTimeFormat.ts +3 -1
  173. package/hooks/useMatchMedia.ts +2 -1
  174. package/hooks/useMemoDeep.ts +2 -1
  175. package/hooks/useNumberFormat.ts +3 -1
  176. package/index.ts +3 -1
  177. package/package.json +17 -18
  178. package/utils/cookie.ts +4 -3
  179. package/utils/robots.ts +1 -1
  180. package/utils/sitemap.ts +3 -2
  181. package/utils/sxx.ts +16 -0
  182. package/AnimatedRow/AnimatedRow.tsx +0 -23
  183. package/docs/building-components.mdx +0 -3
  184. package/docs/components/ComponentBasic.tsx +0 -26
  185. package/docs/components/ComponentChild.tsx +0 -49
  186. package/docs/components/ComponentChildVariant.tsx +0 -55
  187. package/docs/components/ComponentChildVariantExtendable.tsx +0 -63
  188. package/docs/components/ComponentStylable.tsx +0 -32
  189. package/docs/pages/building-components.tsx +0 -62
@@ -1,13 +1,5 @@
1
- import {
2
- alpha,
3
- Box,
4
- BoxProps,
5
- ButtonBase,
6
- ButtonProps,
7
- lighten,
8
- SxProps,
9
- Theme,
10
- } from '@mui/material'
1
+ import type { BoxProps, ButtonProps, SxProps, Theme } from '@mui/material'
2
+ import { alpha, Box, ButtonBase, lighten } from '@mui/material'
11
3
  import React from 'react'
12
4
  import { extendableComponent, responsiveVal } from '../Styles'
13
5
  import { breakpointVal } from '../Styles/breakpointVal'
@@ -21,16 +13,18 @@ function isButtonProps(props: ButtonProps<'div'> | BoxProps<'div'>): props is Bu
21
13
  return props.onClick !== undefined
22
14
  }
23
15
 
24
- const ButtonOrBox = (props: ButtonProps<'div'> | BoxProps<'div'>) =>
25
- isButtonProps(props) ? <ButtonBase component='div' {...props} /> : <Box {...props} />
16
+ function ButtonOrBox(props: ButtonProps<'div'> | BoxProps<'div'>) {
17
+ return isButtonProps(props) ? <ButtonBase component='div' {...props} /> : <Box {...props} />
18
+ }
26
19
 
27
- export type ActionCardProps = {
20
+ export type ActionCardProps<C extends React.ElementType = typeof Box> = {
21
+ component?: C
28
22
  variant?: Variants
29
23
  size?: Size
30
24
  color?: Color
31
25
  layout?: Layout
32
26
  sx?: SxProps<Theme>
33
- title?: string | React.ReactNode
27
+ title?: React.ReactNode
34
28
  image?: React.ReactNode
35
29
  action?: React.ReactNode
36
30
  details?: React.ReactNode
@@ -43,6 +37,19 @@ export type ActionCardProps = {
43
37
  reset?: React.ReactNode
44
38
  disabled?: boolean
45
39
  error?: boolean
40
+ slotProps?: {
41
+ root?: React.ComponentPropsWithoutRef<C>
42
+ rootInner?: BoxProps
43
+ image?: BoxProps
44
+ title?: BoxProps
45
+ action?: BoxProps
46
+ details?: BoxProps
47
+ price?: BoxProps
48
+ after?: BoxProps
49
+ secondaryAction?: BoxProps
50
+ reset?: BoxProps
51
+ end?: BoxProps
52
+ }
46
53
  }
47
54
 
48
55
  const parts = [
@@ -76,8 +83,10 @@ const { withState, selectors } = extendableComponent<StateProps, typeof name, ty
76
83
  parts,
77
84
  )
78
85
 
86
+ /** @public */
79
87
  export const actionCardSelectors = selectors
80
88
 
89
+ /** @public */
81
90
  export const actionCardImageSizes = {
82
91
  small: responsiveVal(60, 80),
83
92
  medium: responsiveVal(60, 80),
@@ -85,7 +94,13 @@ export const actionCardImageSizes = {
85
94
  responsive: responsiveVal(60, 120),
86
95
  }
87
96
 
88
- export function ActionCard(props: ActionCardProps) {
97
+ const combineSx = (defaultSx: SxProps<Theme>, slotSx?: SxProps<Theme>) => [
98
+ ...(Array.isArray(defaultSx) ? defaultSx : [defaultSx]),
99
+ ...(Array.isArray(slotSx) ? slotSx : [slotSx]),
100
+ ]
101
+
102
+ /** @public */
103
+ export function ActionCard<C extends React.ElementType = typeof Box>(props: ActionCardProps<C>) {
89
104
  const {
90
105
  title,
91
106
  image,
@@ -105,6 +120,8 @@ export function ActionCard(props: ActionCardProps) {
105
120
  variant = 'outlined',
106
121
  layout = 'list',
107
122
  error = false,
123
+ slotProps = {},
124
+ ...other
108
125
  } = props
109
126
 
110
127
  const classes = withState({
@@ -121,179 +138,147 @@ export function ActionCard(props: ActionCardProps) {
121
138
  return (
122
139
  <ButtonOrBox
123
140
  className={classes.root}
124
- onClick={onClick && ((event) => onClick?.(event, value))}
141
+ onClick={onClick ? (event) => onClick(event, value) : undefined}
125
142
  disabled={disabled}
126
- sx={[
127
- (theme) => ({
128
- ...breakpointVal(
129
- 'borderRadius',
130
- theme.shape.borderRadius * 1.5,
131
- theme.shape.borderRadius * 3,
132
- theme.breakpoints.values,
133
- ),
134
- '&.sizeSmall': {
135
- px: responsiveVal(8, 12),
136
- py: responsiveVal(4, 6),
137
- display: 'flex',
138
- typography: 'body2',
139
- },
140
- '&.sizeMedium': {
141
- px: responsiveVal(10, 14),
142
- py: responsiveVal(10, 12),
143
- typography: 'body2',
144
- display: 'block',
145
- },
146
- '&.sizeLarge': {
147
- px: responsiveVal(12, 16),
148
- py: responsiveVal(12, 14),
149
- display: 'block',
150
- },
151
- '&.sizeResponsive': {
152
- px: responsiveVal(8, 16),
153
- py: responsiveVal(4, 14),
154
- display: { xs: 'flex', md: 'block', lg: 'block' },
155
- [theme.breakpoints.down('md')]: { typography: 'body2' },
156
- },
157
-
158
- '&.variantDefault': {
159
- position: 'relative',
160
- // '&::after': {
161
- // content: '""',
162
- // position: 'absolute',
163
- // width: '100%',
164
- // left: 0,
165
- // bottom: '-1px',
166
- // borderBottom: `1px solid ${theme.palette.divider}`,
167
- // display: 'block',
168
- // },
169
- '&.selected': {
170
- backgroundColor:
171
- theme.palette.mode === 'light'
172
- ? alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
173
- : lighten(theme.palette.background.default, theme.palette.action.hoverOpacity),
143
+ sx={combineSx(
144
+ [
145
+ (theme) => ({
146
+ ...breakpointVal(
147
+ 'borderRadius',
148
+ theme.shape.borderRadius * 1.5,
149
+ theme.shape.borderRadius * 3,
150
+ theme.breakpoints.values,
151
+ ),
152
+ '&.sizeSmall': {
153
+ px: responsiveVal(8, 12),
154
+ py: responsiveVal(4, 6),
155
+ display: 'flex',
156
+ typography: 'body2',
174
157
  },
175
- '&.error': {
176
- backgroundColor: `${alpha(
177
- theme.palette.error.main,
178
- theme.palette.action.hoverOpacity,
179
- )}`,
158
+ '&.sizeMedium': {
159
+ px: responsiveVal(10, 14),
160
+ py: responsiveVal(10, 12),
161
+ typography: 'body2',
162
+ display: 'block',
180
163
  },
181
-
182
- // '&.sizeSmall': {
183
- // mt: { xs: '2px', sm: '3px', md: '5px' },
184
- // mb: { xs: '3px', sm: '4px', md: '6px' },
185
- // '&::after': {
186
- // mb: { xs: '-2px', sm: '-3px', md: '-5px' },
187
- // },
188
- // },
189
- // '&.sizeMedium': {
190
- // mt: { xs: '4px', sm: '5px', md: '6px' },
191
- // mb: { xs: '5px', sm: '6px', md: '7px' },
192
- // '&::after': {
193
- // mb: { xs: '-4px', sm: '-5px', md: '-6px' },
194
- // },
195
- // },
196
- // '&.sizeLarge': {
197
- // mt: { xs: '5px', sm: '7px', md: '8px' },
198
- // mb: { xs: '6px', sm: '8px', md: '9px' },
199
- // '&::after': {
200
- // mb: { xs: '-5px', sm: '-7px', md: '-8px' },
201
- // },
202
- // },
203
- // '&.sizeResponsive': {
204
- // mt: responsiveVal(2, 8),
205
- // mb: responsiveVal(3, 9),
206
- // '&::after': {
207
- // mb: responsiveVal(-2, -8),
208
- // },
209
- // },
210
- },
211
-
212
- '&.variantOutlined': {
213
- backgroundColor: theme.palette.background.paper,
214
- boxShadow: `inset 0 0 0 1px ${theme.palette.divider}`,
215
- '&:not(:last-of-type)': {
216
- marginBottom: '-2px',
164
+ '&.sizeLarge': {
165
+ px: responsiveVal(12, 16),
166
+ py: responsiveVal(12, 14),
167
+ display: 'block',
168
+ },
169
+ '&.sizeResponsive': {
170
+ px: responsiveVal(8, 16),
171
+ py: responsiveVal(4, 14),
172
+ display: { xs: 'flex', md: 'block', lg: 'block' },
173
+ [theme.breakpoints.down('md')]: { typography: 'body2' },
217
174
  },
218
- '&.layoutList': {
219
- borderRadius: 0,
220
- '&:first-of-type': {
221
- ...breakpointVal(
222
- 'borderTopLeftRadius',
223
- theme.shape.borderRadius * 3,
224
- theme.shape.borderRadius * 4,
225
- theme.breakpoints.values,
226
- ),
227
- ...breakpointVal(
228
- 'borderTopRightRadius',
229
- theme.shape.borderRadius * 3,
230
- theme.shape.borderRadius * 4,
231
- theme.breakpoints.values,
232
- ),
175
+ '&.variantDefault': {
176
+ position: 'relative',
177
+ '&.selected': {
178
+ backgroundColor:
179
+ theme.palette.mode === 'light'
180
+ ? alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
181
+ : lighten(theme.palette.background.default, theme.palette.action.hoverOpacity),
233
182
  },
234
- '&:last-of-type': {
235
- ...breakpointVal(
236
- 'borderBottomLeftRadius',
237
- theme.shape.borderRadius * 3,
238
- theme.shape.borderRadius * 4,
239
- theme.breakpoints.values,
240
- ),
241
- ...breakpointVal(
242
- 'borderBottomRightRadius',
243
- theme.shape.borderRadius * 3,
244
- theme.shape.borderRadius * 4,
245
- theme.breakpoints.values,
246
- ),
183
+ '&.error': {
184
+ backgroundColor: alpha(theme.palette.error.main, theme.palette.action.hoverOpacity),
185
+ },
186
+ '&:focus': {
187
+ outline: 'none',
188
+ boxShadow: `0 0 0 4px ${alpha(theme.palette[color].main, theme.palette.action.focusOpacity)}`,
247
189
  },
248
190
  },
249
-
250
- '&.selected': {
251
- borderColor: 'transparent',
252
- boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}`,
191
+ '&.variantOutlined': {
192
+ backgroundColor: theme.palette.background.paper,
193
+ boxShadow: `inset 0 0 0 1px ${theme.palette.divider}`,
194
+ '&:not(:last-of-type)': {
195
+ marginBottom: '-2px',
196
+ },
197
+ '&.layoutList': {
198
+ borderRadius: 0,
199
+ '&:first-of-type': {
200
+ ...breakpointVal(
201
+ 'borderTopLeftRadius',
202
+ theme.shape.borderRadius * 3,
203
+ theme.shape.borderRadius * 4,
204
+ theme.breakpoints.values,
205
+ ),
206
+ ...breakpointVal(
207
+ 'borderTopRightRadius',
208
+ theme.shape.borderRadius * 3,
209
+ theme.shape.borderRadius * 4,
210
+ theme.breakpoints.values,
211
+ ),
212
+ },
213
+ '&:last-of-type': {
214
+ ...breakpointVal(
215
+ 'borderBottomLeftRadius',
216
+ theme.shape.borderRadius * 3,
217
+ theme.shape.borderRadius * 4,
218
+ theme.breakpoints.values,
219
+ ),
220
+ ...breakpointVal(
221
+ 'borderBottomRightRadius',
222
+ theme.shape.borderRadius * 3,
223
+ theme.shape.borderRadius * 4,
224
+ theme.breakpoints.values,
225
+ ),
226
+ },
227
+ },
228
+ '&.selected': {
229
+ borderColor: 'transparent',
230
+ boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}`,
231
+ },
232
+ '&.selected:focus, &.error:focus': {
233
+ borderColor: 'transparent',
234
+ boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}, 0 0 0 4px ${alpha(
235
+ theme.palette[color].main,
236
+ theme.palette.action.hoverOpacity,
237
+ )}`,
238
+ },
239
+ '&:focus': {
240
+ boxShadow: `inset 0 0 0 1px ${theme.palette.divider},0 0 0 4px ${alpha(
241
+ theme.palette[color].main,
242
+ theme.palette.action.hoverOpacity,
243
+ )}`,
244
+ },
245
+ '&.error': {
246
+ boxShadow: `inset 0 0 0 2px ${theme.palette.error.main}`,
247
+ },
253
248
  },
254
- '&.selected:focus, &.error:focus': {
255
- borderColor: 'transparent',
256
- boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}, 0 0 0 4px ${alpha(
257
- theme.palette[color].main,
258
- theme.palette.action.hoverOpacity,
259
- )}`,
249
+ '&.selected': {
250
+ zIndex: 1,
260
251
  },
261
- '&:focus': {
262
- boxShadow: `inset 0 0 0 1px ${theme.palette.divider},0 0 0 4px ${alpha(
263
- theme.palette[color].main,
264
- theme.palette.action.hoverOpacity,
265
- )}`,
252
+ '&:focus, &.selected:focus, &.error:focus': {
253
+ zIndex: 2,
266
254
  },
267
-
268
- '&.error': {
269
- boxShadow: `inset 0 0 0 2px ${theme.palette.error.main}`,
255
+ '&.disabled': {
256
+ background: theme.palette.action.disabledBackground,
257
+ opacity: theme.palette.action.disabledOpacity,
258
+ color: theme.palette.action.disabled,
270
259
  },
271
- },
272
- '&.selected': {
273
- zIndex: 1,
274
- },
275
- '&:focus, &.selected:focus, &.error:focus': {
276
- zIndex: 2,
277
- },
278
- '&.disabled': {
279
- background: theme.palette.action.disabledBackground,
280
- opacity: theme.palette.action.disabledOpacity,
281
- color: theme.palette.action.disabled,
282
- },
283
- }),
284
- ...(Array.isArray(sx) ? sx : [sx]),
285
- ]}
260
+ }),
261
+ ...(Array.isArray(sx) ? sx : [sx]),
262
+ ],
263
+ slotProps.root?.sx,
264
+ )}
265
+ {...slotProps.root}
266
+ {...other}
286
267
  >
287
268
  <Box
288
269
  className={classes.rootInner}
289
- sx={{
290
- display: 'flex',
291
- flexDirection: 'row',
292
- width: '100%',
293
- justifyContent: 'space-between',
294
- alignContent: 'stretch',
295
- alignItems: 'center',
296
- }}
270
+ sx={combineSx(
271
+ {
272
+ display: 'flex',
273
+ flexDirection: 'row',
274
+ width: '100%',
275
+ justifyContent: 'space-between',
276
+ alignContent: 'stretch',
277
+ alignItems: 'center',
278
+ },
279
+ slotProps.rootInner?.sx,
280
+ )}
281
+ {...slotProps.rootInner}
297
282
  >
298
283
  <Box
299
284
  sx={{
@@ -306,12 +291,15 @@ export function ActionCard(props: ActionCardProps) {
306
291
  {image && (
307
292
  <Box
308
293
  className={classes.image}
309
- sx={{ display: 'flex', pr: '15px', alignSelf: 'center' }}
294
+ sx={combineSx(
295
+ { display: 'flex', pr: '15px', alignSelf: 'center' },
296
+ slotProps.image?.sx,
297
+ )}
298
+ {...slotProps.image}
310
299
  >
311
300
  {image}
312
301
  </Box>
313
302
  )}
314
-
315
303
  <Box
316
304
  sx={{
317
305
  display: 'flex',
@@ -322,62 +310,90 @@ export function ActionCard(props: ActionCardProps) {
322
310
  {title && (
323
311
  <Box
324
312
  className={classes.title}
325
- sx={{
326
- '&.sizeSmall': { typography: 'body1' },
327
- '&.sizeMedium': { typography: 'body1' },
328
- '&.sizeLarge': { typography: 'h6' },
329
- '&.sizeResponsive': { typography: { xs: 'body1', md: 'body1', lg: 'body1' } },
330
- }}
313
+ sx={combineSx(
314
+ {
315
+ '&.sizeSmall': { typography: 'body1' },
316
+ '&.sizeMedium': { typography: 'body1' },
317
+ '&.sizeLarge': { typography: 'h6' },
318
+ '&.sizeResponsive': { typography: { xs: 'body1', md: 'body1', lg: 'body1' } },
319
+ },
320
+ slotProps.title?.sx,
321
+ )}
322
+ {...slotProps.title}
331
323
  >
332
324
  {title}
333
325
  </Box>
334
326
  )}
335
-
336
327
  {details && (
337
- <Box className={classes.details} sx={{ color: 'text.secondary' }}>
328
+ <Box
329
+ className={classes.details}
330
+ sx={combineSx({ color: 'text.secondary' }, slotProps.details?.sx)}
331
+ {...slotProps.details}
332
+ >
338
333
  {details}
339
334
  </Box>
340
335
  )}
341
-
342
- {secondaryAction && <Box className={classes.secondaryAction}>{secondaryAction}</Box>}
336
+ {secondaryAction && (
337
+ <Box
338
+ className={classes.secondaryAction}
339
+ sx={combineSx({}, slotProps.secondaryAction?.sx)}
340
+ {...slotProps.secondaryAction}
341
+ >
342
+ {secondaryAction}
343
+ </Box>
344
+ )}
343
345
  </Box>
344
346
  </Box>
345
-
346
347
  <Box
347
348
  className={classes.end}
348
- sx={{
349
- display: 'flex',
350
- flexDirection: 'column',
351
- justifyContent: 'space-between',
352
- alignItems: 'flex-end',
353
- }}
349
+ sx={combineSx(
350
+ {
351
+ display: 'flex',
352
+ flexDirection: 'column',
353
+ justifyContent: 'space-between',
354
+ alignItems: 'flex-end',
355
+ },
356
+ slotProps.end?.sx,
357
+ )}
358
+ {...slotProps.end}
354
359
  >
355
360
  {action && (
356
361
  <Box
357
362
  className={classes.action}
358
- sx={(theme) => ({ marginBottom: '5px', color: theme.palette[color].main })}
363
+ sx={combineSx(
364
+ (theme) => ({ marginBottom: '5px', color: theme.palette[color].main }),
365
+ slotProps.action?.sx,
366
+ )}
367
+ {...slotProps.action}
359
368
  >
360
369
  {!selected ? action : reset}
361
370
  </Box>
362
371
  )}
363
-
364
372
  {price && !disabled && (
365
373
  <Box
366
374
  className={classes.price}
367
- sx={{
368
- textAlign: 'right',
369
- typography: 'body1',
370
- '&.sizeMedium': { typography: 'subtitle1' },
371
- '&.sizeLarge': { typography: 'h6' },
372
- '&.sizeResponsive': { typography: { xs: 'body1', md: 'subtitle1', lg: 'h6' } },
373
- }}
375
+ sx={combineSx(
376
+ {
377
+ textAlign: 'right',
378
+ typography: 'body1',
379
+ '&.sizeMedium': { typography: 'subtitle1' },
380
+ '&.sizeLarge': { typography: 'h6' },
381
+ '&.sizeResponsive': { typography: { xs: 'body1', md: 'subtitle1', lg: 'h6' } },
382
+ },
383
+ slotProps.price?.sx,
384
+ )}
385
+ {...slotProps.price}
374
386
  >
375
387
  {price}
376
388
  </Box>
377
389
  )}
378
390
  </Box>
379
391
  </Box>
380
- {after && <Box className={classes.after}>{after}</Box>}
392
+ {after && (
393
+ <Box className={classes.after} sx={combineSx({}, slotProps.after?.sx)} {...slotProps.after}>
394
+ {after}
395
+ </Box>
396
+ )}
381
397
  </ButtonOrBox>
382
398
  )
383
399
  }
@@ -1,5 +1,7 @@
1
- import { Accordion, AccordionSummary, AccordionDetails, SxProps, Theme } from '@mui/material'
2
- import { useState, ReactNode } from 'react'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Accordion, AccordionDetails, AccordionSummary } from '@mui/material'
3
+ import type { ReactNode } from 'react'
4
+ import { useState } from 'react'
3
5
  import { IconSvg } from '../IconSvg'
4
6
  import { iconChevronDown } from '../icons'
5
7
 
@@ -1,7 +1,8 @@
1
- import { Box, BoxProps } from '@mui/material'
1
+ import type { BoxProps } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../Styles'
4
- import { ActionCardProps } from './ActionCard'
5
+ import type { ActionCardProps } from './ActionCard'
5
6
 
6
7
  export type ActionCardLayoutProps = {
7
8
  children?: React.ReactNode
@@ -1,12 +1,13 @@
1
1
  import { Trans } from '@lingui/react'
2
- import { Alert, SxProps, Theme } from '@mui/material'
2
+ import type { SxProps, Theme } from '@mui/material'
3
+ import { Alert } from '@mui/material'
3
4
  import React from 'react'
4
5
  import { isFragment } from 'react-is'
5
6
  import { Button } from '../Button'
6
7
  import { IconSvg } from '../IconSvg'
7
8
  import { extendableComponent } from '../Styles'
8
9
  import { iconChevronDown } from '../icons'
9
- import { ActionCardProps } from './ActionCard'
10
+ import type { ActionCardProps } from './ActionCard'
10
11
  import { ActionCardLayout } from './ActionCardLayout'
11
12
 
12
13
  type MultiSelect = {
@@ -49,7 +50,7 @@ function isValueSelected(
49
50
  return value === candidate
50
51
  }
51
52
 
52
- type HoistedActionCardProps = Pick<ActionCardProps, 'color' | 'variant' | 'size' | 'layout'>
53
+ export type HoistedActionCardProps = Pick<ActionCardProps, 'color' | 'variant' | 'size' | 'layout'>
53
54
 
54
55
  const parts = ['root'] as const
55
56
  const name = 'ActionCardList'
@@ -100,7 +101,7 @@ export const ActionCardList = React.forwardRef<HTMLDivElement, ActionCardListPro
100
101
  }
101
102
 
102
103
  type ActionCardLike = React.ReactElement<
103
- Pick<ActionCardProps, 'value' | 'selected' | 'disabled' | 'onClick' | 'error' | 'onClick'> &
104
+ Pick<ActionCardProps, 'value' | 'selected' | 'disabled' | 'onClick' | 'error'> &
104
105
  HoistedActionCardProps
105
106
  >
106
107
 
@@ -108,7 +109,7 @@ export const ActionCardList = React.forwardRef<HTMLDivElement, ActionCardListPro
108
109
  const hasValue = (el as ActionCardLike).props.value
109
110
 
110
111
  if (process.env.NODE_ENV !== 'production') {
111
- if (hasValue === undefined) console.error(el, `must be an instance of ActionCard`)
112
+ if (hasValue === undefined) console.error(el, 'must be an instance of ActionCard')
112
113
  }
113
114
  return (el as ActionCardLike).props.value !== undefined
114
115
  }
@@ -1,6 +1,7 @@
1
- import { Avatar, Box, Chip, SxProps, Theme } from '@mui/material'
2
- import { responsiveVal } from '../../Styles/responsiveVal'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Avatar, Box, Chip } from '@mui/material'
3
3
  import { DateFormat } from '../../Intl/DateTimeFormat'
4
+ import { responsiveVal } from '../../Styles/responsiveVal'
4
5
 
5
6
  export type BlogAuthorProps = {
6
7
  author: string
@@ -18,7 +19,7 @@ export function BlogAuthor(props: BlogAuthorProps) {
18
19
  {
19
20
  display: 'flex',
20
21
  justifyContent: 'left',
21
- margin: `0 auto`,
22
+ margin: '0 auto',
22
23
  marginBottom: (theme) => theme.spacings.md,
23
24
  },
24
25
  ...(Array.isArray(sx) ? sx : [sx]),
@@ -46,7 +47,7 @@ export function BlogAuthor(props: BlogAuthorProps) {
46
47
  {author}
47
48
  </Box>
48
49
  <Box sx={(theme) => ({ lineHeight: 1.4, color: theme.palette.text.disabled })}>
49
- <DateFormat dateStyle='long'>{date}</DateFormat>
50
+ <DateFormat dateStyle='long' date={date} />
50
51
  </Box>
51
52
  </section>
52
53
  }
@@ -1,6 +1,7 @@
1
- import { Box, SxProps, Theme } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
 
3
- type BlogContentProps = {
4
+ export type BlogContentProps = {
4
5
  children: React.ReactNode
5
6
  sx?: SxProps<Theme>
6
7
  }
@@ -1,4 +1,5 @@
1
- import { Box, SxProps, Theme } from '@mui/material'
1
+ import type { SxProps, Theme } from '@mui/material'
2
+ import { Box } from '@mui/material'
2
3
  import React from 'react'
3
4
  import { extendableComponent } from '../../Styles'
4
5
  import { breakpointVal } from '../../Styles/breakpointVal'
@@ -8,7 +9,7 @@ export type BlogHeaderProps = {
8
9
  asset?: React.ReactNode
9
10
  }
10
11
 
11
- const name = 'BlogHeader' as const
12
+ const name = 'BlogHeader'
12
13
  const parts = ['header', 'asset'] as const
13
14
  const { classes } = extendableComponent(name, parts)
14
15
 
@@ -21,7 +22,7 @@ export function BlogHeader(props: BlogHeaderProps) {
21
22
  maxWidth='md'
22
23
  sx={[
23
24
  (theme) => ({
24
- margin: `0 auto`,
25
+ margin: '0 auto',
25
26
  marginBottom: theme.spacings.md,
26
27
  '& img': {
27
28
  objectFit: 'cover',