@loczer/storefront-sdk 0.221.0 → 0.223.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 (43) hide show
  1. package/dist/StorefrontContext.d.ts +2 -2
  2. package/dist/StorefrontProvider.d.ts +2 -2
  3. package/dist/components/Header/index.d.ts.map +1 -1
  4. package/dist/components/Header/index.js +118 -126
  5. package/dist/components/LanguageSelector/index.d.ts +7 -0
  6. package/dist/components/LanguageSelector/index.d.ts.map +1 -0
  7. package/dist/components/LanguageSelector/index.js +69 -0
  8. package/dist/components/StorefrontCartPanel/index.d.ts +2 -8
  9. package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
  10. package/dist/components/StorefrontCartPanel/index.js +65 -107
  11. package/dist/i18n/I18nProvider.d.ts +3 -2
  12. package/dist/i18n/I18nProvider.d.ts.map +1 -1
  13. package/dist/i18n/I18nProvider.js +61 -64
  14. package/dist/i18n/en.d.ts +2 -2
  15. package/dist/i18n/en.js +3 -3
  16. package/dist/i18n/fr.d.ts +2 -2
  17. package/dist/i18n/fr.js +3 -3
  18. package/dist/i18n/languages.d.ts +15 -0
  19. package/dist/i18n/languages.d.ts.map +1 -0
  20. package/dist/i18n/languages.js +26 -0
  21. package/dist/index.d.ts +33 -24
  22. package/dist/index.js +50 -49
  23. package/dist/lib/cartSummary.d.ts +2 -5
  24. package/dist/lib/cartSummary.d.ts.map +1 -1
  25. package/dist/lib/cartSummary.js +5 -11
  26. package/dist/lib/checkoutPaymentDecision.d.ts +1 -0
  27. package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
  28. package/dist/lib/checkoutPaymentDecision.js +1 -0
  29. package/dist/pages/BookingPage.d.ts.map +1 -1
  30. package/dist/pages/BookingPage.js +150 -148
  31. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  32. package/dist/pages/CheckoutPage.js +156 -155
  33. package/dist/pages/ContractSaleDocumentPage.d.ts +2 -3
  34. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  35. package/dist/pages/ContractSaleDocumentPage.js +18 -17
  36. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +2 -2
  37. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
  38. package/dist/pages/checkout/components/CheckoutSummaryColumn.js +14 -15
  39. package/dist/storefront.css +1 -1
  40. package/dist/storefrontSchemas.d.ts +2 -2
  41. package/dist/storefrontSchemas.d.ts.map +1 -1
  42. package/dist/storefrontSchemas.js +95 -94
  43. package/package.json +1 -1
