@wix/headless-bookings 0.0.93 → 0.0.95

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 (91) 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/__mocks__/time-slots.js +0 -1
  4. package/cjs/dist/api/fetch-availability/index.js +3 -3
  5. package/cjs/dist/api/query-services/index.js +1 -4
  6. package/cjs/dist/react/booking/Book.d.ts +3 -0
  7. package/cjs/dist/react/booking/Book.js +5 -6
  8. package/cjs/dist/react/booking/Booking.d.ts +10 -0
  9. package/cjs/dist/react/booking/Booking.js +10 -11
  10. package/cjs/dist/react/booking/BookingItem.d.ts +5 -0
  11. package/cjs/dist/react/booking/BookingItem.js +5 -6
  12. package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -0
  13. package/cjs/dist/react/booking-form/BookingForm.js +7 -8
  14. package/cjs/dist/react/core/staff-member/StaffMember.js +1 -2
  15. package/cjs/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
  16. package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
  17. package/cjs/dist/react/location/Location.d.ts +10 -0
  18. package/cjs/dist/react/location/Location.js +12 -13
  19. package/cjs/dist/react/location/LocationList.d.ts +7 -0
  20. package/cjs/dist/react/location/LocationList.js +9 -10
  21. package/cjs/dist/react/payment/Payment.d.ts +14 -0
  22. package/cjs/dist/react/payment/Payment.js +14 -15
  23. package/cjs/dist/react/service/Service.d.ts +33 -0
  24. package/cjs/dist/react/service/Service.js +39 -40
  25. package/cjs/dist/react/service/ServiceMedia.d.ts +4 -0
  26. package/cjs/dist/react/service/ServiceMedia.js +4 -5
  27. package/cjs/dist/react/service-list/ServiceList.d.ts +7 -0
  28. package/cjs/dist/react/service-list/ServiceList.js +7 -8
  29. package/cjs/dist/react/staff-member/StaffMember.d.ts +6 -6
  30. package/cjs/dist/react/staff-member/StaffMember.js +8 -9
  31. package/cjs/dist/react/staff-member/StaffMemberList.d.ts +8 -7
  32. package/cjs/dist/react/staff-member/StaffMemberList.js +11 -22
  33. package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +12 -12
  34. package/cjs/dist/react/time-slot-list/TimeSlot.js +18 -19
  35. package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +9 -9
  36. package/cjs/dist/react/time-slot-list/TimeSlotList.js +9 -10
  37. package/cjs/dist/services/booking/book-action/buildBookingRequest.js +1 -2
  38. package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
  39. package/cjs/dist/services/constants.d.ts +9 -0
  40. package/cjs/dist/services/constants.js +9 -0
  41. package/cjs/dist/services/payment/payment.js +2 -5
  42. package/cjs/dist/services/service/service.js +1 -1
  43. package/cjs/dist/services/service-list/service-list.js +1 -4
  44. package/cjs/dist/services/time-slot-list/time-slot-list.def.d.ts +0 -1
  45. package/cjs/dist/services/time-slot-list/time-slot-list.js +1 -2
  46. package/dist/__mocks__/services.d.ts +0 -4
  47. package/dist/__mocks__/services.js +1 -4
  48. package/dist/__mocks__/time-slots.js +0 -1
  49. package/dist/api/fetch-availability/index.js +3 -3
  50. package/dist/api/query-services/index.js +1 -4
  51. package/dist/react/booking/Book.d.ts +3 -0
  52. package/dist/react/booking/Book.js +5 -6
  53. package/dist/react/booking/Booking.d.ts +10 -0
  54. package/dist/react/booking/Booking.js +10 -11
  55. package/dist/react/booking/BookingItem.d.ts +5 -0
  56. package/dist/react/booking/BookingItem.js +5 -6
  57. package/dist/react/booking-form/BookingForm.d.ts +5 -0
  58. package/dist/react/booking-form/BookingForm.js +7 -8
  59. package/dist/react/core/staff-member/StaffMember.js +1 -2
  60. package/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
  61. package/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
  62. package/dist/react/location/Location.d.ts +10 -0
  63. package/dist/react/location/Location.js +12 -13
  64. package/dist/react/location/LocationList.d.ts +7 -0
  65. package/dist/react/location/LocationList.js +9 -10
  66. package/dist/react/payment/Payment.d.ts +14 -0
  67. package/dist/react/payment/Payment.js +14 -15
  68. package/dist/react/service/Service.d.ts +33 -0
  69. package/dist/react/service/Service.js +39 -40
  70. package/dist/react/service/ServiceMedia.d.ts +4 -0
  71. package/dist/react/service/ServiceMedia.js +4 -5
  72. package/dist/react/service-list/ServiceList.d.ts +7 -0
  73. package/dist/react/service-list/ServiceList.js +7 -8
  74. package/dist/react/staff-member/StaffMember.d.ts +6 -6
  75. package/dist/react/staff-member/StaffMember.js +8 -9
  76. package/dist/react/staff-member/StaffMemberList.d.ts +8 -7
  77. package/dist/react/staff-member/StaffMemberList.js +11 -22
  78. package/dist/react/time-slot-list/TimeSlot.d.ts +12 -12
  79. package/dist/react/time-slot-list/TimeSlot.js +18 -19
  80. package/dist/react/time-slot-list/TimeSlotList.d.ts +9 -9
  81. package/dist/react/time-slot-list/TimeSlotList.js +9 -10
  82. package/dist/services/booking/book-action/buildBookingRequest.js +1 -2
  83. package/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
  84. package/dist/services/constants.d.ts +9 -0
  85. package/dist/services/constants.js +9 -0
  86. package/dist/services/payment/payment.js +2 -5
  87. package/dist/services/service/service.js +1 -1
  88. package/dist/services/service-list/service-list.js +1 -4
  89. package/dist/services/time-slot-list/time-slot-list.def.d.ts +0 -1
  90. package/dist/services/time-slot-list/time-slot-list.js +1 -2
  91. 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:
