import React from 'react'; import { type LineItem } from '@wix/ecom/services'; import { type AsChildChildren } from '@wix/headless-utils/react'; import { ItemServiceConfig } from '../services/item-details-service.js'; import { EnhancedVariant } from '@wix/headless-restaurants-menus/services'; import { AvailabilityStatus, AvailabilityStatusMap, AddToCartButtonState } from '../services/common-types.js'; /** * Props for the ItemDetails Root component */ export interface RootProps { /** Whether to render as a child component */ asChild?: boolean; /** Child components that will have access to the item context */ children: React.ReactNode; /** Optional pre-loaded item details service configuration */ itemDetailsServiceConfig?: ItemServiceConfig; } /** * Root headless component for menu item details * Provides service context and item data for all child components * * @example * ```tsx * * * * * * * * ``` */ export declare const Root: { ({ children, itemDetailsServiceConfig }: RootProps): import("react/jsx-runtime").JSX.Element; displayName: string; }; /** * Props for the ItemDetails Variants component */ export interface ItemDetailsVariantsProps { /** Children render prop that receives variant data */ children?: AsChildChildren<{ variant: EnhancedVariant; variants: EnhancedVariant[]; hasVariants: boolean; selectedVariantId?: string; onVariantChange?: (variantId: string) => void; }>; /** CSS classes to apply to the default container */ className?: string; /** Whether to render as a child component */ asChild?: boolean; /** CSS classes to apply to variant names */ variantNameClassName?: string; /** CSS classes to apply to variant prices */ variantPriceClassName?: string; /** CSS classes to apply to the RadioGroup container */ radioGroupClassName?: string; /** CSS classes to apply to each RadioGroup.Item (variant radio button) */ variantRadioItemClassName?: string; /** CSS classes to apply to the RadioGroup.Indicator (radio button circle) */ variantRadioIndicatorClassName?: string; /** CSS classes to apply to the radio button wrapper (outer circle with border) */ variantRadioButtonWrapperClassName?: string; /** CSS classes to apply to each variant item container */ variantItemClassName?: string; /** CSS classes to apply to the variant name and price container */ variantContentClassName?: string; /** Optional content to display when no variants are available */ emptyState?: React.ReactNode; } /** * Headless component for item variants selection * Renders variants using Radix UI RadioGroup for single selection * Supports custom rendering via asChild or children render prop * * @example * ```tsx * No variants available} * /> * ``` * * @example * Custom rendering with children prop: * ```tsx * * {({ variants, selectedVariantId, onVariantChange }) => ( *
* {variants.map((variant) => ( * * ))} *
* )} *
* ``` */ export declare const Variants: React.ForwardRefExoticComponent>; /** * Props for the ItemDetails SpecialRequest component */ export interface SpecialRequestProps { /** Whether to render as a child component */ asChild?: boolean; /** Children render prop that receives value and onChange handler */ children?: AsChildChildren<{ value: string; onChange: (value: string) => void; allowSpecialRequest: boolean; /** * Owner-configured placeholder text for the special-request textarea. * `undefined` → consumers should use their default placeholder. * `""` → consumers should render NO placeholder. * `"..."` → consumers should use the string as-is. */ specialRequestInstructions?: string; }>; /** Placeholder text for the textarea */ placeholder?: string; /** Maximum number of characters allowed */ maxLength?: number; /** Number of visible text lines */ rows?: number; /** CSS classes to apply to the textarea */ className?: string; /** CSS classes to apply to the label */ labelClassName?: string; /** Label text for the input */ label?: string; /** Whether to show character count */ showCharCount?: boolean; } /** * Props for the ItemDetails AddToCartButton component */ export interface AddToCartButtonProps { /** Whether to render as a child component */ asChild?: boolean; /** CSS classes to apply to the button */ className?: string; /** Map of button states to display text */ addToCartLabelMap: Record; /** Children render prop that receives button state and line item data */ children?: AsChildChildren<{ onHandleAddToCart: (onClick: (lineItem: LineItem) => void) => void; buttonState: AddToCartButtonState; addToCartButtonDisabled?: boolean; /** Content to display when loading */ loadingState?: string | React.ReactNode; /** Text label for the button */ label: React.ReactNode; formattedPrice: string; price: number; }>; } /** * Headless component for adding item to cart * Wraps Commerce.Actions.AddToCart and provides item-specific state * Displays button state, price, and handles disabled states * * @example * ```tsx * * ``` * * @example * Custom rendering with children prop: * ```tsx * * {({ buttonState, formattedPrice, addToCartButtonDisabled,onHandleAddToCart }) => ( * * )} * * ``` */ export declare const AddToCartButton: React.ForwardRefExoticComponent>; /** * Props for the ItemDetails Quantity component */ export interface ItemDetailsQuantityProps { /** Whether to render as a child component */ asChild?: boolean; /** CSS classes to apply to the container */ className?: string; /** Children render prop that receives quantity state and handlers */ children: (props: { quantity: number; increment: () => void; decrement: () => void; setQuantity: (quantity: number) => void; canIncrement: boolean; canDecrement: boolean; onValueChange: (value: number) => void; }) => React.ReactNode; } /** * Headless component for item quantity selection * Provides increment/decrement controls with validation * * @example * ```tsx * * {({ quantity, increment, decrement, canIncrement, canDecrement }) => ( *
* * {quantity} * *
* )} *
* ``` */ export declare const Quantity: React.FC; /** * Headless component for special requests or custom instructions * Provides a textarea for customers to add notes or modifications * Supports character count and validation * * @example * ```tsx * * ``` * * @example * Custom rendering with children prop: * ```tsx * * {({ value, onChange }) => ( *
* *