@betterstore/react 0.6.11 → 0.6.12
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/checkout-form.d.ts.map +1 -1
- package/dist/components/checkout-embed/steps/customer/address-utils.d.ts.map +1 -1
- package/dist/components/checkout-embed/steps/payment/form.d.ts +2 -1
- package/dist/components/checkout-embed/steps/payment/form.d.ts.map +1 -1
- package/dist/components/checkout-embed/steps/payment/icons.d.ts +8 -0
- package/dist/components/checkout-embed/steps/payment/icons.d.ts.map +1 -0
- package/dist/components/payment-element/checkout-form.d.ts.map +1 -1
- package/dist/components/payment-element/useCheckout.d.ts +3 -0
- package/dist/components/payment-element/useCheckout.d.ts.map +1 -1
- package/dist/index.cjs.js +44 -17
- package/dist/index.mjs +44 -17
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-form.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/checkout-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAcvD,UAAU,iBAAiB;IACzB,WAAW,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,SAAS,GACV,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"checkout-form.d.ts","sourceRoot":"","sources":["../../../src/components/checkout-embed/checkout-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAcvD,UAAU,iBAAiB;IACzB,WAAW,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC;CACzC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,wBAAwB,EACxB,SAAS,GACV,EAAE,iBAAiB,2CA4SnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/customer/address-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,eAAO,MAAM,aAAa,GAAI,SAAS,gBAAgB,CAAC,SAAS,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"address-utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/customer/address-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,eAAO,MAAM,aAAa,GAAI,SAAS,gBAAgB,CAAC,SAAS,CAAC,KAAG,MAMpE,CAAC"}
|
|
@@ -15,7 +15,8 @@ interface PaymentFormProps {
|
|
|
15
15
|
locale?: StripeElementLocale;
|
|
16
16
|
publicKey: string | null;
|
|
17
17
|
paymentComponentKey: number;
|
|
18
|
+
currency: string;
|
|
18
19
|
}
|
|
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
|
+
export default function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, currency, contactEmail, shippingFormData, address, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }: PaymentFormProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
21
22
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/payment/form.tsx"],"names":[],"mappings":"AAKA,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;AAG/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;IAC5B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,aAAa,EACb,SAAS,EACT,OAAO,EACP,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,SAAS,EACT,mBAAmB,GACpB,EAAE,gBAAgB,2CA8HlB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type IconProps = React.HTMLAttributes<SVGElement>;
|
|
2
|
+
export declare const Icons: {
|
|
3
|
+
apple: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
google: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
paypal: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/components/checkout-embed/steps/payment/icons.tsx"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;AAElD,eAAO,MAAM,KAAK;mBACD,SAAS;oBA+BR,SAAS;oBAoBT,SAAS;CA6B1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-form.d.ts","sourceRoot":"","sources":["../../../src/components/payment-element/checkout-form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"checkout-form.d.ts","sourceRoot":"","sources":["../../../src/components/payment-element/checkout-form.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAyB,MAAM,OAAO,CAAC;qGAQ3C;IACD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;CACjD;AAqDD,wBAAkC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
type PaymentMethodType = "apple_pay" | "card" | "paypal" | "google_pay" | string | null;
|
|
1
2
|
interface CheckoutStore {
|
|
2
3
|
isSubmitting: boolean;
|
|
3
4
|
setIsSubmitting: (isSubmitting: boolean) => void;
|
|
5
|
+
paymentMethod: PaymentMethodType;
|
|
6
|
+
setPaymentMethod: (paymentMethod: PaymentMethodType) => void;
|
|
4
7
|
}
|
|
5
8
|
export declare const useCheckout: import("zustand").UseBoundStore<import("zustand").StoreApi<CheckoutStore>>;
|
|
6
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckout.d.ts","sourceRoot":"","sources":["../../../src/components/payment-element/useCheckout.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"useCheckout.d.ts","sourceRoot":"","sources":["../../../src/components/payment-element/useCheckout.ts"],"names":[],"mappings":"AAEA,KAAK,iBAAiB,GAClB,WAAW,GACX,MAAM,GACN,QAAQ,GACR,YAAY,GACZ,MAAM,GACN,IAAI,CAAC;AAET,UAAU,aAAa;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,aAAa,EAAE,iBAAiB,CAAC;IACjC,gBAAgB,EAAE,CAAC,aAAa,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC9D;AAED,eAAO,MAAM,WAAW,4EAMrB,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -3326,7 +3326,12 @@ const CheckoutEmbed$2 = {
|
|
|
3326
3326
|
loading: "Načítání ...",
|
|
3327
3327
|
Payment: {
|
|
3328
3328
|
back: "Zpět na výběr dopravy",
|
|
3329
|
-
button:
|
|
3329
|
+
button: {
|
|
3330
|
+
"default": "Dokončit objednávku",
|
|
3331
|
+
apple_pay: "Zaplatit s Apple Pay",
|
|
3332
|
+
paypal: "Zaplatit s PayPal",
|
|
3333
|
+
google_pay: "Zaplatit s Google Pay"
|
|
3334
|
+
},
|
|
3330
3335
|
description: "Všechny transakce jsou zabezpečené a šifrované.",
|
|
3331
3336
|
title: "Platba"
|
|
3332
3337
|
},
|
|
@@ -3443,7 +3448,12 @@ const CheckoutEmbed$1 = {
|
|
|
3443
3448
|
title: "Payment",
|
|
3444
3449
|
description: "All transactions are secure and encrypted.",
|
|
3445
3450
|
back: "Back to shipping",
|
|
3446
|
-
button:
|
|
3451
|
+
button: {
|
|
3452
|
+
"default": "Buy now",
|
|
3453
|
+
apple_pay: "Pay with Apple Pay",
|
|
3454
|
+
paypal: "Pay with PayPal",
|
|
3455
|
+
google_pay: "Pay with Google Pay"
|
|
3456
|
+
}
|
|
3447
3457
|
}
|
|
3448
3458
|
};
|
|
3449
3459
|
const Errors = {
|
|
@@ -13695,16 +13705,7 @@ objectType({
|
|
|
13695
13705
|
});
|
|
13696
13706
|
|
|
13697
13707
|
const formatAddress = (address) => {
|
|
13698
|
-
const
|
|
13699
|
-
.filter(Boolean)
|
|
13700
|
-
.join(" ");
|
|
13701
|
-
const parts = [
|
|
13702
|
-
address.line1,
|
|
13703
|
-
address.line2,
|
|
13704
|
-
address.city,
|
|
13705
|
-
partWithoutComma,
|
|
13706
|
-
address.country,
|
|
13707
|
-
].filter(Boolean);
|
|
13708
|
+
const parts = [address.line1, address.zipCode, address.country].filter(Boolean);
|
|
13708
13709
|
return parts.join(", ");
|
|
13709
13710
|
};
|
|
13710
13711
|
|
|
@@ -37976,13 +37977,19 @@ var loadStripe = function loadStripe() {
|
|
|
37976
37977
|
const useCheckout = create((set) => ({
|
|
37977
37978
|
isSubmitting: false,
|
|
37978
37979
|
setIsSubmitting: (isSubmitting) => set({ isSubmitting }),
|
|
37980
|
+
paymentMethod: null,
|
|
37981
|
+
setPaymentMethod: (paymentMethod) => set({ paymentMethod }),
|
|
37979
37982
|
}));
|
|
37980
37983
|
|
|
37981
37984
|
const CheckoutForm$1 = ({ onSuccess, onError, children, setSubmitting, }) => {
|
|
37982
37985
|
const stripe = reactStripe_umdExports.useStripe();
|
|
37983
37986
|
const elements = reactStripe_umdExports.useElements();
|
|
37984
|
-
const { setIsSubmitting } = useCheckout();
|
|
37987
|
+
const { setIsSubmitting, setPaymentMethod } = useCheckout();
|
|
37985
37988
|
const [errorMessage, setErrorMessage] = React.useState(undefined);
|
|
37989
|
+
const handlePaymentMethodChange = (event) => {
|
|
37990
|
+
var _a, _b;
|
|
37991
|
+
setPaymentMethod((_b = (_a = event === null || event === void 0 ? void 0 : event.value) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : null);
|
|
37992
|
+
};
|
|
37986
37993
|
const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37987
37994
|
event.preventDefault();
|
|
37988
37995
|
if (!stripe || !elements) {
|
|
@@ -38007,7 +38014,7 @@ const CheckoutForm$1 = ({ onSuccess, onError, children, setSubmitting, }) => {
|
|
|
38007
38014
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
38008
38015
|
}
|
|
38009
38016
|
});
|
|
38010
|
-
return (jsxRuntime.jsxs("form", { className: "w-full pb-40 sm:pb-0", onSubmit: handleSubmit, children: [jsxRuntime.jsx(reactStripe_umdExports.PaymentElement, {}), errorMessage && (jsxRuntime.jsx("p", { className: "text-destructive -mb-2 mt-2 text-sm", children: errorMessage })), children] }));
|
|
38017
|
+
return (jsxRuntime.jsxs("form", { className: "w-full pb-40 sm:pb-0", onSubmit: handleSubmit, children: [jsxRuntime.jsx(reactStripe_umdExports.PaymentElement, { onChange: handlePaymentMethodChange }), errorMessage && (jsxRuntime.jsx("p", { className: "text-destructive -mb-2 mt-2 text-sm", children: errorMessage })), children] }));
|
|
38011
38018
|
};
|
|
38012
38019
|
var CheckoutForm$2 = React.memo(CheckoutForm$1);
|
|
38013
38020
|
|
|
@@ -42680,10 +42687,30 @@ const convertCheckoutAppearanceToStripeAppearance = (appearance, fonts) => {
|
|
|
42680
42687
|
return newAppearance;
|
|
42681
42688
|
};
|
|
42682
42689
|
|
|
42683
|
-
|
|
42690
|
+
const Icons = {
|
|
42691
|
+
apple: (props) => (jsxRuntime.jsxs("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props, { role: "img", fill: "none", children: [jsxRuntime.jsxs("g", { clipPath: "url(#clip0_4418_8987)", children: [jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19.1001 19.16C19.6901 18.26 19.9101 17.8 20.3601 16.79C17.0401 15.53 16.5101 10.8 19.7901 8.98999C18.7901 7.72999 17.3801 7 16.0501 7C15.0901 7 14.4301 7.25001 13.8401 7.48001C13.3401 7.67001 12.8901 7.84 12.3301 7.84C11.7301 7.84 11.2001 7.65001 10.6401 7.45001C10.0301 7.23001 9.39006 7 8.59006 7C7.10006 7 5.51007 7.91 4.50007 9.47C3.08007 11.67 3.33007 15.79 5.62007 19.31C6.44007 20.57 7.54007 21.98 8.97007 22C9.57007 22.01 9.96007 21.83 10.3901 21.64C10.8801 21.42 11.4101 21.18 12.3401 21.18C13.2701 21.17 13.7901 21.42 14.2801 21.64C14.7001 21.83 15.0801 22.01 15.6701 22C17.1201 21.98 18.2801 20.42 19.1001 19.16Z", fill: "currentColor" }), jsxRuntime.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.8399 2C15.9999 3.1 15.5499 4.19001 14.9599 4.95001C14.3299 5.77001 13.2299 6.41 12.1699 6.37C11.9799 5.31 12.4699 4.21999 13.0699 3.48999C13.7399 2.68999 14.8699 2.07 15.8399 2Z", fill: "currentColor" })] }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: "clip0_4418_8987", children: jsxRuntime.jsx("rect", { width: "24", height: "24", fill: "white" }) }) })] }))),
|
|
42692
|
+
google: (props) => (jsxRuntime.jsxs("svg", Object.assign({ viewBox: "-3 0 262 262" }, props, { role: "img", fill: "none", children: [jsxRuntime.jsx("path", { d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027", fill: "#4285F4" }), jsxRuntime.jsx("path", { d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1", fill: "#34A853" }), jsxRuntime.jsx("path", { d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782", fill: "#FBBC05" }), jsxRuntime.jsx("path", { d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251", fill: "#EB4335" })] }))),
|
|
42693
|
+
paypal: (props) => (jsxRuntime.jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "584.798", height: "720", viewBox: "0 0 154.728 190.5" }, props, { role: "img", fill: "none", children: jsxRuntime.jsxs("g", { transform: "translate(898.192 276.071)", children: [jsxRuntime.jsx("path", { clipPath: "none", d: "M-837.663-237.968a5.49 5.49 0 0 0-5.423 4.633l-9.013 57.15-8.281 52.514-.005.044.01-.044 8.281-52.514c.421-2.669 2.719-4.633 5.42-4.633h26.404c26.573 0 49.127-19.387 53.246-45.658.314-1.996.482-3.973.52-5.924v-.003h-.003c-6.753-3.543-14.683-5.565-23.372-5.565z", fill: "#001c64" }), jsxRuntime.jsx("path", { clipPath: "none", d: "M-766.506-232.402c-.037 1.951-.207 3.93-.52 5.926-4.119 26.271-26.673 45.658-53.246 45.658h-26.404c-2.701 0-4.999 1.964-5.42 4.633l-8.281 52.514-5.197 32.947a4.46 4.46 0 0 0 4.405 5.153h28.66a5.49 5.49 0 0 0 5.423-4.633l7.55-47.881c.423-2.669 2.722-4.636 5.423-4.636h16.876c26.573 0 49.124-19.386 53.243-45.655 2.924-18.649-6.46-35.614-22.511-44.026z", fill: "#0070e0" }), jsxRuntime.jsx("path", { clipPath: "none", d: "M-870.225-276.071a5.49 5.49 0 0 0-5.423 4.636l-22.489 142.608a4.46 4.46 0 0 0 4.405 5.156h33.351l8.281-52.514 9.013-57.15a5.49 5.49 0 0 1 5.423-4.633h47.782c8.691 0 16.621 2.025 23.375 5.563.46-23.917-19.275-43.666-46.412-43.666z", fill: "#003087" })] }) }))),
|
|
42694
|
+
};
|
|
42695
|
+
|
|
42696
|
+
function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, currency, contactEmail, shippingFormData, address, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }) {
|
|
42684
42697
|
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
|
42685
42698
|
const { t } = useTranslation();
|
|
42686
|
-
|
|
42699
|
+
const { paymentMethod } = useCheckout();
|
|
42700
|
+
const submitButtonTextKey = paymentMethod === "apple_pay"
|
|
42701
|
+
? "apple_pay"
|
|
42702
|
+
: paymentMethod === "card"
|
|
42703
|
+
? "default"
|
|
42704
|
+
: paymentMethod === "paypal"
|
|
42705
|
+
? "paypal"
|
|
42706
|
+
: paymentMethod === "google_pay"
|
|
42707
|
+
? "google_pay"
|
|
42708
|
+
: "default";
|
|
42709
|
+
const submitButtonText = t(`CheckoutEmbed.Payment.button.${submitButtonTextKey}`);
|
|
42710
|
+
const renderButtonIcon = () => {
|
|
42711
|
+
return submitButtonTextKey === "apple_pay" ? (jsxRuntime.jsx(Icons.apple, { className: "size-5 max-sm:size-[22px]" })) : submitButtonTextKey === "google_pay" ? (jsxRuntime.jsx(Icons.google, { className: "ml-1 size-4 max-sm:size-5" })) : submitButtonTextKey === "paypal" ? (jsxRuntime.jsx(Icons.paypal, { className: "ml-1 size-4 max-sm:size-5" })) : null;
|
|
42712
|
+
};
|
|
42713
|
+
return (jsxRuntime.jsxs("div", { className: "space-y-6", children: [jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("h2", { className: "mb-2", children: t("CheckoutEmbed.Payment.title") }), jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: t("CheckoutEmbed.Payment.description") })] }), jsxRuntime.jsxs("div", { className: "space-y-2", children: [jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("span", { className: "font-medium", children: t("CheckoutEmbed.Shipping.contact") }), " ", jsxRuntime.jsx("span", { className: "text-muted-foreground", children: contactEmail })] }), jsxRuntime.jsx(Button, { variant: "link", size: "link", onClick: onDoubleBack, children: t("CheckoutEmbed.Shipping.change") })] }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [jsxRuntime.jsxs("p", { children: [jsxRuntime.jsx("span", { className: "font-medium", children: t("CheckoutEmbed.Shipping.address") }), " ", jsxRuntime.jsx("span", { className: "text-muted-foreground", children: address })] }), jsxRuntime.jsx(Button, { variant: "link", size: "link", onClick: onDoubleBack, children: t("CheckoutEmbed.Shipping.change") })] }), jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [jsxRuntime.jsxs("div", { className: "flex gap-1", children: [jsxRuntime.jsx("p", { className: "font-medium", children: t("CheckoutEmbed.Shipping.shipping") }), " ", jsxRuntime.jsx("div", { className: "text-muted-foreground flex flex-col gap-1", children: Object.entries(shippingFormData).map(([id, shipmentFormData]) => (jsxRuntime.jsxs("p", { children: [shipmentFormData.displayName, " \u00B7", " ", formatPrice(shipmentFormData.priceInCents, currency)] }, id))) })] }), jsxRuntime.jsx(Button, { variant: "link", size: "link", onClick: onBack, children: t("CheckoutEmbed.Shipping.change") })] })] }), jsxRuntime.jsx("div", { className: "mt-8", children: paymentSecret && (jsxRuntime.jsx(PaymentElement$1, { fonts: fonts, checkoutAppearance: convertCheckoutAppearanceToStripeAppearance(checkoutAppearance, fonts), locale: locale, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, setSubmitting: setIsSubmitting, publicKey: publicKey, children: jsxRuntime.jsx("div", { className: "fixed bottom-0 left-0 right-0 z-50 mt-8 px-4 sm:static sm:px-0", children: jsxRuntime.jsxs("div", { className: "bg-background flex flex-col-reverse items-center justify-between gap-2 pb-4 sm:flex-row sm:bg-transparent sm:pb-0", children: [jsxRuntime.jsxs(Button, { className: "w-full max-sm:hidden sm:w-fit", type: "button", variant: "ghost", onClick: onBack, children: [jsxRuntime.jsx(ChevronLeft, {}), t("CheckoutEmbed.Payment.back")] }), jsxRuntime.jsxs(SubmitButton, { className: "w-full max-sm:h-[52px] max-sm:text-base sm:w-fit", isValid: true, isSubmitting: isSubmitting, children: [submitButtonText, renderButtonIcon()] })] }) }) }, paymentComponentKey)) })] }));
|
|
42687
42714
|
}
|
|
42688
42715
|
|
|
42689
42716
|
function Skeleton(_a) {
|
|
@@ -42999,7 +43026,7 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
42999
43026
|
};
|
|
43000
43027
|
const renderStep = () => {
|
|
43001
43028
|
if (step === "payment" && formData.customer && formData.shipping) {
|
|
43002
|
-
return (jsxRuntime.jsx(PaymentForm, { paymentComponentKey: paymentComponentKey, locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, address: formatAddress(formData.customer.address), shippingFormData: formData.shipping, publicKey: publicKey }));
|
|
43029
|
+
return (jsxRuntime.jsx(PaymentForm, { paymentComponentKey: paymentComponentKey, locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, address: formatAddress(formData.customer.address), shippingFormData: formData.shipping, publicKey: publicKey, currency: currency }));
|
|
43003
43030
|
}
|
|
43004
43031
|
if (step === "shipping" && formData.customer) {
|
|
43005
43032
|
return (jsxRuntime.jsx(ShipmentsShippingMethodForm, { setFormData: setFormData, formData: formData, shippingRates: shippingRates, initialData: formData.shipping, onSubmit: handleShippingSubmit, onBack: handleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), currency: currency, exchangeRate: exchangeRate, locale: locale, countryCode: formData.customer.address.countryCode, shipments: shipments }));
|
package/dist/index.mjs
CHANGED
|
@@ -3306,7 +3306,12 @@ const CheckoutEmbed$2 = {
|
|
|
3306
3306
|
loading: "Načítání ...",
|
|
3307
3307
|
Payment: {
|
|
3308
3308
|
back: "Zpět na výběr dopravy",
|
|
3309
|
-
button:
|
|
3309
|
+
button: {
|
|
3310
|
+
"default": "Dokončit objednávku",
|
|
3311
|
+
apple_pay: "Zaplatit s Apple Pay",
|
|
3312
|
+
paypal: "Zaplatit s PayPal",
|
|
3313
|
+
google_pay: "Zaplatit s Google Pay"
|
|
3314
|
+
},
|
|
3310
3315
|
description: "Všechny transakce jsou zabezpečené a šifrované.",
|
|
3311
3316
|
title: "Platba"
|
|
3312
3317
|
},
|
|
@@ -3423,7 +3428,12 @@ const CheckoutEmbed$1 = {
|
|
|
3423
3428
|
title: "Payment",
|
|
3424
3429
|
description: "All transactions are secure and encrypted.",
|
|
3425
3430
|
back: "Back to shipping",
|
|
3426
|
-
button:
|
|
3431
|
+
button: {
|
|
3432
|
+
"default": "Buy now",
|
|
3433
|
+
apple_pay: "Pay with Apple Pay",
|
|
3434
|
+
paypal: "Pay with PayPal",
|
|
3435
|
+
google_pay: "Pay with Google Pay"
|
|
3436
|
+
}
|
|
3427
3437
|
}
|
|
3428
3438
|
};
|
|
3429
3439
|
const Errors = {
|
|
@@ -13675,16 +13685,7 @@ objectType({
|
|
|
13675
13685
|
});
|
|
13676
13686
|
|
|
13677
13687
|
const formatAddress = (address) => {
|
|
13678
|
-
const
|
|
13679
|
-
.filter(Boolean)
|
|
13680
|
-
.join(" ");
|
|
13681
|
-
const parts = [
|
|
13682
|
-
address.line1,
|
|
13683
|
-
address.line2,
|
|
13684
|
-
address.city,
|
|
13685
|
-
partWithoutComma,
|
|
13686
|
-
address.country,
|
|
13687
|
-
].filter(Boolean);
|
|
13688
|
+
const parts = [address.line1, address.zipCode, address.country].filter(Boolean);
|
|
13688
13689
|
return parts.join(", ");
|
|
13689
13690
|
};
|
|
13690
13691
|
|
|
@@ -37956,13 +37957,19 @@ var loadStripe = function loadStripe() {
|
|
|
37956
37957
|
const useCheckout = create((set) => ({
|
|
37957
37958
|
isSubmitting: false,
|
|
37958
37959
|
setIsSubmitting: (isSubmitting) => set({ isSubmitting }),
|
|
37960
|
+
paymentMethod: null,
|
|
37961
|
+
setPaymentMethod: (paymentMethod) => set({ paymentMethod }),
|
|
37959
37962
|
}));
|
|
37960
37963
|
|
|
37961
37964
|
const CheckoutForm$2 = ({ onSuccess, onError, children, setSubmitting, }) => {
|
|
37962
37965
|
const stripe = reactStripe_umdExports.useStripe();
|
|
37963
37966
|
const elements = reactStripe_umdExports.useElements();
|
|
37964
|
-
const { setIsSubmitting } = useCheckout();
|
|
37967
|
+
const { setIsSubmitting, setPaymentMethod } = useCheckout();
|
|
37965
37968
|
const [errorMessage, setErrorMessage] = useState(undefined);
|
|
37969
|
+
const handlePaymentMethodChange = (event) => {
|
|
37970
|
+
var _a, _b;
|
|
37971
|
+
setPaymentMethod((_b = (_a = event === null || event === void 0 ? void 0 : event.value) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : null);
|
|
37972
|
+
};
|
|
37966
37973
|
const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37967
37974
|
event.preventDefault();
|
|
37968
37975
|
if (!stripe || !elements) {
|
|
@@ -37987,7 +37994,7 @@ const CheckoutForm$2 = ({ onSuccess, onError, children, setSubmitting, }) => {
|
|
|
37987
37994
|
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
37988
37995
|
}
|
|
37989
37996
|
});
|
|
37990
|
-
return (jsxs("form", { className: "w-full pb-40 sm:pb-0", onSubmit: handleSubmit, children: [jsx(reactStripe_umdExports.PaymentElement, {}), errorMessage && (jsx("p", { className: "text-destructive -mb-2 mt-2 text-sm", children: errorMessage })), children] }));
|
|
37997
|
+
return (jsxs("form", { className: "w-full pb-40 sm:pb-0", onSubmit: handleSubmit, children: [jsx(reactStripe_umdExports.PaymentElement, { onChange: handlePaymentMethodChange }), errorMessage && (jsx("p", { className: "text-destructive -mb-2 mt-2 text-sm", children: errorMessage })), children] }));
|
|
37991
37998
|
};
|
|
37992
37999
|
var CheckoutForm$1 = memo(CheckoutForm$2);
|
|
37993
38000
|
|
|
@@ -42660,10 +42667,30 @@ const convertCheckoutAppearanceToStripeAppearance = (appearance, fonts) => {
|
|
|
42660
42667
|
return newAppearance;
|
|
42661
42668
|
};
|
|
42662
42669
|
|
|
42663
|
-
|
|
42670
|
+
const Icons = {
|
|
42671
|
+
apple: (props) => (jsxs("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, props, { role: "img", fill: "none", children: [jsxs("g", { clipPath: "url(#clip0_4418_8987)", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19.1001 19.16C19.6901 18.26 19.9101 17.8 20.3601 16.79C17.0401 15.53 16.5101 10.8 19.7901 8.98999C18.7901 7.72999 17.3801 7 16.0501 7C15.0901 7 14.4301 7.25001 13.8401 7.48001C13.3401 7.67001 12.8901 7.84 12.3301 7.84C11.7301 7.84 11.2001 7.65001 10.6401 7.45001C10.0301 7.23001 9.39006 7 8.59006 7C7.10006 7 5.51007 7.91 4.50007 9.47C3.08007 11.67 3.33007 15.79 5.62007 19.31C6.44007 20.57 7.54007 21.98 8.97007 22C9.57007 22.01 9.96007 21.83 10.3901 21.64C10.8801 21.42 11.4101 21.18 12.3401 21.18C13.2701 21.17 13.7901 21.42 14.2801 21.64C14.7001 21.83 15.0801 22.01 15.6701 22C17.1201 21.98 18.2801 20.42 19.1001 19.16Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.8399 2C15.9999 3.1 15.5499 4.19001 14.9599 4.95001C14.3299 5.77001 13.2299 6.41 12.1699 6.37C11.9799 5.31 12.4699 4.21999 13.0699 3.48999C13.7399 2.68999 14.8699 2.07 15.8399 2Z", fill: "currentColor" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_4418_8987", children: jsx("rect", { width: "24", height: "24", fill: "white" }) }) })] }))),
|
|
42672
|
+
google: (props) => (jsxs("svg", Object.assign({ viewBox: "-3 0 262 262" }, props, { role: "img", fill: "none", children: [jsx("path", { d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027", fill: "#4285F4" }), jsx("path", { d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1", fill: "#34A853" }), jsx("path", { d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782", fill: "#FBBC05" }), jsx("path", { d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251", fill: "#EB4335" })] }))),
|
|
42673
|
+
paypal: (props) => (jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "584.798", height: "720", viewBox: "0 0 154.728 190.5" }, props, { role: "img", fill: "none", children: jsxs("g", { transform: "translate(898.192 276.071)", children: [jsx("path", { clipPath: "none", d: "M-837.663-237.968a5.49 5.49 0 0 0-5.423 4.633l-9.013 57.15-8.281 52.514-.005.044.01-.044 8.281-52.514c.421-2.669 2.719-4.633 5.42-4.633h26.404c26.573 0 49.127-19.387 53.246-45.658.314-1.996.482-3.973.52-5.924v-.003h-.003c-6.753-3.543-14.683-5.565-23.372-5.565z", fill: "#001c64" }), jsx("path", { clipPath: "none", d: "M-766.506-232.402c-.037 1.951-.207 3.93-.52 5.926-4.119 26.271-26.673 45.658-53.246 45.658h-26.404c-2.701 0-4.999 1.964-5.42 4.633l-8.281 52.514-5.197 32.947a4.46 4.46 0 0 0 4.405 5.153h28.66a5.49 5.49 0 0 0 5.423-4.633l7.55-47.881c.423-2.669 2.722-4.636 5.423-4.636h16.876c26.573 0 49.124-19.386 53.243-45.655 2.924-18.649-6.46-35.614-22.511-44.026z", fill: "#0070e0" }), jsx("path", { clipPath: "none", d: "M-870.225-276.071a5.49 5.49 0 0 0-5.423 4.636l-22.489 142.608a4.46 4.46 0 0 0 4.405 5.156h33.351l8.281-52.514 9.013-57.15a5.49 5.49 0 0 1 5.423-4.633h47.782c8.691 0 16.621 2.025 23.375 5.563.46-23.917-19.275-43.666-46.412-43.666z", fill: "#003087" })] }) }))),
|
|
42674
|
+
};
|
|
42675
|
+
|
|
42676
|
+
function PaymentForm({ paymentSecret, onSuccess, onError, onBack, onDoubleBack, currency, contactEmail, shippingFormData, address, checkoutAppearance, fonts, locale, publicKey, paymentComponentKey, }) {
|
|
42664
42677
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
42665
42678
|
const { t } = useTranslation();
|
|
42666
|
-
|
|
42679
|
+
const { paymentMethod } = useCheckout();
|
|
42680
|
+
const submitButtonTextKey = paymentMethod === "apple_pay"
|
|
42681
|
+
? "apple_pay"
|
|
42682
|
+
: paymentMethod === "card"
|
|
42683
|
+
? "default"
|
|
42684
|
+
: paymentMethod === "paypal"
|
|
42685
|
+
? "paypal"
|
|
42686
|
+
: paymentMethod === "google_pay"
|
|
42687
|
+
? "google_pay"
|
|
42688
|
+
: "default";
|
|
42689
|
+
const submitButtonText = t(`CheckoutEmbed.Payment.button.${submitButtonTextKey}`);
|
|
42690
|
+
const renderButtonIcon = () => {
|
|
42691
|
+
return submitButtonTextKey === "apple_pay" ? (jsx(Icons.apple, { className: "size-5 max-sm:size-[22px]" })) : submitButtonTextKey === "google_pay" ? (jsx(Icons.google, { className: "ml-1 size-4 max-sm:size-5" })) : submitButtonTextKey === "paypal" ? (jsx(Icons.paypal, { className: "ml-1 size-4 max-sm:size-5" })) : null;
|
|
42692
|
+
};
|
|
42693
|
+
return (jsxs("div", { className: "space-y-6", children: [jsxs("div", { children: [jsx("h2", { className: "mb-2", children: t("CheckoutEmbed.Payment.title") }), jsx("p", { className: "text-muted-foreground text-sm", children: t("CheckoutEmbed.Payment.description") })] }), jsxs("div", { className: "space-y-2", children: [jsxs("div", { className: "flex items-center justify-between text-sm", children: [jsxs("p", { children: [jsx("span", { className: "font-medium", children: t("CheckoutEmbed.Shipping.contact") }), " ", jsx("span", { className: "text-muted-foreground", children: contactEmail })] }), jsx(Button, { variant: "link", size: "link", onClick: onDoubleBack, children: t("CheckoutEmbed.Shipping.change") })] }), jsxs("div", { className: "flex items-center justify-between text-sm", children: [jsxs("p", { children: [jsx("span", { className: "font-medium", children: t("CheckoutEmbed.Shipping.address") }), " ", jsx("span", { className: "text-muted-foreground", children: address })] }), jsx(Button, { variant: "link", size: "link", onClick: onDoubleBack, children: t("CheckoutEmbed.Shipping.change") })] }), jsxs("div", { className: "flex items-center justify-between text-sm", children: [jsxs("div", { className: "flex gap-1", children: [jsx("p", { className: "font-medium", children: t("CheckoutEmbed.Shipping.shipping") }), " ", jsx("div", { className: "text-muted-foreground flex flex-col gap-1", children: Object.entries(shippingFormData).map(([id, shipmentFormData]) => (jsxs("p", { children: [shipmentFormData.displayName, " \u00B7", " ", formatPrice(shipmentFormData.priceInCents, currency)] }, id))) })] }), jsx(Button, { variant: "link", size: "link", onClick: onBack, children: t("CheckoutEmbed.Shipping.change") })] })] }), jsx("div", { className: "mt-8", children: paymentSecret && (jsx(PaymentElement, { fonts: fonts, checkoutAppearance: convertCheckoutAppearanceToStripeAppearance(checkoutAppearance, fonts), locale: locale, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, setSubmitting: setIsSubmitting, publicKey: publicKey, children: jsx("div", { className: "fixed bottom-0 left-0 right-0 z-50 mt-8 px-4 sm:static sm:px-0", children: jsxs("div", { className: "bg-background flex flex-col-reverse items-center justify-between gap-2 pb-4 sm:flex-row sm:bg-transparent sm:pb-0", children: [jsxs(Button, { className: "w-full max-sm:hidden sm:w-fit", type: "button", variant: "ghost", onClick: onBack, children: [jsx(ChevronLeft, {}), t("CheckoutEmbed.Payment.back")] }), jsxs(SubmitButton, { className: "w-full max-sm:h-[52px] max-sm:text-base sm:w-fit", isValid: true, isSubmitting: isSubmitting, children: [submitButtonText, renderButtonIcon()] })] }) }) }, paymentComponentKey)) })] }));
|
|
42667
42694
|
}
|
|
42668
42695
|
|
|
42669
42696
|
function Skeleton(_a) {
|
|
@@ -42979,7 +43006,7 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
|
|
|
42979
43006
|
};
|
|
42980
43007
|
const renderStep = () => {
|
|
42981
43008
|
if (step === "payment" && formData.customer && formData.shipping) {
|
|
42982
|
-
return (jsx(PaymentForm, { paymentComponentKey: paymentComponentKey, locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, address: formatAddress(formData.customer.address), shippingFormData: formData.shipping, publicKey: publicKey }));
|
|
43009
|
+
return (jsx(PaymentForm, { paymentComponentKey: paymentComponentKey, locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, address: formatAddress(formData.customer.address), shippingFormData: formData.shipping, publicKey: publicKey, currency: currency }));
|
|
42983
43010
|
}
|
|
42984
43011
|
if (step === "shipping" && formData.customer) {
|
|
42985
43012
|
return (jsx(ShipmentsShippingMethodForm, { setFormData: setFormData, formData: formData, shippingRates: shippingRates, initialData: formData.shipping, onSubmit: handleShippingSubmit, onBack: handleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), currency: currency, exchangeRate: exchangeRate, locale: locale, countryCode: formData.customer.address.countryCode, shipments: shipments }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betterstore/react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"world_countries_lists": "^3.2.0",
|
|
78
78
|
"zod": "^3.25.30",
|
|
79
79
|
"zustand": "^5.0.5",
|
|
80
|
-
"@betterstore/sdk": "0.6.
|
|
80
|
+
"@betterstore/sdk": "0.6.12"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|