@@ -624,14 +623,14 @@ export var Actions;
624
623
  select();
625
624
  onClick?.(rawService);
626
625
  };
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: {
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", { children: children || label }) }));
633
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
635
634
  } }));
636
635
  });
637
636
  Actions.Select.displayName = 'Service.Actions.Select';
@@ -673,14 +672,14 @@ export var Actions;
673
672
  add();
674
673
  onClick?.(rawService);
675
674
  };
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: {
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", { children: children || label }) }));
682
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
684
683
  } }));
685
684
  });
686
685
  Actions.Add.displayName = 'Service.Actions.Add';
@@ -722,14 +721,14 @@ export var Actions;
722
721
  remove();
723
722
  onClick?.(rawService);
724
723
  };
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: {
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", { children: children || label }) }));
731
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
733
732
  } }));
734
733
  });
735
734
  Actions.Remove.displayName = 'Service.Actions.Remove';
@@ -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
@@ -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
  // ==========================================
@@ -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, ...rest, className: className, onClick: handleClick, "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", { children: children || label }) }));
137
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
139
138
  } }));
140
139
  });
141
140
  Select.displayName = 'StaffMember.Actions.Select';
@@ -9,13 +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
- staffMemberListTotals = "staff-member-list-totals"
18
- }
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
+ };
19
20
  /**
20
21
  * Props for the StaffMemberList root component
21
22
  */
@@ -8,23 +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["staffMemberListTotals"] = "staff-member-list-totals";
27
- })(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
+ };
28
24
  /**
29
25
  * Root component that provides the StaffMemberList service context for rendering staff member lists.
30
26
  *
@@ -149,21 +145,14 @@ Totals.displayName = 'StaffMemberList.Totals';
149
145
  */
150
146
  const Clear = React.forwardRef((props, ref) => {
151
147
  const { asChild, children, className, label, onClick, ...rest } = props;
152
- return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember }) => {
153
- let bookingService = null;
154
- try {
155
- bookingService = useService(BookingServiceDefinition);
156
- }
157
- catch {
158
- // BookingService not available - likely no ServiceManagerProvider
159
- }
148
+ return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember, clear }) => {
160
149
  const handleClick = () => {
161
- bookingService?.actions.clearResourceByType(STAFF_MEMBER_RESOURCE_TYPE_ID);
150
+ clear();
162
151
  onClick?.(selectedStaffMember);
163
152
  };
164
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "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: {
165
154
  onClick: handleClick,
166
- }, children: _jsx("button", { children: children || label }) }));
155
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
167
156
  } }));
