@loczer/storefront-sdk 0.237.0 → 0.239.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/chunks/pkg/booking-engine/dist/models/{LocalizedString-D_TRgAdr.js → LocalizedString-JmOX62C3.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-CWP_qule.js → Product.shared-C_HehlKK.js} +3 -3
- package/dist/chunks/pkg/booking-engine/dist/models/types-ynW5hdp8.js +8 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-BhIOL2rP.js → base-asset-CFAxfmRW.js} +3 -3
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-BJXFzDM5.js → base-booking-CZOR9kya.js} +13 -12
- package/dist/chunks/pkg/booking-engine/dist/schemas/base-product-QYQBl0fQ.js +4 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{booking-engine-configuration-LnrhShqm.js → booking-engine-configuration-CxKlxKCo.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/booking-reference-DLKcpIa4.js +13 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-3lBblkB0.js → cart-inputs-D1KobIdr.js} +4 -4
- package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-DXc34Bzy.js → insurance-B-Vmdlxo.js} +3 -3
- package/dist/chunks/pkg/booking-engine/dist/schemas/{product-id--yyUTH1Y.js → product-id-ChdStzgp.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{public-booking-engine-configuration-CEM9mexX.js → public-booking-engine-configuration-BwWn9aK0.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas-lb2iTDMd.js +17 -0
- package/dist/components/Footer/businessHoursStatus.js +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +38 -26
- 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 +24 -24
- package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.d.ts +4 -2
- package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.d.ts.map +1 -1
- package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.js +8 -8
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -0
- package/dist/i18n/fr.d.ts +3 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +3 -0
- package/dist/index.d.ts +33 -3
- package/dist/index.js +87 -86
- package/dist/lib/booking-period.js +1 -1
- package/dist/lib/booking.js +2 -2
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +45 -44
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +198 -184
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +10 -6
- package/dist/pages/checkout/components/CheckoutMobileSummaryDrawer.d.ts +13 -0
- package/dist/pages/checkout/components/CheckoutMobileSummaryDrawer.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutMobileSummaryDrawer.js +95 -0
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +4 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +22 -20
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/pkg/booking-engine/dist/models/types-rIp4ReXN.js +0 -8
- package/dist/chunks/pkg/booking-engine/dist/schemas/base-product-Bde9lJQD.js +0 -4
- package/dist/chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js +0 -16
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type CheckoutMobileSummaryDrawerProps = {
|
|
3
|
+
canSubmit: boolean;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
compactSubmitLabel: string;
|
|
6
|
+
itemCount: number;
|
|
7
|
+
onSubmit: () => void;
|
|
8
|
+
submitLabel: string;
|
|
9
|
+
totalLabel: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function CheckoutMobileSummaryDrawer({ canSubmit, children, compactSubmitLabel, itemCount, onSubmit, submitLabel, totalLabel, }: CheckoutMobileSummaryDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=CheckoutMobileSummaryDrawer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckoutMobileSummaryDrawer.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutMobileSummaryDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAiB3D,KAAK,gCAAgC,GAAG;IACtC,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,GACX,EAAE,gCAAgC,2CAuFlC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Button as e } from "../../../ui/button.js";
|
|
2
|
+
import { Drawer as t, DrawerContent as n, DrawerFooter as r, DrawerHeader as i, DrawerTitle as a, DrawerTrigger as o } from "../../../ui/drawer.js";
|
|
3
|
+
import { useEffect as s, useState as c } from "react";
|
|
4
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
|
+
import { useMediaQuery as d } from "@rpcbase/client";
|
|
6
|
+
import { useTranslation as f } from "react-i18next";
|
|
7
|
+
import { toast as p } from "sonner";
|
|
8
|
+
import { ShoppingCart as m } from "lucide-react";
|
|
9
|
+
//#region src/pages/checkout/components/CheckoutMobileSummaryDrawer.tsx
|
|
10
|
+
function h({ canSubmit: h, children: g, compactSubmitLabel: _, itemCount: v, onSubmit: y, submitLabel: b, totalLabel: x }) {
|
|
11
|
+
let { t: S } = f(), [C, w] = c(!1), T = d("(min-width: 64rem)");
|
|
12
|
+
return s(() => {
|
|
13
|
+
T && w(!1);
|
|
14
|
+
}, [T]), /* @__PURE__ */ l("div", {
|
|
15
|
+
className: "lg:hidden",
|
|
16
|
+
children: /* @__PURE__ */ u(t, {
|
|
17
|
+
open: C && !T,
|
|
18
|
+
onOpenChange: (e) => {
|
|
19
|
+
e && p.dismiss(), w(e);
|
|
20
|
+
},
|
|
21
|
+
children: [/* @__PURE__ */ u("div", {
|
|
22
|
+
className: "fixed inset-x-0 bottom-0 z-40 flex gap-2 border-t border-slate-200/80 bg-white/95 p-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] shadow-[0_-12px_30px_-22px_rgba(15,23,42,0.45)] backdrop-blur-lg",
|
|
23
|
+
"data-testid": "checkout-mobile-action-bar",
|
|
24
|
+
children: [/* @__PURE__ */ l(o, {
|
|
25
|
+
asChild: !0,
|
|
26
|
+
children: /* @__PURE__ */ l(e, {
|
|
27
|
+
type: "button",
|
|
28
|
+
variant: "outline",
|
|
29
|
+
className: "h-12 min-w-0 flex-1 border-primary/20 px-3 text-primary hover:bg-primary/5 hover:text-primary",
|
|
30
|
+
"aria-label": S("checkout_mobile_summary_button", { count: v }),
|
|
31
|
+
"data-testid": "checkout-mobile-summary-trigger",
|
|
32
|
+
children: /* @__PURE__ */ u("span", {
|
|
33
|
+
className: "flex w-full min-w-0 items-center justify-between gap-2",
|
|
34
|
+
children: [/* @__PURE__ */ u("span", {
|
|
35
|
+
className: "flex shrink-0 items-center gap-2",
|
|
36
|
+
children: [/* @__PURE__ */ l(m, {
|
|
37
|
+
className: "size-4",
|
|
38
|
+
"aria-hidden": "true"
|
|
39
|
+
}), /* @__PURE__ */ l("span", {
|
|
40
|
+
className: "inline-flex min-w-5 items-center justify-center rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-bold",
|
|
41
|
+
children: v
|
|
42
|
+
})]
|
|
43
|
+
}), /* @__PURE__ */ l("span", {
|
|
44
|
+
className: "truncate text-sm font-semibold",
|
|
45
|
+
"aria-live": "polite",
|
|
46
|
+
children: x
|
|
47
|
+
})]
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
}), /* @__PURE__ */ l(e, {
|
|
51
|
+
type: "button",
|
|
52
|
+
className: "h-12 min-w-0 flex-1 px-3 text-sm font-semibold",
|
|
53
|
+
"aria-label": b,
|
|
54
|
+
"data-testid": "checkout-mobile-submit",
|
|
55
|
+
disabled: !h,
|
|
56
|
+
onClick: y,
|
|
57
|
+
children: /* @__PURE__ */ l("span", {
|
|
58
|
+
className: "line-clamp-2 whitespace-normal leading-tight",
|
|
59
|
+
children: _
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
}), /* @__PURE__ */ u(n, {
|
|
63
|
+
className: "max-h-[90dvh] rounded-t-2xl bg-white",
|
|
64
|
+
closeLabel: S("close_modal"),
|
|
65
|
+
"data-testid": "checkout-mobile-summary-drawer",
|
|
66
|
+
showCloseButton: !0,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ l(i, {
|
|
69
|
+
className: "sr-only",
|
|
70
|
+
children: /* @__PURE__ */ l(a, { children: S("checkout_summary_title") })
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ l("div", {
|
|
73
|
+
className: "min-h-0 flex-1 overflow-y-auto px-4 pb-4 pt-8",
|
|
74
|
+
children: g
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ l(r, {
|
|
77
|
+
className: "mt-auto shrink-0 border-t border-slate-200 bg-white pb-[calc(1rem+env(safe-area-inset-bottom))] pt-4",
|
|
78
|
+
children: /* @__PURE__ */ l(e, {
|
|
79
|
+
type: "button",
|
|
80
|
+
size: "lg",
|
|
81
|
+
className: "w-full font-semibold",
|
|
82
|
+
disabled: !h,
|
|
83
|
+
onClick: () => {
|
|
84
|
+
w(!1), y();
|
|
85
|
+
},
|
|
86
|
+
children: /* @__PURE__ */ l("span", { children: b })
|
|
87
|
+
})
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
})]
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { h as CheckoutMobileSummaryDrawer };
|
|
@@ -8,10 +8,13 @@ type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "item
|
|
|
8
8
|
coupon?: CheckoutCouponCardProps;
|
|
9
9
|
bookingPeriod?: CheckoutBookingPeriodSummaryProps;
|
|
10
10
|
bookingSubtotalLabel: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
presentation?: StorefrontCartPanelProps["presentation"];
|
|
13
|
+
stickyTopClassName?: string;
|
|
11
14
|
vatAmountLabel: string;
|
|
12
15
|
vatRateLabel: string;
|
|
13
16
|
bookingTotalLabel: string;
|
|
14
17
|
};
|
|
15
|
-
export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingPeriod, bookingSubtotalLabel, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingPeriod, bookingSubtotalLabel, className, presentation, stickyTopClassName, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
16
19
|
export {};
|
|
17
20
|
//# 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;
|
|
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;AAI3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,gCAAgC,CAAA;AACvC,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,eAAe,GACf,kBAAkB,GAClB,UAAU,CACb,GAAG;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,aAAa,CAAC,EAAE,iCAAiC,CAAA;IACjD,oBAAoB,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAAA;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,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,aAAa,EACb,MAAM,EACN,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,kBAA6B,EAC7B,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CAiD5B"}
|
|
@@ -3,20 +3,22 @@ import { CheckoutBookingPeriodSummary as t } from "./CheckoutBookingPeriodSummar
|
|
|
3
3
|
import { CheckoutCouponCard as n } from "./CheckoutCouponCard.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
import { useTranslation as a } from "react-i18next";
|
|
6
|
+
import { cn as o } from "@rpcbase/ui";
|
|
6
7
|
//#region src/pages/checkout/components/CheckoutSummaryColumn.tsx
|
|
7
|
-
function
|
|
8
|
-
let { t:
|
|
8
|
+
function s({ lines: s, itemCount: c, baseUnitLabel: l, coupon: u, bookingPeriod: d, bookingSubtotalLabel: f, className: p, presentation: m, stickyTopClassName: h = "top-32", vatAmountLabel: g, vatRateLabel: _, bookingTotalLabel: v, onQuantityChange: y, onRemove: b }) {
|
|
9
|
+
let { t: x } = a();
|
|
9
10
|
return /* @__PURE__ */ r("div", {
|
|
10
|
-
className: "lg:col-span-5",
|
|
11
|
+
className: o("lg:col-span-5", p),
|
|
11
12
|
children: /* @__PURE__ */ r(e, {
|
|
12
|
-
lines:
|
|
13
|
-
itemCount:
|
|
14
|
-
baseUnitLabel:
|
|
15
|
-
title:
|
|
16
|
-
description:
|
|
17
|
-
headerAddon:
|
|
13
|
+
lines: s,
|
|
14
|
+
itemCount: c,
|
|
15
|
+
baseUnitLabel: l,
|
|
16
|
+
title: x("checkout_summary_title"),
|
|
17
|
+
description: x("checkout_summary_description"),
|
|
18
|
+
headerAddon: d ? /* @__PURE__ */ r(t, { ...d }) : void 0,
|
|
18
19
|
editable: !0,
|
|
19
|
-
|
|
20
|
+
presentation: m,
|
|
21
|
+
summaryAddon: u ? /* @__PURE__ */ r(n, { ...u }) : void 0,
|
|
20
22
|
pricingSummary: /* @__PURE__ */ i("dl", {
|
|
21
23
|
className: "grid border-t border-slate-200 pt-3 text-sm",
|
|
22
24
|
"data-testid": "checkout-booking-totals",
|
|
@@ -25,39 +27,39 @@ function o({ lines: o, itemCount: s, baseUnitLabel: c, coupon: l, bookingPeriod:
|
|
|
25
27
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
26
28
|
children: [/* @__PURE__ */ r("dt", {
|
|
27
29
|
className: "text-slate-700",
|
|
28
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
30
|
+
children: /* @__PURE__ */ r("span", { children: x("checkout_booking_subtotal") })
|
|
29
31
|
}), /* @__PURE__ */ r("dd", {
|
|
30
32
|
className: "font-medium tabular-nums text-slate-900",
|
|
31
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
33
|
+
children: /* @__PURE__ */ r("span", { children: f })
|
|
32
34
|
})]
|
|
33
35
|
}),
|
|
34
36
|
/* @__PURE__ */ i("div", {
|
|
35
37
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
36
38
|
children: [/* @__PURE__ */ r("dt", {
|
|
37
39
|
className: "text-slate-700",
|
|
38
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
40
|
+
children: /* @__PURE__ */ r("span", { children: x("checkout_payment_vat", { rate: _ }) })
|
|
39
41
|
}), /* @__PURE__ */ r("dd", {
|
|
40
42
|
className: "font-medium tabular-nums text-slate-900",
|
|
41
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
43
|
+
children: /* @__PURE__ */ r("span", { children: g })
|
|
42
44
|
})]
|
|
43
45
|
}),
|
|
44
46
|
/* @__PURE__ */ i("div", {
|
|
45
47
|
className: "mt-1 flex items-center justify-between gap-3 border-t border-slate-200 pt-3",
|
|
46
48
|
children: [/* @__PURE__ */ r("dt", {
|
|
47
49
|
className: "font-semibold text-slate-950",
|
|
48
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
50
|
+
children: /* @__PURE__ */ r("span", { children: x("checkout_estimated_total") })
|
|
49
51
|
}), /* @__PURE__ */ r("dd", {
|
|
50
52
|
className: "text-base font-bold tabular-nums tracking-tight text-slate-950",
|
|
51
|
-
children: /* @__PURE__ */ r("span", { children:
|
|
53
|
+
children: /* @__PURE__ */ r("span", { children: v })
|
|
52
54
|
})]
|
|
53
55
|
})
|
|
54
56
|
]
|
|
55
57
|
}),
|
|
56
|
-
stickyTopClassName:
|
|
57
|
-
onQuantityChange:
|
|
58
|
-
onRemove:
|
|
58
|
+
stickyTopClassName: h,
|
|
59
|
+
onQuantityChange: y,
|
|
60
|
+
onRemove: b
|
|
59
61
|
})
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
//#endregion
|
|
63
|
-
export {
|
|
65
|
+
export { s as CheckoutSummaryColumn };
|