@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.
- package/ActionCard/ActionCard.tsx +219 -203
- package/ActionCard/ActionCardAccordion.tsx +4 -2
- package/ActionCard/ActionCardLayout.tsx +3 -2
- package/ActionCard/ActionCardList.tsx +6 -5
- package/Blog/BlogAuthor/BlogAuthor.tsx +5 -4
- package/Blog/BlogContent/BlogContent.tsx +3 -2
- package/Blog/BlogHeader/BlogHeader.tsx +4 -3
- package/Blog/BlogList/BlogList.tsx +3 -3
- package/Blog/BlogListItem/BlogListItem.tsx +6 -5
- package/Blog/BlogTags/BlogTag.tsx +3 -2
- package/Blog/BlogTags/BlogTags.tsx +1 -1
- package/Breadcrumbs/Breadcrumbs.tsx +25 -19
- package/Breadcrumbs/BreadcrumbsList.tsx +3 -2
- package/Breadcrumbs/jsonLdBreadcrumb.tsx +1 -1
- package/Breadcrumbs/types.ts +1 -2
- package/Button/Button.tsx +2 -1
- package/Button/LinkOrButton.tsx +4 -2
- package/CHANGELOG.md +294 -1344
- package/ChipMenu/ChipMenu.tsx +3 -2
- package/Config.graphqls +28 -10
- package/Container/Container.tsx +90 -0
- package/ContainerWithHeader/ContainerWithHeader.tsx +2 -1
- package/Document/DocumentBodyEnd.tsx +1 -1
- package/Document/DocumentBodyStart.tsx +1 -1
- package/Document/DocumentHeadEnd.tsx +1 -1
- package/Document/DocumentHeadStart.tsx +1 -1
- package/Fab/Fab.tsx +15 -17
- package/FlagAvatar/FlagAvatar.tsx +2 -1
- package/Footer/Footer.tsx +14 -10
- package/Form/Form.tsx +2 -1
- package/Form/FormHeader.tsx +1 -1
- package/Form/FormRow.tsx +1 -1
- package/Form/InputCheckmark.tsx +2 -1
- package/FramerScroller/ItemScroller.tsx +5 -8
- package/FramerScroller/SidebarGallery.tsx +23 -30
- package/FramerScroller/SidebarSlider.tsx +8 -7
- package/FullPageMessage/FullPageMessage.tsx +2 -1
- package/IconHeader/IconHeader.tsx +5 -3
- package/IconSvg/IconSvg.tsx +8 -7
- package/Intl/DateTimeFormat/DateFormat.tsx +6 -4
- package/Intl/DateTimeFormat/DateTimeFormat.tsx +10 -14
- package/Intl/DateTimeFormat/TimeFormat.tsx +6 -4
- package/Intl/DateTimeFormat/index.ts +1 -0
- package/Intl/DateTimeFormat/useIntlDateTimeFormat.ts +13 -0
- package/Intl/DisplayNames/DisplayNames.tsx +5 -13
- package/Intl/DisplayNames/index.ts +1 -0
- package/Intl/DisplayNames/useIntlDisplayNames.ts +12 -0
- package/Intl/{ListFormat.tsx → ListFormat/ListFormat.tsx} +8 -13
- package/Intl/ListFormat/index.ts +2 -0
- package/Intl/ListFormat/useIntlListFormat.ts +15 -0
- package/Intl/NumberFormat/CurrencyFormat.tsx +4 -2
- package/Intl/NumberFormat/NumberFormat.tsx +15 -17
- package/Intl/NumberFormat/PercentFormat.tsx +6 -2
- package/Intl/NumberFormat/UnitFormat.tsx +5 -5
- package/Intl/NumberFormat/index.ts +1 -0
- package/Intl/NumberFormat/useIntlNumberFormat.ts +17 -0
- package/Intl/RelativeTimeFormat/RelativeTimeFormat.tsx +6 -13
- package/Intl/RelativeTimeFormat/RelativeToTimeFormat.tsx +4 -2
- package/Intl/RelativeTimeFormat/index.ts +1 -0
- package/Intl/RelativeTimeFormat/useIntlRelativeTimeFormat.ts +15 -0
- package/Intl/useIntlLocalesArgument.ts +16 -0
- package/Layout/components/LayoutHeader.tsx +7 -4
- package/Layout/components/LayoutHeaderBack.tsx +6 -4
- package/Layout/components/LayoutHeaderClose.tsx +1 -1
- package/Layout/components/LayoutHeaderContent.tsx +11 -12
- package/Layout/components/LayoutProvider.tsx +1 -1
- package/Layout/components/LayoutTitle.tsx +5 -3
- package/Layout/context/layoutContext.tsx +1 -1
- package/Layout/types.ts +1 -1
- package/LayoutDefault/components/LayoutDefault.tsx +12 -10
- package/LayoutOverlay/components/LayoutOverlay.tsx +3 -2
- package/LayoutOverlay/components/LayoutOverlayHeader.tsx +2 -1
- package/LayoutOverlay/test/LayoutOverlayDemo.tsx +4 -1
- package/LayoutParts/DesktopHeaderBadge.tsx +2 -1
- package/LayoutParts/DesktopNavBar.tsx +26 -22
- package/LayoutParts/DesktopNavBarItem.tsx +11 -7
- package/LayoutParts/Logo.tsx +5 -5
- package/LayoutParts/MenuFab.tsx +7 -13
- package/LayoutParts/MenuFabItem.tsx +6 -1
- package/LayoutParts/MenuFabSecondaryItem.tsx +11 -7
- package/LayoutParts/MobileTopRight.tsx +24 -0
- package/LayoutParts/PlaceholderFab.tsx +2 -1
- package/LayoutParts/StickyBelowHeader.tsx +2 -1
- package/LayoutParts/index.ts +1 -0
- package/LazyHydrate/LazyHydrate.tsx +18 -21
- package/MediaQuery/MediaQuery.tsx +111 -0
- package/MediaQuery/index.ts +1 -0
- package/Navigation/components/NavigationFab.tsx +3 -2
- package/Navigation/components/NavigationItem.tsx +3 -3
- package/Navigation/components/NavigationList.tsx +4 -3
- package/Navigation/components/NavigationOverlay.tsx +18 -11
- package/Navigation/components/NavigationProvider.tsx +9 -8
- package/Navigation/components/NavigationTitle.tsx +5 -5
- package/Navigation/hooks/useNavigation.ts +4 -2
- package/Overlay/components/Overlay.tsx +3 -2
- package/Overlay/components/OverlayBase.tsx +71 -30
- package/Overlay/components/OverlayContainer.tsx +2 -2
- package/Overlay/components/OverlayHeader.tsx +7 -4
- package/Overlay/components/OverlaySsr.tsx +2 -1
- package/Overlay/components/OverlayStickyBottom.tsx +2 -1
- package/Overlay/utils/variantsToScrollSnapType.ts +2 -2
- package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +5 -12
- package/OverlayOrPopperChip/OverlayOrPopperPanel.tsx +3 -3
- package/OverlayOrPopperChip/OverlayPanel.tsx +13 -7
- package/OverlayOrPopperChip/OverlayPanelActions.tsx +2 -2
- package/OverlayOrPopperChip/PopperPanel.tsx +3 -2
- package/OverlayOrPopperChip/PopperPanelActions.tsx +2 -2
- package/OverlayOrPopperChip/types.ts +2 -2
- package/OverlayOrPopperChip/useHandleClickNotDrag.ts +3 -1
- package/Page/CssAndFramerMotionProvider.tsx +2 -1
- package/Page/types.ts +5 -5
- package/PageLoadIndicator/PageLoadIndicator.tsx +3 -2
- package/PageMeta/PageMeta.tsx +3 -2
- package/PageMeta/canonicalize.ts +7 -3
- package/Pagination/Pagination.tsx +4 -2
- package/Pagination/PaginationExtended.tsx +2 -9
- package/RenderType/RenderType.tsx +6 -0
- package/Row/ButtonLinkList/ButtonLinkList.tsx +4 -7
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +2 -1
- package/Row/ColumnOne/variant/VariantMessage.tsx +2 -4
- package/Row/ColumnOneBoxed/ColumnOneBoxed.tsx +4 -2
- package/Row/ColumnOneCentered/ColumnOneCentered.tsx +4 -2
- package/Row/ColumnThree/ColumnThree.tsx +6 -5
- package/Row/ColumnTwo/ColumnTwo.tsx +8 -7
- package/Row/ColumnTwoSpread/ColumnTwoSpread.tsx +7 -5
- package/Row/ColumnTwoWithTop/ColumnTwoWithTop.tsx +5 -4
- package/Row/ContentLinks/ContentLinks.tsx +4 -3
- package/Row/HeroBanner/HeroBanner.tsx +3 -2
- package/Row/IconBlocks/IconBlock.tsx +3 -2
- package/Row/IconBlocks/IconBlocks.tsx +3 -2
- package/Row/ImageText/ImageText.tsx +3 -2
- package/Row/ImageTextBoxed/ImageTextBoxed.tsx +4 -3
- package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +3 -2
- package/Row/Quote/Quote.tsx +1 -1
- package/Row/Row.tsx +2 -1
- package/Row/RowLinks/RowLinks.tsx +36 -34
- package/Row/RowLinks/variant/VariantImageLabelSwiper.tsx +6 -2
- package/Row/RowLinks/variant/VariantInline.tsx +6 -2
- package/Row/RowLinks/variant/VariantLogoSwiper.tsx +2 -1
- package/Row/RowLinks/variant/VariantUsps.tsx +2 -1
- package/Row/SpecialBanner/SpecialBanner.tsx +3 -2
- package/SectionContainer/SectionContainer.tsx +3 -2
- package/SectionHeader/SectionHeader.tsx +2 -1
- package/Separator/Separator.tsx +3 -2
- package/Snackbar/DismissibleSnackbar.tsx +1 -1
- package/Snackbar/ErrorSnackbar.tsx +1 -1
- package/Snackbar/MessageSnackbarImpl.tsx +7 -16
- package/StarRatingField/StarRatingField.tsx +3 -2
- package/Stepper/Stepper.tsx +3 -2
- package/Styles/__tests__/spreadVal.test.ts +4 -4
- package/Styles/extendableComponent.ts +4 -3
- package/Styles/withEmotionCache.tsx +2 -2
- package/Styles/withTheme.tsx +4 -1
- package/TextInputNumber/TextInputNumber.tsx +5 -8
- package/Theme/DarkLightModeThemeProvider.tsx +10 -7
- package/Theme/MuiButton.ts +2 -1
- package/Theme/MuiChip.ts +2 -1
- package/Theme/MuiFab.ts +2 -1
- package/Theme/MuiSlider.ts +3 -3
- package/Theme/MuiSnackbar.ts +1 -1
- package/Theme/NextLink.tsx +35 -15
- package/Theme/createTheme.ts +6 -0
- package/Theme/index.ts +1 -0
- package/Theme/themeDefaults.ts +10 -10
- package/Theme/useContainerSizing.ts +20 -0
- package/TimeAgo/TimeAgo.tsx +3 -3
- package/ToggleButton/ToggleButton.tsx +6 -4
- package/ToggleButtonGroup/ToggleButtonGroup.tsx +99 -94
- package/UspList/UspList.tsx +3 -2
- package/UspList/UspListItem.tsx +3 -2
- package/hooks/memoDeep.ts +3 -2
- package/hooks/useDateTimeFormat.ts +3 -1
- package/hooks/useMatchMedia.ts +2 -1
- package/hooks/useMemoDeep.ts +2 -1
- package/hooks/useNumberFormat.ts +3 -1
- package/index.ts +3 -1
- package/package.json +17 -18
- package/utils/cookie.ts +4 -3
- package/utils/robots.ts +1 -1
- package/utils/sitemap.ts +3 -2
- package/utils/sxx.ts +16 -0
- package/AnimatedRow/AnimatedRow.tsx +0 -23
- package/docs/building-components.mdx +0 -3
- package/docs/components/ComponentBasic.tsx +0 -26
- package/docs/components/ComponentChild.tsx +0 -49
- package/docs/components/ComponentChildVariant.tsx +0 -55
- package/docs/components/ComponentChildVariantExtendable.tsx +0 -63
- package/docs/components/ComponentStylable.tsx +0 -32
- package/docs/pages/building-components.tsx +0 -62
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
-
|
|
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?:
|
|
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
|
-
|
|
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
|
|
141
|
+
onClick={onClick ? (event) => onClick(event, value) : undefined}
|
|
125
142
|
disabled={disabled}
|
|
126
|
-
sx={
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
'&.
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
158
|
+
'&.sizeMedium': {
|
|
159
|
+
px: responsiveVal(10, 14),
|
|
160
|
+
py: responsiveVal(10, 12),
|
|
161
|
+
typography: 'body2',
|
|
162
|
+
display: 'block',
|
|
180
163
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
-
'&.
|
|
219
|
-
|
|
220
|
-
'
|
|
221
|
-
|
|
222
|
-
'
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
'
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
|
|
251
|
-
|
|
252
|
-
|
|
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
|
|
255
|
-
|
|
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
|
-
|
|
263
|
-
theme.palette[color].main,
|
|
264
|
-
theme.palette.action.hoverOpacity,
|
|
265
|
-
)}`,
|
|
252
|
+
'&:focus, &.selected:focus, &.error:focus': {
|
|
253
|
+
zIndex: 2,
|
|
266
254
|
},
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
255
|
+
'&.disabled': {
|
|
256
|
+
background: theme.palette.action.disabledBackground,
|
|
257
|
+
opacity: theme.palette.action.disabledOpacity,
|
|
258
|
+
color: theme.palette.action.disabled,
|
|
270
259
|
},
|
|
271
|
-
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
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={
|
|
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
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
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={(
|
|
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
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
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 &&
|
|
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 {
|
|
2
|
-
import {
|
|
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 {
|
|
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 {
|
|
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'
|
|
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,
|
|
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 {
|
|
2
|
-
import {
|
|
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:
|
|
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'
|
|
50
|
+
<DateFormat dateStyle='long' date={date} />
|
|
50
51
|
</Box>
|
|
51
52
|
</section>
|
|
52
53
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
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'
|
|
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:
|
|
25
|
+
margin: '0 auto',
|
|
25
26
|
marginBottom: theme.spacings.md,
|
|
26
27
|
'& img': {
|
|
27
28
|
objectFit: 'cover',
|