@wix/headless-bookings 0.0.91 → 0.0.93
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/react/booking/Book.d.ts +1 -1
- package/cjs/dist/react/booking/Book.js +9 -6
- package/cjs/dist/react/booking/Booking.d.ts +2 -15
- package/cjs/dist/react/booking/Booking.js +2 -19
- package/cjs/dist/react/booking/BookingItem.d.ts +1 -2
- package/cjs/dist/react/booking/BookingItem.js +2 -2
- package/cjs/dist/react/booking-form/BookingForm.js +3 -3
- package/cjs/dist/react/location/Location.d.ts +2 -4
- package/cjs/dist/react/location/Location.js +14 -14
- package/cjs/dist/react/location/LocationList.d.ts +1 -2
- package/cjs/dist/react/location/LocationList.js +6 -5
- package/cjs/dist/react/payment/Payment.d.ts +8 -16
- package/cjs/dist/react/payment/Payment.js +14 -14
- package/cjs/dist/react/service/Service.d.ts +8 -16
- package/cjs/dist/react/service/Service.js +29 -29
- package/cjs/dist/react/staff-member/StaffMember.d.ts +1 -2
- package/cjs/dist/react/staff-member/StaffMember.js +5 -5
- package/cjs/dist/react/staff-member/StaffMemberList.d.ts +3 -3
- package/cjs/dist/react/staff-member/StaffMemberList.js +6 -5
- package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +4 -8
- package/cjs/dist/react/time-slot-list/TimeSlot.js +19 -19
- package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +1 -3
- package/cjs/dist/react/time-slot-list/TimeSlotList.js +9 -8
- package/dist/react/booking/Book.d.ts +1 -1
- package/dist/react/booking/Book.js +9 -6
- package/dist/react/booking/Booking.d.ts +2 -15
- package/dist/react/booking/Booking.js +2 -19
- package/dist/react/booking/BookingItem.d.ts +1 -2
- package/dist/react/booking/BookingItem.js +2 -2
- package/dist/react/booking-form/BookingForm.js +3 -3
- package/dist/react/location/Location.d.ts +2 -4
- package/dist/react/location/Location.js +14 -14
- package/dist/react/location/LocationList.d.ts +1 -2
- package/dist/react/location/LocationList.js +6 -5
- package/dist/react/payment/Payment.d.ts +8 -16
- package/dist/react/payment/Payment.js +14 -14
- package/dist/react/service/Service.d.ts +8 -16
- package/dist/react/service/Service.js +29 -29
- package/dist/react/staff-member/StaffMember.d.ts +1 -2
- package/dist/react/staff-member/StaffMember.js +5 -5
- package/dist/react/staff-member/StaffMemberList.d.ts +3 -3
- package/dist/react/staff-member/StaffMemberList.js +6 -5
- package/dist/react/time-slot-list/TimeSlot.d.ts +4 -8
- package/dist/react/time-slot-list/TimeSlot.js +19 -19
- package/dist/react/time-slot-list/TimeSlotList.d.ts +1 -3
- package/dist/react/time-slot-list/TimeSlotList.js +9 -8
- package/package.json +2 -2
|
@@ -122,12 +122,11 @@ export declare const Root: React.ForwardRefExoticComponent<ServiceRootProps & Re
|
|
|
122
122
|
/**
|
|
123
123
|
* Props for Service Name component
|
|
124
124
|
*/
|
|
125
|
-
export interface NameProps {
|
|
125
|
+
export interface NameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
126
126
|
asChild?: boolean;
|
|
127
127
|
children?: AsChildChildren<{
|
|
128
128
|
name: string;
|
|
129
129
|
}>;
|
|
130
|
-
className?: string;
|
|
131
130
|
}
|
|
132
131
|
/**
|
|
133
132
|
* Displays the service name with customizable rendering.
|
|
@@ -157,12 +156,11 @@ export declare const Name: React.ForwardRefExoticComponent<NameProps & React.Ref
|
|
|
157
156
|
/**
|
|
158
157
|
* Props for Service Description component
|
|
159
158
|
*/
|
|
160
|
-
export interface DescriptionProps {
|
|
159
|
+
export interface DescriptionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
161
160
|
asChild?: boolean;
|
|
162
161
|
children?: AsChildChildren<{
|
|
163
162
|
description: string;
|
|
164
163
|
}>;
|
|
165
|
-
className?: string;
|
|
166
164
|
}
|
|
167
165
|
/**
|
|
168
166
|
* Displays the service description with customizable rendering.
|
|
@@ -231,12 +229,11 @@ export declare const Price: React.ForwardRefExoticComponent<PriceProps & React.R
|
|
|
231
229
|
/**
|
|
232
230
|
* Props for Service Tagline component
|
|
233
231
|
*/
|
|
234
|
-
export interface TaglineProps {
|
|
232
|
+
export interface TaglineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
235
233
|
asChild?: boolean;
|
|
236
234
|
children?: AsChildChildren<{
|
|
237
235
|
tagline: string;
|
|
238
236
|
}>;
|
|
239
|
-
className?: string;
|
|
240
237
|
}
|
|
241
238
|
/**
|
|
242
239
|
* Displays the service tagline with customizable rendering.
|
|
@@ -272,12 +269,11 @@ export declare const Tagline: React.ForwardRefExoticComponent<TaglineProps & Rea
|
|
|
272
269
|
/**
|
|
273
270
|
* Props for Service DurationInMinutes component
|
|
274
271
|
*/
|
|
275
|
-
export interface DurationInMinutesProps {
|
|
272
|
+
export interface DurationInMinutesProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
276
273
|
asChild?: boolean;
|
|
277
274
|
children?: AsChildChildren<{
|
|
278
275
|
duration: number;
|
|
279
276
|
}>;
|
|
280
|
-
className?: string;
|
|
281
277
|
}
|
|
282
278
|
/**
|
|
283
279
|
* Displays the service duration in minutes (raw number) with customizable rendering.
|
|
@@ -314,12 +310,11 @@ export declare const DurationInMinutes: React.ForwardRefExoticComponent<Duration
|
|
|
314
310
|
/**
|
|
315
311
|
* Props for Service Type component
|
|
316
312
|
*/
|
|
317
|
-
export interface TypeProps {
|
|
313
|
+
export interface TypeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
318
314
|
asChild?: boolean;
|
|
319
315
|
children?: AsChildChildren<{
|
|
320
316
|
type: string;
|
|
321
317
|
}>;
|
|
322
|
-
className?: string;
|
|
323
318
|
}
|
|
324
319
|
/**
|
|
325
320
|
* Displays the service type (APPOINTMENT, CLASS, COURSE, etc.) with customizable rendering.
|
|
@@ -358,7 +353,7 @@ export declare const Type: React.ForwardRefExoticComponent<TypeProps & React.Ref
|
|
|
358
353
|
/**
|
|
359
354
|
* Props for Service Category component
|
|
360
355
|
*/
|
|
361
|
-
export interface CategoryProps {
|
|
356
|
+
export interface CategoryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
362
357
|
asChild?: boolean;
|
|
363
358
|
children?: AsChildChildren<{
|
|
364
359
|
category: {
|
|
@@ -366,7 +361,6 @@ export interface CategoryProps {
|
|
|
366
361
|
_id?: string;
|
|
367
362
|
};
|
|
368
363
|
}>;
|
|
369
|
-
className?: string;
|
|
370
364
|
}
|
|
371
365
|
/**
|
|
372
366
|
* Displays the service category with customizable rendering.
|
|
@@ -1091,13 +1085,12 @@ export declare namespace Schedule {
|
|
|
1091
1085
|
/**
|
|
1092
1086
|
* Props for Service DefaultCapacity component
|
|
1093
1087
|
*/
|
|
1094
|
-
export interface DefaultCapacityProps {
|
|
1088
|
+
export interface DefaultCapacityProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1095
1089
|
asChild?: boolean;
|
|
1096
1090
|
children?: AsChildChildren<{
|
|
1097
1091
|
defaultCapacity: number;
|
|
1098
1092
|
isClassOrCourse: boolean;
|
|
1099
1093
|
}>;
|
|
1100
|
-
className?: string;
|
|
1101
1094
|
}
|
|
1102
1095
|
/**
|
|
1103
1096
|
* Displays the service default capacity with customizable rendering.
|
|
@@ -1121,12 +1114,11 @@ export declare const DefaultCapacity: React.ForwardRefExoticComponent<DefaultCap
|
|
|
1121
1114
|
/**
|
|
1122
1115
|
* Props for Service AvailableOnline component
|
|
1123
1116
|
*/
|
|
1124
|
-
export interface AvailableOnlineProps {
|
|
1117
|
+
export interface AvailableOnlineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1125
1118
|
asChild?: boolean;
|
|
1126
1119
|
children?: AsChildChildren<{
|
|
1127
1120
|
availableOnline: boolean;
|
|
1128
1121
|
}>;
|
|
1129
|
-
className?: string;
|
|
1130
1122
|
label?: string;
|
|
1131
1123
|
}
|
|
1132
1124
|
/**
|
|
@@ -148,8 +148,8 @@ Root.displayName = 'Service.Root';
|
|
|
148
148
|
* ```
|
|
149
149
|
*/
|
|
150
150
|
export const Name = React.forwardRef((props, ref) => {
|
|
151
|
-
const { asChild, children,
|
|
152
|
-
return (_jsx(CoreService.Info, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
151
|
+
const { asChild, children, ...rest } = props;
|
|
152
|
+
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
153
|
});
|
|
154
154
|
Name.displayName = 'Service.Name';
|
|
155
155
|
/**
|
|
@@ -168,8 +168,8 @@ Name.displayName = 'Service.Name';
|
|
|
168
168
|
* ```
|
|
169
169
|
*/
|
|
170
170
|
export const Description = React.forwardRef((props, ref) => {
|
|
171
|
-
const { asChild, children,
|
|
172
|
-
return (_jsx(CoreService.Info, { children: ({ description }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
171
|
+
const { asChild, children, ...rest } = props;
|
|
172
|
+
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
173
|
});
|
|
174
174
|
Description.displayName = 'Service.Description';
|
|
175
175
|
/**
|
|
@@ -261,8 +261,8 @@ Price.displayName = 'Service.Price';
|
|
|
261
261
|
* ```
|
|
262
262
|
*/
|
|
263
263
|
export const Tagline = React.forwardRef((props, ref) => {
|
|
264
|
-
const { asChild, children,
|
|
265
|
-
return (_jsx(CoreService.Info, { children: ({ tagline }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
264
|
+
const { asChild, children, ...rest } = props;
|
|
265
|
+
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
266
|
});
|
|
267
267
|
Tagline.displayName = 'Service.Tagline';
|
|
268
268
|
/**
|
|
@@ -297,9 +297,9 @@ Tagline.displayName = 'Service.Tagline';
|
|
|
297
297
|
* ```
|
|
298
298
|
*/
|
|
299
299
|
export const DurationInMinutes = React.forwardRef((props, ref) => {
|
|
300
|
-
const { asChild, children,
|
|
300
|
+
const { asChild, children, ...rest } = props;
|
|
301
301
|
return (_jsx(CoreService.Info, { children: ({ duration }) => {
|
|
302
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
302
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.serviceDurationInMinutes, customElement: children, customElementProps: { duration }, children: duration ? _jsx("span", { children: duration }) : null }));
|
|
303
303
|
} }));
|
|
304
304
|
});
|
|
305
305
|
DurationInMinutes.displayName = 'Service.DurationInMinutes';
|
|
@@ -337,8 +337,8 @@ DurationInMinutes.displayName = 'Service.DurationInMinutes';
|
|
|
337
337
|
* ```
|
|
338
338
|
*/
|
|
339
339
|
export const Type = React.forwardRef((props, ref) => {
|
|
340
|
-
const { asChild, children,
|
|
341
|
-
return (_jsx(CoreService.Info, { children: ({ type }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
340
|
+
const { asChild, children, ...rest } = props;
|
|
341
|
+
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
342
|
});
|
|
343
343
|
Type.displayName = 'Service.Type';
|
|
344
344
|
/**
|
|
@@ -377,8 +377,8 @@ Type.displayName = 'Service.Type';
|
|
|
377
377
|
* ```
|
|
378
378
|
*/
|
|
379
379
|
export const Category = React.forwardRef((props, ref) => {
|
|
380
|
-
const { asChild, children,
|
|
381
|
-
return (_jsx(CoreService.Info, { children: ({ category }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
380
|
+
const { asChild, children, ...rest } = props;
|
|
381
|
+
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
382
|
});
|
|
383
383
|
Category.displayName = 'Service.Category';
|
|
384
384
|
/**
|
|
@@ -413,13 +413,13 @@ Category.displayName = 'Service.Category';
|
|
|
413
413
|
* ```
|
|
414
414
|
*/
|
|
415
415
|
const LocationsBase = React.forwardRef((props, ref) => {
|
|
416
|
-
const { asChild, children, className, ...
|
|
416
|
+
const { asChild, children, className, ...rest } = props;
|
|
417
417
|
return (_jsx(CoreService.Info, { children: ({ locations }) => {
|
|
418
418
|
// Container level: don't render if no locations
|
|
419
419
|
if (!locations || locations.length === 0) {
|
|
420
420
|
return null;
|
|
421
421
|
}
|
|
422
|
-
return (_jsx(LocationList.Root, { locationListConfig: { locations }, className: className, ref: ref, children: _jsx(AsChildSlot, { ...
|
|
422
|
+
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
423
|
} }));
|
|
424
424
|
});
|
|
425
425
|
LocationsBase.displayName = 'Service.Locations';
|
|
@@ -501,13 +501,13 @@ LocationRepeater.displayName = 'Service.Locations.LocationRepeater';
|
|
|
501
501
|
* ```
|
|
502
502
|
*/
|
|
503
503
|
const StaffMembersBase = React.forwardRef((props, ref) => {
|
|
504
|
-
const { asChild, children, className, ...
|
|
504
|
+
const { asChild, children, className, ...rest } = props;
|
|
505
505
|
return (_jsx(CoreService.Info, { children: ({ staff }) => {
|
|
506
506
|
// Container level: don't render if no staff members
|
|
507
507
|
if (!staff || staff.length === 0) {
|
|
508
508
|
return null;
|
|
509
509
|
}
|
|
510
|
-
return (_jsx(StaffMemberListModule.Root, { staffMemberListConfig: { staffMembers: staff }, className: className, ref: ref, children: _jsx(AsChildSlot, { ...
|
|
510
|
+
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
511
|
} }));
|
|
512
512
|
});
|
|
513
513
|
StaffMembersBase.displayName = 'Service.StaffMembers';
|
|
@@ -618,20 +618,20 @@ export var Actions;
|
|
|
618
618
|
* ```
|
|
619
619
|
*/
|
|
620
620
|
Actions.Select = React.forwardRef((props, ref) => {
|
|
621
|
-
const { asChild, children, className, label, onClick, ...
|
|
621
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
622
622
|
return (_jsx(CoreService.Actions, { children: ({ select, rawService, bookable, selected, requiresAvailability, }) => {
|
|
623
623
|
const handleClick = () => {
|
|
624
624
|
select();
|
|
625
625
|
onClick?.(rawService);
|
|
626
626
|
};
|
|
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: {
|
|
627
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: !bookable, "data-testid": TestIds.serviceActionSelect, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
628
628
|
onClick: handleClick,
|
|
629
629
|
disabled: !bookable,
|
|
630
630
|
selected,
|
|
631
631
|
bookable,
|
|
632
632
|
requiresAvailability,
|
|
633
633
|
service: rawService,
|
|
634
|
-
}, children: _jsx("button", {
|
|
634
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
635
635
|
} }));
|
|
636
636
|
});
|
|
637
637
|
Actions.Select.displayName = 'Service.Actions.Select';
|
|
@@ -665,7 +665,7 @@ export var Actions;
|
|
|
665
665
|
* ```
|
|
666
666
|
*/
|
|
667
667
|
Actions.Add = React.forwardRef((props, ref) => {
|
|
668
|
-
const { asChild, children, className, label, onClick, ...
|
|
668
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
669
669
|
return (_jsx(CoreService.Actions, { children: ({ add, rawService, bookable, selected, requiresAvailability }) => {
|
|
670
670
|
// Disabled when already selected (can't add again) or not bookable
|
|
671
671
|
const isDisabled = selected || !bookable;
|
|
@@ -673,14 +673,14 @@ export var Actions;
|
|
|
673
673
|
add();
|
|
674
674
|
onClick?.(rawService);
|
|
675
675
|
};
|
|
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: {
|
|
676
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: isDisabled, "data-testid": TestIds.serviceActionAdd, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
677
677
|
onClick: handleClick,
|
|
678
678
|
disabled: isDisabled,
|
|
679
679
|
selected,
|
|
680
680
|
bookable,
|
|
681
681
|
requiresAvailability,
|
|
682
682
|
service: rawService,
|
|
683
|
-
}, children: _jsx("button", {
|
|
683
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
684
684
|
} }));
|
|
685
685
|
});
|
|
686
686
|
Actions.Add.displayName = 'Service.Actions.Add';
|
|
@@ -714,7 +714,7 @@ export var Actions;
|
|
|
714
714
|
* ```
|
|
715
715
|
*/
|
|
716
716
|
Actions.Remove = React.forwardRef((props, ref) => {
|
|
717
|
-
const { asChild, children, className, label, onClick, ...
|
|
717
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
718
718
|
return (_jsx(CoreService.Actions, { children: ({ remove, rawService, bookable, selected, requiresAvailability, }) => {
|
|
719
719
|
// Disabled when not selected (nothing to remove) or not bookable
|
|
720
720
|
const isDisabled = !selected || !bookable;
|
|
@@ -722,14 +722,14 @@ export var Actions;
|
|
|
722
722
|
remove();
|
|
723
723
|
onClick?.(rawService);
|
|
724
724
|
};
|
|
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: {
|
|
725
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: isDisabled, "data-testid": TestIds.serviceActionRemove, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
|
|
726
726
|
onClick: handleClick,
|
|
727
727
|
disabled: isDisabled,
|
|
728
728
|
selected,
|
|
729
729
|
bookable,
|
|
730
730
|
requiresAvailability,
|
|
731
731
|
service: rawService,
|
|
732
|
-
}, children: _jsx("button", {
|
|
732
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
733
733
|
} }));
|
|
734
734
|
});
|
|
735
735
|
Actions.Remove.displayName = 'Service.Actions.Remove';
|
|
@@ -1067,10 +1067,10 @@ export var Schedule;
|
|
|
1067
1067
|
* ```
|
|
1068
1068
|
*/
|
|
1069
1069
|
export const DefaultCapacity = React.forwardRef((props, ref) => {
|
|
1070
|
-
const { asChild, children,
|
|
1070
|
+
const { asChild, children, ...rest } = props;
|
|
1071
1071
|
return (_jsx(CoreService.Info, { children: ({ type, defaultCapacity }) => {
|
|
1072
1072
|
const isClassOrCourse = type === 'CLASS' || type === 'COURSE';
|
|
1073
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
1073
|
+
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
1074
|
} }));
|
|
1075
1075
|
});
|
|
1076
1076
|
DefaultCapacity.displayName = 'Service.DefaultCapacity';
|
|
@@ -1098,10 +1098,10 @@ DefaultCapacity.displayName = 'Service.DefaultCapacity';
|
|
|
1098
1098
|
* ```
|
|
1099
1099
|
*/
|
|
1100
1100
|
export const AvailableOnline = React.forwardRef((props, ref) => {
|
|
1101
|
-
const { asChild, children,
|
|
1101
|
+
const { asChild, children, label, ...rest } = props;
|
|
1102
1102
|
return (_jsx(CoreService.Service, { children: ({ service }) => {
|
|
1103
1103
|
const availableOnline = service.conferencing?.enabled ?? false;
|
|
1104
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
1104
|
+
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
1105
|
} }));
|
|
1106
1106
|
});
|
|
1107
1107
|
AvailableOnline.displayName = 'Service.AvailableOnline';
|
|
@@ -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.
|
|
@@ -74,9 +74,9 @@ Root.displayName = 'StaffMember.Root';
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
export const Name = React.forwardRef((props, ref) => {
|
|
77
|
-
const { asChild, children,
|
|
77
|
+
const { asChild, children, ...rest } = props;
|
|
78
78
|
const { name } = useStaffMemberContext();
|
|
79
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
79
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.staffMemberName, customElement: children, customElementProps: { name }, children: name ? _jsx("span", { children: name }) : null }));
|
|
80
80
|
});
|
|
81
81
|
Name.displayName = 'StaffMember.Name';
|
|
82
82
|
/**
|
|
@@ -123,7 +123,7 @@ Raw.displayName = 'StaffMember.Raw';
|
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
125
|
const Select = React.forwardRef((props, ref) => {
|
|
126
|
-
const { asChild, children, onClick, label, className, ...
|
|
126
|
+
const { asChild, children, onClick, label, className, ...rest } = props;
|
|
127
127
|
return (_jsx(CoreStaffMember.Actions, { children: ({ select, selected, rawStaffMember }) => {
|
|
128
128
|
const handleClick = () => {
|
|
129
129
|
select();
|
|
@@ -131,11 +131,11 @@ const Select = React.forwardRef((props, ref) => {
|
|
|
131
131
|
onClick?.(rawStaffMember);
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.staffMemberActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
134
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.staffMemberActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
135
135
|
onClick: handleClick,
|
|
136
136
|
selected,
|
|
137
137
|
staffMember: rawStaffMember,
|
|
138
|
-
}, children: _jsx("button", {
|
|
138
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
139
139
|
} }));
|
|
140
140
|
});
|
|
141
141
|
Select.displayName = 'StaffMember.Actions.Select';
|
|
@@ -13,7 +13,8 @@ export declare enum TestIds {
|
|
|
13
13
|
staffMemberListRoot = "staff-member-list-root",
|
|
14
14
|
staffMemberListStaffMembers = "staff-member-list-staff-members",
|
|
15
15
|
staffMemberListStaffMember = "staff-member-list-staff-member",
|
|
16
|
-
staffMemberListActionClear = "staff-member-list-action-clear"
|
|
16
|
+
staffMemberListActionClear = "staff-member-list-action-clear",
|
|
17
|
+
staffMemberListTotals = "staff-member-list-totals"
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Props for the StaffMemberList root component
|
|
@@ -77,13 +78,12 @@ export declare const StaffMemberRepeater: React.ForwardRefExoticComponent<StaffM
|
|
|
77
78
|
/**
|
|
78
79
|
* Props for StaffMemberList.Totals component
|
|
79
80
|
*/
|
|
80
|
-
export interface TotalsProps {
|
|
81
|
+
export interface TotalsProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
81
82
|
asChild?: boolean;
|
|
82
83
|
children?: React.ReactNode | AsChildChildren<{
|
|
83
84
|
count: number;
|
|
84
85
|
hasStaffMembers: boolean;
|
|
85
86
|
}>;
|
|
86
|
-
className?: string;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Displays the total count of staff members.
|
|
@@ -23,6 +23,7 @@ export var TestIds;
|
|
|
23
23
|
TestIds["staffMemberListStaffMembers"] = "staff-member-list-staff-members";
|
|
24
24
|
TestIds["staffMemberListStaffMember"] = "staff-member-list-staff-member";
|
|
25
25
|
TestIds["staffMemberListActionClear"] = "staff-member-list-action-clear";
|
|
26
|
+
TestIds["staffMemberListTotals"] = "staff-member-list-totals";
|
|
26
27
|
})(TestIds || (TestIds = {}));
|
|
27
28
|
/**
|
|
28
29
|
* Root component that provides the StaffMemberList service context for rendering staff member lists.
|
|
@@ -110,10 +111,10 @@ StaffMemberRepeater.displayName = 'StaffMemberList.StaffMemberRepeater';
|
|
|
110
111
|
* ```
|
|
111
112
|
*/
|
|
112
113
|
export const Totals = React.forwardRef((props, ref) => {
|
|
113
|
-
const { asChild, children,
|
|
114
|
+
const { asChild, children, ...rest } = props;
|
|
114
115
|
return (_jsx(CoreStaffMemberList.StaffMembers, { children: ({ staffMembers, hasStaffMembers }) => {
|
|
115
116
|
const count = staffMembers.length;
|
|
116
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
117
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.staffMemberListTotals, customElement: children, customElementProps: { count, hasStaffMembers }, children: _jsx("span", { children: count }) }));
|
|
117
118
|
} }));
|
|
118
119
|
});
|
|
119
120
|
Totals.displayName = 'StaffMemberList.Totals';
|
|
@@ -147,7 +148,7 @@ Totals.displayName = 'StaffMemberList.Totals';
|
|
|
147
148
|
* ```
|
|
148
149
|
*/
|
|
149
150
|
const Clear = React.forwardRef((props, ref) => {
|
|
150
|
-
const { asChild, children, className, label, onClick, ...
|
|
151
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
151
152
|
return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember }) => {
|
|
152
153
|
let bookingService = null;
|
|
153
154
|
try {
|
|
@@ -160,9 +161,9 @@ const Clear = React.forwardRef((props, ref) => {
|
|
|
160
161
|
bookingService?.actions.clearResourceByType(STAFF_MEMBER_RESOURCE_TYPE_ID);
|
|
161
162
|
onClick?.(selectedStaffMember);
|
|
162
163
|
};
|
|
163
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.staffMemberListActionClear, customElement: children, customElementProps: {
|
|
164
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.staffMemberListActionClear, customElement: children, customElementProps: {
|
|
164
165
|
onClick: handleClick,
|
|
165
|
-
}, children: _jsx("button", {
|
|
166
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
166
167
|
} }));
|
|
167
168
|
});
|
|
168
169
|
Clear.displayName = 'StaffMemberList.Actions.Clear';
|
|
@@ -121,12 +121,11 @@ export declare const EndDate: React.ForwardRefExoticComponent<EndDateProps & Rea
|
|
|
121
121
|
/**
|
|
122
122
|
* Props for TimeSlot.Duration component
|
|
123
123
|
*/
|
|
124
|
-
export interface DurationProps {
|
|
124
|
+
export interface DurationProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
125
125
|
asChild?: boolean;
|
|
126
126
|
children?: AsChildChildren<{
|
|
127
127
|
durationInMinutes: number;
|
|
128
128
|
}>;
|
|
129
|
-
className?: string;
|
|
130
129
|
}
|
|
131
130
|
/**
|
|
132
131
|
* Calculates and displays the duration between start and end times in minutes.
|
|
@@ -249,12 +248,11 @@ export declare const Actions: {
|
|
|
249
248
|
/**
|
|
250
249
|
* Props for TimeSlot.Location.Name component
|
|
251
250
|
*/
|
|
252
|
-
export interface LocationNameProps {
|
|
251
|
+
export interface LocationNameProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
253
252
|
asChild?: boolean;
|
|
254
253
|
children?: AsChildChildren<{
|
|
255
254
|
name: string;
|
|
256
255
|
}>;
|
|
257
|
-
className?: string;
|
|
258
256
|
}
|
|
259
257
|
/**
|
|
260
258
|
* Displays the location name.
|
|
@@ -283,9 +281,8 @@ export declare const Location: {
|
|
|
283
281
|
/**
|
|
284
282
|
* Props for TimeSlot.StaffMembers component
|
|
285
283
|
*/
|
|
286
|
-
export interface StaffMembersProps {
|
|
284
|
+
export interface StaffMembersProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
287
285
|
children: React.ReactNode;
|
|
288
|
-
className?: string;
|
|
289
286
|
}
|
|
290
287
|
/**
|
|
291
288
|
* Container for the staff members list within a time slot.
|
|
@@ -329,12 +326,11 @@ export declare const StaffMemberRepeater: React.ForwardRefExoticComponent<StaffM
|
|
|
329
326
|
/**
|
|
330
327
|
* Props for TimeSlot.StaffMember.Name component
|
|
331
328
|
*/
|
|
332
|
-
export interface StaffMemberNameProps {
|
|
329
|
+
export interface StaffMemberNameProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
333
330
|
asChild?: boolean;
|
|
334
331
|
children?: AsChildChildren<{
|
|
335
332
|
name: string;
|
|
336
333
|
}>;
|
|
337
|
-
className?: string;
|
|
338
334
|
}
|
|
339
335
|
/**
|
|
340
336
|
* Displays the staff member name.
|
|
@@ -24,8 +24,8 @@ import * as CoreTimeSlot from '../core/time-slot-list/TimeSlot.js';
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export const Root = React.forwardRef((props, ref) => {
|
|
27
|
-
const { children, timeSlot, asChild, className
|
|
28
|
-
return (_jsx(CoreTimeSlot.Root, { config: { timeSlot }, children: _jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children,
|
|
27
|
+
const { children, timeSlot, asChild, className } = props;
|
|
28
|
+
return (_jsx(CoreTimeSlot.Root, { config: { timeSlot }, children: _jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, children: children }) }));
|
|
29
29
|
});
|
|
30
30
|
Root.displayName = 'TimeSlot.Root';
|
|
31
31
|
// ============================================================================
|
|
@@ -137,8 +137,8 @@ EndDate.displayName = 'TimeSlot.EndDate';
|
|
|
137
137
|
* ```
|
|
138
138
|
*/
|
|
139
139
|
export const Duration = React.forwardRef((props, ref) => {
|
|
140
|
-
const { asChild, children,
|
|
141
|
-
return (_jsx(CoreTimeSlot.Info, { children: ({ durationInMinutes }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
140
|
+
const { asChild, children, ...rest } = props;
|
|
141
|
+
return (_jsx(CoreTimeSlot.Info, { children: ({ durationInMinutes }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.timeSlotDuration, customElement: children, customElementProps: { durationInMinutes }, children: _jsx("span", { children: durationInMinutes }) })) }));
|
|
142
142
|
});
|
|
143
143
|
Duration.displayName = 'TimeSlot.Duration';
|
|
144
144
|
/**
|
|
@@ -175,19 +175,19 @@ Duration.displayName = 'TimeSlot.Duration';
|
|
|
175
175
|
* ```
|
|
176
176
|
*/
|
|
177
177
|
export const Select = React.forwardRef((props, ref) => {
|
|
178
|
-
const { asChild, children, className, label, onClick, ...
|
|
178
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
179
179
|
return (_jsx(CoreTimeSlot.Actions, { children: ({ selectTimeSlot, timeSlot, isSelected, bookable }) => {
|
|
180
180
|
const handleClick = () => {
|
|
181
181
|
selectTimeSlot();
|
|
182
182
|
onClick?.(timeSlot);
|
|
183
183
|
};
|
|
184
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotActionSelect, "data-selected": isSelected, "data-bookable": bookable, customElement: children, customElementProps: {
|
|
184
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: !bookable, "data-testid": TestIds.timeSlotActionSelect, "data-selected": isSelected, "data-bookable": bookable, customElement: children, customElementProps: {
|
|
185
185
|
onClick: handleClick,
|
|
186
186
|
disabled: !bookable,
|
|
187
187
|
isSelected,
|
|
188
188
|
bookable,
|
|
189
189
|
timeSlot,
|
|
190
|
-
}, children: _jsx("button", {
|
|
190
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
191
191
|
} }));
|
|
192
192
|
});
|
|
193
193
|
Select.displayName = 'TimeSlot.Actions.Select';
|
|
@@ -222,7 +222,7 @@ Select.displayName = 'TimeSlot.Actions.Select';
|
|
|
222
222
|
* ```
|
|
223
223
|
*/
|
|
224
224
|
export const ClearStaffSelection = React.forwardRef((props, ref) => {
|
|
225
|
-
const { asChild, children, className, label, onClick, ...
|
|
225
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
226
226
|
return (_jsx(CoreTimeSlot.Actions, { children: ({ clearStaffSelection, timeSlot }) => {
|
|
227
227
|
if (!clearStaffSelection) {
|
|
228
228
|
return null;
|
|
@@ -231,9 +231,9 @@ export const ClearStaffSelection = React.forwardRef((props, ref) => {
|
|
|
231
231
|
clearStaffSelection();
|
|
232
232
|
onClick?.(timeSlot);
|
|
233
233
|
};
|
|
234
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotActionClearStaffSelection, customElement: children, customElementProps: {
|
|
234
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.timeSlotActionClearStaffSelection, customElement: children, customElementProps: {
|
|
235
235
|
onClick: handleClick,
|
|
236
|
-
}, children: _jsx("button", {
|
|
236
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
237
237
|
} }));
|
|
238
238
|
});
|
|
239
239
|
ClearStaffSelection.displayName = 'TimeSlot.Actions.ClearStaffSelection';
|
|
@@ -262,9 +262,9 @@ export const Actions = {
|
|
|
262
262
|
* ```
|
|
263
263
|
*/
|
|
264
264
|
export const LocationName = React.forwardRef((props, ref) => {
|
|
265
|
-
const { asChild, children,
|
|
265
|
+
const { asChild, children, ...rest } = props;
|
|
266
266
|
return (_jsx(CoreTimeSlot.Info, { children: ({ locationName }) => {
|
|
267
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
267
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.timeSlotLocationName, customElement: children, customElementProps: { name: locationName }, children: _jsx("span", { children: locationName }) }));
|
|
268
268
|
} }));
|
|
269
269
|
});
|
|
270
270
|
LocationName.displayName = 'TimeSlot.Location.Name';
|
|
@@ -290,9 +290,9 @@ export const Location = {
|
|
|
290
290
|
* ```
|
|
291
291
|
*/
|
|
292
292
|
export const StaffMembers = React.forwardRef((props, ref) => {
|
|
293
|
-
const { children,
|
|
293
|
+
const { children, ...attrs } = props;
|
|
294
294
|
return (_jsx(CoreTimeSlot.StaffMembers, { children: ({ staffMembers }) => {
|
|
295
|
-
return (_jsx(GenericList.Root, { items: staffMembers, children: _jsx("div", { ref: ref,
|
|
295
|
+
return (_jsx(GenericList.Root, { items: staffMembers, children: _jsx("div", { ref: ref, ...attrs, "data-testid": TestIds.timeSlotStaffMembers, children: children }) }));
|
|
296
296
|
} }));
|
|
297
297
|
});
|
|
298
298
|
StaffMembers.displayName = 'TimeSlot.StaffMembers';
|
|
@@ -341,8 +341,8 @@ StaffMemberRepeater.displayName = 'TimeSlot.StaffMemberRepeater';
|
|
|
341
341
|
* ```
|
|
342
342
|
*/
|
|
343
343
|
export const StaffMemberName = React.forwardRef((props, ref) => {
|
|
344
|
-
const { asChild, children,
|
|
345
|
-
return (_jsx(CoreTimeSlot.StaffMemberInfo, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
344
|
+
const { asChild, children, ...rest } = props;
|
|
345
|
+
return (_jsx(CoreTimeSlot.StaffMemberInfo, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.timeSlotStaffMemberName, customElement: children, customElementProps: { name }, children: _jsx("span", { children: name }) })) }));
|
|
346
346
|
});
|
|
347
347
|
StaffMemberName.displayName = 'TimeSlot.StaffMember.Name';
|
|
348
348
|
/**
|
|
@@ -379,17 +379,17 @@ StaffMemberName.displayName = 'TimeSlot.StaffMember.Name';
|
|
|
379
379
|
* ```
|
|
380
380
|
*/
|
|
381
381
|
export const SelectStaffMember = React.forwardRef((props, ref) => {
|
|
382
|
-
const { asChild, children, className, label, onClick, ...
|
|
382
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
383
383
|
return (_jsx(CoreTimeSlot.StaffMemberActions, { children: ({ selectStaffMember, isSelected, staffMember }) => {
|
|
384
384
|
const handleClick = () => {
|
|
385
385
|
selectStaffMember();
|
|
386
386
|
onClick?.(staffMember);
|
|
387
387
|
};
|
|
388
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotStaffMemberActionSelect, "data-selected": isSelected, customElement: children, customElementProps: {
|
|
388
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.timeSlotStaffMemberActionSelect, "data-selected": isSelected, customElement: children, customElementProps: {
|
|
389
389
|
onClick: handleClick,
|
|
390
390
|
isSelected,
|
|
391
391
|
staffMember,
|
|
392
|
-
}, children: _jsx("button", {
|
|
392
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
393
393
|
} }));
|
|
394
394
|
});
|
|
395
395
|
SelectStaffMember.displayName = 'TimeSlot.StaffMember.Actions.Select';
|
|
@@ -163,7 +163,7 @@ export declare const Actions: {
|
|
|
163
163
|
/**
|
|
164
164
|
* Props for DateRange.Input component
|
|
165
165
|
*/
|
|
166
|
-
export interface DateRangeInputProps {
|
|
166
|
+
export interface DateRangeInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'type' | 'value' | 'defaultValue'> {
|
|
167
167
|
/** Whether to render as a child component */
|
|
168
168
|
asChild?: boolean;
|
|
169
169
|
/** Children for custom rendering */
|
|
@@ -174,8 +174,6 @@ export interface DateRangeInputProps {
|
|
|
174
174
|
/** IANA timezone string for the time slots (e.g., "America/New_York") */
|
|
175
175
|
timezone: string | undefined;
|
|
176
176
|
}>;
|
|
177
|
-
/** CSS classes to apply to the container */
|
|
178
|
-
className?: string;
|
|
179
177
|
}
|
|
180
178
|
/**
|
|
181
179
|
* DateRange namespace for TimeSlotList date range filter
|