@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.
- package/cjs/dist/__mocks__/services.d.ts +0 -4
- package/cjs/dist/__mocks__/services.js +1 -4
- package/cjs/dist/api/fetch-availability/index.js +3 -3
- package/cjs/dist/api/query-services/index.js +1 -4
- package/cjs/dist/react/booking/Book.d.ts +4 -1
- package/cjs/dist/react/booking/Book.js +12 -10
- package/cjs/dist/react/booking/Booking.d.ts +10 -0
- package/cjs/dist/react/booking/Booking.js +10 -11
- package/cjs/dist/react/booking/BookingItem.d.ts +6 -2
- package/cjs/dist/react/booking/BookingItem.js +7 -8
- package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -0
- package/cjs/dist/react/booking-form/BookingForm.js +8 -9
- package/cjs/dist/react/core/staff-member/StaffMember.js +1 -2
- package/cjs/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
- package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
- package/cjs/dist/react/location/Location.d.ts +12 -4
- package/cjs/dist/react/location/Location.js +24 -25
- package/cjs/dist/react/location/LocationList.d.ts +8 -2
- package/cjs/dist/react/location/LocationList.js +12 -12
- package/cjs/dist/react/payment/Payment.d.ts +22 -16
- package/cjs/dist/react/payment/Payment.js +28 -29
- package/cjs/dist/react/service/Service.d.ts +41 -16
- package/cjs/dist/react/service/Service.js +62 -63
- package/cjs/dist/react/service/ServiceMedia.d.ts +4 -0
- package/cjs/dist/react/service/ServiceMedia.js +4 -5
- package/cjs/dist/react/service-list/ServiceList.d.ts +7 -0
- package/cjs/dist/react/service-list/ServiceList.js +7 -8
- package/cjs/dist/react/staff-member/StaffMember.d.ts +7 -8
- package/cjs/dist/react/staff-member/StaffMember.js +11 -12
- package/cjs/dist/react/staff-member/StaffMemberList.d.ts +9 -8
- package/cjs/dist/react/staff-member/StaffMemberList.js +14 -24
- package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +16 -20
- package/cjs/dist/react/time-slot-list/TimeSlot.js +31 -32
- package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +10 -12
- package/cjs/dist/react/time-slot-list/TimeSlotList.js +18 -18
- package/cjs/dist/services/booking/book-action/buildBookingRequest.js +1 -2
- package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
- package/cjs/dist/services/constants.d.ts +9 -0
- package/cjs/dist/services/constants.js +9 -0
- package/cjs/dist/services/payment/payment.js +2 -5
- package/cjs/dist/services/service/service.js +1 -1
- package/cjs/dist/services/service-list/service-list.js +1 -4
- package/dist/__mocks__/services.d.ts +0 -4
- package/dist/__mocks__/services.js +1 -4
- package/dist/api/fetch-availability/index.js +3 -3
- package/dist/api/query-services/index.js +1 -4
- package/dist/react/booking/Book.d.ts +4 -1
- package/dist/react/booking/Book.js +12 -10
- package/dist/react/booking/Booking.d.ts +10 -0
- package/dist/react/booking/Booking.js +10 -11
- package/dist/react/booking/BookingItem.d.ts +6 -2
- package/dist/react/booking/BookingItem.js +7 -8
- package/dist/react/booking-form/BookingForm.d.ts +5 -0
- package/dist/react/booking-form/BookingForm.js +8 -9
- package/dist/react/core/staff-member/StaffMember.js +1 -2
- package/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
- package/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
- package/dist/react/location/Location.d.ts +12 -4
- package/dist/react/location/Location.js +24 -25
- package/dist/react/location/LocationList.d.ts +8 -2
- package/dist/react/location/LocationList.js +12 -12
- package/dist/react/payment/Payment.d.ts +22 -16
- package/dist/react/payment/Payment.js +28 -29
- package/dist/react/service/Service.d.ts +41 -16
- package/dist/react/service/Service.js +62 -63
- package/dist/react/service/ServiceMedia.d.ts +4 -0
- package/dist/react/service/ServiceMedia.js +4 -5
- package/dist/react/service-list/ServiceList.d.ts +7 -0
- package/dist/react/service-list/ServiceList.js +7 -8
- package/dist/react/staff-member/StaffMember.d.ts +7 -8
- package/dist/react/staff-member/StaffMember.js +11 -12
- package/dist/react/staff-member/StaffMemberList.d.ts +9 -8
- package/dist/react/staff-member/StaffMemberList.js +14 -24
- package/dist/react/time-slot-list/TimeSlot.d.ts +16 -20
- package/dist/react/time-slot-list/TimeSlot.js +31 -32
- package/dist/react/time-slot-list/TimeSlotList.d.ts +10 -12
- package/dist/react/time-slot-list/TimeSlotList.js +18 -18
- package/dist/services/booking/book-action/buildBookingRequest.js +1 -2
- package/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
- package/dist/services/constants.d.ts +9 -0
- package/dist/services/constants.js +9 -0
- package/dist/services/payment/payment.js +2 -5
- package/dist/services/service/service.js +1 -1
- package/dist/services/service-list/service-list.js +1 -4
- package/package.json +2 -2
|
@@ -6,6 +6,20 @@ import React from 'react';
|
|
|
6
6
|
import { AsChildChildren } from '@wix/headless-utils/react';
|
|
7
7
|
import { MoneyData } from '@wix/headless-components/react';
|
|
8
8
|
import type { PaymentServiceConfig, PricingServiceSelection } from '../../services/payment/payment.js';
|
|
9
|
+
export declare const TestIds: {
|
|
10
|
+
readonly paymentRoot: "payment-root";
|
|
11
|
+
readonly paymentSubtotal: "payment-subtotal";
|
|
12
|
+
readonly paymentTax: "payment-tax";
|
|
13
|
+
readonly paymentTotal: "payment-total";
|
|
14
|
+
readonly paymentPayNow: "payment-pay-now";
|
|
15
|
+
readonly paymentPayLater: "payment-pay-later";
|
|
16
|
+
readonly paymentLineItems: "payment-line-items";
|
|
17
|
+
readonly paymentLineItemsList: "payment-line-items-list";
|
|
18
|
+
readonly paymentLineItemRepeater: "payment-line-item-repeater";
|
|
19
|
+
readonly paymentLineItemTotal: "payment-line-item-total";
|
|
20
|
+
readonly paymentLineItemSubtotal: "payment-line-item-subtotal";
|
|
21
|
+
readonly paymentLineItemDeposit: "payment-line-item-deposit";
|
|
22
|
+
};
|
|
9
23
|
/**
|
|
10
24
|
* Props for Payment.Root component
|
|
11
25
|
*/
|
|
@@ -59,13 +73,12 @@ export declare const Root: React.ForwardRefExoticComponent<RootProps & React.Ref
|
|
|
59
73
|
/**
|
|
60
74
|
* Props for Payment.Subtotal component
|
|
61
75
|
*/
|
|
62
|
-
export interface SubtotalProps {
|
|
76
|
+
export interface SubtotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
63
77
|
asChild?: boolean;
|
|
64
78
|
children?: AsChildChildren<{
|
|
65
79
|
subtotal: MoneyData | null;
|
|
66
80
|
customPrice: string | null;
|
|
67
81
|
}>;
|
|
68
|
-
className?: string;
|
|
69
82
|
}
|
|
70
83
|
/**
|
|
71
84
|
* Displays the payment subtotal.
|
|
@@ -91,12 +104,11 @@ export declare const Subtotal: React.ForwardRefExoticComponent<SubtotalProps & R
|
|
|
91
104
|
/**
|
|
92
105
|
* Props for Payment.Tax component
|
|
93
106
|
*/
|
|
94
|
-
export interface TaxProps {
|
|
107
|
+
export interface TaxProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
95
108
|
asChild?: boolean;
|
|
96
109
|
children?: AsChildChildren<{
|
|
97
110
|
tax: MoneyData | null;
|
|
98
111
|
}>;
|
|
99
|
-
className?: string;
|
|
100
112
|
}
|
|
101
113
|
/**
|
|
102
114
|
* Displays the payment tax.
|
|
@@ -112,13 +124,12 @@ export declare const Tax: React.ForwardRefExoticComponent<TaxProps & React.RefAt
|
|
|
112
124
|
/**
|
|
113
125
|
* Props for Payment.Total component
|
|
114
126
|
*/
|
|
115
|
-
export interface TotalProps {
|
|
127
|
+
export interface TotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
116
128
|
asChild?: boolean;
|
|
117
129
|
children?: AsChildChildren<{
|
|
118
130
|
total: MoneyData | null;
|
|
119
131
|
customPrice: string | null;
|
|
120
132
|
}>;
|
|
121
|
-
className?: string;
|
|
122
133
|
}
|
|
123
134
|
/**
|
|
124
135
|
* Displays the payment total.
|
|
@@ -144,13 +155,12 @@ export declare const Total: React.ForwardRefExoticComponent<TotalProps & React.R
|
|
|
144
155
|
/**
|
|
145
156
|
* Props for Payment.PayNow component
|
|
146
157
|
*/
|
|
147
|
-
export interface PayNowProps {
|
|
158
|
+
export interface PayNowProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
148
159
|
asChild?: boolean;
|
|
149
160
|
children?: AsChildChildren<{
|
|
150
161
|
payNow: MoneyData | null;
|
|
151
162
|
isDeposit: boolean;
|
|
152
163
|
}>;
|
|
153
|
-
className?: string;
|
|
154
164
|
}
|
|
155
165
|
/**
|
|
156
166
|
* Displays the pay now amount (amount to pay upfront in deposit scenarios).
|
|
@@ -166,13 +176,12 @@ export declare const PayNow: React.ForwardRefExoticComponent<PayNowProps & React
|
|
|
166
176
|
/**
|
|
167
177
|
* Props for Payment.PayLater component
|
|
168
178
|
*/
|
|
169
|
-
export interface PayLaterProps {
|
|
179
|
+
export interface PayLaterProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
170
180
|
asChild?: boolean;
|
|
171
181
|
children?: AsChildChildren<{
|
|
172
182
|
payLater: MoneyData | null;
|
|
173
183
|
isDeposit: boolean;
|
|
174
184
|
}>;
|
|
175
|
-
className?: string;
|
|
176
185
|
}
|
|
177
186
|
/**
|
|
178
187
|
* Displays the pay later amount (for deposit scenarios).
|
|
@@ -266,13 +275,12 @@ export declare const LineItemRepeater: React.ForwardRefExoticComponent<LineItemR
|
|
|
266
275
|
/**
|
|
267
276
|
* Props for Payment.LineItemTotal component
|
|
268
277
|
*/
|
|
269
|
-
export interface LineItemTotalProps {
|
|
278
|
+
export interface LineItemTotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
270
279
|
asChild?: boolean;
|
|
271
280
|
children?: AsChildChildren<{
|
|
272
281
|
totalPrice: MoneyData | null;
|
|
273
282
|
customPrice: string | null;
|
|
274
283
|
}>;
|
|
275
|
-
className?: string;
|
|
276
284
|
}
|
|
277
285
|
/**
|
|
278
286
|
* Displays the line item total (total price after tax).
|
|
@@ -288,13 +296,12 @@ export declare const LineItemTotal: React.ForwardRefExoticComponent<LineItemTota
|
|
|
288
296
|
/**
|
|
289
297
|
* Props for Payment.LineItemSubtotal component
|
|
290
298
|
*/
|
|
291
|
-
export interface LineItemSubtotalProps {
|
|
299
|
+
export interface LineItemSubtotalProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
292
300
|
asChild?: boolean;
|
|
293
301
|
children?: AsChildChildren<{
|
|
294
302
|
subtotal: MoneyData | null;
|
|
295
303
|
customPrice: string | null;
|
|
296
304
|
}>;
|
|
297
|
-
className?: string;
|
|
298
305
|
}
|
|
299
306
|
/**
|
|
300
307
|
* Displays the line item subtotal (full price before discounts).
|
|
@@ -310,12 +317,11 @@ export declare const LineItemSubtotal: React.ForwardRefExoticComponent<LineItemS
|
|
|
310
317
|
/**
|
|
311
318
|
* Props for Payment.LineItemDeposit component
|
|
312
319
|
*/
|
|
313
|
-
export interface LineItemDepositProps {
|
|
320
|
+
export interface LineItemDepositProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
314
321
|
asChild?: boolean;
|
|
315
322
|
children?: AsChildChildren<{
|
|
316
323
|
deposit: MoneyData | null;
|
|
317
324
|
}>;
|
|
318
|
-
className?: string;
|
|
319
325
|
}
|
|
320
326
|
/**
|
|
321
327
|
* Displays the line item deposit amount.
|
|
@@ -7,21 +7,20 @@ import React from 'react';
|
|
|
7
7
|
import * as CorePayment from '../core/payment/Payment.js';
|
|
8
8
|
import { AsChildSlot } from '@wix/headless-utils/react';
|
|
9
9
|
import { Money, GenericList } from '@wix/headless-components/react';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(TestIds || (TestIds = {}));
|
|
10
|
+
export const TestIds = {
|
|
11
|
+
paymentRoot: 'payment-root',
|
|
12
|
+
paymentSubtotal: 'payment-subtotal',
|
|
13
|
+
paymentTax: 'payment-tax',
|
|
14
|
+
paymentTotal: 'payment-total',
|
|
15
|
+
paymentPayNow: 'payment-pay-now',
|
|
16
|
+
paymentPayLater: 'payment-pay-later',
|
|
17
|
+
paymentLineItems: 'payment-line-items',
|
|
18
|
+
paymentLineItemsList: 'payment-line-items-list',
|
|
19
|
+
paymentLineItemRepeater: 'payment-line-item-repeater',
|
|
20
|
+
paymentLineItemTotal: 'payment-line-item-total',
|
|
21
|
+
paymentLineItemSubtotal: 'payment-line-item-subtotal',
|
|
22
|
+
paymentLineItemDeposit: 'payment-line-item-deposit',
|
|
23
|
+
};
|
|
25
24
|
/**
|
|
26
25
|
* Root component that provides payment context to the entire app.
|
|
27
26
|
* Supports 3 modes:
|
|
@@ -83,10 +82,10 @@ Root.displayName = 'Payment.Root';
|
|
|
83
82
|
*/
|
|
84
83
|
export const Subtotal = React.forwardRef((props, ref) => {
|
|
85
84
|
const { asChild, children, className } = props;
|
|
86
|
-
return (_jsx(CorePayment.Data, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className,
|
|
85
|
+
return (_jsx(CorePayment.Data, { children: ({ subtotal, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
|
|
87
86
|
subtotal,
|
|
88
87
|
customPrice,
|
|
89
|
-
}, children: subtotal && _jsx(Money, { money: subtotal }) })) }));
|
|
88
|
+
}, "data-testid": TestIds.paymentSubtotal, "data-has-custom-price": !!customPrice, children: subtotal && _jsx(Money, { money: subtotal }) })) }));
|
|
90
89
|
});
|
|
91
90
|
Subtotal.displayName = 'Payment.Subtotal';
|
|
92
91
|
/**
|
|
@@ -101,7 +100,7 @@ Subtotal.displayName = 'Payment.Subtotal';
|
|
|
101
100
|
*/
|
|
102
101
|
export const Tax = React.forwardRef((props, ref) => {
|
|
103
102
|
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,
|
|
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 }) })) }));
|
|
105
104
|
});
|
|
106
105
|
Tax.displayName = 'Payment.Tax';
|
|
107
106
|
/**
|
|
@@ -126,10 +125,10 @@ Tax.displayName = 'Payment.Tax';
|
|
|
126
125
|
*/
|
|
127
126
|
export const Total = React.forwardRef((props, ref) => {
|
|
128
127
|
const { asChild, children, className } = props;
|
|
129
|
-
return (_jsx(CorePayment.Data, { children: ({ total, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className,
|
|
128
|
+
return (_jsx(CorePayment.Data, { children: ({ total, customPrice }) => (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, customElement: children, customElementProps: {
|
|
130
129
|
total,
|
|
131
130
|
customPrice,
|
|
132
|
-
}, children: total && _jsx(Money, { money: total }) })) }));
|
|
131
|
+
}, "data-testid": TestIds.paymentTotal, "data-has-custom-price": !!customPrice, children: total && _jsx(Money, { money: total }) })) }));
|
|
133
132
|
});
|
|
134
133
|
Total.displayName = 'Payment.Total';
|
|
135
134
|
/**
|
|
@@ -144,7 +143,7 @@ Total.displayName = 'Payment.Total';
|
|
|
144
143
|
*/
|
|
145
144
|
export const PayNow = React.forwardRef((props, ref) => {
|
|
146
145
|
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,
|
|
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 })) })) }));
|
|
148
147
|
});
|
|
149
148
|
PayNow.displayName = 'Payment.PayNow';
|
|
150
149
|
/**
|
|
@@ -159,7 +158,7 @@ PayNow.displayName = 'Payment.PayNow';
|
|
|
159
158
|
*/
|
|
160
159
|
export const PayLater = React.forwardRef((props, ref) => {
|
|
161
160
|
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,
|
|
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 })) })) }));
|
|
163
162
|
});
|
|
164
163
|
PayLater.displayName = 'Payment.PayLater';
|
|
165
164
|
/**
|
|
@@ -184,8 +183,8 @@ PayLater.displayName = 'Payment.PayLater';
|
|
|
184
183
|
* ```
|
|
185
184
|
*/
|
|
186
185
|
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, { ...
|
|
186
|
+
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 }) }) }) })) }));
|
|
189
188
|
});
|
|
190
189
|
LineItems.displayName = 'Payment.LineItems';
|
|
191
190
|
// Context for line items currency
|
|
@@ -252,8 +251,8 @@ LineItemRepeater.displayName = 'Payment.LineItemRepeater';
|
|
|
252
251
|
* ```
|
|
253
252
|
*/
|
|
254
253
|
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,
|
|
254
|
+
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 })) })) }));
|
|
257
256
|
});
|
|
258
257
|
LineItemTotal.displayName = 'Payment.LineItemTotal';
|
|
259
258
|
/**
|
|
@@ -267,8 +266,8 @@ LineItemTotal.displayName = 'Payment.LineItemTotal';
|
|
|
267
266
|
* ```
|
|
268
267
|
*/
|
|
269
268
|
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,
|
|
269
|
+
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 })) })) }));
|
|
272
271
|
});
|
|
273
272
|
LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
|
|
274
273
|
/**
|
|
@@ -283,6 +282,6 @@ LineItemSubtotal.displayName = 'Payment.LineItemSubtotal';
|
|
|
283
282
|
*/
|
|
284
283
|
export const LineItemDeposit = React.forwardRef((props, ref) => {
|
|
285
284
|
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,
|
|
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 }) })) }));
|
|
287
286
|
});
|
|
288
287
|
LineItemDeposit.displayName = 'Payment.LineItemDeposit';
|
|
@@ -7,6 +7,39 @@ import { AsChildChildren } from '@wix/headless-utils/react';
|
|
|
7
7
|
import { MoneyData } from '@wix/headless-components/react';
|
|
8
8
|
import { type Service, type Payment } from '@wix/auto_sdk_bookings_services';
|
|
9
9
|
import * as ServiceMediaModule from './ServiceMedia.js';
|
|
10
|
+
export declare const TestIds: {
|
|
11
|
+
readonly serviceRoot: "service-root";
|
|
12
|
+
readonly serviceName: "service-name";
|
|
13
|
+
readonly serviceDescription: "service-description";
|
|
14
|
+
readonly servicePrice: "service-price";
|
|
15
|
+
readonly serviceTagline: "service-tagline";
|
|
16
|
+
readonly serviceDurationInMinutes: "service-duration-in-minutes";
|
|
17
|
+
readonly serviceType: "service-type";
|
|
18
|
+
readonly serviceCategory: "service-category";
|
|
19
|
+
readonly serviceLocations: "service-locations";
|
|
20
|
+
readonly serviceLocation: "service-location";
|
|
21
|
+
readonly serviceLocationRepeater: "service-location-repeater";
|
|
22
|
+
readonly locationRoot: "location-root";
|
|
23
|
+
readonly serviceStaffMembers: "service-staff-members";
|
|
24
|
+
readonly serviceStaffMemberRepeater: "service-staff-member-repeater";
|
|
25
|
+
readonly serviceSchedule: "service-schedule";
|
|
26
|
+
readonly serviceDefaultCapacity: "service-default-capacity";
|
|
27
|
+
readonly serviceRaw: "service-raw";
|
|
28
|
+
readonly serviceActionSelect: "service-action-select";
|
|
29
|
+
readonly serviceActionAdd: "service-action-add";
|
|
30
|
+
readonly serviceActionRemove: "service-action-remove";
|
|
31
|
+
readonly servicePolicyLatestCancellationInMinutes: "service-policy-latest-cancellation-in-minutes";
|
|
32
|
+
readonly servicePolicyLatestBookingInMinutes: "service-policy-latest-booking-in-minutes";
|
|
33
|
+
readonly servicePolicyEarliestBookingInMinutes: "service-policy-earliest-booking-in-minutes";
|
|
34
|
+
readonly servicePolicyLatestRescheduleInMinutes: "service-policy-latest-reschedule-in-minutes";
|
|
35
|
+
readonly servicePolicyWaitlistCapacity: "service-policy-waitlist-capacity";
|
|
36
|
+
readonly servicePolicyBookAfterStartEnabled: "service-policy-book-after-start-enabled";
|
|
37
|
+
readonly servicePolicyMaxParticipantsPerBooking: "service-policy-max-participants-per-booking";
|
|
38
|
+
readonly serviceScheduleFirstSessionStart: "service-schedule-first-session-start";
|
|
39
|
+
readonly serviceScheduleLastSessionEnd: "service-schedule-last-session-end";
|
|
40
|
+
readonly serviceScheduleSessionDuration: "service-schedule-session-duration";
|
|
41
|
+
readonly serviceAvailableOnline: "service-available-online";
|
|
42
|
+
};
|
|
10
43
|
/**
|
|
11
44
|
* Base props shared by all Service.Root variants
|
|
12
45
|
*/
|
|
@@ -122,12 +155,11 @@ export declare const Root: React.ForwardRefExoticComponent<ServiceRootProps & Re
|
|
|
122
155
|
/**
|
|
123
156
|
* Props for Service Name component
|
|
124
157
|
*/
|
|
125
|
-
export interface NameProps {
|
|
158
|
+
export interface NameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
126
159
|
asChild?: boolean;
|
|
127
160
|
children?: AsChildChildren<{
|
|
128
161
|
name: string;
|
|
129
162
|
}>;
|
|
130
|
-
className?: string;
|
|
131
163
|
}
|
|
132
164
|
/**
|
|
133
165
|
* Displays the service name with customizable rendering.
|
|
@@ -157,12 +189,11 @@ export declare const Name: React.ForwardRefExoticComponent<NameProps & React.Ref
|
|
|
157
189
|
/**
|
|
158
190
|
* Props for Service Description component
|
|
159
191
|
*/
|
|
160
|
-
export interface DescriptionProps {
|
|
192
|
+
export interface DescriptionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
161
193
|
asChild?: boolean;
|
|
162
194
|
children?: AsChildChildren<{
|
|
163
195
|
description: string;
|
|
164
196
|
}>;
|
|
165
|
-
className?: string;
|
|
166
197
|
}
|
|
167
198
|
/**
|
|
168
199
|
* Displays the service description with customizable rendering.
|
|
@@ -231,12 +262,11 @@ export declare const Price: React.ForwardRefExoticComponent<PriceProps & React.R
|
|
|
231
262
|
/**
|
|
232
263
|
* Props for Service Tagline component
|
|
233
264
|
*/
|
|
234
|
-
export interface TaglineProps {
|
|
265
|
+
export interface TaglineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
235
266
|
asChild?: boolean;
|
|
236
267
|
children?: AsChildChildren<{
|
|
237
268
|
tagline: string;
|
|
238
269
|
}>;
|
|
239
|
-
className?: string;
|
|
240
270
|
}
|
|
241
271
|
/**
|
|
242
272
|
* Displays the service tagline with customizable rendering.
|
|
@@ -272,12 +302,11 @@ export declare const Tagline: React.ForwardRefExoticComponent<TaglineProps & Rea
|
|
|
272
302
|
/**
|
|
273
303
|
* Props for Service DurationInMinutes component
|
|
274
304
|
*/
|
|
275
|
-
export interface DurationInMinutesProps {
|
|
305
|
+
export interface DurationInMinutesProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
276
306
|
asChild?: boolean;
|
|
277
307
|
children?: AsChildChildren<{
|
|
278
308
|
duration: number;
|
|
279
309
|
}>;
|
|
280
|
-
className?: string;
|
|
281
310
|
}
|
|
282
311
|
/**
|
|
283
312
|
* Displays the service duration in minutes (raw number) with customizable rendering.
|
|
@@ -314,12 +343,11 @@ export declare const DurationInMinutes: React.ForwardRefExoticComponent<Duration
|
|
|
314
343
|
/**
|
|
315
344
|
* Props for Service Type component
|
|
316
345
|
*/
|
|
317
|
-
export interface TypeProps {
|
|
346
|
+
export interface TypeProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
318
347
|
asChild?: boolean;
|
|
319
348
|
children?: AsChildChildren<{
|
|
320
349
|
type: string;
|
|
321
350
|
}>;
|
|
322
|
-
className?: string;
|
|
323
351
|
}
|
|
324
352
|
/**
|
|
325
353
|
* Displays the service type (APPOINTMENT, CLASS, COURSE, etc.) with customizable rendering.
|
|
@@ -358,7 +386,7 @@ export declare const Type: React.ForwardRefExoticComponent<TypeProps & React.Ref
|
|
|
358
386
|
/**
|
|
359
387
|
* Props for Service Category component
|
|
360
388
|
*/
|
|
361
|
-
export interface CategoryProps {
|
|
389
|
+
export interface CategoryProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
362
390
|
asChild?: boolean;
|
|
363
391
|
children?: AsChildChildren<{
|
|
364
392
|
category: {
|
|
@@ -366,7 +394,6 @@ export interface CategoryProps {
|
|
|
366
394
|
_id?: string;
|
|
367
395
|
};
|
|
368
396
|
}>;
|
|
369
|
-
className?: string;
|
|
370
397
|
}
|
|
371
398
|
/**
|
|
372
399
|
* Displays the service category with customizable rendering.
|
|
@@ -1091,13 +1118,12 @@ export declare namespace Schedule {
|
|
|
1091
1118
|
/**
|
|
1092
1119
|
* Props for Service DefaultCapacity component
|
|
1093
1120
|
*/
|
|
1094
|
-
export interface DefaultCapacityProps {
|
|
1121
|
+
export interface DefaultCapacityProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1095
1122
|
asChild?: boolean;
|
|
1096
1123
|
children?: AsChildChildren<{
|
|
1097
1124
|
defaultCapacity: number;
|
|
1098
1125
|
isClassOrCourse: boolean;
|
|
1099
1126
|
}>;
|
|
1100
|
-
className?: string;
|
|
1101
1127
|
}
|
|
1102
1128
|
/**
|
|
1103
1129
|
* Displays the service default capacity with customizable rendering.
|
|
@@ -1121,12 +1147,11 @@ export declare const DefaultCapacity: React.ForwardRefExoticComponent<DefaultCap
|
|
|
1121
1147
|
/**
|
|
1122
1148
|
* Props for Service AvailableOnline component
|
|
1123
1149
|
*/
|
|
1124
|
-
export interface AvailableOnlineProps {
|
|
1150
|
+
export interface AvailableOnlineProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
|
|
1125
1151
|
asChild?: boolean;
|
|
1126
1152
|
children?: AsChildChildren<{
|
|
1127
1153
|
availableOnline: boolean;
|
|
1128
1154
|
}>;
|
|
1129
|
-
className?: string;
|
|
1130
1155
|
label?: string;
|
|
1131
1156
|
}
|
|
1132
1157
|
/**
|