@wix/headless-bookings 0.0.89 → 0.0.91

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 (39) hide show
  1. package/cjs/dist/react/booking/Book.d.ts +11 -19
  2. package/cjs/dist/react/booking/Book.js +17 -13
  3. package/cjs/dist/react/booking/Booking.d.ts +1 -1
  4. package/cjs/dist/react/booking/Booking.js +1 -1
  5. package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -2
  6. package/cjs/dist/react/booking-form/BookingForm.js +3 -2
  7. package/cjs/dist/react/location/Location.d.ts +3 -4
  8. package/cjs/dist/react/location/Location.js +6 -6
  9. package/cjs/dist/react/location/LocationList.d.ts +2 -4
  10. package/cjs/dist/react/location/LocationList.js +22 -15
  11. package/cjs/dist/react/service/Service.d.ts +18 -33
  12. package/cjs/dist/react/service/Service.js +20 -33
  13. package/cjs/dist/react/staff-member/StaffMember.d.ts +9 -4
  14. package/cjs/dist/react/staff-member/StaffMember.js +7 -7
  15. package/cjs/dist/react/staff-member/StaffMemberList.d.ts +9 -4
  16. package/cjs/dist/react/staff-member/StaffMemberList.js +23 -16
  17. package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +17 -21
  18. package/cjs/dist/react/time-slot-list/TimeSlot.js +18 -22
  19. package/cjs/dist/services/booking/book-action/types.d.ts +3 -3
  20. package/dist/react/booking/Book.d.ts +11 -19
  21. package/dist/react/booking/Book.js +17 -13
  22. package/dist/react/booking/Booking.d.ts +1 -1
  23. package/dist/react/booking/Booking.js +1 -1
  24. package/dist/react/booking-form/BookingForm.d.ts +5 -2
  25. package/dist/react/booking-form/BookingForm.js +3 -2
  26. package/dist/react/location/Location.d.ts +3 -4
  27. package/dist/react/location/Location.js +6 -6
  28. package/dist/react/location/LocationList.d.ts +2 -4
  29. package/dist/react/location/LocationList.js +22 -15
  30. package/dist/react/service/Service.d.ts +18 -33
  31. package/dist/react/service/Service.js +20 -33
  32. package/dist/react/staff-member/StaffMember.d.ts +9 -4
  33. package/dist/react/staff-member/StaffMember.js +7 -7
  34. package/dist/react/staff-member/StaffMemberList.d.ts +9 -4
  35. package/dist/react/staff-member/StaffMemberList.js +23 -16
  36. package/dist/react/time-slot-list/TimeSlot.d.ts +17 -21
  37. package/dist/react/time-slot-list/TimeSlot.js +18 -22
  38. package/dist/services/booking/book-action/types.d.ts +3 -3
  39. package/package.json +5 -5
@@ -159,11 +159,9 @@ Duration.displayName = 'TimeSlot.Duration';
159
159
  * <button className="btn-primary">Book this slot</button>
160
160
  * </TimeSlot.Actions.Select>
161
161
  *
162
- * // With onClicked callback for navigation
162
+ * // With onClick callback
163
163
  * <TimeSlot.Actions.Select
164
- * onClicked={(timeSlot) => {
165
- * router.push(`/booking/confirm/${timeSlot.localStartDate}`);
166
- * }}
164
+ * onClick={() => router.push('/booking/confirm')}
167
165
  * />
168
166
  *
169
167
  * // Using render prop pattern
@@ -177,18 +175,19 @@ Duration.displayName = 'TimeSlot.Duration';
177
175
  * ```
178
176
  */
179
177
  export const Select = React.forwardRef((props, ref) => {
180
- const { asChild, children, className, label = 'Select', onClicked } = props;
181
- return (_jsx(CoreTimeSlot.Actions, { children: ({ selectTimeSlot, isSelected, bookable, timeSlot }) => {
178
+ const { asChild, children, className, label, onClick, ...buttonProps } = props;
179
+ return (_jsx(CoreTimeSlot.Actions, { children: ({ selectTimeSlot, timeSlot, isSelected, bookable }) => {
182
180
  const handleClick = () => {
183
181
  selectTimeSlot();
184
- onClicked?.(timeSlot);
182
+ onClick?.(timeSlot);
185
183
  };
186
184
  return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotActionSelect, "data-selected": isSelected, "data-bookable": bookable, customElement: children, customElementProps: {
187
185
  onClick: handleClick,
188
186
  disabled: !bookable,
189
187
  isSelected,
190
188
  bookable,
191
- }, children: _jsx("button", { onClick: handleClick, disabled: !bookable, children: children || label }) }));
189
+ timeSlot,
190
+ }, children: _jsx("button", { ...buttonProps, onClick: handleClick, disabled: !bookable, children: children || label }) }));
192
191
  } }));
193
192
  });
194
193
  Select.displayName = 'TimeSlot.Actions.Select';
@@ -211,11 +210,9 @@ Select.displayName = 'TimeSlot.Actions.Select';
211
210
  * <button className="btn-secondary">Clear staff</button>
212
211
  * </TimeSlot.Actions.ClearStaffSelection>
213
212
  *
214
- * // With onClicked callback
213
+ * // With onClick callback
215
214
  * <TimeSlot.Actions.ClearStaffSelection
216
- * onClicked={(timeSlot) => {
217
- * console.log('Staff selection cleared for', timeSlot.localStartDate);
218
- * }}
215
+ * onClick={() => console.log('Staff selection cleared')}
219
216
  * />
220
217
  *
221
218
  * // Using render prop pattern
@@ -225,18 +222,18 @@ Select.displayName = 'TimeSlot.Actions.Select';
225
222
  * ```
