@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.
Files changed (68) hide show
  1. package/dist/StorefrontContext.d.ts +0 -2
  2. package/dist/StorefrontContext.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.d.ts +0 -1
  4. package/dist/StorefrontProvider.d.ts.map +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-C9kJFMIu.js → base-booking-BJXFzDM5.js} +0 -2
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-epi7FXIk.js → cart-inputs-3lBblkB0.js} +0 -10
  7. package/dist/chunks/pkg/booking-engine/dist/{schemas-DW5gdDYz.js → schemas-JjiUWFIv.js} +2 -2
  8. package/dist/chunks/pkg/ui/dist/LanguagePicker/index-D7_3voTe.js +83 -0
  9. package/dist/components/BookingBikeQuickAddCard/index.d.ts +3 -1
  10. package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -1
  11. package/dist/components/BookingBikeQuickAddCard/index.js +94 -85
  12. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  13. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
  14. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  15. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
  16. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  17. package/dist/components/ContractSaleDocument/InvoiceDetails.js +62 -56
  18. package/dist/components/Footer/businessHoursStatus.js +1 -1
  19. package/dist/components/Header/index.d.ts.map +1 -1
  20. package/dist/components/Header/index.js +56 -56
  21. package/dist/components/LanguageSelector/index.d.ts.map +1 -1
  22. package/dist/components/LanguageSelector/index.js +19 -64
  23. package/dist/components/StorefrontCartPanel/index.js +1 -1
  24. package/dist/i18n/en.d.ts +2 -4
  25. package/dist/i18n/en.d.ts.map +1 -1
  26. package/dist/i18n/en.js +3 -5
  27. package/dist/i18n/fr.d.ts +2 -4
  28. package/dist/i18n/fr.d.ts.map +1 -1
  29. package/dist/i18n/fr.js +4 -6
  30. package/dist/index.d.ts +17 -35
  31. package/dist/index.js +3 -3
  32. package/dist/lib/booking-period.js +1 -1
  33. package/dist/lib/booking.d.ts +6 -6
  34. package/dist/lib/booking.d.ts.map +1 -1
  35. package/dist/lib/booking.js +21 -21
  36. package/dist/lib/cart.d.ts +1 -0
  37. package/dist/lib/cart.d.ts.map +1 -1
  38. package/dist/lib/cart.js +2 -0
  39. package/dist/lib/checkoutSubmit.d.ts +2 -6
  40. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  41. package/dist/lib/checkoutSubmit.js +3 -11
  42. package/dist/lib/pricing.js +1 -1
  43. package/dist/lib/storefrontAvailability.d.ts +12 -8
  44. package/dist/lib/storefrontAvailability.d.ts.map +1 -1
  45. package/dist/lib/storefrontAvailability.js +17 -7
  46. package/dist/pages/BookingPage.d.ts.map +1 -1
  47. package/dist/pages/BookingPage.js +236 -238
  48. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  49. package/dist/pages/CheckoutPage.js +127 -125
  50. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  51. package/dist/pages/ContractSaleDocumentPage.js +117 -171
  52. package/dist/pages/HomePage.js +8 -8
  53. package/dist/pages/ProductPage.d.ts.map +1 -1
  54. package/dist/pages/ProductPage.js +187 -181
  55. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  56. package/dist/pages/checkout/components/CheckoutDetailsCard.js +4 -17
  57. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts +7 -0
  58. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -0
  59. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +105 -0
  60. package/dist/pages/checkout/types.d.ts +1 -2
  61. package/dist/pages/checkout/types.d.ts.map +1 -1
  62. package/dist/pages/checkout/types.js +1 -2
  63. package/dist/storefront.css +1 -1
  64. package/dist/storefrontSchemas.d.ts +0 -2
  65. package/dist/storefrontSchemas.d.ts.map +1 -1
  66. package/dist/storefrontSchemas.js +1 -2
  67. package/package.json +1 -1
  68. 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
