@loczer/storefront-sdk 0.230.0 → 0.232.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 +0 -2
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontProvider.d.ts +0 -1
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
- package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
- package/dist/chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js +83 -0
- package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
- package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
- package/dist/components/BookingBikeQuickAddCard/index.js +94 -85
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +62 -56
- package/dist/components/Footer/businessHoursStatus.js +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -56
- package/dist/components/LanguageSelector/index.d.ts.map +1 -1
- package/dist/components/LanguageSelector/index.js +19 -64
- package/dist/components/StorefrontCartPanel/index.js +1 -1
- package/dist/i18n/en.d.ts +2 -4
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +3 -5
- package/dist/i18n/fr.d.ts +2 -4
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +4 -6
- package/dist/index.d.ts +17 -35
- package/dist/index.js +3 -3
- package/dist/lib/booking-period.js +1 -1
- package/dist/lib/booking.d.ts +6 -6
- package/dist/lib/booking.d.ts.map +1 -1
- package/dist/lib/booking.js +21 -21
- package/dist/lib/cart.d.ts +1 -0
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +2 -0
- package/dist/lib/checkoutSubmit.d.ts +2 -6
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +3 -11
- package/dist/lib/pricing.js +1 -1
- package/dist/lib/storefrontAvailability.d.ts +12 -8
- package/dist/lib/storefrontAvailability.d.ts.map +1 -1
- package/dist/lib/storefrontAvailability.js +17 -7
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +236 -238
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +127 -125
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +117 -171
- package/dist/pages/HomePage.js +8 -8
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +187 -181
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts +7 -0
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -0
- package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +105 -0
- package/dist/pages/checkout/types.d.ts +1 -2
- package/dist/pages/checkout/types.d.ts.map +1 -1
- package/dist/pages/checkout/types.js +1 -2
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +0 -2
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +1 -2
- package/package.json +1 -1
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-Q8O5Rjfq.js} +1 -1
|
@@ -97,62 +97,68 @@ function d({ saleDocument: d, items: f, subtotal: p, tax: m, total: h, formatDat
|
|
|
97
97
|
className: o("grid md:grid-cols-2", C ? "gap-3 md:gap-4" : "gap-6 md:gap-8"),
|
|
98
98
|
children: [/* @__PURE__ */ i("div", {
|
|
99
99
|
className: o(C ? "text-[13px] leading-[18px]" : "text-sm"),
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */ r("
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
100
|
+
children: [/* @__PURE__ */ r("h2", {
|
|
101
|
+
className: "mb-2 font-semibold text-foreground",
|
|
102
|
+
children: /* @__PURE__ */ r("span", { children: T("docs_contract_sale_issuer_label") })
|
|
103
|
+
}), /* @__PURE__ */ i("div", {
|
|
104
|
+
"data-testid": k ? "contract-sale-document-issuer-legal-identity" : void 0,
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ r("p", {
|
|
107
|
+
className: "font-semibold text-primary",
|
|
108
|
+
children: A
|
|
109
|
+
}),
|
|
110
|
+
N ? /* @__PURE__ */ r("p", {
|
|
111
|
+
className: "whitespace-nowrap text-muted-foreground",
|
|
112
|
+
children: N
|
|
113
|
+
}) : null,
|
|
114
|
+
P ? /* @__PURE__ */ i("p", {
|
|
115
|
+
className: "flex items-baseline gap-1 text-muted-foreground",
|
|
116
|
+
children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_vat_number_label"), ":"] }), /* @__PURE__ */ r("span", { children: P })]
|
|
117
|
+
}) : null,
|
|
118
|
+
j ? /* @__PURE__ */ r("p", {
|
|
119
|
+
className: "text-muted-foreground whitespace-pre-line",
|
|
120
|
+
children: j
|
|
121
|
+
}) : null
|
|
122
|
+
]
|
|
123
|
+
})]
|
|
119
124
|
}), /* @__PURE__ */ i("div", {
|
|
120
125
|
className: o("md:text-right", C ? "text-[13px] leading-[18px]" : "text-sm"),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
/* @__PURE__ */ r("
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
126
|
+
children: [/* @__PURE__ */ r("h2", {
|
|
127
|
+
className: "mb-2 font-semibold text-foreground",
|
|
128
|
+
children: /* @__PURE__ */ r("span", { children: X })
|
|
129
|
+
}), /* @__PURE__ */ i("div", {
|
|
130
|
+
"data-testid": F ? "contract-sale-document-recipient-legal-identity" : void 0,
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ r("p", {
|
|
133
|
+
className: "font-medium text-foreground",
|
|
134
|
+
children: I
|
|
135
|
+
}),
|
|
136
|
+
z ? /* @__PURE__ */ r("p", {
|
|
137
|
+
className: "text-muted-foreground",
|
|
138
|
+
children: z
|
|
139
|
+
}) : null,
|
|
140
|
+
!R && B ? /* @__PURE__ */ i("p", {
|
|
141
|
+
className: "text-muted-foreground",
|
|
142
|
+
children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_company_registration_label"), ":"] }), /* @__PURE__ */ i("span", { children: [" ", B] })]
|
|
143
|
+
}) : null,
|
|
144
|
+
V ? /* @__PURE__ */ i("p", {
|
|
145
|
+
className: "text-muted-foreground",
|
|
146
|
+
children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_establishment_registration_label"), ":"] }), /* @__PURE__ */ i("span", { children: [" ", V] })]
|
|
147
|
+
}) : null,
|
|
148
|
+
H ? /* @__PURE__ */ i("p", {
|
|
149
|
+
className: "text-muted-foreground",
|
|
150
|
+
children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_vat_number_label"), ":"] }), /* @__PURE__ */ i("span", { children: [" ", H] })]
|
|
151
|
+
}) : null,
|
|
152
|
+
L ? /* @__PURE__ */ r("p", {
|
|
153
|
+
className: "text-muted-foreground whitespace-pre-line",
|
|
154
|
+
children: L
|
|
155
|
+
}) : null,
|
|
156
|
+
U ? /* @__PURE__ */ r("p", {
|
|
157
|
+
className: "text-muted-foreground",
|
|
158
|
+
children: U
|
|
159
|
+
}) : null
|
|
160
|
+
]
|
|
161
|
+
})]
|
|
156
162
|
})]
|
|
157
163
|
})]
|
|
158
164
|
}),
|
|
@@ -198,7 +204,7 @@ function d({ saleDocument: d, items: f, subtotal: p, tax: m, total: h, formatDat
|
|
|
198
204
|
/* @__PURE__ */ i("section", {
|
|
199
205
|
className: o(O ? "mb-0 flex flex-grow flex-col" : C ? "mb-4" : "mb-8"),
|
|
200
206
|
children: [/* @__PURE__ */ i("div", {
|
|
201
|
-
className: o("flex bg-muted font-semibold text-muted-foreground", C ? "
|
|
207
|
+
className: o("flex bg-muted font-semibold text-muted-foreground", C ? "-mx-2 px-2 py-2 text-sm leading-5" : "-mx-2 px-2 py-2 text-xs md:-mx-3 md:px-3 md:py-3 md:text-base"),
|
|
202
208
|
children: [
|
|
203
209
|
/* @__PURE__ */ r("div", {
|
|
204
210
|
className: "w-5/12 pr-2 md:w-1/2",
|
|
@@ -222,7 +228,7 @@ function d({ saleDocument: d, items: f, subtotal: p, tax: m, total: h, formatDat
|
|
|
222
228
|
children: f.map((e) => {
|
|
223
229
|
let t = 1 + (e.taxRate ?? d.taxRate ?? 0);
|
|
224
230
|
return /* @__PURE__ */ i("div", {
|
|
225
|
-
className: o("flex items-center border-b border-border", C ? "
|
|
231
|
+
className: o("flex items-center border-b border-border", C ? "py-2 text-sm leading-5" : "py-2 text-sm md:py-3 md:text-base"),
|
|
226
232
|
children: [
|
|
227
233
|
/* @__PURE__ */ r("div", {
|
|
228
234
|
className: "w-5/12 pr-2 md:w-1/2",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveOpeningHoursForDate as e } from "../../chunks/pkg/booking-engine/dist/utils/opening-hours-period-TCyLhzZw.js";
|
|
2
|
-
import "../../chunks/pkg/booking-engine/dist/schemas-
|
|
2
|
+
import "../../chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js";
|
|
3
3
|
import { businessDateStringToDate as t, calendarDateToBusinessDateString as n, instantToBusinessDateTimeParts as r, normalizeBusinessDateString as i, parseTimeToMinutes as a } from "../../lib/booking-period.js";
|
|
4
4
|
//#region src/components/Footer/businessHoursStatus.ts
|
|
5
5
|
var o = 370, s = (e, r) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAMtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAMtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CAyPlG"}
|
|
@@ -5,46 +5,46 @@ import { buildStorefrontImageUrl as r } from "../../lib/storefrontImage.js";
|
|
|
5
5
|
import ee from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
|
|
6
6
|
import { MISSING_SHOP_EMAIL as te } from "../../lib/storefrontMissingValues.js";
|
|
7
7
|
import { formatStorefrontAddressTagline as i } from "../../lib/storefrontAddress.js";
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { LanguageSelector as
|
|
11
|
-
import { Drawer as
|
|
8
|
+
import { Badge as ne } from "../../ui/badge.js";
|
|
9
|
+
import { Button as a } from "../../ui/button.js";
|
|
10
|
+
import { LanguageSelector as o } from "../LanguageSelector/index.js";
|
|
11
|
+
import { Drawer as re, DrawerClose as s, DrawerContent as c, DrawerDescription as l, DrawerHeader as u, DrawerTitle as d, DrawerTrigger as ie } from "../../ui/drawer.js";
|
|
12
12
|
import { useOptionalStorefront as ae } from "../../StorefrontContext.js";
|
|
13
13
|
import { useState as oe } from "react";
|
|
14
14
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
|
-
import { useMediaQuery as
|
|
15
|
+
import { useMediaQuery as se, useThrottledMeasure as m } from "@rpcbase/client";
|
|
16
16
|
import { Link as h, useLocation as ce, useParams as le } from "@rpcbase/router";
|
|
17
17
|
import { useTranslation as ue } from "react-i18next";
|
|
18
|
-
import { cn as
|
|
18
|
+
import { cn as de, useScrollHideOnDown as g } from "@rpcbase/ui";
|
|
19
19
|
import { ArrowRight as _, Menu as v, ShoppingCart as y } from "lucide-react";
|
|
20
20
|
//#region src/components/Header/index.tsx
|
|
21
|
-
var
|
|
21
|
+
var fe = 36, b = (e, t) => {
|
|
22
22
|
let n = e?.trim() ?? "";
|
|
23
23
|
return n ? r(n, t ?? "") : "";
|
|
24
24
|
};
|
|
25
|
-
function
|
|
26
|
-
let { t:
|
|
25
|
+
function x({ storefrontConfiguration: r, whatsappHref: x, whatsappPhoneDisplay: S }) {
|
|
26
|
+
let { t: C, i18n: w } = ue(), T = ae(), { storeSlug: E } = le(), pe = ce(), { itemCount: D, isReady: O } = n(), k = se("(max-width: 640px)"), [A, j] = oe(!1), [M, N] = m(), P = N?.height ?? fe, F = g({
|
|
27
27
|
enabled: k,
|
|
28
28
|
thresholdPx: P
|
|
29
|
-
}), I = k && F ? `translateY(-${P}px)` : "translateY(0)", L = `/${
|
|
29
|
+
}), I = k && F ? `translateY(-${P}px)` : "translateY(0)", L = `/${E ?? ""}`, R = e(new URLSearchParams(pe.search), E), z = R.toString(), B = !!(R.get("start_time")?.trim() && R.get("end_time")?.trim()), V = z ? `?${z}` : "", H = `${L}/booking${V}`, me = `${L}/checkout${V}`, he = D > 0 && B ? me : H, U = r?.shop.name?.trim() ?? "", W = r?.shop.emailAddress?.trim() ?? "", G = r?.workspace?.workspaceLanguage, K = r?.workspace?.languages, q = t(r?.content?.tagline, w.language, G).trim(), J = i(r?.shop), Y = q || J || "[Missing shop address]", ge = !q && !J, _e = t(r?.content?.topBannerMessage, w.language, G).trim() || C("top_bar_message"), X = b(r?.content?.logoWideImageId, E), Z = b(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, E), Q = X.length > 0, $ = Z.length > 0, ve = [
|
|
30
30
|
{
|
|
31
|
-
label:
|
|
31
|
+
label: C("nav_categories"),
|
|
32
32
|
to: `${L}${V}#categories`
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
|
-
label:
|
|
35
|
+
label: C("nav_featured"),
|
|
36
36
|
to: `${L}${V}#featured`
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
label:
|
|
39
|
+
label: C("nav_products"),
|
|
40
40
|
to: H
|
|
41
41
|
},
|
|
42
|
-
...(
|
|
43
|
-
label:
|
|
42
|
+
...(T?.itineraries.length ?? 0) > 0 ? [{
|
|
43
|
+
label: C("nav_itineraries"),
|
|
44
44
|
to: `${L}/itineraries`
|
|
45
45
|
}] : [],
|
|
46
46
|
{
|
|
47
|
-
label:
|
|
47
|
+
label: C("nav_contact"),
|
|
48
48
|
to: `${L}${V}#contact`
|
|
49
49
|
}
|
|
50
50
|
];
|
|
@@ -60,21 +60,21 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
60
60
|
className: "mx-auto flex max-w-7xl items-center justify-start gap-3 px-4 py-2 text-left text-xs leading-4 sm:justify-between sm:px-6",
|
|
61
61
|
children: [/* @__PURE__ */ f("p", {
|
|
62
62
|
className: "w-full min-w-0 break-words sm:w-auto",
|
|
63
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
63
|
+
children: /* @__PURE__ */ f("span", { children: _e })
|
|
64
64
|
}), /* @__PURE__ */ p("div", {
|
|
65
65
|
className: "hidden items-center gap-4 sm:flex",
|
|
66
|
-
children: [
|
|
66
|
+
children: [x ? /* @__PURE__ */ p("a", {
|
|
67
67
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
68
|
-
href:
|
|
68
|
+
href: x,
|
|
69
69
|
target: "_blank",
|
|
70
70
|
rel: "noreferrer",
|
|
71
|
-
"aria-label": `WhatsApp${
|
|
71
|
+
"aria-label": `WhatsApp${S ? ` ${S}` : ""}`,
|
|
72
72
|
children: [/* @__PURE__ */ f("img", {
|
|
73
73
|
src: ee,
|
|
74
74
|
className: "h-5 w-5 shrink-0",
|
|
75
75
|
alt: "",
|
|
76
76
|
"aria-hidden": "true"
|
|
77
|
-
}),
|
|
77
|
+
}), S ? /* @__PURE__ */ f("span", { children: S }) : null]
|
|
78
78
|
}) : null, W ? /* @__PURE__ */ f("a", {
|
|
79
79
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
80
80
|
href: `mailto:${W}`,
|
|
@@ -121,7 +121,7 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
121
121
|
className: "truncate text-sm font-semibold",
|
|
122
122
|
children: U
|
|
123
123
|
}), /* @__PURE__ */ f("span", {
|
|
124
|
-
className:
|
|
124
|
+
className: de("truncate text-xs text-slate-600", ge && "text-destructive"),
|
|
125
125
|
children: Y
|
|
126
126
|
})]
|
|
127
127
|
})]
|
|
@@ -132,45 +132,45 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
132
132
|
/* @__PURE__ */ f(h, {
|
|
133
133
|
className: "hover:text-slate-950",
|
|
134
134
|
to: `${L}${V}#categories`,
|
|
135
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
135
|
+
children: /* @__PURE__ */ f("span", { children: C("nav_categories") })
|
|
136
136
|
}),
|
|
137
137
|
/* @__PURE__ */ f(h, {
|
|
138
138
|
className: "hover:text-slate-950",
|
|
139
139
|
to: `${L}${V}#featured`,
|
|
140
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
140
|
+
children: /* @__PURE__ */ f("span", { children: C("nav_featured") })
|
|
141
141
|
}),
|
|
142
142
|
/* @__PURE__ */ f(h, {
|
|
143
143
|
className: "hover:text-slate-950",
|
|
144
144
|
to: H,
|
|
145
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
145
|
+
children: /* @__PURE__ */ f("span", { children: C("nav_products") })
|
|
146
146
|
}),
|
|
147
|
-
(
|
|
147
|
+
(T?.itineraries.length ?? 0) > 0 ? /* @__PURE__ */ f(h, {
|
|
148
148
|
className: "hover:text-slate-950",
|
|
149
149
|
to: `${L}/itineraries`,
|
|
150
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
150
|
+
children: /* @__PURE__ */ f("span", { children: C("nav_itineraries") })
|
|
151
151
|
}) : null,
|
|
152
152
|
/* @__PURE__ */ f(h, {
|
|
153
153
|
className: "hover:text-slate-950",
|
|
154
154
|
to: `${L}${V}#contact`,
|
|
155
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
155
|
+
children: /* @__PURE__ */ f("span", { children: C("nav_contact") })
|
|
156
156
|
})
|
|
157
157
|
]
|
|
158
158
|
}),
|
|
159
159
|
/* @__PURE__ */ p("div", {
|
|
160
160
|
className: "flex shrink-0 items-center gap-1.5 sm:gap-2",
|
|
161
161
|
children: [
|
|
162
|
-
/* @__PURE__ */ f(
|
|
162
|
+
/* @__PURE__ */ f(o, {
|
|
163
163
|
languages: K,
|
|
164
164
|
className: "hidden sm:inline-flex"
|
|
165
165
|
}),
|
|
166
|
-
/* @__PURE__ */ f(
|
|
166
|
+
/* @__PURE__ */ f(a, {
|
|
167
167
|
asChild: !0,
|
|
168
168
|
variant: "outline",
|
|
169
169
|
size: "sm",
|
|
170
|
-
className:
|
|
170
|
+
className: "relative h-9 w-9 gap-2 px-0 sm:w-auto sm:px-3",
|
|
171
171
|
children: /* @__PURE__ */ p(h, {
|
|
172
|
-
to:
|
|
173
|
-
"aria-label": `${
|
|
172
|
+
to: he,
|
|
173
|
+
"aria-label": O ? `${C("cart_button")} (${D})` : C("cart_button"),
|
|
174
174
|
children: [
|
|
175
175
|
/* @__PURE__ */ f(y, {
|
|
176
176
|
className: "h-4 w-4",
|
|
@@ -178,30 +178,30 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
178
178
|
}),
|
|
179
179
|
/* @__PURE__ */ f("span", {
|
|
180
180
|
className: "hidden sm:inline",
|
|
181
|
-
children:
|
|
181
|
+
children: C("cart_button")
|
|
182
182
|
}),
|
|
183
|
-
/* @__PURE__ */ f(
|
|
183
|
+
O && D > 0 ? /* @__PURE__ */ f(ne, {
|
|
184
184
|
className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
|
|
185
|
-
children: /* @__PURE__ */ f("span", { children:
|
|
186
|
-
})
|
|
185
|
+
children: /* @__PURE__ */ f("span", { children: D })
|
|
186
|
+
}) : null
|
|
187
187
|
]
|
|
188
188
|
})
|
|
189
189
|
}),
|
|
190
|
-
/* @__PURE__ */ f(
|
|
190
|
+
/* @__PURE__ */ f(a, {
|
|
191
191
|
asChild: !0,
|
|
192
192
|
size: "sm",
|
|
193
193
|
className: "h-9 gap-1.5 px-2 sm:gap-2 sm:px-3",
|
|
194
194
|
children: /* @__PURE__ */ p(h, {
|
|
195
195
|
to: H,
|
|
196
|
-
"aria-label":
|
|
196
|
+
"aria-label": C("cta_book_now"),
|
|
197
197
|
children: [
|
|
198
198
|
/* @__PURE__ */ f("span", {
|
|
199
199
|
className: "sm:hidden",
|
|
200
|
-
children:
|
|
200
|
+
children: C("cta_book_short")
|
|
201
201
|
}),
|
|
202
202
|
/* @__PURE__ */ f("span", {
|
|
203
203
|
className: "hidden sm:inline",
|
|
204
|
-
children:
|
|
204
|
+
children: C("cta_book_now")
|
|
205
205
|
}),
|
|
206
206
|
/* @__PURE__ */ f(_, {
|
|
207
207
|
className: "h-4 w-4",
|
|
@@ -210,40 +210,40 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
210
210
|
]
|
|
211
211
|
})
|
|
212
212
|
}),
|
|
213
|
-
/* @__PURE__ */ p(
|
|
213
|
+
/* @__PURE__ */ p(re, {
|
|
214
214
|
open: A,
|
|
215
215
|
onOpenChange: j,
|
|
216
216
|
direction: "right",
|
|
217
217
|
children: [/* @__PURE__ */ f(ie, {
|
|
218
218
|
asChild: !0,
|
|
219
|
-
children: /* @__PURE__ */ f(
|
|
219
|
+
children: /* @__PURE__ */ f(a, {
|
|
220
220
|
type: "button",
|
|
221
221
|
variant: "outline",
|
|
222
222
|
size: "icon",
|
|
223
223
|
className: "h-9 w-9 md:hidden",
|
|
224
|
-
"aria-label":
|
|
224
|
+
"aria-label": C("mobile_menu_open"),
|
|
225
225
|
children: /* @__PURE__ */ f(v, {
|
|
226
226
|
className: "h-4 w-4",
|
|
227
227
|
"aria-hidden": "true"
|
|
228
228
|
})
|
|
229
229
|
})
|
|
230
|
-
}), /* @__PURE__ */ p(
|
|
230
|
+
}), /* @__PURE__ */ p(c, {
|
|
231
231
|
className: "w-[min(22rem,calc(100vw-1.5rem))] bg-white",
|
|
232
|
-
"aria-label":
|
|
233
|
-
closeLabel:
|
|
232
|
+
"aria-label": C("mobile_menu_label"),
|
|
233
|
+
closeLabel: C("mobile_menu_close"),
|
|
234
234
|
showCloseButton: !0,
|
|
235
235
|
children: [
|
|
236
|
-
/* @__PURE__ */ p(
|
|
236
|
+
/* @__PURE__ */ p(u, {
|
|
237
237
|
className: "border-b border-slate-200 px-5 pb-4 pt-6 text-left",
|
|
238
|
-
children: [/* @__PURE__ */ f(
|
|
238
|
+
children: [/* @__PURE__ */ f(d, { children: U }), /* @__PURE__ */ f(l, {
|
|
239
239
|
className: "break-words",
|
|
240
240
|
children: Y
|
|
241
241
|
})]
|
|
242
242
|
}),
|
|
243
243
|
/* @__PURE__ */ f("nav", {
|
|
244
244
|
className: "grid gap-1 overflow-y-auto p-3",
|
|
245
|
-
"aria-label":
|
|
246
|
-
children:
|
|
245
|
+
"aria-label": C("mobile_menu_label"),
|
|
246
|
+
children: ve.map((e) => /* @__PURE__ */ f(s, {
|
|
247
247
|
asChild: !0,
|
|
248
248
|
children: /* @__PURE__ */ f(h, {
|
|
249
249
|
to: e.to,
|
|
@@ -254,20 +254,20 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
254
254
|
}),
|
|
255
255
|
/* @__PURE__ */ p("div", {
|
|
256
256
|
className: "mt-auto grid gap-3 border-t border-slate-200 p-4",
|
|
257
|
-
children: [/* @__PURE__ */ f(
|
|
257
|
+
children: [/* @__PURE__ */ f(s, {
|
|
258
258
|
asChild: !0,
|
|
259
|
-
children: /* @__PURE__ */ f(
|
|
259
|
+
children: /* @__PURE__ */ f(a, {
|
|
260
260
|
asChild: !0,
|
|
261
261
|
className: "w-full gap-2",
|
|
262
262
|
children: /* @__PURE__ */ p(h, {
|
|
263
263
|
to: H,
|
|
264
|
-
children: [/* @__PURE__ */ f("span", { children:
|
|
264
|
+
children: [/* @__PURE__ */ f("span", { children: C("cta_book_now") }), /* @__PURE__ */ f(_, {
|
|
265
265
|
className: "h-4 w-4",
|
|
266
266
|
"aria-hidden": "true"
|
|
267
267
|
})]
|
|
268
268
|
})
|
|
269
269
|
})
|
|
270
|
-
}), /* @__PURE__ */ f(
|
|
270
|
+
}), /* @__PURE__ */ f(o, {
|
|
271
271
|
languages: K,
|
|
272
272
|
className: "h-10 w-full justify-between"
|
|
273
273
|
})]
|
|
@@ -283,4 +283,4 @@ function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay:
|
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
|
-
export {
|
|
286
|
+
export { x as Header };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageSelector/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageSelector/index.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;IACpC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;CACnC,CAAA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,SAAS,EACT,KAAa,GACd,EAAE,qBAAqB,kDAqBvB"}
|
|
@@ -1,69 +1,24 @@
|
|
|
1
1
|
import { normalizeStorefrontI18nLanguage as e, resolveStorefrontI18nLanguageOptions as t } from "../../i18n/languages.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as i
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { ChevronDown as c } from "lucide-react";
|
|
8
|
-
import { Menu as l } from "@base-ui/react/menu";
|
|
2
|
+
import { storefrontButtonRadiusClassName as n } from "../../ui/button.js";
|
|
3
|
+
import { LanguagePicker as r } from "../../chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import { useTranslation as a } from "react-i18next";
|
|
6
|
+
import { cn as o } from "@rpcbase/ui";
|
|
9
7
|
//#region src/components/LanguageSelector/index.tsx
|
|
10
|
-
function
|
|
11
|
-
let { t:
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"data-testid": "storefront-language-selector-trigger",
|
|
24
|
-
children: [/* @__PURE__ */ a("span", {
|
|
25
|
-
className: "flex items-center gap-1",
|
|
26
|
-
children: [/* @__PURE__ */ i("span", {
|
|
27
|
-
"aria-hidden": "true",
|
|
28
|
-
children: y.flag
|
|
29
|
-
}), /* @__PURE__ */ i("span", { children: y.code })]
|
|
30
|
-
}), /* @__PURE__ */ i(c, {
|
|
31
|
-
className: "size-3.5",
|
|
32
|
-
"aria-hidden": "true"
|
|
33
|
-
})]
|
|
34
|
-
})
|
|
35
|
-
}), /* @__PURE__ */ i(l.Portal, { children: /* @__PURE__ */ i(l.Positioner, {
|
|
36
|
-
align: f,
|
|
37
|
-
sideOffset: 4,
|
|
38
|
-
positionMethod: "fixed",
|
|
39
|
-
className: "z-[60]",
|
|
40
|
-
collisionPadding: 8,
|
|
41
|
-
collisionAvoidance: {
|
|
42
|
-
side: "flip",
|
|
43
|
-
align: "shift",
|
|
44
|
-
fallbackAxisSide: "none"
|
|
45
|
-
},
|
|
46
|
-
children: /* @__PURE__ */ i(l.Popup, {
|
|
47
|
-
className: "min-w-44 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md transition-opacity duration-75 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",
|
|
48
|
-
children: _.map((e) => /* @__PURE__ */ a(l.Item, {
|
|
49
|
-
onClick: (t) => {
|
|
50
|
-
t.defaultPrevented || (m.changeLanguage(e.code), g(!1));
|
|
51
|
-
},
|
|
52
|
-
className: s("flex cursor-pointer select-none items-center gap-2 whitespace-nowrap rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground", y.code === e.code && "bg-accent"),
|
|
53
|
-
"data-testid": `storefront-language-selector-option-${e.code}`,
|
|
54
|
-
children: [/* @__PURE__ */ i("span", {
|
|
55
|
-
"aria-hidden": "true",
|
|
56
|
-
children: e.flag
|
|
57
|
-
}), /* @__PURE__ */ a("span", { children: [
|
|
58
|
-
e.name,
|
|
59
|
-
" (",
|
|
60
|
-
e.code.toUpperCase(),
|
|
61
|
-
")"
|
|
62
|
-
] })]
|
|
63
|
-
}, e.code))
|
|
64
|
-
})
|
|
65
|
-
}) })]
|
|
8
|
+
function s({ languages: s, className: c, align: l = "end" }) {
|
|
9
|
+
let { t: u, i18n: d } = a(), f = t(s), p = e(d.resolvedLanguage ?? d.language);
|
|
10
|
+
return f.length < 2 ? null : /* @__PURE__ */ i(r, {
|
|
11
|
+
value: p ?? f[0].code,
|
|
12
|
+
onValueChange: (e) => {
|
|
13
|
+
d.changeLanguage(e);
|
|
14
|
+
},
|
|
15
|
+
options: f,
|
|
16
|
+
align: l,
|
|
17
|
+
ariaLabel: u("language_selector_label"),
|
|
18
|
+
triggerClassName: o("h-9 px-2", n, c),
|
|
19
|
+
triggerTestId: "storefront-language-selector-trigger",
|
|
20
|
+
optionTestIdPrefix: "storefront-language-selector-option"
|
|
66
21
|
});
|
|
67
22
|
}
|
|
68
23
|
//#endregion
|
|
69
|
-
export {
|
|
24
|
+
export { s as LanguageSelector };
|
|
@@ -39,7 +39,7 @@ function p({ lines: p, itemCount: m, baseUnitLabel: h, totalMinor: g, title: _,
|
|
|
39
39
|
}) : /* @__PURE__ */ o("ul", {
|
|
40
40
|
className: "divide-y divide-slate-200",
|
|
41
41
|
children: p.map((i) => {
|
|
42
|
-
let c = e(i.unitPriceMinor, A.language), l = i.insufficientCapacity === !0, u = i.availabilityIssue === "
|
|
42
|
+
let c = e(i.unitPriceMinor, A.language), l = i.insufficientCapacity === !0, u = i.availabilityIssue === "quantityUnavailable" ? k("availability_quantity_unavailable") : k("availability_out_of_stock");
|
|
43
43
|
return /* @__PURE__ */ s("li", {
|
|
44
44
|
className: "flex items-start justify-between gap-3 py-4 first:pt-0 last:pb-0",
|
|
45
45
|
children: [/* @__PURE__ */ s("div", {
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -183,6 +183,7 @@ export declare const storefront: {
|
|
|
183
183
|
cart_empty: string;
|
|
184
184
|
cart_empty_title: string;
|
|
185
185
|
cart_empty_description: string;
|
|
186
|
+
cart_loading: string;
|
|
186
187
|
cart_line_meta: string;
|
|
187
188
|
remove_from_cart: string;
|
|
188
189
|
cart_total: string;
|
|
@@ -212,10 +213,6 @@ export declare const storefront: {
|
|
|
212
213
|
checkout_estimated_total: string;
|
|
213
214
|
checkout_form_title: string;
|
|
214
215
|
checkout_form_description: string;
|
|
215
|
-
checkout_first_name_label: string;
|
|
216
|
-
checkout_first_name_placeholder: string;
|
|
217
|
-
checkout_last_name_label: string;
|
|
218
|
-
checkout_last_name_placeholder: string;
|
|
219
216
|
checkout_full_name_label: string;
|
|
220
217
|
checkout_full_name_placeholder: string;
|
|
221
218
|
checkout_email_label: string;
|
|
@@ -302,6 +299,7 @@ export declare const storefront: {
|
|
|
302
299
|
docs_contract_sale_quote_date_label: string;
|
|
303
300
|
docs_contract_sale_credit_note_date_label: string;
|
|
304
301
|
docs_contract_sale_due_date_label: string;
|
|
302
|
+
docs_contract_sale_issuer_label: string;
|
|
305
303
|
docs_contract_sale_invoice_recipient_label: string;
|
|
306
304
|
docs_contract_sale_credit_note_recipient_label: string;
|
|
307
305
|
docs_contract_sale_legal_description_label: 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6gBtB,CAAA"}
|
package/dist/i18n/en.js
CHANGED
|
@@ -184,6 +184,7 @@ var e = {
|
|
|
184
184
|
cart_empty: "Your cart is empty.",
|
|
185
185
|
cart_empty_title: "Your cart is empty",
|
|
186
186
|
cart_empty_description: "Add a bike (and accessories) to continue.",
|
|
187
|
+
cart_loading: "Loading cart…",
|
|
187
188
|
cart_line_meta: "Qty {{quantity}} · {{price}} / {{unit}}",
|
|
188
189
|
remove_from_cart: "Remove from cart",
|
|
189
190
|
cart_total: "Total",
|
|
@@ -213,10 +214,6 @@ var e = {
|
|
|
213
214
|
checkout_estimated_total: "Total",
|
|
214
215
|
checkout_form_title: "Your details",
|
|
215
216
|
checkout_form_description: "Enter your details for this booking, and add any useful information in the notes.",
|
|
216
|
-
checkout_first_name_label: "First name",
|
|
217
|
-
checkout_first_name_placeholder: "Jane",
|
|
218
|
-
checkout_last_name_label: "Last name",
|
|
219
|
-
checkout_last_name_placeholder: "Doe",
|
|
220
217
|
checkout_full_name_label: "Full name",
|
|
221
218
|
checkout_full_name_placeholder: "Jane Doe",
|
|
222
219
|
checkout_email_label: "Email",
|
|
@@ -303,7 +300,8 @@ var e = {
|
|
|
303
300
|
docs_contract_sale_quote_date_label: "Quote Date:",
|
|
304
301
|
docs_contract_sale_credit_note_date_label: "Credit Note Date:",
|
|
305
302
|
docs_contract_sale_due_date_label: "Due Date:",
|
|
306
|
-
|
|
303
|
+
docs_contract_sale_issuer_label: "Issuer:",
|
|
304
|
+
docs_contract_sale_invoice_recipient_label: "Billed To:",
|
|
307
305
|
docs_contract_sale_credit_note_recipient_label: "Issued To:",
|
|
308
306
|
docs_contract_sale_legal_description_label: "Description",
|
|
309
307
|
docs_contract_sale_legal_company_registration_label: "Company registration no.",
|
package/dist/i18n/fr.d.ts
CHANGED
|
@@ -184,6 +184,7 @@ export declare const storefront: {
|
|
|
184
184
|
cart_empty: string;
|
|
185
185
|
cart_empty_title: string;
|
|
186
186
|
cart_empty_description: string;
|
|
187
|
+
cart_loading: string;
|
|
187
188
|
cart_line_meta: string;
|
|
188
189
|
remove_from_cart: string;
|
|
189
190
|
cart_total: string;
|
|
@@ -213,10 +214,6 @@ export declare const storefront: {
|
|
|
213
214
|
checkout_estimated_total: string;
|
|
214
215
|
checkout_form_title: string;
|
|
215
216
|
checkout_form_description: string;
|
|
216
|
-
checkout_first_name_label: string;
|
|
217
|
-
checkout_first_name_placeholder: string;
|
|
218
|
-
checkout_last_name_label: string;
|
|
219
|
-
checkout_last_name_placeholder: string;
|
|
220
217
|
checkout_full_name_label: string;
|
|
221
218
|
checkout_full_name_placeholder: string;
|
|
222
219
|
checkout_email_label: string;
|
|
@@ -303,6 +300,7 @@ export declare const storefront: {
|
|
|
303
300
|
docs_contract_sale_quote_date_label: string;
|
|
304
301
|
docs_contract_sale_credit_note_date_label: string;
|
|
305
302
|
docs_contract_sale_due_date_label: string;
|
|
303
|
+
docs_contract_sale_issuer_label: string;
|
|
306
304
|
docs_contract_sale_invoice_recipient_label: string;
|
|
307
305
|
docs_contract_sale_credit_note_recipient_label: string;
|
|
308
306
|
docs_contract_sale_legal_description_label: string;
|