Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eslint-ignore-rest-siblings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/eslint-config-pwa': patch
---

Added `ignoreRestSiblings` and `argsIgnorePattern: '^_'` to `@typescript-eslint/no-unused-vars`. A component can take a prop out of `...rest` without using it, and a parameter that starts with `_` can stay unused.
5 changes: 5 additions & 0 deletions .changeset/image-no-next-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/image': patch
---

Removed the import of `@graphcommerce/next-ui` from `@graphcommerce/image`, because `@graphcommerce/next-ui` depends on `@graphcommerce/image`.
5 changes: 5 additions & 0 deletions .changeset/import-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/misc': patch
---

Changed the imports that only import types to `import type`.
5 changes: 5 additions & 0 deletions .changeset/remove-unused-vars.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/misc': patch
---

Removed unused imports, variables and parameters.
2 changes: 1 addition & 1 deletion examples/magento-graphcms/components/Blog/BlogAuthor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BlogAuthor as NextBlogAuthor } from '@graphcommerce/next-ui'
import { BlogAuthorFragment } from './BlogAuthor.gql'
import type { BlogAuthorFragment } from './BlogAuthor.gql'

type BlogAuthorProps = BlogAuthorFragment

Expand Down
3 changes: 2 additions & 1 deletion examples/magento-graphcms/components/Blog/BlogHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Asset, AssetFragment } from '@graphcommerce/hygraph-ui'
import type { AssetFragment } from '@graphcommerce/hygraph-ui'
import { Asset } from '@graphcommerce/hygraph-ui'
import { BlogHeader as NextBlogHeader } from '@graphcommerce/next-ui'

export function BlogHeader(props: { asset?: AssetFragment }) {
Expand Down
2 changes: 1 addition & 1 deletion examples/magento-graphcms/components/Blog/BlogItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Asset } from '@graphcommerce/hygraph-ui'
import { BlogListItem } from '@graphcommerce/next-ui'
import { Trans } from '@lingui/react/macro'
import { Typography, useTheme } from '@mui/material'
import { BlogItemFragment } from './BlogItem.gql'
import type { BlogItemFragment } from './BlogItem.gql'

type BlogItemProps = BlogItemFragment

Expand Down
2 changes: 1 addition & 1 deletion examples/magento-graphcms/components/Blog/BlogList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BlogItemGrid } from '@graphcommerce/next-ui'
import { BlogItem } from './BlogItem'
import { BlogListQuery } from './BlogList.gql'
import type { BlogListQuery } from './BlogList.gql'

type BlogListProps = BlogListQuery

Expand Down
2 changes: 1 addition & 1 deletion examples/magento-graphcms/components/Blog/BlogTags.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BlogTag, BlogTags as NextBlogTags } from '@graphcommerce/next-ui'
import { BlogTagsFragment } from './BlogTags.gql'
import type { BlogTagsFragment } from './BlogTags.gql'

type BlogTagsProps = BlogTagsFragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RichText } from '@graphcommerce/hygraph-ui'
import { BlogContent } from '@graphcommerce/next-ui'
import { RowBlogContentFragment } from './RowBlogContent.gql'
import type { RowBlogContentFragment } from './RowBlogContent.gql'

type RowBlogContentProps = RowBlogContentFragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ButtonLinkListItem, ButtonLinkList } from '@graphcommerce/next-ui'
import { RowButtonLinkListFragment } from './RowButtonLinkList.gql'
import type { RowButtonLinkListFragment } from './RowButtonLinkList.gql'

