import { productsV3 } from '@wix/stores'; import { AsChildChildren } from '@wix/headless-utils/react'; import React from 'react'; import { AsContent } from './types.js'; /** * Context for sharing variant options state between components. */ interface VariantsContextValue { /** Whether the product has any variant options. */ hasOptions: boolean; /** The list of variant option objects for the current product. */ options: any[]; } /** * Hook to access the variant options provided by `Product.Variants`. * * Returns the list of variant options for the current product. * Use this hook when you need custom rendering of options instead of using * the built-in `Product.VariantOptionRepeater`. * * **Must be used within a `Product.Variants` component.** * * @returns `{ hasOptions: boolean, options: any[] }` * * @example Custom variant iteration * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Call from a component rendered within Product.Variants * * // Custom component using the hook * function CustomVariantRenderer() { * const { hasOptions, options } = Product.useVariantsContext(); * * if (!hasOptions) return null; * * return options.map(option => ( * * * * * * * * * )); * } * * // Usage within the parent component * * * * ``` */ export declare function useVariantsContext(): VariantsContextValue; /** * Context for sharing modifier options state between components. */ interface ModifiersContextValue { /** Whether the product has any modifier options. */ hasModifiers: boolean; /** The list of modifier option objects for the current product. */ modifiers: any[]; } /** * Hook to access the modifier options provided by `Product.Modifiers`. * * Returns the list of modifier options for the current product. * Use this hook when you need custom rendering of modifiers instead of using * the built-in `Product.ModifierOptionRepeater`. * * **Must be used within a `Product.Modifiers` component.** * * @returns `{ hasModifiers: boolean, modifiers: any[] }` * * @example Custom modifier iteration * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Call from a component rendered within Product.Modifiers * * // Custom component using the hook * function CustomModifierRenderer() { * const { hasModifiers, modifiers } = Product.useModifiersContext(); * * if (!hasModifiers) return null; * * return modifiers.map(modifier => ( * * * * * * * * * * )); * } * * // Usage within the parent component * * * * ``` */ export declare function useModifiersContext(): ModifiersContextValue; /** * Basic stock status type for product availability states. */ export type BasicStockStatus = 'in-stock' | 'limited-stock' | 'out-of-stock'; /** * Extended stock status type including pre-order capability. */ export type StockStatus = BasicStockStatus | 'can-pre-order'; /** * Props for the Product root component. */ export interface ProductRootProps { /** Child components to render within the product context. See the component hierarchy for available children. */ children: React.ReactNode; /** The product data object. Load with `loadProductServiceConfig(slug)` for SSR. */ product: productsV3.V3Product; /** * Pre-selected variant data. When provided, the product initializes with this variant already selected. * * @internal This prop isn't currently implemented. */ selectedVariant?: any; } /** * Root component that provides all necessary service contexts for a complete product experience. * This composite component combines Product, ProductVariantSelector, ProductModifiers, and SelectedVariant * functionality following the documented API patterns with proper data attributes. * * > **Note:** `ProductList.ProductRepeater` automatically provides `Product.Root`. * Use this component only for standalone product display, such as a product detail page. * * For SSR, use `loadProductServiceConfig(slug)` to load the product data, then pass * `productResult.config.product` to the `product` prop. See examples below. * * ### Component hierarchy * * ```tsx * * * * * * * * * * // // Not yet published * * ... // See MediaGallery hierarchy (from @wix/headless-media/react) * * * * * * * * * * // Wraps children in Option.Root * ... // See Option hierarchy * * * * * * // Wraps children in Option.Root * ... // See Option hierarchy * * * * * * * * * * * * ``` * * ### Custom variant iteration * * Use `Product.useVariantsContext()` to manually iterate over variant options: * * ```tsx * * * // Uses useVariantsContext() + Option.Root * * * ``` * * ### Custom modifier iteration * * Use `Product.useModifiersContext()` to manually iterate over modifier options: * * ```tsx * * * // Uses useModifiersContext() + Option.Root * * * ``` * * @order 1 * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // import { loadProductServiceConfig } from '@wix/headless-stores/services'; * // * // Call loadProductServiceConfig(slug) to obtain a productConfig * * // Default styling * * * * * ``` * * @example Astro - SSR product display with SSR with loadProductServiceConfig * ```astro * --- * // Astro page example - pages/product/[slug].astro * import { loadProductServiceConfig } from '@wix/stores/services'; * import { Product } from '@wix/stores/components'; * * const { slug } = Astro.params; * const productResult = await loadProductServiceConfig(slug); * * if (productResult.type === 'notFound') { * return Astro.redirect('/404'); * } * --- * * * * * * ``` * * @example Basic usage with ProductList.ProductRepeater (Product.Root not needed) * ```tsx * // import { ProductList, Product } from '@wix/stores/components'; * // * // ProductList.ProductRepeater automatically provides Product.Root * * // Default styling * * * * * ``` */ export declare const Root: { (props: ProductRootProps): React.ReactNode; displayName: string; }; /** * Props for the `Product.Name` component. */ export interface NameProps { /** * When `true`, replaces the default `
` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `name` (`string`): The product name. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ name: string; }>; /** * CSS class name applied to the default element. */ className?: string; } /** * Displays the product name. * * By default, renders a `
` element containing the product name. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Name must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Name must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Semantic HTML improvement * *

* * * // asChild with render function - Syntax demonstration for accessing render props * * {React.forwardRef(({ name, ...props }, ref) => ( *

* {name} *

* ))} *
* * // asChild with render object - Syntax demonstration for render object pattern * * {{ * render: ({ name, ...props }, ref) => ( *

* {name} *

* ) * }} *
* ``` */ export declare const Name: React.ForwardRefExoticComponent>; /** * Props for the `Product.Description` component. */ export interface DescriptionProps { /** * When `true`, replaces the default `
` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `description` (`string`): The product description in the specified format. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ description: string; }>; /** * CSS class name applied to the default element. */ className?: string; /** * Format of the description content. * * - `'plain'`: Plain text with HTML tags stripped. * - `'html'`: HTML content (use with `dangerouslySetInnerHTML`). * - `'ricos'`: Rich content JSON string. * * Default: `'plain'` */ as?: `${AsContent}`; } /** * Displays the product description with format options. * * By default, renders a `
` element containing the plain text description. * Use the `as` prop to specify the format: `'plain'` (default), `'html'`, or `'ricos'`. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Description must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling * * ``` * * @example HTML content format * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Description must be wrapped in ProductList.ProductRepeater or Product.Root * * // HTML content format * * * // Rich content JSON format * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Description must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Custom HTML rendering with dangerouslySetInnerHTML * * {React.forwardRef(({ description, ...props }, ref) => ( *

* ))} * * * // asChild with render object - Syntax demonstration for render object pattern * * {{ * render: ({ description, ...props }, ref) => ( *
* ) * }} * * ``` */ export declare const Description: React.ForwardRefExoticComponent>; /** * Props for the `Product.Price` component. */ export interface PriceProps { /** * When `true`, replaces the default `` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `price` (`string`): The current price value. * - `formattedPrice` (`string`): The formatted price string for display. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ price: string; formattedPrice: string; }>; /** * CSS class name applied to the default element. * * The element has a `data-discounted` attribute with value `"true"` when * the product has a compare-at price, `"false"` otherwise. For conditional styling, target with * `data-[discounted=true]:` or `data-[discounted=false]:`. */ className?: string; } /** * Displays the current product price. * * Shows the price for the selected variant. By default, renders a `` element. * Includes a `data-discounted` attribute when the product is on sale. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Price must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling and data attributes * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Price must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Syntax demonstration for accessing render props * * {React.forwardRef(({ price, formattedPrice, ...props }, ref) => ( * * {formattedPrice} * * ))} * * * // asChild with render object - Syntax demonstration for render object pattern * * {{ * render: ({ price, formattedPrice, ...props }, ref) => ( * * {formattedPrice} * * ) * }} * * ``` */ export declare const Price: React.ForwardRefExoticComponent>; /** * Props for the `Product.CompareAtPrice` component. */ export interface CompareAtPriceProps { /** * When `true`, replaces the default `` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `price` (`string`): The original price value before discount. * - `formattedPrice` (`string`): The formatted original price string for display. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ price: string; formattedPrice: string; }>; /** * CSS class name applied to the default element. * * The element has a `data-discounted` attribute with value `"true"` when * the product has a compare-at price, `"false"` otherwise. For conditional styling, target with * `data-[discounted=true]:` or `data-[discounted=false]:`. */ className?: string; } /** * Displays the original price when the product is on sale. * * Only renders when the product has a compare-at (original) price. * By default, renders a `` element. Typically styled with line-through * to indicate the discounted state. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.CompareAtPrice must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling and data attributes * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.CompareAtPrice must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Adds "Was:" prefix * * {React.forwardRef(({ formattedPrice, ...props }, ref) => ( * * Was: {formattedPrice} * * ))} * * * // asChild with render object - Adds "Was:" prefix * * {{ * render: ({ formattedPrice, ...props }, ref) => ( * * Was: {formattedPrice} * * ) * }} * * ``` */ export declare const CompareAtPrice: React.ForwardRefExoticComponent>; /** * Props for the `Product.Slug` component. */ export interface SlugProps { /** * When `true`, replaces the default `` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `slug` (`string`): The URL-friendly product slug. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ slug: string; }>; /** * CSS class name applied to the default element. */ className?: string; } /** * Displays the product slug. * * By default, renders a `` element containing the URL-friendly product slug. * * @component * @order 6 * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Slug must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Slug must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Creates link to product detail page * * {React.forwardRef(({ slug, ...props }, ref) => ( * * View Product Details * * ))} * * * // asChild with render object - Creates link to product detail page * * {{ * render: ({ slug, ...props }, ref) => ( * * View Product Details * * ) * }} * * ``` */ export declare const Slug: React.ForwardRefExoticComponent>; /** * Props for the `Product.Raw` component. */ export interface RawProps { /** * When `true`, replaces the default rendering with your custom element. * * Use this when you need access to the full product object. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `product` (`V3Product`): The full product data object. * - `_id` (`string`): Unique product identifier. * - `name` (`string`): Product name. * - `slug` (`string`): URL-friendly product slug. * - `description` (`string`): Product description. * - `sku` (`string`): Stock keeping unit. * - `price` (`object`): Price information. * - `amount` (`string`): Price amount. * - `currency` (`string`): Currency code. For example, "USD". * - `formattedAmount` (`string`): Formatted price string. For example, "$10.00". * - `media` (`object`): Product media. * - `mainMedia` (`object | null`): Primary product image. * - `id` (`string`): Media ID. * - `url` (`string`): Media URL. * - `mediaType` (`string`): Media type ('IMAGE' | 'VIDEO'). * - `itemsInfo` (`object`): All media items. * - `items` (`array`): Array of media items. * - `inventory` (`object`): Inventory information. * - `availabilityStatus` (`string`): 'IN_STOCK' | 'OUT_OF_STOCK' | 'PARTIALLY_OUT_OF_STOCK'. * - `quantity` (`number | null`): Available quantity. * - `trackInventory` (`boolean`): Whether inventory is tracked. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ product: productsV3.V3Product; }>; /** * CSS class name applied to the default element. */ className?: string; } /** * Provides access to the raw product data for advanced use cases. * * This component only renders when `asChild` is `true`. Use this when you need * custom access to the full product data object. * * @component * @example Basic usage (asChild is required for this component to render) * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Raw must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling (asChild is required for this component to render) * * {React.forwardRef(({ product, ...props }, ref) => ( *
* Product ID: {product._id} * SKU: {product.sku} * Inventory: {product.inventory?.quantity} *
* ))} *
* ``` */ export declare const Raw: React.ForwardRefExoticComponent>; /** * Props for the `Product.Ribbon` component. */ export interface RibbonProps { /** * When `true`, replaces the default `` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `ribbon` (`string | null`): The ribbon text, or `null` if none. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ ribbon: string | null; }>; /** * CSS class name applied to the default element. */ className?: string; } /** * Displays a product ribbon badge. For example, "Sale", or "New". * * Only renders when the product has a ribbon set. * By default, renders a `` element containing the ribbon text. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Ribbon must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Ribbon must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *

* * * // asChild with render function - Syntax demonstration for accessing render props * * {React.forwardRef(({ ribbon, ...props }, ref) => ( *

* {ribbon} *
* ))} *
* * // asChild with render object - Syntax demonstration for accessing render props * * {{ * render: ({ ribbon, ...props }, ref) => ( *
* {ribbon} *
* ) * }} *
* ``` */ export declare const Ribbon: React.ForwardRefExoticComponent>; /** * Props for the `Product.Stock` component. */ export interface StockProps { /** * When `true`, replaces the default `` with your custom element. * * Use this when you need a different element type or custom structure. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `status` (`'in-stock' | 'limited-stock' | 'out-of-stock'`): The stock status. * - `label` (`string`): The display label for the current status. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ status: BasicStockStatus; label: string; }>; /** * CSS class name applied to the default element. * * The element has a `data-state` attribute with value `"in-stock"`, * `"limited-stock"`, or `"out-of-stock"` based on inventory status. For conditional styling, target with * `data-[state=in-stock]:`, `data-[state=limited-stock]:`, or * `data-[state=out-of-stock]:`. */ className?: string; /** Custom labels for different stock states. */ labels?: { /** Label for the in-stock state. This state is used when the quantity is greater than zero. */ inStock?: string; /** Label for the limited stock state. This state is used when the quantity is low. */ limitedStock?: string; /** Label for the out of stock state. This state is used when the quantity is zero or negative. */ outOfStock?: string; }; } /** * Displays the product-level stock status. * * Shows the overall inventory status for the product, not the selected variant. * For variant-specific stock, use `Product.ProductVariant.Stock`. * * By default, renders a `` element with a `data-state` attribute. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Stock must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * // Custom styling and data attributes * * ``` * * @example With custom labels * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Stock must be wrapped in ProductList.ProductRepeater or Product.Root * * // With custom labels * * * // With custom labels and custom styling and data attributes * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Stock must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *
* * * // asChild with render function - Syntax demonstration for accessing render props * * {React.forwardRef(({ status, label, ...props }, ref) => ( * * {label} * * ))} * * * // asChild with render object - Syntax demonstration for accessing render props * * {{ * render: ({ status, label, ...props }, ref) => ( * * {label} * * ) * }} * * ``` */ export declare const Stock: React.ForwardRefExoticComponent>; /** * Props for the `Product.Variants` component. */ export interface VariantsProps { /** * When `true`, replaces the default `
` with your custom element. * * Use this when you need a different element type or custom structure. * * Default: `false` */ asChild?: boolean; /** * Child components to render within the variants context. * * Use `Product.VariantOptions` and `Product.VariantOptionRepeater` to iterate * over and display variant options. */ children: React.ReactNode; /** * CSS class name applied to the default element. */ className?: string; } /** * Container for product variant selection system. * Does not render when there are no variants. * * Use `Product.VariantOptions` and `Product.VariantOptionRepeater` to iterate * over and display variant options. * * @component * @example Basic usage * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.Variants must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * * * * * * * * * * * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product, ProductList } from '@wix/stores/components'; * // * // Product.Variants must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *
...
*
* * // asChild with render function - Syntax demonstration for accessing render props * * {React.forwardRef(({ hasOptions, ...props }, ref) => ( *
* {props.children} *
* ))} *
* * // asChild with render object - Syntax demonstration for accessing render props * * {{ * render: ({ hasOptions, ...props }, ref) => ( *
* {props.children} *
* ) * }} *
* ``` * * @example Custom iteration with `useVariantsContext()` * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.Variants must be wrapped in ProductList.ProductRepeater or Product.Root * * // Custom component using the hook * function CustomVariantRenderer() { * const { hasOptions, options } = Product.useVariantsContext(); * * if (!hasOptions) return null; * * return options.map(option => ( * * * * * * * * * )); * } * * // Usage within the parent component * * * * ``` */ export declare const Variants: React.ForwardRefExoticComponent>; /** * Props for the `Product.VariantOptions` component. */ export interface VariantOptionsProps { /** * Child components to render when variant options exist. * * Typically contains `Product.VariantOptionRepeater` to iterate over options. */ children: React.ReactNode; /** * Content to display when no variant options are available. * * Only rendered when the product has no variants. */ emptyState?: React.ReactNode; } /** * Component that provides access to variant options. * * @component * @example Basic usage * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.VariantOptions must be wrapped in Product.Variants * * // Default styling * * * * * * * * * * * ``` * * @example With emptyState * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.VariantOptions must be wrapped in Product.Variants * * // With emptyState * No options available
}> * * * * * ``` */ export declare const VariantOptions: React.ForwardRefExoticComponent>; /** * Props for the `Product.VariantOptionRepeater` component. */ export interface VariantOptionRepeaterProps { /** * Child components to render for each variant option. * * Children are automatically wrapped in `Option.Root`, so you can use * `Option.Root` child components directly. */ children: React.ReactNode; } /** * Repeater component that renders children for each variant option. * * These children are automatically wrapped in `Option.Root`, so you can use * `Option.Root` child components directly. * * @component */ export declare const VariantOptionRepeater: React.ForwardRefExoticComponent>; /** * Props for the `Product.Modifiers` component. */ export interface ModifiersProps { /** * When `true`, replaces the default `
` with your custom element. * * Use this when you need a different element type or custom structure. * * Default: `false` */ asChild?: boolean; /** * Child components to render within the modifiers context. * * Use `Product.ModifierOptions` and `Product.ModifierOptionRepeater` to iterate * over and display modifier options. */ children: React.ReactNode; /** * CSS class name applied to the default element. */ className?: string; } /** * Container for product modifier system. * Does not render when there are no modifiers. * * Use `Product.ModifierOptions` and `Product.ModifierOptionRepeater` to iterate * over and display modifier options. * * @component * @example Basic usage * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.Modifiers must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * * * * * * * * * * * * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product, ProductList } from '@wix/stores/components'; * // * // Product.Modifiers must be wrapped in ProductList.ProductRepeater or Product.Root * * // asChild with React element - Syntax demonstration for alternative element type * *
...
*
* * // asChild with render function - Syntax demonstration for accessing render props * * {React.forwardRef(({ hasModifiers, ...props }, ref) => ( *
* {props.children} *
* ))} *
* * // asChild with render object - Syntax demonstration for accessing render props * * {{ * render: ({ hasModifiers, ...props }, ref) => ( *
* {props.children} *
* ) * }} *
* ``` * * @example Custom iteration with `useModifiersContext()` * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.Modifiers must be wrapped in ProductList.ProductRepeater or Product.Root * * // Custom component using the hook * function CustomModifierRenderer() { * const { hasModifiers, modifiers } = Product.useModifiersContext(); * * if (!hasModifiers) return null; * * return modifiers.map(modifier => ( * * * * * * * * * * )); * } * * // Usage within the parent component * * * * ``` */ export declare const Modifiers: React.ForwardRefExoticComponent>; /** * Props for the `Product.ModifierOptions` component. */ export interface ModifierOptionsProps { /** * Child components to render when modifier options exist. * * Typically contains `Product.ModifierOptionRepeater` to iterate over modifiers. */ children: React.ReactNode; /** * Content to display when no modifier options are available. * * Only rendered when the product has no modifiers. */ emptyState?: React.ReactNode; } /** * Component that provides access to modifier options. * * @component * @example Basic usage * ```tsx * // import { Product, Option, Choice } from '@wix/stores/components'; * // * // Product.ModifierOptions must be wrapped in Product.Modifiers * * // Default styling * * * * * * * * * * * * * ``` * * @example With emptyState * ```tsx * // import { Product, Option } from '@wix/stores/components'; * // * // Product.ModifierOptions must be wrapped in Product.Modifiers * * // With emptyState * No modifiers available
}> * * * * * ``` */ export declare const ModifierOptions: React.ForwardRefExoticComponent>; /** * Props for the `Product.ModifierOptionRepeater` component. */ export interface ModifierOptionRepeaterProps { /** * Child components to render for each modifier option. * * Children are automatically wrapped in `Option.Root`, so you can use * `Option.Root` child components directly. */ children: React.ReactNode; /** * Which modifier option types to render. * * Default: `['color', 'text', 'free-text']` (all types) */ allowedTypes?: ('color' | 'text' | 'free-text')[]; } /** * Repeater component that renders children for each modifier option. * * These children are automatically wrapped in `Option.Root`, so you can use * `Option.Root` child components directly. * * @component */ export declare const ModifierOptionRepeater: React.ForwardRefExoticComponent>; /** * Props for the `Product.MediaGallery` component. */ export interface ProductMediaGalleryProps { /** * Child components from `@wix/headless-media/react` to build the gallery. * * At minimum, include `` to display product images. * See the component description for required imports. */ children: React.ReactNode; /** * Whether the gallery loops infinitely. * * When `true`, navigating past the last image returns to the first. * * Default: `false` */ infinite?: boolean; /** * Auto-play configuration for the gallery. * * - `direction`: `'forward'` or `'backward'`. Default: `'forward'` * - `intervalMs` (`number`): Milliseconds between slides. Default: `3000` */ autoPlay?: { /** Scroll direction for auto-play. Default: `'forward'` */ direction?: 'forward' | 'backward'; /** Milliseconds between slides. Default: `3000` */ intervalMs?: number; }; } /** * Container for product media gallery. * This is a wrapper that provides the product's media items to a `MediaGallery.Root`. * * > **Note:** This component is exported as both `ProductMediaGallery` and `MediaGallery`. * Use `Product.MediaGallery` for consistency with other Product components. * * **Important:** This component requires MediaGallery child components to render anything. * At minimum, include `` to display the product images. * These components must be imported from `@wix/headless-media/react`. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // import { MediaGallery } from '@wix/headless-media/react'; * // * // Product.MediaGallery must be wrapped in ProductList.ProductRepeater or Product.Root * * // Default styling * * * * ``` * * @example With navigation and thumbnails * ```tsx * // import { Product } from '@wix/stores/components'; * // import { MediaGallery } from '@wix/headless-media/react'; * // * // Product.MediaGallery must be wrapped in ProductList.ProductRepeater or Product.Root * * // With navigation and thumbnails * * * * * * * * * * * ``` */ export declare const ProductMediaGallery: React.ForwardRefExoticComponent>; /** * Alias for ProductMediaGallery to match the documented API. */ export { ProductMediaGallery as MediaGallery }; /** * Props for the `Product.Quantity.Root` component. */ export interface ProductQuantityProps { /** * When `true`, replaces the default rendering with your custom element. * * Use this for fully custom quantity UI with access to all quantity state. * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * Child components to render within the quantity selector. * * Wrap multiple sub-components in a single element (`
` or `<>...`), otherwise nothing will render. * * When using `asChild`, the typical pattern is a render function for complete custom UI. * If using the atypical React element pattern with `asChild`, fragments can't receive props and will cause an error. Use `
` or another real element. * * Use `Product.Quantity.Decrement`, `Product.Quantity.Input`, * `Product.Quantity.Increment`, and `Product.Quantity.Raw` to build the UI. * * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `selectedQuantity` (`number`): The currently selected quantity. * - `availableQuantity` (`number | null`): Maximum available quantity, or `null` if unlimited. * - `inStock` (`boolean`): Whether the product is in stock. * - `isPreOrderEnabled` (`boolean`): Whether pre-order is available. * - `setSelectedQuantity` (`(quantity: number) => void`): Function to update the quantity. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ selectedQuantity: number; availableQuantity: number | null; inStock: boolean; isPreOrderEnabled: boolean; setSelectedQuantity: (quantity: number) => void; }>; /** * CSS class name applied to the default element. */ className?: string; } /** * Props for `Product.Quantity.Decrement`, `Product.Quantity.Input`, and `Product.Quantity.Increment` components. */ export interface ProductQuantitySubComponentProps { /** * CSS class name applied to the default element. */ className?: string; /** * When `true`, replaces the default element with your custom element. * * See the `children` prop for usage details. * * Default: `false` */ asChild?: boolean; /** * When using `asChild`, pass a React element, render function, or render object. * * **React element:** This must be an element that can have children, such as

or . Your element receives the default element's props automatically. * * **Render function:** Your function receives: * - `disabled` (`boolean`): Whether the control should be disabled. * * **Render object:** You can use a render object in the form `{ render: (props, ref) => ReactNode }` as an alternative to a render function. Receives the same props as the function. */ children?: AsChildChildren<{ disabled: boolean; }>; /** * Whether the component is disabled. * * For `Decrement` and `Increment`, this is automatically determined * based on stock and quantity limits. */ disabled?: boolean; } /** * Product quantity selector component that integrates with the selected variant. * Provides quantity controls with stock validation and can-pre-order support. * Uses a compound component pattern with Root, Decrement, Input, Increment, and Raw sub-components. * * > **Notes:** * > - This component is also available as `Product.Quantity.Root` for consistency with other Product components. * > - Wrap multiple sub-components in a single element (`
` or `<>...`), otherwise nothing will render. * > - When using `asChild`, the typical pattern is a render function for complete custom UI. If using the atypical React element pattern with `asChild`, fragments can't receive props and will cause an error. Use `
` or another real element. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Quantity.Root must be wrapped in Product.Root * * // Default styling * * <> * * * * * * * // Custom styling * * <> * * * * * * ``` * * @example Custom rendering with `asChild` * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Quantity.Root must be wrapped in Product.Root * * // asChild with React element - Semantic HTML improvement * *
* * * *
*
* * // asChild with render function - Custom quantity selector with increment/decrement * * {React.forwardRef(({ selectedQuantity, setSelectedQuantity, availableQuantity, inStock, ...props }, ref) => ( *
* * {selectedQuantity} * *
* ))} *
* * // asChild with render object - Custom quantity selector with increment/decrement * * {{ * render: ({ selectedQuantity, setSelectedQuantity, availableQuantity, inStock, ...props }, ref) => ( *
* * {selectedQuantity} * *
* ) * }} *
* ``` */ export declare const ProductQuantity: React.ForwardRefExoticComponent>; /** * Product Quantity Decrement component. * Automatically handles disabled state based on stock and can-pre-order settings. * Must be used within Product.Quantity.Root. * * > **Note:** This component is also available as `Product.Quantity.Decrement` for consistency with other Product components. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Quantity.Decrement must be wrapped in Product.Quantity.Root * * // Default styling * * * // Custom styling * * ``` */ export declare const ProductQuantityDecrement: React.ForwardRefExoticComponent>; /** * Product Quantity Input component. * Displays the current quantity value. Must be used within Product.Quantity.Root. * * > **Note:** This component is also available as `Product.Quantity.Input` for consistency with other Product components. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Quantity.Input must be wrapped in Product.Quantity.Root * * // Default styling * * * // Custom styling * * ``` */ export declare const ProductQuantityInput: React.ForwardRefExoticComponent>; /** * Product Quantity Increment component. * Automatically handles disabled state based on stock availability. * Must be used within Product.Quantity.Root. * * > **Note:** This component is also available as `Product.Quantity.Increment` for consistency with other Product components. * * @component * @example Basic usage * ```tsx * // import { Product } from '@wix/stores/components'; * // * // Product.Quantity.Increment must be wrapped in Product.Quantity.Root * * // Default styling * * * // Custom styling * * ``` */ export declare const ProductQuantityIncrement: React.ForwardRefExoticComponent>; /** * Props for `Product.Action.AddToCart`, `Product.Action.BuyNow`, and `Product.Action.PreOrder` components. */ export interface ProductActionProps { /** * When `true`, replaces the default `