168
157
  });
169
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).
@@ -31,21 +31,20 @@ Root.displayName = 'TimeSlot.Root';
31
31
  // ============================================================================
32
32
  // TestIds
33
33
  // ============================================================================
34
- export var TestIds;
35
- (function (TestIds) {
36
- TestIds["timeSlotStartDate"] = "time-slot-start-date";
37
- TestIds["timeSlotEndDate"] = "time-slot-end-date";
38
- TestIds["timeSlotDuration"] = "time-slot-duration";
39
- TestIds["timeSlotActionSelect"] = "time-slot-action-select";
40
- TestIds["timeSlotActionClearStaffSelection"] = "time-slot-action-clear-staff-selection";
34
+ export const TestIds = {
35
+ timeSlotStartDate: 'time-slot-start-date',
36
+ timeSlotEndDate: 'time-slot-end-date',
37
+ timeSlotDuration: 'time-slot-duration',
38
+ timeSlotActionSelect: 'time-slot-action-select',
39
+ timeSlotActionClearStaffSelection: 'time-slot-action-clear-staff-selection',
41
40
  // Location component
42
- TestIds["timeSlotLocationName"] = "time-slot-location-name";
41
+ timeSlotLocationName: 'time-slot-location-name',
43
42
  // StaffMember components
44
- TestIds["timeSlotStaffMembers"] = "time-slot-staff-members";
45
- TestIds["timeSlotStaffMember"] = "time-slot-staff-member";
46
- TestIds["timeSlotStaffMemberName"] = "time-slot-staff-member-name";
47
- TestIds["timeSlotStaffMemberActionSelect"] = "time-slot-staff-member-action-select";
48
- })(TestIds || (TestIds = {}));
43
+ timeSlotStaffMembers: 'time-slot-staff-members',
44
+ timeSlotStaffMember: 'time-slot-staff-member',
45
+ timeSlotStaffMemberName: 'time-slot-staff-member-name',
46
+ timeSlotStaffMemberActionSelect: 'time-slot-staff-member-action-select',
47
+ };
49
48
  /**
50
49
  * Displays the time slot start time.
51
50
  * Default formatting shows time as "10:00 AM" (hour:minute with AM/PM).
@@ -181,13 +180,13 @@ export const Select = React.forwardRef((props, ref) => {
181
180
  selectTimeSlot();
182
181
  onClick?.(timeSlot);
183
182
  };
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: {
183
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: !bookable, "data-testid": TestIds.timeSlotActionSelect, "data-selected": isSelected, "data-bookable": bookable, customElement: children, customElementProps: {
185
184
  onClick: handleClick,
186
185
  disabled: !bookable,
187
186
  isSelected,
188
187
  bookable,
189
188
  timeSlot,
190
- }, children: _jsx("button", { children: children || label }) }));
189
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
191
190
  } }));
192
191
  });
193
192
  Select.displayName = 'TimeSlot.Actions.Select';
@@ -231,9 +230,9 @@ export const ClearStaffSelection = React.forwardRef((props, ref) => {
231
230
  clearStaffSelection();
232
231
  onClick?.(timeSlot);
233
232
  };
234
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.timeSlotActionClearStaffSelection, customElement: children, customElementProps: {
233
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.timeSlotActionClearStaffSelection, customElement: children, customElementProps: {
235
234
  onClick: handleClick,
236
- }, children: _jsx("button", { children: children || label }) }));
235
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
237
236
  } }));
238
237
  });
239
238
  ClearStaffSelection.displayName = 'TimeSlot.Actions.ClearStaffSelection';
@@ -385,11 +384,11 @@ export const SelectStaffMember = React.forwardRef((props, ref) => {
385
384
  selectStaffMember();
386
385
  onClick?.(staffMember);
387
386
  };
388
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.timeSlotStaffMemberActionSelect, "data-selected": isSelected, customElement: children, customElementProps: {
387
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.timeSlotStaffMemberActionSelect, "data-selected": isSelected, customElement: children, customElementProps: {
389
388
  onClick: handleClick,
390
389
  isSelected,
391
390
  staffMember,
392
- }, children: _jsx("button", { children: children || label }) }));
391
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
393
392
  } }));
394
393
  });
395
394
  SelectStaffMember.displayName = 'TimeSlot.StaffMember.Actions.Select';
@@ -10,15 +10,15 @@ export type { StartDateProps as TimeSlotStartDateProps, EndDateProps as TimeSlot
10
10
  /**
11
11
  * TimeSlot with required id field for GenericList
12
12
  */