- "data-testid": k ? "contract-sale-document-issuer-legal-identity" : void 0,
101
- children: [
102
- /* @__PURE__ */ r("h2", {
103
- className: "font-semibold text-primary",
104
- children: A
105
- }),
106
- N ? /* @__PURE__ */ r("p", {
107
- className: "whitespace-nowrap text-muted-foreground",
108
- children: N
109
- }) : null,
110
- P ? /* @__PURE__ */ i("p", {
111
- className: "flex items-baseline gap-1 text-muted-foreground",
112
- children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_vat_number_label"), ":"] }), /* @__PURE__ */ r("span", { children: P })]
113
- }) : null,
114
- j ? /* @__PURE__ */ r("p", {
115
- className: "text-muted-foreground whitespace-pre-line",
116
- children: j
117
- }) : null
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
- "data-testid": F ? "contract-sale-document-recipient-legal-identity" : void 0,
122
- children: [
123
- /* @__PURE__ */ r("h3", {
124
- className: "mb-2 font-semibold text-foreground",
125
- children: X
126
- }),
127
- /* @__PURE__ */ r("p", {
128
- className: "font-medium text-foreground",
129
- children: I
130
- }),
131
- z ? /* @__PURE__ */ r("p", {
132
- className: "text-muted-foreground",
133
- children: z
134
- }) : null,
135
- !R && B ? /* @__PURE__ */ i("p", {
136
- className: "text-muted-foreground",
137
- children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_company_registration_label"), ":"] }), /* @__PURE__ */ i("span", { children: [" ", B] })]
138
- }) : null,
139
- V ? /* @__PURE__ */ i("p", {
140
- className: "text-muted-foreground",
141
- children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_establishment_registration_label"), ":"] }), /* @__PURE__ */ i("span", { children: [" ", V] })]
142
- }) : null,
143
- H ? /* @__PURE__ */ i("p", {
144
- className: "text-muted-foreground",
145
- children: [/* @__PURE__ */ i("span", { children: [E("docs_contract_sale_legal_vat_number_label"), ":"] }), /* @__PURE__ */ i("span", { children: [" ", H] })]
146
- }) : null,
147
- L ? /* @__PURE__ */ r("p", {
148
- className: "text-muted-foreground whitespace-pre-line",
149
- children: L
150
- }) : null,
151
- U ? /* @__PURE__ */ r("p", {
152
- className: "text-muted-foreground",
153
- children: U
154
- }) : null
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 ? "p-2 text-sm leading-5" : "p-2 text-xs md:p-3 md:text-base"),
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 ? "p-2 text-sm leading-5" : "p-2 text-sm md:p-3 md:text-base"),
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-DW5gdDYz.js";
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,2CAuPlG"}
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 a } from "../../ui/badge.js";
9
- import { Button as o } from "../../ui/button.js";
10
- import { LanguageSelector as s } from "../LanguageSelector/index.js";
11
- import { Drawer as ne, DrawerClose as c, DrawerContent as l, DrawerDescription as u, DrawerHeader as d, DrawerTitle as re, DrawerTrigger as ie } from "../../ui/drawer.js";
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 m, useThrottledMeasure as se } from "@rpcbase/client";
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 g, useScrollHideOnDown as de } from "@rpcbase/ui";
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 b = 36, x = (e, t) => {
21
+ var fe = 36, b = (e, t) => {
22
22
  let n = e?.trim() ?? "";
23
23
  return n ? r(n, t ?? "") : "";
24
24
  };
25
- function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay: C }) {
26
- let { t: w, i18n: T } = ue(), E = ae(), { storeSlug: D } = le(), fe = ce(), { itemCount: O } = n(), k = m("(max-width: 640px)"), [A, j] = oe(!1), [M, N] = se(), P = N?.height ?? b, F = de({
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 = `/${D ?? ""}`, R = e(new URLSearchParams(fe.search), D), z = R.toString(), B = !!(R.get("start_time")?.trim() && R.get("end_time")?.trim()), V = z ? `?${z}` : "", H = `${L}/booking${V}`, pe = `${L}/checkout${V}`, U = r?.shop.name?.trim() ?? "", W = r?.shop.emailAddress?.trim() ?? "", G = r?.workspace?.workspaceLanguage, K = r?.workspace?.languages, q = t(r?.content?.tagline, T.language, G).trim(), J = i(r?.shop), Y = q || J || "[Missing shop address]", me = !q && !J, he = t(r?.content?.topBannerMessage, T.language, G).trim() || w("top_bar_message"), X = x(r?.content?.logoWideImageId, D), Z = x(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, D), Q = X.length > 0, $ = Z.length > 0, ge = [
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: w("nav_categories"),
31
+ label: C("nav_categories"),
32
32
  to: `${L}${V}#categories`
33
33
  },
34
34
  {
35
- label: w("nav_featured"),
35
+ label: C("nav_featured"),
36
36
  to: `${L}${V}#featured`
37
37
  },
38
38
  {
39
- label: w("nav_products"),
39
+ label: C("nav_products"),
40
40
  to: H
41
41
  },
42
- ...(E?.itineraries.length ?? 0) > 0 ? [{
43
- label: w("nav_itineraries"),
42
+ ...(T?.itineraries.length ?? 0) > 0 ? [{
43
+ label: C("nav_itineraries"),
44
44
  to: `${L}/itineraries`
45
45
  }] : [],
46
46
  {
47
- label: w("nav_contact"),
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: he })
63
+ children: /* @__PURE__ */ f("span", { children: _e })
64
64
  }), /* @__PURE__ */ p("div", {
65
65
  className: "hidden items-center gap-4 sm:flex",
66
- children: [S ? /* @__PURE__ */ p("a", {
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: S,
68
+ href: x,
69
69
  target: "_blank",
70
70
  rel: "noreferrer",
71
- "aria-label": `WhatsApp${C ? ` ${C}` : ""}`,
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
- }), C ? /* @__PURE__ */ f("span", { children: C }) : null]
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: g("truncate text-xs text-slate-600", me && "text-destructive"),
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: w("nav_categories") })
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: w("nav_featured") })
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: w("nav_products") })
145
+ children: /* @__PURE__ */ f("span", { children: C("nav_products") })
146
146
  }),