export type RowButtonLinkListProps = RowButtonLinkListFragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RichText, RichTextProps } from '@graphcommerce/hygraph-ui'
import type { RichTextProps } from '@graphcommerce/hygraph-ui'
import { RichText } from '@graphcommerce/hygraph-ui'
import { ColumnOne } from '@graphcommerce/next-ui'
import type { RowColumnOneFragment } from '../RowColumnOne.gql'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { RichText, RichTextProps } from '@graphcommerce/hygraph-ui'
import type { RichTextProps } from '@graphcommerce/hygraph-ui'
import { RichText } from '@graphcommerce/hygraph-ui'
import { VariantMessage } from '@graphcommerce/next-ui'
import type { RowColumnOneFragment } from '../RowColumnOne.gql'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RichText } from '@graphcommerce/hygraph-ui'
import { ColumnThree } from '@graphcommerce/next-ui'
import { RowColumnThreeFragment } from './RowColumnThree.gql'
import type { RowColumnThreeFragment } from './RowColumnThree.gql'

export function RowColumnThree(props: RowColumnThreeFragment) {
const { colOne, colTwo, colThree } = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RichText } from '@graphcommerce/hygraph-ui'
import { ColumnTwo } from '@graphcommerce/next-ui'
import { RowColumnTwoFragment } from './RowColumnTwo.gql'
import type { RowColumnTwoFragment } from './RowColumnTwo.gql'

export function RowColumnTwo(props: RowColumnTwoFragment) {
const { colOne, colTwo } = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ContentLinks } from '@graphcommerce/next-ui'
import { Link } from '@mui/material'
import { RowContentLinksFragment } from './RowContentLinks.gql'
import type { RowContentLinksFragment } from './RowContentLinks.gql'

/** @deprecated Replace with RowLinks */
export function RowContentLinks(props: RowContentLinksFragment) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { AssetProps } from '@graphcommerce/hygraph-ui'
import { Asset, RichText } from '@graphcommerce/hygraph-ui'
import { breakpointVal, HeroBanner } from '@graphcommerce/next-ui'
import { Button } from '@mui/material'
import { RowHeroBannerFragment } from './RowHeroBanner.gql'
import type { RowHeroBannerFragment } from './RowHeroBanner.gql'

export type RowHeroBannerProps = RowHeroBannerFragment & {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Asset, RichText } from '@graphcommerce/hygraph-ui'
import { responsiveVal, VariantImageLabelSwiper } from '@graphcommerce/next-ui'
import { Box, ButtonBase, Typography } from '@mui/material'
import { RowLinksFragment } from '../RowLinks.gql'
import type { RowLinksFragment } from '../RowLinks.gql'

