@loczer/storefront-sdk 0.208.0 → 0.210.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/StorefrontContext.d.ts +89 -0
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontContext.js +8 -1
- package/dist/StorefrontProvider.d.ts +84 -0
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +55 -41
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/date/index-DAbcklF5.js +1 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/date/mini-CSEBo1ZP.js +60 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/index--u3Qf-qy.js +4 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/tz/index-CEcibV-H.js +1 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/tzOffset/index-COlDDdap.js +22 -0
- package/dist/chunks/pkg/booking-engine/dist/pricing-BJaynUu_.js +3 -0
- package/dist/chunks/pkg/booking-engine/dist/utils/schedule-ssRov9xe.js +39 -0
- package/dist/chunks/pkg/booking-engine/dist/utils/timezone-B6XIbBPz.js +79 -0
- package/dist/chunks/pkg/ui/dist/Map/{MapContent-CDeWtwKa.js → MapContent-TzYCv8ji.js} +109 -108
- package/dist/chunks/pkg/ui/dist/Map/constants-dF2KdJZy.js +8 -0
- package/dist/chunks/pkg/ui/dist/{Map-Cs7wgtH9.js → Map-ZM-ZOU9P.js} +1 -1
- package/dist/components/BookingBikeVariantDialog/index.js +15 -15
- package/dist/components/ContactSection/index.js +9 -9
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +72 -66
- package/dist/components/Itineraries/ItinerariesSection.d.ts +2 -0
- package/dist/components/Itineraries/ItinerariesSection.d.ts.map +1 -0
- package/dist/components/Itineraries/ItinerariesSection.js +81 -0
- package/dist/components/Itineraries/ItineraryListItem.d.ts +9 -0
- package/dist/components/Itineraries/ItineraryListItem.d.ts.map +1 -0
- package/dist/components/Itineraries/ItineraryListItem.js +100 -0
- package/dist/components/Itineraries/ItineraryRouteMap.d.ts +10 -0
- package/dist/components/Itineraries/ItineraryRouteMap.d.ts.map +1 -0
- package/dist/components/Itineraries/ItineraryRouteMap.js +67 -0
- package/dist/components/Itineraries/index.d.ts +4 -0
- package/dist/components/Itineraries/index.d.ts.map +1 -0
- package/dist/components/Itineraries/index.js +4 -0
- package/dist/components/Map/index.d.ts +12 -0
- package/dist/components/Map/index.d.ts.map +1 -1
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +86 -80
- package/dist/components/StorefrontCartPanel/index.d.ts +4 -4
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +10 -9
- package/dist/i18n/en.d.ts +42 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +44 -8
- package/dist/i18n/fr.d.ts +42 -6
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +44 -8
- package/dist/index.d.ts +817 -36
- package/dist/index.js +67 -60
- package/dist/lib/booking.d.ts +0 -6
- package/dist/lib/booking.d.ts.map +1 -1
- package/dist/lib/booking.js +51 -65
- package/dist/lib/cartSummary.d.ts +5 -3
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +7 -7
- package/dist/lib/itineraryPresentation.d.ts +14 -0
- package/dist/lib/itineraryPresentation.d.ts.map +1 -0
- package/dist/lib/itineraryPresentation.js +26 -0
- package/dist/lib/pricing.d.ts +18 -6
- package/dist/lib/pricing.d.ts.map +1 -1
- package/dist/lib/pricing.js +45 -29
- package/dist/lib/storefrontItineraries.d.ts +418 -0
- package/dist/lib/storefrontItineraries.d.ts.map +1 -0
- package/dist/lib/storefrontItineraries.js +81 -0
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +205 -201
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +276 -273
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +111 -108
- package/dist/pages/ItinerariesPage.d.ts +2 -0
- package/dist/pages/ItinerariesPage.d.ts.map +1 -0
- package/dist/pages/ItinerariesPage.js +76 -0
- package/dist/pages/ItineraryDetailsPage.d.ts +66 -0
- package/dist/pages/ItineraryDetailsPage.d.ts.map +1 -0
- package/dist/pages/ItineraryDetailsPage.js +223 -0
- package/dist/pages/ProductPage.js +6 -6
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +2 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +4 -4
- package/dist/pages/itineraries/ElevationProfile.d.ts +5 -0
- package/dist/pages/itineraries/ElevationProfile.d.ts.map +1 -0
- package/dist/pages/itineraries/ElevationProfile.js +59 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +18 -10
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/pkg/ui/dist/Map/constants-BNmiJXfg.js +0 -4
|
@@ -1,110 +1,113 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Badge as
|
|
3
|
-
import { useOptionalStorefront as
|
|
4
|
-
import { useEffect as o, useId as
|
|
5
|
-
import { Fragment as
|
|
1
|
+
import { buildPriceTierLabels as e, buildRentalPriceRows as t, formatRentalUnitQuantity as ee, formatStorefrontPriceMinor as n, getPricingUnitLabel as r } from "../../lib/pricing.js";
|
|
2
|
+
import { Badge as i, badgeVariants as a } from "../../ui/badge.js";
|
|
3
|
+
import { useOptionalStorefront as te } from "../../StorefrontContext.js";
|
|
4
|
+
import { useEffect as o, useId as ne, useRef as s, useState as c } from "react";
|
|
5
|
+
import { Fragment as re, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
import { useMediaQuery as d } from "@rpcbase/client";
|
|
7
|
-
import { useTranslation as
|
|
7
|
+
import { useTranslation as ie } from "react-i18next";
|
|
8
8
|
import { cn as f } from "@rpcbase/ui";
|
|
9
|
-
import { Info as
|
|
10
|
-
import { Drawer as
|
|
11
|
-
import { Popover as
|
|
9
|
+
import { Info as ae, Mail as oe, Phone as se, TrendingDown as ce } from "lucide-react";
|
|
10
|
+
import { Drawer as p } from "@base-ui/react/drawer";
|
|
11
|
+
import { Popover as m } from "@base-ui/react/popover";
|
|
12
12
|
//#region src/components/ProductPriceBadge/index.tsx
|
|
13
|
-
var
|
|
14
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
15
|
-
},
|
|
16
|
-
let { t:
|
|
17
|
-
|
|
13
|
+
var le = 180, h = "(max-width: 767px)", g = "loczer:storefront:product-price-popover-open", _ = (e) => typeof Node < "u" && e instanceof Node, v = (e) => {
|
|
14
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(g, { detail: { id: e } }));
|
|
15
|
+
}, y = ({ prices: y, minPriceMinor: b, className: x, openOnHover: S = !0 }) => {
|
|
16
|
+
let { t: C, i18n: w } = ie(), T = ne(), E = te(), ue = d(h), de = d("(hover: none), (pointer: coarse)"), D = !!(ue || de), [O, k] = c(null), [A, j] = c(!1), M = s(null), N = s(null), P = s(null), F = s(null), I = O !== null, L = E?.storefrontConfiguration.bookingEngine.pricing.baseUnit ?? "day", R = r(L, C), z = e(y, w.language, C, L), B = t(y, w.language, L), V = z[0], H = z[1], U = () => {
|
|
17
|
+
M.current &&= (clearTimeout(M.current), null);
|
|
18
18
|
}, W = (e) => {
|
|
19
|
-
|
|
19
|
+
D || (U(), k((t) => t === "click" ? t : e), v(T));
|
|
20
20
|
}, G = () => {
|
|
21
|
-
U(),
|
|
22
|
-
},
|
|
23
|
-
U(),
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
!
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
21
|
+
U(), k(null);
|
|
22
|
+
}, fe = () => {
|
|
23
|
+
U(), j(!0), v(T);
|
|
24
|
+
}, pe = () => {
|
|
25
|
+
j(!1);
|
|
26
|
+
}, me = () => {
|
|
27
|
+
!S || I || W("hover");
|
|
28
|
+
}, he = (e) => _(e) ? !!(N.current?.contains(e) || F.current?.contains(e)) : !1, K = (e) => _(e) ? !!(P.current?.contains(e) || F.current?.contains(e)) : !1, q = (e) => {
|
|
29
|
+
O !== "hover" || K(e) || (U(), M.current = setTimeout(() => {
|
|
30
|
+
k((e) => e === "hover" ? null : e), M.current = null;
|
|
31
|
+
}, le));
|
|
32
32
|
}, J = (e) => {
|
|
33
33
|
q(e?.relatedTarget);
|
|
34
|
-
},
|
|
34
|
+
}, ge = (e) => {
|
|
35
35
|
let t = e.relatedTarget ?? document.activeElement;
|
|
36
|
-
|
|
36
|
+
he(t) || G();
|
|
37
37
|
};
|
|
38
38
|
if (o(() => {
|
|
39
39
|
if (typeof window > "u") return () => {
|
|
40
40
|
U();
|
|
41
41
|
};
|
|
42
42
|
let e = (e) => {
|
|
43
|
-
e.detail?.id !==
|
|
43
|
+
e.detail?.id !== T && (U(), k(null), j(!1));
|
|
44
44
|
};
|
|
45
|
-
return window.addEventListener(
|
|
46
|
-
window.removeEventListener(
|
|
45
|
+
return window.addEventListener(g, e), () => {
|
|
46
|
+
window.removeEventListener(g, e), U();
|
|
47
47
|
};
|
|
48
|
-
}, [
|
|
49
|
-
if (
|
|
48
|
+
}, [T]), o(() => {
|
|
49
|
+
if (O !== "hover" || typeof window > "u") return;
|
|
50
50
|
let e = (e) => {
|
|
51
51
|
if (K(e.target)) {
|
|
52
52
|
U();
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
M.current || q(e.target);
|
|
56
56
|
};
|
|
57
57
|
return window.addEventListener("pointermove", e, { passive: !0 }), window.addEventListener("mousemove", e, { passive: !0 }), () => {
|
|
58
58
|
window.removeEventListener("pointermove", e), window.removeEventListener("mousemove", e);
|
|
59
59
|
};
|
|
60
|
-
}, [
|
|
61
|
-
if (
|
|
62
|
-
U(),
|
|
60
|
+
}, [O]), o(() => {
|
|
61
|
+
if (D) {
|
|
62
|
+
U(), k(null);
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
}, [
|
|
65
|
+
j(!1);
|
|
66
|
+
}, [D]), !V) return typeof b == "number" ? /* @__PURE__ */ l(i, {
|
|
67
67
|
variant: "outline",
|
|
68
|
-
className: f("border-slate-200 bg-white text-slate-700",
|
|
69
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
68
|
+
className: f("border-slate-200 bg-white text-slate-700", x),
|
|
69
|
+
children: /* @__PURE__ */ l("span", { children: C("price_from", {
|
|
70
|
+
price: n(b, w.language),
|
|
71
|
+
unit: R
|
|
72
|
+
}) })
|
|
70
73
|
}) : null;
|
|
71
|
-
let Y = f(
|
|
74
|
+
let Y = f(a({ variant: "outline" }), "gap-1.5 border-slate-200 bg-white text-slate-700 outline-none transition hover:border-slate-300 hover:text-slate-950 focus:border-slate-200 focus:outline-none focus:ring-0 focus:ring-transparent focus:ring-offset-0 focus-visible:border-slate-200 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0", B.length > 0 && "cursor-pointer", x), X = E?.storefrontConfiguration.shop.emailAddress?.trim(), Z = E?.storefrontConfiguration.shop.contactPhone1?.trim(), _e = !!(X || Z), Q = () => /* @__PURE__ */ u(re, { children: [
|
|
72
75
|
/* @__PURE__ */ l("span", {
|
|
73
76
|
className: "font-semibold",
|
|
74
77
|
children: V
|
|
75
78
|
}),
|
|
76
79
|
H ? /* @__PURE__ */ u("span", {
|
|
77
80
|
className: "inline-flex items-center gap-1 text-slate-500",
|
|
78
|
-
children: [/* @__PURE__ */ l(
|
|
81
|
+
children: [/* @__PURE__ */ l(ce, {
|
|
79
82
|
className: "h-3 w-3",
|
|
80
83
|
strokeWidth: 2.4,
|
|
81
84
|
"aria-hidden": "true"
|
|
82
|
-
}), /* @__PURE__ */ l("span", { children:
|
|
85
|
+
}), /* @__PURE__ */ l("span", { children: C("price_then", { price: H }) })]
|
|
83
86
|
}) : null,
|
|
84
87
|
B.length > 0 ? /* @__PURE__ */ l("span", {
|
|
85
|
-
ref:
|
|
88
|
+
ref: P,
|
|
86
89
|
className: "inline-flex shrink-0 items-center text-slate-500",
|
|
87
90
|
onMouseEnter: () => {
|
|
88
|
-
|
|
91
|
+
S && W("hover");
|
|
89
92
|
},
|
|
90
|
-
onMouseMove:
|
|
93
|
+
onMouseMove: me,
|
|
91
94
|
onMouseLeave: J,
|
|
92
|
-
children: /* @__PURE__ */ l(
|
|
95
|
+
children: /* @__PURE__ */ l(ae, {
|
|
93
96
|
className: "h-3 w-3",
|
|
94
97
|
"aria-hidden": "true"
|
|
95
98
|
})
|
|
96
99
|
}) : null
|
|
97
|
-
] }),
|
|
100
|
+
] }), ve = () => _e ? /* @__PURE__ */ u("div", {
|
|
98
101
|
className: "border-t border-slate-200 pt-2 text-slate-600",
|
|
99
102
|
children: [/* @__PURE__ */ l("p", {
|
|
100
103
|
className: "leading-snug",
|
|
101
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
104
|
+
children: /* @__PURE__ */ l("span", { children: C("price_table_contact_prompt") })
|
|
102
105
|
}), /* @__PURE__ */ u("div", {
|
|
103
106
|
className: "mt-2 flex flex-wrap gap-x-3 gap-y-1",
|
|
104
107
|
children: [Z ? /* @__PURE__ */ u("a", {
|
|
105
108
|
className: "inline-flex min-w-0 items-center gap-1 font-medium text-slate-800 underline-offset-4 hover:underline",
|
|
106
109
|
href: `tel:${Z}`,
|
|
107
|
-
children: [/* @__PURE__ */ l(
|
|
110
|
+
children: [/* @__PURE__ */ l(se, {
|
|
108
111
|
className: "h-3 w-3 shrink-0",
|
|
109
112
|
"aria-hidden": "true"
|
|
110
113
|
}), /* @__PURE__ */ l("span", {
|
|
@@ -114,7 +117,7 @@ var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-po
|
|
|
114
117
|
}) : null, X ? /* @__PURE__ */ u("a", {
|
|
115
118
|
className: "inline-flex min-w-0 items-center gap-1 font-medium text-slate-800 underline-offset-4 hover:underline",
|
|
116
119
|
href: `mailto:${X}`,
|
|
117
|
-
children: [/* @__PURE__ */ l(
|
|
120
|
+
children: [/* @__PURE__ */ l(oe, {
|
|
118
121
|
className: "h-3 w-3 shrink-0",
|
|
119
122
|
"aria-hidden": "true"
|
|
120
123
|
}), /* @__PURE__ */ l("span", {
|
|
@@ -128,12 +131,15 @@ var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-po
|
|
|
128
131
|
children: [
|
|
129
132
|
e ? /* @__PURE__ */ l("p", {
|
|
130
133
|
className: "font-semibold uppercase tracking-[0.12em] text-slate-500",
|
|
131
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
134
|
+
children: /* @__PURE__ */ l("span", { children: C("price_table_title") })
|
|
132
135
|
}) : null,
|
|
133
136
|
/* @__PURE__ */ l("ul", {
|
|
134
137
|
className: f("grid gap-1 text-slate-600", t === "drawer" && "gap-1.5"),
|
|
135
|
-
children: B.map(({
|
|
136
|
-
let i =
|
|
138
|
+
children: B.map(({ unitCount: e, totalPriceLabel: n, perUnitPriceLabel: r }) => {
|
|
139
|
+
let i = ee(e, L, w.language, C), a = C("price_table_per_unit", {
|
|
140
|
+
price: r,
|
|
141
|
+
unit: R
|
|
142
|
+
});
|
|
137
143
|
return /* @__PURE__ */ l("li", { children: /* @__PURE__ */ u("div", {
|
|
138
144
|
className: "flex items-baseline gap-2",
|
|
139
145
|
children: [
|
|
@@ -160,21 +166,21 @@ var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-po
|
|
|
160
166
|
}) }, e);
|
|
161
167
|
})
|
|
162
168
|
}),
|
|
163
|
-
|
|
169
|
+
ve()
|
|
164
170
|
]
|
|
165
171
|
});
|
|
166
|
-
return
|
|
167
|
-
open:
|
|
172
|
+
return D ? /* @__PURE__ */ u(p.Root, {
|
|
173
|
+
open: A,
|
|
168
174
|
onOpenChange: (e) => {
|
|
169
|
-
e ?
|
|
175
|
+
e ? fe() : pe();
|
|
170
176
|
},
|
|
171
177
|
swipeDirection: "down",
|
|
172
|
-
children: [/* @__PURE__ */ l(
|
|
173
|
-
ref:
|
|
178
|
+
children: [/* @__PURE__ */ l(p.Trigger, {
|
|
179
|
+
ref: N,
|
|
174
180
|
type: "button",
|
|
175
181
|
className: Y,
|
|
176
|
-
"aria-label":
|
|
177
|
-
"aria-expanded":
|
|
182
|
+
"aria-label": C("price_details_aria_label", { price: V }),
|
|
183
|
+
"aria-expanded": A,
|
|
178
184
|
onClick: (e) => {
|
|
179
185
|
e.stopPropagation();
|
|
180
186
|
},
|
|
@@ -182,20 +188,20 @@ var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-po
|
|
|
182
188
|
e.stopPropagation();
|
|
183
189
|
},
|
|
184
190
|
children: Q()
|
|
185
|
-
}), /* @__PURE__ */ u(
|
|
191
|
+
}), /* @__PURE__ */ u(p.Portal, { children: [/* @__PURE__ */ l(p.Backdrop, { className: "pointer-events-auto fixed inset-0 z-50 bg-black/50 outline-none data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:animate-in data-[open]:fade-in-0" }), /* @__PURE__ */ l(p.Viewport, {
|
|
186
192
|
className: "pointer-events-none fixed inset-0 z-50",
|
|
187
|
-
children: /* @__PURE__ */ u(
|
|
193
|
+
children: /* @__PURE__ */ u(p.Popup, {
|
|
188
194
|
className: "pointer-events-auto fixed inset-x-0 bottom-0 z-50 flex max-h-[90dvh] flex-col rounded-t-2xl border-t border-slate-200 bg-white text-slate-950 shadow-xl outline-none data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-bottom data-[open]:animate-in data-[open]:fade-in-0 data-[open]:slide-in-from-bottom",
|
|
189
195
|
children: [/* @__PURE__ */ l("div", {
|
|
190
196
|
className: "mx-auto mt-4 h-2 w-[100px] shrink-0 rounded-full bg-slate-200",
|
|
191
197
|
"aria-hidden": "true"
|
|
192
|
-
}), /* @__PURE__ */ l(
|
|
198
|
+
}), /* @__PURE__ */ l(p.Content, { children: /* @__PURE__ */ u("div", {
|
|
193
199
|
className: "flex max-h-[calc(90dvh-1rem)] flex-col",
|
|
194
200
|
children: [/* @__PURE__ */ l("div", {
|
|
195
201
|
className: "border-b border-slate-200 px-4 py-4 text-left",
|
|
196
|
-
children: /* @__PURE__ */ l(
|
|
202
|
+
children: /* @__PURE__ */ l(p.Title, {
|
|
197
203
|
className: "text-left text-lg font-semibold text-slate-950",
|
|
198
|
-
children: /* @__PURE__ */ l("span", { children:
|
|
204
|
+
children: /* @__PURE__ */ l("span", { children: C("price_table_title") })
|
|
199
205
|
})
|
|
200
206
|
}), /* @__PURE__ */ l("div", {
|
|
201
207
|
className: "flex-1 overflow-y-auto px-4 pb-6 pt-3",
|
|
@@ -204,33 +210,33 @@ var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-po
|
|
|
204
210
|
}) })]
|
|
205
211
|
})
|
|
206
212
|
})] })]
|
|
207
|
-
}) : /* @__PURE__ */ u(
|
|
208
|
-
open:
|
|
213
|
+
}) : /* @__PURE__ */ u(m.Root, {
|
|
214
|
+
open: I,
|
|
209
215
|
onOpenChange: (e) => {
|
|
210
216
|
e ? W("click") : G();
|
|
211
217
|
},
|
|
212
|
-
children: [/* @__PURE__ */ l(
|
|
213
|
-
ref:
|
|
218
|
+
children: [/* @__PURE__ */ l(m.Trigger, {
|
|
219
|
+
ref: N,
|
|
214
220
|
type: "button",
|
|
215
221
|
className: Y,
|
|
216
|
-
"aria-label":
|
|
217
|
-
"aria-expanded":
|
|
218
|
-
onBlur:
|
|
222
|
+
"aria-label": C("price_details_aria_label", { price: V }),
|
|
223
|
+
"aria-expanded": I,
|
|
224
|
+
onBlur: ge,
|
|
219
225
|
onClick: (e) => {
|
|
220
|
-
e.preventDefault(), e.stopPropagation(),
|
|
226
|
+
e.preventDefault(), e.stopPropagation(), O === "click" ? G() : W("click");
|
|
221
227
|
},
|
|
222
228
|
onPointerDown: (e) => {
|
|
223
229
|
e.stopPropagation();
|
|
224
230
|
},
|
|
225
231
|
children: Q()
|
|
226
|
-
}), B.length > 0 ? /* @__PURE__ */ l(
|
|
232
|
+
}), B.length > 0 ? /* @__PURE__ */ l(m.Portal, { children: /* @__PURE__ */ l(m.Positioner, {
|
|
227
233
|
side: "top",
|
|
228
234
|
align: "end",
|
|
229
235
|
sideOffset: 8,
|
|
230
236
|
collisionPadding: 12,
|
|
231
237
|
className: "pointer-events-auto z-[70] outline-none",
|
|
232
|
-
children: /* @__PURE__ */ l(
|
|
233
|
-
ref:
|
|
238
|
+
children: /* @__PURE__ */ l(m.Popup, {
|
|
239
|
+
ref: F,
|
|
234
240
|
initialFocus: !1,
|
|
235
241
|
className: "w-64 rounded-xl border border-slate-200 bg-white p-3 text-slate-950 shadow-xl outline-none data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95",
|
|
236
242
|
onPointerDown: (e) => {
|
|
@@ -247,4 +253,4 @@ var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-po
|
|
|
247
253
|
});
|
|
248
254
|
};
|
|
249
255
|
//#endregion
|
|
250
|
-
export {
|
|
256
|
+
export { y as ProductPriceBadge };
|
|
@@ -3,14 +3,14 @@ import { StorefrontCartSummaryLine } from '../../lib/cartSummary';
|
|
|
3
3
|
type StorefrontCartPanelProps = {
|
|
4
4
|
lines: StorefrontCartSummaryLine[];
|
|
5
5
|
itemCount: number;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
totalPerBaseUnitMinor: number;
|
|
7
|
+
baseUnitLabel: string;
|
|
8
8
|
estimatedTotalMinor?: number;
|
|
9
9
|
discountedEstimatedTotalMinor?: number;
|
|
10
10
|
discountAmountMinor?: number;
|
|
11
11
|
lateReturnSurchargeMinor?: number;
|
|
12
12
|
couponCode?: string;
|
|
13
|
-
|
|
13
|
+
durationInBaseUnitLabel?: string;
|
|
14
14
|
title?: string;
|
|
15
15
|
description?: string;
|
|
16
16
|
checkoutPath?: string;
|
|
@@ -23,6 +23,6 @@ type StorefrontCartPanelProps = {
|
|
|
23
23
|
onRemove?: (key: string) => void;
|
|
24
24
|
onClear?: () => void;
|
|
25
25
|
};
|
|
26
|
-
export declare function StorefrontCartPanel({ lines, itemCount,
|
|
26
|
+
export declare function StorefrontCartPanel({ lines, itemCount, totalPerBaseUnitMinor, baseUnitLabel, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationInBaseUnitLabel, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, summaryAddon, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export {};
|
|
28
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCartPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQtE,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,yBAAyB,EAAE,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCartPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQtE,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,yBAAyB,EAAE,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,6BAA6B,CAAC,EAAE,MAAM,CAAA;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1D,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,uBAAuB,EACvB,KAAK,EACL,WAAW,EACX,YAAY,EACZ,kBAA0B,EAC1B,eAAuB,EACvB,QAAe,EACf,YAAY,EACZ,kBAA6B,EAC7B,gBAAgB,EAChB,QAAQ,EACR,OAAO,GACR,EAAE,wBAAwB,2CAgM1B"}
|
|
@@ -10,7 +10,7 @@ import { useTranslation as u } from "react-i18next";
|
|
|
10
10
|
import { cn as d } from "@rpcbase/ui";
|
|
11
11
|
import { ArrowRight as f, Trash2 as p } from "lucide-react";
|
|
12
12
|
//#region src/components/StorefrontCartPanel/index.tsx
|
|
13
|
-
function m({ lines: m, itemCount: h,
|
|
13
|
+
function m({ lines: m, itemCount: h, totalPerBaseUnitMinor: g, baseUnitLabel: _, estimatedTotalMinor: v, discountedEstimatedTotalMinor: y, discountAmountMinor: b, lateReturnSurchargeMinor: x, couponCode: S, durationInBaseUnitLabel: C, title: w, description: T, checkoutPath: E, showCheckoutAction: D = !1, showClearAction: O = !1, editable: k = !0, summaryAddon: A, stickyTopClassName: j = "top-24", onQuantityChange: M, onRemove: N, onClear: P }) {
|
|
14
14
|
let { t: F, i18n: I } = u();
|
|
15
15
|
return /* @__PURE__ */ c(i, {
|
|
16
16
|
className: d("sticky border-slate-200 bg-white shadow-sm", j),
|
|
@@ -62,7 +62,8 @@ function m({ lines: m, itemCount: h, totalPerDayMinor: g, estimatedDays: _, esti
|
|
|
62
62
|
className: "text-xs text-slate-600",
|
|
63
63
|
children: /* @__PURE__ */ s("span", { children: F("cart_line_meta", {
|
|
64
64
|
quantity: i.quantity,
|
|
65
|
-
price: o
|
|
65
|
+
price: o,
|
|
66
|
+
unit: _
|
|
66
67
|
}) })
|
|
67
68
|
}),
|
|
68
69
|
l ? /* @__PURE__ */ s("div", {
|
|
@@ -107,24 +108,24 @@ function m({ lines: m, itemCount: h, totalPerDayMinor: g, estimatedDays: _, esti
|
|
|
107
108
|
className: "flex items-center justify-between gap-3 border-t border-slate-200 pt-3 text-sm",
|
|
108
109
|
children: [/* @__PURE__ */ s("p", {
|
|
109
110
|
className: "text-slate-700",
|
|
110
|
-
children: /* @__PURE__ */ s("span", { children: F("
|
|
111
|
+
children: /* @__PURE__ */ s("span", { children: F("cart_total_per_unit", { unit: _ }) })
|
|
111
112
|
}), /* @__PURE__ */ s("p", {
|
|
112
113
|
className: "font-semibold text-slate-950",
|
|
113
114
|
children: /* @__PURE__ */ s("span", { children: e(g, I.language) })
|
|
114
115
|
})]
|
|
115
116
|
}),
|
|
116
|
-
typeof
|
|
117
|
-
/* @__PURE__ */ c("div", {
|
|
117
|
+
typeof v == "number" ? /* @__PURE__ */ c(o, { children: [
|
|
118
|
+
C ? /* @__PURE__ */ c("div", {
|
|
118
119
|
className: "flex items-center justify-between gap-3 text-sm",
|
|
119
120
|
children: [/* @__PURE__ */ s("p", {
|
|
120
121
|
className: "text-slate-700",
|
|
121
|
-
children: /* @__PURE__ */ s("span", { children: F("
|
|
122
|
-
}),
|
|
122
|
+
children: /* @__PURE__ */ s("span", { children: F("checkout_estimated_duration") })
|
|
123
|
+
}), /* @__PURE__ */ s(t, {
|
|
123
124
|
variant: "outline",
|
|
124
125
|
className: "border-slate-200 bg-white text-slate-700",
|
|
125
126
|
children: /* @__PURE__ */ s("span", { children: C })
|
|
126
|
-
})
|
|
127
|
-
}),
|
|
127
|
+
})]
|
|
128
|
+
}) : null,
|
|
128
129
|
typeof b == "number" && b > 0 ? /* @__PURE__ */ c("div", {
|
|
129
130
|
className: "flex items-center justify-between gap-3 text-sm",
|
|
130
131
|
children: [/* @__PURE__ */ s("p", {
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const storefront: {
|
|
|
7
7
|
nav_categories: string;
|
|
8
8
|
nav_featured: string;
|
|
9
9
|
nav_products: string;
|
|
10
|
+
nav_itineraries: string;
|
|
10
11
|
nav_contact: string;
|
|
11
12
|
language_toggle: string;
|
|
12
13
|
cta_book_now: string;
|
|
@@ -81,6 +82,36 @@ export declare const storefront: {
|
|
|
81
82
|
featured_title: string;
|
|
82
83
|
featured_description: string;
|
|
83
84
|
featured_view_all: string;
|
|
85
|
+
itineraries_eyebrow: string;
|
|
86
|
+
itineraries_title: string;
|
|
87
|
+
itineraries_description: string;
|
|
88
|
+
itineraries_list_label: string;
|
|
89
|
+
itineraries_view_all: string;
|
|
90
|
+
itineraries_back_home: string;
|
|
91
|
+
itineraries_page_title: string;
|
|
92
|
+
itineraries_page_description_one: string;
|
|
93
|
+
itineraries_page_description_other: string;
|
|
94
|
+
itineraries_filter_label: string;
|
|
95
|
+
itineraries_filter_all: string;
|
|
96
|
+
itineraries_no_results: string;
|
|
97
|
+
itineraries_difficulty_easy: string;
|
|
98
|
+
itineraries_difficulty_moderate: string;
|
|
99
|
+
itineraries_difficulty_challenging: string;
|
|
100
|
+
itineraries_back_to_list: string;
|
|
101
|
+
itineraries_route_label: string;
|
|
102
|
+
itineraries_step_fallback: string;
|
|
103
|
+
itineraries_highlights_label: string;
|
|
104
|
+
itineraries_distance_label: string;
|
|
105
|
+
itineraries_duration_label: string;
|
|
106
|
+
itineraries_elevation_gain_label: string;
|
|
107
|
+
itineraries_elevation_loss_label: string;
|
|
108
|
+
itineraries_difficulty_label: string;
|
|
109
|
+
itineraries_details_label: string;
|
|
110
|
+
itineraries_elevation_profile_label: string;
|
|
111
|
+
itineraries_elevation_profile_chart_label: string;
|
|
112
|
+
itineraries_booking_title: string;
|
|
113
|
+
itineraries_booking_description: string;
|
|
114
|
+
itineraries_booking_cta: string;
|
|
84
115
|
about_section_title: string;
|
|
85
116
|
about_section_heading: string;
|
|
86
117
|
about_section_fallback: string;
|
|
@@ -106,12 +137,18 @@ export declare const storefront: {
|
|
|
106
137
|
price_then: string;
|
|
107
138
|
price_details_aria_label: string;
|
|
108
139
|
price_table_title: string;
|
|
109
|
-
|
|
110
|
-
price_table_day_other: string;
|
|
111
|
-
price_table_per_day: string;
|
|
140
|
+
price_table_per_unit: string;
|
|
112
141
|
price_table_contact_prompt: string;
|
|
142
|
+
price_unit_hour_one: string;
|
|
143
|
+
price_unit_hour_other: string;
|
|
144
|
+
price_unit_half_day_one: string;
|
|
145
|
+
price_unit_half_day_other: string;
|
|
113
146
|
price_unit_day_one: string;
|
|
114
147
|
price_unit_day_other: string;
|
|
148
|
+
price_unit_week_one: string;
|
|
149
|
+
price_unit_week_other: string;
|
|
150
|
+
price_unit_month_one: string;
|
|
151
|
+
price_unit_month_other: string;
|
|
115
152
|
products_title: string;
|
|
116
153
|
products_description: string;
|
|
117
154
|
products_page_title: string;
|
|
@@ -131,7 +168,7 @@ export declare const storefront: {
|
|
|
131
168
|
cart_empty_description: string;
|
|
132
169
|
cart_line_meta: string;
|
|
133
170
|
remove_from_cart: string;
|
|
134
|
-
|
|
171
|
+
cart_total_per_unit: string;
|
|
135
172
|
cart_clear: string;
|
|
136
173
|
booking_select_variant_cancel: string;
|
|
137
174
|
close_modal: string;
|
|
@@ -153,8 +190,7 @@ export declare const storefront: {
|
|
|
153
190
|
checkout_subtitle: string;
|
|
154
191
|
checkout_summary_title: string;
|
|
155
192
|
checkout_summary_description: string;
|
|
156
|
-
|
|
157
|
-
checkout_estimated_days_other: string;
|
|
193
|
+
checkout_estimated_duration: string;
|
|
158
194
|
checkout_estimated_total: string;
|
|
159
195
|
checkout_form_title: string;
|
|
160
196
|
checkout_form_description: string;
|
package/dist/i18n/en.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgftB,CAAA"}
|
package/dist/i18n/en.js
CHANGED
|
@@ -8,6 +8,7 @@ var e = {
|
|
|
8
8
|
nav_categories: "Categories",
|
|
9
9
|
nav_featured: "Featured",
|
|
10
10
|
nav_products: "Bikes",
|
|
11
|
+
nav_itineraries: "Routes",
|
|
11
12
|
nav_contact: "Contact",
|
|
12
13
|
language_toggle: "FR/EN",
|
|
13
14
|
cta_book_now: "Book now",
|
|
@@ -82,6 +83,36 @@ var e = {
|
|
|
82
83
|
featured_title: "Featured bikes",
|
|
83
84
|
featured_description: "Popular picks to get started quickly.",
|
|
84
85
|
featured_view_all: "See all bikes",
|
|
86
|
+
itineraries_eyebrow: "Explore by bike",
|
|
87
|
+
itineraries_title: "Our favorite routes",
|
|
88
|
+
itineraries_description: "Routes selected by the shop to help you discover the most beautiful roads nearby.",
|
|
89
|
+
itineraries_list_label: "Routes to discover",
|
|
90
|
+
itineraries_view_all: "View all routes",
|
|
91
|
+
itineraries_back_home: "Back to home",
|
|
92
|
+
itineraries_page_title: "Choose your next ride",
|
|
93
|
+
itineraries_page_description_one: "Discover {{count}} route prepared for your stay.",
|
|
94
|
+
itineraries_page_description_other: "Discover {{count}} routes prepared for your stay.",
|
|
95
|
+
itineraries_filter_label: "Filter by difficulty",
|
|
96
|
+
itineraries_filter_all: "All levels",
|
|
97
|
+
itineraries_no_results: "No route matches this difficulty level.",
|
|
98
|
+
itineraries_difficulty_easy: "Easy",
|
|
99
|
+
itineraries_difficulty_moderate: "Moderate",
|
|
100
|
+
itineraries_difficulty_challenging: "Challenging",
|
|
101
|
+
itineraries_back_to_list: "All routes",
|
|
102
|
+
itineraries_route_label: "The route, step by step",
|
|
103
|
+
itineraries_step_fallback: "Step {{count}}",
|
|
104
|
+
itineraries_highlights_label: "Highlights",
|
|
105
|
+
itineraries_distance_label: "Distance",
|
|
106
|
+
itineraries_duration_label: "Duration",
|
|
107
|
+
itineraries_elevation_gain_label: "Elevation gain",
|
|
108
|
+
itineraries_elevation_loss_label: "Elevation loss",
|
|
109
|
+
itineraries_difficulty_label: "Difficulty level",
|
|
110
|
+
itineraries_details_label: "Route information",
|
|
111
|
+
itineraries_elevation_profile_label: "Elevation profile",
|
|
112
|
+
itineraries_elevation_profile_chart_label: "Route elevation chart",
|
|
113
|
+
itineraries_booking_title: "Ready to ride this route?",
|
|
114
|
+
itineraries_booking_description: "Choose your bike and dates, then head out and explore the route.",
|
|
115
|
+
itineraries_booking_cta: "Book a bike",
|
|
85
116
|
about_section_title: "About",
|
|
86
117
|
about_section_heading: "About the storefront",
|
|
87
118
|
about_section_fallback: "This shop hasn’t added a description yet.",
|
|
@@ -103,16 +134,22 @@ var e = {
|
|
|
103
134
|
availability_checking: "Checking availability",
|
|
104
135
|
availability_remaining_count_one: "{{count}} available",
|
|
105
136
|
availability_remaining_count_other: "{{count}} available",
|
|
106
|
-
price_from: "From {{price}} /
|
|
137
|
+
price_from: "From {{price}} / {{unit}}",
|
|
107
138
|
price_then: "then {{price}}",
|
|
108
139
|
price_details_aria_label: "Show pricing details for {{price}}",
|
|
109
140
|
price_table_title: "Rental pricing",
|
|
110
|
-
|
|
111
|
-
price_table_day_other: "{{count}} days",
|
|
112
|
-
price_table_per_day: "{{price}}/d",
|
|
141
|
+
price_table_per_unit: "{{price}}/{{unit}}",
|
|
113
142
|
price_table_contact_prompt: "For a specific booking or a longer rental, feel free to contact us.",
|
|
143
|
+
price_unit_hour_one: "hour",
|
|
144
|
+
price_unit_hour_other: "hours",
|
|
145
|
+
price_unit_half_day_one: "half-day",
|
|
146
|
+
price_unit_half_day_other: "half-days",
|
|
114
147
|
price_unit_day_one: "day",
|
|
115
148
|
price_unit_day_other: "days",
|
|
149
|
+
price_unit_week_one: "week",
|
|
150
|
+
price_unit_week_other: "weeks",
|
|
151
|
+
price_unit_month_one: "month",
|
|
152
|
+
price_unit_month_other: "months",
|
|
116
153
|
products_title: "Our bikes range",
|
|
117
154
|
products_description: "Browse bikes and reserve in a few clicks.",
|
|
118
155
|
products_page_title: "Choose your bikes",
|
|
@@ -130,9 +167,9 @@ var e = {
|
|
|
130
167
|
cart_empty: "Your cart is empty.",
|
|
131
168
|
cart_empty_title: "Your cart is empty",
|
|
132
169
|
cart_empty_description: "Add a bike (and accessories) to continue.",
|
|
133
|
-
cart_line_meta: "Qty {{quantity}} · {{price}} /
|
|
170
|
+
cart_line_meta: "Qty {{quantity}} · {{price}} / {{unit}}",
|
|
134
171
|
remove_from_cart: "Remove from cart",
|
|
135
|
-
|
|
172
|
+
cart_total_per_unit: "Total / {{unit}}",
|
|
136
173
|
cart_clear: "Clear cart",
|
|
137
174
|
booking_select_variant_cancel: "Cancel",
|
|
138
175
|
close_modal: "Close",
|
|
@@ -154,8 +191,7 @@ var e = {
|
|
|
154
191
|
checkout_subtitle: "Confirm your details and payment · {{duration}}",
|
|
155
192
|
checkout_summary_title: "Summary",
|
|
156
193
|
checkout_summary_description: "Cart and pricing recap.",
|
|
157
|
-
|
|
158
|
-
checkout_estimated_days_other: "Estimated duration: {{count}} days",
|
|
194
|
+
checkout_estimated_duration: "Estimated duration",
|
|
159
195
|
checkout_estimated_total: "Booking total",
|
|
160
196
|
checkout_form_title: "Your details",
|
|
161
197
|
checkout_form_description: "Enter your details for this booking, and add any useful information in the notes.",
|