@graphcommerce/next-ui 9.0.4-canary.9 → 9.0.4
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 +126 -119
- package/ActionCard/ActionCardAccordion.tsx +4 -5
- package/ActionCard/ActionCardList.tsx +1 -1
- package/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/Breadcrumbs/BreadcrumbsList.tsx +1 -1
- package/CHANGELOG.md +9 -23
- package/ChipMenu/ChipMenu.tsx +1 -1
- package/Container/Container.tsx +2 -5
- package/Form/FormHeader.tsx +1 -1
- package/Form/InputCheckmark.tsx +1 -1
- package/FramerScroller/ItemScroller.tsx +1 -1
- package/Intl/RelativeTimeFormat/RelativeTimeFormat.tsx +3 -1
- package/Intl/RelativeTimeFormat/RelativeToTimeFormat.tsx +5 -3
- package/Intl/useIntlLocalesArgument.ts +3 -1
- package/Layout/components/LayoutHeaderBack.tsx +4 -2
- package/Layout/components/LayoutHeaderClose.tsx +1 -1
- package/Layout/components/LayoutHeaderContent.tsx +2 -4
- package/LayoutDefault/components/LayoutDefault.tsx +1 -2
- package/LayoutParts/DesktopNavBar.tsx +1 -1
- package/MediaQuery/MediaQuery.tsx +3 -5
- package/Navigation/components/NavigationFab.tsx +1 -1
- package/Navigation/components/NavigationItem.tsx +3 -3
- package/Navigation/components/NavigationOverlay.tsx +2 -2
- package/Navigation/components/NavigationProvider.tsx +3 -1
- package/OverlayOrPopperChip/OverlayOrPopperChip.tsx +2 -2
- package/OverlayOrPopperChip/OverlayPanelActions.tsx +1 -1
- package/OverlayOrPopperChip/PopperPanelActions.tsx +1 -1
- package/Page/types.ts +1 -1
- package/Pagination/Pagination.tsx +1 -1
- package/Pagination/PaginationExtended.tsx +1 -1
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +1 -1
- package/Row/RowLinks/RowLinks.tsx +1 -0
- package/Snackbar/MessageSnackbarImpl.tsx +6 -4
- package/StarRatingField/StarRatingField.tsx +1 -1
- package/Styles/createEmotionCache.ts +1 -3
- package/Styles/withEmotionCache.tsx +1 -1
- package/TextInputNumber/TextInputNumber.tsx +4 -2
- package/Theme/NextLink.tsx +5 -5
- package/Theme/createTheme.ts +1 -1
- package/Theme/themeDefaults.ts +0 -10
- package/ToggleButton/ToggleButton.tsx +1 -1
- package/hooks/memoDeep.ts +1 -2
- package/hooks/useIsSsr.ts +3 -1
- package/package.json +8 -8
- package/utils/cssFlags.tsx +2 -2
- package/utils/normalizeLocale.ts +7 -6
- package/utils/robots.ts +2 -2
- package/utils/sxx.ts +2 -4
@@ -3,7 +3,6 @@ import { alpha, Box, ButtonBase, lighten } from '@mui/material'
|
|
3
3
|
import React from 'react'
|
4
4
|
import { extendableComponent, responsiveVal } from '../Styles'
|
5
5
|
import { breakpointVal } from '../Styles/breakpointVal'
|
6
|
-
import { sxx } from '../utils/sxx'
|
7
6
|
|
8
7
|
type Variants = 'outlined' | 'default'
|
9
8
|
type Size = 'large' | 'medium' | 'small' | 'responsive'
|
@@ -95,6 +94,11 @@ export const actionCardImageSizes = {
|
|
95
94
|
responsive: responsiveVal(60, 120),
|
96
95
|
}
|
97
96
|
|
97
|
+
const combineSx = (defaultSx: SxProps<Theme>, slotSx?: SxProps<Theme>) => [
|
98
|
+
...(Array.isArray(defaultSx) ? defaultSx : [defaultSx]),
|
99
|
+
...(Array.isArray(slotSx) ? slotSx : [slotSx]),
|
100
|
+
]
|
101
|
+
|
98
102
|
/** @public */
|
99
103
|
export function ActionCard<C extends React.ElementType = typeof Box>(props: ActionCardProps<C>) {
|
100
104
|
const {
|
@@ -117,7 +121,6 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
117
121
|
layout = 'list',
|
118
122
|
error = false,
|
119
123
|
slotProps = {},
|
120
|
-
...other
|
121
124
|
} = props
|
122
125
|
|
123
126
|
const classes = withState({
|
@@ -136,132 +139,133 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
136
139
|
className={classes.root}
|
137
140
|
onClick={onClick ? (event) => onClick(event, value) : undefined}
|
138
141
|
disabled={disabled}
|
139
|
-
sx={
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
'&.sizeMedium': {
|
154
|
-
px: responsiveVal(10, 14),
|
155
|
-
py: responsiveVal(10, 12),
|
156
|
-
typography: 'body2',
|
157
|
-
display: 'block',
|
158
|
-
},
|
159
|
-
'&.sizeLarge': {
|
160
|
-
px: responsiveVal(12, 16),
|
161
|
-
py: responsiveVal(12, 14),
|
162
|
-
display: 'block',
|
163
|
-
},
|
164
|
-
'&.sizeResponsive': {
|
165
|
-
px: responsiveVal(8, 16),
|
166
|
-
py: responsiveVal(4, 14),
|
167
|
-
display: { xs: 'flex', md: 'block', lg: 'block' },
|
168
|
-
[theme.breakpoints.down('md')]: { typography: 'body2' },
|
169
|
-
},
|
170
|
-
'&.variantDefault': {
|
171
|
-
position: 'relative',
|
172
|
-
'&.selected': {
|
173
|
-
backgroundColor:
|
174
|
-
theme.palette.mode === 'light'
|
175
|
-
? alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
176
|
-
: lighten(theme.palette.background.default, theme.palette.action.hoverOpacity),
|
142
|
+
sx={combineSx(
|
143
|
+
[
|
144
|
+
(theme) => ({
|
145
|
+
...breakpointVal(
|
146
|
+
'borderRadius',
|
147
|
+
theme.shape.borderRadius * 1.5,
|
148
|
+
theme.shape.borderRadius * 3,
|
149
|
+
theme.breakpoints.values,
|
150
|
+
),
|
151
|
+
'&.sizeSmall': {
|
152
|
+
px: responsiveVal(8, 12),
|
153
|
+
py: responsiveVal(4, 6),
|
154
|
+
display: 'flex',
|
155
|
+
typography: 'body2',
|
177
156
|
},
|
178
|
-
'&.
|
179
|
-
|
157
|
+
'&.sizeMedium': {
|
158
|
+
px: responsiveVal(10, 14),
|
159
|
+
py: responsiveVal(10, 12),
|
160
|
+
typography: 'body2',
|
161
|
+
display: 'block',
|
180
162
|
},
|
181
|
-
'
|
182
|
-
|
183
|
-
|
163
|
+
'&.sizeLarge': {
|
164
|
+
px: responsiveVal(12, 16),
|
165
|
+
py: responsiveVal(12, 14),
|
166
|
+
display: 'block',
|
184
167
|
},
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
marginBottom: '-2px',
|
168
|
+
'&.sizeResponsive': {
|
169
|
+
px: responsiveVal(8, 16),
|
170
|
+
py: responsiveVal(4, 14),
|
171
|
+
display: { xs: 'flex', md: 'block', lg: 'block' },
|
172
|
+
[theme.breakpoints.down('md')]: { typography: 'body2' },
|
191
173
|
},
|
192
|
-
'&.
|
193
|
-
|
194
|
-
'
|
195
|
-
|
196
|
-
'
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
'borderTopRightRadius',
|
203
|
-
theme.shape.borderRadius * 3,
|
204
|
-
theme.shape.borderRadius * 4,
|
205
|
-
theme.breakpoints.values,
|
206
|
-
),
|
174
|
+
'&.variantDefault': {
|
175
|
+
position: 'relative',
|
176
|
+
'&.selected': {
|
177
|
+
backgroundColor:
|
178
|
+
theme.palette.mode === 'light'
|
179
|
+
? alpha(theme.palette[color].main, theme.palette.action.hoverOpacity)
|
180
|
+
: lighten(theme.palette.background.default, theme.palette.action.hoverOpacity),
|
181
|
+
},
|
182
|
+
'&.error': {
|
183
|
+
backgroundColor: alpha(theme.palette.error.main, theme.palette.action.hoverOpacity),
|
207
184
|
},
|
208
|
-
'&:
|
209
|
-
|
210
|
-
|
211
|
-
theme.shape.borderRadius * 3,
|
212
|
-
theme.shape.borderRadius * 4,
|
213
|
-
theme.breakpoints.values,
|
214
|
-
),
|
215
|
-
...breakpointVal(
|
216
|
-
'borderBottomRightRadius',
|
217
|
-
theme.shape.borderRadius * 3,
|
218
|
-
theme.shape.borderRadius * 4,
|
219
|
-
theme.breakpoints.values,
|
220
|
-
),
|
185
|
+
'&:focus': {
|
186
|
+
outline: 'none',
|
187
|
+
boxShadow: `0 0 0 4px ${alpha(theme.palette[color].main, theme.palette.action.focusOpacity)}`,
|
221
188
|
},
|
222
189
|
},
|
223
|
-
'&.
|
224
|
-
|
225
|
-
boxShadow: `inset 0 0 0
|
190
|
+
'&.variantOutlined': {
|
191
|
+
backgroundColor: theme.palette.background.paper,
|
192
|
+
boxShadow: `inset 0 0 0 1px ${theme.palette.divider}`,
|
193
|
+
'&:not(:last-of-type)': {
|
194
|
+
marginBottom: '-2px',
|
195
|
+
},
|
196
|
+
'&.layoutList': {
|
197
|
+
borderRadius: 0,
|
198
|
+
'&:first-of-type': {
|
199
|
+
...breakpointVal(
|
200
|
+
'borderTopLeftRadius',
|
201
|
+
theme.shape.borderRadius * 3,
|
202
|
+
theme.shape.borderRadius * 4,
|
203
|
+
theme.breakpoints.values,
|
204
|
+
),
|
205
|
+
...breakpointVal(
|
206
|
+
'borderTopRightRadius',
|
207
|
+
theme.shape.borderRadius * 3,
|
208
|
+
theme.shape.borderRadius * 4,
|
209
|
+
theme.breakpoints.values,
|
210
|
+
),
|
211
|
+
},
|
212
|
+
'&:last-of-type': {
|
213
|
+
...breakpointVal(
|
214
|
+
'borderBottomLeftRadius',
|
215
|
+
theme.shape.borderRadius * 3,
|
216
|
+
theme.shape.borderRadius * 4,
|
217
|
+
theme.breakpoints.values,
|
218
|
+
),
|
219
|
+
...breakpointVal(
|
220
|
+
'borderBottomRightRadius',
|
221
|
+
theme.shape.borderRadius * 3,
|
222
|
+
theme.shape.borderRadius * 4,
|
223
|
+
theme.breakpoints.values,
|
224
|
+
),
|
225
|
+
},
|
226
|
+
},
|
227
|
+
'&.selected': {
|
228
|
+
borderColor: 'transparent',
|
229
|
+
boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}`,
|
230
|
+
},
|
231
|
+
'&.selected:focus, &.error:focus': {
|
232
|
+
borderColor: 'transparent',
|
233
|
+
boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}, 0 0 0 4px ${alpha(
|
234
|
+
theme.palette[color].main,
|
235
|
+
theme.palette.action.hoverOpacity,
|
236
|
+
)}`,
|
237
|
+
},
|
238
|
+
'&:focus': {
|
239
|
+
boxShadow: `inset 0 0 0 1px ${theme.palette.divider},0 0 0 4px ${alpha(
|
240
|
+
theme.palette[color].main,
|
241
|
+
theme.palette.action.hoverOpacity,
|
242
|
+
)}`,
|
243
|
+
},
|
244
|
+
'&.error': {
|
245
|
+
boxShadow: `inset 0 0 0 2px ${theme.palette.error.main}`,
|
246
|
+
},
|
226
247
|
},
|
227
|
-
'&.selected
|
228
|
-
|
229
|
-
boxShadow: `inset 0 0 0 2px ${theme.palette[color].main}, 0 0 0 4px ${alpha(
|
230
|
-
theme.palette[color].main,
|
231
|
-
theme.palette.action.hoverOpacity,
|
232
|
-
)}`,
|
248
|
+
'&.selected': {
|
249
|
+
zIndex: 1,
|
233
250
|
},
|
234
|
-
'&:focus': {
|
235
|
-
|
236
|
-
theme.palette[color].main,
|
237
|
-
theme.palette.action.hoverOpacity,
|
238
|
-
)}`,
|
251
|
+
'&:focus, &.selected:focus, &.error:focus': {
|
252
|
+
zIndex: 2,
|
239
253
|
},
|
240
|
-
'&.
|
241
|
-
|
254
|
+
'&.disabled': {
|
255
|
+
background: theme.palette.action.disabledBackground,
|
256
|
+
opacity: theme.palette.action.disabledOpacity,
|
257
|
+
color: theme.palette.action.disabled,
|
242
258
|
},
|
243
|
-
},
|
244
|
-
|
245
|
-
|
246
|
-
},
|
247
|
-
'&:focus, &.selected:focus, &.error:focus': {
|
248
|
-
zIndex: 2,
|
249
|
-
},
|
250
|
-
'&.disabled': {
|
251
|
-
background: theme.palette.action.disabledBackground,
|
252
|
-
opacity: theme.palette.action.disabledOpacity,
|
253
|
-
color: theme.palette.action.disabled,
|
254
|
-
},
|
255
|
-
}),
|
256
|
-
sx,
|
259
|
+
}),
|
260
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
261
|
+
],
|
257
262
|
slotProps.root?.sx,
|
258
263
|
)}
|
259
264
|
{...slotProps.root}
|
260
|
-
{...other}
|
261
265
|
>
|
262
266
|
<Box
|
263
267
|
className={classes.rootInner}
|
264
|
-
sx={
|
268
|
+
sx={combineSx(
|
265
269
|
{
|
266
270
|
display: 'flex',
|
267
271
|
flexDirection: 'row',
|
@@ -285,7 +289,10 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
285
289
|
{image && (
|
286
290
|
<Box
|
287
291
|
className={classes.image}
|
288
|
-
sx={
|
292
|
+
sx={combineSx(
|
293
|
+
{ display: 'flex', pr: '15px', alignSelf: 'center' },
|
294
|
+
slotProps.image?.sx,
|
295
|
+
)}
|
289
296
|
{...slotProps.image}
|
290
297
|
>
|
291
298
|
{image}
|
@@ -301,7 +308,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
301
308
|
{title && (
|
302
309
|
<Box
|
303
310
|
className={classes.title}
|
304
|
-
sx={
|
311
|
+
sx={combineSx(
|
305
312
|
{
|
306
313
|
'&.sizeSmall': { typography: 'body1' },
|
307
314
|
'&.sizeMedium': { typography: 'body1' },
|
@@ -318,7 +325,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
318
325
|
{details && (
|
319
326
|
<Box
|
320
327
|
className={classes.details}
|
321
|
-
sx={
|
328
|
+
sx={combineSx({ color: 'text.secondary' }, slotProps.details?.sx)}
|
322
329
|
{...slotProps.details}
|
323
330
|
>
|
324
331
|
{details}
|
@@ -327,7 +334,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
327
334
|
{secondaryAction && (
|
328
335
|
<Box
|
329
336
|
className={classes.secondaryAction}
|
330
|
-
sx={
|
337
|
+
sx={combineSx({}, slotProps.secondaryAction?.sx)}
|
331
338
|
{...slotProps.secondaryAction}
|
332
339
|
>
|
333
340
|
{secondaryAction}
|
@@ -337,7 +344,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
337
344
|
</Box>
|
338
345
|
<Box
|
339
346
|
className={classes.end}
|
340
|
-
sx={
|
347
|
+
sx={combineSx(
|
341
348
|
{
|
342
349
|
display: 'flex',
|
343
350
|
flexDirection: 'column',
|
@@ -351,7 +358,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
351
358
|
{action && (
|
352
359
|
<Box
|
353
360
|
className={classes.action}
|
354
|
-
sx={
|
361
|
+
sx={combineSx(
|
355
362
|
(theme) => ({ marginBottom: '5px', color: theme.palette[color].main }),
|
356
363
|
slotProps.action?.sx,
|
357
364
|
)}
|
@@ -363,7 +370,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
363
370
|
{price && !disabled && (
|
364
371
|
<Box
|
365
372
|
className={classes.price}
|
366
|
-
sx={
|
373
|
+
sx={combineSx(
|
367
374
|
{
|
368
375
|
textAlign: 'right',
|
369
376
|
typography: 'body1',
|
@@ -381,7 +388,7 @@ export function ActionCard<C extends React.ElementType = typeof Box>(props: Acti
|
|
381
388
|
</Box>
|
382
389
|
</Box>
|
383
390
|
{after && (
|
384
|
-
<Box className={classes.after} sx={
|
391
|
+
<Box className={classes.after} sx={combineSx({}, slotProps.after?.sx)} {...slotProps.after}>
|
385
392
|
{after}
|
386
393
|
</Box>
|
387
394
|
)}
|
@@ -2,9 +2,8 @@ import type { SxProps, Theme } from '@mui/material'
|
|
2
2
|
import { Accordion, AccordionDetails, AccordionSummary } from '@mui/material'
|
3
3
|
import type { ReactNode } from 'react'
|
4
4
|
import { useState } from 'react'
|
5
|
-
import { iconChevronDown } from '../icons'
|
6
5
|
import { IconSvg } from '../IconSvg'
|
7
|
-
import {
|
6
|
+
import { iconChevronDown } from '../icons'
|
8
7
|
|
9
8
|
export type ActionCardAccordionProps = {
|
10
9
|
summary: ReactNode
|
@@ -26,7 +25,7 @@ export function ActionCardAccordion(props: ActionCardAccordionProps) {
|
|
26
25
|
expanded={expanded}
|
27
26
|
variant='outlined'
|
28
27
|
disableGutters
|
29
|
-
sx={
|
28
|
+
sx={[
|
30
29
|
(theme) => ({
|
31
30
|
backgroundColor: 'transparent ',
|
32
31
|
'&.Mui-expanded': { my: 0 },
|
@@ -35,8 +34,8 @@ export function ActionCardAccordion(props: ActionCardAccordionProps) {
|
|
35
34
|
borderBottom: `1px solid ${theme.palette.divider}`,
|
36
35
|
'&:not(.Mui-expanded)': { borderBottom: `1px solid ${theme.palette.divider}` },
|
37
36
|
}),
|
38
|
-
sx,
|
39
|
-
|
37
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
38
|
+
]}
|
40
39
|
>
|
41
40
|
<AccordionSummary
|
42
41
|
onClick={(e) => e.preventDefault()}
|
@@ -4,9 +4,9 @@ import { Alert } from '@mui/material'
|
|
4
4
|
import React from 'react'
|
5
5
|
import { isFragment } from 'react-is'
|
6
6
|
import { Button } from '../Button'
|
7
|
-
import { iconChevronDown } from '../icons'
|
8
7
|
import { IconSvg } from '../IconSvg'
|
9
8
|
import { extendableComponent } from '../Styles'
|
9
|
+
import { iconChevronDown } from '../icons'
|
10
10
|
import type { ActionCardProps } from './ActionCard'
|
11
11
|
import { ActionCardLayout } from './ActionCardLayout'
|
12
12
|
|
@@ -19,8 +19,8 @@ import dynamic from 'next/dynamic'
|
|
19
19
|
import type { MouseEvent } from 'react'
|
20
20
|
import { useState } from 'react'
|
21
21
|
import { Button } from '../Button'
|
22
|
-
import { iconClose, iconEllypsis } from '../icons'
|
23
22
|
import { IconSvg } from '../IconSvg'
|
23
|
+
import { iconClose, iconEllypsis } from '../icons'
|
24
24
|
import type { BreadcrumbsType } from './types'
|
25
25
|
|
26
26
|
const BreadcrumbsPopper = dynamic(
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Trans } from '@lingui/react'
|
2
|
-
import {
|
2
|
+
import { Box, Link, alpha, useTheme } from '@mui/material'
|
3
3
|
import type { KeyboardEvent } from 'react'
|
4
4
|
import { useEffect, useRef } from 'react'
|
5
5
|
import type { BreadcrumbsType } from './types'
|
package/CHANGELOG.md
CHANGED
@@ -1,40 +1,26 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## 9.0.4
|
4
|
-
|
5
|
-
## 9.0.4-canary.8
|
6
|
-
|
7
|
-
## 9.0.4-canary.7
|
8
|
-
|
9
|
-
## 9.0.4-canary.6
|
3
|
+
## 9.0.4
|
10
4
|
|
11
5
|
### Patch Changes
|
12
6
|
|
13
|
-
- [#
|
7
|
+
- [#2503](https://github.com/graphcommerce-org/graphcommerce/pull/2503) [`cf9a54e`](https://github.com/graphcommerce-org/graphcommerce/commit/cf9a54e300378a0ca77aa7e39e4a95788359028d) - Solve issue where ActionCard would crash the whole app because it forwarded components to string attributes ([@paales](https://github.com/paales))
|
14
8
|
|
15
|
-
## 9.0.
|
9
|
+
## 9.0.3
|
16
10
|
|
17
|
-
## 9.0.
|
11
|
+
## 9.0.3-canary.0
|
18
12
|
|
19
|
-
## 9.0.
|
20
|
-
|
21
|
-
## 9.0.4-canary.2
|
22
|
-
|
23
|
-
### Patch Changes
|
13
|
+
## 9.0.2
|
24
14
|
|
25
|
-
|
15
|
+
## 9.0.2-canary.0
|
26
16
|
|
27
|
-
|
28
|
-
|
29
|
-
## 9.0.4-canary.1
|
17
|
+
## 9.0.1
|
30
18
|
|
31
19
|
### Patch Changes
|
32
20
|
|
33
|
-
- [#
|
34
|
-
|
35
|
-
## 9.0.4-canary.0
|
21
|
+
- [#2463](https://github.com/graphcommerce-org/graphcommerce/pull/2463) [`db3e142`](https://github.com/graphcommerce-org/graphcommerce/commit/db3e142d6f8b09a0f6b67a06e664b23946a71173) - Fix issue where layout title would be left aligned ([@FrankHarland](https://github.com/FrankHarland))
|
36
22
|
|
37
|
-
## 9.0.1
|
23
|
+
## 9.0.1-canary.1
|
38
24
|
|
39
25
|
### Patch Changes
|
40
26
|
|
package/ChipMenu/ChipMenu.tsx
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { ChipProps, MenuProps, SxProps, Theme } from '@mui/material'
|
2
2
|
import { Chip, Menu, menuClasses } from '@mui/material'
|
3
3
|
import React, { useState } from 'react'
|
4
|
-
import { iconCancelAlt, iconChevronDown, iconChevronUp } from '../icons'
|
5
4
|
import { IconSvg } from '../IconSvg'
|
6
5
|
import { SectionHeader } from '../SectionHeader/SectionHeader'
|
7
6
|
import { responsiveVal } from '../Styles/responsiveVal'
|
7
|
+
import { iconCancelAlt, iconChevronDown, iconChevronUp } from '../icons'
|
8
8
|
|
9
9
|
export type ChipMenuProps = Omit<ChipProps<'button'>, 'children' | 'component'> & {
|
10
10
|
selectedLabel?: React.ReactNode
|
package/Container/Container.tsx
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Box, useTheme } from '@mui/material'
|
2
2
|
import type { ContainerProps } from '@mui/material'
|
3
|
+
import clsx from 'clsx'
|
3
4
|
import React from 'react'
|
4
5
|
import type { LiteralUnion } from 'type-fest'
|
5
6
|
import { extendableComponent } from '../Styles/extendableComponent'
|
@@ -73,17 +74,13 @@ export const Container = React.forwardRef(
|
|
73
74
|
<Box
|
74
75
|
{...rest}
|
75
76
|
ref={ref}
|
76
|
-
className={
|
77
|
+
className={clsx(className, classes.root)}
|
77
78
|
sx={[
|
78
79
|
{
|
79
|
-
width: '100%',
|
80
80
|
pl: !breakoutLeft ? padding : undefined,
|
81
81
|
pr: !breakoutRight ? padding : undefined,
|
82
82
|
'&.breakoutLeft': { pl: 'unset' },
|
83
83
|
'&.breakoutRight': { pr: 'unset' },
|
84
|
-
|
85
|
-
// Nesting containers will not have padding applied.
|
86
|
-
'.MuiContainer-root &': { pl: 0, pr: 0 },
|
87
84
|
},
|
88
85
|
...(Array.isArray(sx) ? sx : [sx]),
|
89
86
|
]}
|
package/Form/FormHeader.tsx
CHANGED
package/Form/InputCheckmark.tsx
CHANGED
@@ -2,10 +2,10 @@ import type { ScrollerButtonProps } from '@graphcommerce/framer-scroller'
|
|
2
2
|
import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
|
3
3
|
import type { SxProps, Theme } from '@mui/material'
|
4
4
|
import { Box } from '@mui/material'
|
5
|
-
import { iconChevronLeft, iconChevronRight } from '../icons'
|
6
5
|
import { IconSvg } from '../IconSvg'
|
7
6
|
import { extendableComponent, responsiveVal } from '../Styles'
|
8
7
|
import { useFabSize } from '../Theme'
|
8
|
+
import { iconChevronLeft, iconChevronRight } from '../icons'
|
9
9
|
|
10
10
|
const { classes } = extendableComponent('ItemScroller', [
|
11
11
|
'root',
|
@@ -8,7 +8,9 @@ export type RelativeTimeFormatProps = {
|
|
8
8
|
unit?: Intl.RelativeTimeFormatUnit
|
9
9
|
} & UseIntlRelativeTimeFormatOptions
|
10
10
|
|
11
|
-
/**
|
11
|
+
/**
|
12
|
+
* Alternative: {@link file://./RelativeToTimeFormat.tsx}
|
13
|
+
*/
|
12
14
|
export const RelativeTimeFormat = forwardRef<HTMLSpanElement, RelativeTimeFormatProps>(
|
13
15
|
(props, ref) => {
|
14
16
|
const { children, unit, locale, localeMatcher, numeric, styleFormat, ...rest } = props
|
@@ -5,11 +5,13 @@ import type { RelativeTimeFormatProps } from './RelativeTimeFormat'
|
|
5
5
|
import { RelativeTimeFormat } from './RelativeTimeFormat'
|
6
6
|
|
7
7
|
type RelativeToTimeFormatProps = Omit<RelativeTimeFormatProps, 'children'> & {
|
8
|
-
/**
|
8
|
+
/**
|
9
|
+
* Date to format a relative value for.
|
10
|
+
*/
|
9
11
|
children: DateValue
|
10
12
|
/**
|
11
|
-
* If provided, the component will format a relative value to this date.
|
12
|
-
* relative value to the current date.
|
13
|
+
* If provided, the component will format a relative value to this date.
|
14
|
+
* Else, it will format a relative value to the current date.
|
13
15
|
*/
|
14
16
|
to?: DateValue
|
15
17
|
}
|
@@ -10,12 +10,14 @@ import { Box } from '@mui/material'
|
|
10
10
|
import { useRouter } from 'next/router'
|
11
11
|
import type { LinkOrButtonProps } from '../../Button/LinkOrButton'
|
12
12
|
import { LinkOrButton } from '../../Button/LinkOrButton'
|
13
|
-
import { iconChevronLeft } from '../../icons'
|
14
13
|
import { IconSvg } from '../../IconSvg'
|
15
14
|
import { responsiveVal } from '../../Styles'
|
15
|
+
import { iconChevronLeft } from '../../icons'
|
16
16
|
|
17
17
|
export type BackProps = Omit<LinkOrButtonProps, 'onClick' | 'children'> & {
|
18
|
-
/**
|
18
|
+
/**
|
19
|
+
* Will not use `router.back()` if available, and will always use the `up.href`
|
20
|
+
*/
|
19
21
|
disableBackNavigation?: boolean
|
20
22
|
}
|
21
23
|
|
@@ -2,9 +2,9 @@ import { useGo, usePageContext } from '@graphcommerce/framer-next-pages'
|
|
2
2
|
import { i18n } from '@lingui/core'
|
3
3
|
import { Fab } from '@mui/material'
|
4
4
|
import { useState } from 'react'
|
5
|
-
import { iconClose } from '../../icons'
|
6
5
|
import { IconSvg, useIconSvgSize } from '../../IconSvg'
|
7
6
|
import { useFabSize } from '../../Theme'
|
7
|
+
import { iconClose } from '../../icons'
|
8
8
|
|
9
9
|
export type LayoutHeaderCloseProps = {
|
10
10
|
onClose?: () => void
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import { useMotionValueValue } from '@graphcommerce/framer-utils'
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
import type { LayoutProps } from 'framer-motion'
|
5
|
-
import { m } from 'framer-motion'
|
2
|
+
import { Box, styled, SxProps, Theme } from '@mui/material'
|
3
|
+
import { LayoutProps, m } from 'framer-motion'
|
6
4
|
import React, { useRef } from 'react'
|
7
5
|
import { Container } from '../../Container/Container'
|
8
6
|
import { extendableComponent } from '../../Styles'
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { useScrollOffset } from '@graphcommerce/framer-next-pages'
|
2
2
|
import { dvh } from '@graphcommerce/framer-utils'
|
3
|
-
import
|
4
|
-
import { Box } from '@mui/material'
|
3
|
+
import { Box, SxProps, Theme } from '@mui/material'
|
5
4
|
import { useScroll, useTransform } from 'framer-motion'
|
6
5
|
import { Container } from '../../Container/Container'
|
7
6
|
import { LayoutProvider } from '../../Layout/components/LayoutProvider'
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/framer-scroller'
|
2
2
|
import type { BoxProps } from '@mui/material'
|
3
3
|
import React from 'react'
|
4
|
-
import { iconChevronLeft, iconChevronRight } from '../icons'
|
5
4
|
import type { IconSvgProps } from '../IconSvg'
|
6
5
|
import { IconSvg } from '../IconSvg'
|
7
6
|
import { MediaQuery } from '../MediaQuery'
|
8
7
|
import { extendableComponent } from '../Styles/extendableComponent'
|
8
|
+
import { iconChevronLeft, iconChevronRight } from '../icons'
|
9
9
|
|
10
10
|
export type MenuTabsProps = {
|
11
11
|
children: React.ReactNode
|
@@ -57,7 +57,9 @@ export type MediaQueryProps<C extends React.ElementType = 'div'> = BoxProps<C> &
|
|
57
57
|
* hydrates the component if the query matches. If it doesn't match, it will NOT render the
|
58
58
|
* component (and thus not execute the JS).
|
59
59
|
*/
|
60
|
-
function
|
60
|
+
export function MediaQuery<Component extends React.ElementType = 'div'>(
|
61
|
+
props: MediaQueryProps<Component>,
|
62
|
+
) {
|
61
63
|
const { query, sx, children, display = 'contents', ...elementProps } = props
|
62
64
|
|
63
65
|
const theme = useTheme()
|
@@ -107,7 +109,3 @@ function MediaQueryBase(props: MediaQueryProps) {
|
|
107
109
|
/>
|
108
110
|
)
|
109
111
|
}
|
110
|
-
|
111
|
-
export const MediaQuery = MediaQueryBase as <C extends React.ElementType = 'div'>(
|
112
|
-
props: MediaQueryProps<C>,
|
113
|
-
) => React.ReactNode
|
@@ -4,12 +4,12 @@ import { Box, Fab, styled, useTheme } from '@mui/material'
|
|
4
4
|
import { m } from 'framer-motion'
|
5
5
|
import { useRouter } from 'next/router'
|
6
6
|
import React, { useEffect } from 'react'
|
7
|
-
import { iconClose, iconMenu } from '../../icons'
|
8
7
|
import { IconSvg } from '../../IconSvg'
|
9
8
|
import { useScrollY } from '../../Layout/hooks/useScrollY'
|
10
9
|
import { useFabAnimation } from '../../LayoutParts/useFabAnimation'
|
11
10
|
import { extendableComponent } from '../../Styles/extendableComponent'
|
12
11
|
import { useFabSize } from '../../Theme'
|
12
|
+
import { iconClose, iconMenu } from '../../icons'
|
13
13
|
|
14
14
|
const MotionDiv = styled(m.div)({})
|
15
15
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
2
2
|
import { useMotionValueValue } from '@graphcommerce/framer-utils'
|
3
|
-
import {
|
3
|
+
import { Box, ListItemButton, alpha, styled, useEventCallback } from '@mui/material'
|
4
4
|
import React from 'react'
|
5
|
-
import { useMatchMedia } from '../../hooks'
|
6
|
-
import { iconChevronRight } from '../../icons'
|
7
5
|
import { IconSvg } from '../../IconSvg'
|
8
6
|
import { extendableComponent } from '../../Styles/extendableComponent'
|
9
7
|
import { NextLink } from '../../Theme'
|
8
|
+
import { useMatchMedia } from '../../hooks'
|
9
|
+
import { iconChevronRight } from '../../icons'
|
10
10
|
import type { NavigationNode } from '../hooks/useNavigation'
|
11
11
|
import {
|
12
12
|
isNavigationButton,
|
@@ -5,14 +5,14 @@ import { Box, Fab, styled, useEventCallback, useTheme } from '@mui/material'
|
|
5
5
|
import { m } from 'framer-motion'
|
6
6
|
import React, { useEffect, useRef } from 'react'
|
7
7
|
import type { LiteralUnion } from 'type-fest'
|
8
|
-
import { useMatchMedia } from '../../hooks'
|
9
|
-
import { iconChevronLeft, iconClose } from '../../icons'
|
10
8
|
import { IconSvg, useIconSvgSize } from '../../IconSvg'
|
11
9
|
import { LayoutHeaderContent } from '../../Layout/components/LayoutHeaderContent'
|
12
10
|
import { LayoutTitle } from '../../Layout/components/LayoutTitle'
|
13
11
|
import { OverlaySsr } from '../../Overlay/components/OverlaySsr'
|
14
12
|
import { extendableComponent } from '../../Styles/extendableComponent'
|
15
13
|
import { useFabSize } from '../../Theme'
|
14
|
+
import { useMatchMedia } from '../../hooks'
|
15
|
+
import { iconChevronLeft, iconClose } from '../../icons'
|
16
16
|
import { useNavigation } from '../hooks/useNavigation'
|
17
17
|
import type { mouseEventPref } from './NavigationItem'
|
18
18
|
import { NavigationList } from './NavigationList'
|
@@ -15,7 +15,9 @@ import { NavigationContext, NavigationNodeType } from '../hooks/useNavigation'
|
|
15
15
|
export type NavigationProviderBaseProps = {
|
16
16
|
items: (NavigationNode | React.ReactElement)[]
|
17
17
|
hideRootOnNavigate?: boolean
|
18
|
-
/**
|
18
|
+
/**
|
19
|
+
* @deprecated No longer used
|
20
|
+
*/
|
19
21
|
closeAfterNavigate?: boolean
|
20
22
|
children?: React.ReactNode
|
21
23
|
animationDuration?: number
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { ChipProps, SxProps, Theme } from '@mui/material'
|
2
|
-
import { Badge, Chip,
|
2
|
+
import { Badge, Chip, Typography, lighten, useEventCallback } from '@mui/material'
|
3
3
|
import React, { useState } from 'react'
|
4
|
-
import { iconChevronDown, iconChevronUp } from '../icons'
|
5
4
|
import { IconSvg } from '../IconSvg'
|
6
5
|
import { responsiveVal } from '../Styles'
|
6
|
+
import { iconChevronDown, iconChevronUp } from '../icons'
|
7
7
|
import type { OverlayOrPopperPanelProps } from './OverlayOrPopperPanel'
|
8
8
|
import { OverlayOrPopperPanel } from './OverlayOrPopperPanel'
|
9
9
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { i18n } from '@lingui/core'
|
2
2
|
import { Trans } from '@lingui/react'
|
3
3
|
import { Box, Button, Fab, Typography } from '@mui/material'
|
4
|
-
import { iconClose } from '../icons'
|
5
4
|
import { IconSvg, useIconSvgSize } from '../IconSvg'
|
6
5
|
import { LayoutOverlayHeader } from '../LayoutOverlay'
|
7
6
|
import { OverlayStickyBottom } from '../Overlay/components/OverlayStickyBottom'
|
8
7
|
import { extendableComponent } from '../Styles'
|
9
8
|
import { useFabSize } from '../Theme'
|
9
|
+
import { iconClose } from '../icons'
|
10
10
|
import type { PanelActionsProps } from './types'
|
11
11
|
|
12
12
|
const { classes } = extendableComponent(
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { i18n } from '@lingui/core'
|
2
2
|
import { Trans } from '@lingui/react'
|
3
3
|
import { Box, Button, Fab, Typography } from '@mui/material'
|
4
|
-
import { iconClose } from '../icons'
|
5
4
|
import { IconSvg, useIconSvgSize } from '../IconSvg'
|
6
5
|
import { LayoutHeader } from '../Layout'
|
7
6
|
import { OverlayStickyBottom } from '../Overlay/components/OverlayStickyBottom'
|
8
7
|
import { useFabSize } from '../Theme'
|
8
|
+
import { iconClose } from '../icons'
|
9
9
|
import type { PanelActionsProps } from './types'
|
10
10
|
|
11
11
|
export function PopperPanelActions(props: PanelActionsProps) {
|
package/Page/types.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import type { ParsedUrlQuery } from 'querystring'
|
2
1
|
import type { UpPage } from '@graphcommerce/framer-next-pages/types'
|
3
2
|
// todo: remove references to GraphQL
|
4
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
@@ -7,6 +6,7 @@ import type {
|
|
7
6
|
GetServerSideProps as GetServerSidePropsNext,
|
8
7
|
GetStaticProps as GetStaticPropsNext,
|
9
8
|
} from 'next'
|
9
|
+
import type { ParsedUrlQuery } from 'querystring'
|
10
10
|
|
11
11
|
type AnyObj = Record<string, unknown>
|
12
12
|
|
@@ -4,9 +4,9 @@ import { Box, IconButton } from '@mui/material'
|
|
4
4
|
import type { UsePaginationItem } from '@mui/material/usePagination'
|
5
5
|
import usePagination from '@mui/material/usePagination'
|
6
6
|
import React from 'react'
|
7
|
-
import { iconChevronLeft, iconChevronRight } from '../icons'
|
8
7
|
import { IconSvg } from '../IconSvg'
|
9
8
|
import { extendableComponent } from '../Styles'
|
9
|
+
import { iconChevronLeft, iconChevronRight } from '../icons'
|
10
10
|
|
11
11
|
export type PagePaginationProps = {
|
12
12
|
count: number
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { PaginationProps, PaginationRenderItemParams, SxProps, Theme } from '@mui/material'
|
2
2
|
import { Box, Pagination, PaginationItem } from '@mui/material'
|
3
|
-
import { iconChevronLeft, iconChevronRight } from '../icons'
|
4
3
|
import { IconSvg } from '../IconSvg'
|
5
4
|
import { extendableComponent } from '../Styles'
|
6
5
|
import { NextLink } from '../Theme'
|
6
|
+
import { iconChevronLeft, iconChevronRight } from '../icons'
|
7
7
|
|
8
8
|
export type PaginationExtendedProps = {
|
9
9
|
count: number
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { ListItemButtonProps } from '@mui/material'
|
2
2
|
import { ListItemButton, ListItemIcon, ListItemText } from '@mui/material'
|
3
3
|
import React from 'react'
|
4
|
-
import { iconChevronRight } from '../../icons'
|
5
4
|
import { IconSvg } from '../../IconSvg'
|
6
5
|
import { NextLink } from '../../Theme'
|
6
|
+
import { iconChevronRight } from '../../icons'
|
7
7
|
|
8
8
|
export type ButtonLinkListItemProps = {
|
9
9
|
endIcon?: React.ReactNode
|
@@ -8,6 +8,7 @@ import { iconChevronLeft, iconChevronRight } from '../../icons'
|
|
8
8
|
import { IconSvg } from '../../IconSvg'
|
9
9
|
import { extendableComponent } from '../../Styles'
|
10
10
|
import { useFabSize } from '../../Theme'
|
11
|
+
import { Row } from '../Row'
|
11
12
|
|
12
13
|
export type RowLinksProps = {
|
13
14
|
title: string
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { i18n } from '@lingui/core'
|
2
2
|
import type { SnackbarProps, SxProps, Theme } from '@mui/material'
|
3
|
-
import { Box, Fab,
|
3
|
+
import { Box, Fab, Portal, Snackbar, SnackbarContent, lighten } from '@mui/material'
|
4
4
|
import React, { useEffect, useState } from 'react'
|
5
|
-
import { iconCheckmark, iconClose, iconSadFace } from '../icons'
|
6
|
-
import iconInfo from '../icons/info.svg'
|
7
5
|
import type { IconSvgProps } from '../IconSvg'
|
8
6
|
import { IconSvg } from '../IconSvg'
|
9
7
|
import { breakpointVal, extendableComponent } from '../Styles'
|
8
|
+
import { iconCheckmark, iconClose, iconSadFace } from '../icons'
|
9
|
+
import iconInfo from '../icons/info.svg'
|
10
10
|
|
11
11
|
type Size = 'normal' | 'wide'
|
12
12
|
type Variant = 'contained' | 'pill'
|
@@ -29,7 +29,9 @@ type OwnerState = {
|
|
29
29
|
size?: Size
|
30
30
|
severity?: 'success' | 'info' | 'warning' | 'error'
|
31
31
|
variant?: Variant
|
32
|
-
/**
|
32
|
+
/**
|
33
|
+
* Setting this to true allows interaction with the rest of the page without closing the Snackbar
|
34
|
+
*/
|
33
35
|
disableBackdropClick?: boolean
|
34
36
|
disableClose?: boolean
|
35
37
|
disableIcon?: boolean
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import type { RatingProps } from '@mui/material'
|
2
2
|
import { Rating } from '@mui/material'
|
3
|
-
import { iconStar } from '../icons'
|
4
3
|
import { IconSvg } from '../IconSvg'
|
5
4
|
import { extendableComponent } from '../Styles'
|
5
|
+
import { iconStar } from '../icons'
|
6
6
|
|
7
7
|
export type StarRatingFieldProps = {
|
8
8
|
id?: string
|
@@ -10,7 +10,5 @@ export const createEmotionCache = () => {
|
|
10
10
|
insertionPoint = emotionInsertionPoint ?? undefined
|
11
11
|
}
|
12
12
|
|
13
|
-
|
14
|
-
cache.compat = true
|
15
|
-
return cache
|
13
|
+
return createCache({ key: 'mui-style', insertionPoint, stylisPlugins: [] })
|
16
14
|
}
|
@@ -5,8 +5,8 @@ import type { AppType } from 'next/app'
|
|
5
5
|
import type NextDocument from 'next/document'
|
6
6
|
// eslint-disable-next-line @next/next/no-document-import-in-page
|
7
7
|
import type { DocumentContext } from 'next/document'
|
8
|
-
import { createEmotionCache } from './createEmotionCache'
|
9
8
|
import type { EmotionProviderProps } from './EmotionProvider'
|
9
|
+
import { createEmotionCache } from './createEmotionCache'
|
10
10
|
|
11
11
|
export type EmotionCacheProps = { emotionStyleTags: EmotionJSX.Element[] }
|
12
12
|
|
@@ -8,10 +8,10 @@ import {
|
|
8
8
|
} from '@mui/material'
|
9
9
|
import type { ChangeEvent, Ref } from 'react'
|
10
10
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
11
|
-
import { iconMin, iconPlus } from '../icons'
|
12
11
|
import { IconSvg } from '../IconSvg'
|
13
12
|
import { extendableComponent } from '../Styles'
|
14
13
|
import { responsiveVal } from '../Styles/responsiveVal'
|
14
|
+
import { iconMin, iconPlus } from '../icons'
|
15
15
|
|
16
16
|
export type IconButtonPropsOmit = Omit<
|
17
17
|
IconButtonProps,
|
@@ -29,7 +29,9 @@ const name = 'TextInputNumber'
|
|
29
29
|
const parts = ['quantity', 'quantityInput', 'button'] as const
|
30
30
|
const { withState } = extendableComponent<OwnerState, typeof name, typeof parts>(name, parts)
|
31
31
|
|
32
|
-
/**
|
32
|
+
/**
|
33
|
+
* @deprecated Please us NumberFieldElement
|
34
|
+
*/
|
33
35
|
export function TextInputNumber(props: TextInputNumberProps) {
|
34
36
|
const {
|
35
37
|
DownProps = {},
|
package/Theme/NextLink.tsx
CHANGED
@@ -15,8 +15,8 @@ export type LinkProps = AnchorWithoutLinkProps & Partial<NextLinkPropsBase> & {
|
|
15
15
|
* This is a wrapper around the Next.js Link component which can be used with MUI's Link component
|
16
16
|
* or any ButtonBase derivative.
|
17
17
|
*
|
18
|
-
* By default you can use the props provided by the Link or Button component, but you can pass
|
19
|
-
* next/link specific props like `prefetch`, `replace`, `scroll`, `shallow`
|
18
|
+
* By default you can use the props provided by the Link or Button component, but you can pass
|
19
|
+
* any next/link specific props like `prefetch`, `replace`, `scroll`, `shallow`
|
20
20
|
*
|
21
21
|
* ```typescript
|
22
22
|
* const button = (
|
@@ -40,9 +40,9 @@ export const NextLink = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) =>
|
|
40
40
|
const isFullUrl = href.includes(':') || href.startsWith('//')
|
41
41
|
|
42
42
|
/**
|
43
|
-
* When an internal link is provided and it is on the same domain, extract the locale
|
44
|
-
* and make the URL relative without the locale. Prevents Next.js prefixing
|
45
|
-
* locale.
|
43
|
+
* When an internal link is provided and it is on the same domain, extract the locale
|
44
|
+
* from the URL and make the URL relative without the locale. Prevents Next.js prefixing
|
45
|
+
* again with the current locale.
|
46
46
|
*/
|
47
47
|
if (!locale && isFullUrl && href.startsWith(canonicalBaseUrl)) {
|
48
48
|
const url = new URL(href)
|
package/Theme/createTheme.ts
CHANGED
package/Theme/themeDefaults.ts
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
import type { Components, Theme, ThemeOptions } from '@mui/material'
|
2
|
-
import { createTheme as createMuiTheme } from '@mui/material'
|
3
1
|
import type { Shadows } from '@mui/material/styles/shadows'
|
4
2
|
import { spreadVal } from '../Styles/spreadVal'
|
5
3
|
import { breakpoints } from './breakpoints'
|
@@ -39,11 +37,3 @@ export const themeBaseDefaults = {
|
|
39
37
|
spreadVal,
|
40
38
|
shadows,
|
41
39
|
}
|
42
|
-
|
43
|
-
// https://github.com/tjx666/ts-perf-issue#createtheme
|
44
|
-
export const createTheme = createMuiTheme as unknown as (
|
45
|
-
baseTheme: ThemeOptions,
|
46
|
-
options?: {
|
47
|
-
components: Components<Theme>
|
48
|
-
},
|
49
|
-
) => Theme
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
2
2
|
import type { ButtonProps } from '@mui/material'
|
3
|
-
import {
|
3
|
+
import { Button, alpha } from '@mui/material'
|
4
4
|
import type { FormEvent } from 'react'
|
5
5
|
import React from 'react'
|
6
6
|
import { extendableComponent } from '../Styles'
|
package/hooks/memoDeep.ts
CHANGED
@@ -6,8 +6,7 @@ import { memo } from 'react'
|
|
6
6
|
/**
|
7
7
|
* This is a deep comparison version of React's `memo` function.
|
8
8
|
*
|
9
|
-
* This method isn't too expensive to run, but will be rerun every time a parent component is
|
10
|
-
* rendered.
|
9
|
+
* This method isn't too expensive to run, but will be rerun every time a parent component is rendered.
|
11
10
|
*
|
12
11
|
* This should probably only be used as the result of a performance profiling session.
|
13
12
|
*/
|
package/hooks/useIsSsr.ts
CHANGED
@@ -2,7 +2,9 @@ import { useSyncExternalStore } from 'react'
|
|
2
2
|
|
3
3
|
const emptySubscribe = () => () => {}
|
4
4
|
|
5
|
-
/**
|
5
|
+
/**
|
6
|
+
* This method will return true on the server and during hydration and false after that.
|
7
|
+
*/
|
6
8
|
export function useIsSSR() {
|
7
9
|
return useSyncExternalStore(
|
8
10
|
emptySubscribe,
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "9.0.4
|
5
|
+
"version": "9.0.4",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -24,13 +24,13 @@
|
|
24
24
|
"@emotion/react": "^11",
|
25
25
|
"@emotion/server": "^11",
|
26
26
|
"@emotion/styled": "^11",
|
27
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.4
|
28
|
-
"@graphcommerce/framer-next-pages": "^9.0.4
|
29
|
-
"@graphcommerce/framer-scroller": "^9.0.4
|
30
|
-
"@graphcommerce/framer-utils": "^9.0.4
|
31
|
-
"@graphcommerce/image": "^9.0.4
|
32
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.4
|
33
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.4
|
27
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.4",
|
28
|
+
"@graphcommerce/framer-next-pages": "^9.0.4",
|
29
|
+
"@graphcommerce/framer-scroller": "^9.0.4",
|
30
|
+
"@graphcommerce/framer-utils": "^9.0.4",
|
31
|
+
"@graphcommerce/image": "^9.0.4",
|
32
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.4",
|
33
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.4",
|
34
34
|
"@lingui/core": "^4.2.1",
|
35
35
|
"@lingui/macro": "^4.2.1",
|
36
36
|
"@lingui/react": "^4.2.1",
|
package/utils/cssFlags.tsx
CHANGED
@@ -35,7 +35,7 @@ export function getCssFlag(flagName: string) {
|
|
35
35
|
* Example:
|
36
36
|
*
|
37
37
|
* ```tsx
|
38
|
-
*
|
38
|
+
* <Box sx={{ [cssFlagSelector('dark')]: { color: 'white' } }} />
|
39
39
|
* ```
|
40
40
|
*/
|
41
41
|
export const cssFlag = <T extends string>(flagName: T) => `html[data-${flagName}] &` as const
|
@@ -46,7 +46,7 @@ export const cssFlag = <T extends string>(flagName: T) => `html[data-${flagName}
|
|
46
46
|
* Example:
|
47
47
|
*
|
48
48
|
* ```tsx
|
49
|
-
*
|
49
|
+
* <Box sx={{ [cssNotFlagSelector('dark')]: { color: 'black' } }} />
|
50
50
|
* ```
|
51
51
|
*/
|
52
52
|
export const cssNotFlag = <T extends string>(flagName: T) =>
|
package/utils/normalizeLocale.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
import { storefrontConfig, storefrontConfigDefault } from './storefrontConfig'
|
2
2
|
|
3
3
|
/**
|
4
|
-
* To support using multiple storefronts using the same language locale (which
|
5
|
-
* support), we use an additional 'tag' in the locale code in
|
6
|
-
* a Magento store code).
|
4
|
+
* To support using multiple storefronts using the same language locale (which
|
5
|
+
* next.js does not support), we use an additional 'tag' in the locale code in
|
6
|
+
* which we specify a unique string (i.e. a Magento store code).
|
7
7
|
*
|
8
|
-
* This makes next.js happy, as it still follows the BCP47 spec. However, the
|
9
|
-
* places may not accept this as a valid locale.
|
8
|
+
* This makes next.js happy, as it still follows the BCP47 spec. However, the
|
9
|
+
* Intl API and other places may not accept this as a valid locale.
|
10
10
|
*
|
11
|
-
* Use this method to get a 'normalized' locale that can safely be used in such
|
11
|
+
* Use this method to get a 'normalized' locale that can safely be used in such
|
12
|
+
* places.
|
12
13
|
*/
|
13
14
|
export function normalizeLocale(locale: string | undefined = storefrontConfigDefault().locale) {
|
14
15
|
const linguiLocale = storefrontConfig(locale)?.linguiLocale
|
package/utils/robots.ts
CHANGED
@@ -3,8 +3,8 @@ import type { GetServerSidePropsContext } from 'next'
|
|
3
3
|
type Stringifyable = boolean | string | number | null | undefined
|
4
4
|
|
5
5
|
/**
|
6
|
-
* Tagged template literal for robots.txt that will automatically stringify values and indent them
|
7
|
-
*
|
6
|
+
* Tagged template literal for robots.txt that will automatically stringify values and indent them correctly.
|
7
|
+
* https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt#syntax
|
8
8
|
*/
|
9
9
|
export function robotsTxt(strings: TemplateStringsArray, ...values: Stringifyable[]) {
|
10
10
|
return strings
|
package/utils/sxx.ts
CHANGED
@@ -9,10 +9,8 @@ import type { SxProps, Theme } from '@mui/material'
|
|
9
9
|
* sxx({ position: 'absolute', right: 0, top: 0 }, props.sx)
|
10
10
|
* ```
|
11
11
|
*/
|
12
|
-
export const sxx = (
|
13
|
-
...sxPropsArray: (SxProps<Theme> | undefined | null | false)[]
|
14
|
-
): SxProps<Theme> =>
|
12
|
+
export const sxx = (...sxPropsArray: (SxProps<Theme> | undefined)[]): SxProps<Theme> =>
|
15
13
|
sxPropsArray
|
16
|
-
.filter((v) =>
|
14
|
+
.filter((v) => v !== undefined)
|
17
15
|
.map((sx) => (Array.isArray(sx) ? sx : [sx]))
|
18
16
|
.flat(1)
|