@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.
Files changed (85) hide show
  1. package/cjs/dist/__mocks__/services.d.ts +0 -4
  2. package/cjs/dist/__mocks__/services.js +1 -4
  3. package/cjs/dist/api/fetch-availability/index.js +3 -3
  4. package/cjs/dist/api/query-services/index.js +1 -4
  5. package/cjs/dist/react/booking/Book.d.ts +4 -1
  6. package/cjs/dist/react/booking/Book.js +12 -10
  7. package/cjs/dist/react/booking/Booking.d.ts +10 -0
  8. package/cjs/dist/react/booking/Booking.js +10 -11
  9. package/cjs/dist/react/booking/BookingItem.d.ts +6 -2
  10. package/cjs/dist/react/booking/BookingItem.js +7 -8
  11. package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -0
  12. package/cjs/dist/react/booking-form/BookingForm.js +8 -9
  13. package/cjs/dist/react/core/staff-member/StaffMember.js +1 -2
  14. package/cjs/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
  15. package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
  16. package/cjs/dist/react/location/Location.d.ts +12 -4
  17. package/cjs/dist/react/location/Location.js +24 -25
  18. package/cjs/dist/react/location/LocationList.d.ts +8 -2
  19. package/cjs/dist/react/location/LocationList.js +12 -12
  20. package/cjs/dist/react/payment/Payment.d.ts +22 -16
  21. package/cjs/dist/react/payment/Payment.js +28 -29
  22. package/cjs/dist/react/service/Service.d.ts +41 -16
  23. package/cjs/dist/react/service/Service.js +62 -63
  24. package/cjs/dist/react/service/ServiceMedia.d.ts +4 -0
  25. package/cjs/dist/react/service/ServiceMedia.js +4 -5
  26. package/cjs/dist/react/service-list/ServiceList.d.ts +7 -0
  27. package/cjs/dist/react/service-list/ServiceList.js +7 -8
  28. package/cjs/dist/react/staff-member/StaffMember.d.ts +7 -8
  29. package/cjs/dist/react/staff-member/StaffMember.js +11 -12
  30. package/cjs/dist/react/staff-member/StaffMemberList.d.ts +9 -8
  31. package/cjs/dist/react/staff-member/StaffMemberList.js +14 -24
  32. package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +16 -20
  33. package/cjs/dist/react/time-slot-list/TimeSlot.js +31 -32
  34. package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +10 -12
  35. package/cjs/dist/react/time-slot-list/TimeSlotList.js +18 -18
  36. package/cjs/dist/services/booking/book-action/buildBookingRequest.js +1 -2
  37. package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
  38. package/cjs/dist/services/constants.d.ts +9 -0
  39. package/cjs/dist/services/constants.js +9 -0
  40. package/cjs/dist/services/payment/payment.js +2 -5
  41. package/cjs/dist/services/service/service.js +1 -1
  42. package/cjs/dist/services/service-list/service-list.js +1 -4
  43. package/dist/__mocks__/services.d.ts +0 -4
  44. package/dist/__mocks__/services.js +1 -4
  45. package/dist/api/fetch-availability/index.js +3 -3
  46. package/dist/api/query-services/index.js +1 -4
  47. package/dist/react/booking/Book.d.ts +4 -1
  48. package/dist/react/booking/Book.js +12 -10
  49. package/dist/react/booking/Booking.d.ts +10 -0
  50. package/dist/react/booking/Booking.js +10 -11
  51. package/dist/react/booking/BookingItem.d.ts +6 -2
  52. package/dist/react/booking/BookingItem.js +7 -8
  53. package/dist/react/booking-form/BookingForm.d.ts +5 -0
  54. package/dist/react/booking-form/BookingForm.js +8 -9
  55. package/dist/react/core/staff-member/StaffMember.js +1 -2
  56. package/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
  57. package/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
  58. package/dist/react/location/Location.d.ts +12 -4
  59. package/dist/react/location/Location.js +24 -25
  60. package/dist/react/location/LocationList.d.ts +8 -2
  61. package/dist/react/location/LocationList.js +12 -12
  62. package/dist/react/payment/Payment.d.ts +22 -16
  63. package/dist/react/payment/Payment.js +28 -29
  64. package/dist/react/service/Service.d.ts +41 -16
  65. package/dist/react/service/Service.js +62 -63
  66. package/dist/react/service/ServiceMedia.d.ts +4 -0
  67. package/dist/react/service/ServiceMedia.js +4 -5
  68. package/dist/react/service-list/ServiceList.d.ts +7 -0
  69. package/dist/react/service-list/ServiceList.js +7 -8
  70. package/dist/react/staff-member/StaffMember.d.ts +7 -8
  71. package/dist/react/staff-member/StaffMember.js +11 -12
  72. package/dist/react/staff-member/StaffMemberList.d.ts +9 -8
  73. package/dist/react/staff-member/StaffMemberList.js +14 -24
  74. package/dist/react/time-slot-list/TimeSlot.d.ts +16 -20
  75. package/dist/react/time-slot-list/TimeSlot.js +31 -32
  76. package/dist/react/time-slot-list/TimeSlotList.d.ts +10 -12
  77. package/dist/react/time-slot-list/TimeSlotList.js +18 -18
  78. package/dist/services/booking/book-action/buildBookingRequest.js +1 -2
  79. package/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
  80. package/dist/services/constants.d.ts +9 -0
  81. package/dist/services/constants.js +9 -0
  82. package/dist/services/payment/payment.js +2 -5
  83. package/dist/services/service/service.js +1 -1
  84. package/dist/services/service-list/service-list.js +1 -4
  85. package/package.json +2 -2
