@loczer/storefront-sdk 0.219.0 → 0.221.0
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/StorefrontCartPanel/index.d.ts +2 -1
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +31 -32
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +4 -3
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +4 -3
- package/dist/index.d.ts +4 -2
- package/dist/lib/checkoutPaymentDecision.d.ts +2 -6
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +3 -4
- package/dist/lib/checkoutSubmit.d.ts +0 -3
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +41 -43
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +237 -272
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +38 -25
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +6 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +50 -20
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +0 -24
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +0 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +0 -158
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CAsHrE"}
|
|
@@ -4,88 +4,101 @@ import { Textarea as s } from "../../../ui/textarea.js";
|
|
|
4
4
|
import { Card as c } from "../../../ui/card.js";
|
|
5
5
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
import { useTranslation as d } from "react-i18next";
|
|
7
|
+
import { PhoneNumberInput as f, cn as p } from "@rpcbase/ui";
|
|
7
8
|
//#region src/pages/checkout/components/CheckoutDetailsCard.tsx
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
var m = (e) => e.startsWith("fr") ? "FR" : "US";
|
|
10
|
+
function h({ form: h }) {
|
|
11
|
+
let { t: g, i18n: _ } = d();
|
|
10
12
|
return /* @__PURE__ */ u(c, {
|
|
11
13
|
className: "border-slate-200 bg-white shadow-sm",
|
|
12
14
|
children: [/* @__PURE__ */ u("div", {
|
|
13
15
|
className: "border-b border-slate-200 px-4 py-4",
|
|
14
16
|
children: [/* @__PURE__ */ l("p", {
|
|
15
17
|
className: "text-sm font-semibold text-slate-950",
|
|
16
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
18
|
+
children: /* @__PURE__ */ l("span", { children: g("checkout_form_title") })
|
|
17
19
|
}), /* @__PURE__ */ l("p", {
|
|
18
20
|
className: "mt-1 text-xs text-slate-600",
|
|
19
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
21
|
+
children: /* @__PURE__ */ l("span", { children: g("checkout_form_description") })
|
|
20
22
|
})]
|
|
21
23
|
}), /* @__PURE__ */ l("div", {
|
|
22
24
|
className: "px-4 py-4",
|
|
23
25
|
children: /* @__PURE__ */ l(t, {
|
|
24
|
-
...
|
|
26
|
+
...h,
|
|
25
27
|
children: /* @__PURE__ */ u("form", {
|
|
26
28
|
onSubmit: (e) => e.preventDefault(),
|
|
27
29
|
className: "grid gap-3",
|
|
28
30
|
children: [
|
|
29
31
|
/* @__PURE__ */ l(r, {
|
|
30
|
-
control:
|
|
32
|
+
control: h.control,
|
|
31
33
|
name: "first_name",
|
|
32
34
|
render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
|
|
33
|
-
/* @__PURE__ */ l(a, { children:
|
|
35
|
+
/* @__PURE__ */ l(a, { children: g("checkout_first_name_label") }),
|
|
34
36
|
/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
|
|
35
37
|
...t,
|
|
36
38
|
autoComplete: "given-name",
|
|
37
|
-
placeholder:
|
|
39
|
+
placeholder: g("checkout_first_name_placeholder")
|
|
38
40
|
}) }),
|
|
39
41
|
/* @__PURE__ */ l(o, {})
|
|
40
42
|
] })
|
|
41
43
|
}),
|
|
42
44
|
/* @__PURE__ */ l(r, {
|
|
43
|
-
control:
|
|
45
|
+
control: h.control,
|
|
44
46
|
name: "last_name",
|
|
45
47
|
render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
|
|
46
|
-
/* @__PURE__ */ l(a, { children:
|
|
48
|
+
/* @__PURE__ */ l(a, { children: g("checkout_last_name_label") }),
|
|
47
49
|
/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
|
|
48
50
|
...t,
|
|
49
51
|
autoComplete: "family-name",
|
|
50
|
-
placeholder:
|
|
52
|
+
placeholder: g("checkout_last_name_placeholder")
|
|
51
53
|
}) }),
|
|
52
54
|
/* @__PURE__ */ l(o, {})
|
|
53
55
|
] })
|
|
54
56
|
}),
|
|
55
57
|
/* @__PURE__ */ l(r, {
|
|
56
|
-
control:
|
|
58
|
+
control: h.control,
|
|
57
59
|
name: "email",
|
|
58
60
|
render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
|
|
59
|
-
/* @__PURE__ */ l(a, { children:
|
|
61
|
+
/* @__PURE__ */ l(a, { children: g("checkout_email_label") }),
|
|
60
62
|
/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
|
|
61
63
|
...t,
|
|
62
64
|
type: "email",
|
|
63
|
-
placeholder:
|
|
65
|
+
placeholder: g("checkout_email_placeholder")
|
|
64
66
|
}) }),
|
|
65
67
|
/* @__PURE__ */ l(o, {})
|
|
66
68
|
] })
|
|
67
69
|
}),
|
|
68
70
|
/* @__PURE__ */ l(r, {
|
|
69
|
-
control:
|
|
71
|
+
control: h.control,
|
|
70
72
|
name: "phone",
|
|
71
|
-
render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
|
|
72
|
-
/* @__PURE__ */ l(a, { children:
|
|
73
|
-
/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ u(i, { children: [
|
|
74
|
+
/* @__PURE__ */ l(a, { children: g("checkout_phone_label") }),
|
|
75
|
+
/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(f, {
|
|
76
|
+
name: e.name,
|
|
77
|
+
value: e.value ?? "",
|
|
78
|
+
onBlur: e.onBlur,
|
|
79
|
+
onChange: (t) => {
|
|
80
|
+
let n = t.e164 || t.formattedInternational || t.rawInput || "";
|
|
81
|
+
e.onChange(n);
|
|
82
|
+
},
|
|
83
|
+
defaultCountry: m(_.language),
|
|
84
|
+
locale: _.language,
|
|
85
|
+
placeholder: g("checkout_phone_placeholder"),
|
|
86
|
+
className: "relative",
|
|
87
|
+
inputClassName: p(t.error && "border-destructive focus-visible:ring-destructive"),
|
|
88
|
+
renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ l(o, { children: /* @__PURE__ */ l("span", { children: e }) })
|
|
76
89
|
}) }),
|
|
77
|
-
/* @__PURE__ */ l(o, {})
|
|
90
|
+
t.error?.message ? /* @__PURE__ */ l(o, {}) : null
|
|
78
91
|
] })
|
|
79
92
|
}),
|
|
80
93
|
/* @__PURE__ */ l(r, {
|
|
81
|
-
control:
|
|
94
|
+
control: h.control,
|
|
82
95
|
name: "notes",
|
|
83
96
|
render: ({ field: e }) => /* @__PURE__ */ u(i, { children: [
|
|
84
|
-
/* @__PURE__ */ l(a, { children:
|
|
97
|
+
/* @__PURE__ */ l(a, { children: g("checkout_notes_label") }),
|
|
85
98
|
/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(s, {
|
|
86
99
|
...e,
|
|
87
100
|
rows: 4,
|
|
88
|
-
placeholder:
|
|
101
|
+
placeholder: g("checkout_notes_placeholder")
|
|
89
102
|
}) }),
|
|
90
103
|
/* @__PURE__ */ l(o, {})
|
|
91
104
|
] })
|
|
@@ -97,4 +110,4 @@ function f({ form: f }) {
|
|
|
97
110
|
});
|
|
98
111
|
}
|
|
99
112
|
//#endregion
|
|
100
|
-
export {
|
|
113
|
+
export { h as CheckoutDetailsCard };
|
|
@@ -3,9 +3,13 @@ import { StorefrontCartPanel } from '../../../components/StorefrontCartPanel';
|
|
|
3
3
|
import { CheckoutCouponCard } from './CheckoutCouponCard';
|
|
4
4
|
type StorefrontCartPanelProps = ComponentProps<typeof StorefrontCartPanel>;
|
|
5
5
|
type CheckoutCouponCardProps = ComponentProps<typeof CheckoutCouponCard>;
|
|
6
|
-
type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "totalPerBaseUnitMinor" | "baseUnitLabel" | "
|
|
6
|
+
type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "totalPerBaseUnitMinor" | "baseUnitLabel" | "onQuantityChange" | "onRemove"> & {
|
|
7
7
|
coupon?: CheckoutCouponCardProps;
|
|
8
|
+
bookingSubtotalLabel: string;
|
|
9
|
+
vatAmountLabel: string;
|
|
10
|
+
vatRateLabel: string;
|
|
11
|
+
bookingTotalLabel: string;
|
|
8
12
|
};
|
|
9
|
-
export declare function CheckoutSummaryColumn({ lines, itemCount, totalPerBaseUnitMinor, baseUnitLabel,
|
|
13
|
+
export declare function CheckoutSummaryColumn({ lines, itemCount, totalPerBaseUnitMinor, baseUnitLabel, coupon, bookingSubtotalLabel, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export {};
|
|
11
15
|
//# sourceMappingURL=CheckoutSummaryColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutSummaryColumn.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutSummaryColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC1E,KAAK,uBAAuB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAExE,KAAK,0BAA0B,GAAG,IAAI,CACpC,wBAAwB,EACtB,OAAO,GACP,WAAW,GACX,uBAAuB,GACvB,eAAe,GACf,
|
|
1
|
+
{"version":3,"file":"CheckoutSummaryColumn.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutSummaryColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC1E,KAAK,uBAAuB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAExE,KAAK,0BAA0B,GAAG,IAAI,CACpC,wBAAwB,EACtB,OAAO,GACP,WAAW,GACX,uBAAuB,GACvB,eAAe,GACf,kBAAkB,GAClB,UAAU,CACb,GAAG;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,oBAAoB,EAAE,MAAM,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,MAAM,EACN,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CAgD5B"}
|
|
@@ -1,32 +1,62 @@
|
|
|
1
1
|
import { StorefrontCartPanel as e } from "../../../components/StorefrontCartPanel/index.js";
|
|
2
2
|
import { CheckoutCouponCard as t } from "./CheckoutCouponCard.js";
|
|
3
|
-
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
import { useTranslation as
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { useTranslation as i } from "react-i18next";
|
|
5
5
|
//#region src/pages/checkout/components/CheckoutSummaryColumn.tsx
|
|
6
|
-
function
|
|
7
|
-
let { t:
|
|
6
|
+
function a({ lines: a, itemCount: o, totalPerBaseUnitMinor: s, baseUnitLabel: c, coupon: l, bookingSubtotalLabel: u, vatAmountLabel: d, vatRateLabel: f, bookingTotalLabel: p, onQuantityChange: m, onRemove: h }) {
|
|
7
|
+
let { t: g } = i();
|
|
8
8
|
return /* @__PURE__ */ n("div", {
|
|
9
9
|
className: "lg:col-span-5",
|
|
10
10
|
children: /* @__PURE__ */ n(e, {
|
|
11
|
-
lines:
|
|
12
|
-
itemCount:
|
|
13
|
-
totalPerBaseUnitMinor:
|
|
14
|
-
baseUnitLabel:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
discountAmountMinor: u,
|
|
18
|
-
lateReturnSurchargeMinor: d,
|
|
19
|
-
couponCode: f,
|
|
20
|
-
durationInBaseUnitLabel: p,
|
|
21
|
-
title: _("checkout_summary_title"),
|
|
22
|
-
description: _("checkout_summary_description"),
|
|
11
|
+
lines: a,
|
|
12
|
+
itemCount: o,
|
|
13
|
+
totalPerBaseUnitMinor: s,
|
|
14
|
+
baseUnitLabel: c,
|
|
15
|
+
title: g("checkout_summary_title"),
|
|
16
|
+
description: g("checkout_summary_description"),
|
|
23
17
|
editable: !0,
|
|
24
|
-
summaryAddon:
|
|
18
|
+
summaryAddon: l ? /* @__PURE__ */ n(t, { ...l }) : void 0,
|
|
19
|
+
pricingSummary: /* @__PURE__ */ r("dl", {
|
|
20
|
+
className: "grid border-t border-slate-200 pt-3 text-sm",
|
|
21
|
+
"data-testid": "checkout-booking-totals",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ r("div", {
|
|
24
|
+
className: "flex items-center justify-between gap-3 py-1.5",
|
|
25
|
+
children: [/* @__PURE__ */ n("dt", {
|
|
26
|
+
className: "text-slate-700",
|
|
27
|
+
children: /* @__PURE__ */ n("span", { children: g("checkout_booking_subtotal") })
|
|
28
|
+
}), /* @__PURE__ */ n("dd", {
|
|
29
|
+
className: "font-medium tabular-nums text-slate-900",
|
|
30
|
+
children: /* @__PURE__ */ n("span", { children: u })
|
|
31
|
+
})]
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ r("div", {
|
|
34
|
+
className: "flex items-center justify-between gap-3 py-1.5",
|
|
35
|
+
children: [/* @__PURE__ */ n("dt", {
|
|
36
|
+
className: "text-slate-700",
|
|
37
|
+
children: /* @__PURE__ */ n("span", { children: g("checkout_payment_vat", { rate: f }) })
|
|
38
|
+
}), /* @__PURE__ */ n("dd", {
|
|
39
|
+
className: "font-medium tabular-nums text-slate-900",
|
|
40
|
+
children: /* @__PURE__ */ n("span", { children: d })
|
|
41
|
+
})]
|
|
42
|
+
}),
|
|
43
|
+
/* @__PURE__ */ r("div", {
|
|
44
|
+
className: "mt-1 flex items-center justify-between gap-3 border-t border-slate-200 pt-3",
|
|
45
|
+
children: [/* @__PURE__ */ n("dt", {
|
|
46
|
+
className: "font-semibold text-slate-950",
|
|
47
|
+
children: /* @__PURE__ */ n("span", { children: g("checkout_estimated_total") })
|
|
48
|
+
}), /* @__PURE__ */ n("dd", {
|
|
49
|
+
className: "text-base font-bold tabular-nums tracking-tight text-slate-950",
|
|
50
|
+
children: /* @__PURE__ */ n("span", { children: p })
|
|
51
|
+
})]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}),
|
|
25
55
|
stickyTopClassName: "top-32",
|
|
26
|
-
onQuantityChange:
|
|
27
|
-
onRemove:
|
|
56
|
+
onQuantityChange: m,
|
|
57
|
+
onRemove: h
|
|
28
58
|
})
|
|
29
59
|
});
|
|
30
60
|
}
|
|
31
61
|
//#endregion
|
|
32
|
-
export {
|
|
62
|
+
export { a as CheckoutSummaryColumn };
|