@graphcommerce/magento-product 4.0.6 → 4.1.0

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05) Thanks [@paales](https://github.com/paales)! - Added `<Slider size='large' />` and made styling with variants
8
+
9
+ * [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`e4ded94d7`](https://github.com/graphcommerce-org/graphcommerce/commit/e4ded94d7b0f0c87f86abcd31340d75533bde73e) Thanks [@paales](https://github.com/paales)! - Added a fontSize property to the ProductPageDescription to change the fontSize for the rendered paragraph
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`bc8826b9d`](https://github.com/graphcommerce-org/graphcommerce/commit/bc8826b9dc1e6418b2720c9211e46791c33fca8a) Thanks [@paales](https://github.com/paales)! - ProductListFiltersContainer button alignment
14
+
15
+ * [#1322](https://github.com/graphcommerce-org/graphcommerce/pull/1322) [`7e910f3b8`](https://github.com/graphcommerce-org/graphcommerce/commit/7e910f3b8eb73cff33261956937124f95520d8e5) Thanks [@paales](https://github.com/paales)! - Allow overwriting ProductListLink underline
16
+
17
+ * Updated dependencies [[`5266388ea`](https://github.com/graphcommerce-org/graphcommerce/commit/5266388eaffda41592623ef7a3ddbbe03c8e0dad), [`9b35403d9`](https://github.com/graphcommerce-org/graphcommerce/commit/9b35403d9dbb2606ac7cf3bb641a0f9cc3d8a2ba), [`0298a0de1`](https://github.com/graphcommerce-org/graphcommerce/commit/0298a0de1d13e543c4124a6a099297b4e27e2b05), [`815132ea4`](https://github.com/graphcommerce-org/graphcommerce/commit/815132ea43937b4b84b59ec9974ac593cb4eb456), [`3326742a0`](https://github.com/graphcommerce-org/graphcommerce/commit/3326742a0dceb45f0cac4741ca09dc4d4f09ad90), [`7a3799bfc`](https://github.com/graphcommerce-org/graphcommerce/commit/7a3799bfc107f26aa9991a91db5f228e3476f4aa), [`9a77f88ed`](https://github.com/graphcommerce-org/graphcommerce/commit/9a77f88ed26cbecdae9a135c3cb234a5b7ecf4df), [`1e2a07141`](https://github.com/graphcommerce-org/graphcommerce/commit/1e2a071414154600430e6dcf0513d86ab78e0b28), [`0eeaad304`](https://github.com/graphcommerce-org/graphcommerce/commit/0eeaad30461b1d5b486438f0287fa76d49429044), [`bc5213547`](https://github.com/graphcommerce-org/graphcommerce/commit/bc52135471479c83d989449dad24798112e898f4), [`3f1912f55`](https://github.com/graphcommerce-org/graphcommerce/commit/3f1912f553318d5888f8af2b841918ef4ae96a84), [`d91359871`](https://github.com/graphcommerce-org/graphcommerce/commit/d91359871b023a9f0d305b37353c1ee2d0912248), [`b6c68cda8`](https://github.com/graphcommerce-org/graphcommerce/commit/b6c68cda8836a1d0c78ef351899cec9ec1037385)]:
18
+ - @graphcommerce/next-ui@4.3.0
19
+ - @graphcommerce/magento-store@4.1.3
20
+ - @graphcommerce/magento-cart@4.2.0
21
+ - @graphcommerce/framer-scroller@2.1.0
22
+
3
23
  ## 4.0.6
4
24
 
5
25
  ### Patch Changes
@@ -8,7 +8,8 @@ import { FilterIn } from './FilterEqualType'
8
8
  import { ProductListFiltersFragment } from './ProductListFilters.gql'
9
9
 
10
10
  type Filter = NonNullable<NonNullable<ProductListFiltersFragment['aggregations']>[number]>
11
- export type FilterCheckboxTypeProps = Filter & Omit<ChipProps, 'selected'> & { sx?: SxProps<Theme> }
11
+ export type FilterCheckboxTypeProps = Filter &
12
+ Omit<ChipProps<'button'>, 'selected' | 'onDelete' | 'component'> & { sx?: SxProps<Theme> }
12
13
 
13
14
  export function FilterCheckboxType(props: FilterCheckboxTypeProps) {
14
15
  const { attribute_code, count, label, options, ...chipProps } = props
@@ -32,7 +33,8 @@ export function FilterCheckboxType(props: FilterCheckboxTypeProps) {
32
33
  link={{ scroll: false, replace: true }}
33
34
  >
34
35
  <Chip
35
- color={isActive ? undefined : 'default'}
36
+ component='button'
37
+ color={isActive ? 'primary' : 'default'}
36
38
  onDelete={
37
39
  isActive
38
40
  ? () => {
@@ -1,6 +1,7 @@
1
1
  import { cloneDeep, FilterRangeTypeInput } from '@graphcommerce/graphql'
2
2
  import { Money } from '@graphcommerce/magento-store'
3
3
  import { ChipMenu, ChipMenuProps, extendableComponent } from '@graphcommerce/next-ui'
4
+ import { Trans } from '@lingui/macro'
4
5
  import { Box, Slider } from '@mui/material'
5
6
  import React, { useEffect } from 'react'
6
7
  import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
@@ -12,8 +13,6 @@ type FilterRangeTypeProps = NonNullable<
12
13
  > &
13
14
  Omit<ChipMenuProps, 'selected'>
14
15
 
15
- const sliderThumbWidth = 28
16
-
17
16
  const { classes } = extendableComponent('FilterRangeType', ['root', 'container', 'slider'] as const)
18
17
 
19
18
  export function FilterRangeType(props: FilterRangeTypeProps) {
@@ -79,16 +78,16 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
79
78
 
80
79
  if (from === min && to !== max)
81
80
  currentLabel = (
82
- <>
83
- {'Below '} <Money round value={Number(currentFilter?.to)} />
84
- </>
81
+ <Trans>
82
+ Below <Money round value={Number(currentFilter?.to)} />
83
+ </Trans>
85
84
  )
86
85
 
87
86
  if (from !== min && to === max)
88
87
  currentLabel = (
89
- <>
90
- {'Above '} <Money round value={Number(currentFilter?.from)} />
91
- </>
88
+ <Trans>
89
+ Above <Money round value={Number(currentFilter?.from)} />
90
+ </Trans>
92
91
  )
93
92
 
94
93
  if (from !== min && to !== max)
@@ -128,6 +127,7 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
128
127
  <Slider
129
128
  min={min}
130
129
  max={max}
130
+ size='large'
131
131
  aria-labelledby='range-slider'
132
132
  value={value}
133
133
  onChange={(e, newValue) => {
@@ -142,23 +142,6 @@ export function FilterRangeType(props: FilterRangeTypeProps) {
142
142
  }}
143
143
  valueLabelDisplay='off'
144
144
  className={classes.slider}
145
- sx={(theme) => ({
146
- maxWidth: `calc(100% - ${sliderThumbWidth}px)`,
147
- margin: `${theme.spacings.xxs} auto`,
148
- display: 'block',
149
- paddingBottom: '32px',
150
- '& .MuiSlider-rail': {
151
- height: 4,
152
- borderRadius: '10px',
153
- },
154
- '& .MuiSlider-track': {
155
- height: 4,
156
- },
157
- '& .MuiSlider-thumb': {
158
- width: sliderThumbWidth,
159
- height: sliderThumbWidth,
160
- },
161
- })}
162
145
  />
163
146
  </Box>
164
147
  </ChipMenu>
@@ -87,7 +87,6 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
87
87
  (theme) => ({
88
88
  display: 'flex',
89
89
  justifyContent: 'center',
90
- height: responsiveVal(44, 52),
91
90
  marginBottom: theme.spacings.sm,
92
91
  position: 'sticky',
93
92
  top: theme.page.vertical,
@@ -108,7 +107,7 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
108
107
  direction='left'
109
108
  className={classes.sliderPrev}
110
109
  size='small'
111
- sx={{ position: 'absolute', top: 2, left: 2, zIndex: 10 }}
110
+ sx={{ position: 'absolute', top: 4, left: 2, zIndex: 10 }}
112
111
  >
113
112
  <IconSvg src={iconChevronLeft} />
114
113
  </ScrollerButton>
@@ -124,6 +123,8 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
124
123
  background: theme.palette.background.default,
125
124
  borderRadius: '99em',
126
125
  },
126
+ display: 'grid',
127
+ alignItems: 'center',
127
128
  })}
128
129
  >
129
130
  <Scroller
@@ -166,7 +167,7 @@ export function ProductListFiltersContainer(props: ProductListFiltersContainerPr
166
167
  direction='right'
167
168
  className={classes.sliderNext}
168
169
  size='small'
169
- sx={{ position: 'absolute', top: 2, right: 2, zIndex: 10 }}
170
+ sx={{ position: 'absolute', top: 4, right: 2, zIndex: 10 }}
170
171
  >
171
172
  <IconSvg src={iconChevronRight} />
172
173
  </ScrollerButton>
@@ -43,7 +43,7 @@ export const ProductListLink = React.forwardRef<HTMLAnchorElement, ProductListLi
43
43
  {noLink ? (
44
44
  children
45
45
  ) : (
46
- <Link rel={rel} {...linkProps} ref={ref} onClick={updateParams} underline='hover'>
46
+ <Link rel={rel} underline='hover' {...linkProps} ref={ref} onClick={updateParams}>
47
47
  {children}
48
48
  </Link>
49
49
  )}
@@ -2,17 +2,25 @@ import {
2
2
  ColumnTwoWithTop,
3
3
  ColumnTwoWithTopProps,
4
4
  extendableComponent,
5
+ responsiveVal,
5
6
  } from '@graphcommerce/next-ui'
6
7
  import { Box, SxProps, Theme, Typography } from '@mui/material'
8
+ import { Variant } from '@mui/material/styles/createTypography'
7
9
  import { ProductPageDescriptionFragment } from './ProductPageDescription.gql'
8
10
 
9
11
  export type ProductPageDescriptionProps = ProductPageDescriptionFragment &
10
- Omit<ColumnTwoWithTopProps, 'top' | 'left'> & { sx?: SxProps<Theme> }
12
+ Omit<ColumnTwoWithTopProps, 'top' | 'left'> & {
13
+ sx?: SxProps<Theme>
14
+ fontSize: 'responsive' | Variant
15
+ }
11
16
 
12
- const { classes } = extendableComponent('ProductPageDescription', ['root', 'description'] as const)
17
+ const componentName = 'ProductPageDescription'
18
+ const parts = ['root', 'description'] as const
19
+
20
+ const { classes } = extendableComponent(componentName, parts)
13
21
 
14
22
  export function ProductPageDescription(props: ProductPageDescriptionProps) {
15
- const { description, name, right, sx = [] } = props
23
+ const { description, name, right, fontSize = 'subtitle1', sx = [] } = props
16
24
 
17
25
  return (
18
26
  <ColumnTwoWithTop
@@ -29,31 +37,32 @@ export function ProductPageDescription(props: ProductPageDescriptionProps) {
29
37
  className={classes.description}
30
38
  // eslint-disable-next-line react/no-danger
31
39
  dangerouslySetInnerHTML={{ __html: description.html }}
32
- sx={(theme) => ({
33
- '& p:first-of-type': {
34
- marginTop: 0,
35
- },
36
- '& p, & li': {
37
- typography: 'body1',
38
- fontWeight: 400,
39
- [theme.breakpoints.up('md')]: {
40
- typography: 'h3',
41
- fontWeight: 400,
42
- '@supports (font-variation-settings: normal)': {
43
- fontVariationSettings: "'wght' 420",
44
- },
40
+ sx={[
41
+ {
42
+ '& p:first-of-type': {
43
+ marginTop: 0,
44
+ },
45
+ '& ul': {
46
+ padding: 0,
47
+ margin: 0,
48
+ display: 'inline',
49
+ listStyleType: 'none',
50
+ },
51
+ '& li': {
52
+ display: 'inline',
45
53
  },
46
54
  },
47
- '& ul': {
48
- padding: 0,
49
- margin: 0,
50
- display: 'inline',
51
- listStyleType: 'none',
55
+ fontSize === 'responsive' && {
56
+ '& p, & li': {
57
+ fontSize: responsiveVal(16, 30),
58
+ },
52
59
  },
53
- '& li': {
54
- display: 'inline',
60
+ fontSize !== 'responsive' && {
61
+ '& p, & li': {
62
+ fontSize,
63
+ },
55
64
  },
56
- })}
65
+ ]}
57
66
  />
58
67
  )
59
68
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-product",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.0.6",
5
+ "version": "4.1.0",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -18,12 +18,12 @@
18
18
  "@playwright/test": "^1.19.2"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/framer-scroller": "^2.0.6",
21
+ "@graphcommerce/framer-scroller": "^2.1.0",
22
22
  "@graphcommerce/graphql": "^3.0.4",
23
23
  "@graphcommerce/image": "^3.1.1",
24
- "@graphcommerce/magento-cart": "^4.1.4",
25
- "@graphcommerce/magento-store": "^4.1.2",
26
- "@graphcommerce/next-ui": "^4.2.4",
24
+ "@graphcommerce/magento-cart": "^4.2.0",
25
+ "@graphcommerce/magento-store": "^4.1.3",
26
+ "@graphcommerce/next-ui": "^4.3.0",
27
27
  "schema-dts": "^1.1.0",
28
28
  "type-fest": "^2.12.0"
29
29
  },