@@ -97,7 +97,7 @@ export declare function useStorefrontConfig(): {
97
97
  startDate: string;
98
98
  endDate: string;
99
99
  openingHours: {
100
- day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
100
+ day: 0 | 2 | 1 | 3 | 4 | 5 | 6;
101
101
  openingSlots: {
102
102
  start: string;
103
103
  end: string;
@@ -333,7 +333,7 @@ export declare function useStorefrontConfig(): {
333
333
  startDate: string;
334
334
  endDate: string;
335
335
  openingHours: {
336
- day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
336
+ day: 0 | 2 | 1 | 3 | 4 | 5 | 6;
337
337
  openingSlots: {
338
338
  start: string;
339
339
  end: string;
@@ -78,7 +78,7 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
78
78
  startDate: string;
79
79
  endDate: string;
80
80
  openingHours: {
81
- day: 0 | 1 | 2 | 3 | 4 | 5 | 6;
81
+ day: 0 | 2 | 1 | 3 | 4 | 5 | 6;
82
82
  openingSlots: {
83
83
  start: string;
84
84
  end: string;
@@ -240,7 +240,7 @@ export declare const loader: ({ ctx, params }: import('@rpcbase/client').LoaderA
240
240
  accessories: import('.').AccessoryProduct[];
241
241
  bookingBikes: import('.').BikeProduct[];
242
242
  bookingAccessories: import('.').AccessoryProduct[];
243
- language: import('./i18n/I18nProvider').StorefrontI18nLanguage;
243
+ language: "fr" | "en";
244
244
  itineraries: {
245
245
  slug: string;
246
246
  title: Record<string, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAyBA,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,2CA4PlG"}
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"}
@@ -2,282 +2,274 @@ import { resolveBookingSearchParamsFromSessionStorage as e } from "../../lib/boo
2
2
  import { getLocalizedValue as t } from "../../localization.js";
3
3
  import { useStorefrontCart as n } from "../../lib/cart.js";
4
4
  import { buildStorefrontImageUrl as r } from "../../lib/storefrontImage.js";
5
- import i from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
6
- import { MISSING_SHOP_EMAIL as ee } from "../../lib/storefrontMissingValues.js";
7
- import { formatStorefrontAddressTagline as a } from "../../lib/storefrontAddress.js";
8
- import { Badge as o } from "../../ui/badge.js";
9
- import { Button as s } from "../../ui/button.js";
10
- import { Drawer as te, DrawerClose as c, DrawerContent as ne, DrawerDescription as re, DrawerHeader as ie, DrawerTitle as ae, DrawerTrigger as oe } from "../../ui/drawer.js";
11
- import { useOptionalStorefront as se } from "../../StorefrontContext.js";
12
- import { useState as ce } from "react";
13
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
14
- import { useMediaQuery as d, useThrottledMeasure as f } from "@rpcbase/client";
15
- import { Link as p, useLocation as m, useParams as h } from "@rpcbase/router";
16
- import { useTranslation as g } from "react-i18next";
17
- import { cn as _, useScrollHideOnDown as le } from "@rpcbase/ui";
18
- import { ArrowRight as v, Menu as ue, ShoppingCart as de } from "lucide-react";
5
+ import ee from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
6
+ import { MISSING_SHOP_EMAIL as te } from "../../lib/storefrontMissingValues.js";
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";
12
+ import { useOptionalStorefront as ae } from "../../StorefrontContext.js";
13
+ import { useState as oe } from "react";
14
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
15
+ import { useMediaQuery as m, useThrottledMeasure as se } from "@rpcbase/client";
16
+ import { Link as h, useLocation as ce, useParams as le } from "@rpcbase/router";
17
+ import { useTranslation as ue } from "react-i18next";
18
+ import { cn as g, useScrollHideOnDown as de } from "@rpcbase/ui";
19
+ import { ArrowRight as _, Menu as v, ShoppingCart as y } from "lucide-react";
19
20
  //#region src/components/Header/index.tsx
20
- var fe = 36, y = (e, t) => {
21
+ var b = 36, x = (e, t) => {
21
22
  let n = e?.trim() ?? "";
22
23
  return n ? r(n, t ?? "") : "";
23
24
  };
24
- function b({ storefrontConfiguration: r, whatsappHref: b, whatsappPhoneDisplay: x }) {
25
- let { t: S, i18n: C } = g(), w = se(), { storeSlug: T } = h(), E = m(), { itemCount: D } = n(), O = d("(max-width: 640px)"), [k, A] = ce(!1), [j, M] = f(), N = M?.height ?? fe, P = le({
26
- enabled: O,
27
- thresholdPx: N
28
- }), F = O && P ? `translateY(-${N}px)` : "translateY(0)", I = () => {
29
- let e = C.language.startsWith("fr") ? "en" : "fr";
30
- C.changeLanguage(e);
31
- }, L = `/${T ?? ""}`, R = e(new URLSearchParams(E.search), T), 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 = t(r?.content?.tagline, C.language, G).trim(), q = a(r?.shop), J = K || q || "[Missing shop address]", Y = !K && !q, me = t(r?.content?.topBannerMessage, C.language, G).trim() || S("top_bar_message"), X = y(r?.content?.logoWideImageId, T), Z = y(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, T), Q = X.length > 0, $ = Z.length > 0, he = [
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({
27
+ enabled: k,
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 = [
32
30
  {
33
- label: S("nav_categories"),
31
+ label: w("nav_categories"),
34
32
  to: `${L}${V}#categories`
35
33
  },
36
34
  {
37
- label: S("nav_featured"),
35
+ label: w("nav_featured"),
38
36
  to: `${L}${V}#featured`
39
37
  },
40
38
  {
41
- label: S("nav_products"),
39
+ label: w("nav_products"),
42
40
  to: H
43
41
  },
44
- ...(w?.itineraries.length ?? 0) > 0 ? [{
45
- label: S("nav_itineraries"),
42
+ ...(E?.itineraries.length ?? 0) > 0 ? [{
43
+ label: w("nav_itineraries"),
46
44
  to: `${L}/itineraries`
47
45
  }] : [],
48
46
  {
49
- label: S("nav_contact"),
47
+ label: w("nav_contact"),
50
48
  to: `${L}${V}#contact`
51
49
  }
52
50
  ];
53
- return /* @__PURE__ */ u("div", {
51
+ return /* @__PURE__ */ p("div", {
54
52
  className: "sticky top-0 z-30",
55
- children: [/* @__PURE__ */ l("div", {
53
+ children: [/* @__PURE__ */ f("div", {
56
54
  className: "transition-transform duration-300",
57
- style: { transform: F },
58
- children: /* @__PURE__ */ l("div", {
59
- ref: j,
55
+ style: { transform: I },
56
+ children: /* @__PURE__ */ f("div", {
57
+ ref: M,
60
58
  className: "bg-slate-950 text-white",
61
- children: /* @__PURE__ */ u("div", {
59
+ children: /* @__PURE__ */ p("div", {
62
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",
63
- children: [/* @__PURE__ */ l("p", {
61
+ children: [/* @__PURE__ */ f("p", {
64
62
  className: "w-full min-w-0 break-words sm:w-auto",
65
- children: /* @__PURE__ */ l("span", { children: me })
66
- }), /* @__PURE__ */ u("div", {
63
+ children: /* @__PURE__ */ f("span", { children: he })
64
+ }), /* @__PURE__ */ p("div", {
67
65
  className: "hidden items-center gap-4 sm:flex",
68
- children: [b ? /* @__PURE__ */ u("a", {
66
+ children: [S ? /* @__PURE__ */ p("a", {
69
67
  className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
70
- href: b,
68
+ href: S,
71
69
  target: "_blank",
72
70
  rel: "noreferrer",
73
- "aria-label": `WhatsApp${x ? ` ${x}` : ""}`,
74
- children: [/* @__PURE__ */ l("img", {
75
- src: i,
71
+ "aria-label": `WhatsApp${C ? ` ${C}` : ""}`,
72
+ children: [/* @__PURE__ */ f("img", {
73
+ src: ee,
76
74
  className: "h-5 w-5 shrink-0",
77
75
  alt: "",
78
76
  "aria-hidden": "true"
79
- }), x ? /* @__PURE__ */ l("span", { children: x }) : null]
80
- }) : null, W ? /* @__PURE__ */ l("a", {
77
+ }), C ? /* @__PURE__ */ f("span", { children: C }) : null]
78
+ }) : null, W ? /* @__PURE__ */ f("a", {
81
79
  className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
82
80
  href: `mailto:${W}`,
83
81
  "aria-label": W,
84
- children: /* @__PURE__ */ l("span", { children: W })
85
- }) : /* @__PURE__ */ l("span", {
82
+ children: /* @__PURE__ */ f("span", { children: W })
83
+ }) : /* @__PURE__ */ f("span", {
86
84
  className: "inline-flex items-center rounded-md px-2 py-1 text-destructive",
87
- children: ee
85
+ children: te
88
86
  })]
89
87
  })]
90
88
  })
91
89
  })
92
- }), /* @__PURE__ */ l("header", {
90
+ }), /* @__PURE__ */ f("header", {
93
91
  className: "sticky top-0 z-30 border-b bg-white/90 backdrop-blur transition-transform duration-300",
94
- style: { transform: F },
95
- children: /* @__PURE__ */ u("div", {
92
+ style: { transform: I },
93
+ children: /* @__PURE__ */ p("div", {
96
94
  className: "mx-auto flex max-w-7xl min-w-0 items-center gap-2 px-4 py-3 sm:gap-4 sm:px-6",
97
95
  children: [
98
- /* @__PURE__ */ u(p, {
96
+ /* @__PURE__ */ p(h, {
99
97
  to: L,
100
98
  className: "flex min-w-0 flex-1 items-center gap-2 sm:gap-3",
101
- children: [$ ? /* @__PURE__ */ l("span", {
99
+ children: [$ ? /* @__PURE__ */ f("span", {
102
100
  className: "inline-flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-white",
103
- children: /* @__PURE__ */ l("img", {
101
+ children: /* @__PURE__ */ f("img", {
104
102
  src: Z,
105
103
  alt: "",
106
104
  className: "h-full w-full object-contain",
107
105
  "aria-hidden": "true"
108
106
  })
109
- }) : Q ? null : /* @__PURE__ */ l("span", {
107
+ }) : Q ? null : /* @__PURE__ */ f("span", {
110
108
  className: "inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border-2 border-dashed border-slate-300 bg-slate-50 text-slate-400",
111
- children: /* @__PURE__ */ l("span", {
109
+ children: /* @__PURE__ */ f("span", {
112
110
  className: "text-lg font-semibold leading-none",
113
111
  "aria-hidden": "true",
114
112
  children: "?"
115
113
  })
116
- }), /* @__PURE__ */ u("span", {
114
+ }), /* @__PURE__ */ p("span", {
117
115
  className: "flex min-w-0 flex-col leading-tight",
118
- children: [Q && !$ ? /* @__PURE__ */ l("img", {
116
+ children: [Q && !$ ? /* @__PURE__ */ f("img", {
119
117
  src: X,
120
118
  alt: U,
121
119
  className: "h-8 max-w-[10rem] object-contain object-left sm:max-w-[14rem]"
122
- }) : /* @__PURE__ */ l("span", {
120
+ }) : /* @__PURE__ */ f("span", {
123
121
  className: "truncate text-sm font-semibold",
124
122
  children: U
125
- }), /* @__PURE__ */ l("span", {
126
- className: _("truncate text-xs text-slate-600", Y && "text-destructive"),
127
- children: J
123
+ }), /* @__PURE__ */ f("span", {
124
+ className: g("truncate text-xs text-slate-600", me && "text-destructive"),
125
+ children: Y
128
126
  })]
129
127
  })]
130
128
  }),
131
- /* @__PURE__ */ u("nav", {
129
+ /* @__PURE__ */ p("nav", {
132
130
  className: "hidden items-center gap-6 text-sm font-medium text-slate-700 md:flex",
133
131
  children: [
134
- /* @__PURE__ */ l(p, {
132
+ /* @__PURE__ */ f(h, {
135
133
  className: "hover:text-slate-950",
136
134
  to: `${L}${V}#categories`,
137
- children: /* @__PURE__ */ l("span", { children: S("nav_categories") })
135
+ children: /* @__PURE__ */ f("span", { children: w("nav_categories") })
138
136
  }),
139
- /* @__PURE__ */ l(p, {
137
+ /* @__PURE__ */ f(h, {
140
138
  className: "hover:text-slate-950",
141
139
  to: `${L}${V}#featured`,
142
- children: /* @__PURE__ */ l("span", { children: S("nav_featured") })
140
+ children: /* @__PURE__ */ f("span", { children: w("nav_featured") })
143
141
  }),
144
- /* @__PURE__ */ l(p, {
142
+ /* @__PURE__ */ f(h, {
145
143
  className: "hover:text-slate-950",
146
144
  to: H,
147
- children: /* @__PURE__ */ l("span", { children: S("nav_products") })
145
+ children: /* @__PURE__ */ f("span", { children: w("nav_products") })
148
146
  }),
149
- (w?.itineraries.length ?? 0) > 0 ? /* @__PURE__ */ l(p, {
147
+ (E?.itineraries.length ?? 0) > 0 ? /* @__PURE__ */ f(h, {
150
148
  className: "hover:text-slate-950",
151
149
  to: `${L}/itineraries`,
152
- children: /* @__PURE__ */ l("span", { children: S("nav_itineraries") })
150
+ children: /* @__PURE__ */ f("span", { children: w("nav_itineraries") })
153
151
  }) : null,
154
- /* @__PURE__ */ l(p, {
152
+ /* @__PURE__ */ f(h, {
155
153
  className: "hover:text-slate-950",
156
154
  to: `${L}${V}#contact`,
157
- children: /* @__PURE__ */ l("span", { children: S("nav_contact") })
155
+ children: /* @__PURE__ */ f("span", { children: w("nav_contact") })
158
156
  })
159
157
  ]
160
158
  }),
161
- /* @__PURE__ */ u("div", {
159
+ /* @__PURE__ */ p("div", {
162
160
  className: "flex shrink-0 items-center gap-1.5 sm:gap-2",
163
161
  children: [
164
- /* @__PURE__ */ l(s, {
165
- variant: "outline",
166
- size: "sm",
167
- className: "hidden sm:inline-flex",
168
- onClick: I,
169
- children: /* @__PURE__ */ l("span", { children: S("language_toggle") })
162
+ /* @__PURE__ */ f(s, {
163
+ languages: K,
164
+ className: "hidden sm:inline-flex"
170
165
  }),
171
- /* @__PURE__ */ l(s, {
166
+ /* @__PURE__ */ f(o, {
172
167
  asChild: !0,
173
168
  variant: "outline",
174
169
  size: "sm",
175
- className: _("relative h-9 w-9 gap-2 px-0 sm:w-auto sm:px-3", D > 0 && B ? "inline-flex" : "hidden"),
176
- children: /* @__PURE__ */ u(p, {
170
+ className: g("relative h-9 w-9 gap-2 px-0 sm:w-auto sm:px-3", O > 0 && B ? "inline-flex" : "hidden"),
171
+ children: /* @__PURE__ */ p(h, {
177
172
  to: pe,
178
- "aria-label": `${S("cart_button")} (${D})`,
173
+ "aria-label": `${w("cart_button")} (${O})`,
179
174
  children: [
180
- /* @__PURE__ */ l(de, {
175
+ /* @__PURE__ */ f(y, {
181
176
  className: "h-4 w-4",
182
177
  "aria-hidden": "true"
183
178
  }),
184
- /* @__PURE__ */ l("span", {
179
+ /* @__PURE__ */ f("span", {
185
180
  className: "hidden sm:inline",
186
- children: S("cart_button")
181
+ children: w("cart_button")
187
182
  }),
188
- /* @__PURE__ */ l(o, {
183
+ /* @__PURE__ */ f(a, {
189
184
  className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
190
- children: /* @__PURE__ */ l("span", { children: D })
185
+ children: /* @__PURE__ */ f("span", { children: O })
191
186
  })
192
187
  ]
193
188
  })
194
189
  }),
195
- /* @__PURE__ */ l(s, {
190
+ /* @__PURE__ */ f(o, {
196
191
  asChild: !0,
197
192
  size: "sm",
198
193
  className: "h-9 gap-1.5 px-2 sm:gap-2 sm:px-3",
199
- children: /* @__PURE__ */ u(p, {
194
+ children: /* @__PURE__ */ p(h, {
200
195
  to: H,
201
- "aria-label": S("cta_book_now"),
196
+ "aria-label": w("cta_book_now"),
202
197
  children: [
203
- /* @__PURE__ */ l("span", {
198
+ /* @__PURE__ */ f("span", {
204
199
  className: "sm:hidden",
205
- children: S("cta_book_short")
200
+ children: w("cta_book_short")
206
201
  }),
207
- /* @__PURE__ */ l("span", {
202
+ /* @__PURE__ */ f("span", {
208
203
  className: "hidden sm:inline",
209
- children: S("cta_book_now")
204
+ children: w("cta_book_now")
210
205
  }),
211
- /* @__PURE__ */ l(v, {
206
+ /* @__PURE__ */ f(_, {
212
207
  className: "h-4 w-4",
213
208
  "aria-hidden": "true"
214
209
  })
215
210
  ]
216
211
  })
217
212
  }),
218
- /* @__PURE__ */ u(te, {
219
- open: k,
220
- onOpenChange: A,
213
+ /* @__PURE__ */ p(ne, {
214
+ open: A,
215
+ onOpenChange: j,
221
216
  direction: "right",
222
- children: [/* @__PURE__ */ l(oe, {
217
+ children: [/* @__PURE__ */ f(ie, {
223
218
  asChild: !0,
224
- children: /* @__PURE__ */ l(s, {
219
+ children: /* @__PURE__ */ f(o, {
225
220
  type: "button",
226
221
  variant: "outline",
227
222
  size: "icon",
228
223
  className: "h-9 w-9 md:hidden",
229
- "aria-label": S("mobile_menu_open"),
230
- children: /* @__PURE__ */ l(ue, {
224
+ "aria-label": w("mobile_menu_open"),
225
+ children: /* @__PURE__ */ f(v, {
231
226
  className: "h-4 w-4",
232
227
  "aria-hidden": "true"
233
228
  })
234
229
  })
235
- }), /* @__PURE__ */ u(ne, {
230
+ }), /* @__PURE__ */ p(l, {
236
231
  className: "w-[min(22rem,calc(100vw-1.5rem))] bg-white",
237
- "aria-label": S("mobile_menu_label"),
238
- closeLabel: S("mobile_menu_close"),
232
+ "aria-label": w("mobile_menu_label"),
233
+ closeLabel: w("mobile_menu_close"),
239
234
  showCloseButton: !0,
240
235
  children: [
241
- /* @__PURE__ */ u(ie, {
236
+ /* @__PURE__ */ p(d, {
242
237
  className: "border-b border-slate-200 px-5 pb-4 pt-6 text-left",
243
- children: [/* @__PURE__ */ l(ae, { children: U }), /* @__PURE__ */ l(re, {
238
+ children: [/* @__PURE__ */ f(re, { children: U }), /* @__PURE__ */ f(u, {
244
239
  className: "break-words",
245
- children: J
240
+ children: Y
246
241
  })]
247
242
  }),
248
- /* @__PURE__ */ l("nav", {
243
+ /* @__PURE__ */ f("nav", {
249
244
  className: "grid gap-1 overflow-y-auto p-3",
250
- "aria-label": S("mobile_menu_label"),
251
- children: he.map((e) => /* @__PURE__ */ l(c, {
245
+ "aria-label": w("mobile_menu_label"),
246
+ children: ge.map((e) => /* @__PURE__ */ f(c, {
252
247
  asChild: !0,
253
- children: /* @__PURE__ */ l(p, {
248
+ children: /* @__PURE__ */ f(h, {
254
249
  to: e.to,
255
250
  className: "flex min-h-11 items-center rounded-lg px-3 py-2 text-sm font-medium text-slate-700 transition-colors hover:bg-slate-100 hover:text-slate-950",
256
251
  children: e.label
257
252
  })
258
253
  }, `${e.to}-${e.label}`))
259
254
  }),
260
- /* @__PURE__ */ u("div", {
255
+ /* @__PURE__ */ p("div", {
261
256
  className: "mt-auto grid gap-3 border-t border-slate-200 p-4",
262
- children: [/* @__PURE__ */ l(c, {
257
+ children: [/* @__PURE__ */ f(c, {
263
258
  asChild: !0,
264
- children: /* @__PURE__ */ l(s, {
259
+ children: /* @__PURE__ */ f(o, {
265
260
  asChild: !0,
266
261
  className: "w-full gap-2",
267
- children: /* @__PURE__ */ u(p, {
262
+ children: /* @__PURE__ */ p(h, {
268
263
  to: H,
269
- children: [/* @__PURE__ */ l("span", { children: S("cta_book_now") }), /* @__PURE__ */ l(v, {
264
+ children: [/* @__PURE__ */ f("span", { children: w("cta_book_now") }), /* @__PURE__ */ f(_, {
270
265
  className: "h-4 w-4",
271
266
  "aria-hidden": "true"
272
267
  })]
273
268
  })
274
269
  })
275
- }), /* @__PURE__ */ l(s, {
276
- type: "button",
277
- variant: "outline",
278
- className: "w-full",
279
- onClick: I,
280
- children: /* @__PURE__ */ l("span", { children: S("language_toggle") })
270
+ }), /* @__PURE__ */ f(s, {
271
+ languages: K,
272
+ className: "h-10 w-full justify-between"
281
273
  })]
282
274
  })
283
275
  ]
@@ -291,4 +283,4 @@ function b({ storefrontConfiguration: r, whatsappHref: b, whatsappPhoneDisplay:
291
283
  });
292
284
  }
293
285
  //#endregion
294
- export { b as Header };
286
+ export { S as Header };
@@ -0,0 +1,7 @@
1
+ export type LanguageSelectorProps = {
2
+ languages?: readonly string[] | null;
3
+ className?: string;
4
+ align?: "start" | "center" | "end";
5
+ };
6
+ export declare function LanguageSelector({ languages, className, align, }: LanguageSelectorProps): import("react/jsx-runtime").JSX.Element | null;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,69 @@
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";
9
+ //#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
+ }) })]
66
+ });
67
+ }
68
+ //#endregion
69
+ export { u as LanguageSelector };
@@ -3,14 +3,8 @@ import { StorefrontCartSummaryLine } from '../../lib/cartSummary';
3
3
  type StorefrontCartPanelProps = {
4
4
  lines: StorefrontCartSummaryLine[];
5
5
  itemCount: number;
6
- totalPerBaseUnitMinor: number;
7
6
  baseUnitLabel: string;
8
- estimatedTotalMinor?: number;
9
- discountedEstimatedTotalMinor?: number;
10
- discountAmountMinor?: number;
11
- lateReturnSurchargeMinor?: number;
12
- couponCode?: string;
13
- durationInBaseUnitLabel?: string;
7
+ totalMinor?: number;
14
8
  title?: string;
15
9
  description?: string;
16
10
  checkoutPath?: string;
@@ -24,6 +18,6 @@ type StorefrontCartPanelProps = {
24
18
  onRemove?: (key: string) => void;
25
19
  onClear?: () => void;
26
20
  };
27
- export declare function StorefrontCartPanel({ lines, itemCount, totalPerBaseUnitMinor, baseUnitLabel, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationInBaseUnitLabel, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, summaryAddon, pricingSummary, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function StorefrontCartPanel({ lines, itemCount, baseUnitLabel, totalMinor, title, description, checkoutPath, showCheckoutAction, showClearAction, editable, summaryAddon, pricingSummary, stickyTopClassName, onQuantityChange, onRemove, onClear, }: StorefrontCartPanelProps): import("react/jsx-runtime").JSX.Element;
28
22
  export {};
29
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/StorefrontCartPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAQtE,KAAK,wBAAwB,GAAG;IAC9B,K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