@wix/headless-bookings 0.0.105 → 0.0.106

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 (76) hide show
  1. package/cjs/dist/__mocks__/booking/booking-client-service.js +25 -20
  2. package/cjs/dist/__mocks__/booking/booking-mocks.js +28 -20
  3. package/cjs/dist/__mocks__/payment/payment-mocks.js +6 -3
  4. package/cjs/dist/__mocks__/services/services-mocks.js +79 -74
  5. package/cjs/dist/__mocks__/time-slots/time-slots-client-service.js +39 -33
  6. package/cjs/dist/__mocks__/time-slots/time-slots-core.js +43 -33
  7. package/cjs/dist/__mocks__/time-slots/time-slots-mocks.js +18 -13
  8. package/cjs/dist/api/create-booking/index.js +6 -3
  9. package/cjs/dist/api/create-checkout/index.js +9 -4
  10. package/cjs/dist/api/create-order/index.js +6 -3
  11. package/cjs/dist/api/fetch-availability/index.js +18 -15
  12. package/cjs/dist/api/index.js +24 -7
  13. package/cjs/dist/api/query-categories/index.js +6 -3
  14. package/cjs/dist/api/query-locations/index.js +9 -5
  15. package/cjs/dist/api/query-services/index.js +24 -17
  16. package/cjs/dist/react/booking/Book.js +51 -12
  17. package/cjs/dist/react/booking/Booking.js +68 -26
  18. package/cjs/dist/react/booking/BookingItem.js +56 -15
  19. package/cjs/dist/react/booking-form/BookingForm.js +63 -21
  20. package/cjs/dist/react/core/booking/Book.js +14 -11
  21. package/cjs/dist/react/core/booking/Booking.js +35 -23
  22. package/cjs/dist/react/core/booking-form/BookingForm.js +63 -26
  23. package/cjs/dist/react/core/location/Location.js +60 -21
  24. package/cjs/dist/react/core/location-list/LocationList.js +15 -10
  25. package/cjs/dist/react/core/payment/Payment.js +41 -30
  26. package/cjs/dist/react/core/service/Service.js +28 -19
  27. package/cjs/dist/react/core/service/ServiceMediaCover.js +7 -4
  28. package/cjs/dist/react/core/service/ServiceMediaGallery.js +7 -4
  29. package/cjs/dist/react/core/service/ServiceMediaMain.js +7 -4
  30. package/cjs/dist/react/core/service-list/ServiceList.js +12 -8
  31. package/cjs/dist/react/core/service-list/ServiceListFilter.js +9 -6
  32. package/cjs/dist/react/core/staff-member/StaffMember.js +20 -14
  33. package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +19 -14
  34. package/cjs/dist/react/core/time-slot-list/TimeSlot.js +41 -28
  35. package/cjs/dist/react/core/time-slot-list/TimeSlotList.js +21 -15
  36. package/cjs/dist/react/index.js +49 -13
  37. package/cjs/dist/react/location/Location.js +76 -36
  38. package/cjs/dist/react/location/LocationList.js +70 -31
  39. package/cjs/dist/react/payment/Payment.js +87 -48
  40. package/cjs/dist/react/service/Service.js +197 -158
  41. package/cjs/dist/react/service/ServiceMedia.js +56 -17
  42. package/cjs/dist/react/service-list/ServiceList.js +71 -32
  43. package/cjs/dist/react/staff-member/StaffMember.js +61 -20
  44. package/cjs/dist/react/staff-member/StaffMemberList.js +68 -29
  45. package/cjs/dist/react/time-slot-list/TimeSlot.js +95 -56
  46. package/cjs/dist/react/time-slot-list/TimeSlotList.js +87 -48
  47. package/cjs/dist/services/booking/book-action/bookAction.js +21 -18
  48. package/cjs/dist/services/booking/book-action/buildBookingRequest.js +18 -15
  49. package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +8 -5
  50. package/cjs/dist/services/booking/book-action/canBook.js +4 -1
  51. package/cjs/dist/services/booking/book-action/index.js +15 -6
  52. package/cjs/dist/services/booking/book-action/isCheckoutRequired.js +4 -1
  53. package/cjs/dist/services/booking/book-action/types.js +5 -2
  54. package/cjs/dist/services/booking/booking.js +11 -8
  55. package/cjs/dist/services/booking-form/booking-form.js +26 -18
  56. package/cjs/dist/services/booking-form/utils.js +10 -4
  57. package/cjs/dist/services/constants.js +6 -3
  58. package/cjs/dist/services/index.js +48 -10
  59. package/cjs/dist/services/location-list/location-list.def.js +7 -5
  60. package/cjs/dist/services/location-list/location-list.js +31 -23
  61. package/cjs/dist/services/payment/payment.def.js +5 -2
  62. package/cjs/dist/services/payment/payment.js +22 -17
  63. package/cjs/dist/services/service/service.js +33 -29
  64. package/cjs/dist/services/service-list/service-list.js +22 -18
  65. package/cjs/dist/services/staff-member-list/staff-member-list.def.js +5 -2
  66. package/cjs/dist/services/staff-member-list/staff-member-list.js +16 -10
  67. package/cjs/dist/services/time-slot-list/index.js +12 -3
  68. package/cjs/dist/services/time-slot-list/time-slot-list.def.js +8 -5
  69. package/cjs/dist/services/time-slot-list/time-slot-list.js +24 -19
  70. package/cjs/dist/services/time-slot-list/time-slot.js +9 -6
  71. package/cjs/dist/utils/dateAndTime.js +7 -2
  72. package/cjs/dist/utils/guid.js +4 -1
  73. package/cjs/dist/utils/index.js +5 -1
  74. package/cjs/dist/utils/money.js +6 -2
  75. package/cjs/dist/utils/navigation.js +6 -3
  76. package/package.json +3 -3
