@betterstore/react 0.5.19 → 0.5.22
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/cart/useCart.d.ts +5 -3
- package/dist/components/cart/useCart.d.ts.map +1 -1
- package/dist/components/checkout-embed/checkout-form.d.ts +2 -1
- package/dist/components/checkout-embed/checkout-form.d.ts.map +1 -1
- package/dist/components/checkout-embed/checkout-schema.d.ts +45 -17
- package/dist/components/checkout-embed/checkout-schema.d.ts.map +1 -1
- package/dist/components/checkout-embed/index.d.ts.map +1 -1
- package/dist/components/checkout-embed/steps/payment/form.d.ts +4 -4
- package/dist/components/checkout-embed/steps/payment/form.d.ts.map +1 -1
- package/dist/components/checkout-embed/steps/shipping/form.d.ts +7 -6
- package/dist/components/checkout-embed/steps/shipping/form.d.ts.map +1 -1
- package/dist/components/checkout-embed/steps/summary/index.d.ts.map +1 -1
- package/dist/components/checkout-embed/useFormStore.d.ts +5 -3
- package/dist/components/checkout-embed/useFormStore.d.ts.map +1 -1
- package/dist/index.cjs.js +332 -150
- package/dist/index.mjs +332 -150
- package/package.json +2 -2
|
@@ -21,15 +21,17 @@ export interface Cart {
|
|
|
21
21
|
getProductQuantity: (productId: string) => number;
|
|
22
22
|
clearCart: () => void;
|
|
23
23
|
}
|
|
24
|
-
export declare const useCart: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<Cart>, "persist"> & {
|
|
24
|
+
export declare const useCart: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<Cart>, "setState" | "persist"> & {
|
|
25
|
+
setState(partial: Cart | Partial<Cart> | ((state: Cart) => Cart | Partial<Cart>), replace?: false | undefined): unknown;
|
|
26
|
+
setState(state: Cart | ((state: Cart) => Cart), replace: true): unknown;
|
|
25
27
|
persist: {
|
|
26
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<Cart, Cart>>) => void;
|
|
28
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<Cart, Cart, unknown>>) => void;
|
|
27
29
|
clearStorage: () => void;
|
|
28
30
|
rehydrate: () => Promise<void> | void;
|
|
29
31
|
hasHydrated: () => boolean;
|
|
30
32
|
onHydrate: (fn: (state: Cart) => void) => () => void;
|
|
31
33
|
onFinishHydration: (fn: (state: Cart) => void) => () => void;
|
|
32
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<Cart, Cart>>;
|
|
34
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<Cart, Cart, unknown>>;
|
|
33
35
|
};
|
|
34
36
|
}>;
|
|
35
37
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCart.d.ts","sourceRoot":"","sources":["../../../src/components/cart/useCart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIhF,KAAK,sBAAsB,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,WAAW,YACf,SAAQ,IAAI,CACV,iBAAiB,EACjB,UAAU,GAAG,UAAU,GAAG,gBAAgB,GAAG,WAAW,GAAG,SAAS,CACrE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,IAAI;IACnB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,OAAO,EAAE,CACP,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,GAAG;QACjC,eAAe,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;KAC9C,EACD,gBAAgB,CAA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,KAAK,IAAI,CAAC;IACjC,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,kBAAkB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAcD,eAAO,MAAM,OAAO;;;;;;;;;;;;EAuEnB,CAAC"}
|
|
@@ -22,7 +22,8 @@ interface CheckoutFormProps {
|
|
|
22
22
|
latitude?: number;
|
|
23
23
|
longitude?: number;
|
|
24
24
|
currentAlpha3CountryCode?: string;
|
|
25
|
+
shipments: CheckoutSession["shipments"];
|
|
25
26
|
}
|
|
26
|
-
export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, paymentComponentKey, clientProxy, latitude, longitude, currentAlpha3CountryCode, }: CheckoutFormProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl, clientSecret, customer, currency, checkoutAppearance, fonts, locale, setShippingCost, exchangeRate, paymentSecret, publicKey, paymentComponentKey, clientProxy, latitude, longitude, currentAlpha3CountryCode, shipments, }: CheckoutFormProps): import("react/jsx-runtime").JSX.Element;
|
|
27
28
|
export {};
|
|
28
29
|
//# sourceMappingURL=checkout-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-form.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/checkout-form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout-form.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/checkout-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAElB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CA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nB"}
|
|
@@ -66,28 +66,42 @@ export declare const customerSchema: z.ZodObject<{
|
|
|
66
66
|
phone: string;
|
|
67
67
|
isEmailSubscribed?: boolean | undefined;
|
|
68
68
|
}>;
|
|
69
|
-
export declare const
|
|
69
|
+
export declare const shipmentsFormSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
70
70
|
rateId: z.ZodString;
|
|
71
71
|
provider: z.ZodString;
|
|
72
|
-
|
|
72
|
+
priceInCents: z.ZodNumber;
|
|
73
73
|
name: z.ZodString;
|
|
74
74
|
pickupPointId: z.ZodOptional<z.ZodString>;
|
|
75
75
|
pickupPointDisplayName: z.ZodOptional<z.ZodString>;
|
|
76
76
|
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
priceInCents: number;
|
|
77
78
|
rateId: string;
|
|
78
79
|
provider: string;
|
|
79
|
-
price: number;
|
|
80
80
|
name: string;
|
|
81
81
|
pickupPointId?: string | undefined;
|
|
82
82
|
pickupPointDisplayName?: string | undefined;
|
|
83
83
|
}, {
|
|
84
|
+
priceInCents: number;
|
|
84
85
|
rateId: string;
|
|
85
86
|
provider: string;
|
|
86
|
-
price: number;
|
|
87
87
|
name: string;
|
|
88
88
|
pickupPointId?: string | undefined;
|
|
89
89
|
pickupPointDisplayName?: string | undefined;
|
|
90
|
-
}
|
|
90
|
+
}>>, Record<string, {
|
|
91
|
+
priceInCents: number;
|
|
92
|
+
rateId: string;
|
|
93
|
+
provider: string;
|
|
94
|
+
name: string;
|
|
95
|
+
pickupPointId?: string | undefined;
|
|
96
|
+
pickupPointDisplayName?: string | undefined;
|
|
97
|
+
}>, Record<string, {
|
|
98
|
+
priceInCents: number;
|
|
99
|
+
rateId: string;
|
|
100
|
+
provider: string;
|
|
101
|
+
name: string;
|
|
102
|
+
pickupPointId?: string | undefined;
|
|
103
|
+
pickupPointDisplayName?: string | undefined;
|
|
104
|
+
}>>;
|
|
91
105
|
export declare const checkoutSchema: z.ZodObject<{
|
|
92
106
|
customer: z.ZodObject<{
|
|
93
107
|
email: z.ZodString;
|
|
@@ -156,28 +170,42 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
156
170
|
phone: string;
|
|
157
171
|
isEmailSubscribed?: boolean | undefined;
|
|
158
172
|
}>;
|
|
159
|
-
shipping: z.ZodObject<{
|
|
173
|
+
shipping: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
160
174
|
rateId: z.ZodString;
|
|
161
175
|
provider: z.ZodString;
|
|
162
|
-
|
|
176
|
+
priceInCents: z.ZodNumber;
|
|
163
177
|
name: z.ZodString;
|
|
164
178
|
pickupPointId: z.ZodOptional<z.ZodString>;
|
|
165
179
|
pickupPointDisplayName: z.ZodOptional<z.ZodString>;
|
|
166
180
|
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
priceInCents: number;
|
|
167
182
|
rateId: string;
|
|
168
183
|
provider: string;
|
|
169
|
-
price: number;
|
|
170
184
|
name: string;
|
|
171
185
|
pickupPointId?: string | undefined;
|
|
172
186
|
pickupPointDisplayName?: string | undefined;
|
|
173
187
|
}, {
|
|
188
|
+
priceInCents: number;
|
|
174
189
|
rateId: string;
|
|
175
190
|
provider: string;
|
|
176
|
-
price: number;
|
|
177
191
|
name: string;
|
|
178
192
|
pickupPointId?: string | undefined;
|
|
179
193
|
pickupPointDisplayName?: string | undefined;
|
|
180
|
-
}
|
|
194
|
+
}>>, Record<string, {
|
|
195
|
+
priceInCents: number;
|
|
196
|
+
rateId: string;
|
|
197
|
+
provider: string;
|
|
198
|
+
name: string;
|
|
199
|
+
pickupPointId?: string | undefined;
|
|
200
|
+
pickupPointDisplayName?: string | undefined;
|
|
201
|
+
}>, Record<string, {
|
|
202
|
+
priceInCents: number;
|
|
203
|
+
rateId: string;
|
|
204
|
+
provider: string;
|
|
205
|
+
name: string;
|
|
206
|
+
pickupPointId?: string | undefined;
|
|
207
|
+
pickupPointDisplayName?: string | undefined;
|
|
208
|
+
}>>;
|
|
181
209
|
customerId: z.ZodOptional<z.ZodString>;
|
|
182
210
|
}, "strip", z.ZodTypeAny, {
|
|
183
211
|
customer: {
|
|
@@ -197,14 +225,14 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
197
225
|
phone: string;
|
|
198
226
|
isEmailSubscribed?: boolean | undefined;
|
|
199
227
|
};
|
|
200
|
-
shipping: {
|
|
228
|
+
shipping: Record<string, {
|
|
229
|
+
priceInCents: number;
|
|
201
230
|
rateId: string;
|
|
202
231
|
provider: string;
|
|
203
|
-
price: number;
|
|
204
232
|
name: string;
|
|
205
233
|
pickupPointId?: string | undefined;
|
|
206
234
|
pickupPointDisplayName?: string | undefined;
|
|
207
|
-
}
|
|
235
|
+
}>;
|
|
208
236
|
customerId?: string | undefined;
|
|
209
237
|
}, {
|
|
210
238
|
customer: {
|
|
@@ -224,17 +252,17 @@ export declare const checkoutSchema: z.ZodObject<{
|
|
|
224
252
|
phone: string;
|
|
225
253
|
isEmailSubscribed?: boolean | undefined;
|
|
226
254
|
};
|
|
227
|
-
shipping: {
|
|
255
|
+
shipping: Record<string, {
|
|
256
|
+
priceInCents: number;
|
|
228
257
|
rateId: string;
|
|
229
258
|
provider: string;
|
|
230
|
-
price: number;
|
|
231
259
|
name: string;
|
|
232
260
|
pickupPointId?: string | undefined;
|
|
233
261
|
pickupPointDisplayName?: string | undefined;
|
|
234
|
-
}
|
|
262
|
+
}>;
|
|
235
263
|
customerId?: string | undefined;
|
|
236
264
|
}>;
|
|
237
265
|
export type CheckoutFormData = z.infer<typeof checkoutSchema>;
|
|
238
266
|
export type CustomerFormData = z.infer<typeof customerSchema>;
|
|
239
|
-
export type
|
|
267
|
+
export type ShipmentsFormData = z.infer<typeof shipmentsFormSchema>;
|
|
240
268
|
//# sourceMappingURL=checkout-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-schema.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/checkout-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBzB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkout-schema.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/checkout-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBzB,CAAC;AAYH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK5B,CAAC;AAGL,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,KAA4C,MAAM,OAAO,CAAC;AAGjE,OAAmB,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAOnE,UAAU,kBAAkB;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,gBAAgB,CAAC;QAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAcD,iBAAS,sBAAsB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,MAAM,EAAE,MAAM,cAAc,CAAC;AAErE,OAAO,KAA4C,MAAM,OAAO,CAAC;AAGjE,OAAmB,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAOnE,UAAU,kBAAkB;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,gBAAgB,CAAC;QAC9B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAcD,iBAAS,sBAAsB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,kBAAkB,2CAuWzE;AAED,QAAA,MAAM,aAAa,0DAA+B,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StripeElementLocale } from "@stripe/stripe-js";
|
|
2
2
|
import { AppearanceConfig, Fonts } from "../../appearance";
|
|
3
|
+
import { FormStore } from "../../useFormStore";
|
|
3
4
|
interface PaymentFormProps {
|
|
4
5
|
paymentSecret: string | null;
|
|
5
6
|
onSuccess: () => void;
|
|
@@ -7,15 +8,14 @@ interface PaymentFormProps {
|
|
|
7
8
|
onBack: () => void;
|
|
8
9
|
onDoubleBack: () => void;
|
|
9
10
|
contactEmail: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
shippingPrice: string;
|
|
11
|
+
shippingFormData: NonNullable<FormStore["formData"]["shipping"]>;
|
|
12
|
+
address: string;
|
|
13
13
|
checkoutAppearance?: AppearanceConfig;
|
|
14
14
|
fonts?: Fonts;
|
|
15
15
|
locale?: StripeElementLocale;
|
|
16
16
|
publicKey: string | null;
|
|
17
17
|
paymentComponentKey: number;
|
|
18
18
|
}
|
|
19
|
-
export default function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail,
|
|
19
|
+
export default function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, contactEmail, shippingFormData, address, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }: PaymentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
21
21
|
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/payment/form.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,OAAO,EACL,gBAAgB,EAEhB,KAAK,EACN,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/payment/form.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAIxD,OAAO,EACL,gBAAgB,EAEhB,KAAK,EACN,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,UAAU,gBAAgB;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAa,EACb,SAAS,EACT,OAAO,EACP,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,SAAS,EACT,mBAAmB,GACpB,EAAE,gBAAgB,2CAmGlB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ShippingRate } from "@betterstore/sdk";
|
|
2
|
-
import { type
|
|
1
|
+
import { CheckoutSession, ShippingRate } from "@betterstore/sdk";
|
|
2
|
+
import { type ShipmentsFormData } from "../../checkout-schema";
|
|
3
3
|
import { FormStore } from "../../useFormStore";
|
|
4
|
-
interface
|
|
4
|
+
interface ShipmentsFormProps {
|
|
5
5
|
shippingRates: ShippingRate[];
|
|
6
|
-
initialData?:
|
|
7
|
-
onSubmit: (data:
|
|
6
|
+
initialData?: ShipmentsFormData;
|
|
7
|
+
onSubmit: (data: ShipmentsFormData) => void;
|
|
8
8
|
onBack: () => void;
|
|
9
9
|
contactEmail: string;
|
|
10
10
|
shippingAddress: string;
|
|
@@ -14,7 +14,8 @@ interface ShippingMethodFormProps {
|
|
|
14
14
|
countryCode?: string;
|
|
15
15
|
setFormData: FormStore["setFormData"];
|
|
16
16
|
formData: FormStore["formData"];
|
|
17
|
+
shipments: CheckoutSession["shipments"];
|
|
17
18
|
}
|
|
18
|
-
export default function
|
|
19
|
+
export default function ShipmentsForm({ shippingRates, initialData, onSubmit, onBack, contactEmail, shippingAddress, currency, exchangeRate, locale, countryCode, setFormData, formData, shipments, }: ShipmentsFormProps): import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
20
21
|
//# sourceMappingURL=form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/shipping/form.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/shipping/form.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMjE,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,UAAU,kBAAkB;IAC1B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAChC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,GACV,EAAE,kBAAkB,2CA0FpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/summary/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/summary/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO7D,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,EAAE;IACD,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACtD,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C,2CAwRA"}
|
|
@@ -8,15 +8,17 @@ export interface FormStore {
|
|
|
8
8
|
checkoutId: string;
|
|
9
9
|
setCheckoutId: (checkoutId: string) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare const useFormStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FormStore>, "persist"> & {
|
|
11
|
+
export declare const useFormStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<FormStore>, "setState" | "persist"> & {
|
|
12
|
+
setState(partial: FormStore | Partial<FormStore> | ((state: FormStore) => FormStore | Partial<FormStore>), replace?: false | undefined): unknown;
|
|
13
|
+
setState(state: FormStore | ((state: FormStore) => FormStore), replace: true): unknown;
|
|
12
14
|
persist: {
|
|
13
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<FormStore, FormStore>>) => void;
|
|
15
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<FormStore, FormStore, unknown>>) => void;
|
|
14
16
|
clearStorage: () => void;
|
|
15
17
|
rehydrate: () => Promise<void> | void;
|
|
16
18
|
hasHydrated: () => boolean;
|
|
17
19
|
onHydrate: (fn: (state: FormStore) => void) => () => void;
|
|
18
20
|
onFinishHydration: (fn: (state: FormStore) => void) => () => void;
|
|
19
|
-
getOptions: () => Partial<import("zustand/middleware").PersistOptions<FormStore, FormStore>>;
|
|
21
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<FormStore, FormStore, unknown>>;
|
|
20
22
|
};
|
|
21
23
|
}>;
|
|
22
24
|
export declare const resetFormStore: (formData: Partial<CheckoutFormData>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormStore.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/useFormStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC3D,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"useFormStore.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/useFormStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/D,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpC,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC3D,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;EAYxB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,UAAU,OAAO,CAAC,gBAAgB,CAAC,SAcjE,CAAC"}
|