@graphcommerce/next-ui 4.21.0 → 4.23.1
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 +47 -13
- package/ActionCard/ActionCardList.tsx +33 -32
- package/ActionCard/ActionCardListForm.tsx +1 -2
- package/AnimatedRow/AnimatedRow.tsx +1 -0
- package/Blog/BlogHeader/BlogHeader.tsx +7 -2
- package/Blog/BlogListItem/BlogListItem.tsx +5 -1
- package/Blog/BlogTags/BlogTag.tsx +2 -3
- package/CHANGELOG.md +52 -0
- package/Footer/Footer.tsx +3 -2
- package/Form/Form.tsx +7 -2
- package/Form/FormActions.tsx +1 -1
- package/FramerScroller/SidebarGallery.tsx +1 -5
- package/IconSvg/IconSvg.tsx +4 -4
- package/Layout/components/LayoutHeaderClose.tsx +2 -0
- package/Layout/components/LayoutHeaderContent.tsx +3 -1
- package/LayoutDefault/components/LayoutDefault.tsx +3 -3
- package/LayoutOverlay/components/LayoutOverlay.tsx +2 -1
- package/LayoutParts/DesktopHeaderBadge.tsx +3 -3
- package/LayoutParts/MenuFab.tsx +2 -2
- package/Navigation/components/NavigationItem.tsx +33 -19
- package/Navigation/components/NavigationList.tsx +21 -15
- package/Navigation/components/NavigationOverlay.tsx +63 -35
- package/Navigation/components/NavigationProvider.tsx +12 -30
- package/Navigation/hooks/useNavigation.ts +33 -6
- package/Overlay/components/Overlay.tsx +1 -2
- package/Overlay/components/OverlayBase.tsx +19 -19
- package/Overlay/hooks/useOverlayPosition.ts +6 -1
- package/Page/types.ts +10 -1
- package/Row/HeroBanner/HeroBanner.tsx +7 -2
- package/Row/ImageText/ImageText.tsx +10 -3
- package/Row/ImageTextBoxed/ImageTextBoxed.tsx +7 -1
- package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +4 -2
- package/Row/SpecialBanner/SpecialBanner.tsx +10 -2
- package/Snackbar/MessageSnackbarImpl.tsx +9 -5
- package/Stepper/Stepper.tsx +1 -2
- package/Styles/breakpointVal.tsx +1 -1
- package/TextInputNumber/TextInputNumber.tsx +5 -4
- package/Theme/MuiButton.ts +12 -3
- package/Theme/MuiFab.ts +2 -2
- package/ToggleButton/ToggleButton.tsx +15 -5
- package/hooks/index.ts +1 -0
- package/hooks/useMemoDeep.ts +15 -0
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Box, SxProps, Theme } from '@mui/material'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { extendableComponent } from '../../Styles'
|
|
4
|
+
import { breakpointVal } from '../../Styles/breakpointVal'
|
|
4
5
|
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
5
6
|
import { Row } from '../Row'
|
|
6
7
|
|
|
@@ -32,7 +33,12 @@ export function ImageTextBoxed(props: ImageTextBoxedProps) {
|
|
|
32
33
|
gridTemplateColumns: '1fr auto',
|
|
33
34
|
columnGap: `${theme.spacings.lg}`,
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
+
...breakpointVal(
|
|
37
|
+
'borderRadius',
|
|
38
|
+
theme.shape.borderRadius * 2,
|
|
39
|
+
theme.shape.borderRadius * 3,
|
|
40
|
+
theme.breakpoints.values,
|
|
41
|
+
),
|
|
36
42
|
overflow: 'hidden',
|
|
37
43
|
})}
|
|
38
44
|
>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, ContainerProps } from '@mui/material'
|
|
2
2
|
import { extendableComponent } from '../../Styles'
|
|
3
|
-
import {
|
|
3
|
+
import { breakpointVal } from '../../Styles/breakpointVal'
|
|
4
4
|
import { Row } from '../Row'
|
|
5
5
|
|
|
6
6
|
export type ParagraphWithSidebarSlideProps = ContainerProps & {
|
|
@@ -46,9 +46,11 @@ export function ParagraphWithSidebarSlide(props: ParagraphWithSidebarSlideProps)
|
|
|
46
46
|
filter: 'brightness(100%)',
|
|
47
47
|
height: '100%',
|
|
48
48
|
},
|
|
49
|
-
|
|
49
|
+
...breakpointVal(
|
|
50
|
+
'borderRadius',
|
|
50
51
|
theme.shape.borderRadius * 2,
|
|
51
52
|
theme.shape.borderRadius * 3,
|
|
53
|
+
theme.breakpoints.values,
|
|
52
54
|
),
|
|
53
55
|
},
|
|
54
56
|
})}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Box, ContainerProps, Typography } from '@mui/material'
|
|
2
2
|
import { extendableComponent } from '../../Styles'
|
|
3
|
+
import { breakpointVal } from '../../Styles/breakpointVal'
|
|
3
4
|
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
4
5
|
import { Row } from '../Row'
|
|
5
6
|
|
|
@@ -31,7 +32,12 @@ export function SpecialBanner(props: SpecialBannerProps) {
|
|
|
31
32
|
paddingTop: theme.spacings.lg,
|
|
32
33
|
paddingBottom: theme.spacings.lg,
|
|
33
34
|
justifySelf: 'start',
|
|
34
|
-
|
|
35
|
+
...breakpointVal(
|
|
36
|
+
'borderRadius',
|
|
37
|
+
theme.shape.borderRadius * 2,
|
|
38
|
+
theme.shape.borderRadius * 3,
|
|
39
|
+
theme.breakpoints.values,
|
|
40
|
+
),
|
|
35
41
|
[theme.breakpoints.up('md')]: {
|
|
36
42
|
padding: 0,
|
|
37
43
|
background: 'none',
|
|
@@ -51,9 +57,11 @@ export function SpecialBanner(props: SpecialBannerProps) {
|
|
|
51
57
|
width: responsiveVal(200, 900),
|
|
52
58
|
height: 'auto',
|
|
53
59
|
objectFit: 'cover',
|
|
54
|
-
|
|
60
|
+
...breakpointVal(
|
|
61
|
+
'borderRadius',
|
|
55
62
|
theme.shape.borderRadius * 2,
|
|
56
63
|
theme.shape.borderRadius * 3,
|
|
64
|
+
theme.breakpoints.values,
|
|
57
65
|
),
|
|
58
66
|
},
|
|
59
67
|
[theme.breakpoints.up('lg')]: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { breakpointVal } from '@graphcommerce/next-ui'
|
|
1
2
|
import {
|
|
2
3
|
Fab,
|
|
3
4
|
Snackbar,
|
|
@@ -65,8 +66,6 @@ export default function MessageSnackbarImpl(props: MessageSnackbarImplProps) {
|
|
|
65
66
|
}, [open])
|
|
66
67
|
|
|
67
68
|
const hideSnackbar = (e) => {
|
|
68
|
-
e.preventDefault()
|
|
69
|
-
|
|
70
69
|
setShowSnackbar(false)
|
|
71
70
|
onClose?.()
|
|
72
71
|
}
|
|
@@ -86,20 +85,25 @@ export default function MessageSnackbarImpl(props: MessageSnackbarImplProps) {
|
|
|
86
85
|
message={message}
|
|
87
86
|
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
|
88
87
|
open={showSnackbar}
|
|
89
|
-
autoHideDuration={autoHide ?
|
|
88
|
+
autoHideDuration={autoHide ? 5000 : null}
|
|
90
89
|
className={classes.root}
|
|
91
90
|
sx={sx}
|
|
92
91
|
onClose={hideSnackbar}
|
|
93
92
|
>
|
|
94
93
|
<SnackbarContent
|
|
95
|
-
elevation={
|
|
94
|
+
elevation={16}
|
|
96
95
|
className={classes.content}
|
|
97
96
|
sx={(theme) => ({
|
|
98
97
|
'&.variantPill': {
|
|
99
98
|
backgroundColor: theme.palette.background.paper,
|
|
100
99
|
color: theme.palette.text.primary,
|
|
101
100
|
[theme.breakpoints.up('md')]: {
|
|
102
|
-
|
|
101
|
+
...breakpointVal(
|
|
102
|
+
'borderRadius',
|
|
103
|
+
theme.shape.borderRadius * 3,
|
|
104
|
+
theme.shape.borderRadius * 4,
|
|
105
|
+
theme.breakpoints.values,
|
|
106
|
+
),
|
|
103
107
|
},
|
|
104
108
|
padding: theme.spacings.xxs,
|
|
105
109
|
},
|
package/Stepper/Stepper.tsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Box, SxProps, Theme } from '@mui/material'
|
|
2
2
|
import { extendableComponent } from '../Styles'
|
|
3
|
-
import { responsiveVal } from '../Styles/responsiveVal'
|
|
4
3
|
|
|
5
4
|
export type StepperProps = {
|
|
6
5
|
steps: number
|
|
@@ -32,7 +31,7 @@ export function Stepper(props: StepperProps) {
|
|
|
32
31
|
<Box
|
|
33
32
|
sx={[
|
|
34
33
|
{
|
|
35
|
-
height:
|
|
34
|
+
height: 2,
|
|
36
35
|
bgcolor: 'divider',
|
|
37
36
|
},
|
|
38
37
|
currentStep - 1 >= step && {
|
package/Styles/breakpointVal.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core'
|
|
1
2
|
import {
|
|
2
3
|
IconButton,
|
|
3
4
|
IconButtonProps,
|
|
@@ -15,7 +16,7 @@ import { iconMin, iconPlus } from '../icons'
|
|
|
15
16
|
|
|
16
17
|
export type IconButtonPropsOmit = Omit<
|
|
17
18
|
IconButtonProps,
|
|
18
|
-
'aria-label' | 'size' | 'onMouseDown' | 'onMouseUp' | 'disabled'
|
|
19
|
+
'aria-labelledby' | 'aria-label' | 'size' | 'onMouseDown' | 'onMouseUp' | 'disabled'
|
|
19
20
|
>
|
|
20
21
|
|
|
21
22
|
export type TextInputNumberProps = Omit<TextFieldProps, 'type'> & {
|
|
@@ -95,7 +96,6 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
95
96
|
sx={[
|
|
96
97
|
{
|
|
97
98
|
width: responsiveVal(80, 120),
|
|
98
|
-
backgroundColor: 'inherit',
|
|
99
99
|
},
|
|
100
100
|
...(Array.isArray(sx) ? sx : [sx]),
|
|
101
101
|
]}
|
|
@@ -104,7 +104,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
104
104
|
...textFieldProps.InputProps,
|
|
105
105
|
startAdornment: (
|
|
106
106
|
<IconButton
|
|
107
|
-
aria-label=
|
|
107
|
+
aria-label={i18n._(/* i18n */ 'Decrease')}
|
|
108
108
|
size='medium'
|
|
109
109
|
edge='start'
|
|
110
110
|
onPointerDown={() => setDirection('down')}
|
|
@@ -120,7 +120,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
120
120
|
),
|
|
121
121
|
endAdornment: (
|
|
122
122
|
<IconButton
|
|
123
|
-
aria-label=
|
|
123
|
+
aria-label={i18n._(/* i18n */ 'Increase')}
|
|
124
124
|
size='medium'
|
|
125
125
|
edge='end'
|
|
126
126
|
onPointerDown={() => setDirection('up')}
|
|
@@ -141,6 +141,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
141
141
|
}}
|
|
142
142
|
inputProps={{
|
|
143
143
|
...inputProps,
|
|
144
|
+
'aria-label': i18n._(/* i18n */ 'Number'),
|
|
144
145
|
sx: [
|
|
145
146
|
{
|
|
146
147
|
textAlign: 'center',
|
package/Theme/MuiButton.ts
CHANGED
|
@@ -22,7 +22,10 @@ export const MuiButtonResponsive: ButtonVariants = [
|
|
|
22
22
|
props: { size: 'small' },
|
|
23
23
|
style: ({ theme }) => ({
|
|
24
24
|
...theme.typography.body2,
|
|
25
|
-
padding: `${responsiveVal(3, 5)} ${responsiveVal(
|
|
25
|
+
padding: `${responsiveVal(3, 5)} ${responsiveVal(8, 15)}`,
|
|
26
|
+
'&.MuiLoadingButton-loading:hover': {
|
|
27
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
28
|
+
},
|
|
26
29
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(9, 15) },
|
|
27
30
|
'& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(9, 15) },
|
|
28
31
|
}),
|
|
@@ -31,7 +34,10 @@ export const MuiButtonResponsive: ButtonVariants = [
|
|
|
31
34
|
props: { size: 'medium' },
|
|
32
35
|
style: ({ theme }) => ({
|
|
33
36
|
...theme.typography.body1,
|
|
34
|
-
padding: `${responsiveVal(
|
|
37
|
+
padding: `${responsiveVal(7, 9)} ${responsiveVal(15, 22)}`,
|
|
38
|
+
'&.MuiLoadingButton-loading:hover': {
|
|
39
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
40
|
+
},
|
|
35
41
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(16, 24) },
|
|
36
42
|
'& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(16, 24) },
|
|
37
43
|
}),
|
|
@@ -41,7 +47,10 @@ export const MuiButtonResponsive: ButtonVariants = [
|
|
|
41
47
|
style: ({ theme }) => ({
|
|
42
48
|
...theme.typography.subtitle1,
|
|
43
49
|
fontWeight: theme.typography.fontWeightBold,
|
|
44
|
-
padding: `${responsiveVal(10, 15)} ${responsiveVal(
|
|
50
|
+
padding: `${responsiveVal(10, 15)} ${responsiveVal(28, 58)}`,
|
|
51
|
+
'&.MuiLoadingButton-loading:hover': {
|
|
52
|
+
backgroundColor: theme.palette.action.disabledBackground,
|
|
53
|
+
},
|
|
45
54
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(30, 60) },
|
|
46
55
|
'& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(30, 60) },
|
|
47
56
|
}),
|
package/Theme/MuiFab.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { Button, ButtonProps } from '@mui/material'
|
|
2
|
+
import { alpha, Button, ButtonProps } from '@mui/material'
|
|
3
3
|
import React, { FormEvent } from 'react'
|
|
4
4
|
import { extendableComponent } from '../Styles'
|
|
5
|
-
import {
|
|
5
|
+
import { breakpointVal } from '../Styles/breakpointVal'
|
|
6
6
|
|
|
7
7
|
export type ToggleButtonProps = Omit<ButtonProps, 'onClick' | 'onChange'> & {
|
|
8
8
|
selected?: boolean
|
|
@@ -72,16 +72,26 @@ export const ToggleButton = React.forwardRef<any, ToggleButtonProps>((props, ref
|
|
|
72
72
|
border: `1px solid ${theme.palette[color]?.main ?? theme.palette.primary.main}`,
|
|
73
73
|
boxShadow: `inset 0 0 0 1px ${
|
|
74
74
|
theme.palette[color]?.main ?? theme.palette.primary.main
|
|
75
|
-
}
|
|
75
|
+
},0 0 0 4px ${alpha(
|
|
76
|
+
theme.palette.primary.main,
|
|
77
|
+
theme.palette.action.hoverOpacity,
|
|
78
|
+
)} !important`,
|
|
76
79
|
},
|
|
77
80
|
':not(&.sizeSmall)': {
|
|
78
|
-
|
|
81
|
+
...breakpointVal(
|
|
82
|
+
'borderRadius',
|
|
83
|
+
theme.shape.borderRadius * 2,
|
|
84
|
+
theme.shape.borderRadius * 3,
|
|
85
|
+
theme.breakpoints.values,
|
|
86
|
+
),
|
|
79
87
|
padding: `${theme.spacings.xxs} ${theme.spacings.xs}`,
|
|
80
88
|
},
|
|
81
89
|
'&.sizeSmall': {
|
|
82
|
-
|
|
90
|
+
...breakpointVal(
|
|
91
|
+
'borderRadius',
|
|
83
92
|
theme.shape.borderRadius * 1,
|
|
84
93
|
theme.shape.borderRadius * 1.5,
|
|
94
|
+
theme.breakpoints.values,
|
|
85
95
|
),
|
|
86
96
|
padding: `8px 12px`,
|
|
87
97
|
},
|
package/hooks/index.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { equal } from '@wry/equality'
|
|
2
|
+
import { DependencyList, useMemo, useRef } from 'react'
|
|
3
|
+
|
|
4
|
+
export function useMemoDeep<T>(factory: () => T, deps: DependencyList | undefined): T {
|
|
5
|
+
const ref = useRef<DependencyList | undefined>(undefined)
|
|
6
|
+
const signalRef = useRef<number>(0)
|
|
7
|
+
|
|
8
|
+
if (!equal(deps, ref.current)) {
|
|
9
|
+
ref.current = deps
|
|
10
|
+
signalRef.current += 1
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
return useMemo(() => factory(), [signalRef.current])
|
|
15
|
+
}
|
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": "4.
|
|
5
|
+
"version": "4.23.1",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"@emotion/react": "^11.9.3",
|
|
20
20
|
"@emotion/server": "^11.4.0",
|
|
21
21
|
"@emotion/styled": "^11.9.3",
|
|
22
|
-
"@graphcommerce/framer-next-pages": "3.
|
|
23
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
24
|
-
"@graphcommerce/framer-utils": "3.
|
|
25
|
-
"@graphcommerce/image": "3.1.
|
|
22
|
+
"@graphcommerce/framer-next-pages": "3.3.0",
|
|
23
|
+
"@graphcommerce/framer-scroller": "2.1.35",
|
|
24
|
+
"@graphcommerce/framer-utils": "3.2.0",
|
|
25
|
+
"@graphcommerce/image": "3.1.9",
|
|
26
26
|
"cookie": "^0.5.0",
|
|
27
27
|
"react-is": "^18.2.0",
|
|
28
28
|
"schema-dts": "^1.1.0"
|