226
223
  */
227
224
  export const ClearStaffSelection = React.forwardRef((props, ref) => {
228
- const { asChild, children, className, label = 'Change', onClicked } = props;
225
+ const { asChild, children, className, label, onClick, ...buttonProps } = props;
229
226
  return (_jsx(CoreTimeSlot.Actions, { children: ({ clearStaffSelection, timeSlot }) => {
230
227
  if (!clearStaffSelection) {
231
228
  return null;
232
229
  }
233
230
  const handleClick = () => {
234
231
  clearStaffSelection();
235
- onClicked?.(timeSlot);
232
+ onClick?.(timeSlot);
236
233
  };
237
234
  return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotActionClearStaffSelection, customElement: children, customElementProps: {
238
235
  onClick: handleClick,
239
- }, children: _jsx("button", { onClick: handleClick, children: label }) }));
236
+ }, children: _jsx("button", { ...buttonProps, onClick: handleClick, children: children || label }) }));
240
237
  } }));
241
238
  });
242
239
  ClearStaffSelection.displayName = 'TimeSlot.Actions.ClearStaffSelection';
@@ -366,11 +363,9 @@ StaffMemberName.displayName = 'TimeSlot.StaffMember.Name';
366
363
  * <button className="btn-primary">Choose Staff</button>
367
364
  * </TimeSlot.StaffMember.Actions.Select>
368
365
  *
369
- * // With onClicked callback
366
+ * // With onClick callback
370
367
  * <TimeSlot.StaffMember.Actions.Select
371
- * onClicked={(staffMember) => {
372
- * console.log('Selected staff:', staffMember.name);
373
- * }}
368
+ * onClick={() => console.log('Staff selected')}
374
369
  * />
375
370
  *
376
371
  * // Using render prop pattern
@@ -384,16 +379,17 @@ StaffMemberName.displayName = 'TimeSlot.StaffMember.Name';
384
379
  * ```
385
380
  */
386
381
  export const SelectStaffMember = React.forwardRef((props, ref) => {
387
- const { asChild, children, className, label = 'Select', onClicked } = props;
382
+ const { asChild, children, className, label, onClick, ...buttonProps } = props;
388
383
  return (_jsx(CoreTimeSlot.StaffMemberActions, { children: ({ selectStaffMember, isSelected, staffMember }) => {
389
384
  const handleClick = () => {
390
385
  selectStaffMember();
391
- onClicked?.(staffMember);
386
+ onClick?.(staffMember);
392
387
  };
393
388
  return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotStaffMemberActionSelect, "data-selected": isSelected, customElement: children, customElementProps: {
394
389
  onClick: handleClick,
395
390
  isSelected,
396
- }, children: _jsx("button", { onClick: handleClick, children: label }) }));
391
+ staffMember,
392
+ }, children: _jsx("button", { ...buttonProps, onClick: handleClick, children: children || label }) }));
397
393
  } }));
398
394
  });
399
395
  SelectStaffMember.displayName = 'TimeSlot.StaffMember.Actions.Select';
@@ -62,9 +62,9 @@ export interface BookProps {
62
62
  * The navigateToCheckout function has the checkoutId captured - just call it.
63
63
  * When navigateToCheckout is called, the button will show loading state until navigation completes.
64
64
  */
65
- onCheckout?: (result: {
66
- navigateToCheckout: () => Promise<void>;
67
- }) => void;
65
+ onCheckout?: (navigateToCheckout: (options: {
66
+ postFlowUrl: string;
67
+ }) => Promise<void>) => void;
68
68
  /**
69
69
  * Called when booking completes without requiring checkout (free/offline services).
70
70
  * Receives the orderId which can be used to display confirmation or navigate to a thank you page.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.89",
3
+ "version": "0.0.91",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -37,11 +37,11 @@
37
37
  "@wix/auto_sdk_bookings_event-time-slots": "^1.0.64",
38
38
  "@wix/auto_sdk_ecom_checkout": "^1.0.104",
39
39
  "@wix/form-public": "^0.104.0",
40
- "@wix/headless-forms": "0.0.26",
41
- "@wix/headless-media": "0.0.19",
40
+ "@wix/headless-forms": "0.0.27",
41
+ "@wix/headless-media": "0.0.20",
42
42
  "@wix/headless-utils": "0.0.8",
43
43
  "@wix/services-definitions": "^1.0.1",
44
- "@wix/services-manager-react": "^1.0.2",
44
+ "@wix/services-manager-react": "^1.0.3",
45
45
  "date-fns": "^4.1.0"
46
46
  },
47
47
  "devDependencies": {
@@ -72,5 +72,5 @@
72
72
  "groupId": "com.wixpress.headless-components"
73
73
  }
74
74
  },
75
- "falconPackageHash": "57a07a8154bb7def020ba4429b5e58f59af1a8c7e7451b13e715d4a4"
75
+ "falconPackageHash": "a78e1dd86856b7de4c6810333ca39eddce83be25a76ac688d6b2981c"
76
76
  }