@loczer/storefront-sdk 0.236.0 → 0.237.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/FaqSection/index.d.ts +2 -0
- package/dist/components/FaqSection/index.d.ts.map +1 -0
- package/dist/components/FaqSection/index.js +76 -0
- 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 +42 -38
- package/dist/components/StorefrontInsuranceNotice/index.d.ts.map +1 -1
- package/dist/components/StorefrontInsuranceNotice/index.js +3 -12
- package/dist/i18n/en.d.ts +3 -2
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -2
- package/dist/i18n/fr.d.ts +3 -2
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +3 -2
- package/dist/index.d.ts +14 -5
- package/dist/index.js +27 -26
- package/dist/lib/storefrontProducts.d.ts +4 -0
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +2 -0
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +7 -0
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +397 -388
- package/dist/pages/checkout/components/CheckoutBookingPeriodSummary.d.ts +9 -0
- package/dist/pages/checkout/components/CheckoutBookingPeriodSummary.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutBookingPeriodSummary.js +83 -0
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +3 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +34 -32
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type CheckoutBookingPeriodSummaryProps = {
|
|
2
|
+
bookingPath: string;
|
|
3
|
+
startDate: string;
|
|
4
|
+
startTime: string;
|
|
5
|
+
endDate: string;
|
|
6
|
+
endTime: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function CheckoutBookingPeriodSummary({ bookingPath, startDate, startTime, endDate, endTime, }: CheckoutBookingPeriodSummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=CheckoutBookingPeriodSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckoutBookingPeriodSummary.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutBookingPeriodSummary.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,iCAAiC,GAAG;IAC9C,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAwDD,wBAAgB,4BAA4B,CAAC,EAC3C,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,OAAO,GACR,EAAE,iCAAiC,2CAoCnC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { normalizeBusinessDateString as e } from "../../../lib/booking-period.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { Link as r } from "@rpcbase/router";
|
|
4
|
+
import { useTranslation as i } from "react-i18next";
|
|
5
|
+
import { ArrowRight as a, Clock3 as o } from "lucide-react";
|
|
6
|
+
//#region src/pages/checkout/components/CheckoutBookingPeriodSummary.tsx
|
|
7
|
+
var s = (t, n) => {
|
|
8
|
+
let r = e(t);
|
|
9
|
+
if (!r) return t;
|
|
10
|
+
let [i = 0, a = 1, o = 1] = r.split("-").map(Number), s = new Date(Date.UTC(i, a - 1, o));
|
|
11
|
+
try {
|
|
12
|
+
return new Intl.DateTimeFormat(n, {
|
|
13
|
+
weekday: "short",
|
|
14
|
+
year: "numeric",
|
|
15
|
+
month: "short",
|
|
16
|
+
day: "numeric",
|
|
17
|
+
timeZone: "UTC"
|
|
18
|
+
}).format(s);
|
|
19
|
+
} catch {
|
|
20
|
+
return t;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function c({ date: e, label: r, labelAction: i, language: a, testId: c, time: l }) {
|
|
24
|
+
return /* @__PURE__ */ n("div", {
|
|
25
|
+
className: "min-w-0",
|
|
26
|
+
"data-testid": c,
|
|
27
|
+
children: [/* @__PURE__ */ n("div", {
|
|
28
|
+
className: "flex items-center justify-between gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ t("p", {
|
|
30
|
+
className: "min-w-0 text-xs font-medium text-slate-600",
|
|
31
|
+
children: /* @__PURE__ */ t("span", { children: r })
|
|
32
|
+
}), i]
|
|
33
|
+
}), /* @__PURE__ */ n("time", {
|
|
34
|
+
dateTime: `${e}T${l}`,
|
|
35
|
+
className: "mt-1 block text-sm font-semibold text-slate-950",
|
|
36
|
+
children: [/* @__PURE__ */ t("span", { children: s(e, a) }), /* @__PURE__ */ n("span", {
|
|
37
|
+
className: "mt-1 flex items-center gap-1.5 text-sm font-medium text-slate-700",
|
|
38
|
+
children: [/* @__PURE__ */ t(o, {
|
|
39
|
+
className: "size-3.5",
|
|
40
|
+
"aria-hidden": "true"
|
|
41
|
+
}), /* @__PURE__ */ t("span", { children: l })]
|
|
42
|
+
})]
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function l({ bookingPath: e, startDate: o, startTime: s, endDate: l, endTime: u }) {
|
|
47
|
+
let { t: d, i18n: f } = i();
|
|
48
|
+
return /* @__PURE__ */ t("section", {
|
|
49
|
+
className: "mt-3 border-t border-slate-200 pt-3",
|
|
50
|
+
"aria-label": d("booking_rental_period"),
|
|
51
|
+
"data-testid": "checkout-booking-period",
|
|
52
|
+
children: /* @__PURE__ */ n("div", {
|
|
53
|
+
className: "grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ t(c, {
|
|
56
|
+
date: o,
|
|
57
|
+
label: d("booking_start_date"),
|
|
58
|
+
language: f.language,
|
|
59
|
+
testId: "checkout-booking-start",
|
|
60
|
+
time: s
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ t(a, {
|
|
63
|
+
className: "size-4 shrink-0 text-slate-400",
|
|
64
|
+
"aria-hidden": "true"
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ t(c, {
|
|
67
|
+
date: l,
|
|
68
|
+
label: d("booking_end_date"),
|
|
69
|
+
labelAction: /* @__PURE__ */ t(r, {
|
|
70
|
+
to: e,
|
|
71
|
+
className: "shrink-0 text-xs font-semibold text-primary underline-offset-4 hover:underline",
|
|
72
|
+
children: /* @__PURE__ */ t("span", { children: d("checkout_booking_period_edit") })
|
|
73
|
+
}),
|
|
74
|
+
language: f.language,
|
|
75
|
+
testId: "checkout-booking-end",
|
|
76
|
+
time: u
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { l as CheckoutBookingPeriodSummary };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { StorefrontCartPanel } from '../../../components/StorefrontCartPanel';
|
|
3
|
+
import { CheckoutBookingPeriodSummaryProps } from './CheckoutBookingPeriodSummary';
|
|
3
4
|
import { CheckoutCouponCard } from './CheckoutCouponCard';
|
|
4
5
|
type StorefrontCartPanelProps = ComponentProps<typeof StorefrontCartPanel>;
|
|
5
6
|
type CheckoutCouponCardProps = ComponentProps<typeof CheckoutCouponCard>;
|
|
6
7
|
type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "baseUnitLabel" | "onQuantityChange" | "onRemove"> & {
|
|
7
8
|
coupon?: CheckoutCouponCardProps;
|
|
9
|
+
bookingPeriod?: CheckoutBookingPeriodSummaryProps;
|
|
8
10
|
bookingSubtotalLabel: string;
|
|
9
11
|
vatAmountLabel: string;
|
|
10
12
|
vatRateLabel: string;
|
|
11
13
|
bookingTotalLabel: string;
|
|
12
14
|
};
|
|
13
|
-
export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingSubtotalLabel, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingPeriod, bookingSubtotalLabel, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
15
17
|
//# 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,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,aAAa,EACb,MAAM,EACN,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,
|
|
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,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,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,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CAgD5B"}
|
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
import { StorefrontCartPanel as e } from "../../../components/StorefrontCartPanel/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { CheckoutBookingPeriodSummary as t } from "./CheckoutBookingPeriodSummary.js";
|
|
3
|
+
import { CheckoutCouponCard as n } from "./CheckoutCouponCard.js";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { useTranslation as a } from "react-i18next";
|
|
5
6
|
//#region src/pages/checkout/components/CheckoutSummaryColumn.tsx
|
|
6
|
-
function
|
|
7
|
-
let { t:
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
function o({ lines: o, itemCount: s, baseUnitLabel: c, coupon: l, bookingPeriod: u, bookingSubtotalLabel: d, vatAmountLabel: f, vatRateLabel: p, bookingTotalLabel: m, onQuantityChange: h, onRemove: g }) {
|
|
8
|
+
let { t: _ } = a();
|
|
9
|
+
return /* @__PURE__ */ r("div", {
|
|
9
10
|
className: "lg:col-span-5",
|
|
10
|
-
children: /* @__PURE__ */
|
|
11
|
-
lines:
|
|
12
|
-
itemCount:
|
|
13
|
-
baseUnitLabel:
|
|
14
|
-
title:
|
|
15
|
-
description:
|
|
11
|
+
children: /* @__PURE__ */ r(e, {
|
|
12
|
+
lines: o,
|
|
13
|
+
itemCount: s,
|
|
14
|
+
baseUnitLabel: c,
|
|
15
|
+
title: _("checkout_summary_title"),
|
|
16
|
+
description: _("checkout_summary_description"),
|
|
17
|
+
headerAddon: u ? /* @__PURE__ */ r(t, { ...u }) : void 0,
|
|
16
18
|
editable: !0,
|
|
17
|
-
summaryAddon:
|
|
18
|
-
pricingSummary: /* @__PURE__ */
|
|
19
|
+
summaryAddon: l ? /* @__PURE__ */ r(n, { ...l }) : void 0,
|
|
20
|
+
pricingSummary: /* @__PURE__ */ i("dl", {
|
|
19
21
|
className: "grid border-t border-slate-200 pt-3 text-sm",
|
|
20
22
|
"data-testid": "checkout-booking-totals",
|
|
21
23
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ i("div", {
|
|
23
25
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ r("dt", {
|
|
25
27
|
className: "text-slate-700",
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
}), /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ r("span", { children: _("checkout_booking_subtotal") })
|
|
29
|
+
}), /* @__PURE__ */ r("dd", {
|
|
28
30
|
className: "font-medium tabular-nums text-slate-900",
|
|
29
|
-
children: /* @__PURE__ */
|
|
31
|
+
children: /* @__PURE__ */ r("span", { children: d })
|
|
30
32
|
})]
|
|
31
33
|
}),
|
|
32
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ i("div", {
|
|
33
35
|
className: "flex items-center justify-between gap-3 py-1.5",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
36
|
+
children: [/* @__PURE__ */ r("dt", {
|
|
35
37
|
className: "text-slate-700",
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
-
}), /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ r("span", { children: _("checkout_payment_vat", { rate: p }) })
|
|
39
|
+
}), /* @__PURE__ */ r("dd", {
|
|
38
40
|
className: "font-medium tabular-nums text-slate-900",
|
|
39
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ r("span", { children: f })
|
|
40
42
|
})]
|
|
41
43
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ i("div", {
|
|
43
45
|
className: "mt-1 flex items-center justify-between gap-3 border-t border-slate-200 pt-3",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ r("dt", {
|
|
45
47
|
className: "font-semibold text-slate-950",
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
}), /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ r("span", { children: _("checkout_estimated_total") })
|
|
49
|
+
}), /* @__PURE__ */ r("dd", {
|
|
48
50
|
className: "text-base font-bold tabular-nums tracking-tight text-slate-950",
|
|
49
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ r("span", { children: m })
|
|
50
52
|
})]
|
|
51
53
|
})
|
|
52
54
|
]
|
|
53
55
|
}),
|
|
54
56
|
stickyTopClassName: "top-32",
|
|
55
|
-
onQuantityChange:
|
|
56
|
-
onRemove:
|
|
57
|
+
onQuantityChange: h,
|
|
58
|
+
onRemove: g
|
|
57
59
|
})
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
62
|
//#endregion
|
|
61
|
-
export {
|
|
63
|
+
export { o as CheckoutSummaryColumn };
|