147
- (E?.itineraries.length ?? 0) > 0 ? /* @__PURE__ */ f(h, {
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: w("nav_itineraries") })
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: w("nav_contact") })
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(s, {
162
+ /* @__PURE__ */ f(o, {
163
163
  languages: K,
164
164
  className: "hidden sm:inline-flex"
165
165
  }),
166
- /* @__PURE__ */ f(o, {
166
+ /* @__PURE__ */ f(a, {
167
167
  asChild: !0,
168
168
  variant: "outline",
169
169
  size: "sm",
170
- className: g("relative h-9 w-9 gap-2 px-0 sm:w-auto sm:px-3", O > 0 && B ? "inline-flex" : "hidden"),
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: pe,
173
- "aria-label": `${w("cart_button")} (${O})`,
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: w("cart_button")
181
+ children: C("cart_button")
182
182
  }),
183
- /* @__PURE__ */ f(a, {
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: O })
186
- })
185
+ children: /* @__PURE__ */ f("span", { children: D })
186
+ }) : null
187
187
  ]
188
188
  })
189
189
  }),
190
- /* @__PURE__ */ f(o, {
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": w("cta_book_now"),
196
+ "aria-label": C("cta_book_now"),
197
197
  children: [
198
198
  /* @__PURE__ */ f("span", {
199
199
  className: "sm:hidden",
200
- children: w("cta_book_short")
200
+ children: C("cta_book_short")
201
201
  }),
202
202
  /* @__PURE__ */ f("span", {
203
203
  className: "hidden sm:inline",
204
- children: w("cta_book_now")
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(ne, {
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(o, {
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": w("mobile_menu_open"),
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(l, {
230
+ }), /* @__PURE__ */ p(c, {
231
231
  className: "w-[min(22rem,calc(100vw-1.5rem))] bg-white",
232
- "aria-label": w("mobile_menu_label"),
233
- closeLabel: w("mobile_menu_close"),
232
+ "aria-label": C("mobile_menu_label"),
233
+ closeLabel: C("mobile_menu_close"),
234
234
  showCloseButton: !0,
235
235
  children: [
236
- /* @__PURE__ */ p(d, {
236
+ /* @__PURE__ */ p(u, {
237
237
  className: "border-b border-slate-200 px-5 pb-4 pt-6 text-left",
238
- children: [/* @__PURE__ */ f(re, { children: U }), /* @__PURE__ */ f(u, {
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": w("mobile_menu_label"),
246
- children: ge.map((e) => /* @__PURE__ */ f(c, {
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(c, {
257
+ children: [/* @__PURE__ */ f(s, {
258
258
  asChild: !0,
259
- children: /* @__PURE__ */ f(o, {
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: w("cta_book_now") }), /* @__PURE__ */ f(_, {
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(s, {
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 { S as Header };
286
+ export { x as Header };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageSelector/index.tsx"],"names":[],"mappings":"AAaA,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,kDAkEvB"}
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 { Button as n } from "../../ui/button.js";
3
- import { useState as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { useTranslation as o } from "react-i18next";
6
- import { cn as s } from "@rpcbase/ui";
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 u({ languages: u, className: d, align: f = "end" }) {
11
- let { t: p, i18n: m } = o(), [h, g] = r(!1), _ = t(u), v = e(m.resolvedLanguage ?? m.language), y = _.find(({ code: e }) => e === v) ?? _[0];
12
- return !y || _.length < 2 ? null : /* @__PURE__ */ a(l.Root, {
13
- open: h,
14
- onOpenChange: g,
15
- children: [/* @__PURE__ */ i(l.Trigger, {
16
- nativeButton: !0,
17
- render: /* @__PURE__ */ a(n, {
18
- type: "button",
19
- variant: "outline",
20
- size: "sm",
21
- "aria-label": p("language_selector_label"),
22
- className: s("h-9 gap-1 rounded-md px-2 uppercase shadow-none focus-visible:ring-2", d),
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 { u as LanguageSelector };
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 === "quantity_unavailable" ? k("availability_quantity_unavailable") : k("availability_out_of_stock");
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;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+gBtB,CAAA"}
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
- docs_contract_sale_invoice_recipient_label: "Bill To:",
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;