export function ImageLabelSwiper(props: RowLinksFragment) {
const { title, rowLinksCopy, pageLinks } = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { VariantInline } from '@graphcommerce/next-ui'
import { Link } from '@mui/material'

import { RowLinksFragment } from '../RowLinks.gql'
import type { RowLinksFragment } from '../RowLinks.gql'

export function Inline(props: RowLinksFragment) {
const { title, pageLinks } = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Asset } from '@graphcommerce/hygraph-ui'
import { VariantLogoSwiper } from '@graphcommerce/next-ui'
import { Link } from '@mui/material'
import { RowLinksFragment } from '../RowLinks.gql'
import type { RowLinksFragment } from '../RowLinks.gql'

export function LogoSwiper(props: RowLinksFragment) {
const { title, pageLinks } = props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { RichText } from '@graphcommerce/hygraph-ui'
import { iconCheckmark, IconSvg, VariantUsps } from '@graphcommerce/next-ui'
import { Box } from '@mui/material'

import { RowLinksFragment } from '../RowLinks.gql'
import type { RowLinksFragment } from '../RowLinks.gql'

export function Usps(props: RowLinksFragment) {
const { title, pageLinks } = props
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { PrivateQueryMaskProvider, usePrivateQuery } from '@graphcommerce/graphql'
import {
ProductListDocument,
ProductListItemsFragment,
ProductSpecsFragment,
} from '@graphcommerce/magento-product'
import type { ProductListItemsFragment, ProductSpecsFragment } from '@graphcommerce/magento-product'
import { ProductListDocument } from '@graphcommerce/magento-product'
import { filterNonNullableKeys } from '@graphcommerce/next-ui'
import { RowProductFragment } from './RowProduct.gql'
import type { RowProductFragment } from './RowProduct.gql'
import {
Backstory,
Feature,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Asset, RichText } from '@graphcommerce/hygraph-ui'
import { AddProductsToCartForm, ProductListItemsFragment } from '@graphcommerce/magento-product'
import type { ProductListItemsFragment } from '@graphcommerce/magento-product'
import { AddProductsToCartForm } from '@graphcommerce/magento-product'
import { ParagraphWithSidebarSlide, RenderType } from '@graphcommerce/next-ui'
import { useTheme } from '@mui/material'
import { productListRenderer } from '../../../ProductListItems'
import { RowProductFragment } from '../RowProduct.gql'
import type { RowProductFragment } from '../RowProduct.gql'

type BackstoryProps = RowProductFragment & ProductListItemsFragment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { RichText } from '@graphcommerce/hygraph-ui'
import { Image } from '@graphcommerce/image'
import { ImageText, useContainerSpacing } from '@graphcommerce/next-ui'
import { Typography, useTheme } from '@mui/material'
import { RowProductFragment } from '../RowProduct.gql'
import { ProductFeatureMediaFragment } from './ProductFeatureMedia.gql'
import type { RowProductFragment } from '../RowProduct.gql'
import type { ProductFeatureMediaFragment } from './ProductFeatureMedia.gql'

type FeatureProps = RowProductFragment & ProductFeatureMediaFragment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { RichText } from '@graphcommerce/hygraph-ui'
import { Image } from '@graphcommerce/image'
import { ImageTextBoxed, responsiveVal } from '@graphcommerce/next-ui'
import { Typography, useTheme } from '@mui/material'
import { RowProductFragment } from '../RowProduct.gql'
import { ProductFeatureMediaBoxedFragment } from './ProductFeatureMediaBoxed.gql'
import type { RowProductFragment } from '../RowProduct.gql'
import type { ProductFeatureMediaBoxedFragment } from './ProductFeatureMediaBoxed.gql'

type FeatureBoxedProps = RowProductFragment & ProductFeatureMediaBoxedFragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { ContainerWithHeader } from '@graphcommerce/next-ui'
import { Link } from '@mui/material'
import { ProductListItems, ProductListItemsProps } from '../../../ProductListItems/ProductListItems'
import { RowProductFragment } from '../RowProduct.gql'
import type { ProductListItemsProps } from '../../../ProductListItems/ProductListItems'
import { ProductListItems } from '../../../ProductListItems/ProductListItems'
import type { RowProductFragment } from '../RowProduct.gql'

type GridProps = RowProductFragment & ProductListItemsProps

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { AddProductsToCartForm, RelatedProductsFragment } from '@graphcommerce/magento-product'
import {
SidebarSlider,
RenderType,
responsiveVal,
SidebarSliderProps,
} from '@graphcommerce/next-ui'
import type { RelatedProductsFragment } from '@graphcommerce/magento-product'
import { AddProductsToCartForm } from '@graphcommerce/magento-product'
import type { SidebarSliderProps } from '@graphcommerce/next-ui'
import { SidebarSlider, RenderType, responsiveVal } from '@graphcommerce/next-ui'
import { Typography } from '@mui/material'
import { productListRenderer } from '../../../ProductListItems/productListRenderer'
import { RowProductFragment } from '../RowProduct.gql'
import type { RowProductFragment } from '../RowProduct.gql'

type RelatedProps = RowProductFragment & RelatedProductsFragment & Pick<SidebarSliderProps, 'sx'>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { useQuery } from '@graphcommerce/graphql'
import { ProductReviews, ProductReviewsProps } from '@graphcommerce/magento-review'
import type { ProductReviewsProps } from '@graphcommerce/magento-review'
import { ProductReviews } from '@graphcommerce/magento-review'
import { StoreConfigDocument } from '@graphcommerce/magento-store'
import { Row, sxx } from '@graphcommerce/next-ui'
import { Row } from '@graphcommerce/next-ui'
import { Box, Typography } from '@mui/material'
import { RowProductFragment } from '../RowProduct.gql'
import type { RowProductFragment } from '../RowProduct.gql'

type ReviewsProps = RowProductFragment & Partial<ProductReviewsProps>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ProductSpecs, ProductSpecsFragment } from '@graphcommerce/magento-product'
import { RowProductFragment } from '../RowProduct.gql'
import type { ProductSpecsFragment } from '@graphcommerce/magento-product'
import { ProductSpecs } from '@graphcommerce/magento-product'
import type { RowProductFragment } from '../RowProduct.gql'

type SpecsProps = RowProductFragment & ProductSpecsFragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { AddProductsToCartForm, ProductListItemsFragment } from '@graphcommerce/magento-product'
import {
RenderType,
responsiveVal,
SidebarSlider,
SidebarSliderProps,
sxx,
} from '@graphcommerce/next-ui'
import type { ProductListItemsFragment } from '@graphcommerce/magento-product'
import { AddProductsToCartForm } from '@graphcommerce/magento-product'
import type { SidebarSliderProps } from '@graphcommerce/next-ui'
import { RenderType, responsiveVal, SidebarSlider, sxx } from '@graphcommerce/next-ui'
import { Typography } from '@mui/material'
import { productListRenderer } from '../../../ProductListItems/productListRenderer'
import { RowProductFragment } from '../RowProduct.gql'
import type { RowProductFragment } from '../RowProduct.gql'

type SwipeableProps = RowProductFragment & ProductListItemsFragment & Pick<SidebarSliderProps, 'sx'>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { AddProductsToCartForm, UpsellProductsFragment } from '@graphcommerce/magento-product'
import {
SidebarSlider,
RenderType,
responsiveVal,
SidebarSliderProps,
} from '@graphcommerce/next-ui'
import type { UpsellProductsFragment } from '@graphcommerce/magento-product'
import { AddProductsToCartForm } from '@graphcommerce/magento-product'
import type { SidebarSliderProps } from '@graphcommerce/next-ui'
import { SidebarSlider, RenderType, responsiveVal } from '@graphcommerce/next-ui'
import { Typography } from '@mui/material'
import { productListRenderer } from '../../../ProductListItems/productListRenderer'
import { RowProductFragment } from '../RowProduct.gql'
import type { RowProductFragment } from '../RowProduct.gql'

type UpsellsProps = RowProductFragment & UpsellProductsFragment & Pick<SidebarSliderProps, 'sx'>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { RichText } from '@graphcommerce/hygraph-ui'
import { Quote } from '@graphcommerce/next-ui'
import React from 'react'
import { RowQuoteFragment } from './RowQuote.gql'
import type { RowQuoteFragment } from './RowQuote.gql'

type RowQuoteProps = RowQuoteFragment

Expand Down
7 changes: 4 additions & 3 deletions examples/magento-graphcms/components/GraphCMS/RowRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { LazyHydrate, RenderType, TypeRenderer } from '@graphcommerce/next-ui'
import type { TypeRenderer } from '@graphcommerce/next-ui'
import { LazyHydrate, RenderType } from '@graphcommerce/next-ui'
import { memo } from 'react'
import { RowBlogContent } from '../Blog'
import { PageContentQueryFragment } from './PageContentQueryFragment.gql'
import type { PageContentQueryFragment } from './PageContentQueryFragment.gql'
import { RowButtonLinkList } from './RowButtonLinkList/RowButtonLinkList'
import { RowColumnOne } from './RowColumnOne/RowColumnOne'
import { RowColumnThree } from './RowColumnThree/RowColumnThree'
Expand All @@ -11,7 +12,7 @@ import { RowHeroBanner } from './RowHeroBanner/RowHeroBanner'
import { RowLinks } from './RowLinks/RowLinks'
import { RowProduct } from './RowProduct/RowProduct'
import { RowQuote } from './RowQuote/RowQuote'
import { RowRendererFragment } from './RowRenderer.gql'
import type { RowRendererFragment } from './RowRenderer.gql'
import { RowServiceOptions } from './RowServiceOptions/RowServiceOptions'
import { RowSpecialBanner } from './RowSpecialBanner/RowSpecialBanner'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
iconPhone,
IconSvg,
} from '@graphcommerce/next-ui'
import { RowServiceOptionsFragment } from './RowServiceOptions.gql'
import type { RowServiceOptionsFragment } from './RowServiceOptions.gql'

type RowServiceOptionsProps = RowServiceOptionsFragment

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { RichText, Asset } from '@graphcommerce/hygraph-ui'
import { breakpointVal, SpecialBanner } from '@graphcommerce/next-ui'
import { Link } from '@mui/material'
import { RowSpecialBannerFragment } from './RowSpecialBanner.gql'
import type { RowSpecialBannerFragment } from './RowSpecialBanner.gql'

type RowSpecialBannerProps = RowSpecialBannerFragment

Expand Down
2 changes: 1 addition & 1 deletion examples/magento-graphcms/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { magentoVersion } from '@graphcommerce/next-config/config'
import { DateFormat, FindAndReplace, Footer as FooterBase } from '@graphcommerce/next-ui'
import { Trans } from '@lingui/react/macro'
import { Button, IconButton, Link } from '@mui/material'
import { FooterQueryFragment } from './FooterQueryFragment.gql'
import type { FooterQueryFragment } from './FooterQueryFragment.gql'
import { useQuery } from '@graphcommerce/graphql'

export type FooterProps = FooterQueryFragment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Footer } from './Footer'
import { HeaderContainer } from './HeaderContainer'
import { LayoutQuery } from './Layout.gql'
import type { LayoutQuery } from './Layout.gql'
import { LayoutDefault, type LayoutDefaultProps } from './LayoutDefault'
import { Logo } from './Logo'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LayoutOverlayProps as LayoutOverlayBaseProps } from '@graphcommerce/next-ui'
import type { LayoutOverlayProps as LayoutOverlayBaseProps } from '@graphcommerce/next-ui'

