import { type GenericListRootProps, type GenericListItemsProps, type GenericListRepeaterProps, type MoneyProps } from '@wix/headless-components/react'; import { type AsChildChildren } from '@wix/headless-utils/react'; import React from 'react'; import { type EventServiceConfig } from '../services/event-service.js'; import { type TicketDefinitionListServiceConfig } from '../services/ticket-definition-list-service.js'; import { type TicketDefinition as TicketDefinitionType } from '../services/ticket-definition-service.js'; import { type CheckoutServiceConfig } from '../services/checkout-service.js'; /** * Props for the TicketsPicker Root component. */ export interface RootProps extends Pick, 'children' | 'className' | 'variant'> { /** Event service configuration */ eventServiceConfig: EventServiceConfig; /** Ticket definition list service configuration */ ticketDefinitionListServiceConfig: TicketDefinitionListServiceConfig; /** Checkout service configuration */ checkoutServiceConfig: CheckoutServiceConfig; } /** * Root container that provides necessary services context to all child components. * Must be used as the top-level component for tickets picker functionality. * * @order 1 * @component * @example * ```tsx * import { TicketsPicker } from '@wix/events/components'; * * function TicketsPickerComponent({ eventServiceConfig, ticketDefinitionListServiceConfig, checkoutServiceConfig }) { * return ( * * * * * * * * * * * * * * * * * * * * * * ); * } * ``` */ export declare const Root: React.ForwardRefExoticComponent>; /** * Props for the TicketsPicker TicketDefinitions component. */ export interface TicketDefinitionsProps extends GenericListItemsProps { } /** * Container for the ticket definition list with empty state support. * Follows List Container Level pattern. * * @component * @example * ```tsx * No tickets found}> * * * * * * ``` */ export declare const TicketDefinitions: React.ForwardRefExoticComponent>; /** * Props for the TicketsPicker TicketDefinitionRepeater component. */ export interface TicketDefinitionRepeaterProps extends Omit, 'itemWrapper'> { } /** * Repeater component that renders TicketDefinition.Root for each ticket definition. * Follows Repeater Level pattern. * * @component * @example * ```tsx * * * * * ``` */ export declare const TicketDefinitionRepeater: React.ForwardRefExoticComponent>; /** * Props for the TicketsPicker Totals component. */ export interface TotalsProps extends Omit { children?: React.ReactNode | AsChildChildren<{ /** Total value */ total: number; /** Subtotal value */ subtotal: number; /** Tax value */ tax: number; /** Fee value */ fee: number; /** Formatted total value */ formattedTotalMoney: string; /** Formatted total value parts */ formattedTotalMoneyParts: Intl.NumberFormatPart[]; /** Formatted subtotal value */ formattedSubtotalMoney: string; /** Formatted subtotal value parts */ formattedSubtotalMoneyParts: Intl.NumberFormatPart[]; /** Formatted tax value */ formattedTaxMoney: string; /** Formatted tax value parts */ formattedTaxMoneyParts: Intl.NumberFormatPart[]; /** Formatted fee value */ formattedFeeMoney: string; /** Formatted fee value parts */ formattedFeeMoneyParts: Intl.NumberFormatPart[]; /** Tax name */ taxName: string | null; /** Tax rate */ taxRate: number | null; /** Whether tax is included in price */ taxIncluded: boolean; /** Fee rate */ feeRate: number; }>; } /** * Provides totals data for the tickets picker. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ formattedTotalMoney, formattedSubtotalMoney, formattedTaxMoney, formattedFeeMoney }, ref) => ( * * Subtotal: {formattedSubtotalMoney} * Tax: {formattedTaxMoney} * Fee: {formattedFeeMoney} * Total: {formattedTotalMoney} * * ))} * * ``` */ export declare const Totals: React.ForwardRefExoticComponent>; /** * Props for the TicketsPicker CheckoutError component. */ export interface CheckoutErrorProps { /** Whether to render as a child component */ asChild?: boolean; /** Custom render function when using asChild */ children?: AsChildChildren<{ /** Error message */ error: string; }>; /** CSS classes to apply to the default element */ className?: string; } /** * Displays an error message when the checkout fails. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ error, ...props }, ref) => ( * * {error} * * ))} * * ``` */ export declare const CheckoutError: React.ForwardRefExoticComponent>; /** * Props for the TicketsPicker CheckoutTrigger component. */ export interface CheckoutTriggerProps { /** Whether to render as a child component */ asChild?: boolean; /** Custom render function when using asChild */ children?: AsChildChildren<{ /** Whether the checkout is in progress */ isLoading: boolean; /** Error message if any */ error: string | null; /** Whether any ticket definitions are selected */ hasSelectedTicketDefinitions: boolean; /** Function to trigger the checkout */ checkout: () => Promise; }>; /** CSS classes to apply to the default element */ className?: string; /** The label to display inside the button */ label?: React.ReactNode; /** The loading state to display inside the button */ loadingState?: React.ReactNode; } /** * Displays a button for checkout functionality. * * @component * @example * ```tsx * // Default usage * * * // asChild with primitive * * * * * // asChild with react component * * {React.forwardRef(({ isLoading, error, hasSelectedTicketDefinitions, checkout, ...props }, ref) => ( * * ))} * * ``` */ export declare const CheckoutTrigger: React.ForwardRefExoticComponent>;