@@ -1,17 +1,56 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Actions = exports.Totals = exports.LocationRepeater = exports.Locations = exports.Root = exports.TestIds = void 0;
40
+ const jsx_runtime_1 = require("react/jsx-runtime");
2
41
  /**
3
42
  * LocationList - High-level component for displaying locations list
4
43
  * Follows the pattern from ServiceList.tsx
5
44
  *
6
45
  * @module React/LocationList
7
46
  */
8
- import React from 'react';
9
- import { GenericList, } from '@wix/headless-components/react';
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
- import * as CoreLocationList from '../core/location-list/LocationList.js';
14
- import * as LocationComponent from './Location.js';
47
+ const react_1 = __importDefault(require("react"));
48
+ const react_2 = require("@wix/headless-components/react");
49
+ const react_3 = require("@wix/headless-utils/react");
50
+ const services_manager_react_1 = require("@wix/services-manager-react");
51
+ const booking_js_1 = require("../../services/booking/booking.js");
52
+ const CoreLocationList = __importStar(require("../core/location-list/LocationList.js"));
53
+ const LocationComponent = __importStar(require("./Location.js"));
15
54
  // ============================================================================
16
55
  // Helper Functions
17
56
  // ============================================================================
@@ -37,7 +76,7 @@ function getLocationType(location) {
37
76
  // ============================================================================
38
77
  // TestIds
39
78
  // ============================================================================
40
- export const TestIds = {
79
+ exports.TestIds = {
41
80
  locationListRoot: 'location-list-root',
42
81
  locationListLocations: 'location-list-locations',
43
82
  locationListLocation: 'location-list-location',
@@ -66,7 +105,7 @@ export const TestIds = {
66
105
  * }
67
106
  * ```
68
107
  */
69
- export const Root = React.forwardRef((props, ref) => {
108
+ exports.Root = react_1.default.forwardRef((props, ref) => {
70
109
  const { children, locationListConfig, className, variant, customLocationLabel, customerLocationLabel, } = props;
71
110
  // Merge labels into service config
72
111
  const config = {
@@ -74,15 +113,15 @@ export const Root = React.forwardRef((props, ref) => {
74
113
  customLocationLabel,
75
114
  customerLocationLabel,
76
115
  };
77
- return (_jsx(CoreLocationList.Root, { locationListServiceConfig: config, children: _jsx(RootContent, { className: className, ref: ref, variant: variant, children: children }) }));
116
+ return ((0, jsx_runtime_1.jsx)(CoreLocationList.Root, { locationListServiceConfig: config, children: (0, jsx_runtime_1.jsx)(RootContent, { className: className, ref: ref, variant: variant, children: children }) }));
78
117
  });
79
- Root.displayName = 'LocationList.Root';
118
+ exports.Root.displayName = 'LocationList.Root';
80
119
  /**
81
120
  * Internal component to handle the Root content with service access
82
121
  */
83
- const RootContent = React.forwardRef((props, ref) => {
122
+ const RootContent = react_1.default.forwardRef((props, ref) => {
84
123
  const { children, className, variant } = props;
85
- return (_jsx(CoreLocationList.Locations, { children: ({ displayLocations, isLoading }) => (_jsx(GenericList.Root, { items: displayLocations, hasMore: false, isLoading: isLoading, className: className, ref: ref, "data-testid": TestIds.locationListRoot, variant: variant, children: children })) }));
124
+ return ((0, jsx_runtime_1.jsx)(CoreLocationList.Locations, { children: ({ displayLocations, isLoading }) => ((0, jsx_runtime_1.jsx)(react_2.GenericList.Root, { items: displayLocations, hasMore: false, isLoading: isLoading, className: className, ref: ref, "data-testid": exports.TestIds.locationListRoot, variant: variant, children: children })) }));
86
125
  });
87
126
  RootContent.displayName = 'LocationList.RootContent';
88
127
  /**
@@ -100,12 +139,12 @@ RootContent.displayName = 'LocationList.RootContent';
100
139
  * </LocationList.Locations>
101
140
  * ```
102
141
  */
103
- export const Locations = React.forwardRef((props, ref) => {
142
+ exports.Locations = react_1.default.forwardRef((props, ref) => {
104
143
  const { children, ...otherProps } = props;
105
- return (_jsx(GenericList.Items, { ref: ref, "data-testid": TestIds.locationListLocations, ...otherProps, children: children }));
144
+ return ((0, jsx_runtime_1.jsx)(react_2.GenericList.Items, { ref: ref, "data-testid": exports.TestIds.locationListLocations, ...otherProps, children: children }));
106
145
  });
107
- Locations.displayName = 'LocationList.Locations';
108
- export const LocationRepeater = React.forwardRef((props, ref) => {
146
+ exports.Locations.displayName = 'LocationList.Locations';
147
+ exports.LocationRepeater = react_1.default.forwardRef((props, ref) => {
109
148
  const { children } = props;
110
149
  // Custom itemWrapper that wraps each item in LocationComponent.Root
111
150
  // Note: Labels are now handled by Location.Name component, not here
@@ -113,11 +152,11 @@ export const LocationRepeater = React.forwardRef((props, ref) => {
113
152
  const locationId = getLocationId(item);
114
153
  const locationType = getLocationType(item);
115
154
  const isSynthetic = !hasLocationData(item);
116
- return (_jsx(LocationComponent.Root, { location: item, "data-testid": TestIds.locationListLocation, "data-location-id": locationId, "data-location-type": locationType, "data-synthetic": isSynthetic, "data-item-id": locationId, children: itemChildren }, locationId));
155
+ return ((0, jsx_runtime_1.jsx)(LocationComponent.Root, { location: item, "data-testid": exports.TestIds.locationListLocation, "data-location-id": locationId, "data-location-type": locationType, "data-synthetic": isSynthetic, "data-item-id": locationId, children: itemChildren }, locationId));
117
156
  };
118
- return (_jsx(GenericList.Repeater, { ref: ref, itemWrapper: locationItemWrapper, children: children }));
157
+ return ((0, jsx_runtime_1.jsx)(react_2.GenericList.Repeater, { ref: ref, itemWrapper: locationItemWrapper, children: children }));
119
158
  });
120
- LocationRepeater.displayName = 'LocationList.LocationRepeater';
159
+ exports.LocationRepeater.displayName = 'LocationList.LocationRepeater';
121
160
  /**
122
161
  * Displays the total count of locations.
123
162
  *
@@ -132,14 +171,14 @@ LocationRepeater.displayName = 'LocationList.LocationRepeater';
132
171
  * </LocationList.Totals>
133
172
  * ```
134
173
  */
135
- export const Totals = React.forwardRef((props, ref) => {
174
+ exports.Totals = react_1.default.forwardRef((props, ref) => {
136
175
  const { asChild, children, ...rest } = props;
137
- return (_jsx(CoreLocationList.Locations, { children: ({ displayLocations, hasLocations }) => {
176
+ return ((0, jsx_runtime_1.jsx)(CoreLocationList.Locations, { children: ({ displayLocations, hasLocations }) => {
138
177
  const count = displayLocations.length;
139
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationListTotals, customElement: children, customElementProps: { count, hasLocations }, children: _jsx("span", { children: count }) }));
178
+ return ((0, jsx_runtime_1.jsx)(react_3.AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": exports.TestIds.locationListTotals, customElement: children, customElementProps: { count, hasLocations }, children: (0, jsx_runtime_1.jsx)("span", { children: count }) }));
140
179
  } }));
141
180
  });
142
- Totals.displayName = 'LocationList.Totals';
181
+ exports.Totals.displayName = 'LocationList.Totals';
143
182
  /**
144
183
  * Button to clear the location selection.
145
184
  * Clears the location from the BookingService.
@@ -169,12 +208,12 @@ Totals.displayName = 'LocationList.Totals';
169
208
  * </LocationList.Actions.Clear>
170
209
  * ```
171
210
  */
172
- const Clear = React.forwardRef((props, ref) => {
211
+ const Clear = react_1.default.forwardRef((props, ref) => {
173
212
  const { asChild, children, className, label, onClick, ...rest } = props;
174
- return (_jsx(CoreLocationList.Actions, { children: ({ selectedLocation }) => {
213
+ return ((0, jsx_runtime_1.jsx)(CoreLocationList.Actions, { children: ({ selectedLocation }) => {
175
214
  let bookingService = null;
176
215
  try {
177
- bookingService = useService(BookingServiceDefinition);
216
+ bookingService = (0, services_manager_react_1.useService)(booking_js_1.BookingServiceDefinition);
178
217
  }
179
218
  catch {
180
219
  // BookingService not available - likely no ServiceManagerProvider
@@ -183,15 +222,15 @@ const Clear = React.forwardRef((props, ref) => {
183
222
  bookingService?.actions.clearLocation();
184
223
  onClick?.(selectedLocation);
185
224
  };
186
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.locationListActionClear, customElement: children, customElementProps: {
225
+ return ((0, jsx_runtime_1.jsx)(react_3.AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": exports.TestIds.locationListActionClear, customElement: children, customElementProps: {
187
226
  onClick: handleClick,
188
- }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
227
+ }, children: (0, jsx_runtime_1.jsx)("button", { onClick: handleClick, children: children || label }) }));
189
228
  } }));
190
229
  });
191
230
  Clear.displayName = 'LocationList.Actions.Clear';
192
231
  /**
193
232
  * Actions namespace for location list-level actions
194
233
  */
195
- export const Actions = {
234
+ exports.Actions = {
196
235
  Clear,
197
236
  };
@@ -1,13 +1,52 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.LineItemDeposit = exports.LineItemSubtotal = exports.LineItemTotal = exports.LineItemRepeater = exports.LineItemsList = exports.LineItems = exports.PayLater = exports.PayNow = exports.Total = exports.Tax = exports.Subtotal = exports.Root = exports.TestIds = void 0;
40
+ const jsx_runtime_1 = require("react/jsx-runtime");
2
41
  /**
3
42
  * Payment - High-level component for displaying payment information
4
43
  * Provides components for displaying payment summary, totals, and line items
5
44
  */
6
- import React from 'react';
7
- import * as CorePayment from '../core/payment/Payment.js';
8
- import { AsChildSlot } from '@wix/headless-utils/react';
9
- import { Money, GenericList } from '@wix/headless-components/react';
10
- export const TestIds = {
45
+ const react_1 = __importDefault(require("react"));
46
+ const CorePayment = __importStar(require("../core/payment/Payment.js"));
47
+ const react_2 = require("@wix/headless-utils/react");
48
+ const react_3 = require("@wix/headless-components/react");
49
+ exports.TestIds = {
11
50
  paymentRoot: 'payment-root',
12
51
  paymentSubtotal: 'payment-subtotal',
13
52
  paymentTax: 'payment-tax',
@@ -53,13 +92,13 @@ export const TestIds = {
53
92
  * }
54
93
  * ```
55
94
  */
56
- export const Root = React.forwardRef((props, ref) => {
95
+ exports.Root = react_1.default.forwardRef((props, ref) => {
57
96
  const { children, paymentServiceConfig, pricingServiceSelections, totalParticipants, asChild, className, ...attrs } = props;
58
- return (_jsx(CorePayment.Root, { paymentServiceConfig: paymentServiceConfig, pricingServiceSelections: pricingServiceSelections, totalParticipants: totalParticipants, children: ({ isLoading, hasError }) => {
59
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.paymentRoot, "data-loading": isLoading, "data-has-error": hasError, customElement: children, customElementProps: { isLoading, hasError }, ...attrs, children: children }));
97
+ return ((0, jsx_runtime_1.jsx)(CorePayment.Root, { paymentServiceConfig: paymentServiceConfig, pricingServiceSelections: pricingServiceSelections, totalParticipants: totalParticipants, children: ({ isLoading, hasError }) => {
98
+ return ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": exports.TestIds.paymentRoot, "data-loading": isLoading, "data-has-error": hasError, customElement: children, customElementProps: { isLoading, hasError }, ...attrs, children: children }));
60
99
  } }));
61
100
  });
62
- Root.displayName = 'Payment.Root';
101
+ exports.Root.displayName = 'Payment.Root';
63
102
  /**
64
103
  * Displays the payment subtotal.
65
104
  * Always displays the monetary value. Exposes customPrice for custom rendering.
@@ -80,14 +119,14 @@ Root.displayName = 'Payment.Root';
80
119
  * </Payment.Subtotal>
81
120
  * ```
82
121
  */
83
- export const Subtotal = React.forwardRef((props, ref) => {
122
+ exports.Subtotal = react_1.default.forwardRef((props, ref) => {
84
123
  const { asChild, children, className } = props;
85
- return (_jsx(CorePayment.Data, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
124
+ return ((0, jsx_runtime_1.jsx)(CorePayment.Data, { children: ({ subtotal, customPrice }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
86
125
  subtotal,
87
126
  customPrice,
88
- }, "data-testid": TestIds.paymentSubtotal, "data-has-custom-price": !!customPrice, children: subtotal && _jsx(Money, { money: subtotal }) })) }));
127
+ }, "data-testid": exports.TestIds.paymentSubtotal, "data-has-custom-price": !!customPrice, children: subtotal && (0, jsx_runtime_1.jsx)(react_3.Money, { money: subtotal }) })) }));
89
128
  });
90
- Subtotal.displayName = 'Payment.Subtotal';
129
+ exports.Subtotal.displayName = 'Payment.Subtotal';
91
130
  /**
92
131
  * Displays the payment tax.
93
132
  * Uses data-has-tax attribute for conditional visibility.
@@ -98,11 +137,11 @@ Subtotal.displayName = 'Payment.Subtotal';
98
137
  * <Payment.Tax className="text-secondary-foreground" />
99
138
  * ```
100
139
  */
101
- export const Tax = React.forwardRef((props, ref) => {
140
+ exports.Tax = react_1.default.forwardRef((props, ref) => {
102
141
  const { asChild, children, className } = props;
103
- return (_jsx(CorePayment.Data, { children: ({ tax, hasTax }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { tax }, "data-testid": TestIds.paymentTax, "data-has-tax": hasTax, children: hasTax && _jsx(Money, { money: tax }) })) }));
142
+ return ((0, jsx_runtime_1.jsx)(CorePayment.Data, { children: ({ tax, hasTax }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { tax }, "data-testid": exports.TestIds.paymentTax, "data-has-tax": hasTax, children: hasTax && (0, jsx_runtime_1.jsx)(react_3.Money, { money: tax }) })) }));
104
143
  });
105
- Tax.displayName = 'Payment.Tax';
144
+ exports.Tax.displayName = 'Payment.Tax';
106
145
  /**
107
146
  * Displays the payment total.
108
147
  * Always displays the monetary value. Exposes customPrice for custom rendering.
@@ -123,14 +162,14 @@ Tax.displayName = 'Payment.Tax';
123
162
  * </Payment.Total>
124
163
  * ```
125
164
  */
126
- export const Total = React.forwardRef((props, ref) => {
165
+ exports.Total = react_1.default.forwardRef((props, ref) => {
127
166
  const { asChild, children, className } = props;
128
- return (_jsx(CorePayment.Data, { children: ({ total, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
167
+ return ((0, jsx_runtime_1.jsx)(CorePayment.Data, { children: ({ total, customPrice }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
129
168
  total,
130
169
  customPrice,
131
- }, "data-testid": TestIds.paymentTotal, "data-has-custom-price": !!customPrice, children: total && _jsx(Money, { money: total }) })) }));
170
+ }, "data-testid": exports.TestIds.paymentTotal, "data-has-custom-price": !!customPrice, children: total && (0, jsx_runtime_1.jsx)(react_3.Money, { money: total }) })) }));
132
171
  });
133
- Total.displayName = 'Payment.Total';
172
+ exports.Total.displayName = 'Payment.Total';
134
173
  /**
135
174
  * Displays the pay now amount (amount to pay upfront in deposit scenarios).
136
175
  * Only renders in deposit mode when payNow has a valid amount.
@@ -141,11 +180,11 @@ Total.displayName = 'Payment.Total';
141
180
  * <Payment.PayNow className="font-semibold" />
142
181
  * ```
143
182
  */
144
- export const PayNow = React.forwardRef((props, ref) => {
183
+ exports.PayNow = react_1.default.forwardRef((props, ref) => {
145
184
  const { asChild, children, className } = props;
146
- return (_jsx(CorePayment.Data, { children: ({ payNow, isDeposit }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { payNow, isDeposit }, "data-testid": TestIds.paymentPayNow, "data-has-deposit": isDeposit, children: isDeposit && payNow && payNow.amount > 0 && (_jsx(Money, { money: payNow })) })) }));
185
+ return ((0, jsx_runtime_1.jsx)(CorePayment.Data, { children: ({ payNow, isDeposit }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { payNow, isDeposit }, "data-testid": exports.TestIds.paymentPayNow, "data-has-deposit": isDeposit, children: isDeposit && payNow && payNow.amount > 0 && ((0, jsx_runtime_1.jsx)(react_3.Money, { money: payNow })) })) }));
147
186
  });
148
- PayNow.displayName = 'Payment.PayNow';
187
+ exports.PayNow.displayName = 'Payment.PayNow';
149
188
  /**
150
189
  * Displays the pay later amount (for deposit scenarios).
151
190
  * Only renders when in deposit mode and payLater has a valid amount.
@@ -156,11 +195,11 @@ PayNow.displayName = 'Payment.PayNow';
156
195
  * <Payment.PayLater className="text-secondary-foreground" />
157
196
  * ```
158
197
  */
159
- export const PayLater = React.forwardRef((props, ref) => {
198
+ exports.PayLater = react_1.default.forwardRef((props, ref) => {
160
199
  const { asChild, children, className } = props;
161
- return (_jsx(CorePayment.Data, { children: ({ payLater, isDeposit }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { payLater, isDeposit }, "data-testid": TestIds.paymentPayLater, "data-has-deposit": isDeposit, children: isDeposit && payLater && payLater.amount > 0 && (_jsx(Money, { money: payLater })) })) }));
200
+ return ((0, jsx_runtime_1.jsx)(CorePayment.Data, { children: ({ payLater, isDeposit }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { payLater, isDeposit }, "data-testid": exports.TestIds.paymentPayLater, "data-has-deposit": isDeposit, children: isDeposit && payLater && payLater.amount > 0 && ((0, jsx_runtime_1.jsx)(react_3.Money, { money: payLater })) })) }));
162
201
  });
163
- PayLater.displayName = 'Payment.PayLater';
202
+ exports.PayLater.displayName = 'Payment.PayLater';
164
203
  /**
165
204
  * Container component for line items.
166
205
  * Follows the 3-level List/Options/Repeater pattern.
@@ -182,15 +221,15 @@ PayLater.displayName = 'Payment.PayLater';
182
221
  * </Payment.LineItems>
183
222
  * ```
184
223
  */
185
- export const LineItems = React.forwardRef((props, ref) => {
224
+ exports.LineItems = react_1.default.forwardRef((props, ref) => {
186
225
  const { asChild, children, className, ...rest } = props;
187
- return (_jsx(CorePayment.LineItems, { children: ({ lineItems, currency, isLoading, error }) => (_jsx(GenericList.Root, { items: lineItems, isLoading: isLoading, error: error, children: _jsx(LineItemsContext.Provider, { value: { currency }, children: _jsx(AsChildSlot, { ...rest, ref: ref, asChild: asChild, className: className, "data-testid": TestIds.paymentLineItems, "data-loading": isLoading, "data-error": !!error, customElement: children, customElementProps: { lineItems, currency, isLoading, error }, children: _jsx("div", { children: React.isValidElement(children) ? children : null }) }) }) })) }));
226
+ return ((0, jsx_runtime_1.jsx)(CorePayment.LineItems, { children: ({ lineItems, currency, isLoading, error }) => ((0, jsx_runtime_1.jsx)(react_3.GenericList.Root, { items: lineItems, isLoading: isLoading, error: error, children: (0, jsx_runtime_1.jsx)(LineItemsContext.Provider, { value: { currency }, children: (0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ...rest, ref: ref, asChild: asChild, className: className, "data-testid": exports.TestIds.paymentLineItems, "data-loading": isLoading, "data-error": !!error, customElement: children, customElementProps: { lineItems, currency, isLoading, error }, children: (0, jsx_runtime_1.jsx)("div", { children: react_1.default.isValidElement(children) ? children : null }) }) }) })) }));
188
227
  });
189
- LineItems.displayName = 'Payment.LineItems';
228
+ exports.LineItems.displayName = 'Payment.LineItems';
190
229
  // Context for line items currency
191
- const LineItemsContext = React.createContext(null);
230
+ const LineItemsContext = react_1.default.createContext(null);
192
231
  function useLineItemsContext() {
193
- const context = React.useContext(LineItemsContext);
232
+ const context = react_1.default.useContext(LineItemsContext);
194
233
  if (!context) {
195
234
  throw new Error('useLineItemsContext must be used within a Payment.LineItems component');
196
235
  }
@@ -211,16 +250,16 @@ function useLineItemsContext() {
211
250
  * </Payment.LineItemsList>
212
251
  * ```
213
252
  */
214
- export const LineItemsList = React.forwardRef((props, ref) => {
253
+ exports.LineItemsList = react_1.default.forwardRef((props, ref) => {
215
254
  const { children, emptyState, loadingState, errorState, className, ...otherProps } = props;
216
- return (_jsx(GenericList.Items, { ref: ref, emptyState: emptyState, loadingState: loadingState, errorState: errorState, className: className, "data-testid": TestIds.paymentLineItemsList, ...otherProps, children: children }));
255
+ return ((0, jsx_runtime_1.jsx)(react_3.GenericList.Items, { ref: ref, emptyState: emptyState, loadingState: loadingState, errorState: errorState, className: className, "data-testid": exports.TestIds.paymentLineItemsList, ...otherProps, children: children }));
217
256
  });
218
- LineItemsList.displayName = 'Payment.LineItemsList';
257
+ exports.LineItemsList.displayName = 'Payment.LineItemsList';
219
258
  /**
220
259
  * Internal component that wraps each line item with context provider.
221
260
  */
222
261
  const LineItemWrapper = ({ item, currency, children, }) => {
223
- return (_jsx(CorePayment.LineItemProvider, { lineItem: item, currency: currency, children: children }));
262
+ return ((0, jsx_runtime_1.jsx)(CorePayment.LineItemProvider, { lineItem: item, currency: currency, children: children }));
224
263
  };
225
264
  /**
226
265
  * Repeater component that maps over line items and provides context per item.
@@ -234,12 +273,12 @@ const LineItemWrapper = ({ item, currency, children, }) => {
234
273
  * </Payment.LineItemRepeater>
235
274
  * ```
236
275
  */
237
- export const LineItemRepeater = React.forwardRef((props, ref) => {
276
+ exports.LineItemRepeater = react_1.default.forwardRef((props, ref) => {
238
277
  const { children } = props;
239
278
  const { currency } = useLineItemsContext();
240
- return (_jsx(GenericList.Repeater, { ref: ref, itemWrapper: ({ item }) => (_jsx(LineItemWrapper, { item: item, currency: currency, children: children }, item.id)), children: undefined }));
279
+ return ((0, jsx_runtime_1.jsx)(react_3.GenericList.Repeater, { ref: ref, itemWrapper: ({ item }) => ((0, jsx_runtime_1.jsx)(LineItemWrapper, { item: item, currency: currency, children: children }, item.id)), children: undefined }));
241
280
  });
242
- LineItemRepeater.displayName = 'Payment.LineItemRepeater';
281
+ exports.LineItemRepeater.displayName = 'Payment.LineItemRepeater';
243
282
  /**
244
283
  * Displays the line item total (total price after tax).
245
284
  * Shows customPrice for CUSTOM rate type services, otherwise shows totalPrice.
@@ -250,11 +289,11 @@ LineItemRepeater.displayName = 'Payment.LineItemRepeater';
250
289
  * <Payment.LineItemTotal className="text-2xl font-bold" />
251
290
  * ```
252
291
  */
253
- export const LineItemTotal = React.forwardRef((props, ref) => {
292
+ exports.LineItemTotal = react_1.default.forwardRef((props, ref) => {
254
293
  const { asChild, children, ...rest } = props;
255
- return (_jsx(CorePayment.LineItemInfo, { children: ({ totalPrice, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.paymentLineItemTotal, "data-has-custom-price": !!customPrice, customElement: children, customElementProps: { totalPrice, customPrice }, children: customPrice ? (_jsx("span", { children: customPrice })) : (totalPrice && _jsx(Money, { money: totalPrice })) })) }));
294
+ return ((0, jsx_runtime_1.jsx)(CorePayment.LineItemInfo, { children: ({ totalPrice, customPrice }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": exports.TestIds.paymentLineItemTotal, "data-has-custom-price": !!customPrice, customElement: children, customElementProps: { totalPrice, customPrice }, children: customPrice ? ((0, jsx_runtime_1.jsx)("span", { children: customPrice })) : (totalPrice && (0, jsx_runtime_1.jsx)(react_3.Money, { money: totalPrice })) })) }));
256
295
  });
257
- LineItemTotal.displayName = 'Payment.LineItemTotal';
296
+ exports.LineItemTotal.displayName = 'Payment.LineItemTotal';
258
297
  /**
259
298
  * Displays the line item subtotal (full price before discounts).
260
299
  * Shows customPrice for CUSTOM rate type services, otherwise shows subtotal.
@@ -265,11 +304,11 @@ LineItemTotal.displayName = 'Payment.LineItemTotal';
265
304
  * <Payment.LineItemSubtotal className="text-lg" />
266
305
  * ```
267
306
  */
268
- export const LineItemSubtotal = React.forwardRef((props, ref) => {
307
+ exports.LineItemSubtotal = react_1.default.forwardRef((props, ref) => {
269
308
  const { asChild, children, ...rest } = props;
270
- return (_jsx(CorePayment.LineItemInfo, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.paymentLineItemSubtotal, "data-has-custom-price": !!customPrice, customElement: children, customElementProps: { subtotal, customPrice }, children: customPrice ? (_jsx("span", { children: customPrice })) : (subtotal && _jsx(Money, { money: subtotal })) })) }));
309
+ return ((0, jsx_runtime_1.jsx)(CorePayment.LineItemInfo, { children: ({ subtotal, customPrice }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": exports.TestIds.paymentLineItemSubtotal, "data-has-custom-price": !!customPrice, customElement: children, customElementProps: { subtotal, customPrice }, children: customPrice ? ((0, jsx_runtime_1.jsx)("span", { children: customPrice })) : (subtotal && (0, jsx_runtime_1.jsx)(react_3.Money, { money: subtotal })) })) }));
271
310
  });
272
- LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
311
+ exports.LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
273
312
  /**
274
313
  * Displays the line item deposit amount.
275
314
  * Uses data-has-deposit attribute for conditional visibility.
@@ -280,8 +319,8 @@ LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
280
319
  * <Payment.LineItemDeposit className="font-semibold" />
281
320
  * ```
282
321
  */
283
- export const LineItemDeposit = React.forwardRef((props, ref) => {
322
+ exports.LineItemDeposit = react_1.default.forwardRef((props, ref) => {
284
323
  const { asChild, children, className } = props;
285
- return (_jsx(CorePayment.LineItemInfo, { children: ({ deposit, hasDeposit }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { deposit }, "data-testid": TestIds.paymentLineItemDeposit, "data-has-deposit": hasDeposit, children: hasDeposit && _jsx(Money, { money: deposit }) })) }));
324
+ return ((0, jsx_runtime_1.jsx)(CorePayment.LineItemInfo, { children: ({ deposit, hasDeposit }) => ((0, jsx_runtime_1.jsx)(react_2.AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: { deposit }, "data-testid": exports.TestIds.paymentLineItemDeposit, "data-has-deposit": hasDeposit, children: hasDeposit && (0, jsx_runtime_1.jsx)(react_3.Money, { money: deposit }) })) }));
286
325
  });
287
- LineItemDeposit.displayName = 'Payment.LineItemDeposit';
326
+ exports.LineItemDeposit.displayName = 'Payment.LineItemDeposit';