import { type MoneyProps } from '@wix/headless-components/react'; import { type AsChildChildren } from '@wix/headless-utils/react'; import React from 'react'; import { PricingOption } from '../services/pricing-option-service.js'; /** * Props for the PricingOption Root component. */ export interface RootProps { /** Pricing option */ pricingOption: PricingOption; /** Whether to render as a child component */ asChild?: boolean; /** Child components that will have access to the pricing option */ children: React.ReactNode; /** CSS classes to apply to the default element */ className?: string; } /** * Root container that provides pricing option context to all child components. * Must be used as the top-level PricingOption component. * * @order 1 * @component * @example * ```tsx * import { PricingOption } from '@wix/events/components'; * * function PricingOptionComponent({ pricingOption }) { * return ( * * * * * * ); * } * ``` */ export declare const Root: React.ForwardRefExoticComponent>; /** * Props for the PricingOption Name component. */ export interface NameProps { /** Whether to render as a child component */ asChild?: boolean; /** Custom render function when using asChild */ children?: AsChildChildren<{ /** Pricing option name */ name: string; }>; /** CSS classes to apply to the default element */ className?: string; } /** * Displays the pricing option name. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ name, ...props }, ref) => ( * * {name} * * ))} * * ``` */ export declare const Name: React.ForwardRefExoticComponent>; /** * Props for the PricingOption Pricing component. */ export interface PricingProps extends Omit { } /** * Displays the pricing option price. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ formattedMoney, formattedMoneyParts, ...props }, ref) => ( * * {formattedMoney} * * ))} * * ``` */ export declare const Pricing: React.ForwardRefExoticComponent>; /** * Props for the PricingOption Tax component. */ export interface TaxProps extends Omit { children?: React.ReactNode | AsChildChildren<{ /** Tax name */ name: string; /** Tax rate */ rate: number; /** Whether tax is included in price */ included: boolean; /** Taxable value */ taxableValue: number; /** Tax value */ taxValue: number; formattedTaxableMoney: string; /** Formatted taxable value parts */ formattedTaxableMoneyParts: Intl.NumberFormatPart[]; formattedTaxMoney: string; /** Formatted tax value parts */ formattedTaxMoneyParts: Intl.NumberFormatPart[]; }>; } /** * Displays the tax for the pricing option. Only renders when event has tax settings. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ name, rate, included, taxableValue, taxValue, formattedTaxMoney, formattedTaxMoneyParts, formattedTaxableMoney, formattedTaxableMoneyParts, ...props }, ref) => ( * * {included ? `${name} included` : `+${formattedTaxMoney} ${name}`} * * ))} * * ``` */ export declare const Tax: React.ForwardRefExoticComponent>; /** * Props for the PricingOption Fee component. */ export interface FeeProps extends Omit { children?: React.ReactNode | AsChildChildren<{ /** Fee rate */ rate: number; /** Fee value */ value: number; /** Formatted fee value */ formattedMoney: string; /** Formatted fee value parts */ formattedMoneyParts: Intl.NumberFormatPart[]; }>; } /** * Displays the fee for the pricing option. Only renders when ticket definition has fee enabled. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ rate, value, formattedMoney, formattedMoneyParts, ...props }, ref) => ( * * +{formattedMoney} service fee * * ))} * * ``` */ export declare const Fee: React.ForwardRefExoticComponent>; /** * Props for the PricingOption Quantity component. */ export interface QuantityProps { /** Whether to render as a child component */ asChild?: boolean; /** Custom render function when using asChild */ children?: AsChildChildren<{ /** Array of quantity options */ options: number[]; /** Current quantity */ quantity: number; /** Maximum quantity allowed */ maxQuantity: number; /** Function to increment quantity */ increment: () => void; /** Function to decrement quantity */ decrement: () => void; /** Function to set specific quantity */ setQuantity: (quantity: number) => void; }>; /** CSS classes to apply to the default element */ className?: string; } /** * Displays a quantity selector for the pricing option. Only renders when the sale has started and the ticket definition is not sold out. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ options, quantity, maxQuantity, increment, decrement, setQuantity, ...props }, ref) => ( * * - * {quantity} * = maxQuantity} onClick={increment}>+ * * ))} * * ``` */ export declare const Quantity: React.ForwardRefExoticComponent>;