import React from 'react'; import { DispatchType, FulfillmentTypeEnum } from '../types/fulfillments-types.js'; import { AsChildChildren } from '@wix/headless-utils/react'; interface TimeSlotContextValue { timeSlots: Array<{ id: string; label: string; startTime: Date; endTime: Date; dispatchType: DispatchType; isAsap: boolean; }>; selectedTimeSlotId: string | null; onTimeSlotChange: (timeSlotId: string) => void; hasTimeSlots: boolean; } export interface RootProps extends Omit, 'children'> { /** Child components that will have access to fulfillment details context */ children: React.ReactNode; } /** * Root headless component for Fulfillment Details * Provides context for fulfillment detail components * * @example * ```tsx * * * * * * * * * ``` */ export declare const Root: React.ForwardRefExoticComponent>; interface AddressNameProps extends Omit, 'children'> { /** Whether to render as a child component */ asChild?: boolean; /** Children render prop that receives the address data */ children?: AsChildChildren<{ addressName: string | null; fullAddress: string | null; hasAddress: boolean; dispatchType: DispatchType | null; }> | React.ReactNode; } /** * Headless component for displaying the fulfillment address name * Shows pickup location name or delivery address * * @example * ```tsx * * {({ addressName, dispatchType }) => ( *
* {dispatchType === 'PICKUP' ? 'Pickup at: ' : 'Deliver to: '} * {addressName} *
* )} *
* ``` */ export declare const AddressName: React.ForwardRefExoticComponent>; interface FulfillmentDateProps extends Omit, 'children' | 'type' | 'value' | 'onChange' | 'min' | 'max'> { /** Whether to render as a child component */ asChild?: boolean; /** Optional label text or element for the date picker */ label?: React.ReactNode; /** Optional class name for the label element */ labelClassName?: string; /** Optional class name for the wrapper div (only rendered when label is provided) */ wrapperClassName?: string; /** Optional children render prop that receives the date picker props */ children?: AsChildChildren<{ selectedDate: Date | null; onDateChange: (date: Date) => void; availableDates: Array<{ date: Date; hasAvailableSlots: boolean; }>; isValidDate: (date: Date) => boolean; }> | React.ReactNode; } /** * Headless component for fulfillment date selection * Provides date picker functionality with default input type="date" rendering * * @example * ```tsx * // Default usage - renders input type="date" * * * // With custom class name * * * // With label * * * // Using asChild pattern * * {({ selectedDate, onDateChange, minDate, maxDate }) => ( * onDateChange(new Date(e.target.value))} * min={toISODateString(minDate)} * max={toISODateString(maxDate)} * /> * )} * * ``` */ export declare const FulfillmentDate: React.ForwardRefExoticComponent>; interface AvailableTimeSlotsProps extends Omit, 'children'> { /** Child components that will have access to time slot context */ children: React.ReactNode; } /** * Container component for available time slots * Provides context for time slot selection * Does not render if no time slots are available * * @example * ```tsx * * No slots}> * * {({ label, isSelected }) => ( *
{label}
* )} *
*
*
* ``` */ export declare const AvailableTimeSlots: React.ForwardRefExoticComponent>; type TimeSlotRenderProps = { timeSlots: TimeSlotContextValue['timeSlots']; selectedTimeSlotId: string | null; onTimeSlotChange: (timeSlotId: string) => void; hasTimeSlots: boolean; }; interface TimeSlotOptionsProps extends Omit, 'children'> { /** Whether to render as a child component */ asChild?: boolean; /** Child components or render prop that receives time slot data */ children?: ((props: TimeSlotRenderProps) => React.ReactNode) | React.ReactNode; /** Optional content to display when no time slots are available */ emptyState?: React.ReactNode; } /** * Container for time slot options list with empty state support * Supports both regular children and asChild pattern for custom rendering (e.g., select dropdowns) * * @example * ```tsx * // Regular usage with repeater * No time slots}> * * {({ label }) =>
{label}
} *
*
* * // With asChild for select dropdown * * {({ timeSlots, selectedTimeSlotId, onTimeSlotChange }) => ( * * )} * * ``` */ export declare const TimeSlotOptions: React.ForwardRefExoticComponent>; interface TimeSlotOptionRepeaterProps { /** Render prop that receives each time slot option data */ children: (props: { id: string; label: string; startTime: Date; endTime: Date; isSelected: boolean; isAsap: boolean; onSelect: () => void; }) => React.ReactNode; } /** * Repeater component that renders children for each available time slot * * @example * ```tsx * * {({ label, isSelected, onSelect, isAsap }) => ( * * )} * * ``` */ export declare const TimeSlotOptionRepeater: React.FC; interface FulfillmentTypeProps extends Omit, 'children'> { /** Whether to render as a child component */ asChild?: boolean; /** Label text for the schedule for later (preorder) option */ scheduleLabel?: string; /** Aria label for the radio group */ groupAriaLabel?: string; /** Template text for ASAP time display (e.g., "Ready in {0} min"). Use {0} for asapTime placeholder */ asapTimeText?: string; /** Optional class name for the radio input elements */ inputClassName?: string; /** Children render prop that receives the fulfillment type selection props */ children?: AsChildChildren<{ selectedType: FulfillmentTypeEnum; onTypeChange: (type: FulfillmentTypeEnum) => void; hasAsapOption: boolean; hasPreorderOption: boolean; asapTime: number | undefined; asapTimeRange: { minDuration?: number; maxDuration?: number; } | undefined; }> | React.ReactNode; } /** * Headless component for fulfillment type selection (ASAP or Schedule for later) * Provides radio button functionality with default rendering * * @example * ```tsx * // Default usage - renders radio buttons * * * // With custom labels * * * // Using asChild pattern * * {({ selectedType, onTypeChange, hasAsapOption, hasPreorderOption }) => ( *
* {hasAsapOption && ( * * )} * {hasPreorderOption && ( * * )} *
* )} *
* ``` */ export declare const FulfillmentType: React.ForwardRefExoticComponent>; /** * Address fields that can be updated */ export interface DeliveryAddressFields { /** Street address line 1 */ addressLine?: string; /** Street address line 2 (apartment, suite, etc.) */ addressLine2?: string; /** City */ city?: string; /** State/Province/Subdivision */ subdivision?: string; /** Postal/ZIP code */ postalCode?: string; /** Country */ country?: string; /** Formatted full address string */ formattedAddress?: string; } interface DeliveryAddressProps extends Omit, 'children'> { /** Whether to render as a child component */ asChild?: boolean; /** Label text for the address input */ label?: React.ReactNode; /** Optional class name for the label element */ labelClassName?: string; /** Optional class name for the wrapper div (only rendered when label is provided) */ wrapperClassName?: string; /** Placeholder text for the address input */ placeholder?: string; /** Optional class name for the input element */ inputClassName?: string; /** Children render prop that receives the address data */ children?: AsChildChildren<{ address: DeliveryAddressFields | null; hasAddress: boolean; isDelivery: boolean; dispatchType: DispatchType | null; onAddressChange: (address: DeliveryAddressFields) => void; onAddressClear: () => void; }> | React.ReactNode; } /** * Headless component for editing the delivery address * Only renders when dispatch type is DELIVERY * * @example * ```tsx * // Default usage - renders input for address line * * * // Using asChild pattern for custom rendering * * {({ address, hasAddress, isDelivery, onAddressChange, onAddressClear }) => ( * isDelivery && ( *
* onAddressChange({ ...address, addressLine: e.target.value })} * placeholder="Street Address" * /> * onAddressChange({ ...address, city: e.target.value })} * placeholder="City" * /> * onAddressChange({ ...address, postalCode: e.target.value })} * placeholder="ZIP Code" * /> * {hasAddress && } *
* ) * )} *
* ``` */ export declare const DeliveryAddress: React.ForwardRefExoticComponent>; export interface AddressPrediction { /** The human-readable name of the prediction */ description?: string; /** The id of the prediction that can be used in place API */ searchId?: string; /** Contains the main text of a prediction, usually the name of the place */ mainText?: string; /** Contains the secondary text of a prediction, usually the location of the place */ secondaryText?: string; } interface AddressPickerProps extends Omit, 'children'> { /** Whether to render as a child component */ asChild?: boolean; /** Placeholder text for the address input */ placeholder?: string; /** Optional class name for the input element */ inputClassName?: string; /** Optional class name for the predictions container */ predictionsClassName?: string; /** Optional class name for individual prediction items */ predictionClassName?: string; /** Optional class name for the prediction main text */ predictionMainTextClassName?: string; /** Optional class name for the prediction secondary text */ predictionSecondaryTextClassName?: string; /** Optional class name for the prediction description */ predictionDescriptionClassName?: string; /** Optional class name for the error message */ errorClassName?: string; /** Minimum input length before showing predictions (default: 2) */ minInputLength?: number; /** Children render prop that receives the address picker props */ children?: AsChildChildren<{ inputValue: string; onInputChange: (value: string) => void; predictions: AddressPrediction[]; isLoading: boolean; onPredictionSelect: (prediction: AddressPrediction) => Promise; isDelivery: boolean; dispatchType: DispatchType | null; error: string | null; }> | React.ReactNode; } export declare const AddressPicker: React.ForwardRefExoticComponent>; interface SaveButtonProps extends Omit, 'children'> { /** Whether to render as a child component */ asChild?: boolean; /** Text to display while saving */ savingText?: string; /** Text to display when save is available */ saveText?: string; /** Children render prop that receives the save state */ children?: AsChildChildren<{ onSave: () => void; isSaving: boolean; canSave: boolean; hasChanges: boolean; selectedTimeSlot: { id: string; startTime: Date; endTime: Date; dispatchType: DispatchType; } | null; dispatchType: DispatchType | null; }> | React.ReactNode; } /** * Headless component for saving fulfillment details * Saves the selected time slot to the FulfillmentsService * * @example * ```tsx * // Default usage - renders a save button * * * // Using asChild pattern for custom rendering * * {({ onSave, isSaving, canSave, hasChanges }) => ( * * )} * * ``` */ export declare const SaveButton: React.ForwardRefExoticComponent>; interface DispatchTypeSelectorProps extends Omit, 'children'> { /** Child components that will have access to dispatch type context */ children: React.ReactNode; } /** * Container component for dispatch type selection (pickup or delivery) * Provides context for child components to access dispatch type data * Does not render if no dispatch types are available * * @example * ```tsx * * No options}> * * {({ type, isSelected, selectDispatchType }) => ( * * )} * * * * ``` */ export declare const DispatchTypeSelector: React.ForwardRefExoticComponent>; interface DispatchTypeOptionsProps extends Omit, 'children'> { /** Child components to render when dispatch types are available */ children: React.ReactNode; /** Optional content to display when no dispatch types are available */ emptyState?: React.ReactNode; } /** * Container for dispatch type options list with empty state support * * @example * ```tsx * No options available}> * * {({ type }) =>
{type}
} *
*
* ``` */ export declare const DispatchTypeOptions: React.ForwardRefExoticComponent>; interface DispatchTypeOptionRepeaterProps { /** Render prop that receives each dispatch type option data */ children: (props: { type: DispatchType; isSelected: boolean; selectDispatchType: (type: DispatchType) => void; }) => React.ReactNode; } /** * Repeater component that renders children for each available dispatch type * * @example * ```tsx * * {({ type, isSelected, selectDispatchType }) => ( * * )} * * ``` */ export declare const DispatchTypeOptionRepeater: React.FC; export {};