diff --git a/.changeset/afraid-ants-shout.md b/.changeset/afraid-ants-shout.md new file mode 100644 index 0000000000..78d32b2935 --- /dev/null +++ b/.changeset/afraid-ants-shout.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-product': patch +--- + +Hide ProductScroller components when no items are available diff --git a/.changeset/small-onions-marry.md b/.changeset/small-onions-marry.md new file mode 100644 index 0000000000..5ea66d7a72 --- /dev/null +++ b/.changeset/small-onions-marry.md @@ -0,0 +1,28 @@ +--- +'@graphcommerce/magento-cart-shipping-address': patch +'@graphcommerce/magento-cart-shipping-method': patch +'@graphcommerce/magento-product-configurable': patch +'@graphcommerce/magento-product-downloadable': patch +'@graphcommerce/magento-product-grouped': patch +'@graphcommerce/magento-product-bundle': patch +'@graphcommerce/mollie-magento-payment': patch +'@graphcommerce/magento-pagebuilder': patch +'@graphcommerce/magento-cart-items': patch +'@graphcommerce/magento-newsletter': patch +'@graphcommerce/magento-category': patch +'@graphcommerce/magento-customer': patch +'@graphcommerce/magento-wishlist': patch +'@graphcommerce/framer-scroller': patch +'@graphcommerce/magento-compare': patch +'@graphcommerce/magento-product': patch +'@graphcommerce/algolia-search': patch +'@graphcommerce/magento-review': patch +'@graphcommerce/magento-search': patch +'@graphcommerce/magento-store': patch +'@graphcommerce/ecommerce-ui': patch +'@graphcommerce/magento-cart': patch +'@graphcommerce/graphcms-ui': patch +'@graphcommerce/next-ui': patch +--- + +Made all component prop types exported diff --git a/.changeset/spotty-moons-jog.md b/.changeset/spotty-moons-jog.md new file mode 100644 index 0000000000..96d39433e1 --- /dev/null +++ b/.changeset/spotty-moons-jog.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-product-configurable': patch +--- + +Respect configurableVariantValues.gallery config when selecting a configurable variant. The image should only change to the simple product image when the config is set to true, otherwise the configurable image should remain. To keep this functionality, please set `configurableVariantValues: { gallery: true }` in your graphcommerce.config.js diff --git a/.changeset/ten-camels-repeat.md b/.changeset/ten-camels-repeat.md new file mode 100644 index 0000000000..58bd841511 --- /dev/null +++ b/.changeset/ten-camels-repeat.md @@ -0,0 +1,5 @@ +--- +'@graphcommerce/magento-product': patch +--- + +Allow adding elements after/between product list items (e.g. banners) diff --git a/.changeset/witty-beers-fail.md b/.changeset/witty-beers-fail.md new file mode 100644 index 0000000000..d466b5d2c2 --- /dev/null +++ b/.changeset/witty-beers-fail.md @@ -0,0 +1,11 @@ +--- +'@graphcommerce/magento-cart-shipping-method': patch +'@graphcommerce/magento-product-configurable': patch +'@graphcommerce/magento-customer': patch +'@graphcommerce/magento-wishlist': patch +'@graphcommerce/magento-product': patch +'@graphcommerce/ecommerce-ui': patch +'@graphcommerce/next-ui': patch +--- + +Allow changing various props for internal components diff --git a/packages/algolia-search/components/SearchBox/SearchBox.tsx b/packages/algolia-search/components/SearchBox/SearchBox.tsx index d289e3584a..7bf97839a5 100644 --- a/packages/algolia-search/components/SearchBox/SearchBox.tsx +++ b/packages/algolia-search/components/SearchBox/SearchBox.tsx @@ -7,7 +7,7 @@ import { useCallback, useEffect, useRef } from 'react' import type { UseSearchBoxProps } from 'react-instantsearch-hooks-web' import { useHits, useSearchBox } from 'react-instantsearch-hooks-web' -type SearchBoxProps = UseSearchBoxProps & SearchFormProps +export type SearchBoxProps = UseSearchBoxProps & SearchFormProps export function SearchBox(props: SearchBoxProps) { const { search, textFieldProps, sx = [] } = props diff --git a/packages/ecommerce-ui/components/ApolloError/ApolloErrorSnackbar.tsx b/packages/ecommerce-ui/components/ApolloError/ApolloErrorSnackbar.tsx index d6b3861059..ef65a93716 100644 --- a/packages/ecommerce-ui/components/ApolloError/ApolloErrorSnackbar.tsx +++ b/packages/ecommerce-ui/components/ApolloError/ApolloErrorSnackbar.tsx @@ -8,7 +8,7 @@ export type ApolloErrorSnackbarProps = { } & Pick export function ApolloErrorSnackbar(props: ApolloErrorSnackbarProps) { - const { error, action, ...passedProps } = props + const { error, ...passedProps } = props if (!error) return null diff --git a/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitButton.tsx b/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitButton.tsx index 599832a966..afd5cfbc3f 100644 --- a/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitButton.tsx +++ b/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitButton.tsx @@ -3,7 +3,7 @@ import { Button, IconSvg, iconChevronRight } from '@graphcommerce/next-ui' import type { ComposedSubmitRenderComponentProps } from '@graphcommerce/react-hook-form' import { forwardRef } from 'react' -type ComposedSubmitButtonProps = ComposedSubmitRenderComponentProps & +export type ComposedSubmitButtonProps = ComposedSubmitRenderComponentProps & Omit /** Makes a ComposedSubmitRenderComponent rendered as a LinkOrButton */ diff --git a/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitLinkOrButton.tsx b/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitLinkOrButton.tsx index 68247e48e2..572705d77b 100644 --- a/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitLinkOrButton.tsx +++ b/packages/ecommerce-ui/components/ComposedSubmitButton/ComposedSubmitLinkOrButton.tsx @@ -3,7 +3,7 @@ import { IconSvg, LinkOrButton, iconChevronRight } from '@graphcommerce/next-ui' import type { ComposedSubmitRenderComponentProps } from '@graphcommerce/react-hook-form' import { forwardRef } from 'react' -type ComposedLinkOrButtonProps = ComposedSubmitRenderComponentProps & +export type ComposedLinkOrButtonProps = ComposedSubmitRenderComponentProps & Omit /** Makes a ComposedSubmitRenderComponent rendered as a LinkOrButton */ diff --git a/packages/framer-scroller/components/ScrollerBar.tsx b/packages/framer-scroller/components/ScrollerBar.tsx index fe29cc24f2..c6eef51d69 100644 --- a/packages/framer-scroller/components/ScrollerBar.tsx +++ b/packages/framer-scroller/components/ScrollerBar.tsx @@ -11,7 +11,7 @@ type OwnerProps = { direction: 'x' | 'y' } -type ScrollerBarProps = OwnerProps & { +export type ScrollerBarProps = OwnerProps & { sx?: SxProps } diff --git a/packages/framer-scroller/components/ScrollerDot.tsx b/packages/framer-scroller/components/ScrollerDot.tsx index 5eafbb0cce..dc2d1b2ea8 100644 --- a/packages/framer-scroller/components/ScrollerDot.tsx +++ b/packages/framer-scroller/components/ScrollerDot.tsx @@ -15,7 +15,7 @@ type OwnerProps = { active: boolean } const { withState } = extendableComponent(name, parts) -type ScrollerDotProps = Omit & ItemState & { idx: number } +export type ScrollerDotProps = Omit & ItemState & { idx: number } const MotionBox = styled(m.div)({}) diff --git a/packages/framer-scroller/components/ScrollerThumbnail.tsx b/packages/framer-scroller/components/ScrollerThumbnail.tsx index 2fcb04054c..1ca1f4b11f 100644 --- a/packages/framer-scroller/components/ScrollerThumbnail.tsx +++ b/packages/framer-scroller/components/ScrollerThumbnail.tsx @@ -14,7 +14,7 @@ type OwnerProps = { active: boolean } const { withState } = extendableComponent(name, parts) -type ScrollerThumbnailProps = { +export type ScrollerThumbnailProps = { idx: number image: Pick layoutDependency: boolean diff --git a/packages/framer-scroller/components/ThumbnailContainer.tsx b/packages/framer-scroller/components/ThumbnailContainer.tsx index 6bf7fd0fae..3d431be632 100644 --- a/packages/framer-scroller/components/ThumbnailContainer.tsx +++ b/packages/framer-scroller/components/ThumbnailContainer.tsx @@ -6,7 +6,7 @@ import React, { useRef } from 'react' const MotionBox = styled(m.div)({}) -type ThumbnailContainerProps = { +export type ThumbnailContainerProps = { children: React.ReactNode sx?: SxProps layoutDependency: boolean diff --git a/packages/hygraph-ui/components/Asset/Asset.tsx b/packages/hygraph-ui/components/Asset/Asset.tsx index 105aebdcc0..0404328311 100644 --- a/packages/hygraph-ui/components/Asset/Asset.tsx +++ b/packages/hygraph-ui/components/Asset/Asset.tsx @@ -16,7 +16,7 @@ function isImage(asset: AssetFragment): asset is ImageAsset { return !!(asset.width && asset.height) } -type AssetProps = { +export type AssetProps = { asset: AssetFragment sx?: SxProps } & Omit diff --git a/packages/magento-cart-items/components/EditCartItem/EditCartItemForm/EditCartItemForm.tsx b/packages/magento-cart-items/components/EditCartItem/EditCartItemForm/EditCartItemForm.tsx index 056f5a1c5a..b6d420d3df 100644 --- a/packages/magento-cart-items/components/EditCartItem/EditCartItemForm/EditCartItemForm.tsx +++ b/packages/magento-cart-items/components/EditCartItem/EditCartItemForm/EditCartItemForm.tsx @@ -13,7 +13,7 @@ import { useRemoveItemFromCart } from '../../../hooks/useRemoveItemFromCart' import type { CartItemToCartItemInputProps } from '../../../utils/cartItemToCartItemInput' import { cartItemToCartItemInput } from '../../../utils/cartItemToCartItemInput' -type EditInitProps = CartItemToCartItemInputProps & AddToCartItemSelector +export type EditInitProps = CartItemToCartItemInputProps & AddToCartItemSelector function EditInit(props: EditInitProps) { const { product, selectors, cartItem, index = 0 } = props diff --git a/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx b/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx index b9bc3094e0..a885b3343b 100644 --- a/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx +++ b/packages/magento-cart-items/components/SelectedCustomizableOptions/SelectedCustomizableOptions.tsx @@ -4,7 +4,7 @@ import { Box } from '@mui/material' import type { CartItemFragment } from '../../Api/CartItem.gql' import type { SelectedCustomizableOptionFragment } from './SelectedCustomizableOption.gql' -type SelectedCustomizableOptionProps = CartItemFragment & { +export type SelectedCustomizableOptionProps = CartItemFragment & { customizable_options?: (SelectedCustomizableOptionFragment | null | undefined)[] | null } diff --git a/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressActionCard.tsx b/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressActionCard.tsx index e1520b45f5..b86bcc8750 100644 --- a/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressActionCard.tsx +++ b/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressActionCard.tsx @@ -6,7 +6,7 @@ import { Trans } from '@lingui/react' import { Button } from '@mui/material' import { useRouter } from 'next/router' -type CustomerAddressActionCardProps = ActionCardItemRenderProps< +export type CustomerAddressActionCardProps = ActionCardItemRenderProps< CustomerAddressFragment | null | undefined > diff --git a/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx b/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx index 8e638add84..b5ac7ac30c 100644 --- a/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx +++ b/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx @@ -30,7 +30,7 @@ import type { } from './SetCustomerShippingBillingAddressOnCart.gql' import { SetCustomerShippingBillingAddressOnCartDocument } from './SetCustomerShippingBillingAddressOnCart.gql' -type CustomerAddressListProps = Pick & { +export type CustomerAddressListProps = Pick & { children?: React.ReactNode sx?: SxProps } diff --git a/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodActionCard.tsx b/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodActionCard.tsx index 1eac51beea..550825c437 100644 --- a/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodActionCard.tsx +++ b/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodActionCard.tsx @@ -6,7 +6,7 @@ import { Trans } from '@lingui/react' import { Button, Chip } from '@mui/material' import type { AvailableShippingMethodFragment } from '../../AvailableShippingMethod/AvailableShippingMethod.gql' -type ShippingMethodActionCardProps = ActionCardItemRenderProps< +export type ShippingMethodActionCardProps = ActionCardItemRenderProps< AvailableShippingMethodFragment | null | undefined > diff --git a/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodForm.tsx b/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodForm.tsx index 0e5e1bc127..8f128a8a65 100644 --- a/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodForm.tsx +++ b/packages/magento-cart-shipping-method/components/ShippingMethodForm/ShippingMethodForm.tsx @@ -57,6 +57,7 @@ export function ShippingMethodForm(props: ShippingMethodFormProps) { ...method, disabled: !method?.available, value: `${method?.carrier_code}-${method?.method_code ?? ''}`, + method_title: method?.method_title || '', })), [availableMethods], ) diff --git a/packages/magento-cart/components/CartFab/CartFab.tsx b/packages/magento-cart/components/CartFab/CartFab.tsx index 54966b52c6..2cb4e6f7e9 100644 --- a/packages/magento-cart/components/CartFab/CartFab.tsx +++ b/packages/magento-cart/components/CartFab/CartFab.tsx @@ -23,7 +23,7 @@ export type CartFabProps = { BadgeProps?: BadgeProps } & Pick -type CartFabContentProps = CartFabProps & CartTotalQuantityFragment +export type CartFabContentProps = CartFabProps & CartTotalQuantityFragment const MotionDiv = styled(m.div)({}) diff --git a/packages/magento-cart/components/CartItemSummary/CartItemSummary.tsx b/packages/magento-cart/components/CartItemSummary/CartItemSummary.tsx index 4c765437d2..89dc2f9037 100644 --- a/packages/magento-cart/components/CartItemSummary/CartItemSummary.tsx +++ b/packages/magento-cart/components/CartItemSummary/CartItemSummary.tsx @@ -30,7 +30,7 @@ const parts = [ ] as const const { classes } = extendableComponent(name, parts) -type OrderSummaryProps = ActionCardLayoutProps & { +export type OrderSummaryProps = ActionCardLayoutProps & { sx?: SxProps itemProps?: Omit< CartItemActionCardProps, diff --git a/packages/magento-cart/components/EmptyCart/EmptyCart.tsx b/packages/magento-cart/components/EmptyCart/EmptyCart.tsx index 9a994c0eb8..5ef760f5f3 100644 --- a/packages/magento-cart/components/EmptyCart/EmptyCart.tsx +++ b/packages/magento-cart/components/EmptyCart/EmptyCart.tsx @@ -5,7 +5,7 @@ import type { SxProps, Theme } from '@mui/material' import { Button } from '@mui/material' import React from 'react' -type EmptyCartProps = { +export type EmptyCartProps = { children?: React.ReactNode sx?: SxProps } & Pick diff --git a/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumb.tsx b/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumb.tsx index eb1ce34061..9aa6281c68 100644 --- a/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumb.tsx +++ b/packages/magento-category/components/CategoryBreadcrumb/CategoryBreadcrumb.tsx @@ -4,7 +4,8 @@ import type { BreadcrumbsProps } from '@mui/material' import { Breadcrumbs, Link, Typography } from '@mui/material' import type { CategoryBreadcrumbFragment } from './CategoryBreadcrumb.gql' -type CategoryPageBreadcrumbsProps = CategoryBreadcrumbFragment & Omit +export type CategoryPageBreadcrumbsProps = CategoryBreadcrumbFragment & + Omit /** * @deprecated Please use CategoryBreadcrumbs diff --git a/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx b/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx index 417b37f32a..657139b5a7 100644 --- a/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx +++ b/packages/magento-category/components/CategoryChildren/CategoryChildren.tsx @@ -6,7 +6,7 @@ import type { SxProps, Theme } from '@mui/material' import { Box, Link } from '@mui/material' import type { CategoryChildrenFragment } from './CategoryChildren.gql' -type CategoryChildrenProps = Omit & { +export type CategoryChildrenProps = Omit & { params: ProductListParams sx?: SxProps } diff --git a/packages/magento-category/components/CategoryHeroNav/CategoryHeroNavTitle.tsx b/packages/magento-category/components/CategoryHeroNav/CategoryHeroNavTitle.tsx index 59dad634eb..71e747532f 100644 --- a/packages/magento-category/components/CategoryHeroNav/CategoryHeroNavTitle.tsx +++ b/packages/magento-category/components/CategoryHeroNav/CategoryHeroNavTitle.tsx @@ -2,7 +2,7 @@ import { LayoutTitle } from '@graphcommerce/next-ui' import type { SxProps, Theme } from '@mui/material' import { memo } from 'react' -type CategoryHeroNavTitleProps = { +export type CategoryHeroNavTitleProps = { children: React.ReactNode sx?: SxProps } diff --git a/packages/magento-compare/components/CompareFab.tsx b/packages/magento-compare/components/CompareFab.tsx index d7f2e21a88..0cd6c4b2cb 100644 --- a/packages/magento-compare/components/CompareFab.tsx +++ b/packages/magento-compare/components/CompareFab.tsx @@ -18,7 +18,7 @@ export type CompareFabProps = { sx?: SxProps } & Pick -type CompareFabContentProps = CompareFabProps & { total_quantity: number } +export type CompareFabContentProps = CompareFabProps & { total_quantity: number } const MotionDiv = styled(m.div)({}) diff --git a/packages/magento-compare/components/CompareListForm.tsx b/packages/magento-compare/components/CompareListForm.tsx index a2333ac4c4..06f26ffaf2 100644 --- a/packages/magento-compare/components/CompareListForm.tsx +++ b/packages/magento-compare/components/CompareListForm.tsx @@ -4,7 +4,7 @@ import { filterNonNullableKeys, nonNullable } from '@graphcommerce/next-ui' import React, { createContext, useContext, useEffect, useMemo, useRef } from 'react' import { useCompareList } from '../hooks' -type CompareListFormProps = { children?: React.ReactNode } +export type CompareListFormProps = { children?: React.ReactNode } type FormFields = { selected: number[] } diff --git a/packages/magento-compare/components/CompareListIntroText.tsx b/packages/magento-compare/components/CompareListIntroText.tsx index 58d693a53e..a7eb8f1e26 100644 --- a/packages/magento-compare/components/CompareListIntroText.tsx +++ b/packages/magento-compare/components/CompareListIntroText.tsx @@ -1,6 +1,6 @@ import { Box, Container } from '@mui/material' -type CompareListIntroTextProps = { +export type CompareListIntroTextProps = { children: React.ReactNode } diff --git a/packages/magento-compare/components/CompareMessageSnackbar.tsx b/packages/magento-compare/components/CompareMessageSnackbar.tsx index ff8271943d..6fe5a93bc6 100644 --- a/packages/magento-compare/components/CompareMessageSnackbar.tsx +++ b/packages/magento-compare/components/CompareMessageSnackbar.tsx @@ -2,7 +2,7 @@ import { Button, IconSvg, MessageSnackbar, iconChevronRight } from '@graphcommer import { Trans } from '@lingui/react' import type { SetStateAction } from 'react' -type CompareMessageSnackbarProps = { +export type CompareMessageSnackbarProps = { count: number | undefined name: string | null | undefined displayMessageBar: boolean diff --git a/packages/magento-compare/components/CompareProductButton.tsx b/packages/magento-compare/components/CompareProductButton.tsx index 7c93402402..135c6154c7 100644 --- a/packages/magento-compare/components/CompareProductButton.tsx +++ b/packages/magento-compare/components/CompareProductButton.tsx @@ -10,7 +10,7 @@ import { useCompareSummary } from '../hooks' import { useCompareListUidCreate } from '../hooks/useCompareListUidCreate' import { CompareMessageSnackbar } from './CompareMessageSnackbar' -type CompareProductButtonProps = CompareProductIdInternalFragment & { sx?: SxProps } +export type CompareProductButtonProps = CompareProductIdInternalFragment & { sx?: SxProps } export function CompareProductButton(props: CompareProductButtonProps) { const { id, name, sx } = props diff --git a/packages/magento-compare/components/CompareProductToggle.tsx b/packages/magento-compare/components/CompareProductToggle.tsx index 7f6ab15af0..daf35620b8 100644 --- a/packages/magento-compare/components/CompareProductToggle.tsx +++ b/packages/magento-compare/components/CompareProductToggle.tsx @@ -5,7 +5,7 @@ import { i18n } from '@lingui/core' import { Trans } from '@lingui/react' // eslint-disable-next-line @typescript-eslint/no-restricted-imports import type { SxProps, Theme } from '@mui/material' -import { Checkbox, NoSsr, alpha, useTheme } from '@mui/material' +import { alpha, Checkbox, NoSsr, useTheme } from '@mui/material' import { useState } from 'react' import type { CompareProductIdInternalFragment } from '../graphql' import { AddProductsToCompareListDocument } from '../graphql/AddProductsToCompareList.gql' @@ -14,7 +14,7 @@ import { useCompareSummary } from '../hooks' import { useCompareListUidCreate } from '../hooks/useCompareListUidCreate' import { CompareMessageSnackbar } from './CompareMessageSnackbar' -type CompareProductToggleProps = { +export type CompareProductToggleProps = { sx?: SxProps product: CompareProductIdInternalFragment } & Pick diff --git a/packages/magento-compare/components/EmptyCompareListButton.tsx b/packages/magento-compare/components/EmptyCompareListButton.tsx index b307f3b03b..9c5237c02c 100644 --- a/packages/magento-compare/components/EmptyCompareListButton.tsx +++ b/packages/magento-compare/components/EmptyCompareListButton.tsx @@ -7,7 +7,7 @@ import { DeleteCompareListDocument } from '../graphql/DeleteCompareList.gql' import { useCompareList } from '../hooks' import { useClearCurrentCompareListUid } from '../hooks/useClearCurrentCompareListUid' -type EmptyCompareListButtonProps = Omit +export type EmptyCompareListButtonProps = Omit export function EmptyCompareListButton(props: EmptyCompareListButtonProps) { const { button = {}, link = {} } = props diff --git a/packages/magento-customer/components/AddressMultiLine/AddressMultiLine.tsx b/packages/magento-customer/components/AddressMultiLine/AddressMultiLine.tsx index c6c618a3c9..72c2d37e30 100644 --- a/packages/magento-customer/components/AddressMultiLine/AddressMultiLine.tsx +++ b/packages/magento-customer/components/AddressMultiLine/AddressMultiLine.tsx @@ -13,7 +13,7 @@ import type { CustomerAddressFragment } from '../CreateCustomerAddressForm/Custo // return exports.getEuMembers().indexOf(code.toUpperCase()) != -1; // }; -type AddressMultiLineProps = CustomerAddressFragment & { sx?: SxProps } +export type AddressMultiLineProps = CustomerAddressFragment & { sx?: SxProps } const name = 'AddressMultiLine' const parts = ['root', 'title'] as const diff --git a/packages/magento-customer/components/CancelOrder/CancelOrderForm.tsx b/packages/magento-customer/components/CancelOrder/CancelOrderForm.tsx index 28627d4ec7..a91163072a 100644 --- a/packages/magento-customer/components/CancelOrder/CancelOrderForm.tsx +++ b/packages/magento-customer/components/CancelOrder/CancelOrderForm.tsx @@ -18,7 +18,7 @@ import type { OrderDetailsFragment } from '../OrderDetails/OrderDetails.gql' import type { CancelOrderMutation, CancelOrderMutationVariables } from './CancelOrder.gql' import { CancelOrderDocument } from './CancelOrder.gql' -type CancelOrderFormProps = { +export type CancelOrderFormProps = { order: OrderDetailsFragment } & Omit diff --git a/packages/magento-customer/components/ChangeNameForm/ChangeNameForm.tsx b/packages/magento-customer/components/ChangeNameForm/ChangeNameForm.tsx index ac972f9d8e..0be357510f 100644 --- a/packages/magento-customer/components/ChangeNameForm/ChangeNameForm.tsx +++ b/packages/magento-customer/components/ChangeNameForm/ChangeNameForm.tsx @@ -5,7 +5,7 @@ import { ApolloCustomerErrorAlert } from '../ApolloCustomerError/ApolloCustomerE import { NameFields } from '../NameFields/NameFields' import { UpdateCustomerNameDocument } from './UpdateCustomerName.gql' -type ChangeNameFormProps = { +export type ChangeNameFormProps = { prefix?: string firstname: string lastname: string diff --git a/packages/magento-customer/components/CustomerFab/CustomerFab.tsx b/packages/magento-customer/components/CustomerFab/CustomerFab.tsx index 35416c9fab..68bd1d03d7 100644 --- a/packages/magento-customer/components/CustomerFab/CustomerFab.tsx +++ b/packages/magento-customer/components/CustomerFab/CustomerFab.tsx @@ -11,7 +11,7 @@ import React from 'react' import type { UseCustomerSessionReturn } from '../../hooks' import { useCustomerAccountCanSignIn, useCustomerSession } from '../../hooks' -type CustomerFabContentProps = { +export type CustomerFabContentProps = { icon?: React.ReactNode authHref: string guestHref: string diff --git a/packages/magento-customer/components/CustomerMenuFabItem/CustomerMenuFabItem.tsx b/packages/magento-customer/components/CustomerMenuFabItem/CustomerMenuFabItem.tsx index 0467091e41..bb39783e24 100644 --- a/packages/magento-customer/components/CustomerMenuFabItem/CustomerMenuFabItem.tsx +++ b/packages/magento-customer/components/CustomerMenuFabItem/CustomerMenuFabItem.tsx @@ -7,7 +7,7 @@ import { useCustomerAccountCanSignIn } from '../../hooks' import type { UseCustomerSessionReturn } from '../../hooks/useCustomerSession' import { useCustomerSession } from '../../hooks/useCustomerSession' -type CustomerMenuFabItemProps = { +export type CustomerMenuFabItemProps = { icon?: React.ReactNode children: React.ReactNode authHref: string diff --git a/packages/magento-customer/components/EditAddressForm/EditAddressForm.tsx b/packages/magento-customer/components/EditAddressForm/EditAddressForm.tsx index 48119e4d5a..6c8ed8c196 100644 --- a/packages/magento-customer/components/EditAddressForm/EditAddressForm.tsx +++ b/packages/magento-customer/components/EditAddressForm/EditAddressForm.tsx @@ -12,7 +12,7 @@ import { CompanyFields } from '../CompanyFields' import { NameFields } from '../NameFields/NameFields' import { UpdateCustomerAddressDocument } from './UpdateCustomerAddress.gql' -type EditAddressFormProps = { +export type EditAddressFormProps = { address?: AccountAddressFragment sx?: SxProps } diff --git a/packages/magento-customer/components/ForgotPasswordForm/ForgotPasswordForm.tsx b/packages/magento-customer/components/ForgotPasswordForm/ForgotPasswordForm.tsx index 0498dd5a0c..c50a52ae3f 100644 --- a/packages/magento-customer/components/ForgotPasswordForm/ForgotPasswordForm.tsx +++ b/packages/magento-customer/components/ForgotPasswordForm/ForgotPasswordForm.tsx @@ -10,8 +10,12 @@ import { ApolloCustomerErrorAlert } from '../ApolloCustomerError/ApolloCustomerE import type { ForgotPasswordMutation, ForgotPasswordMutationVariables } from './ForgotPassword.gql' import { ForgotPasswordDocument } from './ForgotPassword.gql' -export function ForgotPasswordForm(props: { sx?: SxProps }) { - const { sx = [] } = props +export type ForgotPasswordFormProps = { + sx?: SxProps + buttonProps?: React.ComponentProps +} +export function ForgotPasswordForm(props: ForgotPasswordFormProps) { + const { sx = [], buttonProps } = props const form = useFormGqlMutation( ForgotPasswordDocument, ) @@ -62,6 +66,7 @@ export function ForgotPasswordForm(props: { sx?: SxProps }) { color='primary' variant='pill' size='large' + {...buttonProps} > diff --git a/packages/magento-customer/components/NameFields/NameFields.tsx b/packages/magento-customer/components/NameFields/NameFields.tsx index 5263fe29e3..24faf9f513 100644 --- a/packages/magento-customer/components/NameFields/NameFields.tsx +++ b/packages/magento-customer/components/NameFields/NameFields.tsx @@ -13,7 +13,7 @@ type NameFieldValues = { prefix?: string } -type NameFieldProps = { +export type NameFieldProps = { // eslint-disable-next-line @typescript-eslint/no-explicit-any form: UseFormReturn readOnly?: boolean diff --git a/packages/magento-customer/components/NoOrdersFound/NoOrdersFound.tsx b/packages/magento-customer/components/NoOrdersFound/NoOrdersFound.tsx index 83811123c8..85cfe9fbf8 100644 --- a/packages/magento-customer/components/NoOrdersFound/NoOrdersFound.tsx +++ b/packages/magento-customer/components/NoOrdersFound/NoOrdersFound.tsx @@ -6,7 +6,7 @@ import { Box } from '@mui/material' const parts = ['root'] as const const { classes } = extendableComponent('NoOrdersFound', parts) -type NoOrdersFoundProps = { sx?: SxProps } +export type NoOrdersFoundProps = { sx?: SxProps } export function NoOrdersFound(props: NoOrdersFoundProps) { const { sx = [] } = props diff --git a/packages/magento-customer/components/OrderCard/OrderCard.tsx b/packages/magento-customer/components/OrderCard/OrderCard.tsx index 19c2939d8a..426b71cdb0 100644 --- a/packages/magento-customer/components/OrderCard/OrderCard.tsx +++ b/packages/magento-customer/components/OrderCard/OrderCard.tsx @@ -8,7 +8,7 @@ import { OrderStateLabel } from '../OrderStateLabel/OrderStateLabel' import { TrackingLink } from '../TrackingLink/TrackingLink' import type { OrderCardFragment } from './OrderCard.gql' -type OrderCardProps = Partial & { +export type OrderCardProps = Partial & { loading?: boolean images?: UseOrderCardItemImages sx?: SxProps diff --git a/packages/magento-customer/components/OrderItem/OrderItem.tsx b/packages/magento-customer/components/OrderItem/OrderItem.tsx index 5846af7f53..3be6e6b928 100644 --- a/packages/magento-customer/components/OrderItem/OrderItem.tsx +++ b/packages/magento-customer/components/OrderItem/OrderItem.tsx @@ -7,7 +7,7 @@ import { Box } from '@mui/material' import type { OrderCardItemImageFragment } from '../../hooks/OrderCardItemImage.gql' import type { OrderItemFragment } from './OrderItem.gql' -type OrderItemProps = OrderItemFragment & Omit +export type OrderItemProps = OrderItemFragment & Omit const rowImageSize = responsiveVal(70, 110) diff --git a/packages/magento-customer/components/OrderStateLabel/OrderStateLabelInline.tsx b/packages/magento-customer/components/OrderStateLabel/OrderStateLabelInline.tsx index 7e87fe9119..30a9dae0ee 100644 --- a/packages/magento-customer/components/OrderStateLabel/OrderStateLabelInline.tsx +++ b/packages/magento-customer/components/OrderStateLabel/OrderStateLabelInline.tsx @@ -2,7 +2,7 @@ import { alpha } from '@mui/material' import type { OrderStateLabelProps } from './OrderStateLabel' import { OrderStateLabel } from './OrderStateLabel' -type OrderStateLabelInlineProps = OrderStateLabelProps +export type OrderStateLabelInlineProps = OrderStateLabelProps export function OrderStateLabelInline(props: OrderStateLabelInlineProps) { const { sx = [] } = props diff --git a/packages/magento-customer/components/ResetPasswordForm/ResetPasswordForm.tsx b/packages/magento-customer/components/ResetPasswordForm/ResetPasswordForm.tsx index e58f304efc..4e3a4687b4 100644 --- a/packages/magento-customer/components/ResetPasswordForm/ResetPasswordForm.tsx +++ b/packages/magento-customer/components/ResetPasswordForm/ResetPasswordForm.tsx @@ -8,12 +8,13 @@ import { ValidatedPasswordElement } from '../ValidatedPasswordElement/ValidatedP import type { ResetPasswordMutation, ResetPasswordMutationVariables } from './ResetPassword.gql' import { ResetPasswordDocument } from './ResetPassword.gql' -type ResetPasswordFormProps = { +export type ResetPasswordFormProps = { token: string + buttonProps?: React.ComponentProps } export function ResetPasswordForm(props: ResetPasswordFormProps) { - const { token } = props + const { token, buttonProps } = props const form = useFormGqlMutation< ResetPasswordMutation, @@ -80,6 +81,7 @@ export function ResetPasswordForm(props: ResetPasswordFormProps) { color='primary' variant='pill' size='large' + {...buttonProps} > diff --git a/packages/magento-customer/components/SignInForm/SignInFormInline.tsx b/packages/magento-customer/components/SignInForm/SignInFormInline.tsx index cba142ba91..239284800f 100644 --- a/packages/magento-customer/components/SignInForm/SignInFormInline.tsx +++ b/packages/magento-customer/components/SignInForm/SignInFormInline.tsx @@ -6,7 +6,7 @@ import { Box, Link } from '@mui/material' import { useSignInForm } from '../../hooks/useSignInForm' import type { SignInMutationVariables } from './SignIn.gql' -type InlineSignInFormProps = Omit & { +export type InlineSignInFormProps = Omit & { sx?: SxProps children?: React.ReactNode } diff --git a/packages/magento-customer/components/SignOutForm/SignOutForm.tsx b/packages/magento-customer/components/SignOutForm/SignOutForm.tsx index d7ed2460ff..a7e71e8353 100644 --- a/packages/magento-customer/components/SignOutForm/SignOutForm.tsx +++ b/packages/magento-customer/components/SignOutForm/SignOutForm.tsx @@ -7,7 +7,7 @@ import { ApolloCustomerErrorAlert } from '../ApolloCustomerError/ApolloCustomerE import { SignOutFormDocument } from './SignOutForm.gql' import { signOut } from './signOut' -type SignOutFormProps = { +export type SignOutFormProps = { button: (props: { formState: FormState> }) => React.ReactNode } diff --git a/packages/magento-customer/components/SignUpForm/SignUpForm.tsx b/packages/magento-customer/components/SignUpForm/SignUpForm.tsx index 7da85de749..9e745df018 100644 --- a/packages/magento-customer/components/SignUpForm/SignUpForm.tsx +++ b/packages/magento-customer/components/SignUpForm/SignUpForm.tsx @@ -13,7 +13,7 @@ import { ValidatedPasswordElement } from '../ValidatedPasswordElement/ValidatedP import type { SignUpMutation, SignUpMutationVariables } from './SignUp.gql' import { SignUpDocument } from './SignUp.gql' -type SignUpFormProps = { email: string } +export type SignUpFormProps = { email: string } export function SignUpForm(props: SignUpFormProps) { const { email } = props diff --git a/packages/magento-customer/components/SignUpForm/SignUpFormInline.tsx b/packages/magento-customer/components/SignUpForm/SignUpFormInline.tsx index c0ad08ff2d..ff9aeaa686 100644 --- a/packages/magento-customer/components/SignUpForm/SignUpFormInline.tsx +++ b/packages/magento-customer/components/SignUpForm/SignUpFormInline.tsx @@ -12,7 +12,7 @@ import { ValidatedPasswordElement } from '../ValidatedPasswordElement/ValidatedP import type { SignUpMutation, SignUpMutationVariables } from './SignUp.gql' import { SignUpDocument } from './SignUp.gql' -type SignUpFormInlineProps = Pick & { +export type SignUpFormInlineProps = Pick & { children?: React.ReactNode firstname?: string lastname?: string diff --git a/packages/magento-customer/components/UpdateCustomerEmailForm/UpdateCustomerEmailForm.tsx b/packages/magento-customer/components/UpdateCustomerEmailForm/UpdateCustomerEmailForm.tsx index 9598c10e49..2c28caa4d7 100644 --- a/packages/magento-customer/components/UpdateCustomerEmailForm/UpdateCustomerEmailForm.tsx +++ b/packages/magento-customer/components/UpdateCustomerEmailForm/UpdateCustomerEmailForm.tsx @@ -19,7 +19,7 @@ import type { } from './UpdateCustomerEmail.gql' import { UpdateCustomerEmailDocument } from './UpdateCustomerEmail.gql' -type UpdateCustomerEmailFormProps = { +export type UpdateCustomerEmailFormProps = { email: string } diff --git a/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx b/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx index b6fc1f9e22..505bd21e94 100644 --- a/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx +++ b/packages/magento-customer/components/WaitForCustomer/WaitForCustomer.tsx @@ -8,7 +8,7 @@ import React from 'react' import { useCustomerSession } from '../../hooks/useCustomerSession' import { ApolloCustomerErrorFullPage } from '../ApolloCustomerError/ApolloCustomerErrorFullPage' -type WaitForCustomerProps = Omit & +export type WaitForCustomerProps = Omit & Pick & { waitFor?: WaitForQueriesProps['waitFor'] fallback?: React.ReactNode diff --git a/packages/magento-newsletter/components/CheckoutNewsletter/CheckoutNewsletter.tsx b/packages/magento-newsletter/components/CheckoutNewsletter/CheckoutNewsletter.tsx index 0c901d1f19..0fa78c5fea 100644 --- a/packages/magento-newsletter/components/CheckoutNewsletter/CheckoutNewsletter.tsx +++ b/packages/magento-newsletter/components/CheckoutNewsletter/CheckoutNewsletter.tsx @@ -11,7 +11,7 @@ import { SubscribeCustomerDocument } from './SubscribeCustomer.gql' import type { SubscribeGuestMutation, SubscribeGuestMutationVariables } from './SubscribeGuest.gql' import { SubscribeGuestDocument } from './SubscribeGuest.gql' -type CheckoutNewsletterProps = { +export type CheckoutNewsletterProps = { step: number checked?: boolean label: string diff --git a/packages/magento-newsletter/components/GuestNewsletter/GuestNewsletter.tsx b/packages/magento-newsletter/components/GuestNewsletter/GuestNewsletter.tsx index b40411294c..402e57996f 100644 --- a/packages/magento-newsletter/components/GuestNewsletter/GuestNewsletter.tsx +++ b/packages/magento-newsletter/components/GuestNewsletter/GuestNewsletter.tsx @@ -4,7 +4,7 @@ import { Trans } from '@lingui/react' import type { SxProps, Theme } from '@mui/material' import { GuestNewsletterToggleDocument } from '../GuestNewsletterToggle/GuestNewsletterToggle.gql' -type GuestNewsletterProps = { +export type GuestNewsletterProps = { sx?: SxProps } diff --git a/packages/magento-newsletter/components/SignupNewsletter/SignupNewsletter.tsx b/packages/magento-newsletter/components/SignupNewsletter/SignupNewsletter.tsx index bde47ddc01..a7baa32f5a 100644 --- a/packages/magento-newsletter/components/SignupNewsletter/SignupNewsletter.tsx +++ b/packages/magento-newsletter/components/SignupNewsletter/SignupNewsletter.tsx @@ -8,7 +8,7 @@ import { CustomerNewsletterToggle } from '../CustomerNewsletterToggle/CustomerNe import { GuestNewsletterToggle } from '../GuestNewsletterToggle/GuestNewsletterToggle' import { GetCartEmailDocument } from './GetCartEmail.gql' -type SignupNewsletterProps = { sx?: SxProps } +export type SignupNewsletterProps = { sx?: SxProps } const name = 'SignupNewsletter' diff --git a/packages/magento-pagebuilder/ContentTypes/Slider/AutoScroll.tsx b/packages/magento-pagebuilder/ContentTypes/Slider/AutoScroll.tsx index 90adc96a38..c32a31e160 100644 --- a/packages/magento-pagebuilder/ContentTypes/Slider/AutoScroll.tsx +++ b/packages/magento-pagebuilder/ContentTypes/Slider/AutoScroll.tsx @@ -1,7 +1,7 @@ import { useScrollTo, useScrollerContext } from '@graphcommerce/framer-scroller' import { useEffect } from 'react' -type AutoScrollProps = { +export type AutoScrollProps = { timePerSlide?: number pause?: boolean } diff --git a/packages/magento-pagebuilder/components/ButtonLink/ButtonLink.tsx b/packages/magento-pagebuilder/components/ButtonLink/ButtonLink.tsx index 01cd5edd46..11f8d06fd7 100644 --- a/packages/magento-pagebuilder/components/ButtonLink/ButtonLink.tsx +++ b/packages/magento-pagebuilder/components/ButtonLink/ButtonLink.tsx @@ -10,7 +10,7 @@ import React from 'react' import { RouteDocument } from '../../Route.gql' import type { ButtonLinkProps } from './getButtonLinkProps' -type ButtonLinkComponentProps = ButtonLinkProps & { +export type ButtonLinkComponentProps = ButtonLinkProps & { sx?: SxProps } diff --git a/packages/magento-pagebuilder/components/MediaBackground/ImageBackground.tsx b/packages/magento-pagebuilder/components/MediaBackground/ImageBackground.tsx index 9b70325100..75ff64cbee 100644 --- a/packages/magento-pagebuilder/components/MediaBackground/ImageBackground.tsx +++ b/packages/magento-pagebuilder/components/MediaBackground/ImageBackground.tsx @@ -3,7 +3,7 @@ import type { SxProps, Theme } from '@mui/material' import { extractImageBackgroundProps } from './extractImageBackgroundProps' import type { ImageBackgroundProps } from './getImageBackgroundProps' -type ImageBackgroundComponentProps = ImageBackgroundProps & { +export type ImageBackgroundComponentProps = ImageBackgroundProps & { sx?: SxProps } diff --git a/packages/magento-pagebuilder/components/MediaBackground/MediaBackground.tsx b/packages/magento-pagebuilder/components/MediaBackground/MediaBackground.tsx index 161a92ca02..d5e196169d 100644 --- a/packages/magento-pagebuilder/components/MediaBackground/MediaBackground.tsx +++ b/packages/magento-pagebuilder/components/MediaBackground/MediaBackground.tsx @@ -3,7 +3,7 @@ import { ImageBackground } from './ImageBackground' import { VideoBackground } from './VideoBackground' import type { MediaBackgroundProps } from './getMediaBackgroundProps' -type MediaBackgroundComponentProps = MediaBackgroundProps & { +export type MediaBackgroundComponentProps = MediaBackgroundProps & { sx?: SxProps } diff --git a/packages/magento-pagebuilder/components/MediaBackground/VideoBackground.tsx b/packages/magento-pagebuilder/components/MediaBackground/VideoBackground.tsx index 274132d820..9bba6749e0 100644 --- a/packages/magento-pagebuilder/components/MediaBackground/VideoBackground.tsx +++ b/packages/magento-pagebuilder/components/MediaBackground/VideoBackground.tsx @@ -3,7 +3,7 @@ import { Box, styled } from '@mui/material' import { YoutubeVideo } from './YoutubeVideo' import type { VideoBackgroundProps } from './getVideoBackgroundProps' -type VideoBackgroundComponentProps = VideoBackgroundProps & { +export type VideoBackgroundComponentProps = VideoBackgroundProps & { sx?: SxProps } diff --git a/packages/magento-pagebuilder/components/MediaBackground/YoutubeVideo.tsx b/packages/magento-pagebuilder/components/MediaBackground/YoutubeVideo.tsx index 72a588a7af..1aa0434c88 100644 --- a/packages/magento-pagebuilder/components/MediaBackground/YoutubeVideo.tsx +++ b/packages/magento-pagebuilder/components/MediaBackground/YoutubeVideo.tsx @@ -2,7 +2,7 @@ import type { SxProps, Theme } from '@mui/material' import { styled } from '@mui/material' import type { VideoBackgroundProps } from './getVideoBackgroundProps' -type YoutubeVideoProps = { +export type YoutubeVideoProps = { youtubeId: string sx?: SxProps } & Pick diff --git a/packages/magento-pagebuilder/components/Pagebuilder/Pagebuilder.tsx b/packages/magento-pagebuilder/components/Pagebuilder/Pagebuilder.tsx index 88920d0154..4f6d7ac97f 100644 --- a/packages/magento-pagebuilder/components/Pagebuilder/Pagebuilder.tsx +++ b/packages/magento-pagebuilder/components/Pagebuilder/Pagebuilder.tsx @@ -4,7 +4,7 @@ import { PagebuilderProvider } from './PagebuilderProvider' import { PagebuilderRender } from './PagebuilderRender' import { isPagebuilderValue } from './isPagebuilderValue' -type PagebuilderProps = { +export type PagebuilderProps = { pagebuilder: unknown /** The children are only rendered when there is no pagebuilder content. */ children: React.ReactNode diff --git a/packages/magento-pagebuilder/components/Pagebuilder/PagebuilderProvider.tsx b/packages/magento-pagebuilder/components/Pagebuilder/PagebuilderProvider.tsx index 71f54f421c..07fd84136e 100644 --- a/packages/magento-pagebuilder/components/Pagebuilder/PagebuilderProvider.tsx +++ b/packages/magento-pagebuilder/components/Pagebuilder/PagebuilderProvider.tsx @@ -1,7 +1,7 @@ import React, { useMemo } from 'react' import type { GetRenderComponent } from '../../types' -type PagebuilderContext = { +export type PagebuilderContext = { getComponentByType: GetRenderComponent } const pagebuilerContext = React.createContext(undefined as unknown as PagebuilderContext) @@ -10,7 +10,7 @@ if (process.env.NODE_ENV !== 'production') { pagebuilerContext.displayName = 'PagebuilerContext' } -type PagebuilderContextProps = { +export type PagebuilderContextProps = { children: React.ReactNode } & PagebuilderContext diff --git a/packages/magento-pagebuilder/components/TextRenderer/TextRenderer.tsx b/packages/magento-pagebuilder/components/TextRenderer/TextRenderer.tsx index 02efc288d2..03800306bc 100644 --- a/packages/magento-pagebuilder/components/TextRenderer/TextRenderer.tsx +++ b/packages/magento-pagebuilder/components/TextRenderer/TextRenderer.tsx @@ -5,7 +5,7 @@ export type TextProps = { textContent?: string } -type TextRendererProps = TextProps & { +export type TextRendererProps = TextProps & { sx?: SxProps } diff --git a/packages/magento-product-bundle/components/BundleProductOptions/BundleProductOptions.tsx b/packages/magento-product-bundle/components/BundleProductOptions/BundleProductOptions.tsx index 43f5486985..454319b25b 100644 --- a/packages/magento-product-bundle/components/BundleProductOptions/BundleProductOptions.tsx +++ b/packages/magento-product-bundle/components/BundleProductOptions/BundleProductOptions.tsx @@ -6,7 +6,7 @@ import { BundleOptionValue } from './BundleOptionValue' import type { BundleProductOptionsFragment } from './BundleProductOptions.gql' import type { BundleOptionValueProps } from './types' -type BundelProductOptionsProps = Pick< +export type BundelProductOptionsProps = Pick< ActionCardListProps, 'size' | 'layout' | 'color' | 'variant' > & { diff --git a/packages/magento-product-configurable/ConfigurableCartItem/OptionsList.tsx b/packages/magento-product-configurable/ConfigurableCartItem/OptionsList.tsx index 76b2f80ef9..bcb1aabc7e 100644 --- a/packages/magento-product-configurable/ConfigurableCartItem/OptionsList.tsx +++ b/packages/magento-product-configurable/ConfigurableCartItem/OptionsList.tsx @@ -3,7 +3,7 @@ import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' import type { ConfigurableCartItemFragment } from './ConfigurableCartItem.gql' -type CartItemOptionsListProps = Partial & { +export type CartItemOptionsListProps = Partial & { sx?: SxProps } diff --git a/packages/magento-product-configurable/ConfigurableContext/ConfigurableContext.tsx b/packages/magento-product-configurable/ConfigurableContext/ConfigurableContext.tsx index 215fe37e7b..e8127d8149 100644 --- a/packages/magento-product-configurable/ConfigurableContext/ConfigurableContext.tsx +++ b/packages/magento-product-configurable/ConfigurableContext/ConfigurableContext.tsx @@ -3,7 +3,7 @@ import { createContext, useCallback, useContext, useMemo, useState } from 'react import type { ConfigurableProductFormFragment } from './ConfigurableProductForm.gql' import cheapestVariant from './cheapestVariant' -type ConfigurableProductFormProps = ConfigurableProductFormFragment & { +export type ConfigurableProductFormProps = ConfigurableProductFormFragment & { sku: string children?: React.ReactNode } diff --git a/packages/magento-product-configurable/ConfigurableProductAddToCart/ConfigurableProductAddToCart.tsx b/packages/magento-product-configurable/ConfigurableProductAddToCart/ConfigurableProductAddToCart.tsx index 8d9fa3b0f4..2319a05d0c 100644 --- a/packages/magento-product-configurable/ConfigurableProductAddToCart/ConfigurableProductAddToCart.tsx +++ b/packages/magento-product-configurable/ConfigurableProductAddToCart/ConfigurableProductAddToCart.tsx @@ -19,7 +19,7 @@ import { ConfigurableOptionsInput } from '../ConfigurableOptions/ConfigurableOpt import type { ConfigurableProductAddToCartMutationVariables } from '../graphql/ConfigurableProductAddToCart.gql' import { ConfigurableProductAddToCartDocument } from '../graphql/ConfigurableProductAddToCart.gql' -type ConfigurableProductAddToCartProps = { +export type ConfigurableProductAddToCartProps = { variables: Omit name: string optionEndLabels?: Record diff --git a/packages/magento-product-configurable/SwatchList.tsx b/packages/magento-product-configurable/SwatchList.tsx index 49ec26d365..3032ee5470 100644 --- a/packages/magento-product-configurable/SwatchList.tsx +++ b/packages/magento-product-configurable/SwatchList.tsx @@ -7,7 +7,7 @@ import { TextSwatchData } from './Swatches/TextSwatchData' import type { SwatchSize, SwatchTypeRenderer } from './Swatches/types' import type { ProductListItemConfigurableFragment } from './components/ProductListItemConfigurable/ProductListItemConfigurable.gql' -type SwatchListProps = { +export type SwatchListProps = { attributes?: string[] configurable_options?: Maybe } diff --git a/packages/magento-product-configurable/Swatches/ColorSwatchData.tsx b/packages/magento-product-configurable/Swatches/ColorSwatchData.tsx index ea2e929637..b2a8bba049 100644 --- a/packages/magento-product-configurable/Swatches/ColorSwatchData.tsx +++ b/packages/magento-product-configurable/Swatches/ColorSwatchData.tsx @@ -4,7 +4,7 @@ import { Box } from '@mui/material' import type { ColorSwatchDataFragment } from './ColorSwatchData.gql' import type { SwatchDataProps } from './types' -type ColorSwatchDataProps = ColorSwatchDataFragment & +export type ColorSwatchDataProps = ColorSwatchDataFragment & SwatchDataProps & { sx?: SxProps } diff --git a/packages/magento-product-configurable/Swatches/ImageSwatchData.tsx b/packages/magento-product-configurable/Swatches/ImageSwatchData.tsx index 94fb71e6d2..075eee9f55 100644 --- a/packages/magento-product-configurable/Swatches/ImageSwatchData.tsx +++ b/packages/magento-product-configurable/Swatches/ImageSwatchData.tsx @@ -5,7 +5,8 @@ import { Box } from '@mui/material' import type { ImageSwatchDataFragment } from './ImageSwatchData.gql' import type { SwatchDataProps } from './types' -type ImageSwatchDataProps = ImageSwatchDataFragment & SwatchDataProps & { sx?: SxProps } +export type ImageSwatchDataProps = ImageSwatchDataFragment & + SwatchDataProps & { sx?: SxProps } type OwnerState = Pick const name = 'ColorSwatchData' diff --git a/packages/magento-product-configurable/Swatches/TextSwatchData.tsx b/packages/magento-product-configurable/Swatches/TextSwatchData.tsx index 15efb7cef9..be89b0782e 100644 --- a/packages/magento-product-configurable/Swatches/TextSwatchData.tsx +++ b/packages/magento-product-configurable/Swatches/TextSwatchData.tsx @@ -5,7 +5,7 @@ import { Box } from '@mui/material' import type { TextSwatchDataFragment } from './TextSwatchData.gql' import type { SwatchDataProps } from './types' -type TextSwatchDataProps = TextSwatchDataFragment & SwatchDataProps & { sx?: SxProps } +export type TextSwatchDataProps = TextSwatchDataFragment & SwatchDataProps & { sx?: SxProps } type OwnerState = Pick const name = 'TextSwatchData' diff --git a/packages/magento-product-configurable/components/ConfigurableCartItemOptions/ConfigurableCartItemOptions.tsx b/packages/magento-product-configurable/components/ConfigurableCartItemOptions/ConfigurableCartItemOptions.tsx index 6678a6dd89..f17ebcbcb3 100644 --- a/packages/magento-product-configurable/components/ConfigurableCartItemOptions/ConfigurableCartItemOptions.tsx +++ b/packages/magento-product-configurable/components/ConfigurableCartItemOptions/ConfigurableCartItemOptions.tsx @@ -3,7 +3,7 @@ import { SelectedCustomizableOptions } from '@graphcommerce/magento-cart-items' import { Box } from '@mui/material' import type { ConfigurableCartItemFragment } from '../../ConfigurableCartItem/ConfigurableCartItem.gql' -type ConfigurableActionCartItemProps = ConfigurableCartItemFragment & CartItemFragment +export type ConfigurableActionCartItemProps = ConfigurableCartItemFragment & CartItemFragment export function ConfigurableCartItemOptions(props: ConfigurableActionCartItemProps) { const { configurable_options } = props diff --git a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx index 4421673af0..0482241acc 100644 --- a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx +++ b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOption.tsx @@ -15,23 +15,25 @@ import type { ConfigurableOptionValueFragment, } from '../ConfigurableOptionValue' -type Props = NonNullable< +export type ConfigurableProductOptionProps = NonNullable< NonNullable[number] > & { index: number optionIndex: number + optionStartLabels?: Record optionEndLabels?: Record sx?: SxProps attribute_code: string render: typeof ConfigurableOptionValue } & UseConfigurableOptionsSelection -export function ConfigurableProductOption(props: Props) { +export function ConfigurableProductOption(props: ConfigurableProductOptionProps) { const { values, label, index, optionIndex, + optionStartLabels, optionEndLabels, sx, attribute_code, @@ -71,7 +73,7 @@ export function ConfigurableProductOption(props: Props) { return ( diff --git a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx index 0d9992cf2e..d17ad07103 100644 --- a/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx +++ b/packages/magento-product-configurable/components/ConfigurableProductOptions/ConfigurableProductOptions.tsx @@ -13,6 +13,7 @@ import { ConfigurableOptionValue } from '../ConfigurableOptionValue/Configurable import { ConfigurableProductOption } from './ConfigurableProductOption' export type ConfigurableProductOptionsProps = AddToCartItemSelector & { + optionStartLabels?: Record optionEndLabels?: Record sx?: SxProps render?: typeof ConfigurableOptionValue @@ -22,6 +23,7 @@ export type ConfigurableProductOptionsProps = AddToCartItemSelector & { export function ConfigurableProductOptions(props: ConfigurableProductOptionsProps) { const { + optionStartLabels, optionEndLabels, sx, render = ConfigurableOptionValue, @@ -68,6 +70,7 @@ export function ConfigurableProductOptions(props: ConfigurableProductOptionsProp {...option} key={option.uid} render={render} + optionStartLabels={optionStartLabels} optionEndLabels={optionEndLabels} index={index} optionIndex={optionIndex} diff --git a/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery.tsx b/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery.tsx index e2490a0c27..4ecfa1812b 100644 --- a/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery.tsx +++ b/packages/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery.tsx @@ -5,6 +5,7 @@ import { useConfigurableOptionsSelection } from '../../hooks' export const config: PluginConfig = { type: 'component', module: '@graphcommerce/magento-product', + ifConfig: 'configurableVariantValues.gallery', } export function ProductPageGallery( diff --git a/packages/magento-product-downloadable/components/DownloadableProductOptions/DownloadableProductOptions.tsx b/packages/magento-product-downloadable/components/DownloadableProductOptions/DownloadableProductOptions.tsx index 115900cfa9..96b5661026 100644 --- a/packages/magento-product-downloadable/components/DownloadableProductOptions/DownloadableProductOptions.tsx +++ b/packages/magento-product-downloadable/components/DownloadableProductOptions/DownloadableProductOptions.tsx @@ -7,7 +7,7 @@ import { ActionCard, filterNonNullableKeys } from '@graphcommerce/next-ui' import { useMemo } from 'react' import type { DownloadableProductOptionsFragment } from './DownloadableProductOptions.gql' -type DownloadableProductOptionsProps = AddToCartItemSelector & { +export type DownloadableProductOptionsProps = AddToCartItemSelector & { product: DownloadableProductOptionsFragment } diff --git a/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx b/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx index fdf86b596e..e2146b670c 100644 --- a/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx +++ b/packages/magento-product-grouped/GroupedProducts/GroupedProducts.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react' import type { ProductPageGroupedQueryFragment } from '../ProductPageGroupedQueryFragment.gql' import { GroupedProductActionCard } from './GroupedProductActionCard' -type GroupedProductsProps = { +export type GroupedProductsProps = { product: NonNullable['items']>[0] } diff --git a/packages/magento-product/components/AddProductsToCart/AddProductsToCartError.tsx b/packages/magento-product/components/AddProductsToCart/AddProductsToCartError.tsx index ea76e9f3eb..b16b6e7a5d 100644 --- a/packages/magento-product/components/AddProductsToCart/AddProductsToCartError.tsx +++ b/packages/magento-product/components/AddProductsToCart/AddProductsToCartError.tsx @@ -3,7 +3,7 @@ import { FormHelperText } from '@mui/material' import type { AddToCartItemSelector } from './useFormAddProductsToCart' import { useFormAddProductsToCart } from './useFormAddProductsToCart' -type AddProductsToCartErrorProps = { +export type AddProductsToCartErrorProps = { children?: React.ReactNode } & AddToCartItemSelector diff --git a/packages/magento-product/components/AddProductsToCart/AddProductsToCartQuantity.tsx b/packages/magento-product/components/AddProductsToCart/AddProductsToCartQuantity.tsx index f07d3b5606..b6c53e8e99 100644 --- a/packages/magento-product/components/AddProductsToCart/AddProductsToCartQuantity.tsx +++ b/packages/magento-product/components/AddProductsToCart/AddProductsToCartQuantity.tsx @@ -5,7 +5,7 @@ import type { AddProductsToCartMutationVariables } from './AddProductsToCart.gql import type { AddToCartItemSelector } from './useFormAddProductsToCart' import { useFormAddProductsToCart } from './useFormAddProductsToCart' -type AddToCartQuantityProps = Omit< +export type AddToCartQuantityProps = Omit< NumberFieldElementProps, 'error' | 'required' | 'inputProps' | 'helperText' | 'name' | 'control' > & @@ -20,13 +20,13 @@ export function AddProductsToCartQuantity(props: AddToCartQuantityProps) { variant='outlined' size='small' color='primary' - {...props} required inputProps={{ min: 1, 'aria-label': i18n._(/* i18n */ 'Add to cart quantity') }} defaultValue={1} control={control} aria-label={i18n._(/* i18n */ 'Add to cart quantity')} name={`cartItems.${index}.quantity`} + {...props} /> ) } diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx index 5f4c416072..c61ffc0ada 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableAreaOption.tsx @@ -18,7 +18,7 @@ export type OptionTypeRenderer = TypeRenderer< } > -type CustomizableAreaOptionProps = React.ComponentProps< +export type CustomizableAreaOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableAreaOption'] > diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableCheckboxOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableCheckboxOption.tsx index 6d7f4d3d26..5403553bf2 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableCheckboxOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableCheckboxOption.tsx @@ -7,7 +7,7 @@ import { Box, Checkbox } from '@mui/material' import { useFormAddProductsToCart } from '../AddProductsToCart' import type { OptionTypeRenderer } from './CustomizableAreaOption' -type CustomizableCheckboxOptionProps = React.ComponentProps< +export type CustomizableCheckboxOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableCheckboxOption'] > diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableDateOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableDateOption.tsx index 0eb911eb31..9bb61608c7 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableDateOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableDateOption.tsx @@ -6,7 +6,7 @@ import { Box } from '@mui/material' import { useFormAddProductsToCart } from '../AddProductsToCart' import type { OptionTypeRenderer } from './CustomizableAreaOption' -type CustomizableDateOptionProps = React.ComponentProps< +export type CustomizableDateOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableDateOption'] > & { minDate?: Date diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableDropDownOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableDropDownOption.tsx index 5a17ed4b95..f11b18f2a1 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableDropDownOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableDropDownOption.tsx @@ -5,7 +5,7 @@ import { Box, MenuItem, TextField } from '@mui/material' import { useFormAddProductsToCart } from '../AddProductsToCart' import type { OptionTypeRenderer } from './CustomizableAreaOption' -type CustomizableDropDownOptionProps = React.ComponentProps< +export type CustomizableDropDownOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableDropDownOption'] > diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx index 584f48722d..d882c8ffbc 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableFieldOption.tsx @@ -6,7 +6,7 @@ import { Box } from '@mui/material' import { useFormAddProductsToCart } from '../AddProductsToCart' import type { OptionTypeRenderer } from './CustomizableAreaOption' -type CustomizableFieldOptionProps = React.ComponentProps< +export type CustomizableFieldOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableFieldOption'] > diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableMultipleOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableMultipleOption.tsx index 28cbfb72c2..02529d1945 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableMultipleOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableMultipleOption.tsx @@ -7,7 +7,7 @@ import { Box } from '@mui/material' import { useFormAddProductsToCart } from '../AddProductsToCart' import type { OptionTypeRenderer } from './CustomizableAreaOption' -type CustomizableMultipleOptionProps = React.ComponentProps< +export type CustomizableMultipleOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableMultipleOption'] > diff --git a/packages/magento-product/components/ProductCustomizable/CustomizableRadioOption.tsx b/packages/magento-product/components/ProductCustomizable/CustomizableRadioOption.tsx index 5f41920ba5..80311000dd 100644 --- a/packages/magento-product/components/ProductCustomizable/CustomizableRadioOption.tsx +++ b/packages/magento-product/components/ProductCustomizable/CustomizableRadioOption.tsx @@ -7,7 +7,7 @@ import { Box } from '@mui/material' import { useFormAddProductsToCart } from '../AddProductsToCart' import type { OptionTypeRenderer } from './CustomizableAreaOption' -type CustomizableRadioOptionProps = React.ComponentProps< +export type CustomizableRadioOptionProps = React.ComponentProps< OptionTypeRenderer['CustomizableRadioOption'] > diff --git a/packages/magento-product/components/ProductCustomizable/ProductCustomizable.tsx b/packages/magento-product/components/ProductCustomizable/ProductCustomizable.tsx index a9d353d835..a1ec789c5b 100644 --- a/packages/magento-product/components/ProductCustomizable/ProductCustomizable.tsx +++ b/packages/magento-product/components/ProductCustomizable/ProductCustomizable.tsx @@ -33,7 +33,7 @@ type OptionTypeRendererProp = Simplify< : MissingOptionTypeRenderer & DefinedOptionTypeRenderer > -type ProductCustomizableProps = AddToCartItemSelector & { +export type ProductCustomizableProps = AddToCartItemSelector & { product: ProductCustomizableFragment & ProductPagePriceFragment } & (keyof MissingOptionTypeRenderer extends never ? { renderer?: OptionTypeRendererProp } diff --git a/packages/magento-product/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx b/packages/magento-product/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx index 43d458bc0b..5643683854 100644 --- a/packages/magento-product/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx +++ b/packages/magento-product/components/ProductFiltersPro/ProductFiltersProAllFiltersChip.tsx @@ -19,7 +19,8 @@ export type ProductFiltersProAllFiltersChipProps = ProductFiltersProAggregations Omit< ChipOverlayOrPopperProps, 'label' | 'selected' | 'selectedLabel' | 'onApply' | 'onReset' | 'onClose' | 'children' - > + > & + Partial> export function ProductFiltersProAllFiltersChip(props: ProductFiltersProAllFiltersChipProps) { const { sort_fields, total_count, renderer, category, ...rest } = props diff --git a/packages/magento-product/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx b/packages/magento-product/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx index 3aabaded82..6b431c1faf 100644 --- a/packages/magento-product/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx +++ b/packages/magento-product/components/ProductFiltersPro/ProductFiltersProSortDirectionArrow.tsx @@ -1,11 +1,13 @@ import type { SortEnum } from '@graphcommerce/graphql-mesh' import { IconSvg, iconArrowDown, iconArrowUp } from '@graphcommerce/next-ui' -type Props = { +export type ProductFiltersProSortDirectionArrowProps = { sortDirection: SortEnum | null } -export function ProductFiltersProSortDirectionArrow({ sortDirection }: Props) { +export function ProductFiltersProSortDirectionArrow({ + sortDirection, +}: ProductFiltersProSortDirectionArrowProps) { return ( , 'in'> type Filter = NonNullable[number]> -type FilterEqualTypeProps = Filter & Omit +export type FilterEqualTypeProps = Filter & Omit export function FilterEqualType(props: FilterEqualTypeProps) { const { attribute_code, count, label, options, __typename, ...chipProps } = props diff --git a/packages/magento-product/components/ProductListFilters/FilterRangeType.tsx b/packages/magento-product/components/ProductListFilters/FilterRangeType.tsx index d3afd0835b..fdc6f1555e 100644 --- a/packages/magento-product/components/ProductListFilters/FilterRangeType.tsx +++ b/packages/magento-product/components/ProductListFilters/FilterRangeType.tsx @@ -11,7 +11,7 @@ import { useProductListLinkReplace } from '../../hooks/useProductListLinkReplace import { useProductListParamsContext } from '../../hooks/useProductListParamsContext' import type { ProductListFiltersFragment } from './ProductListFilters.gql' -type FilterRangeTypeProps = NonNullable< +export type FilterRangeTypeProps = NonNullable< NonNullable[0] > & Omit diff --git a/packages/magento-product/components/ProductListItem/ProductListItem.tsx b/packages/magento-product/components/ProductListItem/ProductListItem.tsx index 3ec0286490..ef2a35df10 100644 --- a/packages/magento-product/components/ProductListItem/ProductListItem.tsx +++ b/packages/magento-product/components/ProductListItem/ProductListItem.tsx @@ -40,7 +40,7 @@ type StyleProps = { imageOnly?: boolean } -type BaseProps = { +export type BaseProps = { imageOnly?: boolean children?: React.ReactNode sx?: SxProps @@ -53,9 +53,9 @@ type BaseProps = { Pick // eslint-disable-next-line react/no-unused-prop-types -type SkeletonProps = BaseProps & { __typename: 'Skeleton' } +export type SkeletonProps = BaseProps & { __typename: 'Skeleton' } -type ProductProps = BaseProps & ProductListItemFragment +export type ProductProps = BaseProps & ProductListItemFragment export type ProductListItemProps = ProductProps | SkeletonProps diff --git a/packages/magento-product/components/ProductListItem/ProductListItemImage.tsx b/packages/magento-product/components/ProductListItem/ProductListItemImage.tsx index 62373a8105..b90dfe78de 100644 --- a/packages/magento-product/components/ProductListItem/ProductListItemImage.tsx +++ b/packages/magento-product/components/ProductListItem/ProductListItemImage.tsx @@ -48,7 +48,7 @@ export function ProductListItemImageSkeleton(props: ProductListItemImageProps) { ) } -type ImageOrPlaceholderProps = ProductListItemImageProps & +export type ImageOrPlaceholderProps = ProductListItemImageProps & Omit & { alt?: ImageProps['alt'] | null src?: ImageProps['src'] | null diff --git a/packages/magento-product/components/ProductListItem/ProductListItemImageContainer.tsx b/packages/magento-product/components/ProductListItem/ProductListItemImageContainer.tsx index 886ecd131a..a20a9d8d51 100644 --- a/packages/magento-product/components/ProductListItem/ProductListItemImageContainer.tsx +++ b/packages/magento-product/components/ProductListItem/ProductListItemImageContainer.tsx @@ -2,7 +2,7 @@ import { breakpointVal, responsiveVal } from '@graphcommerce/next-ui' import type { BoxProps } from '@mui/material' import { Box } from '@mui/material' -type ProductImageContainerProps = BoxProps +export type ProductImageContainerProps = BoxProps export function ProductImageContainer(props: ProductImageContainerProps) { const { sx = [] } = props diff --git a/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx b/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx index de2ec73ea5..1e5f27c21a 100644 --- a/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx +++ b/packages/magento-product/components/ProductListItem/ProductListItemLinkOrDiv.tsx @@ -2,8 +2,8 @@ import { NextLink, breakpointVal } from '@graphcommerce/next-ui' import type { BoxProps, ButtonBaseProps, SxProps, Theme } from '@mui/material' import { Box, ButtonBase } from '@mui/material' -type ProductListItemLinkProps = ButtonBaseProps -type ProductListItemLinkOrDivProps = ProductListItemLinkProps | BoxProps +export type ProductListItemLinkProps = ButtonBaseProps +export type ProductListItemLinkOrDivProps = ProductListItemLinkProps | BoxProps function isLink(props: ProductListItemLinkOrDivProps): props is ProductListItemLinkProps { return 'href' in props diff --git a/packages/magento-product/components/ProductListItems/ProductListItemsBase.tsx b/packages/magento-product/components/ProductListItems/ProductListItemsBase.tsx index 728672b29a..afc2d49178 100644 --- a/packages/magento-product/components/ProductListItems/ProductListItemsBase.tsx +++ b/packages/magento-product/components/ProductListItems/ProductListItemsBase.tsx @@ -38,6 +38,7 @@ export type ProductItemsGridProps = ProductListItemsFragment & { sx?: BoxProps['sx'] columns?: ((theme: Theme) => ColumnsConfig) | ColumnsConfig containerRef?: React.Ref + children?: React.ReactNode } & Pick & ComponentState @@ -57,6 +58,7 @@ export function ProductListItemsBase(props: ProductItemsGridProps) { titleComponent, onClick, columns, + children, } = props const theme = useTheme() @@ -124,6 +126,7 @@ export function ProductListItemsBase(props: ProductItemsGridProps) { ) : null, )} + {children} ) diff --git a/packages/magento-product/components/ProductListSuggestions/ProductListSuggestions.tsx b/packages/magento-product/components/ProductListSuggestions/ProductListSuggestions.tsx index 84d4386f09..8fd959ee9d 100644 --- a/packages/magento-product/components/ProductListSuggestions/ProductListSuggestions.tsx +++ b/packages/magento-product/components/ProductListSuggestions/ProductListSuggestions.tsx @@ -5,7 +5,7 @@ import { productListLinkFromFilter } from '../../hooks/useProductListLink' import { useProductFiltersPro } from '../ProductFiltersPro' import type { ProductListSuggestionsFragment } from './ProductListSuggestions.gql' -type ProductListSuggestionsProps = { +export type ProductListSuggestionsProps = { products: ProductListSuggestionsFragment } diff --git a/packages/magento-product/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx b/packages/magento-product/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx index 60b5db543b..d1b63230a4 100644 --- a/packages/magento-product/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx +++ b/packages/magento-product/components/ProductPageBreadcrumb/ProductPageBreadcrumb.tsx @@ -6,13 +6,13 @@ import { Breadcrumbs, Link, Typography } from '@mui/material' import { productPageCategory } from '../ProductPageCategory/productPageCategory' import type { ProductPageBreadcrumbFragment } from './ProductPageBreadcrumb.gql' -type ProductPageBreadcrumbsProps = ProductPageBreadcrumbFragment & +export type ProductPageBreadcrumbProps = ProductPageBreadcrumbFragment & Omit /** * @deprecated Please use ProductPageBreadcrumbs */ -export function ProductPageBreadcrumb(props: ProductPageBreadcrumbsProps) { +export function ProductPageBreadcrumb(props: ProductPageBreadcrumbProps) { const { categories, name, ...breadcrumbProps } = props const prev = usePrevPageRouter() diff --git a/packages/magento-product/components/ProductScroller/ProductScroller.tsx b/packages/magento-product/components/ProductScroller/ProductScroller.tsx index 0f3d647905..ef066ade40 100644 --- a/packages/magento-product/components/ProductScroller/ProductScroller.tsx +++ b/packages/magento-product/components/ProductScroller/ProductScroller.tsx @@ -36,7 +36,7 @@ export const ProductScroller = forwardRef( const Wrapper = useContext(AddProductsToCartContext) ? React.Fragment : AddProductsToCartForm - if (!items) return null + if (!items || !items.length) return null return ( diff --git a/packages/magento-product/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx b/packages/magento-product/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx index 5b06fdd0a3..1cf0b17da1 100644 --- a/packages/magento-product/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx +++ b/packages/magento-product/components/ProductSidebarDelivery/ProductSidebarDelivery.tsx @@ -3,7 +3,7 @@ import { Trans } from '@lingui/react' import { Box, darken, lighten } from '@mui/material' import type { UseAddProductsToCartActionFragment } from '../AddProductsToCart/UseAddProductsToCartAction.gql' -type ProductSidebarDeliveryProps = { +export type ProductSidebarDeliveryProps = { product?: UseAddProductsToCartActionFragment } diff --git a/packages/magento-review/components/AccountReviews/AccountReviews.tsx b/packages/magento-review/components/AccountReviews/AccountReviews.tsx index 054c023fba..343b2648e9 100644 --- a/packages/magento-review/components/AccountReviews/AccountReviews.tsx +++ b/packages/magento-review/components/AccountReviews/AccountReviews.tsx @@ -3,7 +3,7 @@ import { Box } from '@mui/material' import { CustomerReview } from '../CustomerReview/CustomerReview' import type { AccountReviewsFragment } from './AccountReviews.gql' -type AccountReviewsProps = AccountReviewsFragment +export type AccountReviewsProps = AccountReviewsFragment const { classes } = extendableComponent('AccountReviews', ['root', 'older'] as const) diff --git a/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx b/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx index 90b412e5ae..837ce1bdd3 100644 --- a/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx +++ b/packages/magento-review/components/CreateProductReviewForm/CreateProductReviewForm.tsx @@ -20,7 +20,7 @@ import { useEffect, useState } from 'react' import { CreateProductReviewDocument } from './CreateProductReview.gql' import { ProductReviewRatingsMetadataDocument } from './ProductReviewRatingsMetadata.gql' -type CreateProductReviewFormProps = { +export type CreateProductReviewFormProps = { sku: string nickname?: string sx?: SxProps diff --git a/packages/magento-review/components/CustomerReview/CustomerReview.tsx b/packages/magento-review/components/CustomerReview/CustomerReview.tsx index e53b4c37fa..8788bd2977 100644 --- a/packages/magento-review/components/CustomerReview/CustomerReview.tsx +++ b/packages/magento-review/components/CustomerReview/CustomerReview.tsx @@ -6,7 +6,7 @@ import type { CustomerReviewFragment } from './CustomerReview.gql' import filledStar from './review_star_filled.svg' import outlinedStar from './review_star_outlined.svg' -type CustomerReviewProps = CustomerReviewFragment & { sx?: SxProps } +export type CustomerReviewProps = CustomerReviewFragment & { sx?: SxProps } const { classes } = extendableComponent('ScrollerDots', [ 'container', diff --git a/packages/magento-search/components/ProductFiltersPro/ProductFiltersProCategorySectionSearch.tsx b/packages/magento-search/components/ProductFiltersPro/ProductFiltersProCategorySectionSearch.tsx index dc8beadac4..8f0f7590f9 100644 --- a/packages/magento-search/components/ProductFiltersPro/ProductFiltersProCategorySectionSearch.tsx +++ b/packages/magento-search/components/ProductFiltersPro/ProductFiltersProCategorySectionSearch.tsx @@ -79,7 +79,7 @@ function isParent(item: U, parent: U): boolean { return false } -type ProductFiltersProCategorySectionSearchProps = Omit< +export type ProductFiltersProCategorySectionSearchProps = Omit< ProductFiltersProCategoryAccordionProps, 'categoryTree' | 'onChange' > & { diff --git a/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchField.tsx b/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchField.tsx index 72a6dceeb7..070165d5ab 100644 --- a/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchField.tsx +++ b/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchField.tsx @@ -6,7 +6,7 @@ import { useMemo, useState } from 'react' import type { ProductFiltersProSearchInputProps } from './ProductFiltersProSearchInput' import { useSearchPageAndParam } from './useSearchPageAndParam' -type ProductFiltersProSearchFieldProps = ProductFiltersProSearchInputProps & { +export type ProductFiltersProSearchFieldProps = ProductFiltersProSearchInputProps & { fab?: FabProps } diff --git a/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchHeader.tsx b/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchHeader.tsx index 4d13bed0f7..ef6c393999 100644 --- a/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchHeader.tsx +++ b/packages/magento-search/components/ProductFiltersPro/ProductFiltersProSearchHeader.tsx @@ -4,7 +4,7 @@ import { useWatch } from '@graphcommerce/react-hook-form' import { Trans } from '@lingui/macro' import { Box } from '@mui/material' -type ProductFiltersProSearchHeaderProps = { +export type ProductFiltersProSearchHeaderProps = { params: ProductListParams /** * Provide a text when there is no term searched diff --git a/packages/magento-store/PageMeta.tsx b/packages/magento-store/PageMeta.tsx index a2e96d9f2a..4edf72fd87 100644 --- a/packages/magento-store/PageMeta.tsx +++ b/packages/magento-store/PageMeta.tsx @@ -3,7 +3,7 @@ import type { PageMetaProps as NextPageMetaProps } from '@graphcommerce/next-ui' import { PageMeta as NextPageMeta } from '@graphcommerce/next-ui' import { StoreConfigDocument } from './StoreConfig.gql' -type PageMetaProps = Omit & { +export type PageMetaProps = Omit & { canonical?: string } diff --git a/packages/magento-wishlist/components/ProductWishlistChip/ProductWishlistIconButton.tsx b/packages/magento-wishlist/components/ProductWishlistChip/ProductWishlistIconButton.tsx index 5e9e8bdb0e..ad0f044bf4 100644 --- a/packages/magento-wishlist/components/ProductWishlistChip/ProductWishlistIconButton.tsx +++ b/packages/magento-wishlist/components/ProductWishlistChip/ProductWishlistIconButton.tsx @@ -1,4 +1,5 @@ import type { ProductListItemFragment } from '@graphcommerce/magento-product' +import type { IconSvgProps } from '@graphcommerce/next-ui' import { IconSvg, MessageSnackbar, @@ -16,6 +17,7 @@ import { useAddProductToWishlistAction, useWishlistEnabled } from '../../hooks' export type ProductWishlistChipProps = ProductListItemFragment & { sx?: SxProps buttonProps?: IconButtonProps + iconSvgProps?: Partial } const compName = 'ProductWishlistChipBase' @@ -23,7 +25,7 @@ const parts = ['root', 'wishlistIcon', 'wishlistIconActive', 'wishlistButton'] a const { classes } = extendableComponent(compName, parts) export const ProductWishlistIconButton = React.memo((props) => { - const { buttonProps, sx = [], ...product } = props + const { buttonProps, iconSvgProps, sx = [], ...product } = props const enabled = useWishlistEnabled() const { current, onClick, cancelBubble, showSuccess, hideShowSuccess } = useAddProductToWishlistAction({ product, index: 0 }) @@ -53,6 +55,7 @@ export const ProductWishlistIconButton = React.memo((p size='medium' className={classes.wishlistIconActive} sx={(theme) => ({ color: theme.palette.primary.main, fill: 'currentcolor' })} + {...iconSvgProps} /> ) : ( ((p : theme.palette.primary.contrastText, }, })} + {...iconSvgProps} /> )} diff --git a/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx b/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx index 5464eec3f4..4c94637967 100644 --- a/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx +++ b/packages/magento-wishlist/components/WishlistFab/WishlistFab.tsx @@ -5,7 +5,7 @@ import { Fab, NoSsr } from '@mui/material' import React from 'react' import { useWishlistEnabled, useWishlistItems } from '../../hooks' -type WishlistFabContentProps = { +export type WishlistFabContentProps = { icon?: React.ReactNode FabProps?: Omit BadgeProps?: BadgeProps diff --git a/packages/magento-wishlist/components/WishlistItem/AddWishlistItemToCart.tsx b/packages/magento-wishlist/components/WishlistItem/AddWishlistItemToCart.tsx index c7f684cb15..a533979c2b 100644 --- a/packages/magento-wishlist/components/WishlistItem/AddWishlistItemToCart.tsx +++ b/packages/magento-wishlist/components/WishlistItem/AddWishlistItemToCart.tsx @@ -10,7 +10,7 @@ import { import type { InputMaybe } from '@graphcommerce/next-config' import { Box } from '@mui/material' -type AddWishlistItemToCartProps = UseAddProductsToCartActionProps & +export type AddWishlistItemToCartProps = UseAddProductsToCartActionProps & AddToCartItemSelector & { selectedOptions?: InputMaybe | undefined } export function AddWishlistItemToCart(props: AddWishlistItemToCartProps) { diff --git a/packages/magento-wishlist/components/WishlistItemActionCard/ConfigurableWishlistItemAction.tsx b/packages/magento-wishlist/components/WishlistItemActionCard/ConfigurableWishlistItemAction.tsx index a47fdf5d83..b59e5354bf 100644 --- a/packages/magento-wishlist/components/WishlistItemActionCard/ConfigurableWishlistItemAction.tsx +++ b/packages/magento-wishlist/components/WishlistItemActionCard/ConfigurableWishlistItemAction.tsx @@ -5,7 +5,10 @@ import { Trans } from '@lingui/react' import { Button } from '@mui/material' import { AddWishlistItemToCart } from '../WishlistItem/AddWishlistItemToCart' -type ConfigurableWishlistItemActionProps = Omit +export type ConfigurableWishlistItemActionProps = Omit< + WishlistItemActionCardProps, + 'selectedOptions' +> export function ConfigurableWishlistItemAction(props: ConfigurableWishlistItemActionProps) { const { item } = props diff --git a/packages/magento-wishlist/components/WishlistItemActionCard/WishlistItemActionCard.tsx b/packages/magento-wishlist/components/WishlistItemActionCard/WishlistItemActionCard.tsx index b4ffdf2e34..81c73827b2 100644 --- a/packages/magento-wishlist/components/WishlistItemActionCard/WishlistItemActionCard.tsx +++ b/packages/magento-wishlist/components/WishlistItemActionCard/WishlistItemActionCard.tsx @@ -5,7 +5,7 @@ import type { InputMaybe } from '@graphcommerce/next-config' import type { ActionCardProps } from '@graphcommerce/next-ui' import { ActionCard, actionCardImageSizes, extendableComponent } from '@graphcommerce/next-ui' import { Trans } from '@lingui/react' -import type { SxProps, Theme } from '@mui/material' +import type { SxProps, Theme, ButtonProps } from '@mui/material' import { Button, Link } from '@mui/material' import type { ReactNode } from 'react' import { useRemoveProductsFromWishlist } from '../../hooks' @@ -18,6 +18,7 @@ export type WishlistItemActionCardProps = { selectedOptions?: InputMaybe | undefined isConfigurableUncompleted?: boolean secondaryAction?: ReactNode + actionButtonProps?: ButtonProps } & OwnerState & Omit type OwnerState = { withOptions?: boolean } @@ -49,6 +50,7 @@ export function WishlistItemActionCard(props: WishlistItemActionCardProps) { selectedOptions, secondaryAction, variant = 'default', + actionButtonProps, ...rest } = props const { id, product } = item @@ -169,6 +171,7 @@ export function WishlistItemActionCard(props: WishlistItemActionCardProps) { size='medium' type='button' onClick={() => remove([id])} + {...actionButtonProps} > diff --git a/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx b/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx index d3f919875a..3de433a52a 100644 --- a/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx +++ b/packages/magento-wishlist/components/WishlistMenuFabItem/WishlistMenuFabItem.tsx @@ -5,7 +5,7 @@ import type { MouseEventHandler } from 'react' import React from 'react' import { useWishlistItems } from '../../hooks' -type WishlistMenuFabItemContentProps = { +export type WishlistMenuFabItemContentProps = { icon?: React.ReactNode children: React.ReactNode sx?: SxProps diff --git a/packages/mollie-magento-payment/components/MollieActionCard/MollieActionCard.tsx b/packages/mollie-magento-payment/components/MollieActionCard/MollieActionCard.tsx index d362cad953..ffd568aafd 100644 --- a/packages/mollie-magento-payment/components/MollieActionCard/MollieActionCard.tsx +++ b/packages/mollie-magento-payment/components/MollieActionCard/MollieActionCard.tsx @@ -2,7 +2,7 @@ import { Image } from '@graphcommerce/image' import type { PaymentMethodActionCardProps } from '@graphcommerce/magento-cart-payment-method' import { ActionCard } from '@graphcommerce/next-ui' -type MollieActionCardProps = PaymentMethodActionCardProps +export type MollieActionCardProps = PaymentMethodActionCardProps export function MollieActionCard(props: MollieActionCardProps) { const { mollie_meta } = props diff --git a/packages/mollie-magento-payment/components/MollieOptionsIssuer/MollieIssuerOptions.tsx b/packages/mollie-magento-payment/components/MollieOptionsIssuer/MollieIssuerOptions.tsx index 88994eac8b..231cfbd1fd 100644 --- a/packages/mollie-magento-payment/components/MollieOptionsIssuer/MollieIssuerOptions.tsx +++ b/packages/mollie-magento-payment/components/MollieOptionsIssuer/MollieIssuerOptions.tsx @@ -5,7 +5,7 @@ import { FormRow, filterNonNullableKeys } from '@graphcommerce/next-ui' import { FormPersist, useFormCompose } from '@graphcommerce/react-hook-form' import { SetMolliePaymentMethodIssuerOnCartDocument } from './SetMolliePaymentMethodIssuerOnCart.gql' -type MollieIssuerOptionsProps = PaymentOptionsProps & { +export type MollieIssuerOptionsProps = PaymentOptionsProps & { label: string children?: React.ReactNode } diff --git a/packages/mollie-magento-payment/components/MollieOptionsToken/MollieField.tsx b/packages/mollie-magento-payment/components/MollieOptionsToken/MollieField.tsx index 1efb4ed853..04cffbcdf2 100644 --- a/packages/mollie-magento-payment/components/MollieOptionsToken/MollieField.tsx +++ b/packages/mollie-magento-payment/components/MollieOptionsToken/MollieField.tsx @@ -14,7 +14,7 @@ function InputComponent(props) { return } -type IframeFieldProps = Omit & { +export type IframeFieldProps = Omit & { name: MollieFieldName onChange: (event: { target: { name: string; value: string } }) => void } @@ -87,7 +87,7 @@ const IframeField = React.forwardRef((props, ) }) -type MollieFieldProps = { +export type MollieFieldProps = { name: MollieFieldName isSubmitted?: boolean } & TextFieldProps diff --git a/packages/next-ui/ActionCard/ActionCardList.tsx b/packages/next-ui/ActionCard/ActionCardList.tsx index 461ae9bc2b..c93e224d51 100644 --- a/packages/next-ui/ActionCard/ActionCardList.tsx +++ b/packages/next-ui/ActionCard/ActionCardList.tsx @@ -50,7 +50,7 @@ function isValueSelected( return value === candidate } -type HoistedActionCardProps = Pick +export type HoistedActionCardProps = Pick const parts = ['root'] as const const name = 'ActionCardList' diff --git a/packages/next-ui/Blog/BlogContent/BlogContent.tsx b/packages/next-ui/Blog/BlogContent/BlogContent.tsx index c98ac16600..695e989cad 100644 --- a/packages/next-ui/Blog/BlogContent/BlogContent.tsx +++ b/packages/next-ui/Blog/BlogContent/BlogContent.tsx @@ -1,7 +1,7 @@ import type { SxProps, Theme } from '@mui/material' import { Box } from '@mui/material' -type BlogContentProps = { +export type BlogContentProps = { children: React.ReactNode sx?: SxProps } diff --git a/packages/next-ui/Blog/BlogList/BlogList.tsx b/packages/next-ui/Blog/BlogList/BlogList.tsx index e85a3957fb..b91ff06d15 100644 --- a/packages/next-ui/Blog/BlogList/BlogList.tsx +++ b/packages/next-ui/Blog/BlogList/BlogList.tsx @@ -1,7 +1,7 @@ import type { ContainerProps } from '@mui/material' import { Row } from '../../Row/Row' -type BlogItemGridProps = ContainerProps +export type BlogItemGridProps = ContainerProps export function BlogItemGrid(props: BlogItemGridProps) { const { sx = [], ...containerProps } = props diff --git a/packages/next-ui/Blog/BlogTags/BlogTag.tsx b/packages/next-ui/Blog/BlogTags/BlogTag.tsx index 64826efa13..b8e4f07ab9 100644 --- a/packages/next-ui/Blog/BlogTags/BlogTag.tsx +++ b/packages/next-ui/Blog/BlogTags/BlogTag.tsx @@ -2,7 +2,7 @@ import type { SxProps, Theme } from '@mui/material' import { Chip } from '@mui/material' import { NextLink } from '../../Theme' -type BlogTagsProps = { +export type BlogTagsProps = { url: string title: string sx?: SxProps diff --git a/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx b/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx index 3b19c1ed45..c77a840491 100644 --- a/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx +++ b/packages/next-ui/Breadcrumbs/BreadcrumbsList.tsx @@ -4,7 +4,7 @@ import type { KeyboardEvent } from 'react' import { useEffect, useRef } from 'react' import type { BreadcrumbsType } from './types' -type PopperBreadcrumbsListProps = { +export type PopperBreadcrumbsListProps = { autoFocus: boolean breadcrumbs: BreadcrumbsType['breadcrumbs'] showDesktopAmount?: number diff --git a/packages/next-ui/IconHeader/IconHeader.tsx b/packages/next-ui/IconHeader/IconHeader.tsx index bbe011d835..e9956e9f13 100644 --- a/packages/next-ui/IconHeader/IconHeader.tsx +++ b/packages/next-ui/IconHeader/IconHeader.tsx @@ -8,7 +8,7 @@ import { extendableComponent } from '../Styles' export type IconHeaderSize = 'small' | 'medium' | 'large' -type IconHeaderProps = { +export type IconHeaderProps = { children: React.ReactNode size?: IconHeaderSize noMargin?: boolean diff --git a/packages/next-ui/Intl/DisplayNames/DisplayNames.tsx b/packages/next-ui/Intl/DisplayNames/DisplayNames.tsx index 1844b2a706..ed3548768f 100644 --- a/packages/next-ui/Intl/DisplayNames/DisplayNames.tsx +++ b/packages/next-ui/Intl/DisplayNames/DisplayNames.tsx @@ -1,7 +1,7 @@ import type { UseDisplayNamesOptions } from './useDisplayNames' import { useDisplayNames } from './useDisplayNames' -type DisplayNamesProps = UseDisplayNamesOptions & { +export type DisplayNamesProps = UseDisplayNamesOptions & { code: string } diff --git a/packages/next-ui/Layout/components/LayoutHeaderClose.tsx b/packages/next-ui/Layout/components/LayoutHeaderClose.tsx index 9b86acd0e5..80f8faf8fc 100644 --- a/packages/next-ui/Layout/components/LayoutHeaderClose.tsx +++ b/packages/next-ui/Layout/components/LayoutHeaderClose.tsx @@ -6,7 +6,7 @@ import { IconSvg, useIconSvgSize } from '../../IconSvg' import { useFabSize } from '../../Theme' import { iconClose } from '../../icons' -type LayoutHeaderCloseProps = { +export type LayoutHeaderCloseProps = { onClose?: () => void } diff --git a/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx b/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx index c07c7de2f0..34a5eab100 100644 --- a/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx +++ b/packages/next-ui/LayoutParts/MenuFabSecondaryItem.tsx @@ -9,7 +9,7 @@ import { NextLink } from '../Theme' export type FabMenuSecondaryItemProps = { href: string children: React.ReactNode - icon: React.ReactNode + icon?: React.ReactNode sx?: SxProps onClick?: MouseEventHandler } @@ -37,9 +37,11 @@ export function MenuFabSecondaryItem(props: FabMenuSecondaryItemProps) { dense selected={router.asPath.startsWith(href)} > - - {icon} - + {icon && ( + + {icon} + + )} {children} ) diff --git a/packages/next-ui/Navigation/components/NavigationItem.tsx b/packages/next-ui/Navigation/components/NavigationItem.tsx index 66e3cb39d6..9760bd3021 100644 --- a/packages/next-ui/Navigation/components/NavigationItem.tsx +++ b/packages/next-ui/Navigation/components/NavigationItem.tsx @@ -24,7 +24,7 @@ type OwnerState = { column: number } -type NavigationItemProps = NavigationNode & { +export type NavigationItemProps = NavigationNode & { parentPath: string idx: number NavigationList: typeof NavigationList diff --git a/packages/next-ui/Navigation/components/NavigationList.tsx b/packages/next-ui/Navigation/components/NavigationList.tsx index 8dba21befc..d72ffb0de4 100644 --- a/packages/next-ui/Navigation/components/NavigationList.tsx +++ b/packages/next-ui/Navigation/components/NavigationList.tsx @@ -15,7 +15,7 @@ const NavigationUList = styled('ul')({ }, }) -type NavigationItemsProps = { +export type NavigationItemsProps = { parentPath?: string items: NavigationNode[] selected?: boolean diff --git a/packages/next-ui/Navigation/components/NavigationOverlay.tsx b/packages/next-ui/Navigation/components/NavigationOverlay.tsx index 76c44ccaef..fe046af259 100644 --- a/packages/next-ui/Navigation/components/NavigationOverlay.tsx +++ b/packages/next-ui/Navigation/components/NavigationOverlay.tsx @@ -23,8 +23,9 @@ type LayoutOverlaySize = 'floating' | 'minimal' | 'full' type LayoutOverlayAlign = 'start' | 'end' | 'center' | 'stretch' type ItemPadding = LiteralUnion -type NavigationOverlayProps = { +export type NavigationOverlayProps = { sx?: SxProps + overlaySx?: SxProps stretchColumns?: boolean variantSm: LayoutOverlayVariant variantMd: LayoutOverlayVariant @@ -40,12 +41,13 @@ type NavigationOverlayProps = { const MotionDiv = styled(m.div)({}) const componentName = 'Navigation' -const parts = ['root', 'navigation', 'header', 'column'] as const +const parts = ['root', 'navigation', 'header', 'column', 'wrapper'] as const const { classes } = extendableComponent(componentName, parts) export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => { const { sx, + overlaySx, stretchColumns, variantMd, variantSm, @@ -125,12 +127,15 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => { animating.set(false) }, }} - sx={{ - zIndex: 'drawer', - '& .LayoutOverlayBase-overlayPane': { - minWidth: itemWidthMd, + sx={[ + { + zIndex: 'drawer', + '& .LayoutOverlayBase-overlayPane': { + minWidth: itemWidthMd, + }, }, - }} + ...(Array.isArray(overlaySx) ? overlaySx : [overlaySx]), + ]} > { ({ display: 'grid', diff --git a/packages/next-ui/Overlay/components/OverlayContainer.tsx b/packages/next-ui/Overlay/components/OverlayContainer.tsx index 552ea0eb5a..892c37db5f 100644 --- a/packages/next-ui/Overlay/components/OverlayContainer.tsx +++ b/packages/next-ui/Overlay/components/OverlayContainer.tsx @@ -1,7 +1,7 @@ import { Box } from '@mui/material' import type { LayoutOverlayBaseProps } from './OverlayBase' -type OverlayContainerProps = Pick & { +export type OverlayContainerProps = Pick & { hidden?: boolean children: React.ReactNode } diff --git a/packages/next-ui/Overlay/components/OverlayHeader.tsx b/packages/next-ui/Overlay/components/OverlayHeader.tsx index 3587e138c3..c1fe051a4b 100644 --- a/packages/next-ui/Overlay/components/OverlayHeader.tsx +++ b/packages/next-ui/Overlay/components/OverlayHeader.tsx @@ -3,7 +3,7 @@ import { LayoutTitle } from '../../Layout' import { LayoutHeaderClose } from '../../Layout/components/LayoutHeaderClose' import { LayoutOverlayHeader } from '../../LayoutOverlay/components/LayoutOverlayHeader' -type OverlayHeaderProps = Omit & +export type OverlayHeaderProps = Omit & Pick & { onClose: () => void } export function OverlayHeader(props: OverlayHeaderProps) { diff --git a/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx b/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx index 79867d9e7c..b202b43d07 100644 --- a/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx +++ b/packages/next-ui/OverlayOrPopperChip/OverlayPanel.tsx @@ -1,5 +1,6 @@ import { Overlay } from '../Overlay/components/Overlay' import type { OverlayProps } from '../Overlay/components/OverlaySsr' +import { nonNullable } from '../RenderType/nonNullable' import { OverlayPanelActions } from './OverlayPanelActions' import type { PanelProps } from './types' @@ -15,12 +16,17 @@ export function OverlayPanel(props: OverlayPanelProps) { {...overlayProps} onClosed={onClose} active={Boolean(activeEl)} - sx={{ - '& .LayoutOverlayBase-overlayPane': { - display: 'grid', - gridTemplateRows: 'min-content auto min-content', + sx={[ + { + '& .LayoutOverlayBase-overlayPane': { + display: 'grid', + gridTemplateRows: 'min-content auto min-content', + }, }, - }} + ...(Array.isArray(overlayProps?.sx) ? overlayProps.sx : [overlayProps?.sx]).filter( + nonNullable, + ), + ]} > {() => ( diff --git a/packages/next-ui/Theme/DarkLightModeThemeProvider.tsx b/packages/next-ui/Theme/DarkLightModeThemeProvider.tsx index 805655f391..f490002bbf 100644 --- a/packages/next-ui/Theme/DarkLightModeThemeProvider.tsx +++ b/packages/next-ui/Theme/DarkLightModeThemeProvider.tsx @@ -28,7 +28,7 @@ type ColorModeContext = { export const colorModeContext = createContext(undefined as unknown as ColorModeContext) colorModeContext.displayName = 'ColorModeContext' -type ThemeProviderProps = { +export type ThemeProviderProps = { children: React.ReactNode ssrMode?: Mode listenToBrowser?: boolean diff --git a/packages/next-ui/Theme/NextLink.tsx b/packages/next-ui/Theme/NextLink.tsx index 7f85ea6264..f38aa558dc 100644 --- a/packages/next-ui/Theme/NextLink.tsx +++ b/packages/next-ui/Theme/NextLink.tsx @@ -4,12 +4,12 @@ import { useRouter } from 'next/router' import React, { forwardRef } from 'react' import { useStorefrontConfig } from '../hooks/useStorefrontConfig' -type NextLinkPropsBase = Omit -type AnchorWithoutLinkProps = Omit< +export type NextLinkPropsBase = Omit +export type AnchorWithoutLinkProps = Omit< React.AnchorHTMLAttributes, keyof NextLinkPropsBase > -type LinkProps = AnchorWithoutLinkProps & Partial & { relative?: boolean } +export type LinkProps = AnchorWithoutLinkProps & Partial & { relative?: boolean } /** * This is a wrapper around the Next.js Link component which can be used with MUI's Link component diff --git a/packagesDev/next-config/__tests__/interceptors/findPlugins.ts b/packagesDev/next-config/__tests__/interceptors/findPlugins.ts index 24be614501..90e6d6deb8 100644 --- a/packagesDev/next-config/__tests__/interceptors/findPlugins.ts +++ b/packagesDev/next-config/__tests__/interceptors/findPlugins.ts @@ -240,14 +240,6 @@ it('finds plugins', () => { "targetModule": "@graphcommerce/magento-product", "type": "component", }, - { - "enabled": true, - "sourceExport": "ProductPageGallery", - "sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery", - "targetExport": "ProductPageGallery", - "targetModule": "@graphcommerce/magento-product", - "type": "component", - }, { "enabled": true, "sourceExport": "CartItemActionCard", @@ -668,6 +660,15 @@ it('finds plugins', () => { "targetModule": "@graphcommerce/magento-product", "type": "component", }, + { + "enabled": false, + "ifConfig": "configurableVariantValues.gallery", + "sourceExport": "ProductPageGallery", + "sourceModule": "@graphcommerce/magento-product-configurable/plugins/ConfigurableProductPage/ConfigurableProductPageGallery", + "targetExport": "ProductPageGallery", + "targetModule": "@graphcommerce/magento-product", + "type": "component", + }, { "enabled": false, "ifConfig": "configurableVariantValues.content",