@@ -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
- var TestIds;
21
- (function (TestIds) {
22
- TestIds["serviceRoot"] = "service-root";
23
- TestIds["serviceName"] = "service-name";
24
- TestIds["serviceDescription"] = "service-description";
25
- TestIds["servicePrice"] = "service-price";
26
- TestIds["serviceTagline"] = "service-tagline";
27
- TestIds["serviceDurationInMinutes"] = "service-duration-in-minutes";
28
- TestIds["serviceType"] = "service-type";
29
- TestIds["serviceCategory"] = "service-category";
30
- TestIds["serviceLocations"] = "service-locations";
31
- TestIds["serviceLocation"] = "service-location";
32
- TestIds["serviceLocationRepeater"] = "service-location-repeater";
33
- TestIds["locationRoot"] = "location-root";
34
- TestIds["serviceStaffMembers"] = "service-staff-members";
35
- TestIds["serviceStaffMemberRepeater"] = "service-staff-member-repeater";
36
- TestIds["serviceSchedule"] = "service-schedule";
37
- TestIds["serviceDefaultCapacity"] = "service-default-capacity";
38
- TestIds["serviceRaw"] = "service-raw";
39
- TestIds["serviceActionSelect"] = "service-action-select";
40
- TestIds["serviceActionAdd"] = "service-action-add";
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
- TestIds["servicePolicyLatestCancellationInMinutes"] = "service-policy-latest-cancellation-in-minutes";
44
- TestIds["servicePolicyLatestBookingInMinutes"] = "service-policy-latest-booking-in-minutes";
45
- TestIds["servicePolicyEarliestBookingInMinutes"] = "service-policy-earliest-booking-in-minutes";
46
- TestIds["servicePolicyLatestRescheduleInMinutes"] = "service-policy-latest-reschedule-in-minutes";
47
- TestIds["servicePolicyWaitlistCapacity"] = "service-policy-waitlist-capacity";
48
- TestIds["servicePolicyBookAfterStartEnabled"] = "service-policy-book-after-start-enabled";
49
- TestIds["servicePolicyMaxParticipantsPerBooking"] = "service-policy-max-participants-per-booking";
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
- TestIds["serviceScheduleFirstSessionStart"] = "service-schedule-first-session-start";
52
- TestIds["serviceScheduleLastSessionEnd"] = "service-schedule-last-session-end";
53
- TestIds["serviceScheduleSessionDuration"] = "service-schedule-session-duration";
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
- TestIds["serviceAvailableOnline"] = "service-available-online";
56
- })(TestIds || (TestIds = {}));
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, className } = props;
152
- return (_jsx(CoreService.Info, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceName, customElement: children, customElementProps: { name }, children: _jsx("span", { children: name }) })) }));
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, className } = props;
172
- return (_jsx(CoreService.Info, { children: ({ description }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceDescription, customElement: children, customElementProps: { description }, children: _jsx("div", { children: description }) })) }));
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, className } = props;
265
- return (_jsx(CoreService.Info, { children: ({ tagline }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceTagline, customElement: children, customElementProps: { tagline }, children: tagline ? _jsx("p", { children: tagline }) : null })) }));
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, className } = props;
299
+ const { asChild, children, ...rest } = props;
301
300
  return (_jsx(CoreService.Info, { children: ({ duration }) => {
302
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceDurationInMinutes, customElement: children, customElementProps: { duration }, children: duration ? _jsx("span", { children: duration }) : null }));
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, className } = props;
341
- return (_jsx(CoreService.Info, { children: ({ type }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceType, customElement: children, customElementProps: { type }, children: type ? _jsx("span", { children: type }) : null })) }));
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, className } = props;
381
- return (_jsx(CoreService.Info, { children: ({ category }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.serviceCategory, customElement: children, customElementProps: { category }, children: category?.name ? _jsx("span", { children: category.name }) : null })) }));
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, ...attributes } = props;
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, { ...attributes, asChild: asChild, className: className, "data-testid": TestIds.serviceLocations, customElement: children, children: _jsx("div", { children: children }) }) }));
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, ...attributes } = props;
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, { ...attributes, asChild: asChild, className: className, "data-testid": TestIds.serviceStaffMembers, customElement: children, children: _jsx("div", { children: children }) }) }));
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, ...buttonProps } = props;
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", { ...buttonProps, onClick: handleClick, disabled: !bookable, "data-testid": TestIds.serviceActionSelect, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, children: children || label }) }));
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, ...buttonProps } = props;
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", { ...buttonProps, onClick: handleClick, disabled: isDisabled, "data-testid": TestIds.serviceActionAdd, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, children: children || label }) }));
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, ...buttonProps } = props;
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", { ...buttonProps, onClick: handleClick, disabled: isDisabled, "data-testid": TestIds.serviceActionRemove, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, children: children || label }) }));
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, className } = props;
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, className: className, "data-testid": TestIds.serviceDefaultCapacity, customElement: children, customElementProps: { defaultCapacity, isClassOrCourse }, children: isClassOrCourse && defaultCapacity ? (_jsxs("span", { children: ["Max ", defaultCapacity, " participants"] })) : null }));
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, className, label } = props;
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, className: className, "data-testid": TestIds.serviceAvailableOnline, customElement: children, customElementProps: { availableOnline }, children: availableOnline && label ? _jsx("span", { children: label }) : null }));
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
- var TestIds;
12
- (function (TestIds) {
13
- TestIds["serviceMediaMain"] = "service-media-main";
14
- TestIds["serviceMediaCover"] = "service-media-cover";
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
- var TestIds;
14
- (function (TestIds) {
15
- TestIds["serviceListRoot"] = "service-list-root";
16
- TestIds["serviceListServices"] = "service-list-services";
17
- TestIds["serviceListService"] = "service-list-service";
18
- TestIds["serviceListLoadMore"] = "service-list-load-more";
19
- TestIds["serviceListFilter"] = "service-list-filter";
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 enum TestIds {
12
- staffMemberRoot = "staff-member-root",
13
- staffMemberName = "staff-member-name",
14
- staffMemberRaw = "staff-member-raw",
15
- staffMemberActionSelect = "staff-member-action-select"
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 var TestIds;
17
- (function (TestIds) {
18
- TestIds["staffMemberRoot"] = "staff-member-root";
19
- TestIds["staffMemberName"] = "staff-member-name";
20
- TestIds["staffMemberRaw"] = "staff-member-raw";
21
- TestIds["staffMemberActionSelect"] = "staff-member-action-select";
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, className, ...attrs } = props;
76
+ const { asChild, children, ...rest } = props;
78
77
  const { name } = useStaffMemberContext();
79
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.staffMemberName, customElement: children, customElementProps: { name }, ...attrs, children: name ? _jsx("span", { children: name }) : null }));
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, ...buttonProps } = props;
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", { ...buttonProps, onClick: handleClick, children: children || label }) }));
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
- export declare enum TestIds {
13
- staffMemberListRoot = "staff-member-list-root",
14
- staffMemberListStaffMembers = "staff-member-list-staff-members",
15
- staffMemberListStaffMember = "staff-member-list-staff-member",
16
- staffMemberListActionClear = "staff-member-list-action-clear"
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.
@@ -8,22 +8,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import React from 'react';
9
9
  import { GenericList, } from '@wix/headless-components/react';
10
10
  import { AsChildSlot } from '@wix/headless-utils/react';
11
- import { useService } from '@wix/services-manager-react';
12
- import { BookingServiceDefinition } from '../../services/booking/booking.js';
13
11
  import * as CoreStaffMemberList from '../core/staff-member-list/StaffMemberList.js';
14
12
  import * as StaffMember from './StaffMember.js';
15
13
  /** Resource type ID for staff members */
16
- const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
17
14
  // ============================================================================
18
15
  // TestIds
19
16
  // ============================================================================
20
- export var TestIds;
21
- (function (TestIds) {
22
- TestIds["staffMemberListRoot"] = "staff-member-list-root";
23
- TestIds["staffMemberListStaffMembers"] = "staff-member-list-staff-members";
24
- TestIds["staffMemberListStaffMember"] = "staff-member-list-staff-member";
25
- TestIds["staffMemberListActionClear"] = "staff-member-list-action-clear";
26
- })(TestIds || (TestIds = {}));
17
+ export const TestIds = {
18
+ staffMemberListRoot: 'staff-member-list-root',
19
+ staffMemberListStaffMembers: 'staff-member-list-staff-members',
20
+ staffMemberListStaffMember: 'staff-member-list-staff-member',
21
+ staffMemberListActionClear: 'staff-member-list-action-clear',
22
+ staffMemberListTotals: 'staff-member-list-totals',
23
+ };
27
24
  /**
28
25
  * Root component that provides the StaffMemberList service context for rendering staff member lists.
29
26
  *
@@ -110,10 +107,10 @@ StaffMemberRepeater.displayName = 'StaffMemberList.StaffMemberRepeater';
110
107
  * ```
111
108
  */
112
109
  export const Totals = React.forwardRef((props, ref) => {
113
- const { asChild, children, className, ...attrs } = props;
110
+ const { asChild, children, ...rest } = props;
114
111
  return (_jsx(CoreStaffMemberList.StaffMembers, { children: ({ staffMembers, hasStaffMembers }) => {
115
112
  const count = staffMembers.length;
116
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { count, hasStaffMembers }, ...attrs, children: _jsx("span", { children: count }) }));
113
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.staffMemberListTotals, customElement: children, customElementProps: { count, hasStaffMembers }, children: _jsx("span", { children: count }) }));
117
114
  } }));
