import { SelectedVariantServiceConfig } from '../../services/selected-variant-service.js'; import { type LineItem } from '@wix/headless-ecom/services'; export interface RootProps { children: React.ReactNode; selectedVariantServiceConfig?: SelectedVariantServiceConfig; } /** * Root component that provides the SelectedVariant service context to its children. * This component sets up the necessary services for rendering and managing selected variant data. * * @order 1 * @component * @example * ```tsx * import { SelectedVariant } from '@wix/stores/components'; * * function ProductVariantDisplay() { * return ( * *
* * {({ price, compareAtPrice, currency }) => ( *
* {price} * {compareAtPrice && ( * * {compareAtPrice} * * )} * {currency} *
* )} *
*
*
* ); * } * ``` */ export declare function Root(props: RootProps): React.ReactNode; /** * Props for ProductDetails headless component */ export interface ProductDetailsProps { /** Render prop function that receives product details data */ children: (props: ProductDetailsRenderProps) => React.ReactNode; } /** * Render props for ProductDetails component */ export interface ProductDetailsRenderProps { /** Product SKU */ sku: string | null; /** Product weight */ weight: string | null; } /** * Headless component for selected variant details display * * @component * @example * ```tsx * import { SelectedVariant } from '@wix/stores/components'; * * function VariantDetails() { * return ( * * {({ sku, weight }) => ( *
* {sku &&
SKU: {sku}
} * {weight &&
Weight: {weight}
} *
* )} *
* ); * } * ``` */ export declare function Details(props: ProductDetailsProps): import("react").ReactNode; /** * Props for Price headless component */ export interface PriceProps { /** Render prop function that receives price data */ children: (props: PriceRenderProps) => React.ReactNode; } /** * Render props for Price component */ export interface PriceRenderProps { /** Current price (formatted) */ price: string; /** Compare at price (formatted) - null if no compare price */ compareAtPrice: string | null; /** Currency code */ currency: string; } /** * Headless component for product price display * * @component * @example * ```tsx * import { SelectedVariant } from '@wix/stores/components'; * * function ProductPrice() { * return ( * * {({ price, compareAtPrice, currency }) => ( *
* {price} * {compareAtPrice && ( * * {compareAtPrice} * * )} * {currency} *
* )} *
* ); * } * ``` */ export declare function Price(props: PriceProps): import("react").ReactNode; /** * Props for SKU headless component */ export interface SKUProps { /** Render prop function that receives SKU data */ children: (props: SKURenderProps) => React.ReactNode; } /** * Render props for SKU component */ export interface SKURenderProps { /** Product SKU */ sku: string | null; } /** * Headless component for product SKU display * * @component * @example * ```tsx * import { SelectedVariant } from '@wix/stores/components'; * * function ProductSKU() { * return ( * * {({ sku }) => ( *
* {sku && ( *
* SKU: {sku} *
* )} *
* )} *
* ); * } * ``` */ export declare function SKU(props: SKUProps): import("react").ReactNode; /** * Props for Actions headless component */ export interface ActionsProps { /** Render prop function that receives actions data */ children: (props: ActionsRenderProps) => React.ReactNode; } /** * Render props for Actions component */ export interface ActionsRenderProps { /** Function to add product to cart */ addToCart: () => Promise; /** Function to buy now (clear cart, add product, proceed to checkout) */ buyNow: () => Promise; /** Line items */ lineItems: LineItem[]; /** Whether add to cart is available */ canAddToCart: boolean; /** Whether add to cart is currently loading */ isLoading: boolean; /** Whether variant is in stock */ inStock: boolean; /** Whether pre-order is enabled */ isPreOrderEnabled: boolean; /** Pre-order message */ preOrderMessage: string | null; /** Error message if any */ error: string | null; } /** * Headless component for product actions (add to cart, buy now) * * @component * @example * ```tsx * import { SelectedVariant } from '@wix/stores/components'; * * function AddToCartButton() { * return ( * * {({ addToCart, buyNow, canAddToCart, isLoading, inStock, error }) => ( *
* {error &&
{error}
} * {!inStock &&
Out of stock
} * * *
* )} *
* ); * } * ``` */ export declare function Actions(props: ActionsProps): string | number | boolean | Iterable | import("react/jsx-runtime").JSX.Element | null | undefined;