@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
@@ -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.
@@ -24,28 +24,27 @@ 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, ...attrs } = props;
28
- return (_jsx(CoreTimeSlot.Root, { config: { timeSlot }, children: _jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, ...attrs, children: 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
  // ============================================================================
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).
@@ -137,8 +136,8 @@ EndDate.displayName = 'TimeSlot.EndDate';
137
136
  * ```
138
137
  */
139
138
  export const Duration = React.forwardRef((props, ref) => {
140
- const { asChild, children, className } = props;
141
- return (_jsx(CoreTimeSlot.Info, { children: ({ durationInMinutes }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotDuration, customElement: children, customElementProps: { durationInMinutes }, children: _jsx("span", { children: durationInMinutes }) })) }));
139
+ const { asChild, children, ...rest } = props;
140
+ 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
141
  });
143
142
  Duration.displayName = 'TimeSlot.Duration';
144
143
  /**
@@ -175,19 +174,19 @@ Duration.displayName = 'TimeSlot.Duration';
175
174
  * ```
176
175
  */
177
176
  export const Select = React.forwardRef((props, ref) => {
178
- const { asChild, children, className, label, onClick, ...buttonProps } = props;
177
+ const { asChild, children, className, label, onClick, ...rest } = props;
179
178
  return (_jsx(CoreTimeSlot.Actions, { children: ({ selectTimeSlot, timeSlot, isSelected, bookable }) => {
180
179
  const handleClick = () => {
181
180
  selectTimeSlot();
182
181
  onClick?.(timeSlot);
183
182
  };
184
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "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", { ...buttonProps, onClick: handleClick, disabled: !bookable, children: children || label }) }));
189
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
191
190
  } }));
192
191
  });
193
192
  Select.displayName = 'TimeSlot.Actions.Select';
@@ -222,7 +221,7 @@ Select.displayName = 'TimeSlot.Actions.Select';
222
221
  * ```
223
222
  */
224
223
  export const ClearStaffSelection = React.forwardRef((props, ref) => {
225
- const { asChild, children, className, label, onClick, ...buttonProps } = props;
224
+ const { asChild, children, className, label, onClick, ...rest } = props;
226
225
  return (_jsx(CoreTimeSlot.Actions, { children: ({ clearStaffSelection, timeSlot }) => {
227
226
  if (!clearStaffSelection) {
228
227
  return null;
@@ -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, className: className, "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", { ...buttonProps, onClick: handleClick, children: children || label }) }));
235
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
237
236
  } }));
238
237
  });
239
238
  ClearStaffSelection.displayName = 'TimeSlot.Actions.ClearStaffSelection';
@@ -262,9 +261,9 @@ export const Actions = {
262
261
  * ```
263
262
  */
264
263
  export const LocationName = React.forwardRef((props, ref) => {
265
- const { asChild, children, className } = props;
264
+ const { asChild, children, ...rest } = props;
266
265
  return (_jsx(CoreTimeSlot.Info, { children: ({ locationName }) => {
267
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotLocationName, customElement: children, customElementProps: { name: locationName }, children: _jsx("span", { children: locationName }) }));
266
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.timeSlotLocationName, customElement: children, customElementProps: { name: locationName }, children: _jsx("span", { children: locationName }) }));
268
267
  } }));
269
268
  });
270
269
  LocationName.displayName = 'TimeSlot.Location.Name';
