@wix/headless-bookings 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/cjs/dist/react/ServiceList.d.ts +50 -0
  2. package/cjs/dist/react/ServiceList.js +100 -0
  3. package/cjs/dist/react/ServiceListSort.d.ts +37 -0
  4. package/cjs/dist/react/ServiceListSort.js +35 -0
  5. package/cjs/dist/react/core/Service.d.ts +91 -0
  6. package/cjs/dist/react/core/Service.js +73 -0
  7. package/cjs/dist/react/core/ServiceList.d.ts +218 -0
  8. package/cjs/dist/react/core/ServiceList.js +199 -0
  9. package/cjs/dist/react/index.d.ts +4 -0
  10. package/cjs/dist/react/index.js +5 -0
  11. package/cjs/dist/react/test-ids.d.ts +18 -0
  12. package/cjs/dist/react/test-ids.js +24 -0
  13. package/cjs/dist/react/types.d.ts +52 -0
  14. package/cjs/dist/react/types.js +1 -0
  15. package/cjs/dist/services/index.d.ts +1 -0
  16. package/cjs/dist/services/index.js +1 -0
  17. package/cjs/dist/services/service-service.d.ts +136 -0
  18. package/cjs/dist/services/service-service.js +140 -0
  19. package/cjs/dist/services/services-list-service.d.ts +184 -0
  20. package/cjs/dist/services/services-list-service.js +168 -0
  21. package/cjs/package.json +3 -0
  22. package/dist/react/ServiceList.d.ts +50 -0
  23. package/dist/react/ServiceList.js +100 -0
  24. package/dist/react/ServiceListSort.d.ts +37 -0
  25. package/dist/react/ServiceListSort.js +35 -0
  26. package/dist/react/core/Service.d.ts +91 -0
  27. package/dist/react/core/Service.js +73 -0
  28. package/dist/react/core/ServiceList.d.ts +218 -0
  29. package/dist/react/core/ServiceList.js +199 -0
  30. package/dist/react/index.d.ts +4 -0
  31. package/dist/react/index.js +5 -0
  32. package/dist/react/test-ids.d.ts +18 -0
  33. package/dist/react/test-ids.js +24 -0
  34. package/dist/react/types.d.ts +52 -0
  35. package/dist/react/types.js +1 -0
  36. package/dist/services/index.d.ts +1 -0
  37. package/dist/services/index.js +1 -0
  38. package/dist/services/service-service.d.ts +136 -0
  39. package/dist/services/service-service.js +140 -0
  40. package/dist/services/services-list-service.d.ts +184 -0
  41. package/dist/services/services-list-service.js +168 -0
  42. package/package.json +70 -0
  43. package/react/package.json +4 -0
  44. package/services/package.json +4 -0
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { ServicesListServiceConfig } from '../services/services-list-service.js';
3
+ import { services } from '@wix/bookings';
4
+ /**
5
+ * Props for the ServiceList root component following the documented API
6
+ */
7
+ export interface ServiceListRootProps {
8
+ children: ((props: {
9
+ services: services.Service[];
10
+ }) => React.ReactNode) | React.ReactNode;
11
+ services?: services.Service[];
12
+ servicesListConfig?: ServicesListServiceConfig;
13
+ className?: string;
14
+ }
15
+ /**
16
+ * Root component that provides the ServiceList context for rendering service lists.
17
+ * This component manages the service data and provides it to child components through context.
18
+ */
19
+ export declare const List: React.ForwardRefExoticComponent<ServiceListRootProps & React.RefAttributes<HTMLDivElement>>;
20
+ export interface ServiceOptionsProps {
21
+ children: ((props: {
22
+ services: services.Service[];
23
+ }) => React.ReactNode) | React.ReactNode;
24
+ emptyState?: React.ReactNode;
25
+ infiniteScroll?: boolean;
26
+ pageSize?: number;
27
+ className?: string;
28
+ }
29
+ export declare const Options: React.ForwardRefExoticComponent<ServiceOptionsProps & React.RefAttributes<HTMLDivElement>>;
30
+ export interface ServiceRepeaterProps {
31
+ children: ((props: {
32
+ service: services.Service;
33
+ }) => React.ReactNode) | React.ReactNode;
34
+ className?: string;
35
+ }
36
+ export declare const ServiceRepeater: React.ForwardRefExoticComponent<ServiceRepeaterProps & React.RefAttributes<HTMLDivElement>>;
37
+ export interface RawProps {
38
+ children: ((props: {
39
+ totalServices: number;
40
+ displayedServices: number;
41
+ isFiltered: boolean;
42
+ }) => React.ReactNode) | React.ReactNode;
43
+ }
44
+ export declare const Raw: React.ForwardRefExoticComponent<RawProps & React.RefAttributes<HTMLDivElement>>;
45
+ export interface ErrorProps {
46
+ asChild?: boolean;
47
+ children?: React.ReactNode;
48
+ className?: string;
49
+ }
50
+ export declare const Error: React.ForwardRefExoticComponent<ErrorProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,100 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { useService } from '@wix/services-manager-react';
4
+ import { TestIds } from './test-ids.js';
5
+ import { AsChildSlot } from '@wix/headless-utils/react';
6
+ import { Root as CoreServiceListRoot, Error as CoreServiceListError, } from './core/ServiceList.js';
7
+ import { Root as CoreServiceRoot } from './core/Service.js';
8
+ import { ServicesListServiceDefinition, } from '../services/services-list-service.js';
9
+ /**
10
+ * Root component that provides the ServiceList context for rendering service lists.
11
+ * This component manages the service data and provides it to child components through context.
12
+ */
13
+ export const List = React.forwardRef((props, ref) => {
14
+ const { children, services = [], servicesListConfig, className } = props;
15
+ const serviceConfig = servicesListConfig || {
16
+ services: services,
17
+ searchOptions: {
18
+ cursorPaging: { limit: 10 },
19
+ },
20
+ pagingMetadata: {
21
+ count: services?.length || 0,
22
+ },
23
+ aggregations: {
24
+ results: [],
25
+ },
26
+ customizations: [],
27
+ };
28
+ return (_jsx(CoreServiceListRoot, { servicesListConfig: serviceConfig, children: _jsx(ListContent, { children: children, className: className, ref: ref }) }));
29
+ });
30
+ List.displayName = 'Services.List';
31
+ const ListContent = React.forwardRef((props, ref) => {
32
+ const { children, className } = props;
33
+ const servicesListService = useService(ServicesListServiceDefinition);
34
+ const services = servicesListService.services.get();
35
+ const pagingMetadata = servicesListService.pagingMetadata.get();
36
+ const displayedServices = services.length;
37
+ const totalServices = pagingMetadata?.count || services.length;
38
+ const isFiltered = Object.keys(servicesListService.filters.get()).length > 0;
39
+ const attributes = {
40
+ 'data-testid': TestIds.servicesList,
41
+ 'data-total-services': totalServices,
42
+ 'data-displayed-services': displayedServices,
43
+ 'data-filtered': isFiltered,
44
+ className,
45
+ };
46
+ return (_jsx("div", { ...attributes, ref: ref, children: typeof children === 'function' ? children({ services }) : children }));
47
+ });
48
+ export const Options = React.forwardRef((props, ref) => {
49
+ const { children, emptyState, infiniteScroll = true, pageSize = 0, className, } = props;
50
+ const servicesListService = useService(ServicesListServiceDefinition);
51
+ const services = servicesListService.services.get();
52
+ const hasServices = services.length > 0;
53
+ if (!hasServices) {
54
+ return emptyState || null;
55
+ }
56
+ const attributes = {
57
+ 'data-testid': TestIds.servicesOptions,
58
+ 'data-empty': !hasServices,
59
+ 'data-infinite-scroll': infiniteScroll,
60
+ 'data-page-size': pageSize,
61
+ className,
62
+ };
63
+ return (_jsx("div", { ...attributes, ref: ref, children: typeof children === 'function' ? children({ services }) : children }));
64
+ });
65
+ Options.displayName = 'Services.Options';
66
+ export const ServiceRepeater = React.forwardRef((props, _ref) => {
67
+ const { children, className } = props;
68
+ const servicesListService = useService(ServicesListServiceDefinition);
69
+ const services = servicesListService.services.get();
70
+ const hasServices = services.length > 0;
71
+ if (!hasServices)
72
+ return null;
73
+ return (_jsx(_Fragment, { children: services.map((service) => (_jsx(CoreServiceRoot, { serviceConfig: { service }, "data-testid": TestIds.serviceRepeater, "data-service-id": service._id, className: className, children: typeof children === 'function' ? children({ service }) : children }, service._id))) }));
74
+ });
75
+ ServiceRepeater.displayName = 'Services.ServiceRepeater';
76
+ export const Raw = React.forwardRef((props, ref) => {
77
+ const { children } = props;
78
+ const servicesListService = useService(ServicesListServiceDefinition);
79
+ const services = servicesListService.services.get();
80
+ const pagingMetadata = servicesListService.pagingMetadata.get();
81
+ const displayedServices = services.length;
82
+ const totalServices = pagingMetadata?.count || services.length;
83
+ const isFiltered = Object.keys(servicesListService.filters.get()).length > 0;
84
+ return (_jsx("div", { ref: ref, children: typeof children === 'function'
85
+ ? children({ totalServices, displayedServices, isFiltered })
86
+ : children }));
87
+ });
88
+ Raw.displayName = 'Services.Raw';
89
+ export const Error = React.forwardRef((props, ref) => {
90
+ const { asChild, children, className, ...otherProps } = props;
91
+ return (_jsx(CoreServiceListError, { children: ({ error }) => {
92
+ if (!error) {
93
+ return null;
94
+ }
95
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceError, "data-error": error, customElement: children, customElementProps: {
96
+ error,
97
+ }, content: error, ...otherProps, children: _jsx("div", { className: "text-status-error text-sm sm:text-base", children: error }) }));
98
+ } }));
99
+ });
100
+ Error.displayName = 'Services.Error';
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { Sort as SortPrimitive } from '@wix/headless-components/react';
3
+ export interface ServiceListSortProps {
4
+ children: (props: {
5
+ currentSort: {
6
+ fieldName: string;
7
+ order: 'ASC' | 'DESC';
8
+ }[];
9
+ sortOptions: SortPrimitive.SortOption[];
10
+ setSort: (sort: {
11
+ fieldName: string;
12
+ order: 'ASC' | 'DESC';
13
+ }[]) => void;
14
+ }) => React.ReactNode;
15
+ }
16
+ export declare const ServiceListSort: (props: ServiceListSortProps) => React.ReactNode;
17
+ export interface ServiceListSeparateSortProps {
18
+ children: (props: {
19
+ currentSort: {
20
+ fieldName: string;
21
+ order: 'ASC' | 'DESC';
22
+ }[];
23
+ sortFieldOptions: Array<{
24
+ fieldName: string;
25
+ label: string;
26
+ }>;
27
+ sortOrderOptions: Array<{
28
+ order: 'ASC' | 'DESC';
29
+ label: string;
30
+ }>;
31
+ setSort: (sort: {
32
+ fieldName: string;
33
+ order: 'ASC' | 'DESC';
34
+ }[]) => void;
35
+ }) => React.ReactNode;
36
+ }
37
+ export declare function ServiceListSeparateSort(props: ServiceListSeparateSortProps): React.ReactNode;
@@ -0,0 +1,35 @@
1
+ import { useService } from '@wix/services-manager-react';
2
+ import { ServicesListServiceDefinition } from '../services/services-list-service.js';
3
+ export const ServiceListSort = (props) => {
4
+ const servicesListService = useService(ServicesListServiceDefinition);
5
+ const currentSort = servicesListService.sort.get();
6
+ // Define sort options
7
+ const sortOptions = [
8
+ { fieldName: 'name', order: 'ASC', label: 'Name (A-Z)' },
9
+ { fieldName: 'name', order: 'DESC', label: 'Name (Z-A)' },
10
+ ];
11
+ return props.children({
12
+ currentSort,
13
+ sortOptions,
14
+ setSort: (sort) => {
15
+ servicesListService.setSort(sort);
16
+ },
17
+ });
18
+ };
19
+ export function ServiceListSeparateSort(props) {
20
+ const servicesListService = useService(ServicesListServiceDefinition);
21
+ const currentSort = servicesListService.sort.get();
22
+ const sortFieldOptions = [{ fieldName: 'name', label: 'Name' }];
23
+ const sortOrderOptions = [
24
+ { order: 'ASC', label: 'Ascending' },
25
+ { order: 'DESC', label: 'Descending' },
26
+ ];
27
+ return props.children({
28
+ currentSort,
29
+ sortFieldOptions,
30
+ sortOrderOptions,
31
+ setSort: (sort) => {
32
+ servicesListService.setSort(sort);
33
+ },
34
+ });
35
+ }
@@ -0,0 +1,91 @@
1
+ import React from 'react';
2
+ import { services } from '@wix/bookings';
3
+ import { type ServiceServiceConfig } from '../../services/service-service.js';
4
+ export interface RootProps {
5
+ children: React.ReactNode;
6
+ serviceConfig: ServiceServiceConfig;
7
+ className?: string;
8
+ }
9
+ export interface ServiceNameProps {
10
+ children: (props: ServiceNameRenderProps) => React.ReactNode;
11
+ }
12
+ export interface ServiceNameRenderProps {
13
+ name: string;
14
+ }
15
+ export interface ServiceDescriptionProps {
16
+ children: (props: ServiceDescriptionRenderProps) => React.ReactNode;
17
+ }
18
+ export interface ServiceDescriptionRenderProps {
19
+ description: string | null;
20
+ }
21
+ export interface ServicePriceProps {
22
+ children: (props: ServicePriceRenderProps) => React.ReactNode;
23
+ }
24
+ export interface ServicePriceRenderProps {
25
+ price: {
26
+ value: number;
27
+ currency: string;
28
+ } | null;
29
+ }
30
+ export interface ServiceImageRenderProps {
31
+ image: string | null;
32
+ alt: string;
33
+ }
34
+ export interface ServiceCategoryProps {
35
+ children: (props: ServiceCategoryRenderProps) => React.ReactNode;
36
+ }
37
+ export interface ServiceCategoryRenderProps {
38
+ category: {
39
+ name: string;
40
+ } | null;
41
+ }
42
+ export interface ServiceLoadingProps {
43
+ children: (props: ServiceLoadingRenderProps) => React.ReactNode;
44
+ }
45
+ export interface ServiceLoadingRenderProps {
46
+ isLoading: boolean;
47
+ }
48
+ export interface ServiceContentProps {
49
+ children: (props: ServiceContentRenderProps) => React.ReactNode;
50
+ }
51
+ export interface ServiceContentRenderProps {
52
+ service: services.Service;
53
+ }
54
+ declare function Content(props: ServiceContentProps): React.ReactNode;
55
+ declare namespace Content {
56
+ var displayName: string;
57
+ }
58
+ declare function Loading(props: ServiceLoadingProps): React.ReactNode;
59
+ declare namespace Loading {
60
+ var displayName: string;
61
+ }
62
+ export declare function Name(props: ServiceNameProps): React.ReactNode;
63
+ export declare namespace Name {
64
+ var displayName: string;
65
+ }
66
+ export declare function Description(props: ServiceDescriptionProps): React.ReactNode;
67
+ export declare namespace Description {
68
+ var displayName: string;
69
+ }
70
+ export declare function Price(props: ServicePriceProps): React.ReactNode;
71
+ export declare namespace Price {
72
+ var displayName: string;
73
+ }
74
+ export declare function Image(): import("react/jsx-runtime").JSX.Element | null;
75
+ export declare namespace Image {
76
+ var displayName: string;
77
+ }
78
+ export declare function Root(props: RootProps): import("react/jsx-runtime").JSX.Element;
79
+ export declare namespace Root {
80
+ var displayName: string;
81
+ }
82
+ export declare const Service: {
83
+ Root: typeof Root;
84
+ Content: typeof Content;
85
+ Loading: typeof Loading;
86
+ Name: typeof Name;
87
+ Description: typeof Description;
88
+ Price: typeof Price;
89
+ Image: typeof Image;
90
+ };
91
+ export {};
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useService, WixServices } from '@wix/services-manager-react';
3
+ import { createServicesMap } from '@wix/services-manager';
4
+ import { ServiceService, ServiceServiceDefinition, } from '../../services/service-service.js';
5
+ import { WixMediaImage } from '@wix/headless-media/react';
6
+ function Content(props) {
7
+ const serviceService = useService(ServiceServiceDefinition);
8
+ const service = serviceService.service.get();
9
+ return props.children({ service });
10
+ }
11
+ function Loading(props) {
12
+ const serviceService = useService(ServiceServiceDefinition);
13
+ const isLoading = serviceService.isLoading.get();
14
+ return props.children({ isLoading });
15
+ }
16
+ export function Name(props) {
17
+ const serviceService = useService(ServiceServiceDefinition);
18
+ const service = serviceService.service.get();
19
+ if (!service)
20
+ return null;
21
+ return props.children({ name: service.name || '' });
22
+ }
23
+ export function Description(props) {
24
+ const serviceService = useService(ServiceServiceDefinition);
25
+ const service = serviceService.service.get();
26
+ if (!service)
27
+ return null;
28
+ return props.children({ description: service.description || null });
29
+ }
30
+ export function Price(props) {
31
+ const serviceService = useService(ServiceServiceDefinition);
32
+ const service = serviceService.service.get();
33
+ if (!service)
34
+ return null;
35
+ const price = service.payment?.fixed?.price
36
+ ? {
37
+ value: Number(service.payment.fixed.price.value),
38
+ currency: service.payment.fixed.price.currency || '',
39
+ }
40
+ : null;
41
+ return props.children({ price });
42
+ }
43
+ export function Image() {
44
+ const serviceService = useService(ServiceServiceDefinition);
45
+ const service = serviceService.service.get();
46
+ if (!service || !service.media?.mainMedia?.image)
47
+ return null;
48
+ //WA until the issue with media will be solved
49
+ const image = service.media?.mainMedia?.image?.replace(/v1\/[\w-]+\//, 'v1/');
50
+ return _jsx(WixMediaImage, { media: { image }, alt: service.name || '' });
51
+ }
52
+ export function Root(props) {
53
+ const { serviceConfig, children } = props;
54
+ const services = createServicesMap().addService(ServiceServiceDefinition, ServiceService, serviceConfig);
55
+ return _jsx(WixServices, { servicesMap: services, children: children });
56
+ }
57
+ // Set display names for components
58
+ Root.displayName = 'Service.Root';
59
+ Content.displayName = 'Service.Content';
60
+ Loading.displayName = 'Service.Loading';
61
+ Name.displayName = 'Service.Name';
62
+ Description.displayName = 'Service.Description';
63
+ Price.displayName = 'Service.Price';
64
+ Image.displayName = 'Service.Image';
65
+ export const Service = {
66
+ Root,
67
+ Content,
68
+ Loading,
69
+ Name,
70
+ Description,
71
+ Price,
72
+ Image,
73
+ };
@@ -0,0 +1,218 @@
1
+ import { type ServicesListServiceConfig } from '../../services/services-list-service.js';
2
+ import { services } from '@wix/bookings';
3
+ /**
4
+ * Props for Root headless component
5
+ */
6
+ export interface RootProps {
7
+ /** Child components that will have access to the ServiceList service */
8
+ children: React.ReactNode;
9
+ /** Configuration for the ServiceList service */
10
+ servicesListConfig: ServicesListServiceConfig;
11
+ }
12
+ /**
13
+ * Root component that provides ServiceList service context to its children.
14
+ * This component sets up the necessary services for managing services list state,
15
+ * including filtering, sorting, and pagination functionality.
16
+ *
17
+ * @order 1
18
+ * @component
19
+ * @example
20
+ * ```tsx
21
+ * import { ServiceList, Service } from '@wix/headless-services/react';
22
+ *
23
+ * function ServiceListPage() {
24
+ * return (
25
+ * <ServiceList.Root
26
+ * servicesListConfig={{
27
+ * services: myServices,
28
+ * searchOptions: {
29
+ * cursorPaging: { limit: 10 },
30
+ * sort: [{ fieldName: 'name', order: 'ASC' }]
31
+ * },
32
+ * pagingMetadata: { count: 10, hasNext: true }
33
+ * }}
34
+ * >
35
+ * <ServiceList.Options>
36
+ * <ServiceList.ServiceRepeater>
37
+ * <Service.Name>
38
+ * {({ name }) => <h3>{name}</h3>}
39
+ * </Service.Name>
40
+ * <Service.Price>
41
+ * {({ price }) => price && <div>{price.value} {price.currency}</div>}
42
+ * </Service.Price>
43
+ * </ServiceList.ServiceRepeater>
44
+ * </ServiceList.Options>
45
+ * </ServiceList.Root>
46
+ * );
47
+ * }
48
+ * ```
49
+ */
50
+ export declare function Root(props: RootProps): React.ReactNode;
51
+ /**
52
+ * Props for EmptyState headless component
53
+ */
54
+ export interface EmptyStateProps {
55
+ /** Content to display when services list is empty (can be a render function or ReactNode) */
56
+ children: ((props: EmptyStateRenderProps) => React.ReactNode) | React.ReactNode;
57
+ }
58
+ /**
59
+ * Render props for EmptyState component
60
+ */
61
+ export interface EmptyStateRenderProps {
62
+ }
63
+ /**
64
+ * Component that renders content when the services list is empty.
65
+ * Only displays its children when there are no services, no loading state, and no errors.
66
+ *
67
+ * @component
68
+ * @example
69
+ * ```tsx
70
+ * import { ServiceList } from '@wix/headless-services/react';
71
+ *
72
+ * function EmptyServicesMessage() {
73
+ * return (
74
+ * <ServiceList.EmptyState>
75
+ * {() => (
76
+ * <div className="empty-state">
77
+ * <h3>No services found</h3>
78
+ * <p>Try adjusting your search or filter criteria</p>
79
+ * <button>Clear Filters</button>
80
+ * </div>
81
+ * )}
82
+ * </ServiceList.EmptyState>
83
+ * );
84
+ * }
85
+ * ```
86
+ */
87
+ export declare function EmptyState(props: EmptyStateProps): React.ReactNode;
88
+ /**
89
+ * Props for Loading headless component
90
+ */
91
+ export interface LoadingProps {
92
+ /** Content to display during loading (can be a render function or ReactNode) */
93
+ children: ((props: LoadingRenderProps) => React.ReactNode) | React.ReactNode;
94
+ }
95
+ /**
96
+ * Render props for Loading component
97
+ */
98
+ export interface LoadingRenderProps {
99
+ }
100
+ /**
101
+ * Component that renders content during loading state.
102
+ * Only displays its children when the services list is currently loading.
103
+ *
104
+ * @component
105
+ * @example
106
+ * ```tsx
107
+ * import { ServiceList } from '@wix/headless-services/react';
108
+ *
109
+ * function ServicesLoading() {
110
+ * return (
111
+ * <ServiceList.Loading>
112
+ * {() => (
113
+ * <div className="loading-spinner">
114
+ * <div>Loading services...</div>
115
+ * <div className="spinner"></div>
116
+ * </div>
117
+ * )}
118
+ * </ServiceList.Loading>
119
+ * );
120
+ * }
121
+ * ```
122
+ */
123
+ export declare function Loading(props: LoadingProps): React.ReactNode;
124
+ /**
125
+ * Props for Error headless component
126
+ */
127
+ export interface ErrorProps {
128
+ /** Content to display during error state (can be a render function or ReactNode) */
129
+ children: ((props: ErrorRenderProps) => React.ReactNode) | React.ReactNode;
130
+ }
131
+ /**
132
+ * Render props for Error component
133
+ */
134
+ export interface ErrorRenderProps {
135
+ /** Error message */
136
+ error: string | null;
137
+ }
138
+ /**
139
+ * Component that renders content when there's an error loading services.
140
+ * Only displays its children when an error has occurred.
141
+ *
142
+ * @component
143
+ * @example
144
+ * ```tsx
145
+ * import { ServiceList } from '@wix/headless-services/react';
146
+ *
147
+ * function ServicesError() {
148
+ * return (
149
+ * <ServiceList.Error>
150
+ * {({ error }) => (
151
+ * <div className="error-state">
152
+ * <h3>Error loading services</h3>
153
+ * <p>{error}</p>
154
+ * <button onClick={() => window.location.reload()}>
155
+ * Try Again
156
+ * </button>
157
+ * </div>
158
+ * )}
159
+ * </ServiceList.Error>
160
+ * );
161
+ * }
162
+ * ```
163
+ */
164
+ export declare function Error(props: ErrorProps): React.ReactNode;
165
+ /**
166
+ * Props for ItemContent headless component
167
+ */
168
+ export interface ItemContentProps {
169
+ /** Content to display for each service (can be a render function receiving service data or ReactNode) */
170
+ children: ((props: ItemContentRenderProps) => React.ReactNode) | React.ReactNode;
171
+ }
172
+ /**
173
+ * Render props for ItemContent component
174
+ */
175
+ export interface ItemContentRenderProps {
176
+ /** Service data */
177
+ service: services.Service;
178
+ }
179
+ /**
180
+ * Component that renders content for each service in the list.
181
+ * Maps over all services and provides each service through a service context.
182
+ * Only renders when services are successfully loaded (not loading, no error, and has services).
183
+ *
184
+ * @component
185
+ * @example
186
+ * ```tsx
187
+ * import { ServiceList, Service } from '@wix/headless-services/react';
188
+ *
189
+ * function ServicesGrid() {
190
+ * return (
191
+ * <ServiceList.ItemContent>
192
+ * {({ service }) => (
193
+ * <div className="service-card">
194
+ * <Service.Image>
195
+ * {({ image, alt }) => <img src={image} alt={alt} />}
196
+ * </Service.Image>
197
+ * <Service.Name>
198
+ * {({ name }) => <h3>{name}</h3>}
199
+ * </Service.Name>
200
+ * <Service.Price>
201
+ * {({ price }) => price && <p>{price.value} {price.currency}</p>}
202
+ * </Service.Price>
203
+ * <button>Book Now</button>
204
+ * </div>
205
+ * )}
206
+ * </ServiceList.ItemContent>
207
+ * );
208
+ * }
209
+ * ```
210
+ */
211
+ export declare function ItemContent(props: ItemContentProps): React.ReactNode;
212
+ export type ItemsProps = {
213
+ children: ((props: ItemsRenderProps) => React.ReactNode) | React.ReactNode;
214
+ };
215
+ export type ItemsRenderProps = {
216
+ services: services.Service[];
217
+ };
218
+ export declare function Items(props: ItemsProps): import("react").ReactNode;