@wix/headless-bookings 0.0.92 → 0.0.93
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.
- package/cjs/dist/react/booking/Book.d.ts +1 -1
- package/cjs/dist/react/booking/Book.js +9 -6
- package/cjs/dist/react/booking/BookingItem.d.ts +1 -2
- package/cjs/dist/react/booking/BookingItem.js +2 -2
- package/cjs/dist/react/booking-form/BookingForm.js +3 -3
- package/cjs/dist/react/location/Location.d.ts +2 -4
- package/cjs/dist/react/location/Location.js +14 -14
- package/cjs/dist/react/location/LocationList.d.ts +1 -2
- package/cjs/dist/react/location/LocationList.js +6 -5
- package/cjs/dist/react/payment/Payment.d.ts +8 -16
- package/cjs/dist/react/payment/Payment.js +14 -14
- package/cjs/dist/react/service/Service.d.ts +8 -16
- package/cjs/dist/react/service/Service.js +29 -29
- package/cjs/dist/react/staff-member/StaffMember.d.ts +1 -2
- package/cjs/dist/react/staff-member/StaffMember.js +5 -5
- package/cjs/dist/react/staff-member/StaffMemberList.d.ts +3 -3
- package/cjs/dist/react/staff-member/StaffMemberList.js +6 -5
- package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +4 -8
- package/cjs/dist/react/time-slot-list/TimeSlot.js +19 -19
- package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +1 -3
- package/cjs/dist/react/time-slot-list/TimeSlotList.js +9 -8
- package/dist/react/booking/Book.d.ts +1 -1
- package/dist/react/booking/Book.js +9 -6
- package/dist/react/booking/BookingItem.d.ts +1 -2
- package/dist/react/booking/BookingItem.js +2 -2
- package/dist/react/booking-form/BookingForm.js +3 -3
- package/dist/react/location/Location.d.ts +2 -4
- package/dist/react/location/Location.js +14 -14
- package/dist/react/location/LocationList.d.ts +1 -2
- package/dist/react/location/LocationList.js +6 -5
- package/dist/react/payment/Payment.d.ts +8 -16
- package/dist/react/payment/Payment.js +14 -14
- package/dist/react/service/Service.d.ts +8 -16
- package/dist/react/service/Service.js +29 -29
- package/dist/react/staff-member/StaffMember.d.ts +1 -2
- package/dist/react/staff-member/StaffMember.js +5 -5
- package/dist/react/staff-member/StaffMemberList.d.ts +3 -3
- package/dist/react/staff-member/StaffMemberList.js +6 -5
- package/dist/react/time-slot-list/TimeSlot.d.ts +4 -8
- package/dist/react/time-slot-list/TimeSlot.js +19 -19
- package/dist/react/time-slot-list/TimeSlotList.d.ts +1 -3
- package/dist/react/time-slot-list/TimeSlotList.js +9 -8
- package/package.json +2 -2
|
@@ -171,7 +171,7 @@ Fields.displayName = 'BookingForm.Fields';
|
|
|
171
171
|
* ```
|
|
172
172
|
*/
|
|
173
173
|
export const ValidateFormSubmission = React.forwardRef((props, ref) => {
|
|
174
|
-
const { asChild, children,
|
|
174
|
+
const { asChild, children, label, onValidationComplete, onClick, ...rest } = props;
|
|
175
175
|
const [valid, setValid] = React.useState(null);
|
|
176
176
|
const [validationFailures, setValidationFailures] = React.useState([]);
|
|
177
177
|
return (_jsx(CoreBookingForm.Actions, { children: ({ validateFormSubmission }) => {
|
|
@@ -184,11 +184,11 @@ export const ValidateFormSubmission = React.forwardRef((props, ref) => {
|
|
|
184
184
|
}
|
|
185
185
|
onClick?.(result);
|
|
186
186
|
};
|
|
187
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
187
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, onClick: handleClick, "data-testid": TestIds.bookingFormActionValidateFormSubmission, "data-valid": valid, customElement: children, customElementProps: {
|
|
188
188
|
onClick: handleClick,
|
|
189
189
|
valid,
|
|
190
190
|
validationFailures,
|
|
191
|
-
}, children: _jsx("button", {
|
|
191
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
192
192
|
} }));
|
|
193
193
|
});
|
|
194
194
|
ValidateFormSubmission.displayName =
|
|
@@ -58,12 +58,11 @@ export declare const Root: React.ForwardRefExoticComponent<RootProps & React.Ref
|
|
|
58
58
|
/**
|
|
59
59
|
* Props for Location.Name component
|
|
60
60
|
*/
|
|
61
|
-
export interface NameProps {
|
|
61
|
+
export interface NameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
62
62
|
asChild?: boolean;
|
|
63
63
|
children?: React.ReactNode | AsChildChildren<{
|
|
64
64
|
name: string;
|
|
65
65
|
}>;
|
|
66
|
-
className?: string;
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
69
68
|
* Displays the location name.
|
|
@@ -90,14 +89,13 @@ export declare const Name: React.ForwardRefExoticComponent<NameProps & React.Ref
|
|
|
90
89
|
/**
|
|
91
90
|
* Props for Location.Type component
|
|
92
91
|
*/
|
|
93
|
-
export interface TypeProps {
|
|
92
|
+
export interface TypeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
94
93
|
asChild?: boolean;
|
|
95
94
|
children?: React.ReactNode | AsChildChildren<{
|
|
96
95
|
locationType: LocationType;
|
|
97
96
|
isCustomerLocation: boolean;
|
|
98
97
|
isCustomLocation: boolean;
|
|
99
98
|
}>;
|
|
100
|
-
className?: string;
|
|
101
99
|
}
|
|
102
100
|
/**
|
|
103
101
|
* Displays the location type.
|
|
@@ -93,9 +93,9 @@ Root.displayName = 'Location.Root';
|
|
|
93
93
|
* ```
|
|
94
94
|
*/
|
|
95
95
|
export const Name = React.forwardRef((props, ref) => {
|
|
96
|
-
const { asChild, children,
|
|
96
|
+
const { asChild, children, ...rest } = props;
|
|
97
97
|
const { name } = useLocationContext();
|
|
98
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
98
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationName, customElement: children, customElementProps: { name: name ?? '' }, children: name ? _jsx("span", { children: name }) : null }));
|
|
99
99
|
});
|
|
100
100
|
Name.displayName = 'Location.Name';
|
|
101
101
|
/**
|
|
@@ -117,13 +117,13 @@ Name.displayName = 'Location.Name';
|
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
119
|
export const Type = React.forwardRef((props, ref) => {
|
|
120
|
-
const { asChild, children,
|
|
120
|
+
const { asChild, children, ...rest } = props;
|
|
121
121
|
const { locationType, isCustomerLocation, isCustomLocation } = useLocationContext();
|
|
122
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
122
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationType, customElement: children, customElementProps: {
|
|
123
123
|
locationType,
|
|
124
124
|
isCustomerLocation,
|
|
125
125
|
isCustomLocation,
|
|
126
|
-
},
|
|
126
|
+
}, children: locationType ? _jsx("span", { children: locationType }) : null }));
|
|
127
127
|
});
|
|
128
128
|
Type.displayName = 'Location.Type';
|
|
129
129
|
/**
|
|
@@ -150,9 +150,9 @@ Type.displayName = 'Location.Type';
|
|
|
150
150
|
* ```
|
|
151
151
|
*/
|
|
152
152
|
export const LocationAddress = React.forwardRef((props, ref) => {
|
|
153
|
-
const { asChild, children,
|
|
153
|
+
const { asChild, children, ...rest } = props;
|
|
154
154
|
const { address } = useLocationContext();
|
|
155
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
155
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationAddress, customElement: children, customElementProps: { address }, children: address ? (_jsx("span", { children: _jsx(Address.Root, { address: address, children: _jsx(Address.Formatted, {}) }) })) : null }));
|
|
156
156
|
});
|
|
157
157
|
LocationAddress.displayName = 'Location.Address';
|
|
158
158
|
// Export as Address (avoiding name collision with imported Address)
|
|
@@ -173,9 +173,9 @@ export { LocationAddress as Address };
|
|
|
173
173
|
* ```
|
|
174
174
|
*/
|
|
175
175
|
export const Phone = React.forwardRef((props, ref) => {
|
|
176
|
-
const { asChild, children,
|
|
176
|
+
const { asChild, children, ...rest } = props;
|
|
177
177
|
const { phone } = useLocationContext();
|
|
178
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
178
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationPhone, customElement: children, customElementProps: { phone }, children: phone ? _jsx("span", { children: phone }) : null }));
|
|
179
179
|
});
|
|
180
180
|
Phone.displayName = 'Location.Phone';
|
|
181
181
|
/**
|
|
@@ -194,9 +194,9 @@ Phone.displayName = 'Location.Phone';
|
|
|
194
194
|
* ```
|
|
195
195
|
*/
|
|
196
196
|
export const Email = React.forwardRef((props, ref) => {
|
|
197
|
-
const { asChild, children,
|
|
197
|
+
const { asChild, children, ...rest } = props;
|
|
198
198
|
const { email } = useLocationContext();
|
|
199
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
199
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationEmail, customElement: children, customElementProps: { email }, children: email ? _jsx("span", { children: email }) : null }));
|
|
200
200
|
});
|
|
201
201
|
Email.displayName = 'Location.Email';
|
|
202
202
|
/**
|
|
@@ -244,7 +244,7 @@ Raw.displayName = 'Location.Raw';
|
|
|
244
244
|
* ```
|
|
245
245
|
*/
|
|
246
246
|
const Select = React.forwardRef((props, ref) => {
|
|
247
|
-
const { asChild, children, onClick, label, className, ...
|
|
247
|
+
const { asChild, children, onClick, label, className, ...rest } = props;
|
|
248
248
|
return (_jsx(CoreLocation.Actions, { children: ({ select, selected, rawLocation }) => {
|
|
249
249
|
const handleClick = () => {
|
|
250
250
|
select();
|
|
@@ -252,11 +252,11 @@ const Select = React.forwardRef((props, ref) => {
|
|
|
252
252
|
onClick?.(rawLocation);
|
|
253
253
|
}
|
|
254
254
|
};
|
|
255
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.locationActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
255
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.locationActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
256
256
|
onClick: handleClick,
|
|
257
257
|
selected,
|
|
258
258
|
location: rawLocation,
|
|
259
|
-
}, children: _jsx("button", {
|
|
259
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
260
260
|
} }));
|
|
261
261
|
});
|
|
262
262
|
Select.displayName = 'Location.Actions.Select';
|
|
@@ -77,13 +77,12 @@ export declare const LocationRepeater: React.ForwardRefExoticComponent<LocationR
|
|
|
77
77
|
/**
|
|
78
78
|
* Props for LocationList.Totals component
|
|
79
79
|
*/
|
|
80
|
-
export interface TotalsProps {
|
|
80
|
+
export interface TotalsProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
81
81
|
asChild?: boolean;
|
|
82
82
|
children?: React.ReactNode | AsChildChildren<{
|
|
83
83
|
count: number;
|
|
84
84
|
hasLocations: boolean;
|
|
85
85
|
}>;
|
|
86
|
-
className?: string;
|
|
87
86
|
}
|
|
88
87
|
/**
|
|
89
88
|
* Displays the total count of locations.
|
|
@@ -43,6 +43,7 @@ var TestIds;
|
|
|
43
43
|
TestIds["locationListLocations"] = "location-list-locations";
|
|
44
44
|
TestIds["locationListLocation"] = "location-list-location";
|
|
45
45
|
TestIds["locationListActionClear"] = "location-list-action-clear";
|
|
46
|
+
TestIds["locationListTotals"] = "location-list-totals";
|
|
46
47
|
})(TestIds || (TestIds = {}));
|
|
47
48
|
/**
|
|
48
49
|
* Root component that provides the LocationList service context for rendering locations lists.
|
|
@@ -133,10 +134,10 @@ LocationRepeater.displayName = 'LocationList.LocationRepeater';
|
|
|
133
134
|
* ```
|
|
134
135
|
*/
|
|
135
136
|
export const Totals = React.forwardRef((props, ref) => {
|
|
136
|
-
const { asChild, children,
|
|
137
|
+
const { asChild, children, ...rest } = props;
|
|
137
138
|
return (_jsx(CoreLocationList.Locations, { children: ({ displayLocations, hasLocations }) => {
|
|
138
139
|
const count = displayLocations.length;
|
|
139
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
140
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.locationListTotals, customElement: children, customElementProps: { count, hasLocations }, children: _jsx("span", { children: count }) }));
|
|
140
141
|
} }));
|
|
141
142
|
});
|
|
142
143
|
Totals.displayName = 'LocationList.Totals';
|
|
@@ -170,7 +171,7 @@ Totals.displayName = 'LocationList.Totals';
|
|
|
170
171
|
* ```
|
|
171
172
|
*/
|
|
172
173
|
const Clear = React.forwardRef((props, ref) => {
|
|
173
|
-
const { asChild, children, className, label, onClick, ...
|
|
174
|
+
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
174
175
|
return (_jsx(CoreLocationList.Actions, { children: ({ selectedLocation }) => {
|
|
175
176
|
let bookingService = null;
|
|
176
177
|
try {
|
|
@@ -183,9 +184,9 @@ const Clear = React.forwardRef((props, ref) => {
|
|
|
183
184
|
bookingService?.actions.clearLocation();
|
|
184
185
|
onClick?.(selectedLocation);
|
|
185
186
|
};
|
|
186
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.locationListActionClear, customElement: children, customElementProps: {
|
|
187
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.locationListActionClear, customElement: children, customElementProps: {
|
|
187
188
|
onClick: handleClick,
|
|
188
|
-
}, children: _jsx("button", {
|
|
189
|
+
}, children: _jsx("button", { children: children || label }) }));
|
|
189
190
|
} }));
|
|
190
191
|
});
|
|
191
192
|
Clear.displayName = 'LocationList.Actions.Clear';
|
|
@@ -59,13 +59,12 @@ export declare const Root: React.ForwardRefExoticComponent<RootProps & React.Ref
|
|
|
59
59
|
/**
|
|
60
60
|
* Props for Payment.Subtotal component
|
|
61
61
|
*/
|
|
62
|
-
export interface SubtotalProps {
|
|
62
|
+
export interface SubtotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
63
63
|
asChild?: boolean;
|
|
64
64
|
children?: AsChildChildren<{
|
|
65
65
|
subtotal: MoneyData | null;
|
|
66
66
|
customPrice: string | null;
|
|
67
67
|
}>;
|
|
68
|
-
className?: string;
|
|
69
68
|
}
|
|
70
69
|
/**
|
|
71
70
|
* Displays the payment subtotal.
|
|
@@ -91,12 +90,11 @@ export declare const Subtotal: React.ForwardRefExoticComponent<SubtotalProps & R
|
|
|
91
90
|
/**
|
|
92
91
|
* Props for Payment.Tax component
|
|
93
92
|
*/
|
|
94
|
-
export interface TaxProps {
|
|
93
|
+
export interface TaxProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
95
94
|
asChild?: boolean;
|
|
96
95
|
children?: AsChildChildren<{
|
|
97
96
|
tax: MoneyData | null;
|
|
98
97
|
}>;
|
|
99
|
-
className?: string;
|
|
100
98
|
}
|
|
101
99
|
/**
|
|
102
100
|
* Displays the payment tax.
|
|
@@ -112,13 +110,12 @@ export declare const Tax: React.ForwardRefExoticComponent<TaxProps & React.RefAt
|
|
|
112
110
|
/**
|
|
113
111
|
* Props for Payment.Total component
|
|
114
112
|
*/
|
|
115
|
-
export interface TotalProps {
|
|
113
|
+
export interface TotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
116
114
|
asChild?: boolean;
|
|
117
115
|
children?: AsChildChildren<{
|
|
118
116
|
total: MoneyData | null;
|
|
119
117
|
customPrice: string | null;
|
|
120
118
|
}>;
|
|
121
|
-
className?: string;
|
|
122
119
|
}
|
|
123
120
|
/**
|
|
124
121
|
* Displays the payment total.
|
|
@@ -144,13 +141,12 @@ export declare const Total: React.ForwardRefExoticComponent<TotalProps & React.R
|
|
|
144
141
|
/**
|
|
145
142
|
* Props for Payment.PayNow component
|
|
146
143
|
*/
|
|
147
|
-
export interface PayNowProps {
|
|
144
|
+
export interface PayNowProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
148
145
|
asChild?: boolean;
|
|
149
146
|
children?: AsChildChildren<{
|
|
150
147
|
payNow: MoneyData | null;
|
|
151
148
|
isDeposit: boolean;
|
|
152
149
|
}>;
|
|
153
|
-
className?: string;
|
|
154
150
|
}
|
|
155
151
|
/**
|
|
156
152
|
* Displays the pay now amount (amount to pay upfront in deposit scenarios).
|
|
@@ -166,13 +162,12 @@ export declare const PayNow: React.ForwardRefExoticComponent<PayNowProps & React
|
|
|
166
162
|
/**
|
|
167
163
|
* Props for Payment.PayLater component
|
|
168
164
|
*/
|
|
169
|
-
export interface PayLaterProps {
|
|
165
|
+
export interface PayLaterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
170
166
|
asChild?: boolean;
|
|
171
167
|
children?: AsChildChildren<{
|
|
172
168
|
payLater: MoneyData | null;
|
|
173
169
|
isDeposit: boolean;
|
|
174
170
|
}>;
|
|
175
|
-
className?: string;
|
|
176
171
|
}
|
|
177
172
|
/**
|
|
178
173
|
* Displays the pay later amount (for deposit scenarios).
|
|
@@ -266,13 +261,12 @@ export declare const LineItemRepeater: React.ForwardRefExoticComponent<LineItemR
|
|
|
266
261
|
/**
|
|
267
262
|
* Props for Payment.LineItemTotal component
|
|
268
263
|
*/
|
|
269
|
-
export interface LineItemTotalProps {
|
|
264
|
+
export interface LineItemTotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
270
265
|
asChild?: boolean;
|
|
271
266
|
children?: AsChildChildren<{
|
|
272
267
|
totalPrice: MoneyData | null;
|
|
273
268
|
customPrice: string | null;
|
|
274
269
|
}>;
|
|
275
|
-
className?: string;
|
|
276
270
|
}
|
|
277
271
|
/**
|
|
278
272
|
* Displays the line item total (total price after tax).
|
|
@@ -288,13 +282,12 @@ export declare const LineItemTotal: React.ForwardRefExoticComponent<LineItemTota
|
|
|
288
282
|
/**
|
|
289
283
|
* Props for Payment.LineItemSubtotal component
|
|
290
284
|
*/
|
|
291
|
-
export interface LineItemSubtotalProps {
|
|
285
|
+
export interface LineItemSubtotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
292
286
|
asChild?: boolean;
|
|
293
287
|
children?: AsChildChildren<{
|
|
294
288
|
subtotal: MoneyData | null;
|
|
295
289
|
customPrice: string | null;
|
|
296
290
|
}>;
|
|
297
|
-
className?: string;
|
|
298
291
|
}
|
|
299
292
|
/**
|
|
300
293
|
* Displays the line item subtotal (full price before discounts).
|
|
@@ -310,12 +303,11 @@ export declare const LineItemSubtotal: React.ForwardRefExoticComponent<LineItemS
|
|
|
310
303
|
/**
|
|
311
304
|
* Props for Payment.LineItemDeposit component
|
|
312
305
|
*/
|
|
313
|
-
export interface LineItemDepositProps {
|
|
306
|
+
export interface LineItemDepositProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
314
307
|
asChild?: boolean;
|
|
315
308
|
children?: AsChildChildren<{
|
|
316
309
|
deposit: MoneyData | null;
|
|
317
310
|
}>;
|
|
318
|
-
className?: string;
|
|
319
311
|
}
|
|
320
312
|
/**
|
|
321
313
|
* Displays the line item deposit amount.
|
|
@@ -83,10 +83,10 @@ Root.displayName = 'Payment.Root';
|
|
|
83
83
|
*/
|
|
84
84
|
export const Subtotal = React.forwardRef((props, ref) => {
|
|
85
85
|
const { asChild, children, className } = props;
|
|
86
|
-
return (_jsx(CorePayment.Data, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className,
|
|
86
|
+
return (_jsx(CorePayment.Data, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
|
|
87
87
|
subtotal,
|
|
88
88
|
customPrice,
|
|
89
|
-
}, children: subtotal && _jsx(Money, { money: subtotal }) })) }));
|
|
89
|
+
}, "data-testid": TestIds.paymentSubtotal, "data-has-custom-price": !!customPrice, children: subtotal && _jsx(Money, { money: subtotal }) })) }));
|
|
90
90
|
});
|
|
91
91
|
Subtotal.displayName = 'Payment.Subtotal';
|
|
92
92
|
/**
|
|
@@ -101,7 +101,7 @@ Subtotal.displayName = 'Payment.Subtotal';
|
|
|
101
101
|
*/
|
|
102
102
|
export const Tax = React.forwardRef((props, ref) => {
|
|
103
103
|
const { asChild, children, className } = props;
|
|
104
|
-
return (_jsx(CorePayment.Data, { children: ({ tax, hasTax }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.paymentTax, "data-has-tax": hasTax,
|
|
104
|
+
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 }) })) }));
|
|
105
105
|
});
|
|
106
106
|
Tax.displayName = 'Payment.Tax';
|
|
107
107
|
/**
|
|
@@ -126,10 +126,10 @@ Tax.displayName = 'Payment.Tax';
|
|
|
126
126
|
*/
|
|
127
127
|
export const Total = React.forwardRef((props, ref) => {
|
|
128
128
|
const { asChild, children, className } = props;
|
|
129
|
-
return (_jsx(CorePayment.Data, { children: ({ total, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className,
|
|
129
|
+
return (_jsx(CorePayment.Data, { children: ({ total, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
|
|
130
130
|
total,
|
|
131
131
|
customPrice,
|
|
132
|
-
}, children: total && _jsx(Money, { money: total }) })) }));
|
|
132
|
+
}, "data-testid": TestIds.paymentTotal, "data-has-custom-price": !!customPrice, children: total && _jsx(Money, { money: total }) })) }));
|
|
133
133
|
});
|
|
134
134
|
Total.displayName = 'Payment.Total';
|
|
135
135
|
/**
|
|
@@ -144,7 +144,7 @@ Total.displayName = 'Payment.Total';
|
|
|
144
144
|
*/
|
|
145
145
|
export const PayNow = React.forwardRef((props, ref) => {
|
|
146
146
|
const { asChild, children, className } = props;
|
|
147
|
-
return (_jsx(CorePayment.Data, { children: ({ payNow, isDeposit }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.paymentPayNow, "data-has-deposit": isDeposit,
|
|
147
|
+
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 })) })) }));
|
|
148
148
|
});
|
|
149
149
|
PayNow.displayName = 'Payment.PayNow';
|
|
150
150
|
/**
|
|
@@ -159,7 +159,7 @@ PayNow.displayName = 'Payment.PayNow';
|
|
|
159
159
|
*/
|
|
160
160
|
export const PayLater = React.forwardRef((props, ref) => {
|
|
161
161
|
const { asChild, children, className } = props;
|
|
162
|
-
return (_jsx(CorePayment.Data, { children: ({ payLater, isDeposit }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.paymentPayLater, "data-has-deposit": isDeposit,
|
|
162
|
+
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 })) })) }));
|
|
163
163
|
});
|
|
164
164
|
PayLater.displayName = 'Payment.PayLater';
|
|
165
165
|
/**
|
|
@@ -184,8 +184,8 @@ PayLater.displayName = 'Payment.PayLater';
|
|
|
184
184
|
* ```
|
|
185
185
|
*/
|
|
186
186
|
export const LineItems = React.forwardRef((props, ref) => {
|
|
187
|
-
const { asChild, children, className, ...
|
|
188
|
-
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, { ...
|
|
187
|
+
const { asChild, children, className, ...rest } = props;
|
|
188
|
+
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 }) }) }) })) }));
|
|
189
189
|
});
|
|
190
190
|
LineItems.displayName = 'Payment.LineItems';
|
|
191
191
|
// Context for line items currency
|
|
@@ -252,8 +252,8 @@ LineItemRepeater.displayName = 'Payment.LineItemRepeater';
|
|
|
252
252
|
* ```
|
|
253
253
|
*/
|
|
254
254
|
export const LineItemTotal = React.forwardRef((props, ref) => {
|
|
255
|
-
const { asChild, children,
|
|
256
|
-
return (_jsx(CorePayment.LineItemInfo, { children: ({ totalPrice, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
255
|
+
const { asChild, children, ...rest } = props;
|
|
256
|
+
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 })) })) }));
|
|
257
257
|
});
|
|
258
258
|
LineItemTotal.displayName = 'Payment.LineItemTotal';
|
|
259
259
|
/**
|
|
@@ -267,8 +267,8 @@ LineItemTotal.displayName = 'Payment.LineItemTotal';
|
|
|
267
267
|
* ```
|
|
268
268
|
*/
|
|
269
269
|
export const LineItemSubtotal = React.forwardRef((props, ref) => {
|
|
270
|
-
const { asChild, children,
|
|
271
|
-
return (_jsx(CorePayment.LineItemInfo, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild,
|
|
270
|
+
const { asChild, children, ...rest } = props;
|
|
271
|
+
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 })) })) }));
|
|
272
272
|
});
|
|
273
273
|
LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
|
|
274
274
|
/**
|
|
@@ -283,6 +283,6 @@ LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
|
|
|
283
283
|
*/
|
|
284
284
|
export const LineItemDeposit = React.forwardRef((props, ref) => {
|
|
285
285
|
const { asChild, children, className } = props;
|
|
286
|
-
return (_jsx(CorePayment.LineItemInfo, { children: ({ deposit, hasDeposit }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.paymentLineItemDeposit, "data-has-deposit": hasDeposit,
|
|
286
|
+
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 }) })) }));
|
|
287
287
|
});
|
|
288
288
|
LineItemDeposit.displayName = 'Payment.LineItemDeposit';
|
|
@@ -122,12 +122,11 @@ export declare const Root: React.ForwardRefExoticComponent<ServiceRootProps & Re
|
|
|
122
122
|
/**
|
|
123
123
|
* Props for Service Name component
|
|
124
124
|
*/
|
|
125
|
-
export interface NameProps {
|
|
125
|
+
export interface NameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
126
126
|
asChild?: boolean;
|
|
127
127
|
children?: AsChildChildren<{
|
|
128
128
|
name: string;
|
|
129
129
|
}>;
|
|
130
|
-
className?: string;
|
|
131
130
|
}
|
|
132
131
|
/**
|
|
133
132
|
* Displays the service name with customizable rendering.
|
|
@@ -157,12 +156,11 @@ export declare const Name: React.ForwardRefExoticComponent<NameProps & React.Ref
|
|
|
157
156
|
/**
|
|
158
157
|
* Props for Service Description component
|
|
159
158
|
*/
|
|
160
|
-
export interface DescriptionProps {
|
|
159
|
+
export interface DescriptionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
161
160
|
asChild?: boolean;
|
|
162
161
|
children?: AsChildChildren<{
|
|
163
162
|
description: string;
|
|
164
163
|
}>;
|
|
165
|
-
className?: string;
|
|
166
164
|
}
|
|
167
165
|
/**
|
|
168
166
|
* Displays the service description with customizable rendering.
|
|
@@ -231,12 +229,11 @@ export declare const Price: React.ForwardRefExoticComponent<PriceProps & React.R
|
|
|
231
229
|
/**
|
|
232
230
|
* Props for Service Tagline component
|
|
233
231
|
*/
|
|
234
|
-
export interface TaglineProps {
|
|
232
|
+
export interface TaglineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
235
233
|
asChild?: boolean;
|
|
236
234
|
children?: AsChildChildren<{
|
|
237
235
|
tagline: string;
|
|
238
236
|
}>;
|
|
239
|
-
className?: string;
|
|
240
237
|
}
|
|
241
238
|
/**
|
|
242
239
|
* Displays the service tagline with customizable rendering.
|
|
@@ -272,12 +269,11 @@ export declare const Tagline: React.ForwardRefExoticComponent<TaglineProps & Rea
|
|
|
272
269
|
/**
|
|
273
270
|
* Props for Service DurationInMinutes component
|
|
274
271
|
*/
|
|
275
|
-
export interface DurationInMinutesProps {
|
|
272
|
+
export interface DurationInMinutesProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
276
273
|
asChild?: boolean;
|
|
277
274
|
children?: AsChildChildren<{
|
|
278
275
|
duration: number;
|
|
279
276
|
}>;
|
|
280
|
-
className?: string;
|
|
281
277
|
}
|
|
282
278
|
/**
|
|
283
279
|
* Displays the service duration in minutes (raw number) with customizable rendering.
|
|
@@ -314,12 +310,11 @@ export declare const DurationInMinutes: React.ForwardRefExoticComponent<Duration
|
|
|
314
310
|
/**
|
|
315
311
|
* Props for Service Type component
|
|
316
312
|
*/
|
|
317
|
-
export interface TypeProps {
|
|
313
|
+
export interface TypeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
318
314
|
asChild?: boolean;
|
|
319
315
|
children?: AsChildChildren<{
|
|
320
316
|
type: string;
|
|
321
317
|
}>;
|
|
322
|
-
className?: string;
|
|
323
318
|
}
|
|
324
319
|
/**
|
|
325
320
|
* Displays the service type (APPOINTMENT, CLASS, COURSE, etc.) with customizable rendering.
|
|
@@ -358,7 +353,7 @@ export declare const Type: React.ForwardRefExoticComponent<TypeProps & React.Ref
|
|
|
358
353
|
/**
|
|
359
354
|
* Props for Service Category component
|
|
360
355
|
*/
|
|
361
|
-
export interface CategoryProps {
|
|
356
|
+
export interface CategoryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
362
357
|
asChild?: boolean;
|
|
363
358
|
children?: AsChildChildren<{
|
|
364
359
|
category: {
|
|
@@ -366,7 +361,6 @@ export interface CategoryProps {
|
|
|
366
361
|
_id?: string;
|
|
367
362
|
};
|
|
368
363
|
}>;
|
|
369
|
-
className?: string;
|
|
370
364
|
}
|
|
371
365
|
/**
|
|
372
366
|
* Displays the service category with customizable rendering.
|
|
@@ -1091,13 +1085,12 @@ export declare namespace Schedule {
|
|
|
1091
1085
|
/**
|
|
1092
1086
|
* Props for Service DefaultCapacity component
|
|
1093
1087
|
*/
|
|
1094
|
-
export interface DefaultCapacityProps {
|
|
1088
|
+
export interface DefaultCapacityProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1095
1089
|
asChild?: boolean;
|
|
1096
1090
|
children?: AsChildChildren<{
|
|
1097
1091
|
defaultCapacity: number;
|
|
1098
1092
|
isClassOrCourse: boolean;
|
|
1099
1093
|
}>;
|
|
1100
|
-
className?: string;
|
|
1101
1094
|
}
|
|
1102
1095
|
/**
|
|
1103
1096
|
* Displays the service default capacity with customizable rendering.
|
|
@@ -1121,12 +1114,11 @@ export declare const DefaultCapacity: React.ForwardRefExoticComponent<DefaultCap
|
|
|
1121
1114
|
/**
|
|
1122
1115
|
* Props for Service AvailableOnline component
|
|
1123
1116
|
*/
|
|
1124
|
-
export interface AvailableOnlineProps {
|
|
1117
|
+
export interface AvailableOnlineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1125
1118
|
asChild?: boolean;
|
|
1126
1119
|
children?: AsChildChildren<{
|
|
1127
1120
|
availableOnline: boolean;
|
|
1128
1121
|
}>;
|
|
1129
|
-
className?: string;
|
|
1130
1122
|
label?: string;
|
|
1131
1123
|
}
|
|
1132
1124
|
/**
|