@@ -290,9 +289,9 @@ export const Location = {
290
289
  * ```
291
290
  */
292
291
  export const StaffMembers = React.forwardRef((props, ref) => {
293
- const { children, className } = props;
292
+ const { children, ...attrs } = props;
294
293
  return (_jsx(CoreTimeSlot.StaffMembers, { children: ({ staffMembers }) => {
295
- return (_jsx(GenericList.Root, { items: staffMembers, children: _jsx("div", { ref: ref, className: className, "data-testid": TestIds.timeSlotStaffMembers, children: children }) }));
294
+ return (_jsx(GenericList.Root, { items: staffMembers, children: _jsx("div", { ref: ref, ...attrs, "data-testid": TestIds.timeSlotStaffMembers, children: children }) }));
296
295
  } }));
297
296
  });
298
297
  StaffMembers.displayName = 'TimeSlot.StaffMembers';
@@ -341,8 +340,8 @@ StaffMemberRepeater.displayName = 'TimeSlot.StaffMemberRepeater';
341
340
  * ```
342
341
  */
343
342
  export const StaffMemberName = React.forwardRef((props, ref) => {
344
- const { asChild, children, className } = props;
345
- return (_jsx(CoreTimeSlot.StaffMemberInfo, { children: ({ name }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotStaffMemberName, customElement: children, customElementProps: { name }, children: _jsx("span", { children: name }) })) }));
343
+ const { asChild, children, ...rest } = props;
344
+ 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
345
  });
347
346
  StaffMemberName.displayName = 'TimeSlot.StaffMember.Name';
348
347
  /**
@@ -379,17 +378,17 @@ StaffMemberName.displayName = 'TimeSlot.StaffMember.Name';
379
378
  * ```
380
379
  */
381
380
  export const SelectStaffMember = React.forwardRef((props, ref) => {
382
- const { asChild, children, className, label, onClick, ...buttonProps } = props;
381
+ const { asChild, children, className, label, onClick, ...rest } = props;
383
382
  return (_jsx(CoreTimeSlot.StaffMemberActions, { children: ({ selectStaffMember, isSelected, staffMember }) => {
384
383
  const handleClick = () => {
385
384
  selectStaffMember();
386
385
  onClick?.(staffMember);
387
386
  };
388
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "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", { ...buttonProps, onClick: handleClick, 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
  */
@@ -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
@@ -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
  *
@@ -182,7 +181,7 @@ export const Actions = {
182
181
  * Uses the core DateRange component to access service data.
183
182
  * Both dates are set together and trigger a single fetch.
184
183
  *
185
- * Default rendering provides two native date inputs.
184
+ * Default rendering provides a native date input.
186
185
  *
187
186
  * @component
188
187
  * @example
@@ -203,18 +202,19 @@ export const Actions = {
203
202
  * ```
204
203
  */
205
204
  const DateRangeInput = React.forwardRef((props, ref) => {
206
- const { asChild, children, className, ...otherProps } = props;
205
+ const { asChild, children, className, onChange, ...rest } = props;
207
206
  return (_jsx(CoreTimeSlotList.DateRange, { children: ({ startDate, endDate, setDateRange, timezone }) => {
208
- const defaultContent = (_jsx("input", { ref: ref, type: "date", className: className, "data-testid": TestIds.timeSlotListDateRangeInput, value: toISODateString(startDate, timezone), required: true, onChange: (e) => {
209
- const date = parse(e.target.value, 'yyyy-MM-dd', new Date());
210
- setDateRange(startOfDay(date), endOfDay(date));
211
- } }));
212
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotListDateRangeInput, customElement: children, customElementProps: {
207
+ const handleChange = (e) => {
208
+ const date = parse(e.target.value, 'yyyy-MM-dd', new Date());
209
+ setDateRange(startOfDay(date), endOfDay(date));
210
+ onChange?.(e);
211
+ };
212
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onChange: handleChange, "data-testid": TestIds.timeSlotListDateRangeInput, customElement: children, customElementProps: {
213
213
  startDate,
214
214
  endDate,
215
215
  onChange: setDateRange,
216
216
  timezone,
217
- }, ...otherProps, children: defaultContent }));
217
+ }, children: _jsx("input", { ref: ref, type: "date", value: toISODateString(startDate, timezone) }) }));
218
218
  } }));
219
219
  });
220
220
  DateRangeInput.displayName = 'TimeSlotList.DateRange.Input';
@@ -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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -72,5 +72,5 @@
72
72
  "groupId": "com.wixpress.headless-components"
73
73
  }
74
74
  },
75
- "falconPackageHash": "341d5571c2edceebe571138968072317b3891fc724640ac721f6acff"
75
+ "falconPackageHash": "a055004ae2955e2870d942a6691942dad3c02119893d438fbb365661"
76
76
  }