@betterstore/react 0.7.2 → 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 +3 -4
- package/dist/components/checkout-embed/checkout-schema.d.ts +13 -14
- package/dist/components/checkout-embed/color-utils.d.ts +0 -1
- package/dist/components/checkout-embed/index.d.ts +3 -4
- 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/{compounds/form → form}/address-input/index.d.ts +0 -1
- 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 +0 -1
- 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 -38497
- 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 +22 -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.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-data.d.ts +0 -5
- package/dist/dev/dev-data.d.ts.map +0 -1
- package/dist/dev/dev.d.ts.map +0 -1
- package/dist/dev/generate-test-checkout.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 -38475
- 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,6 +1,6 @@
|
|
|
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;
|
|
@@ -27,4 +27,3 @@ interface CheckoutFormProps {
|
|
|
27
27
|
}
|
|
28
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;
|
|
29
29
|
export {};
|
|
30
|
-
//# 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,7 +34,7 @@ export declare const customerSchema: z.ZodObject<{
|
|
|
34
34
|
provinceCode?: string | null | undefined;
|
|
35
35
|
company?: string | null | undefined;
|
|
36
36
|
}>;
|
|
37
|
-
phone: z.ZodString
|
|
37
|
+
phone: z.ZodEffects<z.ZodString, string, string>;
|
|
38
38
|
isSubscribedEmail: z.ZodOptional<z.ZodBoolean>;
|
|
39
39
|
isSubscribedSMS: z.ZodOptional<z.ZodBoolean>;
|
|
40
40
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -83,29 +83,29 @@ export declare const shipmentsFormSchema: z.ZodEffects<z.ZodRecord<z.ZodString,
|
|
|
83
83
|
displayName: z.ZodString;
|
|
84
84
|
}, "strip", z.ZodTypeAny, {
|
|
85
85
|
priceInCents: number;
|
|
86
|
-
displayName: string;
|
|
87
86
|
rateId: string;
|
|
87
|
+
displayName: string;
|
|
88
88
|
carrierId?: string | undefined;
|
|
89
89
|
pickupPointId?: string | undefined;
|
|
90
90
|
pickupPointDisplayName?: string | undefined;
|
|
91
91
|
}, {
|
|
92
92
|
priceInCents: number;
|
|
93
|
-
displayName: string;
|
|
94
93
|
rateId: string;
|
|
94
|
+
displayName: string;
|
|
95
95
|
carrierId?: string | undefined;
|
|
96
96
|
pickupPointId?: string | undefined;
|
|
97
97
|
pickupPointDisplayName?: string | undefined;
|
|
98
98
|
}>>, Record<string, {
|
|
99
99
|
priceInCents: number;
|
|
100
|
-
displayName: string;
|
|
101
100
|
rateId: string;
|
|
101
|
+
displayName: string;
|
|
102
102
|
carrierId?: string | undefined;
|
|
103
103
|
pickupPointId?: string | undefined;
|
|
104
104
|
pickupPointDisplayName?: string | undefined;
|
|
105
105
|
}>, Record<string, {
|
|
106
106
|
priceInCents: number;
|
|
107
|
-
displayName: string;
|
|
108
107
|
rateId: string;
|
|
108
|
+
displayName: string;
|
|
109
109
|
carrierId?: string | undefined;
|
|
110
110
|
pickupPointId?: string | undefined;
|
|
111
111
|
pickupPointDisplayName?: string | undefined;
|
|
@@ -146,7 +146,7 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
146
146
|
provinceCode?: string | null | undefined;
|
|
147
147
|
company?: string | null | undefined;
|
|
148
148
|
}>;
|
|
149
|
-
phone: z.ZodString
|
|
149
|
+
phone: z.ZodEffects<z.ZodString, string, string>;
|
|
150
150
|
isSubscribedEmail: z.ZodOptional<z.ZodBoolean>;
|
|
151
151
|
isSubscribedSMS: z.ZodOptional<z.ZodBoolean>;
|
|
152
152
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -195,29 +195,29 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
195
195
|
displayName: z.ZodString;
|
|
196
196
|
}, "strip", z.ZodTypeAny, {
|
|
197
197
|
priceInCents: number;
|
|
198
|
-
displayName: string;
|
|
199
198
|
rateId: string;
|
|
199
|
+
displayName: string;
|
|
200
200
|
carrierId?: string | undefined;
|
|
201
201
|
pickupPointId?: string | undefined;
|
|
202
202
|
pickupPointDisplayName?: string | undefined;
|
|
203
203
|
}, {
|
|
204
204
|
priceInCents: number;
|
|
205
|
-
displayName: string;
|
|
206
205
|
rateId: string;
|
|
206
|
+
displayName: string;
|
|
207
207
|
carrierId?: string | undefined;
|
|
208
208
|
pickupPointId?: string | undefined;
|
|
209
209
|
pickupPointDisplayName?: string | undefined;
|
|
210
210
|
}>>, Record<string, {
|
|
211
211
|
priceInCents: number;
|
|
212
|
-
displayName: string;
|
|
213
212
|
rateId: string;
|
|
213
|
+
displayName: string;
|
|
214
214
|
carrierId?: string | undefined;
|
|
215
215
|
pickupPointId?: string | undefined;
|
|
216
216
|
pickupPointDisplayName?: string | undefined;
|
|
217
217
|
}>, Record<string, {
|
|
218
218
|
priceInCents: number;
|
|
219
|
-
displayName: string;
|
|
220
219
|
rateId: string;
|
|
220
|
+
displayName: string;
|
|
221
221
|
carrierId?: string | undefined;
|
|
222
222
|
pickupPointId?: string | undefined;
|
|
223
223
|
pickupPointDisplayName?: string | undefined;
|
|
@@ -245,8 +245,8 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
245
245
|
};
|
|
246
246
|
shipping: Record<string, {
|
|
247
247
|
priceInCents: number;
|
|
248
|
-
displayName: string;
|
|
249
248
|
rateId: string;
|
|
249
|
+
displayName: string;
|
|
250
250
|
carrierId?: string | undefined;
|
|
251
251
|
pickupPointId?: string | undefined;
|
|
252
252
|
pickupPointDisplayName?: string | undefined;
|
|
@@ -274,8 +274,8 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
274
274
|
};
|
|
275
275
|
shipping: Record<string, {
|
|
276
276
|
priceInCents: number;
|
|
277
|
-
displayName: string;
|
|
278
277
|
rateId: string;
|
|
278
|
+
displayName: string;
|
|
279
279
|
carrierId?: string | undefined;
|
|
280
280
|
pickupPointId?: string | undefined;
|
|
281
281
|
pickupPointDisplayName?: string | undefined;
|
|
@@ -285,4 +285,3 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
285
285
|
export type CheckoutFormData = z.infer<typeof checkoutSchema>;
|
|
286
286
|
export type CustomerFormData = z.infer<typeof customerSchema>;
|
|
287
287
|
export type ShipmentsFormData = z.infer<typeof shipmentsFormSchema>;
|
|
288
|
-
//# sourceMappingURL=checkout-schema.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
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: {
|
|
@@ -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;
|
|
@@ -9,4 +9,3 @@ interface AddressInputProps {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function AddressInput({ className, proxy, checkoutSecret, latitude, longitude, currentAlpha3CountryCode, locale, }: AddressInputProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Appearance, StripeElementLocale } from
|
|
2
|
-
import React from
|
|
3
|
-
import { Fonts } from
|
|
1
|
+
import { Appearance, StripeElementLocale } from '@stripe/stripe-js';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Fonts } from '../checkout-embed/appearance';
|
|
4
4
|
declare function PaymentElement({ paymentSecret, publicKey, checkoutAppearance, locale, fonts, onSuccess, onError, children, setSubmitting, }: {
|
|
5
5
|
paymentSecret: string;
|
|
6
6
|
publicKey: string | null;
|
|
@@ -14,4 +14,3 @@ declare function PaymentElement({ paymentSecret, publicKey, checkoutAppearance,
|
|
|
14
14
|
}): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
declare const _default: React.MemoExoticComponent<typeof PaymentElement>;
|
|
16
16
|
export default _default;
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,6 +5,5 @@ interface CheckoutStore {
|
|
|
5
5
|
paymentMethod: PaymentMethodType;
|
|
6
6
|
setPaymentMethod: (paymentMethod: PaymentMethodType) => void;
|
|
7
7
|
}
|
|
8
|
-
export declare const useCheckout: import(
|
|
8
|
+
export declare const useCheckout: import('zustand').UseBoundStore<import('zustand').StoreApi<CheckoutStore>>;
|
|
9
9
|
export {};
|
|
10
|
-
//# sourceMappingURL=useCheckout.d.ts.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "outline" | "default" | "destructive" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "link" | "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
-
} & import(
|
|
5
|
+
size?: "link" | "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export { Button, buttonVariants };
|
|
11
|
-
//# sourceMappingURL=button.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
1
|
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
3
|
declare function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export { Checkbox };
|
|
5
|
-
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { Command as CommandPrimitive } from
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import { Dialog } from './dialog';
|
|
2
3
|
import * as React from "react";
|
|
3
|
-
import { Dialog } from "@/react/components/ui/dialog";
|
|
4
4
|
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function CommandDialog({ title, description, children, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
6
|
title?: string;
|
|
7
7
|
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
8
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,5 +15,4 @@ declare function CommandGroup({ className, ...props }: React.ComponentProps<type
|
|
|
13
15
|
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
15
17
|
declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export { Command, CommandDialog, CommandEmpty, CommandGroup,
|
|
17
|
-
//# sourceMappingURL=command.d.ts.map
|
|
18
|
+
export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
|
|
@@ -5,10 +5,11 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
|
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Content>
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
14
|
-
//# sourceMappingURL=dialog.d.ts.map
|