@loczer/storefront-sdk 0.208.0 → 0.209.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/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/i18n/en.d.ts +31 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +31 -0
- package/dist/i18n/fr.d.ts +31 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +31 -0
- package/dist/index.d.ts +763 -0
- package/dist/index.js +58 -51
- 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/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.js +8 -8
- package/dist/pages/CheckoutPage.js +4 -4
- 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/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
package/dist/pages/HomePage.js
CHANGED
|
@@ -5,37 +5,39 @@ import { buildStorefrontImageUrl as c } from "../lib/storefrontImage.js";
|
|
|
5
5
|
import "../lib/storefrontMissingValues.js";
|
|
6
6
|
import { Badge as l } from "../ui/badge.js";
|
|
7
7
|
import { Button as u } from "../ui/button.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
8
|
+
import { useStorefront as te, useStorefrontProducts as ne } from "../StorefrontContext.js";
|
|
9
|
+
import { usePlaygroundDevSettings as re } from "../lib/playgroundDevSettings.js";
|
|
10
|
+
import { BookingPeriodProvider as ie, useBookingPeriod as d } from "../components/BookingPeriodSelector/BookingPeriodContext.js";
|
|
11
|
+
import { BookingStartDateField as ae } from "../components/BookingPeriodSelector/components/BookingStartDateField.js";
|
|
12
|
+
import { BookingStartTimeField as oe } from "../components/BookingPeriodSelector/components/BookingStartTimeField.js";
|
|
13
|
+
import { BookingEndDateField as se } from "../components/BookingPeriodSelector/components/BookingEndDateField.js";
|
|
14
|
+
import { BookingEndTimeField as ce } from "../components/BookingPeriodSelector/components/BookingEndTimeField.js";
|
|
15
|
+
import { BookingTimeSlotsStatus as le } from "../components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js";
|
|
15
16
|
import "../components/BookingPeriodSelector/index.js";
|
|
16
|
-
import { DeliveryAddressSelector as
|
|
17
|
-
import { useStorefront as le, useStorefrontProducts as ue } from "../StorefrontContext.js";
|
|
17
|
+
import { DeliveryAddressSelector as ue } from "../components/DeliveryAddressSelector/index.js";
|
|
18
18
|
import { ContactSection as de } from "../components/ContactSection/index.js";
|
|
19
19
|
import { TestimonialsSection as fe } from "../components/TestimonialsSection/index.js";
|
|
20
20
|
import { AboutSection as pe } from "../components/AboutSection/index.js";
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
21
|
+
import { ItinerariesSection as me } from "../components/Itineraries/ItinerariesSection.js";
|
|
22
|
+
import "../components/Itineraries/index.js";
|
|
23
|
+
import { Card as he } from "../ui/card.js";
|
|
24
|
+
import { ProductWarningNotice as ge } from "../components/ProductWarningNotice/index.js";
|
|
25
|
+
import { ProductPriceBadge as _e } from "../components/ProductPriceBadge/index.js";
|
|
26
|
+
import ve from "../chunks/assets/playground-hero-preview-kf4c9tSc.js";
|
|
27
|
+
import { resolveProductImageContainerStyle as ye } from "../lib/productImageStyles.js";
|
|
28
|
+
import { BikeProductCard as be } from "../components/BikeProductCard/index.js";
|
|
29
|
+
import { StorefrontCancellationPolicyNotice as xe } from "../components/StorefrontCancellationPolicyNotice/index.js";
|
|
30
|
+
import { StorefrontInsuranceNotice as Se } from "../components/StorefrontInsuranceNotice/index.js";
|
|
31
|
+
import { createStorefrontTimeSlotsFetcher as Ce } from "../lib/fetchStorefrontTimeSlots.js";
|
|
32
|
+
import { FulfillmentSection as we } from "../components/FulfillmentSection/index.js";
|
|
33
|
+
import { useEffect as f, useMemo as p, useRef as Te, useState as m } from "react";
|
|
32
34
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
33
|
-
import { Link as v, useLocation as
|
|
34
|
-
import { useTranslation as
|
|
35
|
+
import { Link as v, useLocation as Ee, useNavigate as De, useParams as Oe, useSearchParams as ke } from "@rpcbase/router";
|
|
36
|
+
import { useTranslation as Ae } from "react-i18next";
|
|
35
37
|
import { cn as y } from "@rpcbase/ui";
|
|
36
|
-
import { ArrowRight as b, Bike as
|
|
38
|
+
import { ArrowRight as b, Bike as je, Clock as Me, MapPin as Ne, ShieldCheck as Pe, Truck as Fe } from "lucide-react";
|
|
37
39
|
//#region src/pages/HomePage.tsx
|
|
38
|
-
var x = (e) => String(e).padStart(2, "0"),
|
|
40
|
+
var x = (e) => String(e).padStart(2, "0"), Ie = "text-2xs font-semibold uppercase tracking-wide text-slate-600", Le = "h-10", S = 6, C = 5, Re = [
|
|
39
41
|
15,
|
|
40
42
|
25,
|
|
41
43
|
42,
|
|
@@ -51,7 +53,7 @@ var x = (e) => String(e).padStart(2, "0"), Fe = "text-2xs font-semibold uppercas
|
|
|
51
53
|
"4 / 3",
|
|
52
54
|
"9 / 16",
|
|
53
55
|
"6 / 7"
|
|
54
|
-
],
|
|
56
|
+
], ze = ({ buttonRef: e, className: t, label: n, onSubmit: r }) => {
|
|
55
57
|
let { hasConfirmedTimeSlots: i, startTime: a, endTime: o } = d();
|
|
56
58
|
return /* @__PURE__ */ _(u, {
|
|
57
59
|
ref: e,
|
|
@@ -69,8 +71,8 @@ var x = (e) => String(e).padStart(2, "0"), Fe = "text-2xs font-semibold uppercas
|
|
|
69
71
|
if (!t) return;
|
|
70
72
|
let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), a = new Date(n, r - 1, i);
|
|
71
73
|
if (!(Number.isNaN(a.getTime()) || a.getFullYear() !== n || a.getMonth() !== r - 1 || a.getDate() !== i)) return a;
|
|
72
|
-
},
|
|
73
|
-
let t = e.length > 0 ? e : [
|
|
74
|
+
}, Be = (e) => {
|
|
75
|
+
let t = e.length > 0 ? e : [ve];
|
|
74
76
|
return Array.from({ length: S }, (e, n) => Array.from({ length: C }, (e, r) => {
|
|
75
77
|
let i = n * C + r;
|
|
76
78
|
return {
|
|
@@ -80,15 +82,15 @@ var x = (e) => String(e).padStart(2, "0"), Fe = "text-2xs font-semibold uppercas
|
|
|
80
82
|
}));
|
|
81
83
|
};
|
|
82
84
|
function D() {
|
|
83
|
-
let { t: d, i18n: x } =
|
|
85
|
+
let { t: d, i18n: x } = Ae(), { storeSlug: S } = Oe(), C = Ee(), { storefrontConfiguration: w } = te(), D = w.shop.address?.trim() ?? "", O = w.workspace?.workspaceLanguage, { bikes: k, accessories: Ve } = ne(), [A, He] = ke(), Ue = De(), j = p(() => a(A, S), [A, S]), We = p(() => n(w), [w]), M = p(() => i(w), [w]), N = p(() => E(M.start_date), [M.start_date]), Ge = p(() => E(M.end_date) ?? N, [M.end_date, N]), P = w.settings.fulfillmentModes.includes("delivery"), Ke = w.settings.deliveryDisabledReason.trim(), F = p(() => r(j, M), [M, j]), [I, qe] = m(() => F.fulfillment === "delivery" && P ? "delivery" : "pickup"), [L, Je] = m(() => E(j.get("start_date")) ?? N), [R, Ye] = m(() => j.get("start_time") ?? M.start_time), [z, Xe] = m(() => {
|
|
84
86
|
let e = E(j.get("start_date")) ?? N;
|
|
85
|
-
return E(j.get("end_date")) ?? e ??
|
|
86
|
-
}), [B,
|
|
87
|
+
return E(j.get("end_date")) ?? e ?? Ge;
|
|
88
|
+
}), [B, Ze] = m(() => j.get("end_time") ?? M.end_time), [Qe, $e] = m(void 0), [et, tt] = m(!1), [V, H] = m(() => F.start_address), [U, W] = m(() => F.end_address), G = Te(null), nt = [
|
|
87
89
|
L ? T(L) : "",
|
|
88
90
|
R,
|
|
89
91
|
z ? T(z) : "",
|
|
90
92
|
B
|
|
91
|
-
].join(":"), K =
|
|
93
|
+
].join(":"), K = Qe === nt, rt = p(() => k.slice(0, 4), [k]), { heroMode: it } = re(), at = it ?? w.content?.heroMode ?? "current_booking_hero", q = at === "vertical_marquee_hero", J = at === "booking_bar_overlay_hero" || q, ot = Ce(S), st = p(() => ({
|
|
92
94
|
startDate: d("booking_start_date"),
|
|
93
95
|
pickStartDate: d("booking_start_date"),
|
|
94
96
|
startTime: d("booking_start_time"),
|
|
@@ -122,56 +124,56 @@ function D() {
|
|
|
122
124
|
V,
|
|
123
125
|
L,
|
|
124
126
|
R
|
|
125
|
-
]),
|
|
127
|
+
]), ct = Y.toString(), lt = ct ? `?${ct}` : "";
|
|
126
128
|
f(() => {
|
|
127
129
|
o(S, Y);
|
|
128
130
|
}, [Y, S]), f(() => {
|
|
129
131
|
let t = new URLSearchParams(A);
|
|
130
132
|
for (let n of e) t.delete(n);
|
|
131
133
|
for (let [e, n] of Y.entries()) t.set(e, n);
|
|
132
|
-
t.toString() !== A.toString() &&
|
|
134
|
+
t.toString() !== A.toString() && He(t, { replace: !0 });
|
|
133
135
|
}, [
|
|
134
136
|
Y,
|
|
135
137
|
A,
|
|
136
|
-
|
|
138
|
+
He
|
|
137
139
|
]), f(() => {
|
|
138
|
-
|
|
139
|
-
}, [K,
|
|
140
|
-
let
|
|
140
|
+
!et || !K || (tt(!1), G.current?.focus({ preventScroll: !0 }));
|
|
141
|
+
}, [K, et]);
|
|
142
|
+
let ut = K && !!(R && B), dt = {
|
|
141
143
|
startDate: L,
|
|
142
|
-
onStartDateChange:
|
|
144
|
+
onStartDateChange: Je,
|
|
143
145
|
startTime: R,
|
|
144
|
-
onStartTimeChange:
|
|
146
|
+
onStartTimeChange: Ye,
|
|
145
147
|
endDate: z,
|
|
146
|
-
onEndDateChange:
|
|
148
|
+
onEndDateChange: Xe,
|
|
147
149
|
endTime: B,
|
|
148
|
-
onEndTimeChange:
|
|
149
|
-
onEndTimeCommit: () =>
|
|
150
|
-
bookingPeriodConfig:
|
|
151
|
-
fetchTimeSlots:
|
|
150
|
+
onEndTimeChange: Ze,
|
|
151
|
+
onEndTimeCommit: () => tt(!0),
|
|
152
|
+
bookingPeriodConfig: We,
|
|
153
|
+
fetchTimeSlots: ot,
|
|
152
154
|
onTimeSlotsConfirmationChange: (e) => {
|
|
153
|
-
|
|
155
|
+
$e(e ? nt : void 0);
|
|
154
156
|
},
|
|
155
|
-
labels:
|
|
157
|
+
labels: st,
|
|
156
158
|
localeCode: x.language
|
|
157
159
|
}, X = () => {
|
|
158
|
-
if (!
|
|
160
|
+
if (!ut) return;
|
|
159
161
|
let e = new URLSearchParams(A);
|
|
160
162
|
for (let [t, n] of Y.entries()) e.set(t, n);
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
+
Ue(`/${S ?? ""}/booking?${e.toString()}#booking-products`);
|
|
164
|
+
}, ft = (e) => `/${S ?? ""}/products/${e}`, Z = { backTo: `${C.pathname}${C.search}${C.hash}` }, pt = /* @__PURE__ */ _("div", { children: [
|
|
163
165
|
/* @__PURE__ */ _("div", {
|
|
164
166
|
className: "flex items-center gap-2",
|
|
165
167
|
children: [/* @__PURE__ */ _(l, {
|
|
166
168
|
variant: "secondary",
|
|
167
|
-
children: [/* @__PURE__ */ g(
|
|
169
|
+
children: [/* @__PURE__ */ g(Me, {
|
|
168
170
|
className: "h-3 w-3",
|
|
169
171
|
"aria-hidden": "true"
|
|
170
172
|
}), /* @__PURE__ */ g("span", { children: d("status_open") })]
|
|
171
173
|
}), /* @__PURE__ */ _(l, {
|
|
172
174
|
variant: "outline",
|
|
173
175
|
className: y(!D && "border-destructive/40 text-destructive"),
|
|
174
|
-
children: [/* @__PURE__ */ g(
|
|
176
|
+
children: [/* @__PURE__ */ g(Ne, {
|
|
175
177
|
className: "h-3 w-3",
|
|
176
178
|
"aria-hidden": "true"
|
|
177
179
|
}), /* @__PURE__ */ g("span", { children: D || "[Missing shop address]" })]
|
|
@@ -194,7 +196,7 @@ function D() {
|
|
|
194
196
|
/* @__PURE__ */ _("li", {
|
|
195
197
|
className: "flex items-start gap-3",
|
|
196
198
|
"data-testid": "storefront-secure-payment-notice",
|
|
197
|
-
children: [/* @__PURE__ */ g(
|
|
199
|
+
children: [/* @__PURE__ */ g(Pe, {
|
|
198
200
|
className: "mt-0.5 h-5 w-5 text-success",
|
|
199
201
|
"aria-hidden": "true"
|
|
200
202
|
}), /* @__PURE__ */ _("div", {
|
|
@@ -208,14 +210,14 @@ function D() {
|
|
|
208
210
|
})]
|
|
209
211
|
})]
|
|
210
212
|
}),
|
|
211
|
-
/* @__PURE__ */ g(
|
|
213
|
+
/* @__PURE__ */ g(xe, {
|
|
212
214
|
policy: w.bookingEngine.cancellationPolicy,
|
|
213
215
|
className: y(!J && "border-t border-slate-200/70 pt-3")
|
|
214
216
|
}),
|
|
215
217
|
P ? /* @__PURE__ */ _("li", {
|
|
216
218
|
className: y("flex items-start gap-3", !J && "border-t border-slate-200/70 pt-3"),
|
|
217
219
|
"data-testid": "storefront-delivery-notice",
|
|
218
|
-
children: [/* @__PURE__ */ g(
|
|
220
|
+
children: [/* @__PURE__ */ g(Fe, {
|
|
219
221
|
className: "mt-0.5 h-5 w-5 text-slate-900",
|
|
220
222
|
"aria-hidden": "true"
|
|
221
223
|
}), /* @__PURE__ */ _("div", {
|
|
@@ -229,7 +231,7 @@ function D() {
|
|
|
229
231
|
})]
|
|
230
232
|
})]
|
|
231
233
|
}) : null,
|
|
232
|
-
/* @__PURE__ */ g(
|
|
234
|
+
/* @__PURE__ */ g(Se, {
|
|
233
235
|
bikes: k,
|
|
234
236
|
currency: w.bookingEngine.currency,
|
|
235
237
|
className: y(!J && "border-t border-slate-200/70 pt-3")
|
|
@@ -237,45 +239,45 @@ function D() {
|
|
|
237
239
|
]
|
|
238
240
|
})
|
|
239
241
|
})
|
|
240
|
-
] }),
|
|
241
|
-
...
|
|
242
|
-
labelClassName:
|
|
243
|
-
inputClassName:
|
|
242
|
+
] }), Q = ({ className: e, showSubmitButton: t = !1, submitButtonClassName: n }) => /* @__PURE__ */ g(ie, {
|
|
243
|
+
...dt,
|
|
244
|
+
labelClassName: Ie,
|
|
245
|
+
inputClassName: Le,
|
|
244
246
|
children: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("div", {
|
|
245
247
|
className: e,
|
|
246
248
|
children: [
|
|
247
249
|
/* @__PURE__ */ g("div", {
|
|
248
250
|
className: "min-w-0",
|
|
249
|
-
children: /* @__PURE__ */ g(
|
|
251
|
+
children: /* @__PURE__ */ g(ae, {})
|
|
250
252
|
}),
|
|
251
|
-
/* @__PURE__ */ g(
|
|
253
|
+
/* @__PURE__ */ g(oe, {}),
|
|
252
254
|
/* @__PURE__ */ g("div", {
|
|
253
255
|
className: "min-w-0",
|
|
254
|
-
children: /* @__PURE__ */ g(
|
|
256
|
+
children: /* @__PURE__ */ g(se, {})
|
|
255
257
|
}),
|
|
256
|
-
/* @__PURE__ */ g(
|
|
257
|
-
t ? /* @__PURE__ */ g(
|
|
258
|
+
/* @__PURE__ */ g(ce, {}),
|
|
259
|
+
t ? /* @__PURE__ */ g(ze, {
|
|
258
260
|
buttonRef: G,
|
|
259
261
|
className: n,
|
|
260
262
|
label: d("booking_submit"),
|
|
261
263
|
onSubmit: X
|
|
262
264
|
}) : null
|
|
263
265
|
]
|
|
264
|
-
}), /* @__PURE__ */ g(
|
|
266
|
+
}), /* @__PURE__ */ g(le, {
|
|
265
267
|
className: "mt-2",
|
|
266
268
|
testId: "booking-home-time-slots-status"
|
|
267
269
|
})] })
|
|
268
|
-
}),
|
|
270
|
+
}), mt = (e) => P ? /* @__PURE__ */ g(ue, {
|
|
269
271
|
open: I === "delivery",
|
|
270
272
|
className: "sm:min-h-[6.75rem]",
|
|
271
|
-
inputClassName: `${
|
|
272
|
-
labelClassName:
|
|
273
|
+
inputClassName: `${Le} bg-white`,
|
|
274
|
+
labelClassName: Ie,
|
|
273
275
|
startAddress: V,
|
|
274
276
|
onStartAddressChange: H,
|
|
275
277
|
returnAddress: U,
|
|
276
278
|
onReturnAddressChange: W,
|
|
277
279
|
testIdPrefix: e
|
|
278
|
-
}) : null,
|
|
280
|
+
}) : null, ht = mt("storefront-home-fulfillment-delivery-address"), gt = mt("storefront-home-compact-fulfillment-delivery-address"), _t = /* @__PURE__ */ _(he, {
|
|
279
281
|
className: "border-slate-200 bg-white/80 shadow-none",
|
|
280
282
|
children: [/* @__PURE__ */ _("div", {
|
|
281
283
|
className: "border-b border-slate-200 px-4 py-4",
|
|
@@ -289,12 +291,12 @@ function D() {
|
|
|
289
291
|
}), /* @__PURE__ */ _("div", {
|
|
290
292
|
className: "grid gap-4 px-4 py-4",
|
|
291
293
|
children: [
|
|
292
|
-
/* @__PURE__ */ g(
|
|
294
|
+
/* @__PURE__ */ g(we, {
|
|
293
295
|
value: I,
|
|
294
|
-
onValueChange:
|
|
296
|
+
onValueChange: qe,
|
|
295
297
|
pickupAddress: D,
|
|
296
298
|
deliveryEnabled: P,
|
|
297
|
-
deliveryDisabledReason:
|
|
299
|
+
deliveryDisabledReason: Ke,
|
|
298
300
|
startAddress: V,
|
|
299
301
|
onStartAddressChange: H,
|
|
300
302
|
endAddress: U,
|
|
@@ -302,8 +304,8 @@ function D() {
|
|
|
302
304
|
showDeliveryAddressSelector: !1,
|
|
303
305
|
testIdPrefix: "storefront-home-fulfillment"
|
|
304
306
|
}),
|
|
305
|
-
|
|
306
|
-
|
|
307
|
+
Q({ className: "grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-[minmax(0,1fr)_150px_minmax(0,1fr)_150px] xl:items-start" }),
|
|
308
|
+
ht,
|
|
307
309
|
/* @__PURE__ */ g("p", {
|
|
308
310
|
className: "text-xs text-slate-600",
|
|
309
311
|
children: /* @__PURE__ */ g("span", { children: d("booking_minimum_duration", { hours: 4 }) })
|
|
@@ -311,7 +313,7 @@ function D() {
|
|
|
311
313
|
/* @__PURE__ */ _(u, {
|
|
312
314
|
ref: G,
|
|
313
315
|
className: "h-11 w-fit justify-self-start rounded-xl text-sm font-semibold gap-2",
|
|
314
|
-
disabled: !
|
|
316
|
+
disabled: !ut,
|
|
315
317
|
onClick: X,
|
|
316
318
|
children: [/* @__PURE__ */ g("span", { children: d("booking_submit") }), /* @__PURE__ */ g(b, {
|
|
317
319
|
className: "h-4 w-4",
|
|
@@ -320,17 +322,17 @@ function D() {
|
|
|
320
322
|
})
|
|
321
323
|
]
|
|
322
324
|
})]
|
|
323
|
-
}),
|
|
325
|
+
}), vt = /* @__PURE__ */ g(he, {
|
|
324
326
|
className: "border-slate-200 bg-white/95 shadow-xl",
|
|
325
327
|
children: /* @__PURE__ */ _("div", {
|
|
326
328
|
className: "grid gap-3 p-4",
|
|
327
329
|
children: [
|
|
328
|
-
/* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(
|
|
330
|
+
/* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(we, {
|
|
329
331
|
value: I,
|
|
330
|
-
onValueChange:
|
|
332
|
+
onValueChange: qe,
|
|
331
333
|
pickupAddress: D,
|
|
332
334
|
deliveryEnabled: P,
|
|
333
|
-
deliveryDisabledReason:
|
|
335
|
+
deliveryDisabledReason: Ke,
|
|
334
336
|
startAddress: V,
|
|
335
337
|
onStartAddressChange: H,
|
|
336
338
|
endAddress: U,
|
|
@@ -338,15 +340,15 @@ function D() {
|
|
|
338
340
|
showDeliveryAddressSelector: !1,
|
|
339
341
|
testIdPrefix: "storefront-home-compact-fulfillment"
|
|
340
342
|
}) }),
|
|
341
|
-
|
|
343
|
+
Q({
|
|
342
344
|
className: "grid gap-3 md:grid-cols-2 xl:grid-cols-[minmax(0,1fr)_150px_minmax(0,1fr)_150px_auto] xl:items-end",
|
|
343
345
|
showSubmitButton: !0,
|
|
344
346
|
submitButtonClassName: "h-10 rounded-xl text-sm font-semibold xl:self-end"
|
|
345
347
|
}),
|
|
346
|
-
|
|
348
|
+
gt
|
|
347
349
|
]
|
|
348
350
|
})
|
|
349
|
-
}), $ = (w.content?.galleryImageIds ?? []).map((e) => e.trim()).filter((e) => e.length > 0),
|
|
351
|
+
}), $ = (w.content?.galleryImageIds ?? []).map((e) => e.trim()).filter((e) => e.length > 0), yt = $.map((e) => c(e, S ?? w.storeSlug, 320)).filter((e) => e.length > 0), bt = [...k, ...Ve].flatMap((e) => Array.isArray(e.images) ? e.images : []).filter((e) => typeof e == "string" && e.trim().length > 0).map((e) => e.trim()).slice(0, 12), xt = Be(yt.length > 0 ? yt : bt), St = $[0] ? c($[0], S ?? w.storeSlug, 1600) : ve, Ct = q ? /* @__PURE__ */ g("style", { children: "\n @keyframes storefront-hero-marquee-up {\n 0% { transform: translateY(0); }\n 100% { transform: translateY(calc(-50% - (var(--storefront-hero-marquee-gap) / 2))); }\n }\n @keyframes storefront-hero-marquee-down {\n 0% { transform: translateY(calc(-50% - (var(--storefront-hero-marquee-gap) / 2))); }\n 100% { transform: translateY(0); }\n }\n .storefront-hero-marquee-track {\n animation: storefront-hero-marquee-up var(--storefront-hero-marquee-duration, 32s) linear infinite;\n will-change: transform;\n }\n .storefront-hero-marquee-track-reverse {\n animation-name: storefront-hero-marquee-down;\n }\n @media (prefers-reduced-motion: reduce) {\n .storefront-hero-marquee-track,\n .storefront-hero-marquee-track-reverse {\n animation: none !important;\n transform: none !important;\n }\n }\n " }) : null, wt = (e) => /* @__PURE__ */ g("div", {
|
|
350
352
|
className: y("relative h-full min-h-[340px] overflow-hidden", e),
|
|
351
353
|
style: {
|
|
352
354
|
WebkitMaskImage: "linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%)",
|
|
@@ -359,8 +361,8 @@ function D() {
|
|
|
359
361
|
"aria-hidden": "true",
|
|
360
362
|
children: /* @__PURE__ */ g("div", {
|
|
361
363
|
className: "absolute inset-0 grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-6",
|
|
362
|
-
children:
|
|
363
|
-
let n =
|
|
364
|
+
children: xt.map((e, t) => {
|
|
365
|
+
let n = Re[t % Re.length] ?? 32, r = [...e, ...e];
|
|
364
366
|
return /* @__PURE__ */ g("div", {
|
|
365
367
|
className: y("relative min-h-0 overflow-hidden", t === 2 && "hidden md:block", t >= 3 && "hidden lg:block"),
|
|
366
368
|
children: /* @__PURE__ */ g("div", {
|
|
@@ -387,26 +389,26 @@ function D() {
|
|
|
387
389
|
}, `hero-marquee-column-${t}`);
|
|
388
390
|
})
|
|
389
391
|
})
|
|
390
|
-
}),
|
|
392
|
+
}), Tt = q ? /* @__PURE__ */ g("div", {
|
|
391
393
|
className: "pointer-events-none absolute inset-0 hidden lg:block",
|
|
392
394
|
"aria-hidden": "true",
|
|
393
395
|
children: /* @__PURE__ */ _("div", {
|
|
394
396
|
className: "mx-auto grid h-full max-w-7xl grid-cols-12 gap-8 px-4 sm:px-6",
|
|
395
397
|
children: [/* @__PURE__ */ g("div", { className: "lg:col-span-5" }), /* @__PURE__ */ g("div", {
|
|
396
398
|
className: "lg:col-span-7",
|
|
397
|
-
children:
|
|
399
|
+
children: wt()
|
|
398
400
|
})]
|
|
399
401
|
})
|
|
400
|
-
}) : null,
|
|
402
|
+
}) : null, Et = q ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
401
403
|
className: "lg:hidden",
|
|
402
|
-
children:
|
|
404
|
+
children: wt()
|
|
403
405
|
}), /* @__PURE__ */ g("div", {
|
|
404
406
|
className: "hidden min-h-[510px] lg:block",
|
|
405
407
|
"aria-hidden": "true"
|
|
406
408
|
})] }) : /* @__PURE__ */ _("div", {
|
|
407
409
|
className: "relative min-h-[340px] overflow-hidden rounded-3xl border border-slate-200 bg-slate-900 shadow-sm lg:min-h-[510px]",
|
|
408
410
|
children: [/* @__PURE__ */ g("img", {
|
|
409
|
-
src:
|
|
411
|
+
src: St,
|
|
410
412
|
alt: "",
|
|
411
413
|
className: "absolute inset-0 h-full w-full object-cover",
|
|
412
414
|
"aria-hidden": "true"
|
|
@@ -428,25 +430,25 @@ function D() {
|
|
|
428
430
|
style: { backgroundImage: "radial-gradient(circle at 20% 20%, rgba(15, 23, 42, 0.9) 0px, transparent 55%), radial-gradient(circle at 80% 35%, rgba(14, 116, 144, 0.9) 0px, transparent 55%), radial-gradient(circle at 55% 85%, rgba(99, 102, 241, 0.9) 0px, transparent 55%)" },
|
|
429
431
|
"aria-hidden": "true"
|
|
430
432
|
}),
|
|
431
|
-
|
|
432
|
-
|
|
433
|
+
Ct,
|
|
434
|
+
Tt,
|
|
433
435
|
J ? /* @__PURE__ */ _("div", {
|
|
434
436
|
className: "relative mx-auto grid max-w-7xl gap-x-8 px-4 py-10 sm:px-6 lg:grid-cols-12 lg:py-14",
|
|
435
437
|
children: [
|
|
436
438
|
/* @__PURE__ */ g("div", {
|
|
437
439
|
className: "lg:col-span-5 lg:col-start-1 lg:row-start-1",
|
|
438
|
-
children:
|
|
440
|
+
children: pt
|
|
439
441
|
}),
|
|
440
442
|
/* @__PURE__ */ g("div", {
|
|
441
443
|
className: y("mt-8 lg:col-span-7 lg:col-start-6 lg:row-span-2 lg:row-start-1 lg:mt-0", !q && "lg:pt-4"),
|
|
442
|
-
children:
|
|
444
|
+
children: Et
|
|
443
445
|
}),
|
|
444
446
|
/* @__PURE__ */ g("div", {
|
|
445
447
|
className: "relative z-20 mt-4 lg:col-span-5 lg:col-start-1 lg:row-start-2 lg:mt-7",
|
|
446
448
|
"data-testid": "storefront-home-booking-bar",
|
|
447
449
|
children: /* @__PURE__ */ g("div", {
|
|
448
450
|
className: "lg:w-[calc(100%+24rem)] lg:max-w-none",
|
|
449
|
-
children:
|
|
451
|
+
children: vt
|
|
450
452
|
})
|
|
451
453
|
})
|
|
452
454
|
]
|
|
@@ -454,10 +456,10 @@ function D() {
|
|
|
454
456
|
className: "relative mx-auto grid max-w-7xl gap-8 px-4 py-10 sm:px-6 lg:grid-cols-12 lg:items-center lg:py-14",
|
|
455
457
|
children: [/* @__PURE__ */ g("div", {
|
|
456
458
|
className: "lg:col-span-5",
|
|
457
|
-
children:
|
|
459
|
+
children: pt
|
|
458
460
|
}), /* @__PURE__ */ g("div", {
|
|
459
461
|
className: "lg:col-span-7",
|
|
460
|
-
children:
|
|
462
|
+
children: _t
|
|
461
463
|
})]
|
|
462
464
|
})
|
|
463
465
|
]
|
|
@@ -478,7 +480,7 @@ function D() {
|
|
|
478
480
|
})]
|
|
479
481
|
}), /* @__PURE__ */ _(v, {
|
|
480
482
|
className: "hidden items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950 sm:inline-flex",
|
|
481
|
-
to: `/${S ?? ""}/booking${
|
|
483
|
+
to: `/${S ?? ""}/booking${lt}`,
|
|
482
484
|
children: [/* @__PURE__ */ g("span", { children: d("featured_view_all") }), /* @__PURE__ */ g(b, {
|
|
483
485
|
className: "h-4 w-4",
|
|
484
486
|
"aria-hidden": "true"
|
|
@@ -486,8 +488,8 @@ function D() {
|
|
|
486
488
|
})]
|
|
487
489
|
}), /* @__PURE__ */ g("div", {
|
|
488
490
|
className: "mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
489
|
-
children:
|
|
490
|
-
let t = e.id, n = e.slug, r = s(e.name, x.language, O), i = s(e.description, x.language, O), a = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", o =
|
|
491
|
+
children: rt.map((e) => {
|
|
492
|
+
let t = e.id, n = e.slug, r = s(e.name, x.language, O), i = s(e.description, x.language, O), a = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", o = ye(e.primaryImageStyle), c = ee(e.availabilityStatus), u = ft(n);
|
|
491
493
|
return /* @__PURE__ */ _("div", {
|
|
492
494
|
className: "group flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 text-left shadow-sm transition hover:border-slate-400",
|
|
493
495
|
children: [
|
|
@@ -505,7 +507,7 @@ function D() {
|
|
|
505
507
|
loading: "lazy"
|
|
506
508
|
}) : /* @__PURE__ */ g("span", {
|
|
507
509
|
className: "absolute inset-0 flex items-center justify-center text-slate-400",
|
|
508
|
-
children: /* @__PURE__ */ g(
|
|
510
|
+
children: /* @__PURE__ */ g(je, {
|
|
509
511
|
className: "h-8 w-8",
|
|
510
512
|
"aria-hidden": "true"
|
|
511
513
|
})
|
|
@@ -521,7 +523,7 @@ function D() {
|
|
|
521
523
|
className: "text-sm font-semibold text-slate-950 hover:text-slate-700",
|
|
522
524
|
children: /* @__PURE__ */ g("span", { children: r })
|
|
523
525
|
}),
|
|
524
|
-
/* @__PURE__ */ g(
|
|
526
|
+
/* @__PURE__ */ g(_e, {
|
|
525
527
|
prices: e.prices,
|
|
526
528
|
className: "self-start"
|
|
527
529
|
}),
|
|
@@ -574,9 +576,9 @@ function D() {
|
|
|
574
576
|
})
|
|
575
577
|
}), /* @__PURE__ */ g("div", {
|
|
576
578
|
className: "mt-6 grid gap-4 md:grid-cols-2",
|
|
577
|
-
children: k.map((e) => /* @__PURE__ */ g(
|
|
579
|
+
children: k.map((e) => /* @__PURE__ */ g(be, {
|
|
578
580
|
bike: e,
|
|
579
|
-
detailsPath:
|
|
581
|
+
detailsPath: ft(e.slug),
|
|
580
582
|
productDetailsLinkState: Z,
|
|
581
583
|
fallbackLanguage: O,
|
|
582
584
|
onAction: X
|
|
@@ -600,8 +602,8 @@ function D() {
|
|
|
600
602
|
})
|
|
601
603
|
}), /* @__PURE__ */ g("div", {
|
|
602
604
|
className: "mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
603
|
-
children:
|
|
604
|
-
let t = s(e.name, x.language, O), n = s(e.description, x.language, O), r = s(e.warning, x.language, O), i = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", a =
|
|
605
|
+
children: Ve.slice(0, 4).map((e) => {
|
|
606
|
+
let t = s(e.name, x.language, O), n = s(e.description, x.language, O), r = s(e.warning, x.language, O), i = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", a = ye(e.primaryImageStyle);
|
|
605
607
|
return /* @__PURE__ */ _("div", {
|
|
606
608
|
className: "flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
607
609
|
children: [
|
|
@@ -615,7 +617,7 @@ function D() {
|
|
|
615
617
|
loading: "lazy"
|
|
616
618
|
}) : /* @__PURE__ */ g("div", {
|
|
617
619
|
className: "absolute inset-0 flex items-center justify-center text-slate-400",
|
|
618
|
-
children: /* @__PURE__ */ g(
|
|
620
|
+
children: /* @__PURE__ */ g(je, {
|
|
619
621
|
className: "h-8 w-8",
|
|
620
622
|
"aria-hidden": "true"
|
|
621
623
|
})
|
|
@@ -632,7 +634,7 @@ function D() {
|
|
|
632
634
|
className: "line-clamp-2 text-xs text-slate-600",
|
|
633
635
|
children: /* @__PURE__ */ g("span", { children: n })
|
|
634
636
|
}),
|
|
635
|
-
/* @__PURE__ */ g(
|
|
637
|
+
/* @__PURE__ */ g(ge, {
|
|
636
638
|
warning: r,
|
|
637
639
|
className: "mt-1"
|
|
638
640
|
})
|
|
@@ -640,7 +642,7 @@ function D() {
|
|
|
640
642
|
}),
|
|
641
643
|
/* @__PURE__ */ g("div", {
|
|
642
644
|
className: "flex items-center justify-between gap-2",
|
|
643
|
-
children: /* @__PURE__ */ g(
|
|
645
|
+
children: /* @__PURE__ */ g(_e, {
|
|
644
646
|
prices: e.prices,
|
|
645
647
|
openOnHover: !1
|
|
646
648
|
})
|
|
@@ -651,6 +653,7 @@ function D() {
|
|
|
651
653
|
})]
|
|
652
654
|
}),
|
|
653
655
|
/* @__PURE__ */ g(pe, {}),
|
|
656
|
+
/* @__PURE__ */ g(me, {}),
|
|
654
657
|
/* @__PURE__ */ g(fe, {}),
|
|
655
658
|
/* @__PURE__ */ g(de, { storeSlug: S ?? "" })
|
|
656
659
|
] });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ItinerariesPage.d.ts","sourceRoot":"","sources":["../../src/pages/ItinerariesPage.tsx"],"names":[],"mappings":"AAaA,MAAM,CAAC,OAAO,UAAU,eAAe,4CAoEtC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Button as e } from "../ui/button.js";
|
|
2
|
+
import { useStorefront as t } from "../StorefrontContext.js";
|
|
3
|
+
import { ItineraryListItem as n } from "../components/Itineraries/ItineraryListItem.js";
|
|
4
|
+
import "../components/Itineraries/index.js";
|
|
5
|
+
import { useState as r } from "react";
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
|
+
import { Link as o } from "@rpcbase/router";
|
|
8
|
+
import { useTranslation as s } from "react-i18next";
|
|
9
|
+
import { ArrowLeft as c, Route as l } from "lucide-react";
|
|
10
|
+
//#region src/pages/ItinerariesPage.tsx
|
|
11
|
+
function u() {
|
|
12
|
+
let { t: u } = s(), { itineraries: d, storeSlug: f } = t(), [p, m] = r("all"), h = Array.from(new Set(d.map((e) => e.difficulty))), g = p === "all" ? d : d.filter((e) => e.difficulty === p);
|
|
13
|
+
return /* @__PURE__ */ i("section", {
|
|
14
|
+
"data-testid": "storefront-itineraries-page",
|
|
15
|
+
className: "min-h-[70vh] bg-white",
|
|
16
|
+
children: /* @__PURE__ */ a("div", {
|
|
17
|
+
className: "mx-auto max-w-7xl px-4 py-8 sm:px-6 sm:py-10",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ i(e, {
|
|
20
|
+
asChild: !0,
|
|
21
|
+
variant: "ghost",
|
|
22
|
+
className: "h-auto justify-start gap-2 px-0 text-sm font-medium text-slate-700 hover:bg-transparent hover:text-slate-950",
|
|
23
|
+
children: /* @__PURE__ */ a(o, {
|
|
24
|
+
to: `/${f}#itineraries`,
|
|
25
|
+
children: [/* @__PURE__ */ i(c, {
|
|
26
|
+
className: "size-4",
|
|
27
|
+
"aria-hidden": "true"
|
|
28
|
+
}), /* @__PURE__ */ i("span", { children: u("itineraries_back_home") })]
|
|
29
|
+
})
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ a("div", {
|
|
32
|
+
className: "mt-6 flex flex-col gap-5 sm:flex-row sm:items-end sm:justify-between",
|
|
33
|
+
children: [/* @__PURE__ */ a("div", {
|
|
34
|
+
className: "max-w-2xl",
|
|
35
|
+
children: [/* @__PURE__ */ i("h1", {
|
|
36
|
+
className: "text-2xl font-semibold tracking-tight text-slate-950",
|
|
37
|
+
children: /* @__PURE__ */ i("span", { children: u("itineraries_page_title") })
|
|
38
|
+
}), /* @__PURE__ */ i("p", {
|
|
39
|
+
className: "mt-2 text-sm leading-6 text-slate-600",
|
|
40
|
+
children: /* @__PURE__ */ i("span", { children: u("itineraries_page_description", { count: d.length }) })
|
|
41
|
+
})]
|
|
42
|
+
}), h.length > 1 ? /* @__PURE__ */ i("div", {
|
|
43
|
+
className: "flex flex-wrap gap-2",
|
|
44
|
+
"aria-label": u("itineraries_filter_label"),
|
|
45
|
+
children: ["all", ...h].map((t) => /* @__PURE__ */ i(e, {
|
|
46
|
+
type: "button",
|
|
47
|
+
size: "sm",
|
|
48
|
+
variant: t === p ? "secondary" : "outline",
|
|
49
|
+
"aria-pressed": t === p,
|
|
50
|
+
onClick: () => m(t),
|
|
51
|
+
children: /* @__PURE__ */ i("span", { children: u(t === "all" ? "itineraries_filter_all" : `itineraries_difficulty_${t}`) })
|
|
52
|
+
}, t))
|
|
53
|
+
}) : null]
|
|
54
|
+
}),
|
|
55
|
+
g.length > 0 ? /* @__PURE__ */ i("div", {
|
|
56
|
+
className: "mt-6 grid gap-4 lg:grid-cols-2",
|
|
57
|
+
children: g.map((e) => /* @__PURE__ */ i(n, {
|
|
58
|
+
itinerary: e,
|
|
59
|
+
storeSlug: f
|
|
60
|
+
}, e.slug))
|
|
61
|
+
}) : /* @__PURE__ */ i("div", {
|
|
62
|
+
className: "mt-6 grid min-h-64 place-items-center rounded-xl border border-dashed border-slate-300 bg-slate-50/50 p-8 text-center",
|
|
63
|
+
children: /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i(l, {
|
|
64
|
+
className: "mx-auto size-8 text-slate-400",
|
|
65
|
+
"aria-hidden": "true"
|
|
66
|
+
}), /* @__PURE__ */ i("p", {
|
|
67
|
+
className: "mt-3 text-sm text-slate-600",
|
|
68
|
+
children: /* @__PURE__ */ i("span", { children: u("itineraries_no_results") })
|
|
69
|
+
})] })
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { u as default };
|