@graphcommerce/magento-product 9.0.0-canary.101 → 9.0.0-canary.103
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 +83 -1254
- package/components/AddProductsToCart/AddProductsToCartButton.tsx +4 -5
- package/components/AddProductsToCart/AddProductsToCartError.tsx +2 -1
- package/components/AddProductsToCart/AddProductsToCartFab.tsx +5 -6
- package/components/AddProductsToCart/AddProductsToCartForm.tsx +15 -19
- package/components/AddProductsToCart/AddProductsToCartQuantity.tsx +5 -3
- package/components/AddProductsToCart/AddProductsToCartSnackbar.tsx +2 -1
- package/components/AddProductsToCart/AddProductsToCartSnackbarMessage.tsx +3 -4
- package/components/AddProductsToCart/findAddedItems.ts +2 -2
- package/components/AddProductsToCart/toUserErrors.ts +2 -2
- package/components/AddProductsToCart/useAddProductsToCartAction.ts +4 -3
- package/components/AddProductsToCart/useFormAddProductsToCart.ts +2 -2
- package/components/JsonLdProduct/ProductPageJsonLd.tsx +1 -1
- package/components/JsonLdProduct/jsonLdProduct.tsx +2 -2
- package/components/ProductAddToCart/ProductAddToCart.tsx +6 -3
- package/components/ProductCustomizable/CustomizableAreaOption.tsx +4 -3
- package/components/ProductCustomizable/CustomizableCheckboxOption.tsx +3 -7
- package/components/ProductCustomizable/CustomizableDateOption.tsx +2 -2
- package/components/ProductCustomizable/CustomizableDropDownOption.tsx +5 -5
- package/components/ProductCustomizable/CustomizableFieldOption.tsx +2 -2
- package/components/ProductCustomizable/CustomizableMultipleOption.tsx +3 -7
- package/components/ProductCustomizable/CustomizableRadioOption.tsx +3 -7
- package/components/ProductCustomizable/ProductCustomizable.tsx +5 -4
- package/components/ProductFiltersPro/PriceSlider.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersPro.tsx +10 -19
- package/components/ProductFiltersPro/ProductFiltersProAggregations.tsx +2 -2
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx +5 -6
- package/components/ProductFiltersPro/ProductFiltersProAllFiltersSidebar.tsx +7 -12
- package/components/ProductFiltersPro/ProductFiltersProCategorySection.tsx +6 -8
- package/components/ProductFiltersPro/ProductFiltersProChips.tsx +1 -1
- package/components/ProductFiltersPro/ProductFiltersProClearAll.tsx +2 -2
- package/components/ProductFiltersPro/ProductFiltersProLayoutSidebar.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersProLimitChip.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersProLimitSection.tsx +3 -2
- package/components/ProductFiltersPro/ProductFiltersProNoResults.tsx +3 -2
- package/components/ProductFiltersPro/ProductFiltersProSortChip.tsx +4 -2
- package/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx +1 -1
- package/components/ProductFiltersPro/ProductFiltersProSortSection.tsx +3 -2
- package/components/ProductFiltersPro/activeAggregations.ts +2 -2
- package/components/ProductFiltersPro/applyAggregationCount.ts +2 -2
- package/components/ProductFiltersPro/useProductFiltersProClearAllAction.ts +1 -1
- package/components/ProductFiltersPro/useProductFiltersProSort.tsx +3 -3
- package/components/ProductListCount/ProductListCount.tsx +3 -2
- package/components/ProductListFilters/FilterCheckboxType.tsx +4 -3
- package/components/ProductListFilters/FilterEqualType.tsx +5 -4
- package/components/ProductListFilters/FilterRangeType.tsx +3 -2
- package/components/ProductListFilters/ProductListFilters.tsx +3 -3
- package/components/ProductListFiltersContainer/ProductListFiltersContainer.tsx +3 -2
- package/components/ProductListItem/ProductDiscountLabel.tsx +3 -2
- package/components/ProductListItem/ProductListItem.tsx +10 -15
- package/components/ProductListItem/ProductListItemImage.tsx +4 -2
- package/components/ProductListItem/ProductListItemImageContainer.tsx +7 -6
- package/components/ProductListItem/ProductListItemLinkOrDiv.tsx +2 -1
- package/components/ProductListItem/ProductListItemTitleAndPrice.tsx +4 -3
- package/components/ProductListItems/ProductListItemsBase.tsx +5 -4
- package/components/ProductListItems/ProductListParamsProvider.tsx +1 -1
- package/components/ProductListItems/filteredProductList.tsx +2 -2
- package/components/ProductListItems/getFilterTypes.ts +2 -1
- package/components/ProductListItems/productListApplyCategoryDefaults.ts +5 -4
- package/components/ProductListItems/renderer.tsx +2 -2
- package/components/ProductListLink/ProductListLink.tsx +5 -3
- package/components/ProductListPagination/ProductListPagination.tsx +5 -4
- package/components/ProductListPrice/ProductListPrice.tsx +3 -2
- package/components/ProductListSort/ProductListSort.tsx +7 -5
- package/components/ProductListSuggestions/ProductListSuggestions.tsx +1 -1
- package/components/ProductPage/ProductPageAddToCartRow.tsx +3 -2
- package/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx +3 -2
- package/components/ProductPageBreadcrumb/ProductPageBreadcrumbs.tsx +3 -3
- package/components/ProductPageCategory/productPageCategory.ts +1 -1
- package/components/ProductPageDescription/ProductPageDescription.tsx +5 -4
- package/components/ProductPageGallery/ProductImage.tsx +1 -1
- package/components/ProductPageGallery/ProductPageGallery.tsx +3 -7
- package/components/ProductPageGallery/ProductVideo.tsx +1 -1
- package/components/ProductPageMeta/ProductPageMeta.tsx +2 -2
- package/components/ProductPageName/ProductPageName.tsx +2 -2
- package/components/ProductPagePrice/ProductPagePrice.tsx +5 -6
- package/components/ProductPagePrice/ProductPagePriceTiers.tsx +2 -2
- package/components/ProductPagePrice/getProductTierPrice.ts +2 -2
- package/components/ProductPagePrice/useCustomizableOptionPrice.ts +6 -5
- package/components/ProductScroller/ProductScroller.tsx +6 -13
- package/components/ProductShortDescription/ProductShortDescription.tsx +3 -2
- package/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx +2 -2
- package/components/ProductSpecs/ProductSpecs.tsx +4 -3
- package/components/ProductSpecs/ProductSpecsAggregations.tsx +2 -2
- package/components/ProductSpecs/ProductSpecsCustomAttributes.tsx +2 -2
- package/components/ProductStaticPaths/getProductStaticPaths.ts +4 -3
- package/components/ProductStaticPaths/getSitemapPaths.ts +2 -2
- package/components/ProductWeight/ProductWeight.tsx +3 -2
- package/context/productListParamsContext.ts +1 -1
- package/hooks/useProductLink.ts +1 -1
- package/hooks/useProductList.ts +10 -13
- package/hooks/useProductListLink.ts +7 -5
- package/hooks/useProductListLinkReplace.ts +1 -1
- package/package.json +14 -14
- package/test/productURL.fixture.ts +1 -1
- package/tsconfig.json +1 -1
@@ -1,8 +1,10 @@
|
|
1
1
|
import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
|
2
|
-
import {
|
2
|
+
import type { ChipOverlayOrPopperProps } from '@graphcommerce/next-ui'
|
3
|
+
import { ActionCard, ChipOverlayOrPopper } from '@graphcommerce/next-ui'
|
3
4
|
import { Trans } from '@lingui/react'
|
4
5
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
5
|
-
import { UseProductFiltersProSortProps
|
6
|
+
import type { UseProductFiltersProSortProps } from './useProductFiltersProSort'
|
7
|
+
import { useProductFiltersProSort } from './useProductFiltersProSort'
|
6
8
|
|
7
9
|
export type ProductListActionSortProps = UseProductFiltersProSortProps &
|
8
10
|
Omit<
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { ActionCardListForm } from '@graphcommerce/ecommerce-ui'
|
2
2
|
import { ActionCard, ActionCardAccordion, Button } from '@graphcommerce/next-ui'
|
3
3
|
import { Trans } from '@lingui/react'
|
4
|
-
import { SxProps, Theme } from '@mui/material'
|
4
|
+
import type { SxProps, Theme } from '@mui/material'
|
5
5
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
6
|
-
import { UseProductFiltersProSortProps
|
6
|
+
import type { UseProductFiltersProSortProps } from './useProductFiltersProSort'
|
7
|
+
import { useProductFiltersProSort } from './useProductFiltersProSort'
|
7
8
|
|
8
9
|
export type ProductFiltersProSortSectionProps = UseProductFiltersProSortProps & {
|
9
10
|
sx?: SxProps<Theme>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
2
|
-
import { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
3
|
-
import { ProductFilterParams } from '../ProductListItems/filterTypes'
|
2
|
+
import type { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
3
|
+
import type { ProductFilterParams } from '../ProductListItems/filterTypes'
|
4
4
|
|
5
5
|
export function excludeCategory(aggregations: ProductListFiltersFragment['aggregations']) {
|
6
6
|
return filterNonNullableKeys(aggregations).filter(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
2
|
-
import { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
3
|
-
import { ProductFilterParams } from '../ProductListItems/filterTypes'
|
2
|
+
import type { ProductListFiltersFragment } from '../ProductListFilters/ProductListFilters.gql'
|
3
|
+
import type { ProductFilterParams } from '../ProductListItems/filterTypes'
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Apply aggregation count to aggregation options:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useCallback } from 'react'
|
2
|
-
import { ProductFilterParams } from '../ProductListItems/filterTypes'
|
2
|
+
import type { ProductFilterParams } from '../ProductListItems/filterTypes'
|
3
3
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
4
4
|
|
5
5
|
export function useProductFiltersProClearAllAction() {
|
@@ -4,9 +4,9 @@ import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
|
4
4
|
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
5
5
|
import { i18n } from '@lingui/core'
|
6
6
|
import { useMemo } from 'react'
|
7
|
-
import { CategoryDefaultFragment } from '../ProductListItems/CategoryDefault.gql'
|
8
|
-
import { ProductFilterParams } from '../ProductListItems/filterTypes'
|
9
|
-
import { ProductListSortFragment } from '../ProductListSort'
|
7
|
+
import type { CategoryDefaultFragment } from '../ProductListItems/CategoryDefault.gql'
|
8
|
+
import type { ProductFilterParams } from '../ProductListItems/filterTypes'
|
9
|
+
import type { ProductListSortFragment } from '../ProductListSort'
|
10
10
|
import { useProductFiltersPro } from './ProductFiltersPro'
|
11
11
|
import type { ProductListActionSortProps } from './ProductFiltersProSortChip'
|
12
12
|
import { ProductFiltersProSortDirectionArrow } from './ProductFiltersProSortDirectionArrow'
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import { extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
|
2
2
|
import { Trans } from '@lingui/react'
|
3
|
-
import {
|
4
|
-
import {
|
3
|
+
import type { SxProps, Theme } from '@mui/material'
|
4
|
+
import { Box, Divider, Typography } from '@mui/material'
|
5
|
+
import type { ProductListCountFragment } from './ProductListCount.gql'
|
5
6
|
|
6
7
|
const { classes, selectors } = extendableComponent('ProductListCount', [
|
7
8
|
'root',
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { cloneDeep } from '@graphcommerce/graphql'
|
2
2
|
import { iconCancelAlt, IconSvg } from '@graphcommerce/next-ui'
|
3
|
-
import {
|
3
|
+
import type { ChipProps, SxProps, Theme } from '@mui/material'
|
4
|
+
import { Chip } from '@mui/material'
|
4
5
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
5
6
|
import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
|
6
7
|
import { ProductListLink } from '../ProductListLink/ProductListLink'
|
7
|
-
import { FilterIn } from './FilterEqualType'
|
8
|
-
import { ProductListFiltersFragment } from './ProductListFilters.gql'
|
8
|
+
import type { FilterIn } from './FilterEqualType'
|
9
|
+
import type { ProductListFiltersFragment } from './ProductListFilters.gql'
|
9
10
|
|
10
11
|
type Filter = NonNullable<NonNullable<ProductListFiltersFragment['aggregations']>[number]>
|
11
12
|
export type FilterCheckboxTypeProps = Filter &
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { cloneDeep } from '@graphcommerce/graphql'
|
2
2
|
import type { FilterEqualTypeInput } from '@graphcommerce/graphql-mesh'
|
3
|
-
import {
|
3
|
+
import type { ChipMenuProps } from '@graphcommerce/next-ui'
|
4
|
+
import { responsiveVal, extendableComponent, ChipMenu } from '@graphcommerce/next-ui'
|
4
5
|
import {
|
5
6
|
Box,
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
@@ -14,13 +15,13 @@ import type { SetRequired } from 'type-fest'
|
|
14
15
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
15
16
|
import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
|
16
17
|
import { ProductListLink } from '../ProductListLink/ProductListLink'
|
17
|
-
import { ProductListFiltersFragment } from './ProductListFilters.gql'
|
18
|
+
import type { ProductListFiltersFragment } from './ProductListFilters.gql'
|
18
19
|
|
19
20
|
type OwnerState = {
|
20
21
|
isColor: boolean
|
21
22
|
isActive: boolean
|
22
23
|
}
|
23
|
-
const componentName = 'FilterEqual'
|
24
|
+
const componentName = 'FilterEqual'
|
24
25
|
const parts = [
|
25
26
|
'listItem',
|
26
27
|
'listItemInnerContainer',
|
@@ -155,7 +156,7 @@ export function FilterEqualType(props: FilterEqualTypeProps) {
|
|
155
156
|
},
|
156
157
|
[`& .${listItemTextClasses.secondary}`]: {
|
157
158
|
color: theme.palette.grey[500],
|
158
|
-
marginLeft:
|
159
|
+
marginLeft: '4px',
|
159
160
|
fontSize: theme.typography.pxToRem(11),
|
160
161
|
display: 'inline',
|
161
162
|
},
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { cloneDeep } from '@graphcommerce/graphql'
|
2
2
|
import type { FilterRangeTypeInput } from '@graphcommerce/graphql-mesh'
|
3
3
|
import { Money } from '@graphcommerce/magento-store'
|
4
|
-
import {
|
4
|
+
import type { ChipMenuProps } from '@graphcommerce/next-ui'
|
5
|
+
import { ChipMenu, extendableComponent } from '@graphcommerce/next-ui'
|
5
6
|
import { Trans } from '@lingui/react'
|
6
7
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
7
8
|
import { Box, Slider } from '@mui/material'
|
8
9
|
import React, { useEffect } from 'react'
|
9
10
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
10
11
|
import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
|
11
|
-
import { ProductListFiltersFragment } from './ProductListFilters.gql'
|
12
|
+
import type { ProductListFiltersFragment } from './ProductListFilters.gql'
|
12
13
|
|
13
14
|
type FilterRangeTypeProps = NonNullable<
|
14
15
|
NonNullable<ProductListFiltersFragment['aggregations']>[0]
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { ChipMenuProps } from '@graphcommerce/next-ui'
|
2
|
-
import { FilterTypes } from '../ProductListItems/getFilterTypes'
|
1
|
+
import type { ChipMenuProps } from '@graphcommerce/next-ui'
|
2
|
+
import type { FilterTypes } from '../ProductListItems/getFilterTypes'
|
3
3
|
import { FilterCheckboxType } from './FilterCheckboxType'
|
4
4
|
import { FilterEqualType } from './FilterEqualType'
|
5
5
|
import { FilterRangeType } from './FilterRangeType'
|
6
|
-
import { ProductListFiltersFragment } from './ProductListFilters.gql'
|
6
|
+
import type { ProductListFiltersFragment } from './ProductListFilters.gql'
|
7
7
|
|
8
8
|
export type ProductFiltersProps = ProductListFiltersFragment & {
|
9
9
|
filterTypes: FilterTypes
|
@@ -6,7 +6,8 @@ import {
|
|
6
6
|
useScrollY,
|
7
7
|
extendableComponent,
|
8
8
|
} from '@graphcommerce/next-ui'
|
9
|
-
import {
|
9
|
+
import type { SxProps, Theme } from '@mui/material'
|
10
|
+
import { Box, styled } from '@mui/material'
|
10
11
|
import { m, useTransform } from 'framer-motion'
|
11
12
|
import React, { useEffect, useRef, useState } from 'react'
|
12
13
|
|
@@ -17,7 +18,7 @@ export type ProductListFiltersContainerProps = { children: React.ReactNode; sx?:
|
|
17
18
|
type OwnerState = {
|
18
19
|
isSticky: boolean
|
19
20
|
}
|
20
|
-
const name = 'ProductListFiltersContainer'
|
21
|
+
const name = 'ProductListFiltersContainer'
|
21
22
|
const parts = [
|
22
23
|
'wrapper',
|
23
24
|
'container',
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { PercentFormat } from '@graphcommerce/next-ui'
|
2
|
-
import {
|
3
|
-
import {
|
2
|
+
import type { BoxProps } from '@mui/material'
|
3
|
+
import { Box } from '@mui/material'
|
4
|
+
import type { ProductListItemFragment } from '../../Api/ProductListItem.gql'
|
4
5
|
|
5
6
|
export type ProductDiscountLabelProps = Pick<ProductListItemFragment, 'price_range'> &
|
6
7
|
Omit<BoxProps, 'children'>
|
@@ -1,27 +1,22 @@
|
|
1
|
-
import { ImageProps } from '@graphcommerce/image'
|
1
|
+
import type { ImageProps } from '@graphcommerce/image'
|
2
2
|
import { extendableComponent } from '@graphcommerce/next-ui'
|
3
|
-
import { SxProps, Theme
|
3
|
+
import type { SxProps, Theme } from '@mui/material'
|
4
|
+
import { useEventCallback, Skeleton } from '@mui/material'
|
4
5
|
import React from 'react'
|
5
|
-
import { ProductListItemFragment } from '../../Api/ProductListItem.gql'
|
6
|
+
import type { ProductListItemFragment } from '../../Api/ProductListItem.gql'
|
6
7
|
import { productLink } from '../../hooks/useProductLink'
|
7
8
|
import { ProductListPrice } from '../ProductListPrice/ProductListPrice'
|
8
9
|
import { ProductDiscountLabel } from './ProductDiscountLabel'
|
9
|
-
import {
|
10
|
-
|
11
|
-
|
12
|
-
ProductListItemImageSkeleton,
|
13
|
-
} from './ProductListItemImage'
|
14
|
-
import {
|
10
|
+
import type { ProductListItemImageProps } from './ProductListItemImage'
|
11
|
+
import { ProductListItemImage, ProductListItemImageSkeleton } from './ProductListItemImage'
|
12
|
+
import type {
|
15
13
|
ProductListItemImageAreaKeys,
|
16
14
|
ProductListsItemImageAreaProps,
|
17
|
-
ProductListItemImageAreas,
|
18
|
-
ProductImageContainer,
|
19
15
|
} from './ProductListItemImageContainer'
|
16
|
+
import { ProductListItemImageAreas, ProductImageContainer } from './ProductListItemImageContainer'
|
20
17
|
import { ProductListItemLinkOrDiv } from './ProductListItemLinkOrDiv'
|
21
|
-
import {
|
22
|
-
|
23
|
-
ProductListItemTitleAndPriceProps,
|
24
|
-
} from './ProductListItemTitleAndPrice'
|
18
|
+
import type { ProductListItemTitleAndPriceProps } from './ProductListItemTitleAndPrice'
|
19
|
+
import { ProductListItemTitleAndPrice } from './ProductListItemTitleAndPrice'
|
25
20
|
|
26
21
|
const { classes, selectors } = extendableComponent('ProductListItem', [
|
27
22
|
'root',
|
@@ -1,6 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import type { ImageProps } from '@graphcommerce/image'
|
2
|
+
import { Image } from '@graphcommerce/image'
|
2
3
|
import { Trans } from '@lingui/react'
|
3
|
-
import {
|
4
|
+
import type { BoxProps } from '@mui/material'
|
5
|
+
import { Box, Skeleton, styled } from '@mui/material'
|
4
6
|
|
5
7
|
const StyledImage = styled(Image)({})
|
6
8
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { responsiveVal, breakpointVal } from '@graphcommerce/next-ui'
|
2
|
-
import {
|
2
|
+
import type { BoxProps } from '@mui/material'
|
3
|
+
import { Box } from '@mui/material'
|
3
4
|
|
4
5
|
type ProductImageContainerProps = BoxProps
|
5
6
|
|
@@ -22,7 +23,7 @@ export function ProductImageContainer(props: ProductImageContainerProps) {
|
|
22
23
|
overflow: 'hidden',
|
23
24
|
padding: responsiveVal(8, 12),
|
24
25
|
'& > picture, & > .ProductListItem-placeholder': {
|
25
|
-
gridArea:
|
26
|
+
gridArea: '1 / 1 / 3 / 3',
|
26
27
|
margin: `calc(${responsiveVal(8, 12)} * -1)`,
|
27
28
|
height: 'auto',
|
28
29
|
},
|
@@ -52,7 +53,7 @@ export function ProductListItemImageAreas(props: ProductListsItemImageAreaProps)
|
|
52
53
|
<>
|
53
54
|
<Box
|
54
55
|
sx={{
|
55
|
-
gridArea:
|
56
|
+
gridArea: '1 / 1 / 2 / 2',
|
56
57
|
zIndex: 1,
|
57
58
|
}}
|
58
59
|
className={classes.topLeft}
|
@@ -63,7 +64,7 @@ export function ProductListItemImageAreas(props: ProductListsItemImageAreaProps)
|
|
63
64
|
sx={{
|
64
65
|
justifySelf: 'end',
|
65
66
|
textAlign: 'right',
|
66
|
-
gridArea:
|
67
|
+
gridArea: '1 / 2 / 2 / 3',
|
67
68
|
zIndex: 1,
|
68
69
|
}}
|
69
70
|
className={classes.topRight}
|
@@ -73,7 +74,7 @@ export function ProductListItemImageAreas(props: ProductListsItemImageAreaProps)
|
|
73
74
|
<Box
|
74
75
|
sx={{
|
75
76
|
alignSelf: 'flex-end',
|
76
|
-
gridArea:
|
77
|
+
gridArea: '2 / 1 / 3 / 2',
|
77
78
|
zIndex: 1,
|
78
79
|
}}
|
79
80
|
className={classes.bottomLeft}
|
@@ -84,7 +85,7 @@ export function ProductListItemImageAreas(props: ProductListsItemImageAreaProps)
|
|
84
85
|
sx={{
|
85
86
|
textAlign: 'right',
|
86
87
|
alignSelf: 'flex-end',
|
87
|
-
gridArea:
|
88
|
+
gridArea: '2 / 2 / 3 / 3',
|
88
89
|
zIndex: 1,
|
89
90
|
justifySelf: 'end',
|
90
91
|
}}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { NextLink, breakpointVal } from '@graphcommerce/next-ui'
|
2
|
-
import {
|
2
|
+
import type { BoxProps, ButtonBaseProps, SxProps, Theme } from '@mui/material'
|
3
|
+
import { Box, ButtonBase } from '@mui/material'
|
3
4
|
|
4
5
|
type ProductListItemLinkProps = ButtonBaseProps<typeof NextLink>
|
5
6
|
type ProductListItemLinkOrDivProps = ProductListItemLinkProps | BoxProps
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import type { SxProps, Theme } from '@mui/material'
|
2
|
+
import { Box, Typography } from '@mui/material'
|
2
3
|
import { productListPrice } from '../ProductListPrice'
|
3
4
|
|
4
5
|
export type ProductListItemTitleAndPriceProps = {
|
@@ -23,8 +24,8 @@ export function ProductListItemTitleAndPrice(props: ProductListItemTitleAndPrice
|
|
23
24
|
marginTop: theme.spacings.xs,
|
24
25
|
columnGap: 1,
|
25
26
|
gridTemplateAreas: {
|
26
|
-
xs:
|
27
|
-
md:
|
27
|
+
xs: '"title title" "subtitle price"',
|
28
|
+
md: '"title subtitle price"',
|
28
29
|
},
|
29
30
|
gridTemplateColumns: { xs: 'unset', md: 'auto auto 1fr' },
|
30
31
|
justifyContent: 'space-between',
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { LazyHydrate, RenderType, extendableComponent, responsiveVal } from '@graphcommerce/next-ui'
|
2
|
-
import {
|
2
|
+
import type { BoxProps, Breakpoint, Theme } from '@mui/material'
|
3
|
+
import { Box, useTheme } from '@mui/material'
|
3
4
|
import { AddProductsToCartForm } from '../AddProductsToCart'
|
4
|
-
import { ProductListItemProps } from '../ProductListItem/ProductListItem'
|
5
|
-
import { ProductListItemsFragment } from './ProductListItems.gql'
|
6
|
-
import { ProductListItemRenderer } from './renderer'
|
5
|
+
import type { ProductListItemProps } from '../ProductListItem/ProductListItem'
|
6
|
+
import type { ProductListItemsFragment } from './ProductListItems.gql'
|
7
|
+
import type { ProductListItemRenderer } from './renderer'
|
7
8
|
|
8
9
|
type ComponentState = {
|
9
10
|
size?: 'normal' | 'small'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useState, useEffect, useMemo } from 'react'
|
2
2
|
import { productListParamsContext } from '../../context/productListParamsContext'
|
3
|
-
import { ProductListParams } from './filterTypes'
|
3
|
+
import type { ProductListParams } from './filterTypes'
|
4
4
|
|
5
5
|
export function ProductListParamsProvider({
|
6
6
|
children,
|
@@ -6,8 +6,8 @@ import type {
|
|
6
6
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
7
7
|
import { equal } from '@wry/equality'
|
8
8
|
import { useRouter } from 'next/router'
|
9
|
-
import { ProductListParams } from './filterTypes'
|
10
|
-
import { FilterTypes } from './getFilterTypes'
|
9
|
+
import type { ProductListParams } from './filterTypes'
|
10
|
+
import type { FilterTypes } from './getFilterTypes'
|
11
11
|
|
12
12
|
export function parseParams(
|
13
13
|
url: string,
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import type { ApolloClient, NormalizedCacheObject, TypedDocumentNode } from '@graphcommerce/graphql'
|
2
|
+
import { gql } from '@graphcommerce/graphql'
|
2
3
|
import type { AttributeFrontendInputEnum, Exact } from '@graphcommerce/graphql-mesh'
|
3
4
|
import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui'
|
4
5
|
import { ProductFilterTypesDocument } from './ProductFilterTypes.gql'
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { cloneDeep, useQuery } from '@graphcommerce/graphql'
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
2
|
+
import type { StoreConfigQuery } from '@graphcommerce/magento-store'
|
3
|
+
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
4
|
+
import type { ProductListQueryVariables } from '../ProductList/ProductList.gql'
|
5
|
+
import type { CategoryDefaultFragment } from './CategoryDefault.gql'
|
6
|
+
import type { ProductListParams } from './filterTypes'
|
6
7
|
|
7
8
|
export function useProductListApplyCategoryDefaults(
|
8
9
|
params: ProductListParams | undefined,
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { TypeRenderer } from '@graphcommerce/next-ui'
|
2
|
-
import { ProductListItemFragment } from '../../Api/ProductListItem.gql'
|
1
|
+
import type { TypeRenderer } from '@graphcommerce/next-ui'
|
2
|
+
import type { ProductListItemFragment } from '../../Api/ProductListItem.gql'
|
3
3
|
import { ProductListItem } from '../ProductListItem/ProductListItem'
|
4
4
|
|
5
5
|
type SkeletonType = { __typename: 'Skeleton'; uid: string }
|
@@ -1,9 +1,11 @@
|
|
1
|
-
import {
|
2
|
-
import
|
1
|
+
import type { LinkProps } from '@mui/material'
|
2
|
+
import { Link } from '@mui/material'
|
3
|
+
import type { LinkProps as PageLinkProps } from 'next/link'
|
4
|
+
import PageLink from 'next/link'
|
3
5
|
import React from 'react'
|
4
6
|
import { useProductListLink } from '../../hooks/useProductListLink'
|
5
7
|
import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
|
6
|
-
import { ProductListParams } from '../ProductListItems/filterTypes'
|
8
|
+
import type { ProductListParams } from '../ProductListItems/filterTypes'
|
7
9
|
|
8
10
|
export type ProductListLinkProps = LinkProps &
|
9
11
|
ProductListParams & {
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { NextLink, PaginationExtended, Pagination } from '@graphcommerce/next-ui'
|
2
|
-
import {
|
2
|
+
import type { PaginationProps } from '@mui/material'
|
3
|
+
import { Link } from '@mui/material'
|
3
4
|
import { productListLink } from '../../hooks/useProductListLink'
|
4
|
-
import { ProductListParams } from '../ProductListItems/filterTypes'
|
5
|
-
import { ProductListPaginationFragment } from './ProductListPagination.gql'
|
5
|
+
import type { ProductListParams } from '../ProductListItems/filterTypes'
|
6
|
+
import type { ProductListPaginationFragment } from './ProductListPagination.gql'
|
6
7
|
|
7
8
|
export type ProductPaginationProps = ProductListPaginationFragment &
|
8
9
|
Omit<PaginationProps, 'count' | 'defaultPage' | 'page' | 'renderItem'> & {
|
@@ -22,7 +23,7 @@ export function ProductListPagination({
|
|
22
23
|
count={page_info?.total_pages}
|
23
24
|
page={page_info?.current_page ?? 1}
|
24
25
|
renderLink={(_, icon, btnProps) => {
|
25
|
-
const suffix = btnProps.page === 1 ? '' :
|
26
|
+
const suffix = btnProps.page === 1 ? '' : '#products'
|
26
27
|
return (
|
27
28
|
<Link
|
28
29
|
{...btnProps}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { InContextMask } from '@graphcommerce/graphql'
|
2
2
|
import { Money } from '@graphcommerce/magento-store'
|
3
3
|
import { extendableComponent } from '@graphcommerce/next-ui'
|
4
|
-
import {
|
5
|
-
import {
|
4
|
+
import type { TypographyProps } from '@mui/material'
|
5
|
+
import { Typography } from '@mui/material'
|
6
|
+
import type { ProductListPriceFragment } from './ProductListPrice.gql'
|
6
7
|
|
7
8
|
export const productListPrice = extendableComponent('ProductListPrice', [
|
8
9
|
'root',
|
@@ -1,20 +1,22 @@
|
|
1
1
|
import { useQuery, cloneDeep } from '@graphcommerce/graphql'
|
2
2
|
import { StoreConfigDocument } from '@graphcommerce/magento-store'
|
3
|
-
import {
|
3
|
+
import type { ChipMenuProps } from '@graphcommerce/next-ui'
|
4
|
+
import { ChipMenu, extendableComponent } from '@graphcommerce/next-ui'
|
4
5
|
import { Trans } from '@lingui/react'
|
5
|
-
import {
|
6
|
+
import type { SxProps, Theme } from '@mui/material'
|
7
|
+
import { ListItem, ListItemText } from '@mui/material'
|
6
8
|
import React from 'react'
|
7
9
|
import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace'
|
8
10
|
import { useProductListParamsContext } from '../../hooks/useProductListParamsContext'
|
9
11
|
import { ProductListLink } from '../ProductListLink/ProductListLink'
|
10
|
-
import { ProductListSortFragment } from './ProductListSort.gql'
|
12
|
+
import type { ProductListSortFragment } from './ProductListSort.gql'
|
11
13
|
|
12
14
|
export type ProductListSortProps = ProductListSortFragment &
|
13
15
|
Omit<ChipMenuProps, 'selected' | 'selectedLabel' | 'children' | 'label' | 'onDelete'> & {
|
14
16
|
sx?: SxProps<Theme>
|
15
17
|
}
|
16
18
|
|
17
|
-
const name = 'ProductListSort'
|
19
|
+
const name = 'ProductListSort'
|
18
20
|
const parts = ['menu', 'item', 'link'] as const
|
19
21
|
const { classes } = extendableComponent(name, parts)
|
20
22
|
|
@@ -46,7 +48,7 @@ export function ProductListSort(props: ProductListSortProps) {
|
|
46
48
|
selected={selected}
|
47
49
|
label={label}
|
48
50
|
{...filterMenuProps}
|
49
|
-
selectedLabel={selected ? currentOption?.label ?? '' : label}
|
51
|
+
selectedLabel={selected ? (currentOption?.label ?? '') : label}
|
50
52
|
onDelete={selected ? removeFilter : undefined}
|
51
53
|
sx={Array.isArray(sx) ? sx : [sx]}
|
52
54
|
>
|
@@ -3,7 +3,7 @@ import { Trans } from '@lingui/macro'
|
|
3
3
|
import { Box, Link } from '@mui/material'
|
4
4
|
import { productListLinkFromFilter } from '../../hooks/useProductListLink'
|
5
5
|
import { useProductFiltersPro } from '../ProductFiltersPro'
|
6
|
-
import { ProductListSuggestionsFragment } from './ProductListSuggestions.gql'
|
6
|
+
import type { ProductListSuggestionsFragment } from './ProductListSuggestions.gql'
|
7
7
|
|
8
8
|
type ProductListSuggestionsProps = {
|
9
9
|
products: ProductListSuggestionsFragment
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import type { SxProps, Theme } from '@mui/material'
|
2
|
+
import { Box } from '@mui/material'
|
3
|
+
import type { UseAddProductsToCartActionFragment } from '../AddProductsToCart/UseAddProductsToCartAction.gql'
|
3
4
|
|
4
5
|
export type ProductPageAddToCartRowProps = {
|
5
6
|
sx?: SxProps<Theme>
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { usePrevPageRouter } from '@graphcommerce/framer-next-pages'
|
2
2
|
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
|
3
3
|
import { Trans } from '@lingui/react'
|
4
|
-
import {
|
4
|
+
import type { BreadcrumbsProps } from '@mui/material'
|
5
|
+
import { Breadcrumbs, Link, Typography } from '@mui/material'
|
5
6
|
import { productPageCategory } from '../ProductPageCategory/productPageCategory'
|
6
|
-
import { ProductPageBreadcrumbFragment } from './ProductPageBreadcrumb.gql'
|
7
|
+
import type { ProductPageBreadcrumbFragment } from './ProductPageBreadcrumb.gql'
|
7
8
|
|
8
9
|
type ProductPageBreadcrumbsProps = ProductPageBreadcrumbFragment &
|
9
10
|
Omit<BreadcrumbsProps, 'children'>
|
@@ -3,12 +3,12 @@ import { categoryToBreadcrumbs } from '@graphcommerce/magento-category'
|
|
3
3
|
import { Breadcrumbs } from '@graphcommerce/next-ui'
|
4
4
|
import { BreadcrumbsJsonLd } from '@graphcommerce/next-ui/Breadcrumbs/BreadcrumbsJsonLd'
|
5
5
|
import { jsonLdBreadcrumb } from '@graphcommerce/next-ui/Breadcrumbs/jsonLdBreadcrumb'
|
6
|
-
import { BreadcrumbsProps } from '@mui/material'
|
6
|
+
import type { BreadcrumbsProps } from '@mui/material'
|
7
7
|
import { useRouter } from 'next/router'
|
8
|
-
import { BreadcrumbList } from 'schema-dts'
|
8
|
+
import type { BreadcrumbList } from 'schema-dts'
|
9
9
|
import { productLink } from '../../hooks/useProductLink'
|
10
10
|
import { productPageCategory } from '../ProductPageCategory/productPageCategory'
|
11
|
-
import { ProductPageBreadcrumbFragment } from './ProductPageBreadcrumb.gql'
|
11
|
+
import type { ProductPageBreadcrumbFragment } from './ProductPageBreadcrumb.gql'
|
12
12
|
|
13
13
|
export type ProductPageBreadcrumbsProps = Omit<BreadcrumbsProps, 'children'> & {
|
14
14
|
breadcrumbsAmount?: number
|
@@ -1,14 +1,15 @@
|
|
1
|
+
import type { ColumnTwoWithTopProps } from '@graphcommerce/next-ui'
|
1
2
|
import {
|
2
3
|
ColumnTwoWithTop,
|
3
|
-
ColumnTwoWithTopProps,
|
4
4
|
extendableComponent,
|
5
5
|
breakpointVal,
|
6
6
|
LazyHydrate,
|
7
7
|
} from '@graphcommerce/next-ui'
|
8
|
-
import {
|
9
|
-
import {
|
8
|
+
import type { SxProps, Theme } from '@mui/material'
|
9
|
+
import { Box, Typography } from '@mui/material'
|
10
|
+
import type { Variant } from '@mui/material/styles/createTypography'
|
10
11
|
import { ProductPageName } from '../ProductPageName'
|
11
|
-
import { ProductPageDescriptionFragment } from './ProductPageDescription.gql'
|
12
|
+
import type { ProductPageDescriptionFragment } from './ProductPageDescription.gql'
|
12
13
|
|
13
14
|
export type ProductPageDescriptionProps = ProductPageDescriptionFragment &
|
14
15
|
Omit<ColumnTwoWithTopProps, 'top' | 'left'> & {
|
@@ -1,10 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
SidebarGalleryProps,
|
5
|
-
TypeRenderer,
|
6
|
-
} from '@graphcommerce/next-ui'
|
7
|
-
import { ProductPageGalleryFragment } from './ProductPageGallery.gql'
|
1
|
+
import type { SidebarGalleryProps, TypeRenderer } from '@graphcommerce/next-ui'
|
2
|
+
import { nonNullable, SidebarGallery } from '@graphcommerce/next-ui'
|
3
|
+
import type { ProductPageGalleryFragment } from './ProductPageGallery.gql'
|
8
4
|
|
9
5
|
export type ProductPageGalleryRenderers = TypeRenderer<
|
10
6
|
NonNullable<NonNullable<ProductPageGalleryFragment['media_gallery']>[0]>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { PageMeta } from '@graphcommerce/magento-store'
|
2
|
-
import { PageMetaProps } from '@graphcommerce/next-ui'
|
2
|
+
import type { PageMetaProps } from '@graphcommerce/next-ui'
|
3
3
|
import { productLink } from '../../hooks/useProductLink'
|
4
|
-
import { ProductPageMetaFragment } from './ProductPageMeta.gql'
|
4
|
+
import type { ProductPageMetaFragment } from './ProductPageMeta.gql'
|
5
5
|
|
6
6
|
export type ProductPageMetaProps = { product: ProductPageMetaFragment } & Pick<
|
7
7
|
PageMetaProps,
|