13
- export declare enum TestIds {
14
- timeSlotListRoot = "time-slot-list-root",
15
- timeSlotListTimeSlots = "time-slot-list-time-slots",
16
- timeSlotListTimeSlot = "time-slot-list-time-slot",
17
- timeSlotListTimezone = "time-slot-list-timezone",
18
- timeSlotListLoadMore = "time-slot-list-load-more",
19
- timeSlotListContinue = "time-slot-list-continue",
20
- timeSlotListDateRangeInput = "time-slot-list-date-range-input"
21
- }
13
+ export declare const TestIds: {
14
+ readonly timeSlotListRoot: "time-slot-list-root";
15
+ readonly timeSlotListTimeSlots: "time-slot-list-time-slots";
16
+ readonly timeSlotListTimeSlot: "time-slot-list-time-slot";
17
+ readonly timeSlotListTimezone: "time-slot-list-timezone";
18
+ readonly timeSlotListLoadMore: "time-slot-list-load-more";
19
+ readonly timeSlotListContinue: "time-slot-list-continue";
20
+ readonly timeSlotListDateRangeInput: "time-slot-list-date-range-input";
21
+ };
22
22
  /**
23
23
  * Render props for TimeSlotList.Timezone component
24
24
  */
@@ -32,16 +32,15 @@ function toISODateString(date, timezone) {
32
32
  /**
33
33
  * TimeSlot with required id field for GenericList
34
34
  */
35
- export var TestIds;
36
- (function (TestIds) {
37
- TestIds["timeSlotListRoot"] = "time-slot-list-root";
38
- TestIds["timeSlotListTimeSlots"] = "time-slot-list-time-slots";
39
- TestIds["timeSlotListTimeSlot"] = "time-slot-list-time-slot";
40
- TestIds["timeSlotListTimezone"] = "time-slot-list-timezone";
41
- TestIds["timeSlotListLoadMore"] = "time-slot-list-load-more";
42
- TestIds["timeSlotListContinue"] = "time-slot-list-continue";
43
- TestIds["timeSlotListDateRangeInput"] = "time-slot-list-date-range-input";
44
- })(TestIds || (TestIds = {}));
35
+ export const TestIds = {
36
+ timeSlotListRoot: 'time-slot-list-root',
37
+ timeSlotListTimeSlots: 'time-slot-list-time-slots',
38
+ timeSlotListTimeSlot: 'time-slot-list-time-slot',
39
+ timeSlotListTimezone: 'time-slot-list-timezone',
40
+ timeSlotListLoadMore: 'time-slot-list-load-more',
41
+ timeSlotListContinue: 'time-slot-list-continue',
42
+ timeSlotListDateRangeInput: 'time-slot-list-date-range-input',
43
+ };
45
44
  /**
46
45
  * Displays the current timezone with customizable rendering.
47
46
  *
@@ -3,8 +3,7 @@
3
3
  */
4
4
  import { LocationType as TimeSlotLocationType } from '@wix/auto_sdk_bookings_availability-time-slots';
5
5
  import { LocationType as BookingLocationType, SelectionMethod, } from '@wix/auto_sdk_bookings_bookings';
6
- /** Resource type ID for staff members */
7
- const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
6
+ import { STAFF_MEMBER_RESOURCE_TYPE_ID } from '../../constants.js';
8
7
  /**
9
8
  * Derives the selected payment option from service payment settings.
10
9
  * Maps service.payment.options to booking API's selectedPaymentOption.
@@ -2,7 +2,7 @@
2
2
  * Builds the createCheckout request
3
3
  */
4
4
  import { ChannelType, } from '../../../api/create-checkout/index.js';
5
- const BOOKINGS_APP_DEF_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
5
+ import { BOOKING_APP_ID } from '../../constants.js';
6
6
  /**
7
7
  * Builds a checkout request from the booking ID and contact details
8
8
  *
@@ -53,7 +53,7 @@ export function buildCheckoutRequest(params) {
53
53
  quantity: 1,
54
54
  catalogReference: {
55
55
  catalogItemId: bookingId,
56
- appId: BOOKINGS_APP_DEF_ID,
56
+ appId: BOOKING_APP_ID,
57
57
  },
58
58
  },
59
59
  ],
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shared constants for bookings services
3
+ *
4
+ * @module Services/Constants
5
+ */
6
+ /** Booking app definition ID */
7
+ export declare const BOOKING_APP_ID = "13d21c63-b5ec-5912-8397-c3a5ddb27a97";
8
+ /** Resource type ID for staff members */
9
+ export declare const STAFF_MEMBER_RESOURCE_TYPE_ID = "1cd44cf8-756f-41c3-bd90-3e2ffcaf1155";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shared constants for bookings services
3
+ *
4
+ * @module Services/Constants
5
+ */
6
+ /** Booking app definition ID */
7
+ export const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
8
+ /** Resource type ID for staff members */
9
+ export const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
@@ -11,10 +11,7 @@ import { RateType } from '@wix/auto_sdk_bookings_services';
11
11
  import { PaymentServiceDefinition, } from './payment.def.js';
12
12
  import { generateLineItemId } from '../../utils/guid.js';
13
13
  export { PaymentServiceDefinition, } from './payment.def.js';
14
- // ============================================================================
15
- // Constants
16
- // ============================================================================
17
- const BOOKINGS_APP_DEF_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
14
+ import { BOOKING_APP_ID } from '../constants.js';
18
15
  // ============================================================================
19
16
  // Helper Functions
20
17
  // ============================================================================
@@ -52,7 +49,7 @@ function buildLineItem(service, totalParticipants, lineItemId) {
52
49
  _id: lineItemId,
53
50
  catalogReference: {
54
51
  catalogItemId: service._id || '',
55
- appId: BOOKINGS_APP_DEF_ID,
52
+ appId: BOOKING_APP_ID,
56
53
  },
57
54
  price: String(price),
58
55
  ...(deposit ? { depositAmount: String(deposit) } : {}),
@@ -11,7 +11,7 @@ import { convertToMoneyData } from '../../utils/money.js';
11
11
  /**
12
12
  * Booking app ID constant
13
13
  */
14
- const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
14
+ import { BOOKING_APP_ID } from '../constants.js';
15
15
  /**
16
16
  * Service definition for the Service service.
17
17
  * This defines the contract that the ServiceService must implement.
@@ -7,10 +7,7 @@ import { SignalsServiceDefinition, } from '@wix/services-definitions/core-servic
7
7
  import { queryServices } from '../../api/query-services/index.js';
8
8
  import { queryCategories, } from '../../api/query-categories/index.js';
9
9
  import { BookingServiceDefinition } from '../booking/booking.js';
10
- /**
11
- * Booking app ID constant
12
- */
13
- const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
10
+ import { BOOKING_APP_ID } from '../constants.js';
14
11
  /**
15
12
  * Default query limit
16
13
  */
@@ -88,7 +88,6 @@ export interface TimeSlotListServiceAPI {
88
88
  hasMore: Signal<boolean>;
89
89
  dateRange: Signal<DateRange>;
90
90
  actions: TimeSlotListServiceActions;
91
- dispose: () => void;
92
91
  }
93
92
  export declare const TimeSlotListServiceDefinition: string & {
94
93
  __api: TimeSlotListServiceAPI;