@graphcommerce/magento-product-configurable 10.0.0-canary.66 → 10.0.0-canary.68

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,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.68
4
+
5
+ ### Major Changes
6
+
7
+ - [#2557](https://github.com/graphcommerce-org/graphcommerce/pull/2557) [`ceaadd8`](https://github.com/graphcommerce-org/graphcommerce/commit/ceaadd87f0648982a068a3b07b1fa149c9127f49) - ## Material UI v5 → v7 Migration
8
+
9
+ This release upgrades Material UI from v5 to v7 with full CSS variables support. ([@paales](https://github.com/paales))
10
+
11
+ ## 10.0.0-canary.67
12
+
3
13
  ## 10.0.0-canary.66
4
14
 
5
15
  ## 10.0.0-canary.65
@@ -1,4 +1,4 @@
1
- import { extendableComponent } from '@graphcommerce/next-ui'
1
+ import { extendableComponent, sxx } from '@graphcommerce/next-ui'
2
2
  import type { SxProps, Theme } from '@mui/material'
3
3
  import { Box } from '@mui/material'
4
4
  import type { ConfigurableCartItemFragment } from './ConfigurableCartItem.gql'
@@ -18,15 +18,15 @@ export function OptionsList(props: CartItemOptionsListProps) {
18
18
  return (
19
19
  <Box
20
20
  className={classes.root}
21
- sx={[
21
+ sx={sxx(
22
22
  {
23
23
  gridArea: 'itemOptions',
24
24
  cursor: 'default',
25
25
  marginLeft: 0,
26
26
  paddingBottom: '4px',
27
27
  },
28
- ...(Array.isArray(sx) ? sx : [sx]),
29
- ]}
28
+ sx,
29
+ )}
30
30
  >
31
31
  {configurable_options &&
32
32
  configurable_options.map((option) => (
@@ -1,4 +1,4 @@
1
- import { extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
1
+ import { extendableComponent, responsiveVal, sxx } from '@graphcommerce/next-ui'
2
2
  import type { SxProps, Theme } from '@mui/material'
3
3
  import { Box } from '@mui/material'
4
4
  import type { ColorSwatchDataFragment } from './ColorSwatchData.gql'
@@ -23,19 +23,17 @@ export function ColorSwatchData(props: ColorSwatchDataProps) {
23
23
  <Box
24
24
  className={classes.color}
25
25
  style={{ backgroundColor: value ?? undefined }}
26
- sx={[
27
- {
28
- margin: '0 auto',
29
- height: responsiveVal(22, 30),
30
- width: responsiveVal(22, 30),
31
- borderRadius: '50%',
32
- '&.sizeSmall': {
33
- height: responsiveVal(8, 12),
34
- width: responsiveVal(8, 12),
35
- marginTop: responsiveVal(2, 4),
36
- },
26
+ sx={sxx({
27
+ margin: '0 auto',
28
+ height: responsiveVal(22, 30),
29
+ width: responsiveVal(22, 30),
30
+ borderRadius: '50%',
31
+ '&.sizeSmall': {
32
+ height: responsiveVal(8, 12),
33
+ width: responsiveVal(8, 12),
34
+ marginTop: responsiveVal(2, 4),
37
35
  },
38
- ]}
36
+ })}
39
37
  />
40
38
  {size !== 'small' && (
41
39
  <Box component='span' className={classes.label}>
@@ -1,5 +1,5 @@
1
1
  import { Image } from '@graphcommerce/image'
2
- import { extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
2
+ import { extendableComponent, responsiveVal, sxx } from '@graphcommerce/next-ui'
3
3
  import type { SxProps, Theme } from '@mui/material'
4
4
  import { Box } from '@mui/material'
5
5
  import type { ImageSwatchDataFragment } from './ImageSwatchData.gql'
@@ -20,12 +20,12 @@ export function ImageSwatchData(props: ImageSwatchDataProps) {
20
20
 
21
21
  return (
22
22
  <Box
23
- sx={[
23
+ sx={sxx(
24
24
  (theme) => ({
25
25
  '& .image': {
26
26
  height: responsiveVal(40, 80),
27
27
  width: responsiveVal(40, 80),
28
- border: `3px solid ${theme.palette.divider}`,
28
+ border: `3px solid ${theme.vars.palette.divider}`,
29
29
  boxSizing: 'border-box',
30
30
  borderRadius: '50%',
31
31
  objectFit: 'cover',
@@ -35,8 +35,8 @@ export function ImageSwatchData(props: ImageSwatchDataProps) {
35
35
  height: 20,
36
36
  },
37
37
  }),
38
- ...(Array.isArray(sx) ? sx : [sx]),
39
- ]}
38
+ sx,
39
+ )}
40
40
  >
41
41
  {thumbnail ? (
42
42
  <Image
@@ -1,5 +1,5 @@
1
1
  import { Money } from '@graphcommerce/magento-store'
2
- import { extendableComponent } from '@graphcommerce/next-ui'
2
+ import { extendableComponent, sxx } from '@graphcommerce/next-ui'
3
3
  import type { SxProps, Theme } from '@mui/material'
4
4
  import { Box } from '@mui/material'
5
5
  import type { TextSwatchDataFragment } from './TextSwatchData.gql'
@@ -18,10 +18,7 @@ export function TextSwatchData(props: TextSwatchDataProps) {
18
18
  const classes = withState({ size })
19
19
 
20
20
  return (
21
- <Box
22
- className={classes.root}
23
- sx={[{ width: '100%', height: '100%' }, ...(Array.isArray(sx) ? sx : [sx])]}
24
- >
21
+ <Box className={classes.root} sx={sxx({ width: '100%', height: '100%' }, sx)}>
25
22
  {size !== 'small' ? (
26
23
  <>
27
24
  <Box
@@ -2,7 +2,7 @@ import type { ActionCardItemBase } from '@graphcommerce/ecommerce-ui'
2
2
  import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
3
3
  import type { AddProductsToCartFields } from '@graphcommerce/magento-product/components'
4
4
  import { useFormAddProductsToCart } from '@graphcommerce/magento-product/components'
5
- import { filterNonNullableKeys, nonNullable, SectionHeader } from '@graphcommerce/next-ui'
5
+ import { filterNonNullableKeys, nonNullable, SectionHeader, sxx } from '@graphcommerce/next-ui'
6
6
  import { useWatch } from '@graphcommerce/react-hook-form'
7
7
  import { t } from '@lingui/core/macro'
8
8
  import type { SxProps, Theme } from '@mui/material'
@@ -77,13 +77,12 @@ export function ConfigurableProductOption(props: ConfigurableProductOptionProps)
77
77
  if (!values) return null
78
78
 
79
79
  return (
80
- <Box key={fieldName} sx={[...(Array.isArray(sx) ? sx : [sx])]}>
80
+ <Box key={fieldName} sx={sx}>
81
81
  <SectionHeader
82
82
  labelLeft={optionStartLabels?.[attribute_code ?? ''] ?? label}
83
83
  labelRight={optionEndLabels?.[attribute_code ?? '']}
84
84
  sx={{ mt: 0 }}
85
85
  />
86
-
87
86
  <ActionCardListForm<
88
87
  ActionCardItemBase & ConfigurableOptionValueFragment,
89
88
  AddProductsToCartFields
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-product-configurable",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.66",
5
+ "version": "10.0.0-canary.68",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,27 +12,27 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^10.0.0-canary.66",
16
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.66",
17
- "@graphcommerce/graphql": "^10.0.0-canary.66",
18
- "@graphcommerce/graphql-mesh": "^10.0.0-canary.66",
19
- "@graphcommerce/image": "^10.0.0-canary.66",
20
- "@graphcommerce/lingui-next": "10.0.0-canary.66",
21
- "@graphcommerce/magento-cart": "^10.0.0-canary.66",
22
- "@graphcommerce/magento-cart-items": "^10.0.0-canary.66",
23
- "@graphcommerce/magento-category": "^10.0.0-canary.66",
24
- "@graphcommerce/magento-customer": "^10.0.0-canary.66",
25
- "@graphcommerce/magento-product": "^10.0.0-canary.66",
26
- "@graphcommerce/magento-product-simple": "^10.0.0-canary.66",
27
- "@graphcommerce/magento-store": "^10.0.0-canary.66",
28
- "@graphcommerce/next-ui": "^10.0.0-canary.66",
29
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.66",
30
- "@graphcommerce/react-hook-form": "^10.0.0-canary.66",
31
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.66",
15
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.68",
16
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.68",
17
+ "@graphcommerce/graphql": "^10.0.0-canary.68",
18
+ "@graphcommerce/graphql-mesh": "^10.0.0-canary.68",
19
+ "@graphcommerce/image": "^10.0.0-canary.68",
20
+ "@graphcommerce/lingui-next": "10.0.0-canary.68",
21
+ "@graphcommerce/magento-cart": "^10.0.0-canary.68",
22
+ "@graphcommerce/magento-cart-items": "^10.0.0-canary.68",
23
+ "@graphcommerce/magento-category": "^10.0.0-canary.68",
24
+ "@graphcommerce/magento-customer": "^10.0.0-canary.68",
25
+ "@graphcommerce/magento-product": "^10.0.0-canary.68",
26
+ "@graphcommerce/magento-product-simple": "^10.0.0-canary.68",
27
+ "@graphcommerce/magento-store": "^10.0.0-canary.68",
28
+ "@graphcommerce/next-ui": "^10.0.0-canary.68",
29
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.68",
30
+ "@graphcommerce/react-hook-form": "^10.0.0-canary.68",
31
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.68",
32
32
  "@lingui/core": "^5",
33
33
  "@lingui/macro": "^5",
34
34
  "@lingui/react": "^5",
35
- "@mui/material": "^5.10.16",
35
+ "@mui/material": "^7.0.0",
36
36
  "framer-motion": "^11.0.0",
37
37
  "next": "*",
38
38
  "react": "^19.2.0",
@@ -20,7 +20,7 @@ export function ProductPageDescription(
20
20
  if (product.__typename !== 'ConfigurableProduct') {
21
21
  return <Prev product={product} index={index} {...rest} />
22
22
  }
23
-
23
+
24
24
  return (
25
25
  <Prev
26
26
  product={{
@@ -4,8 +4,8 @@ import type {
4
4
  ProductPageJsonLdProps,
5
5
  } from '@graphcommerce/magento-product'
6
6
  import type { PluginConfig, PluginProps } from '@graphcommerce/next-config'
7
- import { useConfigurableSelectedVariant } from '../../hooks'
8
7
  import { isTypename } from '@graphcommerce/next-ui'
8
+ import { useConfigurableSelectedVariant } from '../../hooks'
9
9
 
10
10
  export const config: PluginConfig = {
11
11
  type: 'component',
@@ -21,7 +21,6 @@ export function ProductPageMeta(props: PluginProps<ProductPageMetaProps> & AddTo
21
21
  const isValidVariant = (variant?.url_rewrites ?? []).length > 0 && variant?.url_key
22
22
  const targetUrl = isValidVariant ? productLink(variant) : productLink(product)
23
23
 
24
-
25
24
  useEffect(() => {
26
25
  if (product.__typename !== 'ConfigurableProduct') return
27
26
  // Filter asPath with #, for zoomed gallery