118
115
  });
119
116
  Totals.displayName = 'StaffMemberList.Totals';
@@ -147,22 +144,15 @@ Totals.displayName = 'StaffMemberList.Totals';
147
144
  * ```
148
145
  */
149
146
  const Clear = React.forwardRef((props, ref) => {
150
- const { asChild, children, className, label, onClick, ...buttonProps } = props;
151
- return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember }) => {
152
- let bookingService = null;
153
- try {
154
- bookingService = useService(BookingServiceDefinition);
155
- }
156
- catch {
157
- // BookingService not available - likely no ServiceManagerProvider
158
- }
147
+ const { asChild, children, className, label, onClick, ...rest } = props;
148
+ return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember, clear }) => {
159
149
  const handleClick = () => {
160
- bookingService?.actions.clearResourceByType(STAFF_MEMBER_RESOURCE_TYPE_ID);
150
+ clear();
161
151
  onClick?.(selectedStaffMember);
162
152
  };
163
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.staffMemberListActionClear, customElement: children, customElementProps: {
153
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.staffMemberListActionClear, customElement: children, customElementProps: {
164
154
  onClick: handleClick,
165
- }, children: _jsx("button", { ...buttonProps, onClick: handleClick, children: children || label }) }));
155
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
166
156
  } }));
167
157
  });
168
158
  Clear.displayName = 'StaffMemberList.Actions.Clear';
@@ -34,18 +34,18 @@ export interface RootProps {
34
34
  * ```
