@betterstore/react 0.7.1 → 0.7.3
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/dist/components/checkout-embed/appearance.d.ts +1 -2
- package/dist/components/checkout-embed/checkout-form-loading.d.ts +0 -1
- package/dist/components/checkout-embed/checkout-form.d.ts +6 -6
- package/dist/components/checkout-embed/checkout-schema.d.ts +41 -34
- package/dist/components/checkout-embed/color-utils.d.ts +0 -1
- package/dist/components/checkout-embed/index.d.ts +4 -5
- package/dist/components/checkout-embed/steps/customer/address-utils.d.ts +1 -2
- package/dist/components/checkout-embed/steps/customer/form.d.ts +15 -10
- package/dist/components/checkout-embed/steps/payment/form.d.ts +29 -20
- package/dist/components/checkout-embed/steps/payment/icons.d.ts +0 -1
- package/dist/components/checkout-embed/steps/shipping/form.d.ts +29 -17
- package/dist/components/checkout-embed/steps/shipping/providers/zasilkovna.d.ts +1 -2
- package/dist/components/checkout-embed/steps/shipping/shipping-option-wrapper.d.ts +2 -3
- package/dist/components/checkout-embed/steps/summary/discount-code.d.ts +0 -1
- package/dist/components/checkout-embed/steps/summary/index.d.ts +1 -2
- package/dist/components/checkout-embed/steps/summary/loading.d.ts +0 -1
- package/dist/components/checkout-embed/useFormStore.d.ts +4 -5
- package/dist/components/{compounds/form → form}/address-input/country-data.d.ts +1 -1
- package/dist/components/form/address-input/index.d.ts +11 -0
- package/dist/components/{compounds/form → form}/address-input/province-data.d.ts +0 -1
- package/dist/components/form/compobox-controller/index.d.ts +17 -0
- package/dist/components/form/country-input/index.d.ts +10 -0
- package/dist/components/{compounds/form → form}/floating-label.d.ts +0 -1
- package/dist/components/{compounds/form → form}/form-messages.d.ts +0 -1
- package/dist/components/form/input-controller.d.ts +10 -0
- package/dist/components/form/phone-input/component.d.ts +8 -0
- package/dist/components/form/phone-input/index.d.ts +12 -0
- package/dist/components/form/phone-input/schema.d.ts +3 -0
- package/dist/components/{compounds/form → form}/submit-button.d.ts +1 -2
- package/dist/components/index.d.ts +3 -4
- package/dist/components/payment-element/checkout-form.d.ts +1 -2
- package/dist/components/payment-element/index.d.ts +3 -4
- package/dist/components/payment-element/useCheckout.d.ts +1 -2
- package/dist/components/ui/button.d.ts +3 -4
- package/dist/components/ui/checkbox.d.ts +1 -2
- package/dist/components/ui/command.d.ts +6 -5
- package/dist/components/ui/dialog.d.ts +3 -2
- package/dist/components/ui/dropdown-menu.d.ts +2 -3
- package/dist/components/ui/form.d.ts +6 -7
- package/dist/components/ui/input.d.ts +0 -1
- package/dist/components/ui/label.d.ts +1 -2
- package/dist/components/ui/popover.d.ts +2 -3
- package/dist/components/ui/radio-group.d.ts +1 -2
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/sonner.d.ts +1 -2
- package/dist/dev/dev.d.ts +0 -2
- package/dist/dev/generate-test-checkout.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/{components/cart/useCart.d.ts → hooks/use-cart.d.ts} +19 -2
- package/dist/i18n/index.d.ts +2 -4
- package/dist/index.cjs.js +67 -38483
- package/dist/index.d.ts +3 -3
- package/dist/index.es.js +31500 -0
- package/dist/lib/error-message-utils.d.ts +1 -2
- package/dist/lib/utils.d.ts +1 -2
- package/dist/stores/checkout-form-store.d.ts +24 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/payment-checkout-store.d.ts +9 -0
- package/dist/types/checkout.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale.d.ts +2 -0
- package/dist/types.d.ts +1 -2
- package/dist/utils/address.d.ts +2 -0
- package/dist/utils/checkout.d.ts +4 -0
- package/dist/utils/error-message.d.ts +4 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/payment.d.ts +7 -0
- package/package.json +25 -27
- package/dist/components/cart/useCart.d.ts.map +0 -1
- package/dist/components/checkout-embed/appearance.d.ts.map +0 -1
- package/dist/components/checkout-embed/checkout-form-loading.d.ts.map +0 -1
- package/dist/components/checkout-embed/checkout-form.d.ts.map +0 -1
- package/dist/components/checkout-embed/checkout-schema.d.ts.map +0 -1
- package/dist/components/checkout-embed/color-utils.d.ts.map +0 -1
- package/dist/components/checkout-embed/index.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/customer/address-utils.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/customer/form.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/payment/form.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/payment/icons.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/shipping/form.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/shipping/providers/zasilkovna.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/shipping/shipping-option-wrapper.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/summary/discount-code.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/summary/index.d.ts.map +0 -1
- package/dist/components/checkout-embed/steps/summary/loading.d.ts.map +0 -1
- package/dist/components/checkout-embed/useFormStore.d.ts.map +0 -1
- package/dist/components/compounds/form/address-input/country-data.d.ts.map +0 -1
- package/dist/components/compounds/form/address-input/index.d.ts +0 -12
- package/dist/components/compounds/form/address-input/index.d.ts.map +0 -1
- package/dist/components/compounds/form/address-input/province-data.d.ts.map +0 -1
- package/dist/components/compounds/form/compobox-group/index.d.ts +0 -18
- package/dist/components/compounds/form/compobox-group/index.d.ts.map +0 -1
- package/dist/components/compounds/form/country-input/index.d.ts +0 -11
- package/dist/components/compounds/form/country-input/index.d.ts.map +0 -1
- package/dist/components/compounds/form/floating-label.d.ts.map +0 -1
- package/dist/components/compounds/form/form-messages.d.ts.map +0 -1
- package/dist/components/compounds/form/input-group.d.ts +0 -11
- package/dist/components/compounds/form/input-group.d.ts.map +0 -1
- package/dist/components/compounds/form/submit-button.d.ts.map +0 -1
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/payment-element/checkout-form.d.ts.map +0 -1
- package/dist/components/payment-element/index.d.ts.map +0 -1
- package/dist/components/payment-element/useCheckout.d.ts.map +0 -1
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/checkbox.d.ts.map +0 -1
- package/dist/components/ui/command.d.ts.map +0 -1
- package/dist/components/ui/dialog.d.ts.map +0 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +0 -1
- package/dist/components/ui/form.d.ts.map +0 -1
- package/dist/components/ui/input.d.ts.map +0 -1
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/popover.d.ts.map +0 -1
- package/dist/components/ui/radio-group.d.ts.map +0 -1
- package/dist/components/ui/skeleton.d.ts.map +0 -1
- package/dist/components/ui/sonner.d.ts.map +0 -1
- package/dist/dev/dev.d.ts.map +0 -1
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.mjs +0 -38461
- package/dist/lib/error-message-utils.d.ts.map +0 -1
- package/dist/lib/utils.d.ts.map +0 -1
- package/dist/types.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Appearance as StripeAppearance, StripeElementsOptions } from
|
|
1
|
+
import { Appearance as StripeAppearance, StripeElementsOptions } from '@stripe/stripe-js';
|
|
2
2
|
export type Themes = "dark" | "light";
|
|
3
3
|
export type Fonts = StripeElementsOptions["fonts"];
|
|
4
4
|
export type AppearanceConfig = {
|
|
@@ -27,4 +27,3 @@ export type AppearanceConfig = {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
export declare const convertCheckoutAppearanceToStripeAppearance: (appearance?: AppearanceConfig, fonts?: Fonts) => StripeAppearance;
|
|
30
|
-
//# sourceMappingURL=appearance.d.ts.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { createBetterStoreClient, GetCheckoutResponse } from
|
|
2
|
-
import { StripeElementLocale } from
|
|
3
|
-
import { AppearanceConfig, Fonts } from
|
|
1
|
+
import { createBetterStoreClient, GetCheckoutResponse } from '@betterstore/sdk';
|
|
2
|
+
import { StripeElementLocale } from '@stripe/stripe-js';
|
|
3
|
+
import { AppearanceConfig, Fonts } from './appearance';
|
|
4
4
|
interface CheckoutFormProps {
|
|
5
5
|
storeClient: ReturnType<typeof createBetterStoreClient>;
|
|
6
6
|
checkoutId: string;
|
|
7
7
|
onSuccess: () => void;
|
|
8
8
|
onError: () => void;
|
|
9
9
|
cancelUrl: string;
|
|
10
|
-
|
|
10
|
+
checkoutSecret: string;
|
|
11
|
+
customerData?: GetCheckoutResponse["customerData"];
|
|
11
12
|
customer?: GetCheckoutResponse["customer"];
|
|
12
13
|
currency: string;
|
|
13
14
|
checkoutAppearance?: AppearanceConfig;
|
|
@@ -24,6 +25,5 @@ interface CheckoutFormProps {
|
|
|
24
25
|
currentAlpha3CountryCode?: string;
|
|
25
26
|
shipments: GetCheckoutResponse["shipments"];
|
|
26
27
|
}
|
|
27
|
-
export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
28
|
+
export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, checkoutSecret, customer, customerData, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, paymentComponentKey, clientProxy, latitude, longitude, currentAlpha3CountryCode, shipments, }: CheckoutFormProps): import("react/jsx-runtime").JSX.Element;
|
|
28
29
|
export {};
|
|
29
|
-
//# sourceMappingURL=checkout-form.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const customerSchema: z.ZodObject<{
|
|
3
3
|
email: z.ZodString;
|
|
4
4
|
firstName: z.ZodString;
|
|
@@ -34,8 +34,9 @@ export declare const customerSchema: z.ZodObject<{
|
|
|
34
34
|
provinceCode?: string | null | undefined;
|
|
35
35
|
company?: string | null | undefined;
|
|
36
36
|
}>;
|
|
37
|
-
phone: z.ZodString
|
|
38
|
-
|
|
37
|
+
phone: z.ZodEffects<z.ZodString, string, string>;
|
|
38
|
+
isSubscribedEmail: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
isSubscribedSMS: z.ZodOptional<z.ZodBoolean>;
|
|
39
40
|
}, "strip", z.ZodTypeAny, {
|
|
40
41
|
email: string;
|
|
41
42
|
firstName: string;
|
|
@@ -52,7 +53,8 @@ export declare const customerSchema: z.ZodObject<{
|
|
|
52
53
|
company?: string | null | undefined;
|
|
53
54
|
};
|
|
54
55
|
phone: string;
|
|
55
|
-
|
|
56
|
+
isSubscribedEmail?: boolean | undefined;
|
|
57
|
+
isSubscribedSMS?: boolean | undefined;
|
|
56
58
|
}, {
|
|
57
59
|
email: string;
|
|
58
60
|
firstName: string;
|
|
@@ -69,41 +71,42 @@ export declare const customerSchema: z.ZodObject<{
|
|
|
69
71
|
company?: string | null | undefined;
|
|
70
72
|
};
|
|
71
73
|
phone: string;
|
|
72
|
-
|
|
74
|
+
isSubscribedEmail?: boolean | undefined;
|
|
75
|
+
isSubscribedSMS?: boolean | undefined;
|
|
73
76
|
}>;
|
|
74
77
|
export declare const shipmentsFormSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
75
78
|
rateId: z.ZodString;
|
|
76
|
-
|
|
79
|
+
carrierId: z.ZodOptional<z.ZodString>;
|
|
77
80
|
priceInCents: z.ZodNumber;
|
|
78
81
|
pickupPointId: z.ZodOptional<z.ZodString>;
|
|
79
82
|
pickupPointDisplayName: z.ZodOptional<z.ZodString>;
|
|
80
83
|
displayName: z.ZodString;
|
|
81
84
|
}, "strip", z.ZodTypeAny, {
|
|
82
85
|
priceInCents: number;
|
|
83
|
-
displayName: string;
|
|
84
86
|
rateId: string;
|
|
85
|
-
|
|
87
|
+
displayName: string;
|
|
88
|
+
carrierId?: string | undefined;
|
|
86
89
|
pickupPointId?: string | undefined;
|
|
87
90
|
pickupPointDisplayName?: string | undefined;
|
|
88
91
|
}, {
|
|
89
92
|
priceInCents: number;
|
|
90
|
-
displayName: string;
|
|
91
93
|
rateId: string;
|
|
92
|
-
|
|
94
|
+
displayName: string;
|
|
95
|
+
carrierId?: string | undefined;
|
|
93
96
|
pickupPointId?: string | undefined;
|
|
94
97
|
pickupPointDisplayName?: string | undefined;
|
|
95
98
|
}>>, Record<string, {
|
|
96
99
|
priceInCents: number;
|
|
97
|
-
displayName: string;
|
|
98
100
|
rateId: string;
|
|
99
|
-
|
|
101
|
+
displayName: string;
|
|
102
|
+
carrierId?: string | undefined;
|
|
100
103
|
pickupPointId?: string | undefined;
|
|
101
104
|
pickupPointDisplayName?: string | undefined;
|
|
102
105
|
}>, Record<string, {
|
|
103
106
|
priceInCents: number;
|
|
104
|
-
displayName: string;
|
|
105
107
|
rateId: string;
|
|
106
|
-
|
|
108
|
+
displayName: string;
|
|
109
|
+
carrierId?: string | undefined;
|
|
107
110
|
pickupPointId?: string | undefined;
|
|
108
111
|
pickupPointDisplayName?: string | undefined;
|
|
109
112
|
}>>;
|
|
@@ -143,8 +146,9 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
143
146
|
provinceCode?: string | null | undefined;
|
|
144
147
|
company?: string | null | undefined;
|
|
145
148
|
}>;
|
|
146
|
-
phone: z.ZodString
|
|
147
|
-
|
|
149
|
+
phone: z.ZodEffects<z.ZodString, string, string>;
|
|
150
|
+
isSubscribedEmail: z.ZodOptional<z.ZodBoolean>;
|
|
151
|
+
isSubscribedSMS: z.ZodOptional<z.ZodBoolean>;
|
|
148
152
|
}, "strip", z.ZodTypeAny, {
|
|
149
153
|
email: string;
|
|
150
154
|
firstName: string;
|
|
@@ -161,7 +165,8 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
161
165
|
company?: string | null | undefined;
|
|
162
166
|
};
|
|
163
167
|
phone: string;
|
|
164
|
-
|
|
168
|
+
isSubscribedEmail?: boolean | undefined;
|
|
169
|
+
isSubscribedSMS?: boolean | undefined;
|
|
165
170
|
}, {
|
|
166
171
|
email: string;
|
|
167
172
|
firstName: string;
|
|
@@ -178,41 +183,42 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
178
183
|
company?: string | null | undefined;
|
|
179
184
|
};
|
|
180
185
|
phone: string;
|
|
181
|
-
|
|
186
|
+
isSubscribedEmail?: boolean | undefined;
|
|
187
|
+
isSubscribedSMS?: boolean | undefined;
|
|
182
188
|
}>;
|
|
183
189
|
shipping: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
184
190
|
rateId: z.ZodString;
|
|
185
|
-
|
|
191
|
+
carrierId: z.ZodOptional<z.ZodString>;
|
|
186
192
|
priceInCents: z.ZodNumber;
|
|
187
193
|
pickupPointId: z.ZodOptional<z.ZodString>;
|
|
188
194
|
pickupPointDisplayName: z.ZodOptional<z.ZodString>;
|
|
189
195
|
displayName: z.ZodString;
|
|
190
196
|
}, "strip", z.ZodTypeAny, {
|
|
191
197
|
priceInCents: number;
|
|
192
|
-
displayName: string;
|
|
193
198
|
rateId: string;
|
|
194
|
-
|
|
199
|
+
displayName: string;
|
|
200
|
+
carrierId?: string | undefined;
|
|
195
201
|
pickupPointId?: string | undefined;
|
|
196
202
|
pickupPointDisplayName?: string | undefined;
|
|
197
203
|
}, {
|
|
198
204
|
priceInCents: number;
|
|
199
|
-
displayName: string;
|
|
200
205
|
rateId: string;
|
|
201
|
-
|
|
206
|
+
displayName: string;
|
|
207
|
+
carrierId?: string | undefined;
|
|
202
208
|
pickupPointId?: string | undefined;
|
|
203
209
|
pickupPointDisplayName?: string | undefined;
|
|
204
210
|
}>>, Record<string, {
|
|
205
211
|
priceInCents: number;
|
|
206
|
-
displayName: string;
|
|
207
212
|
rateId: string;
|
|
208
|
-
|
|
213
|
+
displayName: string;
|
|
214
|
+
carrierId?: string | undefined;
|
|
209
215
|
pickupPointId?: string | undefined;
|
|
210
216
|
pickupPointDisplayName?: string | undefined;
|
|
211
217
|
}>, Record<string, {
|
|
212
218
|
priceInCents: number;
|
|
213
|
-
displayName: string;
|
|
214
219
|
rateId: string;
|
|
215
|
-
|
|
220
|
+
displayName: string;
|
|
221
|
+
carrierId?: string | undefined;
|
|
216
222
|
pickupPointId?: string | undefined;
|
|
217
223
|
pickupPointDisplayName?: string | undefined;
|
|
218
224
|
}>>;
|
|
@@ -234,13 +240,14 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
234
240
|
company?: string | null | undefined;
|
|
235
241
|
};
|
|
236
242
|
phone: string;
|
|
237
|
-
|
|
243
|
+
isSubscribedEmail?: boolean | undefined;
|
|
244
|
+
isSubscribedSMS?: boolean | undefined;
|
|
238
245
|
};
|
|
239
246
|
shipping: Record<string, {
|
|
240
247
|
priceInCents: number;
|
|
241
|
-
displayName: string;
|
|
242
248
|
rateId: string;
|
|
243
|
-
|
|
249
|
+
displayName: string;
|
|
250
|
+
carrierId?: string | undefined;
|
|
244
251
|
pickupPointId?: string | undefined;
|
|
245
252
|
pickupPointDisplayName?: string | undefined;
|
|
246
253
|
}>;
|
|
@@ -262,13 +269,14 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
262
269
|
company?: string | null | undefined;
|
|
263
270
|
};
|
|
264
271
|
phone: string;
|
|
265
|
-
|
|
272
|
+
isSubscribedEmail?: boolean | undefined;
|
|
273
|
+
isSubscribedSMS?: boolean | undefined;
|
|
266
274
|
};
|
|
267
275
|
shipping: Record<string, {
|
|
268
276
|
priceInCents: number;
|
|
269
|
-
displayName: string;
|
|
270
277
|
rateId: string;
|
|
271
|
-
|
|
278
|
+
displayName: string;
|
|
279
|
+
carrierId?: string | undefined;
|
|
272
280
|
pickupPointId?: string | undefined;
|
|
273
281
|
pickupPointDisplayName?: string | undefined;
|
|
274
282
|
}>;
|
|
@@ -277,4 +285,3 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
277
285
|
export type CheckoutFormData = z.infer<typeof checkoutSchema>;
|
|
278
286
|
export type CustomerFormData = z.infer<typeof customerSchema>;
|
|
279
287
|
export type ShipmentsFormData = z.infer<typeof shipmentsFormSchema>;
|
|
280
|
-
//# sourceMappingURL=checkout-schema.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Locale } from
|
|
2
|
-
import React from
|
|
3
|
-
import { AppearanceConfig, Fonts } from
|
|
1
|
+
import { Locale } from '../../types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { AppearanceConfig, Fonts } from './appearance';
|
|
4
4
|
interface CheckoutEmbedProps {
|
|
5
5
|
checkoutId: string;
|
|
6
6
|
config: {
|
|
7
|
-
|
|
7
|
+
checkoutSecret: string;
|
|
8
8
|
cancelUrl: string;
|
|
9
9
|
successUrl: string;
|
|
10
10
|
appearance?: AppearanceConfig;
|
|
@@ -16,4 +16,3 @@ interface CheckoutEmbedProps {
|
|
|
16
16
|
declare function CheckoutEmbedComponent({ checkoutId, config }: CheckoutEmbedProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare const CheckoutEmbed: React.MemoExoticComponent<typeof CheckoutEmbedComponent>;
|
|
18
18
|
export { CheckoutEmbed };
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CustomerFormData } from '../../checkout-schema';
|
|
2
2
|
interface CustomerFormProps {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
form: {
|
|
4
|
+
initialData?: CustomerFormData;
|
|
5
|
+
onSubmit: (data: CustomerFormData) => void;
|
|
6
|
+
};
|
|
7
|
+
api: {
|
|
8
|
+
checkoutSecret: string;
|
|
9
|
+
clientProxy?: string;
|
|
10
|
+
};
|
|
11
|
+
location?: {
|
|
12
|
+
latitude?: number;
|
|
13
|
+
longitude?: number;
|
|
14
|
+
countryCode?: string;
|
|
15
|
+
};
|
|
10
16
|
locale?: string;
|
|
11
17
|
}
|
|
12
|
-
export default function CustomerForm({
|
|
18
|
+
export default function CustomerForm({ form: formProps, api, location, locale, }: CustomerFormProps): import("react/jsx-runtime").JSX.Element;
|
|
13
19
|
export {};
|
|
14
|
-
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CheckoutFormStore } from '../../../../stores/checkout-form-store';
|
|
2
|
+
import { StripeElementLocale } from '@stripe/stripe-js';
|
|
3
|
+
import { AppearanceConfig, Fonts } from '../../appearance';
|
|
4
4
|
interface PaymentFormProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
payment: {
|
|
6
|
+
secret: string | null;
|
|
7
|
+
publicKey: string | null;
|
|
8
|
+
componentKey: number;
|
|
9
|
+
};
|
|
10
|
+
callbacks: {
|
|
11
|
+
onSuccess: () => void;
|
|
12
|
+
onError: () => void;
|
|
13
|
+
onBack: () => void;
|
|
14
|
+
onDoubleBack: () => void;
|
|
15
|
+
};
|
|
16
|
+
customerInfo: {
|
|
17
|
+
email: string;
|
|
18
|
+
address: string;
|
|
19
|
+
shippingData: NonNullable<CheckoutFormStore["formData"]["shipping"]>;
|
|
20
|
+
};
|
|
21
|
+
appearance?: {
|
|
22
|
+
config?: AppearanceConfig;
|
|
23
|
+
fonts?: Fonts;
|
|
24
|
+
locale?: StripeElementLocale;
|
|
25
|
+
};
|
|
26
|
+
currency: {
|
|
27
|
+
code: string;
|
|
28
|
+
exchangeRate: number;
|
|
29
|
+
};
|
|
20
30
|
}
|
|
21
|
-
export default function PaymentForm({
|
|
31
|
+
export default function PaymentForm({ payment, callbacks, customerInfo, appearance, currency, }: PaymentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
22
32
|
export {};
|
|
23
|
-
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
import { GetCheckoutResponse, GetShippingRatesResponse } from
|
|
2
|
-
import {
|
|
3
|
-
import { FormStore } from "../../useFormStore";
|
|
1
|
+
import { GetCheckoutResponse, GetShippingRatesResponse } from '@betterstore/sdk';
|
|
2
|
+
import { ShipmentsFormData } from '../../checkout-schema';
|
|
4
3
|
export type ShippingRate = GetShippingRatesResponse["rates"][number];
|
|
5
4
|
interface ShipmentsFormProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
form: {
|
|
6
|
+
initialData?: ShipmentsFormData;
|
|
7
|
+
onSubmit: (data: ShipmentsFormData) => void;
|
|
8
|
+
onBack: () => void;
|
|
9
|
+
};
|
|
10
|
+
shipping: {
|
|
11
|
+
rates: GetShippingRatesResponse | undefined;
|
|
12
|
+
shipments: GetCheckoutResponse["shipments"];
|
|
13
|
+
};
|
|
14
|
+
customer: {
|
|
15
|
+
email: string;
|
|
16
|
+
address: string;
|
|
17
|
+
countryCode?: string;
|
|
18
|
+
};
|
|
19
|
+
currency: {
|
|
20
|
+
code: string;
|
|
21
|
+
exchangeRate: number;
|
|
22
|
+
};
|
|
14
23
|
locale?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
onShippingDataChange?: (shipmentId: string, data: {
|
|
25
|
+
rateId: string;
|
|
26
|
+
carrierId?: string;
|
|
27
|
+
priceInCents: number;
|
|
28
|
+
displayName: string;
|
|
29
|
+
pickupPointId: string;
|
|
30
|
+
pickupPointDisplayName: string;
|
|
31
|
+
}) => void;
|
|
19
32
|
}
|
|
20
|
-
export default function ShipmentsShippingMethodForm({
|
|
33
|
+
export default function ShipmentsShippingMethodForm({ form: formProps, shipping, customer, currency, locale, onShippingDataChange, }: ShipmentsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
21
34
|
export {};
|
|
22
|
-
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
declare global {
|
|
3
3
|
interface Window {
|
|
4
4
|
Packeta: any;
|
|
@@ -11,4 +11,3 @@ export default function ZasilkovnaShippingOption({ children, onPickupPointSelect
|
|
|
11
11
|
countryCode?: string;
|
|
12
12
|
apiKey?: string;
|
|
13
13
|
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
//# sourceMappingURL=zasilkovna.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ShippingRate } from
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ShippingRate } from './form';
|
|
3
3
|
export default function ShippingOptionWrapper({ rate, children, onPickupPointSelected, locale, countryCode, }: {
|
|
4
4
|
rate: ShippingRate;
|
|
5
5
|
children: React.ReactNode;
|
|
@@ -7,4 +7,3 @@ export default function ShippingOptionWrapper({ rate, children, onPickupPointSel
|
|
|
7
7
|
locale?: string;
|
|
8
8
|
countryCode?: string;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=shipping-option-wrapper.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetCheckoutResponse } from
|
|
1
|
+
import { GetCheckoutResponse } from '@betterstore/sdk';
|
|
2
2
|
export default function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency, onCancel, exchangeRate, applyDiscountCode, removeDiscount, }: {
|
|
3
3
|
appliedDiscounts: GetCheckoutResponse["appliedDiscounts"];
|
|
4
4
|
lineItems: GetCheckoutResponse["lineItems"];
|
|
@@ -10,4 +10,3 @@ export default function CheckoutSummary({ appliedDiscounts, lineItems, shipping,
|
|
|
10
10
|
applyDiscountCode: (code: string) => Promise<void>;
|
|
11
11
|
removeDiscount: (id: string) => Promise<void>;
|
|
12
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckoutFormData } from
|
|
1
|
+
import { CheckoutFormData } from './checkout-schema';
|
|
2
2
|
export type CheckoutStep = "customer" | "shipping" | "payment";
|
|
3
3
|
export interface FormStore {
|
|
4
4
|
formData: Partial<CheckoutFormData>;
|
|
@@ -8,18 +8,17 @@ export interface FormStore {
|
|
|
8
8
|
checkoutId: string;
|
|
9
9
|
setCheckoutId: (checkoutId: string) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare const useFormStore: import(
|
|
11
|
+
export declare const useFormStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<FormStore>, "setState" | "persist"> & {
|
|
12
12
|
setState(partial: FormStore | Partial<FormStore> | ((state: FormStore) => FormStore | Partial<FormStore>), replace?: false | undefined): unknown;
|
|
13
13
|
setState(state: FormStore | ((state: FormStore) => FormStore), replace: true): unknown;
|
|
14
14
|
persist: {
|
|
15
|
-
setOptions: (options: Partial<import(
|
|
15
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<FormStore, FormStore, unknown>>) => void;
|
|
16
16
|
clearStorage: () => void;
|
|
17
17
|
rehydrate: () => Promise<void> | void;
|
|
18
18
|
hasHydrated: () => boolean;
|
|
19
19
|
onHydrate: (fn: (state: FormStore) => void) => () => void;
|
|
20
20
|
onFinishHydration: (fn: (state: FormStore) => void) => () => void;
|
|
21
|
-
getOptions: () => Partial<import(
|
|
21
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<FormStore, FormStore, unknown>>;
|
|
22
22
|
};
|
|
23
23
|
}>;
|
|
24
24
|
export declare const resetFormStore: (formData: Partial<CheckoutFormData>) => void;
|
|
25
|
-
//# sourceMappingURL=useFormStore.d.ts.map
|
|
@@ -5,4 +5,4 @@ export interface Country {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const enCountries: Country[];
|
|
7
7
|
export declare const getCountriesByLocale: (locale?: string) => Country[];
|
|
8
|
-
|
|
8
|
+
export declare const getAlpha2ByAlpha3: (alpha3: string) => string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface AddressInputProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
proxy?: string;
|
|
4
|
+
checkoutSecret: string;
|
|
5
|
+
latitude?: number;
|
|
6
|
+
longitude?: number;
|
|
7
|
+
currentAlpha3CountryCode?: string;
|
|
8
|
+
locale?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function AddressInput({ className, proxy, checkoutSecret, latitude, longitude, currentAlpha3CountryCode, locale, }: AddressInputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
2
|
+
type CompoboxControllerProps = {
|
|
3
|
+
form: UseFormReturn<any>;
|
|
4
|
+
name: string;
|
|
5
|
+
label: string;
|
|
6
|
+
options: {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
searchText: string;
|
|
11
|
+
emptyText: string;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
onSelect?: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
export default function CompoboxController({ form, name, label, options, searchText, emptyText, required, className, onSelect, }: CompoboxControllerProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as CompoboxController } from '../compobox-controller';
|
|
3
|
+
type CountryInputProps = {
|
|
4
|
+
locale?: string;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
} & Omit<React.ComponentProps<typeof CompoboxController>, "name" | "options">;
|
|
9
|
+
export default function CountryInput({ form, prefix, label, locale, ...props }: CountryInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -5,4 +5,3 @@ interface FormMessagesProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function FormMessages({ messages, type, className, ...props }: FormMessagesProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=form-messages.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Input } from '../ui/input';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type InputControllerProps = {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
showIcon?: boolean;
|
|
8
|
+
} & Omit<React.ComponentProps<typeof Input>, "placeholder">;
|
|
9
|
+
export default function InputController({ name, label, className, icon, showIcon, ...props }: InputControllerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as RPNInput from "react-phone-number-input";
|
|
3
|
+
type PhoneInputComponentProps = Omit<React.ComponentProps<"input">, "onChange" | "value" | "ref"> & Omit<RPNInput.Props<typeof RPNInput.default>, "onChange"> & {
|
|
4
|
+
onChange?: (value: RPNInput.Value) => void;
|
|
5
|
+
locale?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const PhoneInputComponent: React.ForwardRefExoticComponent<PhoneInputComponentProps>;
|
|
8
|
+
export { PhoneInputComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PhoneInputComponent } from './component';
|
|
3
|
+
type PhoneInputProps = {
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
defaultCountry?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
locale?: string;
|
|
10
|
+
} & Omit<React.ComponentProps<typeof PhoneInputComponent>, "name" | "defaultCountry" | "international" | "placeholder">;
|
|
11
|
+
export declare function PhoneInput({ name, label, className, defaultCountry, required, locale, ...props }: PhoneInputProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Button } from
|
|
1
|
+
import { Button } from '../ui/button';
|
|
2
2
|
type SubmitButtonProps = Parameters<typeof Button>[0] & {
|
|
3
3
|
isSubmitting: boolean;
|
|
4
4
|
isValid: boolean;
|
|
5
5
|
};
|
|
6
6
|
export default function SubmitButton({ isSubmitting, isValid, className, variant, children, size, ...props }: SubmitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=submit-button.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { CheckoutEmbed } from
|
|
3
|
-
export {
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from '../hooks/use-cart';
|
|
2
|
+
export { CheckoutEmbed } from './checkout-embed';
|
|
3
|
+
export { usePaymentCheckout } from '../stores/payment-checkout-store';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
declare const _default: React.MemoExoticComponent<({ onSuccess, onError, children, setSubmitting, }: {
|
|
3
3
|
onSuccess?: () => void;
|
|
4
4
|
onError?: () => void;
|
|
@@ -6,4 +6,3 @@ declare const _default: React.MemoExoticComponent<({ onSuccess, onError, childre
|
|
|
6
6
|
setSubmitting?: (isSubmitting: boolean) => void;
|
|
7
7
|
}) => import("react/jsx-runtime").JSX.Element>;
|
|
8
8
|
export default _default;
|
|
9
|
-
//# sourceMappingURL=checkout-form.d.ts.map
|