@graphcommerce/ecommerce-ui 10.0.0-canary.67 → 10.0.0-canary.72
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/CHANGELOG.md +24 -0
- package/components/ApolloError/ApolloErrorAlert.tsx +45 -42
- package/components/ApolloError/ApolloErrorFullPage.tsx +8 -4
- package/components/ApolloError/ApolloErrorSnackbar.tsx +9 -4
- package/components/ApolloError/maskNetworkError.tsx +6 -15
- package/components/FormComponents/CheckboxButtonGroup.tsx +10 -1
- package/components/FormComponents/CheckboxElement.tsx +2 -4
- package/components/FormComponents/MultiSelectElement.tsx +10 -5
- package/components/FormComponents/NumberFieldElement.tsx +88 -76
- package/components/FormComponents/RadioButtonGroup.tsx +19 -6
- package/components/FormComponents/TextFieldElement.tsx +13 -10
- package/components/PreviewMode/LightTooltip.tsx +2 -2
- package/components/WaitForQueries/WaitForQueries.tsx +2 -2
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @graphcommerce/ecommerce-ui
|
|
2
2
|
|
|
3
|
+
## 10.0.0-canary.72
|
|
4
|
+
|
|
5
|
+
## 10.0.0-canary.71
|
|
6
|
+
|
|
7
|
+
## 10.0.0-canary.70
|
|
8
|
+
|
|
9
|
+
### Major Changes
|
|
10
|
+
|
|
11
|
+
- [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
|
|
12
|
+
|
|
13
|
+
## 10.0.0-canary.69
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#2567](https://github.com/graphcommerce-org/graphcommerce/pull/2567) [`0af3466`](https://github.com/graphcommerce-org/graphcommerce/commit/0af34663f882ad9906dc13ae6c835c158598b945) - Fix NumberFieldElement plus button decreasing the number instead of increasing ([@paales](https://github.com/paales))
|
|
18
|
+
|
|
19
|
+
## 10.0.0-canary.68
|
|
20
|
+
|
|
21
|
+
### Major Changes
|
|
22
|
+
|
|
23
|
+
- [#2557](https://github.com/graphcommerce-org/graphcommerce/pull/2557) [`ceaadd8`](https://github.com/graphcommerce-org/graphcommerce/commit/ceaadd87f0648982a068a3b07b1fa149c9127f49) - ## Material UI v5 → v7 Migration
|
|
24
|
+
|
|
25
|
+
This release upgrades Material UI from v5 to v7 with full CSS variables support. ([@paales](https://github.com/paales))
|
|
26
|
+
|
|
3
27
|
## 10.0.0-canary.67
|
|
4
28
|
|
|
5
29
|
## 10.0.0-canary.66
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ApolloError } from '@graphcommerce/graphql'
|
|
2
1
|
import { extendableComponent } from '@graphcommerce/next-ui/Styles/extendableComponent'
|
|
2
|
+
import type { ErrorLike } from '@apollo/client'
|
|
3
|
+
import { CombinedGraphQLErrors } from '@apollo/client/errors'
|
|
3
4
|
import type { AlertProps, SxProps, Theme } from '@mui/material'
|
|
4
5
|
import { Alert, Box } from '@mui/material'
|
|
5
6
|
import { maskNetworkError } from './maskNetworkError'
|
|
@@ -7,7 +8,7 @@ import { maskNetworkError } from './maskNetworkError'
|
|
|
7
8
|
const { classes, selectors } = extendableComponent('ApolloErrorAlert', ['root', 'alert'] as const)
|
|
8
9
|
|
|
9
10
|
export type ApolloErrorAlertProps = {
|
|
10
|
-
error?:
|
|
11
|
+
error?: ErrorLike | null
|
|
11
12
|
graphqlErrorAlertProps?: Omit<AlertProps, 'severity'>
|
|
12
13
|
networkErrorAlertProps?: Omit<AlertProps, 'severity'>
|
|
13
14
|
sx?: SxProps<Theme>
|
|
@@ -15,48 +16,50 @@ export type ApolloErrorAlertProps = {
|
|
|
15
16
|
export function ApolloErrorAlert(props: ApolloErrorAlertProps) {
|
|
16
17
|
const { error, graphqlErrorAlertProps, networkErrorAlertProps, sx } = props
|
|
17
18
|
|
|
19
|
+
if (!error) return null
|
|
20
|
+
|
|
21
|
+
// Check if this is a CombinedGraphQLErrors
|
|
22
|
+
const isGraphQLError = CombinedGraphQLErrors.is(error)
|
|
23
|
+
const graphQLErrors = isGraphQLError ? error.errors : []
|
|
24
|
+
|
|
18
25
|
return (
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</Alert>
|
|
53
|
-
</Box>
|
|
54
|
-
</Box>
|
|
55
|
-
)}
|
|
26
|
+
<Box key='alerts'>
|
|
27
|
+
<Box sx={sx} className={classes.root}>
|
|
28
|
+
{graphQLErrors.map((e, index) => (
|
|
29
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
30
|
+
<Box key={index}>
|
|
31
|
+
<div className={classes.alert}>
|
|
32
|
+
<Alert
|
|
33
|
+
severity='error'
|
|
34
|
+
{...graphqlErrorAlertProps}
|
|
35
|
+
sx={(theme) => ({
|
|
36
|
+
borderRadius: theme.shape.borderRadius * 1,
|
|
37
|
+
marginTop: 0.5,
|
|
38
|
+
})}
|
|
39
|
+
>
|
|
40
|
+
{e.message}
|
|
41
|
+
</Alert>
|
|
42
|
+
</div>
|
|
43
|
+
</Box>
|
|
44
|
+
))}
|
|
45
|
+
{!isGraphQLError && error && (
|
|
46
|
+
<Box key='networkError'>
|
|
47
|
+
<Box
|
|
48
|
+
sx={(theme) => ({
|
|
49
|
+
paddingTop: theme.spacings.xxs,
|
|
50
|
+
paddingBottom: theme.spacings.xxs,
|
|
51
|
+
})}
|
|
52
|
+
className={classes.alert}
|
|
53
|
+
key='networkError'
|
|
54
|
+
>
|
|
55
|
+
<Alert severity='error' {...networkErrorAlertProps}>
|
|
56
|
+
{maskNetworkError(error)}
|
|
57
|
+
</Alert>
|
|
58
|
+
</Box>
|
|
56
59
|
</Box>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
)}
|
|
61
|
+
</Box>
|
|
62
|
+
</Box>
|
|
60
63
|
)
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { ApolloError } from '@graphcommerce/graphql'
|
|
2
1
|
import type { FullPageMessageProps } from '@graphcommerce/next-ui'
|
|
3
2
|
import { FullPageMessage } from '@graphcommerce/next-ui'
|
|
3
|
+
import type { ErrorLike } from '@apollo/client'
|
|
4
|
+
import { CombinedGraphQLErrors } from '@apollo/client/errors'
|
|
4
5
|
import { Trans } from '@lingui/react/macro'
|
|
5
6
|
import type { AlertProps } from '@mui/material'
|
|
6
7
|
import { ApolloErrorAlert } from './ApolloErrorAlert'
|
|
7
8
|
import { maskNetworkError } from './maskNetworkError'
|
|
8
9
|
|
|
9
10
|
export type ApolloErrorFullPageProps = {
|
|
10
|
-
error:
|
|
11
|
+
error: ErrorLike
|
|
11
12
|
graphqlErrorAlertProps?: Omit<AlertProps, 'severity'>
|
|
12
13
|
networkErrorAlertProps?: Omit<AlertProps, 'severity'>
|
|
13
14
|
} & Omit<FullPageMessageProps, 'title' | 'description'>
|
|
@@ -21,14 +22,17 @@ export function ApolloErrorFullPage(props: ApolloErrorFullPageProps) {
|
|
|
21
22
|
...fullPageMessageProps
|
|
22
23
|
} = props
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
// Check if this is a CombinedGraphQLErrors
|
|
26
|
+
const isGraphQLError = CombinedGraphQLErrors.is(error)
|
|
27
|
+
const graphQLErrors = isGraphQLError ? error.errors : []
|
|
28
|
+
const errorCount = graphQLErrors.length + (isGraphQLError ? 0 : 1)
|
|
25
29
|
|
|
26
30
|
if (errorCount === 0) return null
|
|
27
31
|
|
|
28
32
|
if (errorCount === 1) {
|
|
29
33
|
return (
|
|
30
34
|
<FullPageMessage
|
|
31
|
-
title={
|
|
35
|
+
title={graphQLErrors[0]?.message ?? maskNetworkError(error)}
|
|
32
36
|
{...fullPageMessageProps}
|
|
33
37
|
>
|
|
34
38
|
{children}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { ApolloError } from '@graphcommerce/graphql'
|
|
2
1
|
import type { ErrorSnackbarProps } from '@graphcommerce/next-ui'
|
|
3
2
|
import { ErrorSnackbar } from '@graphcommerce/next-ui'
|
|
3
|
+
import type { ErrorLike } from '@apollo/client'
|
|
4
|
+
import { CombinedGraphQLErrors } from '@apollo/client/errors'
|
|
4
5
|
import { maskNetworkError } from './maskNetworkError'
|
|
5
6
|
|
|
6
7
|
export type ApolloErrorSnackbarProps = {
|
|
7
|
-
error?:
|
|
8
|
+
error?: ErrorLike | null
|
|
8
9
|
} & Pick<ErrorSnackbarProps, 'action' | 'onClose'>
|
|
9
10
|
|
|
10
11
|
export function ApolloErrorSnackbar(props: ApolloErrorSnackbarProps) {
|
|
@@ -12,11 +13,15 @@ export function ApolloErrorSnackbar(props: ApolloErrorSnackbarProps) {
|
|
|
12
13
|
|
|
13
14
|
if (!error) return null
|
|
14
15
|
|
|
16
|
+
// Check if this is a CombinedGraphQLErrors
|
|
17
|
+
const isGraphQLError = CombinedGraphQLErrors.is(error)
|
|
18
|
+
const graphQLErrors = isGraphQLError ? error.errors : []
|
|
19
|
+
|
|
15
20
|
return (
|
|
16
21
|
<ErrorSnackbar variant='pill' severity='error' {...passedProps} open={!!error}>
|
|
17
22
|
<>
|
|
18
|
-
{
|
|
19
|
-
{maskNetworkError(error
|
|
23
|
+
{graphQLErrors.map((e) => e.message).join(', ')}
|
|
24
|
+
{!isGraphQLError && maskNetworkError(error)}
|
|
20
25
|
</>
|
|
21
26
|
</ErrorSnackbar>
|
|
22
27
|
)
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ErrorLike } from '@apollo/client'
|
|
2
|
+
import { ServerError, ServerParseError } from '@apollo/client/errors'
|
|
2
3
|
import { Trans } from '@lingui/react/macro'
|
|
3
4
|
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
function isServerParseError(
|
|
9
|
-
error: Error | ServerParseError | ServerError | null,
|
|
10
|
-
): error is ServerParseError {
|
|
11
|
-
return 'bodyText' in (error as ServerParseError)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function maskNetworkError(networkError: Error | ServerParseError | ServerError | null) {
|
|
15
|
-
if (!networkError) return null
|
|
5
|
+
export function maskNetworkError(error: ErrorLike | null) {
|
|
6
|
+
if (!error) return null
|
|
16
7
|
|
|
17
8
|
if (process.env.NODE_ENV === 'development') {
|
|
18
|
-
console.log(
|
|
9
|
+
console.log(error)
|
|
19
10
|
}
|
|
20
11
|
|
|
21
|
-
if (
|
|
12
|
+
if (ServerParseError.is(error) || ServerError.is(error)) {
|
|
22
13
|
return <Trans>Something went wrong on the server, please try again later.</Trans>
|
|
23
14
|
}
|
|
24
15
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { FieldValues } from '@graphcommerce/react-hook-form'
|
|
2
3
|
import { useController } from '@graphcommerce/react-hook-form'
|
|
3
4
|
import { t } from '@lingui/core/macro'
|
|
@@ -95,7 +96,15 @@ function CheckboxButtonGroupBase(props: CheckboxButtonGroupProps) {
|
|
|
95
96
|
<FormControlLabel
|
|
96
97
|
control={
|
|
97
98
|
<Checkbox
|
|
98
|
-
sx={
|
|
99
|
+
sx={sxx(
|
|
100
|
+
invalid
|
|
101
|
+
? {
|
|
102
|
+
color: theme.vars.palette.error.main,
|
|
103
|
+
}
|
|
104
|
+
: {
|
|
105
|
+
color: null,
|
|
106
|
+
},
|
|
107
|
+
)}
|
|
99
108
|
color={checkboxColor || 'primary'}
|
|
100
109
|
value={optionKey}
|
|
101
110
|
checked={isChecked}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { FieldValues } from '@graphcommerce/react-hook-form'
|
|
2
3
|
import { useController } from '@graphcommerce/react-hook-form'
|
|
3
4
|
import { t } from '@lingui/core/macro'
|
|
@@ -76,10 +77,7 @@ function CheckboxElementBase(props: CheckboxElementProps): React.ReactNode {
|
|
|
76
77
|
name={name}
|
|
77
78
|
inputRef={useForkRef(ref, rest.inputRef)}
|
|
78
79
|
color={rest.color || 'primary'}
|
|
79
|
-
sx={{
|
|
80
|
-
...(Array.isArray(sx) ? sx : [sx]),
|
|
81
|
-
color: invalid ? 'error.main' : undefined,
|
|
82
|
-
}}
|
|
80
|
+
sx={sxx(sx, invalid && { color: 'error.main' })}
|
|
83
81
|
value={value}
|
|
84
82
|
checked={!!value}
|
|
85
83
|
onChange={() => onChange(!value)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-nested-ternary */
|
|
2
|
-
import { iconClose, IconSvg } from '@graphcommerce/next-ui'
|
|
2
|
+
import { iconClose, IconSvg, sxx } from '@graphcommerce/next-ui'
|
|
3
3
|
import type { ControllerProps, FieldValues } from '@graphcommerce/react-hook-form'
|
|
4
4
|
import { useController } from '@graphcommerce/react-hook-form'
|
|
5
5
|
import { t } from '@lingui/core/macro'
|
|
@@ -153,10 +153,15 @@ export function MultiSelectElement<TFieldValues extends FieldValues>(
|
|
|
153
153
|
<MenuItem
|
|
154
154
|
key={val}
|
|
155
155
|
value={val}
|
|
156
|
-
sx={
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
sx={sxx(
|
|
157
|
+
isChecked
|
|
158
|
+
? {
|
|
159
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
160
|
+
}
|
|
161
|
+
: {
|
|
162
|
+
fontWeight: theme.typography.fontWeightRegular,
|
|
163
|
+
},
|
|
164
|
+
)}
|
|
160
165
|
>
|
|
161
166
|
{showCheckbox && <Checkbox checked={isChecked} />}
|
|
162
167
|
<ListItemText primary={item[itemLabel] || item} />
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
iconPlus,
|
|
5
5
|
IconSvg,
|
|
6
6
|
responsiveVal,
|
|
7
|
+
sxx,
|
|
7
8
|
} from '@graphcommerce/next-ui'
|
|
8
9
|
import type { FieldValues } from '@graphcommerce/react-hook-form'
|
|
9
10
|
import { useController } from '@graphcommerce/react-hook-form'
|
|
@@ -104,14 +105,10 @@ function NumberFieldElementBase(props: NumberFieldElementProps) {
|
|
|
104
105
|
size={size}
|
|
105
106
|
type='number'
|
|
106
107
|
className={`${rest.className ?? ''} ${classes.quantity}`}
|
|
107
|
-
sx={
|
|
108
|
+
sx={sxx(
|
|
108
109
|
{
|
|
109
110
|
width: responsiveVal(90, 120),
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
'& input[type=number]': {
|
|
113
|
-
MozAppearance: 'textfield',
|
|
114
|
-
},
|
|
111
|
+
'& input[type=number]': { MozAppearance: 'textfield' },
|
|
115
112
|
'& .MuiOutlinedInput-root': {
|
|
116
113
|
px: '2px',
|
|
117
114
|
display: 'grid',
|
|
@@ -119,78 +116,93 @@ function NumberFieldElementBase(props: NumberFieldElementProps) {
|
|
|
119
116
|
},
|
|
120
117
|
},
|
|
121
118
|
variant === 'standard' && {
|
|
122
|
-
'& .MuiOutlinedInput-input': {
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
'& .MuiOutlinedInput-notchedOutline': {
|
|
126
|
-
display: 'none',
|
|
127
|
-
},
|
|
119
|
+
'& .MuiOutlinedInput-input': { padding: 0 },
|
|
120
|
+
'& .MuiOutlinedInput-notchedOutline': { display: 'none' },
|
|
128
121
|
},
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
sx,
|
|
123
|
+
)}
|
|
131
124
|
autoComplete='off'
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
125
|
+
slotProps={{
|
|
126
|
+
input: {
|
|
127
|
+
...InputPropsFiltered,
|
|
128
|
+
startAdornment: (
|
|
129
|
+
<Fab
|
|
130
|
+
aria-label={t`Decrease`}
|
|
131
|
+
size='smaller'
|
|
132
|
+
onClick={() => {
|
|
133
|
+
if (
|
|
134
|
+
(valueAsNumber ?? Infinity) <= inputProps.min ||
|
|
135
|
+
(inputProps.min === 0 && valueAsNumber <= inputProps.min)
|
|
136
|
+
)
|
|
137
|
+
return
|
|
138
|
+
// Round to nearest step with precision fix
|
|
139
|
+
const newValue = roundToPrecision(Math.round((valueAsNumber - step) / step) * step)
|
|
140
|
+
onChange(newValue)
|
|
141
|
+
}}
|
|
142
|
+
sx={sxx(
|
|
143
|
+
{
|
|
144
|
+
minHeight: '30px',
|
|
145
|
+
minWidth: '30px',
|
|
146
|
+
},
|
|
147
|
+
variant === 'standard'
|
|
148
|
+
? {
|
|
149
|
+
boxShadow: 4,
|
|
150
|
+
}
|
|
151
|
+
: {
|
|
152
|
+
boxShadow: 0,
|
|
153
|
+
},
|
|
154
|
+
)}
|
|
155
|
+
tabIndex={-1}
|
|
156
|
+
color='inherit'
|
|
157
|
+
{...DownProps}
|
|
158
|
+
className={`${classes.button} ${DownProps.className ?? ''}`}
|
|
159
|
+
>
|
|
160
|
+
{DownProps.children ?? <IconSvg src={iconMin} size='small' />}
|
|
161
|
+
</Fab>
|
|
162
|
+
),
|
|
163
|
+
endAdornment: (
|
|
164
|
+
<Fab
|
|
165
|
+
aria-label={t`Increase`}
|
|
166
|
+
size='smaller'
|
|
167
|
+
onClick={() => {
|
|
168
|
+
if (valueAsNumber >= (inputProps.max ?? Infinity)) return
|
|
169
|
+
// Round to nearest step with precision fix
|
|
170
|
+
const newValue = roundToPrecision(Math.round((valueAsNumber + step) / step) * step)
|
|
171
|
+
onChange(newValue)
|
|
172
|
+
}}
|
|
173
|
+
sx={sxx(
|
|
174
|
+
{
|
|
175
|
+
minHeight: '30px',
|
|
176
|
+
minWidth: '30px',
|
|
177
|
+
},
|
|
178
|
+
variant === 'standard'
|
|
179
|
+
? {
|
|
180
|
+
boxShadow: 4,
|
|
181
|
+
}
|
|
182
|
+
: {
|
|
183
|
+
boxShadow: 0,
|
|
184
|
+
},
|
|
185
|
+
)}
|
|
186
|
+
tabIndex={-1}
|
|
187
|
+
color='inherit'
|
|
188
|
+
{...UpProps}
|
|
189
|
+
className={`${classes.button} ${UpProps.className ?? ''}`}
|
|
190
|
+
>
|
|
191
|
+
{UpProps.children ?? <IconSvg src={iconPlus} size='small' />}
|
|
192
|
+
</Fab>
|
|
193
|
+
),
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
htmlInput: {
|
|
197
|
+
'aria-label': t`Number`,
|
|
198
|
+
...inputProps,
|
|
199
|
+
className: `${inputProps?.className ?? ''} ${classes.quantityInput}`,
|
|
200
|
+
sx: {
|
|
201
|
+
typography: 'body1',
|
|
202
|
+
textAlign: 'center',
|
|
203
|
+
'&::-webkit-inner-spin-button,&::-webkit-outer-spin-button': {
|
|
204
|
+
appearance: 'none',
|
|
205
|
+
},
|
|
194
206
|
},
|
|
195
207
|
},
|
|
196
208
|
}}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { FieldValues } from '@graphcommerce/react-hook-form'
|
|
2
3
|
import { useController } from '@graphcommerce/react-hook-form'
|
|
3
4
|
import { t } from '@lingui/core/macro'
|
|
@@ -90,9 +91,15 @@ function RadioButtonGroupBase(props: RadioButtonGroupProps): React.ReactNode {
|
|
|
90
91
|
<FormControlLabel
|
|
91
92
|
control={
|
|
92
93
|
<Radio
|
|
93
|
-
sx={
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
sx={sxx(
|
|
95
|
+
invalid
|
|
96
|
+
? {
|
|
97
|
+
color: theme.vars.palette.error.main,
|
|
98
|
+
}
|
|
99
|
+
: {
|
|
100
|
+
color: null,
|
|
101
|
+
},
|
|
102
|
+
)}
|
|
96
103
|
checked={!value}
|
|
97
104
|
/>
|
|
98
105
|
}
|
|
@@ -107,9 +114,15 @@ function RadioButtonGroupBase(props: RadioButtonGroupProps): React.ReactNode {
|
|
|
107
114
|
control={
|
|
108
115
|
<Radio
|
|
109
116
|
disabled={disabled}
|
|
110
|
-
sx={
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
sx={sxx(
|
|
118
|
+
invalid
|
|
119
|
+
? {
|
|
120
|
+
color: theme.vars.palette.error.main,
|
|
121
|
+
}
|
|
122
|
+
: {
|
|
123
|
+
color: null,
|
|
124
|
+
},
|
|
125
|
+
)}
|
|
113
126
|
checked={value === optionKey}
|
|
114
127
|
/>
|
|
115
128
|
}
|
|
@@ -100,7 +100,6 @@ function TextFieldElementBase(props: TextFieldElementProps): React.ReactNode {
|
|
|
100
100
|
onBlur={onBlur}
|
|
101
101
|
name={name}
|
|
102
102
|
value={toValue(value, type)}
|
|
103
|
-
inputProps={{ ...rest.inputProps, onAnimationStart }}
|
|
104
103
|
onChange={(ev) => {
|
|
105
104
|
let changeValue: string | number | Date = ev.target.value
|
|
106
105
|
|
|
@@ -126,15 +125,19 @@ function TextFieldElementBase(props: TextFieldElementProps): React.ReactNode {
|
|
|
126
125
|
type={type}
|
|
127
126
|
error={Boolean(error) || rest.error}
|
|
128
127
|
helperText={error ? error.message : rest.helperText}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
slotProps={{
|
|
129
|
+
input: {
|
|
130
|
+
...rest.InputProps,
|
|
131
|
+
endAdornment:
|
|
132
|
+
showValid && Boolean(value) && !error ? (
|
|
133
|
+
<InputCheckmark show={!error} />
|
|
134
|
+
) : (
|
|
135
|
+
rest.InputProps?.endAdornment
|
|
136
|
+
),
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
htmlInput: { ...rest.inputProps, onAnimationStart },
|
|
140
|
+
inputLabel: { ...rest.InputLabelProps, shrink },
|
|
138
141
|
}}
|
|
139
142
|
/>
|
|
140
143
|
)
|
|
@@ -4,8 +4,8 @@ export const LightTooltip = styled<typeof Tooltip>(({ className, ...props }) =>
|
|
|
4
4
|
<Tooltip {...props} classes={{ popper: className }} />
|
|
5
5
|
))(({ theme }) => ({
|
|
6
6
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
7
|
-
backgroundColor: theme.palette.common.white,
|
|
8
|
-
color: theme.palette.text.primary,
|
|
7
|
+
backgroundColor: theme.vars.palette.common.white,
|
|
8
|
+
color: theme.vars.palette.text.primary,
|
|
9
9
|
boxShadow: theme.shadows[1],
|
|
10
10
|
},
|
|
11
11
|
}))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApolloClient, useQuery } from '@graphcommerce/graphql'
|
|
2
2
|
import { useIsSSR } from '@graphcommerce/next-ui'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
5
|
export type WaitForQueriesProps = {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
-
waitFor:
|
|
7
|
+
waitFor: useQuery.Result<any, any> | boolean | (useQuery.Result<any, any> | boolean)[] | undefined
|
|
8
8
|
children: React.ReactNode
|
|
9
9
|
fallback?: React.ReactNode
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/ecommerce-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.72",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
16
|
-
"@graphcommerce/graphql": "^10.0.0-canary.
|
|
17
|
-
"@graphcommerce/next-ui": "^10.0.0-canary.
|
|
18
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
19
|
-
"@graphcommerce/react-hook-form": "^10.0.0-canary.
|
|
20
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.72",
|
|
16
|
+
"@graphcommerce/graphql": "^10.0.0-canary.72",
|
|
17
|
+
"@graphcommerce/next-ui": "^10.0.0-canary.72",
|
|
18
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.72",
|
|
19
|
+
"@graphcommerce/react-hook-form": "^10.0.0-canary.72",
|
|
20
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.72",
|
|
21
21
|
"@lingui/core": "^5",
|
|
22
22
|
"@lingui/macro": "^5",
|
|
23
23
|
"@lingui/react": "^5",
|
|
24
|
-
"@mui/material": "^
|
|
24
|
+
"@mui/material": "^7.0.0",
|
|
25
25
|
"framer-motion": "^11.0.0",
|
|
26
26
|
"next": "*",
|
|
27
27
|
"react": "^19.2.0",
|