@graphcommerce/next-ui 6.2.0-canary.80 → 6.2.0-canary.82
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 +4 -4
- package/ActionCard/ActionCardLayout.tsx +6 -6
- package/CHANGELOG.md +14 -0
- package/LayoutOverlay/components/LayoutOverlayHeader.tsx +2 -1
- package/TextInputNumber/TextInputNumber.tsx +49 -30
- package/Theme/MuiButton.ts +1 -1
- package/Theme/MuiFab.ts +15 -1
- package/package.json +8 -8
|
@@ -141,6 +141,7 @@ export function ActionCard(props: ActionCardProps) {
|
|
|
141
141
|
},
|
|
142
142
|
|
|
143
143
|
'&.variantDefault': {
|
|
144
|
+
position: 'relative',
|
|
144
145
|
'&::after': {
|
|
145
146
|
content: '""',
|
|
146
147
|
position: 'absolute',
|
|
@@ -163,21 +164,21 @@ export function ActionCard(props: ActionCardProps) {
|
|
|
163
164
|
)}`,
|
|
164
165
|
},
|
|
165
166
|
|
|
166
|
-
'&.
|
|
167
|
+
'&.sizeSmall': {
|
|
167
168
|
mt: { xs: '2px', sm: '3px', md: '5px' },
|
|
168
169
|
mb: { xs: '3px', sm: '4px', md: '6px' },
|
|
169
170
|
'&::after': {
|
|
170
171
|
mb: { xs: '-2px', sm: '-3px', md: '-5px' },
|
|
171
172
|
},
|
|
172
173
|
},
|
|
173
|
-
'&.
|
|
174
|
+
'&.sizeMedium': {
|
|
174
175
|
mt: { xs: '4px', sm: '5px', md: '6px' },
|
|
175
176
|
mb: { xs: '5px', sm: '6px', md: '7px' },
|
|
176
177
|
'&::after': {
|
|
177
178
|
mb: { xs: '-4px', sm: '-5px', md: '-6px' },
|
|
178
179
|
},
|
|
179
180
|
},
|
|
180
|
-
'&.
|
|
181
|
+
'&.sizeLarge': {
|
|
181
182
|
mt: { xs: '5px', sm: '7px', md: '8px' },
|
|
182
183
|
mb: { xs: '6px', sm: '8px', md: '9px' },
|
|
183
184
|
'&::after': {
|
|
@@ -288,7 +289,6 @@ export function ActionCard(props: ActionCardProps) {
|
|
|
288
289
|
<Box
|
|
289
290
|
sx={{
|
|
290
291
|
display: 'flex',
|
|
291
|
-
justifyContent: 'center',
|
|
292
292
|
flexDirection: 'column',
|
|
293
293
|
alignItems: 'flex-start',
|
|
294
294
|
}}
|
|
@@ -3,10 +3,10 @@ import React from 'react'
|
|
|
3
3
|
import { extendableComponent } from '../Styles'
|
|
4
4
|
import { ActionCardProps } from './ActionCard'
|
|
5
5
|
|
|
6
|
-
type ActionCardLayoutProps = {
|
|
6
|
+
export type ActionCardLayoutProps = {
|
|
7
7
|
children?: React.ReactNode
|
|
8
8
|
} & Pick<ActionCardProps, 'layout'> &
|
|
9
|
-
BoxProps
|
|
9
|
+
Pick<BoxProps, 'sx' | 'className'>
|
|
10
10
|
|
|
11
11
|
const parts = ['root'] as const
|
|
12
12
|
const name = 'ActionCardLayout'
|
|
@@ -18,15 +18,15 @@ const { withState } = extendableComponent<
|
|
|
18
18
|
|
|
19
19
|
export const ActionCardLayout = React.forwardRef<HTMLDivElement, ActionCardLayoutProps>(
|
|
20
20
|
(props, ref) => {
|
|
21
|
-
const { layout = 'list' } = props
|
|
21
|
+
const { layout = 'list', sx, className = '', ...boxProps } = props
|
|
22
22
|
|
|
23
23
|
const classes = withState({ layout })
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
26
|
<Box
|
|
27
27
|
ref={ref}
|
|
28
|
-
{...
|
|
29
|
-
className={classes.root}
|
|
28
|
+
{...boxProps}
|
|
29
|
+
className={`${classes.root} ${className}`}
|
|
30
30
|
sx={[
|
|
31
31
|
(theme) => ({
|
|
32
32
|
'&.layoutStack': {
|
|
@@ -50,7 +50,7 @@ export const ActionCardLayout = React.forwardRef<HTMLDivElement, ActionCardLayou
|
|
|
50
50
|
gap: theme.spacings.xxs,
|
|
51
51
|
},
|
|
52
52
|
}),
|
|
53
|
-
...(Array.isArray(
|
|
53
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
54
54
|
]}
|
|
55
55
|
/>
|
|
56
56
|
)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.82
|
|
4
|
+
|
|
5
|
+
## 6.2.0-canary.81
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- [#2003](https://github.com/graphcommerce-org/graphcommerce/pull/2003) [`609b384de`](https://github.com/graphcommerce-org/graphcommerce/commit/609b384de8cded7a9dd2f29bd516ded810ab970a) - Created a new version of the cart using ActionCards for each CartItem. Different types of CartItems can have different ActionCards. These ActionCards will be overridden with the use of Plugins. An example can be found in the @graphcommerce/magento-product-configurable package. ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2003](https://github.com/graphcommerce-org/graphcommerce/pull/2003) [`e9041802b`](https://github.com/graphcommerce-org/graphcommerce/commit/e9041802b27d6610cc93715ca61acff7f59792e6) - When the switchPoint is zero, make sure the header doesn’t flash when scrolling up on iOS ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
14
|
+
|
|
15
|
+
- [#2003](https://github.com/graphcommerce-org/graphcommerce/pull/2003) [`e81a9722b`](https://github.com/graphcommerce-org/graphcommerce/commit/e81a9722b5f581dacb624246c14d74aafbf55893) - Make sure the className is forwarded for ActionCardLayout ([@Jessevdpoel](https://github.com/Jessevdpoel))
|
|
16
|
+
|
|
3
17
|
## 6.2.0-canary.80
|
|
4
18
|
|
|
5
19
|
## 6.2.0-canary.79
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { LayoutHeaderProps, LayoutHeader } from '../../Layout'
|
|
2
2
|
|
|
3
3
|
export function LayoutOverlayHeader(props: LayoutHeaderProps) {
|
|
4
|
-
const { sx } = props
|
|
4
|
+
const { sx, switchPoint } = props
|
|
5
5
|
return (
|
|
6
6
|
<LayoutHeader
|
|
7
7
|
{...props}
|
|
8
8
|
noAlign
|
|
9
|
+
switchPoint={switchPoint !== 0 ? switchPoint : -1000}
|
|
9
10
|
sx={[
|
|
10
11
|
(theme) => ({
|
|
11
12
|
[theme.breakpoints.down('md')]: {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core'
|
|
2
2
|
import {
|
|
3
|
-
IconButton,
|
|
4
3
|
IconButtonProps,
|
|
5
4
|
SxProps,
|
|
5
|
+
Box,
|
|
6
6
|
TextField,
|
|
7
7
|
TextFieldProps,
|
|
8
8
|
useForkRef,
|
|
9
9
|
Theme,
|
|
10
|
+
Fab,
|
|
10
11
|
} from '@mui/material'
|
|
11
12
|
import { ChangeEvent, Ref, useCallback, useEffect, useRef, useState } from 'react'
|
|
12
13
|
import { IconSvg } from '../IconSvg'
|
|
@@ -36,6 +37,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
36
37
|
UpProps = {},
|
|
37
38
|
inputProps = {},
|
|
38
39
|
inputRef,
|
|
40
|
+
variant = 'outlined',
|
|
39
41
|
sx = [],
|
|
40
42
|
...textFieldProps
|
|
41
43
|
} = props
|
|
@@ -91,11 +93,27 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
91
93
|
<TextField
|
|
92
94
|
{...textFieldProps}
|
|
93
95
|
type='number'
|
|
96
|
+
variant={variant}
|
|
94
97
|
inputRef={forkRef}
|
|
95
98
|
className={`${textFieldProps.className ?? ''} ${classes.quantity}`}
|
|
96
99
|
sx={[
|
|
97
100
|
{
|
|
98
|
-
width: responsiveVal(
|
|
101
|
+
width: responsiveVal(90, 120),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
'& .MuiOutlinedInput-root': {
|
|
105
|
+
px: '3px',
|
|
106
|
+
display: 'grid',
|
|
107
|
+
gridTemplateColumns: '1fr auto 1fr',
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
variant === 'standard' && {
|
|
111
|
+
'& .MuiOutlinedInput-input': {
|
|
112
|
+
padding: 0,
|
|
113
|
+
},
|
|
114
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
115
|
+
display: 'none',
|
|
116
|
+
},
|
|
99
117
|
},
|
|
100
118
|
...(Array.isArray(sx) ? sx : [sx]),
|
|
101
119
|
]}
|
|
@@ -103,36 +121,36 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
103
121
|
InputProps={{
|
|
104
122
|
...textFieldProps.InputProps,
|
|
105
123
|
startAdornment: (
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</
|
|
124
|
+
<Box>
|
|
125
|
+
<Fab
|
|
126
|
+
aria-label={i18n._(/* i18n */ 'Decrease')}
|
|
127
|
+
size='smaller'
|
|
128
|
+
sx={{ boxShadow: variant === 'standard' ? 4 : 0, minHeight: '30px' }}
|
|
129
|
+
onPointerDown={() => setDirection('down')}
|
|
130
|
+
onPointerUp={stop}
|
|
131
|
+
tabIndex={-1}
|
|
132
|
+
{...DownProps}
|
|
133
|
+
className={`${classes.button} ${DownProps.className ?? ''}`}
|
|
134
|
+
>
|
|
135
|
+
{DownProps.children ?? <IconSvg src={iconMin} size='small' />}
|
|
136
|
+
</Fab>
|
|
137
|
+
</Box>
|
|
120
138
|
),
|
|
121
139
|
endAdornment: (
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
</
|
|
140
|
+
<Box>
|
|
141
|
+
<Fab
|
|
142
|
+
aria-label={i18n._(/* i18n */ 'Increase')}
|
|
143
|
+
size='smaller'
|
|
144
|
+
sx={{ boxShadow: variant === 'standard' ? 4 : 0, minHeight: '30px' }}
|
|
145
|
+
onPointerDown={() => setDirection('up')}
|
|
146
|
+
onPointerUp={() => setDirection(null)}
|
|
147
|
+
tabIndex={-1}
|
|
148
|
+
{...UpProps}
|
|
149
|
+
className={`${classes.button} ${UpProps.className ?? ''}`}
|
|
150
|
+
>
|
|
151
|
+
{UpProps.children ?? <IconSvg src={iconPlus} size='small' />}
|
|
152
|
+
</Fab>
|
|
153
|
+
</Box>
|
|
136
154
|
),
|
|
137
155
|
}}
|
|
138
156
|
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
|
@@ -144,6 +162,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
|
|
|
144
162
|
'aria-label': i18n._(/* i18n */ 'Number'),
|
|
145
163
|
sx: [
|
|
146
164
|
{
|
|
165
|
+
typography: 'body1',
|
|
147
166
|
textAlign: 'center',
|
|
148
167
|
'&::-webkit-inner-spin-button,&::-webkit-outer-spin-button': {
|
|
149
168
|
appearance: 'none',
|
package/Theme/MuiButton.ts
CHANGED
|
@@ -161,7 +161,7 @@ export const MuiButtonInline: ButtonVariants = [
|
|
|
161
161
|
{
|
|
162
162
|
props: { variant: 'inline', size: 'small' },
|
|
163
163
|
style: ({ theme }) => ({
|
|
164
|
-
margin: `calc(${theme.spacings.xxs}
|
|
164
|
+
margin: `calc(${theme.spacings.xxs} * -1 )`,
|
|
165
165
|
padding: '3px 9px',
|
|
166
166
|
|
|
167
167
|
'& .MuiLoadingButton-loadingIndicatorEnd': { right: 3 },
|
package/Theme/MuiFab.ts
CHANGED
|
@@ -25,9 +25,12 @@ const defaultSizes: FabSizes = {
|
|
|
25
25
|
* Default values picked from MUI:
|
|
26
26
|
* https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Fab/Fab.js
|
|
27
27
|
*/
|
|
28
|
+
smaller: '30px',
|
|
28
29
|
small: '40px',
|
|
29
30
|
medium: '48px',
|
|
30
31
|
large: '54px',
|
|
32
|
+
responsiveSmall: responsiveVal(30, 40),
|
|
33
|
+
responsiveMedium: responsiveVal(36, 48),
|
|
31
34
|
responsive: responsiveVal(40, 54),
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -43,6 +46,9 @@ export const useFabSize = (size: FabSize) => {
|
|
|
43
46
|
declare module '@mui/material/Fab/Fab' {
|
|
44
47
|
interface FabPropsSizeOverrides {
|
|
45
48
|
responsive: true
|
|
49
|
+
responsiveSmall: true
|
|
50
|
+
responsiveMedium: true
|
|
51
|
+
smaller: true
|
|
46
52
|
}
|
|
47
53
|
// todo: Wait for the color prop to be exendable and then add inverted
|
|
48
54
|
// https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Fab/Fab.js#L193-L202
|
|
@@ -60,7 +66,15 @@ function fabWidthHeight(size: FabSize, theme: Theme) {
|
|
|
60
66
|
|
|
61
67
|
type FabVariants = NonNullable<ComponentsVariants['MuiFab']>
|
|
62
68
|
|
|
63
|
-
const sizes: FabSize[] = [
|
|
69
|
+
const sizes: FabSize[] = [
|
|
70
|
+
'smaller',
|
|
71
|
+
'small',
|
|
72
|
+
'medium',
|
|
73
|
+
'large',
|
|
74
|
+
'responsive',
|
|
75
|
+
'responsiveSmall',
|
|
76
|
+
'responsiveMedium',
|
|
77
|
+
]
|
|
64
78
|
|
|
65
79
|
/**
|
|
66
80
|
* This defines the sizes for the added responsive variant.
|
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": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.82",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"@emotion/react": "^11.11.1",
|
|
19
19
|
"@emotion/server": "^11.11.0",
|
|
20
20
|
"@emotion/styled": "^11.11.0",
|
|
21
|
-
"@graphcommerce/framer-next-pages": "6.2.0-canary.
|
|
22
|
-
"@graphcommerce/framer-scroller": "6.2.0-canary.
|
|
23
|
-
"@graphcommerce/framer-utils": "6.2.0-canary.
|
|
24
|
-
"@graphcommerce/image": "6.2.0-canary.
|
|
21
|
+
"@graphcommerce/framer-next-pages": "6.2.0-canary.82",
|
|
22
|
+
"@graphcommerce/framer-scroller": "6.2.0-canary.82",
|
|
23
|
+
"@graphcommerce/framer-utils": "6.2.0-canary.82",
|
|
24
|
+
"@graphcommerce/image": "6.2.0-canary.82",
|
|
25
25
|
"cookie": "^0.5.0",
|
|
26
26
|
"react-is": "^18.2.0",
|
|
27
27
|
"schema-dts": "^1.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
31
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
32
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
30
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.82",
|
|
31
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.82",
|
|
32
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.82",
|
|
33
33
|
"@types/cookie": "^0.5.1",
|
|
34
34
|
"@types/react-is": "^18.2.1",
|
|
35
35
|
"typescript": "5.1.3"
|