@graphcommerce/magento-product 3.3.0 → 3.4.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/CHANGELOG.md +37 -0
- package/components/ProductList/ProductList.graphql +1 -1
- package/components/ProductListCount/index.tsx +1 -1
- package/components/ProductListFilters/FilterCheckboxType.tsx +7 -6
- package/components/ProductListFilters/FilterEqualType.tsx +29 -2
- package/components/ProductListFilters/FilterRangeType.tsx +2 -2
- package/components/ProductListFiltersContainer/index.tsx +8 -4
- package/components/ProductListItems/ProductListItemsBase.tsx +11 -3
- package/components/ProductListPrice/index.tsx +1 -1
- package/components/ProductPageDescription/index.tsx +3 -1
- package/components/ProductSidebarDelivery/index.tsx +15 -9
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.4.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-product@3.4.0...@graphcommerce/magento-product@3.4.1) (2021-10-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* External SVG's can't have alt tags ([1b1414a](https://github.com/ho-nl/m2-pwa/commit/1b1414a782d55d3acf7b0e6bcaa50f2ad5f18f39))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.4.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-product@3.3.2...@graphcommerce/magento-product@3.4.0) (2021-10-28)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* bug causing filter chips missing bottom border on drag ([04f5695](https://github.com/ho-nl/m2-pwa/commit/04f56959d8cdc078c7af70fecadd9cb74ee55ebc))
|
|
23
|
+
* manual styling for productpage description since unique ([7989214](https://github.com/ho-nl/m2-pwa/commit/79892147f547de67537737ca19fda002c16497a6))
|
|
24
|
+
* only show active borders for color filters ([fc136ae](https://github.com/ho-nl/m2-pwa/commit/fc136aef13deae758ed2d70cf6508a2e925304d0))
|
|
25
|
+
* only show dash when relevant ([77ee56f](https://github.com/ho-nl/m2-pwa/commit/77ee56f44cc39447d2e778530da11c5408e6e5b8))
|
|
26
|
+
* update SvgImage to SvgImageSimple ([f116543](https://github.com/ho-nl/m2-pwa/commit/f116543730853fa9782abff0ccacee7032e85789))
|
|
27
|
+
* use font from theme ([7c11eb0](https://github.com/ho-nl/m2-pwa/commit/7c11eb000aecbe3a0a12fd579011c51c9da4f4ed))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* cleaner delivery banner ([a275773](https://github.com/ho-nl/m2-pwa/commit/a275773fce305324cd20df30125d1f86ebf796f6))
|
|
33
|
+
* color swatches ([886145f](https://github.com/ho-nl/m2-pwa/commit/886145fdaa14fc92e364d7e9d3a7ed019d594c86))
|
|
34
|
+
* dynamic icons, update SvgImage uses to SvgImageSimple ([3d3cc0e](https://github.com/ho-nl/m2-pwa/commit/3d3cc0e0336fcde1cce6ba19705f82c1edf9bfc6))
|
|
35
|
+
* enable use of both small and medium chips in design ([4536f96](https://github.com/ho-nl/m2-pwa/commit/4536f96b031734a71faf7c10f94aa5d5da90b9a8))
|
|
36
|
+
* full width category pages ([5f5c264](https://github.com/ho-nl/m2-pwa/commit/5f5c26487e7264fdbbf38ca51c7c453c7f5b6a17))
|
|
37
|
+
* Larger category page size for more realistic shop experience ([47f0cd5](https://github.com/ho-nl/m2-pwa/commit/47f0cd5424bec9a1b15e450bb6f7a47caaed41fc))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
# [3.3.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-product@3.2.6...@graphcommerce/magento-product@3.3.0) (2021-10-27)
|
|
7
44
|
|
|
8
45
|
|
|
@@ -29,7 +29,7 @@ const useStyles = makeStyles(
|
|
|
29
29
|
background: theme.palette.background.default,
|
|
30
30
|
display: 'inline-block',
|
|
31
31
|
padding: `0 ${theme.spacings.xs} 0 ${theme.spacings.xs}`,
|
|
32
|
-
color: theme.palette.
|
|
32
|
+
color: theme.palette.text.disabled,
|
|
33
33
|
transform: 'translateY(calc(-50% - 1px))',
|
|
34
34
|
},
|
|
35
35
|
}),
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { cloneDeep } from '@apollo/client/utilities'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
useChipMenuStyles,
|
|
4
|
+
SvgImage,
|
|
5
|
+
iconCloseCircle,
|
|
6
|
+
SvgImageSimple,
|
|
7
|
+
} from '@graphcommerce/next-ui'
|
|
3
8
|
import { Chip, ChipProps } from '@material-ui/core'
|
|
4
9
|
import clsx from 'clsx'
|
|
5
10
|
import React from 'react'
|
|
@@ -51,11 +56,7 @@ export default function FilterCheckboxType(props: FilterCheckboxTypeProps) {
|
|
|
51
56
|
}
|
|
52
57
|
: undefined
|
|
53
58
|
}
|
|
54
|
-
deleteIcon={
|
|
55
|
-
isActive ? (
|
|
56
|
-
<SvgImage src={iconCloseCircle} alt='remove' size='small' loading='eager' />
|
|
57
|
-
) : undefined
|
|
58
|
-
}
|
|
59
|
+
deleteIcon={isActive ? <SvgImageSimple src={iconCloseCircle} size='small' /> : undefined}
|
|
59
60
|
label={label}
|
|
60
61
|
clickable
|
|
61
62
|
{...chipProps}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
makeStyles,
|
|
10
10
|
Theme,
|
|
11
11
|
} from '@material-ui/core'
|
|
12
|
+
import clsx from 'clsx'
|
|
12
13
|
import React from 'react'
|
|
13
14
|
import { SetRequired } from 'type-fest'
|
|
14
15
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
|
@@ -78,6 +79,16 @@ const useFilterEqualStyles = makeStyles(
|
|
|
78
79
|
overflow: 'hidden',
|
|
79
80
|
whiteSpace: 'break-spaces',
|
|
80
81
|
},
|
|
82
|
+
isColor: {
|
|
83
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
84
|
+
'& > *': {
|
|
85
|
+
opacity: 0,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
isActive: {
|
|
89
|
+
border: `1px solid ${theme.palette.primary.main}`,
|
|
90
|
+
boxShadow: `inset 0 0 0 4px #fff`,
|
|
91
|
+
},
|
|
81
92
|
}),
|
|
82
93
|
{ name: 'FilterEqual' },
|
|
83
94
|
)
|
|
@@ -121,6 +132,11 @@ export default function FilterEqualType(props: FilterEqualTypeProps) {
|
|
|
121
132
|
if (!option?.value) return null
|
|
122
133
|
const labelId = `filter-equal-${attribute_code}-${option?.value}`
|
|
123
134
|
const filters = cloneDeep(params.filters)
|
|
135
|
+
let isColor = false
|
|
136
|
+
|
|
137
|
+
if (label?.toLowerCase().includes('color')) {
|
|
138
|
+
isColor = true
|
|
139
|
+
}
|
|
124
140
|
|
|
125
141
|
if (currentFilter.in?.includes(option.value)) {
|
|
126
142
|
filters[attribute_code] = {
|
|
@@ -155,11 +171,22 @@ export default function FilterEqualType(props: FilterEqualTypeProps) {
|
|
|
155
171
|
edge='start'
|
|
156
172
|
checked={currentFilter.in?.includes(option?.value ?? '')}
|
|
157
173
|
tabIndex={-1}
|
|
158
|
-
size='
|
|
174
|
+
size='medium'
|
|
159
175
|
color='primary'
|
|
160
176
|
disableRipple
|
|
161
177
|
inputProps={{ 'aria-labelledby': labelId }}
|
|
162
|
-
className={
|
|
178
|
+
className={clsx(
|
|
179
|
+
classes.checkbox,
|
|
180
|
+
isColor && classes.isColor,
|
|
181
|
+
currentFilter.in?.includes(option?.value) && isColor
|
|
182
|
+
? classes.isActive
|
|
183
|
+
: false,
|
|
184
|
+
)}
|
|
185
|
+
style={
|
|
186
|
+
isColor
|
|
187
|
+
? { background: `${option?.label}`, color: `${option?.label}` }
|
|
188
|
+
: undefined
|
|
189
|
+
}
|
|
163
190
|
/>
|
|
164
191
|
</ListItemSecondaryAction>
|
|
165
192
|
</div>
|
|
@@ -26,7 +26,7 @@ const useFilterRangeType = makeStyles(
|
|
|
26
26
|
display: 'block',
|
|
27
27
|
paddingBottom: 32,
|
|
28
28
|
'& .MuiSlider-rail': {
|
|
29
|
-
color: theme.palette.
|
|
29
|
+
color: theme.palette.text.disabled,
|
|
30
30
|
height: 4,
|
|
31
31
|
borderRadius: 10,
|
|
32
32
|
},
|
|
@@ -144,7 +144,7 @@ export default function FilterRangeType(props: FilterRangeTypeProps) {
|
|
|
144
144
|
labelRight={
|
|
145
145
|
<>
|
|
146
146
|
<Money round value={value[0]} />
|
|
147
|
-
{' — '}
|
|
147
|
+
{value[0] ? ' — ' : false}
|
|
148
148
|
<Money round value={value[1]} />
|
|
149
149
|
</>
|
|
150
150
|
}
|
|
@@ -2,6 +2,7 @@ import { Scroller, ScrollerButton, ScrollerProvider } from '@graphcommerce/frame
|
|
|
2
2
|
import {
|
|
3
3
|
iconChevronLeft,
|
|
4
4
|
iconChevronRight,
|
|
5
|
+
responsiveVal,
|
|
5
6
|
SvgImageSimple,
|
|
6
7
|
UseStyles,
|
|
7
8
|
} from '@graphcommerce/next-ui'
|
|
@@ -15,7 +16,7 @@ const useStyles = makeStyles(
|
|
|
15
16
|
wrapper: {
|
|
16
17
|
display: 'flex',
|
|
17
18
|
justifyContent: 'center',
|
|
18
|
-
height: 44,
|
|
19
|
+
height: responsiveVal(44, 52),
|
|
19
20
|
marginBottom: theme.spacings.sm,
|
|
20
21
|
position: 'sticky',
|
|
21
22
|
top: theme.page.vertical,
|
|
@@ -36,13 +37,16 @@ const useStyles = makeStyles(
|
|
|
36
37
|
padding: 6,
|
|
37
38
|
[theme.breakpoints.up('md')]: {
|
|
38
39
|
background: '#fff',
|
|
39
|
-
borderRadius:
|
|
40
|
-
|
|
40
|
+
borderRadius: '99em',
|
|
41
|
+
},
|
|
42
|
+
[theme.breakpoints.down('sm')]: {
|
|
43
|
+
boxShadow: 'none !important',
|
|
41
44
|
},
|
|
42
45
|
},
|
|
43
46
|
containerSticky: {},
|
|
44
47
|
scroller: {
|
|
45
|
-
|
|
48
|
+
paddingBottom: 1,
|
|
49
|
+
borderRadius: '99em',
|
|
46
50
|
columnGap: 6,
|
|
47
51
|
gridAutoColumns: 'min-content',
|
|
48
52
|
},
|
|
@@ -11,13 +11,21 @@ export const useStyles = makeStyles(
|
|
|
11
11
|
(theme: Theme) => ({
|
|
12
12
|
productList: {
|
|
13
13
|
display: 'grid',
|
|
14
|
-
gridColumnGap: theme.spacings.
|
|
14
|
+
gridColumnGap: theme.spacings.md,
|
|
15
15
|
gridRowGap: theme.spacings.md,
|
|
16
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${responsiveVal(150, 360)}, 1fr))`,
|
|
17
16
|
},
|
|
18
17
|
productListsmall: {
|
|
19
18
|
gridTemplateColumns: `repeat(auto-fill, minmax(${responsiveVal(150, 280)}, 1fr))`,
|
|
20
19
|
},
|
|
20
|
+
productListnormal: {
|
|
21
|
+
gridTemplateColumns: `repeat(2, 1fr)`,
|
|
22
|
+
[theme.breakpoints.up('md')]: {
|
|
23
|
+
gridTemplateColumns: `repeat(3, 1fr)`,
|
|
24
|
+
},
|
|
25
|
+
[theme.breakpoints.up('lg')]: {
|
|
26
|
+
gridTemplateColumns: `repeat(4, 1fr)`,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
21
29
|
}),
|
|
22
30
|
{ name: 'ProductList' },
|
|
23
31
|
)
|
|
@@ -34,7 +42,7 @@ export type ProductItemsGridProps = {
|
|
|
34
42
|
JSX.IntrinsicElements['div']
|
|
35
43
|
|
|
36
44
|
export default function ProductListItemsBase(props: ProductItemsGridProps) {
|
|
37
|
-
const { items, renderers, loadingEager = 0, size, ...divProps } = props
|
|
45
|
+
const { items, renderers, loadingEager = 0, size = 'normal', ...divProps } = props
|
|
38
46
|
const classes = useStyles(props)
|
|
39
47
|
|
|
40
48
|
return (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { responsiveVal } from '@graphcommerce/next-ui'
|
|
1
2
|
import { makeStyles, Theme } from '@material-ui/core'
|
|
2
3
|
import React from 'react'
|
|
3
4
|
import { ProductPageDescriptionFragment } from './ProductPageDescription.gql'
|
|
@@ -8,7 +9,8 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|
|
8
9
|
...theme.typography.h4,
|
|
9
10
|
fontWeight: 400,
|
|
10
11
|
[theme.breakpoints.up('md')]: {
|
|
11
|
-
|
|
12
|
+
fontSize: responsiveVal(18, 30),
|
|
13
|
+
lineHeight: 1.7,
|
|
12
14
|
fontWeight: 400,
|
|
13
15
|
},
|
|
14
16
|
'& p:first-of-type': {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SvgImage, responsiveVal, iconBox } from '@graphcommerce/next-ui'
|
|
1
|
+
import { SvgImage, responsiveVal, iconBox, SvgImageSimple } from '@graphcommerce/next-ui'
|
|
2
2
|
import { makeStyles, Theme, Typography } from '@material-ui/core'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
@@ -9,22 +9,28 @@ const useStyles = makeStyles(
|
|
|
9
9
|
alignItems: 'center',
|
|
10
10
|
gridTemplate: `
|
|
11
11
|
"image title"
|
|
12
|
-
"
|
|
12
|
+
". subtitle"
|
|
13
13
|
`,
|
|
14
14
|
gridTemplateColumns: `min-content auto`,
|
|
15
|
-
columnGap: theme.spacings.
|
|
16
|
-
marginTop: theme.spacings.
|
|
15
|
+
columnGap: theme.spacings.xxs,
|
|
16
|
+
marginTop: theme.spacings.xxs,
|
|
17
|
+
background: '#fff',
|
|
18
|
+
padding: theme.spacings.xxs,
|
|
19
|
+
borderRadius: responsiveVal(4, 6),
|
|
17
20
|
},
|
|
18
21
|
text: {},
|
|
19
22
|
image: {
|
|
20
23
|
gridArea: 'image',
|
|
24
|
+
width: responsiveVal(18, 24),
|
|
25
|
+
height: responsiveVal(18, 24),
|
|
21
26
|
},
|
|
22
27
|
title: {
|
|
23
28
|
gridArea: 'title',
|
|
29
|
+
fontWeight: 600,
|
|
24
30
|
},
|
|
25
31
|
subtitle: {
|
|
26
32
|
gridArea: 'subtitle',
|
|
27
|
-
color: theme.palette.
|
|
33
|
+
color: theme.palette.text.disabled,
|
|
28
34
|
},
|
|
29
35
|
}),
|
|
30
36
|
{ name: 'ProductSidebarDelivery' },
|
|
@@ -35,11 +41,11 @@ export default function ProductSidebarDelivery() {
|
|
|
35
41
|
|
|
36
42
|
return (
|
|
37
43
|
<div className={classes.root}>
|
|
38
|
-
<
|
|
39
|
-
<Typography className={classes.title} variant='
|
|
40
|
-
Order before 22:00
|
|
44
|
+
<SvgImageSimple className={classes.image} src={iconBox} />
|
|
45
|
+
<Typography className={classes.title} variant='body2' component='div'>
|
|
46
|
+
Order before 22:00
|
|
41
47
|
</Typography>
|
|
42
|
-
<Typography className={classes.subtitle} variant='body2' component='div'
|
|
48
|
+
<Typography className={classes.subtitle} variant='body2' component='div'>
|
|
43
49
|
Next day delivery - Shipping free
|
|
44
50
|
</Typography>
|
|
45
51
|
</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
6
6
|
"browserslist": [
|
|
@@ -14,29 +14,29 @@
|
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@graphcommerce/browserslist-config-pwa": "^3.0.2",
|
|
17
|
-
"@graphcommerce/eslint-config-pwa": "^3.1.
|
|
17
|
+
"@graphcommerce/eslint-config-pwa": "^3.1.2",
|
|
18
18
|
"@graphcommerce/prettier-config-pwa": "^3.0.3",
|
|
19
19
|
"@graphcommerce/typescript-config-pwa": "^3.1.1",
|
|
20
|
-
"@playwright/test": "^1.
|
|
20
|
+
"@playwright/test": "^1.16.2"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@apollo/client": "^3.4.16",
|
|
24
|
-
"@graphcommerce/framer-scroller": "^0.4.
|
|
25
|
-
"@graphcommerce/graphql": "^2.105.
|
|
26
|
-
"@graphcommerce/image": "^2.105.
|
|
27
|
-
"@graphcommerce/magento-cart": "^3.
|
|
28
|
-
"@graphcommerce/magento-store": "^3.1.
|
|
29
|
-
"@graphcommerce/next-ui": "^3.
|
|
24
|
+
"@graphcommerce/framer-scroller": "^0.4.1",
|
|
25
|
+
"@graphcommerce/graphql": "^2.105.1",
|
|
26
|
+
"@graphcommerce/image": "^2.105.1",
|
|
27
|
+
"@graphcommerce/magento-cart": "^3.4.1",
|
|
28
|
+
"@graphcommerce/magento-store": "^3.1.4",
|
|
29
|
+
"@graphcommerce/next-ui": "^3.11.1",
|
|
30
30
|
"@graphql-typed-document-node/core": "^3.1.0",
|
|
31
31
|
"@material-ui/core": "^4.12.3",
|
|
32
32
|
"@material-ui/lab": "^4.0.0-alpha.60",
|
|
33
33
|
"clsx": "^1.1.1",
|
|
34
34
|
"framer-motion": "^4.1.17",
|
|
35
|
-
"next": "^12.0.
|
|
35
|
+
"next": "^12.0.1",
|
|
36
36
|
"react": "^17.0.2",
|
|
37
37
|
"react-dom": "^17.0.2",
|
|
38
38
|
"schema-dts": "^1.0.0",
|
|
39
39
|
"type-fest": "^2.5.1"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "e01d10a0e89c68c316c3e4bb6a306e9a6959a7f6"
|
|
42
42
|
}
|