35
35
  */
36
36
  export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement>>;
37
- export declare enum TestIds {
38
- timeSlotStartDate = "time-slot-start-date",
39
- timeSlotEndDate = "time-slot-end-date",
40
- timeSlotDuration = "time-slot-duration",
41
- timeSlotActionSelect = "time-slot-action-select",
42
- timeSlotActionClearStaffSelection = "time-slot-action-clear-staff-selection",
43
- timeSlotLocationName = "time-slot-location-name",
44
- timeSlotStaffMembers = "time-slot-staff-members",
45
- timeSlotStaffMember = "time-slot-staff-member",
46
- timeSlotStaffMemberName = "time-slot-staff-member-name",
47
- timeSlotStaffMemberActionSelect = "time-slot-staff-member-action-select"
48
- }
37
+ export declare const TestIds: {
38
+ readonly timeSlotStartDate: "time-slot-start-date";
39
+ readonly timeSlotEndDate: "time-slot-end-date";
40
+ readonly timeSlotDuration: "time-slot-duration";
41
+ readonly timeSlotActionSelect: "time-slot-action-select";
42
+ readonly timeSlotActionClearStaffSelection: "time-slot-action-clear-staff-selection";
43
+ readonly timeSlotLocationName: "time-slot-location-name";
44
+ readonly timeSlotStaffMembers: "time-slot-staff-members";
45
+ readonly timeSlotStaffMember: "time-slot-staff-member";
46
+ readonly timeSlotStaffMemberName: "time-slot-staff-member-name";
47
+ readonly timeSlotStaffMemberActionSelect: "time-slot-staff-member-action-select";
48
+ };
49
49
  /**
50
50
  * Props for TimeSlot.StartDate component.
51
51
  * Inherits formatting options from DateData (dateTimeFormatOptions, locale).
@@ -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.