@wix/headless-bookings 0.0.92 → 0.0.94
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.
- package/cjs/dist/__mocks__/services.d.ts +0 -4
- package/cjs/dist/__mocks__/services.js +1 -4
- package/cjs/dist/api/fetch-availability/index.js +3 -3
- package/cjs/dist/api/query-services/index.js +1 -4
- package/cjs/dist/react/booking/Book.d.ts +4 -1
- package/cjs/dist/react/booking/Book.js +12 -10
- package/cjs/dist/react/booking/Booking.d.ts +10 -0
- package/cjs/dist/react/booking/Booking.js +10 -11
- package/cjs/dist/react/booking/BookingItem.d.ts +6 -2
- package/cjs/dist/react/booking/BookingItem.js +7 -8
- package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -0
- package/cjs/dist/react/booking-form/BookingForm.js +8 -9
- package/cjs/dist/react/core/staff-member/StaffMember.js +1 -2
- package/cjs/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
- package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
- package/cjs/dist/react/location/Location.d.ts +12 -4
- package/cjs/dist/react/location/Location.js +24 -25
- package/cjs/dist/react/location/LocationList.d.ts +8 -2
- package/cjs/dist/react/location/LocationList.js +12 -12
- package/cjs/dist/react/payment/Payment.d.ts +22 -16
- package/cjs/dist/react/payment/Payment.js +28 -29
- package/cjs/dist/react/service/Service.d.ts +41 -16
- package/cjs/dist/react/service/Service.js +62 -63
- package/cjs/dist/react/service/ServiceMedia.d.ts +4 -0
- package/cjs/dist/react/service/ServiceMedia.js +4 -5
- package/cjs/dist/react/service-list/ServiceList.d.ts +7 -0
- package/cjs/dist/react/service-list/ServiceList.js +7 -8
- package/cjs/dist/react/staff-member/StaffMember.d.ts +7 -8
- package/cjs/dist/react/staff-member/StaffMember.js +11 -12
- package/cjs/dist/react/staff-member/StaffMemberList.d.ts +9 -8
- package/cjs/dist/react/staff-member/StaffMemberList.js +14 -24
- package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +16 -20
- package/cjs/dist/react/time-slot-list/TimeSlot.js +31 -32
- package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +10 -12
- package/cjs/dist/react/time-slot-list/TimeSlotList.js +18 -18
- package/cjs/dist/services/booking/book-action/buildBookingRequest.js +1 -2
- package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
- package/cjs/dist/services/constants.d.ts +9 -0
- package/cjs/dist/services/constants.js +9 -0
- package/cjs/dist/services/payment/payment.js +2 -5
- package/cjs/dist/services/service/service.js +1 -1
- package/cjs/dist/services/service-list/service-list.js +1 -4
- package/dist/__mocks__/services.d.ts +0 -4
- package/dist/__mocks__/services.js +1 -4
- package/dist/api/fetch-availability/index.js +3 -3
- package/dist/api/query-services/index.js +1 -4
- package/dist/react/booking/Book.d.ts +4 -1
- package/dist/react/booking/Book.js +12 -10
- package/dist/react/booking/Booking.d.ts +10 -0
- package/dist/react/booking/Booking.js +10 -11
- package/dist/react/booking/BookingItem.d.ts +6 -2
- package/dist/react/booking/BookingItem.js +7 -8
- package/dist/react/booking-form/BookingForm.d.ts +5 -0
- package/dist/react/booking-form/BookingForm.js +8 -9
- package/dist/react/core/staff-member/StaffMember.js +1 -2
- package/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
- package/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
- package/dist/react/location/Location.d.ts +12 -4
- package/dist/react/location/Location.js +24 -25
- package/dist/react/location/LocationList.d.ts +8 -2
- package/dist/react/location/LocationList.js +12 -12
- package/dist/react/payment/Payment.d.ts +22 -16
- package/dist/react/payment/Payment.js +28 -29
- package/dist/react/service/Service.d.ts +41 -16
- package/dist/react/service/Service.js +62 -63
- package/dist/react/service/ServiceMedia.d.ts +4 -0
- package/dist/react/service/ServiceMedia.js +4 -5
- package/dist/react/service-list/ServiceList.d.ts +7 -0
- package/dist/react/service-list/ServiceList.js +7 -8
- package/dist/react/staff-member/StaffMember.d.ts +7 -8
- package/dist/react/staff-member/StaffMember.js +11 -12
- package/dist/react/staff-member/StaffMemberList.d.ts +9 -8
- package/dist/react/staff-member/StaffMemberList.js +14 -24
- package/dist/react/time-slot-list/TimeSlot.d.ts +16 -20
- package/dist/react/time-slot-list/TimeSlot.js +31 -32
- package/dist/react/time-slot-list/TimeSlotList.d.ts +10 -12
- package/dist/react/time-slot-list/TimeSlotList.js +18 -18
- package/dist/services/booking/book-action/buildBookingRequest.js +1 -2
- package/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
- package/dist/services/constants.d.ts +9 -0
- package/dist/services/constants.js +9 -0
- package/dist/services/payment/payment.js +2 -5
- package/dist/services/service/service.js +1 -1
- package/dist/services/service-list/service-list.js +1 -4
- package/package.json +2 -2
|
@@ -7,6 +7,39 @@ import { AsChildChildren } from '@wix/headless-utils/react';
|
|
|
7
7
|
import { MoneyData } from '@wix/headless-components/react';
|
|
8
8
|
import { type Service, type Payment } from '@wix/auto_sdk_bookings_services';
|
|
9
9
|
import * as ServiceMediaModule from './ServiceMedia.js';
|
|
10
|
+
export declare const TestIds: {
|
|
11
|
+
readonly serviceRoot: "service-root";
|
|
12
|
+
readonly serviceName: "service-name";
|
|
13
|
+
readonly serviceDescription: "service-description";
|
|
14
|
+
readonly servicePrice: "service-price";
|
|
15
|
+
readonly serviceTagline: "service-tagline";
|
|
16
|
+
readonly serviceDurationInMinutes: "service-duration-in-minutes";
|
|
17
|
+
readonly serviceType: "service-type";
|
|
18
|
+
readonly serviceCategory: "service-category";
|
|
19
|
+
readonly serviceLocations: "service-locations";
|
|
20
|
+
readonly serviceLocation: "service-location";
|
|
21
|
+
readonly serviceLocationRepeater: "service-location-repeater";
|
|
22
|
+
readonly locationRoot: "location-root";
|
|
23
|
+
readonly serviceStaffMembers: "service-staff-members";
|
|
24
|
+
readonly serviceStaffMemberRepeater: "service-staff-member-repeater";
|
|
25
|
+
readonly serviceSchedule: "service-schedule";
|
|
26
|
+
readonly serviceDefaultCapacity: "service-default-capacity";
|
|
27
|
+
readonly serviceRaw: "service-raw";
|
|
28
|
+
readonly serviceActionSelect: "service-action-select";
|
|
29
|
+
readonly serviceActionAdd: "service-action-add";
|
|
30
|
+
readonly serviceActionRemove: "service-action-remove";
|
|
31
|
+
readonly servicePolicyLatestCancellationInMinutes: "service-policy-latest-cancellation-in-minutes";
|
|
32
|
+
readonly servicePolicyLatestBookingInMinutes: "service-policy-latest-booking-in-minutes";
|
|
33
|
+
readonly servicePolicyEarliestBookingInMinutes: "service-policy-earliest-booking-in-minutes";
|
|
34
|
+
readonly servicePolicyLatestRescheduleInMinutes: "service-policy-latest-reschedule-in-minutes";
|
|
35
|
+
readonly servicePolicyWaitlistCapacity: "service-policy-waitlist-capacity";
|
|
36
|
+
readonly servicePolicyBookAfterStartEnabled: "service-policy-book-after-start-enabled";
|
|
37
|
+
readonly servicePolicyMaxParticipantsPerBooking: "service-policy-max-participants-per-booking";
|
|
38
|
+
readonly serviceScheduleFirstSessionStart: "service-schedule-first-session-start";
|
|
39
|
+
readonly serviceScheduleLastSessionEnd: "service-schedule-last-session-end";
|
|
40
|
+
readonly serviceScheduleSessionDuration: "service-schedule-session-duration";
|
|
41
|
+
readonly serviceAvailableOnline: "service-available-online";
|
|
42
|
+
};
|
|
10
43
|
/**
|
|
11
44
|
* Base props shared by all Service.Root variants
|
|
12
45
|
*/
|
|
@@ -122,12 +155,11 @@ export declare const Root: React.ForwardRefExoticComponent<ServiceRootProps & Re
|
|
|
122
155
|
/**
|
|
123
156
|
* Props for Service Name component
|
|
124
157
|
*/
|
|
125
|
-
export interface NameProps {
|
|
158
|
+
export interface NameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
126
159
|
asChild?: boolean;
|
|
127
160
|
children?: AsChildChildren<{
|
|
128
161
|
name: string;
|
|
129
162
|
}>;
|
|
130
|
-
className?: string;
|
|
131
163
|
}
|
|
132
164
|
/**
|
|
133
165
|
* Displays the service name with customizable rendering.
|
|
@@ -157,12 +189,11 @@ export declare const Name: React.ForwardRefExoticComponent<NameProps & React.Ref
|
|
|
157
189
|
/**
|
|
158
190
|
* Props for Service Description component
|
|
159
191
|
*/
|
|
160
|
-
export interface DescriptionProps {
|
|
192
|
+
export interface DescriptionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
161
193
|
asChild?: boolean;
|
|
162
194
|
children?: AsChildChildren<{
|
|
163
195
|
description: string;
|
|
164
196
|
}>;
|
|
165
|
-
className?: string;
|
|
166
197
|
}
|
|
167
198
|
/**
|
|
168
199
|
* Displays the service description with customizable rendering.
|
|
@@ -231,12 +262,11 @@ export declare const Price: React.ForwardRefExoticComponent<PriceProps & React.R
|
|
|
231
262
|
/**
|
|
232
263
|
* Props for Service Tagline component
|
|
233
264
|
*/
|
|
234
|
-
export interface TaglineProps {
|
|
265
|
+
export interface TaglineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
235
266
|
asChild?: boolean;
|
|
236
267
|
children?: AsChildChildren<{
|
|
237
268
|
tagline: string;
|
|
238
269
|
}>;
|
|
239
|
-
className?: string;
|
|
240
270
|
}
|
|
241
271
|
/**
|
|
242
272
|
* Displays the service tagline with customizable rendering.
|
|
@@ -272,12 +302,11 @@ export declare const Tagline: React.ForwardRefExoticComponent<TaglineProps & Rea
|
|
|
272
302
|
/**
|
|
273
303
|
* Props for Service DurationInMinutes component
|
|
274
304
|
*/
|
|
275
|
-
export interface DurationInMinutesProps {
|
|
305
|
+
export interface DurationInMinutesProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
276
306
|
asChild?: boolean;
|
|
277
307
|
children?: AsChildChildren<{
|
|
278
308
|
duration: number;
|
|
279
309
|
}>;
|
|
280
|
-
className?: string;
|
|
281
310
|
}
|
|
282
311
|
/**
|
|
283
312
|
* Displays the service duration in minutes (raw number) with customizable rendering.
|
|
@@ -314,12 +343,11 @@ export declare const DurationInMinutes: React.ForwardRefExoticComponent<Duration
|
|
|
314
343
|
/**
|
|
315
344
|
* Props for Service Type component
|
|
316
345
|
*/
|
|
317
|
-
export interface TypeProps {
|
|
346
|
+
export interface TypeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
318
347
|
asChild?: boolean;
|
|
319
348
|
children?: AsChildChildren<{
|
|
320
349
|
type: string;
|
|
321
350
|
}>;
|
|
322
|
-
className?: string;
|
|
323
351
|
}
|
|
324
352
|
/**
|
|
325
353
|
* Displays the service type (APPOINTMENT, CLASS, COURSE, etc.) with customizable rendering.
|
|
@@ -358,7 +386,7 @@ export declare const Type: React.ForwardRefExoticComponent<TypeProps & React.Ref
|
|
|
358
386
|
/**
|
|
359
387
|
* Props for Service Category component
|
|
360
388
|
*/
|
|
361
|
-
export interface CategoryProps {
|
|
389
|
+
export interface CategoryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
362
390
|
asChild?: boolean;
|
|
363
391
|
children?: AsChildChildren<{
|
|
364
392
|
category: {
|
|
@@ -366,7 +394,6 @@ export interface CategoryProps {
|
|
|
366
394
|
_id?: string;
|
|
367
395
|
};
|
|
368
396
|
}>;
|
|
369
|
-
className?: string;
|
|
370
397
|
}
|
|
371
398
|
/**
|
|
372
399
|
* Displays the service category with customizable rendering.
|
|
@@ -1091,13 +1118,12 @@ export declare namespace Schedule {
|
|
|
1091
1118
|
/**
|
|
1092
1119
|
* Props for Service DefaultCapacity component
|
|
1093
1120
|
*/
|
|
1094
|
-
export interface DefaultCapacityProps {
|
|
1121
|
+
export interface DefaultCapacityProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1095
1122
|
asChild?: boolean;
|
|
1096
1123
|
children?: AsChildChildren<{
|
|
1097
1124
|
defaultCapacity: number;
|
|
1098
1125
|
isClassOrCourse: boolean;
|
|
1099
1126
|
}>;
|
|
1100
|
-
className?: string;
|
|
1101
1127
|
}
|
|
1102
1128
|
/**
|
|
1103
1129
|
* Displays the service default capacity with customizable rendering.
|
|
@@ -1121,12 +1147,11 @@ export declare const DefaultCapacity: React.ForwardRefExoticComponent<DefaultCap
|
|
|
1121
1147
|
/**
|
|
1122
1148
|
* Props for Service AvailableOnline component
|
|
1123
1149
|
*/
|
|
1124
|
-
export interface AvailableOnlineProps {
|
|
1150
|
+
export interface AvailableOnlineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1125
1151
|
asChild?: boolean;
|
|
1126
1152
|
children?: AsChildChildren<{
|
|
1127
1153
|
availableOnline: boolean;
|
|
1128
1154
|
}>;
|
|
1129
|
-
className?: string;
|
|
1130
1155
|
label?: string;
|
|
1131
1156
|
}
|
|
1132
1157
|
/**
|
|
@@ -17,43 +17,42 @@ import * as StaffMemberListModule from '../staff-member/StaffMemberList.js';
|
|
|
17
17
|
// Note: StaffMember components are used inside StaffMemberList.StaffMemberRepeater
|
|
18
18
|
// Users should import { StaffMember } from '@wix/headless-bookings/react' for StaffMember.Name, etc.
|
|
19
19
|
import * as ServiceMediaModule from './ServiceMedia.js';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
TestIds["serviceActionRemove"] = "service-action-remove";
|
|
20
|
+
export const TestIds = {
|
|
21
|
+
serviceRoot: 'service-root',
|
|
22
|
+
serviceName: 'service-name',
|
|
23
|
+
serviceDescription: 'service-description',
|
|
24
|
+
servicePrice: 'service-price',
|
|
25
|
+
serviceTagline: 'service-tagline',
|
|
26
|
+
serviceDurationInMinutes: 'service-duration-in-minutes',
|
|
27
|
+
serviceType: 'service-type',
|
|
28
|
+
serviceCategory: 'service-category',
|
|
29
|
+
serviceLocations: 'service-locations',
|
|
30
|
+
serviceLocation: 'service-location',
|
|
31
|
+
serviceLocationRepeater: 'service-location-repeater',
|
|
32
|
+
locationRoot: 'location-root',
|
|
33
|
+
serviceStaffMembers: 'service-staff-members',
|
|
34
|
+
serviceStaffMemberRepeater: 'service-staff-member-repeater',
|
|
35
|
+
serviceSchedule: 'service-schedule',
|
|
36
|
+
serviceDefaultCapacity: 'service-default-capacity',
|
|
37
|
+
serviceRaw: 'service-raw',
|
|
38
|
+
serviceActionSelect: 'service-action-select',
|
|
39
|
+
serviceActionAdd: 'service-action-add',
|
|
40
|
+
serviceActionRemove: 'service-action-remove',
|
|
42
41
|
// Policy component TestIds
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
servicePolicyLatestCancellationInMinutes: 'service-policy-latest-cancellation-in-minutes',
|
|
43
|
+
servicePolicyLatestBookingInMinutes: 'service-policy-latest-booking-in-minutes',
|
|
44
|
+
servicePolicyEarliestBookingInMinutes: 'service-policy-earliest-booking-in-minutes',
|
|
45
|
+
servicePolicyLatestRescheduleInMinutes: 'service-policy-latest-reschedule-in-minutes',
|
|
46
|
+
servicePolicyWaitlistCapacity: 'service-policy-waitlist-capacity',
|
|
47
|
+
servicePolicyBookAfterStartEnabled: 'service-policy-book-after-start-enabled',
|
|
48
|
+
servicePolicyMaxParticipantsPerBooking: 'service-policy-max-participants-per-booking',
|
|
50
49
|
// Schedule component TestIds
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
serviceScheduleFirstSessionStart: 'service-schedule-first-session-start',
|
|
51
|
+
serviceScheduleLastSessionEnd: 'service-schedule-last-session-end',
|
|
52
|
+
serviceScheduleSessionDuration: 'service-schedule-session-duration',
|
|
54
53
|
// Conferencing component TestIds
|
|
55
|
-
|
|
56
|
-
}
|
|
54
|
+
serviceAvailableOnline: 'service-available-online',
|
|
55
|
+
};
|
|
57
56
|
/**
|
|
58
57
|
* Root component that provides service context to the entire app.
|
|
59
58
|
* Can be used with:
|
|
@@ -148,8 +147,8 @@ Root.displayName = 'Service.Root';
|
|
|
148
147
|
* ```
|
|
149
148
|
*/
|
|
150
149
|
export const Name = React.forwardRef((props, ref) => {
|
|
151
|
-
const { asChild, children,
|
|
152
|
-
return (_jsx(CoreService.Info, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
150
|
+
const { asChild, children, ...rest } = props;
|
|
151
|
+
return (_jsx(CoreService.Info, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceName, customElement: children, customElementProps: { name }, children: _jsx("span", { children: name }) })) }));
|
|
153
152
|
});
|
|
154
153
|
Name.displayName = 'Service.Name';
|
|
155
154
|
/**
|
|
@@ -168,8 +167,8 @@ Name.displayName = 'Service.Name';
|
|
|
168
167
|
* ```
|
|
169
168
|
*/
|
|
170
169
|
export const Description = React.forwardRef((props, ref) => {
|
|
171
|
-
const { asChild, children,
|
|
172
|
-
return (_jsx(CoreService.Info, { children: ({ description }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
170
|
+
const { asChild, children, ...rest } = props;
|
|
171
|
+
return (_jsx(CoreService.Info, { children: ({ description }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceDescription, customElement: children, customElementProps: { description }, children: _jsx("div", { children: description }) })) }));
|
|
173
172
|
});
|
|
174
173
|
Description.displayName = 'Service.Description';
|
|
175
174
|
/**
|
|
@@ -261,8 +260,8 @@ Price.displayName = 'Service.Price';
|
|
|
261
260
|
* ```
|
|
262
261
|
*/
|
|
263
262
|
export const Tagline = React.forwardRef((props, ref) => {
|
|
264
|
-
const { asChild, children,
|
|
265
|
-
return (_jsx(CoreService.Info, { children: ({ tagline }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
263
|
+
const { asChild, children, ...rest } = props;
|
|
264
|
+
return (_jsx(CoreService.Info, { children: ({ tagline }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceTagline, customElement: children, customElementProps: { tagline }, children: tagline ? _jsx("p", { children: tagline }) : null })) }));
|
|
266
265
|
});
|
|
267
266
|
Tagline.displayName = 'Service.Tagline';
|
|
268
267
|
/**
|
|
@@ -297,9 +296,9 @@ Tagline.displayName = 'Service.Tagline';
|
|
|
297
296
|
* ```
|
|
298
297
|
*/
|
|
299
298
|
export const DurationInMinutes = React.forwardRef((props, ref) => {
|
|
300
|
-
const { asChild, children,
|
|
299
|
+
const { asChild, children, ...rest } = props;
|
|
301
300
|
return (_jsx(CoreService.Info, { children: ({ duration }) => {
|
|
302
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
301
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceDurationInMinutes, customElement: children, customElementProps: { duration }, children: duration ? _jsx("span", { children: duration }) : null }));
|
|
303
302
|
} }));
|
|
304
303
|
});
|
|
305
304
|
DurationInMinutes.displayName = 'Service.DurationInMinutes';
|
|
@@ -337,8 +336,8 @@ DurationInMinutes.displayName = 'Service.DurationInMinutes';
|
|
|
337
336
|
* ```
|
|
338
337
|
*/
|
|
339
338
|
export const Type = React.forwardRef((props, ref) => {
|
|
340
|
-
const { asChild, children,
|
|
341
|
-
return (_jsx(CoreService.Info, { children: ({ type }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
339
|
+
const { asChild, children, ...rest } = props;
|
|
340
|
+
return (_jsx(CoreService.Info, { children: ({ type }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceType, customElement: children, customElementProps: { type }, children: type ? _jsx("span", { children: type }) : null })) }));
|
|
342
341
|
});
|
|
343
342
|
Type.displayName = 'Service.Type';
|
|
344
343
|
/**
|
|
@@ -377,8 +376,8 @@ Type.displayName = 'Service.Type';
|
|
|
377
376
|
* ```
|
|
378
377
|
*/
|
|
379
378
|
export const Category = React.forwardRef((props, ref) => {
|
|
380
|
-
const { asChild, children,
|
|
381
|
-
return (_jsx(CoreService.Info, { children: ({ category }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
379
|
+
const { asChild, children, ...rest } = props;
|
|
380
|
+
return (_jsx(CoreService.Info, { children: ({ category }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceCategory, customElement: children, customElementProps: { category }, children: category?.name ? _jsx("span", { children: category.name }) : null })) }));
|
|
382
381
|
});
|
|
383
382
|
Category.displayName = 'Service.Category';
|
|
384
383
|
/**
|
|
@@ -413,13 +412,13 @@ Category.displayName = 'Service.Category';
|
|
|
413
412
|
* ```
|
|
414
413
|
*/
|
|
415
414
|
const LocationsBase = React.forwardRef((props, ref) => {
|
|
416
|
-
const { asChild, children, className, ...
|
|
415
|
+
const { asChild, children, className, ...rest } = props;
|
|
417
416
|
return (_jsx(CoreService.Info, { children: ({ locations }) => {
|
|
418
417
|
// Container level: don't render if no locations
|
|
419
418
|
if (!locations || locations.length === 0) {
|
|
420
419
|
return null;
|
|
421
420
|
}
|
|
422
|
-
return (_jsx(LocationList.Root, { locationListConfig: { locations }, className: className, ref: ref, children: _jsx(AsChildSlot, { ...
|
|
421
|
+
return (_jsx(LocationList.Root, { locationListConfig: { locations }, className: className, ref: ref, children: _jsx(AsChildSlot, { ...rest, asChild: asChild, className: className, "data-testid": TestIds.serviceLocations, customElement: children, children: _jsx("div", { children: children }) }) }));
|
|
423
422
|
} }));
|
|
424
423
|
});
|
|
425
424
|
LocationsBase.displayName = 'Service.Locations';
|
|
@@ -501,13 +500,13 @@ LocationRepeater.displayName = 'Service.Locations.LocationRepeater';
|
|
|
501
500
|
* ```
|
|
502
501
|
*/
|
|
503
502
|
const StaffMembersBase = React.forwardRef((props, ref) => {
|
|
504
|
-
const { asChild, children, className, ...
|
|
503
|
+
const { asChild, children, className, ...rest } = props;
|
|
505
504
|
return (_jsx(CoreService.Info, { children: ({ staff }) => {
|
|
506
505
|
// Container level: don't render if no staff members
|
|
507
506
|
if (!staff || staff.length === 0) {
|
|
508
507
|
return null;
|
|
509
508
|
}
|
|
510
|
-
return (_jsx(StaffMemberListModule.Root, { staffMemberListConfig: { staffMembers: staff }, className: className, ref: ref, children: _jsx(AsChildSlot, { ...
|
|
509
|
+
return (_jsx(StaffMemberListModule.Root, { staffMemberListConfig: { staffMembers: staff }, className: className, ref: ref, children: _jsx(AsChildSlot, { ...rest, asChild: asChild, className: className, "data-testid": TestIds.serviceStaffMembers, customElement: children, children: _jsx("div", { children: children }) }) }));
|
|
511
510
|
} }));
|
|
512
511
|
});
|
|
513
512
|
StaffMembersBase.displayName = 'Service.StaffMembers';
|
|
@@ -618,20 +617,20 @@ export var Actions;
|
|
|
618
617
|
* ```
|
|
619
618
|
*/
|
|
620
619
|
Actions.Select = React.forwardRef((props, ref) => {
|
|
621
|
-
const { asChild, children, className, label, onClick, ...
|
|
620
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
622
621
|
return (_jsx(CoreService.Actions, { children: ({ select, rawService, bookable, selected, requiresAvailability, }) => {
|
|
623
622
|
const handleClick = () => {
|
|
624
623
|
select();
|
|
625
624
|
onClick?.(rawService);
|
|
626
625
|
};
|
|
627
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceActionSelect, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
626
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: !bookable, "data-testid": TestIds.serviceActionSelect, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
628
627
|
onClick: handleClick,
|
|
629
628
|
disabled: !bookable,
|
|
630
629
|
selected,
|
|
631
630
|
bookable,
|
|
632
631
|
requiresAvailability,
|
|
633
632
|
service: rawService,
|
|
634
|
-
}, children: _jsx("button", {
|
|
633
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
635
634
|
} }));
|
|
636
635
|
});
|
|
637
636
|
Actions.Select.displayName = 'Service.Actions.Select';
|
|
@@ -665,7 +664,7 @@ export var Actions;
|
|
|
665
664
|
* ```
|
|
666
665
|
*/
|
|
667
666
|
Actions.Add = React.forwardRef((props, ref) => {
|
|
668
|
-
const { asChild, children, className, label, onClick, ...
|
|
667
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
669
668
|
return (_jsx(CoreService.Actions, { children: ({ add, rawService, bookable, selected, requiresAvailability }) => {
|
|
670
669
|
// Disabled when already selected (can't add again) or not bookable
|
|
671
670
|
const isDisabled = selected || !bookable;
|
|
@@ -673,14 +672,14 @@ export var Actions;
|
|
|
673
672
|
add();
|
|
674
673
|
onClick?.(rawService);
|
|
675
674
|
};
|
|
676
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceActionAdd, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
675
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: isDisabled, "data-testid": TestIds.serviceActionAdd, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
677
676
|
onClick: handleClick,
|
|
678
677
|
disabled: isDisabled,
|
|
679
678
|
selected,
|
|
680
679
|
bookable,
|
|
681
680
|
requiresAvailability,
|
|
682
681
|
service: rawService,
|
|
683
|
-
}, children: _jsx("button", {
|
|
682
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
684
683
|
} }));
|
|
685
684
|
});
|
|
686
685
|
Actions.Add.displayName = 'Service.Actions.Add';
|
|
@@ -714,7 +713,7 @@ export var Actions;
|
|
|
714
713
|
* ```
|
|
715
714
|
*/
|
|
716
715
|
Actions.Remove = React.forwardRef((props, ref) => {
|
|
717
|
-
const { asChild, children, className, label, onClick, ...
|
|
716
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
718
717
|
return (_jsx(CoreService.Actions, { children: ({ remove, rawService, bookable, selected, requiresAvailability, }) => {
|
|
719
718
|
// Disabled when not selected (nothing to remove) or not bookable
|
|
720
719
|
const isDisabled = !selected || !bookable;
|
|
@@ -722,14 +721,14 @@ export var Actions;
|
|
|
722
721
|
remove();
|
|
723
722
|
onClick?.(rawService);
|
|
724
723
|
};
|
|
725
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceActionRemove, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
724
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: isDisabled, "data-testid": TestIds.serviceActionRemove, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
726
725
|
onClick: handleClick,
|
|
727
726
|
disabled: isDisabled,
|
|
728
727
|
selected,
|
|
729
728
|
bookable,
|
|
730
729
|
requiresAvailability,
|
|
731
730
|
service: rawService,
|
|
732
|
-
}, children: _jsx("button", {
|
|
731
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
733
732
|
} }));
|
|
734
733
|
});
|
|
735
734
|
Actions.Remove.displayName = 'Service.Actions.Remove';
|
|
@@ -1067,10 +1066,10 @@ export var Schedule;
|
|
|
1067
1066
|
* ```
|
|
1068
1067
|
*/
|
|
1069
1068
|
export const DefaultCapacity = React.forwardRef((props, ref) => {
|
|
1070
|
-
const { asChild, children,
|
|
1069
|
+
const { asChild, children, ...rest } = props;
|
|
1071
1070
|
return (_jsx(CoreService.Info, { children: ({ type, defaultCapacity }) => {
|
|
1072
1071
|
const isClassOrCourse = type === 'CLASS' || type === 'COURSE';
|
|
1073
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
1072
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceDefaultCapacity, customElement: children, customElementProps: { defaultCapacity, isClassOrCourse }, children: isClassOrCourse && defaultCapacity ? (_jsxs("span", { children: ["Max ", defaultCapacity, " participants"] })) : null }));
|
|
1074
1073
|
} }));
|
|
1075
1074
|
});
|
|
1076
1075
|
DefaultCapacity.displayName = 'Service.DefaultCapacity';
|
|
@@ -1098,10 +1097,10 @@ DefaultCapacity.displayName = 'Service.DefaultCapacity';
|
|
|
1098
1097
|
* ```
|
|
1099
1098
|
*/
|
|
1100
1099
|
export const AvailableOnline = React.forwardRef((props, ref) => {
|
|
1101
|
-
const { asChild, children,
|
|
1100
|
+
const { asChild, children, label, ...rest } = props;
|
|
1102
1101
|
return (_jsx(CoreService.Service, { children: ({ service }) => {
|
|
1103
1102
|
const availableOnline = service.conferencing?.enabled ?? false;
|
|
1104
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
1103
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceAvailableOnline, customElement: children, customElementProps: { availableOnline }, children: availableOnline && label ? _jsx("span", { children: label }) : null }));
|
|
1105
1104
|
} }));
|
|
1106
1105
|
});
|
|
1107
1106
|
AvailableOnline.displayName = 'Service.AvailableOnline';
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { AsChildChildren } from '@wix/headless-utils/react';
|
|
7
|
+
export declare const TestIds: {
|
|
8
|
+
readonly serviceMediaMain: "service-media-main";
|
|
9
|
+
readonly serviceMediaCover: "service-media-cover";
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* Props for ServiceMedia.Main component
|
|
9
13
|
*/
|
|
@@ -8,11 +8,10 @@ import { AsChildSlot } from '@wix/headless-utils/react';
|
|
|
8
8
|
import { WixMediaImage } from '@wix/headless-media/react';
|
|
9
9
|
import * as CoreServiceMediaMain from '../core/service/ServiceMediaMain.js';
|
|
10
10
|
import * as CoreServiceMediaCover from '../core/service/ServiceMediaCover.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})(TestIds || (TestIds = {}));
|
|
11
|
+
export const TestIds = {
|
|
12
|
+
serviceMediaMain: 'service-media-main',
|
|
13
|
+
serviceMediaCover: 'service-media-cover',
|
|
14
|
+
};
|
|
16
15
|
/**
|
|
17
16
|
* Displays the service main media image using WixMediaImage.
|
|
18
17
|
*
|
|
@@ -7,6 +7,13 @@ import { ListVariant, GenericListLoadMoreRenderProps, type FilterRootProps } fro
|
|
|
7
7
|
import { AsChildChildren } from '@wix/headless-utils/react';
|
|
8
8
|
import type { ServiceListServiceConfig } from '../../services/service-list/service-list.js';
|
|
9
9
|
import type { Service as ServiceType } from '@wix/auto_sdk_bookings_services';
|
|
10
|
+
export declare const TestIds: {
|
|
11
|
+
readonly serviceListRoot: "service-list-root";
|
|
12
|
+
readonly serviceListServices: "service-list-services";
|
|
13
|
+
readonly serviceListService: "service-list-service";
|
|
14
|
+
readonly serviceListLoadMore: "service-list-load-more";
|
|
15
|
+
readonly serviceListFilter: "service-list-filter";
|
|
16
|
+
};
|
|
10
17
|
/**
|
|
11
18
|
* Props for the ServiceList root component
|
|
12
19
|
*/
|
|
@@ -10,14 +10,13 @@ import { ServiceListServiceDefinition } from '../../services/service-list/servic
|
|
|
10
10
|
import * as CoreServiceList from '../core/service-list/ServiceList.js';
|
|
11
11
|
import * as CoreServiceListFilter from '../core/service-list/ServiceListFilter.js';
|
|
12
12
|
import * as Service from '../service/Service.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})(TestIds || (TestIds = {}));
|
|
13
|
+
export const TestIds = {
|
|
14
|
+
serviceListRoot: 'service-list-root',
|
|
15
|
+
serviceListServices: 'service-list-services',
|
|
16
|
+
serviceListService: 'service-list-service',
|
|
17
|
+
serviceListLoadMore: 'service-list-load-more',
|
|
18
|
+
serviceListFilter: 'service-list-filter',
|
|
19
|
+
};
|
|
21
20
|
/**
|
|
22
21
|
* Root component that provides the ServiceList service context for rendering services lists.
|
|
23
22
|
*
|
|
@@ -8,12 +8,12 @@ import React from 'react';
|
|
|
8
8
|
import * as CoreStaffMember from '../core/staff-member/StaffMember.js';
|
|
9
9
|
import { type AsChildChildren } from '@wix/headless-utils/react';
|
|
10
10
|
export { useStaffMemberContext } from '../core/staff-member/StaffMember.js';
|
|
11
|
-
export declare
|
|
12
|
-
staffMemberRoot
|
|
13
|
-
staffMemberName
|
|
14
|
-
staffMemberRaw
|
|
15
|
-
staffMemberActionSelect
|
|
16
|
-
}
|
|
11
|
+
export declare const TestIds: {
|
|
12
|
+
readonly staffMemberRoot: "staff-member-root";
|
|
13
|
+
readonly staffMemberName: "staff-member-name";
|
|
14
|
+
readonly staffMemberRaw: "staff-member-raw";
|
|
15
|
+
readonly staffMemberActionSelect: "staff-member-action-select";
|
|
16
|
+
};
|
|
17
17
|
export type { StaffMemberData, StaffMemberRenderProps, } from '../core/staff-member/StaffMember.js';
|
|
18
18
|
/**
|
|
19
19
|
* Props for StaffMember.Root component
|
|
@@ -58,12 +58,11 @@ export declare const Root: React.ForwardRefExoticComponent<RootProps & React.Ref
|
|
|
58
58
|
/**
|
|
59
59
|
* Props for StaffMember.Name component
|
|
60
60
|
*/
|
|
61
|
-
export interface NameProps {
|
|
61
|
+
export interface NameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
62
62
|
asChild?: boolean;
|
|
63
63
|
children?: React.ReactNode | AsChildChildren<{
|
|
64
64
|
name: string | undefined;
|
|
65
65
|
}>;
|
|
66
|
-
className?: string;
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
69
68
|
* Displays the staff member name.
|
|
@@ -13,13 +13,12 @@ export { useStaffMemberContext } from '../core/staff-member/StaffMember.js';
|
|
|
13
13
|
// ==========================================
|
|
14
14
|
// TestIds Enum
|
|
15
15
|
// ==========================================
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})(TestIds || (TestIds = {}));
|
|
16
|
+
export const TestIds = {
|
|
17
|
+
staffMemberRoot: 'staff-member-root',
|
|
18
|
+
staffMemberName: 'staff-member-name',
|
|
19
|
+
staffMemberRaw: 'staff-member-raw',
|
|
20
|
+
staffMemberActionSelect: 'staff-member-action-select',
|
|
21
|
+
};
|
|
23
22
|
// ==========================================
|
|
24
23
|
// Type Definitions
|
|
25
24
|
// ==========================================
|
|
@@ -74,9 +73,9 @@ Root.displayName = 'StaffMember.Root';
|
|
|
74
73
|
* ```
|
|
75
74
|
*/
|
|
76
75
|
export const Name = React.forwardRef((props, ref) => {
|
|
77
|
-
const { asChild, children,
|
|
76
|
+
const { asChild, children, ...rest } = props;
|
|
78
77
|
const { name } = useStaffMemberContext();
|
|
79
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
78
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.staffMemberName, customElement: children, customElementProps: { name }, children: name ? _jsx("span", { children: name }) : null }));
|
|
80
79
|
});
|
|
81
80
|
Name.displayName = 'StaffMember.Name';
|
|
82
81
|
/**
|
|
@@ -123,7 +122,7 @@ Raw.displayName = 'StaffMember.Raw';
|
|
|
123
122
|
* ```
|
|
124
123
|
*/
|
|
125
124
|
const Select = React.forwardRef((props, ref) => {
|
|
126
|
-
const { asChild, children, onClick, label, className, ...
|
|
125
|
+
const { asChild, children, onClick, label, className, ...rest } = props;
|
|
127
126
|
return (_jsx(CoreStaffMember.Actions, { children: ({ select, selected, rawStaffMember }) => {
|
|
128
127
|
const handleClick = () => {
|
|
129
128
|
select();
|
|
@@ -131,11 +130,11 @@ const Select = React.forwardRef((props, ref) => {
|
|
|
131
130
|
onClick?.(rawStaffMember);
|
|
132
131
|
}
|
|
133
132
|
};
|
|
134
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.staffMemberActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
133
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.staffMemberActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
135
134
|
onClick: handleClick,
|
|
136
135
|
selected,
|
|
137
136
|
staffMember: rawStaffMember,
|
|
138
|
-
}, children: _jsx("button", {
|
|
137
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
139
138
|
} }));
|
|
140
139
|
});
|
|
141
140
|
Select.displayName = 'StaffMember.Actions.Select';
|
|
@@ -9,12 +9,14 @@ import { GenericListRepeaterProps, type ListVariant } from '@wix/headless-compon
|
|
|
9
9
|
import { type AsChildChildren } from '@wix/headless-utils/react';
|
|
10
10
|
import type { StaffMemberListServiceConfig } from '../../services/staff-member-list/staff-member-list.js';
|
|
11
11
|
import type { StaffMemberData } from '../../services/staff-member-list/staff-member-list.def.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
/** Resource type ID for staff members */
|
|
13
|
+
export declare const TestIds: {
|
|
14
|
+
readonly staffMemberListRoot: "staff-member-list-root";
|
|
15
|
+
readonly staffMemberListStaffMembers: "staff-member-list-staff-members";
|
|
16
|
+
readonly staffMemberListStaffMember: "staff-member-list-staff-member";
|
|
17
|
+
readonly staffMemberListActionClear: "staff-member-list-action-clear";
|
|
18
|
+
readonly staffMemberListTotals: "staff-member-list-totals";
|
|
19
|
+
};
|
|
18
20
|
/**
|
|
19
21
|
* Props for the StaffMemberList root component
|
|
20
22
|
*/
|
|
@@ -77,13 +79,12 @@ export declare const StaffMemberRepeater: React.ForwardRefExoticComponent<StaffM
|
|
|
77
79
|
/**
|
|
78
80
|
* Props for StaffMemberList.Totals component
|
|
79
81
|
*/
|
|
80
|
-
export interface TotalsProps {
|
|
82
|
+
export interface TotalsProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
81
83
|
asChild?: boolean;
|
|
82
84
|
children?: React.ReactNode | AsChildChildren<{
|
|
83
85
|
count: number;
|
|
84
86
|
hasStaffMembers: boolean;
|
|
85
87
|
}>;
|
|
86
|
-
className?: string;
|
|
87
88
|
}
|
|
88
89
|
/**
|
|
89
90
|
* Displays the total count of staff members.
|