/**
* LocationList - High-level component for displaying locations list
* Follows the pattern from ServiceList.tsx
*
* @module React/LocationList
*/
import React from 'react';
import { GenericListRepeaterProps, type ListVariant } from '@wix/headless-components/react';
import { type AsChildChildren } from '@wix/headless-utils/react';
import type { LocationListServiceConfig } from '../../services/location-list/location-list.js';
import { type Location } from '../../services/location-list/location-list.def.js';
export declare const TestIds: {
readonly locationListRoot: "location-list-root";
readonly locationListLocations: "location-list-locations";
readonly locationListLocation: "location-list-location";
readonly locationListActionClear: "location-list-action-clear";
readonly locationListTotals: "location-list-totals";
};
/**
* Props for the LocationList root component
*/
export interface RootProps {
children: React.ReactNode;
locationListConfig?: LocationListServiceConfig;
className?: string;
variant?: ListVariant;
/** Custom label for CUSTOM location type */
customLocationLabel?: string;
/** Custom label for CUSTOMER location type */
customerLocationLabel?: string;
}
/**
* Root component that provides the LocationList service context for rendering locations lists.
*
* @component
* @example
* ```tsx
* import { LocationList, Location } from '@wix/bookings/react';
*
* function LocationsPage({ locationListConfig }) {
* return (
*
* No locations available}>
*
*
*
*
*
*
* );
* }
* ```
*/
export declare const Root: React.ForwardRefExoticComponent>;
/**
* Props for LocationList.Locations component
*/
export interface LocationsProps {
children: React.ReactNode;
emptyState?: React.ReactNode;
className?: string;
}
/**
* Container for the locations list with empty state support.
* Wraps GenericList.Items internally (no separate Items export).
*
* @component
* @example
* ```tsx
* No locations available}>
*
*
*
*
*
* ```
*/
export declare const Locations: React.ForwardRefExoticComponent>;
/**
* Props for LocationList.LocationRepeater component
*/
export type LocationRepeaterProps = GenericListRepeaterProps;
export declare const LocationRepeater: React.ForwardRefExoticComponent>;
/**
* Props for LocationList.Totals component
*/
export interface TotalsProps extends Omit, 'children'> {
asChild?: boolean;
children?: React.ReactNode | AsChildChildren<{
count: number;
hasLocations: boolean;
}>;
}
/**
* Displays the total count of locations.
*
* @component
* @example
* ```tsx
*
*
* // With asChild
*
* {({ count }) => {count} locations available}
*
* ```
*/
export declare const Totals: React.ForwardRefExoticComponent>;
/**
* Props for LocationList.Actions.Clear component
*/
export interface ClearProps extends Omit, 'children' | 'onClick'> {
asChild?: boolean;
children?: React.ReactNode | ((props: {
onClick: () => void;
}) => React.ReactNode);
label?: string;
onClick?: (location: Location | null) => void;
}
/**
* Actions namespace for location list-level actions
*/
export declare const Actions: {
Clear: React.ForwardRefExoticComponent>;
};