export { LayoutOverlay } from '@graphcommerce/next-ui'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ProductListItemsBase, ProductItemsGridProps } from '@graphcommerce/magento-product'
import type { ProductItemsGridProps } from '@graphcommerce/magento-product'
import { ProductListItemsBase } from '@graphcommerce/magento-product'
import { productListRenderer } from './productListRenderer'

export type ProductListItemsProps = Omit<ProductItemsGridProps, 'renderers'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { breadcrumbs } from '@graphcommerce/next-config/config'
import { LayoutTitle, memoDeep, StickyBelowHeader, Container } from '@graphcommerce/next-ui'
import { ProductListItems, productListRenderer } from '../ProductListItems'
import { ProductListLayoutProps } from './types'
import type { ProductListLayoutProps } from './types'
import { Trans } from '@lingui/react/macro'

export const ProductListLayoutClassic = memoDeep(function ProductListLayoutClassic(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { Container, LayoutTitle, memoDeep, StickyBelowHeader } from '@graphcomme
import { Trans } from '@lingui/react/macro'
import { Typography } from '@mui/material'
import { ProductListItems, productListRenderer } from '../ProductListItems'
import { ProductListLayoutProps, useLayoutConfiguration } from './types'
import type { ProductListLayoutProps } from './types'
import { useLayoutConfiguration } from './types'

export const ProductListLayoutDefault = memoDeep(function ProductListLayoutDefault(
props: ProductListLayoutProps,
Expand Down
Loading
Loading