@loczer/storefront-sdk 0.182.0 → 0.183.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 (77) hide show
  1. package/dist/StorefrontProvider.d.ts +18 -15
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.js +24 -34
  4. package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
  5. package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
  6. package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
  7. package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
  8. package/dist/chunks/booking-engine/dist/{schemas-BNlwu75Z.js → schemas-34QQv0EH.js} +4 -4
  9. package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
  10. package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
  11. package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
  12. package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
  13. package/dist/components/AboutSection/index.d.ts +1 -6
  14. package/dist/components/AboutSection/index.d.ts.map +1 -1
  15. package/dist/components/AboutSection/index.js +43 -39
  16. package/dist/components/ContactSection/index.d.ts +1 -3
  17. package/dist/components/ContactSection/index.d.ts.map +1 -1
  18. package/dist/components/ContactSection/index.js +222 -164
  19. package/dist/components/Footer/index.d.ts +3 -4
  20. package/dist/components/Footer/index.d.ts.map +1 -1
  21. package/dist/components/Footer/index.js +98 -69
  22. package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
  23. package/dist/components/FulfillmentSection/index.js +17 -16
  24. package/dist/components/Header/index.d.ts +1 -3
  25. package/dist/components/Header/index.d.ts.map +1 -1
  26. package/dist/components/Header/index.js +77 -72
  27. package/dist/components/Layout/index.d.ts +3 -1
  28. package/dist/components/Layout/index.d.ts.map +1 -1
  29. package/dist/components/Layout/index.js +45 -47
  30. package/dist/components/Map/index.js +1 -1
  31. package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
  32. package/dist/components/ProductPriceBadge/index.js +68 -60
  33. package/dist/i18n/I18nProvider.js +1 -1
  34. package/dist/i18n/fr.js +1 -1
  35. package/dist/index.d.ts +151 -150
  36. package/dist/index.js +62 -62
  37. package/dist/lib/cart.d.ts +4 -1
  38. package/dist/lib/cart.d.ts.map +1 -1
  39. package/dist/lib/cart.js +64 -40
  40. package/dist/lib/cartSummary.d.ts.map +1 -1
  41. package/dist/lib/cartSummary.js +4 -3
  42. package/dist/lib/checkoutSubmit.js +2 -2
  43. package/dist/lib/productVariants.d.ts.map +1 -1
  44. package/dist/lib/productVariants.js +20 -9
  45. package/dist/lib/storefrontAddress.d.ts +5 -0
  46. package/dist/lib/storefrontAddress.d.ts.map +1 -0
  47. package/dist/lib/storefrontAddress.js +24 -0
  48. package/dist/lib/storefrontAvailability.d.ts +6 -6
  49. package/dist/lib/storefrontContact.d.ts +10 -0
  50. package/dist/lib/storefrontContact.d.ts.map +1 -0
  51. package/dist/lib/storefrontContact.js +24 -0
  52. package/dist/lib/storefrontMissingValues.d.ts +5 -0
  53. package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
  54. package/dist/lib/storefrontMissingValues.js +4 -0
  55. package/dist/lib/storefrontProducts.d.ts +23 -21
  56. package/dist/lib/storefrontProducts.d.ts.map +1 -1
  57. package/dist/lib/storefrontProducts.js +7 -5
  58. package/dist/lib/whatsapp.d.ts +8 -6
  59. package/dist/lib/whatsapp.d.ts.map +1 -1
  60. package/dist/lib/whatsapp.js +16 -43
  61. package/dist/pages/BookingPage.js +36 -36
  62. package/dist/pages/HomePage.d.ts.map +1 -1
  63. package/dist/pages/HomePage.js +126 -128
  64. package/dist/pages/ProductPage.js +160 -160
  65. package/dist/storefront.css +1 -1
  66. package/dist/storefrontSchemas.d.ts +14 -12
  67. package/dist/storefrontSchemas.d.ts.map +1 -1
  68. package/dist/storefrontSchemas.js +3 -2
  69. package/dist/ui/radio-group.d.ts +1 -1
  70. package/package.json +7 -6
  71. package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
  72. package/dist/data/config.d.ts +0 -15
  73. package/dist/data/config.d.ts.map +0 -1
  74. package/dist/data/config.js +0 -24
  75. package/dist/static/strings.d.ts +0 -2
  76. package/dist/static/strings.d.ts.map +0 -1
  77. package/dist/static/strings.js +0 -4
@@ -1,137 +1,166 @@
1
- import e from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
2
- import { BusinessHours as t } from "./BusinessHours.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { cn as i } from "@rpcbase/ui";
5
- import { useTranslation as a } from "react-i18next";
6
- import { Clock as o, Mail as s, MapPin as c, Phone as l } from "lucide-react";
1
+ import { resolveStorefrontMapsHref as e, resolveStorefrontPhoneContact as t } from "../../lib/storefrontContact.js";
2
+ import n from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
3
+ import { MISSING_SHOP_ADDRESS as r, MISSING_SHOP_EMAIL as i, MISSING_SHOP_PHONE_NUMBER as a } from "../../lib/storefrontMissingValues.js";
4
+ import { BusinessHours as o } from "./BusinessHours.js";
5
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import { cn as l } from "@rpcbase/ui";
7
+ import { useTranslation as u } from "react-i18next";
8
+ import { Clock as d, Mail as f, MapPin as p, Phone as m } from "lucide-react";
7
9
  //#region src/components/Footer/index.tsx
8
- var u = "group inline-flex gap-2 text-sm font-normal text-slate-600 decoration-current underline-offset-4 transition-colors hover:text-slate-800 hover:underline", d = "mt-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center text-current transition-colors", f = (e) => (Math.trunc(e) % 7 + 7) % 7, p = (e) => Array.isArray(e) ? e.map((e) => ({
10
+ var h = "group inline-flex gap-2 text-sm font-normal text-slate-600 decoration-current underline-offset-4 transition-colors hover:text-slate-800 hover:underline", g = "mt-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center text-current transition-colors", _ = (e) => (Math.trunc(e) % 7 + 7) % 7, v = (e) => Array.isArray(e) ? e.map((e) => ({
9
11
  name: e.name,
10
12
  startDate: e.startDate,
11
13
  endDate: e.endDate,
12
14
  openingHours: e.openingHours.map((e) => ({
13
- day: f(e.day),
15
+ day: _(e.day),
14
16
  openingSlots: e.openingSlots.map((e) => ({
15
17
  start: e.start,
16
18
  end: e.end
17
19
  }))
18
20
  }))
19
- })) : [], m = (e) => Array.isArray(e) ? e.map((e) => ({
21
+ })) : [], y = (e) => Array.isArray(e) ? e.map((e) => ({
20
22
  date: e.date,
21
23
  openingSlots: e.openingSlots.map((e) => ({
22
24
  start: e.start,
23
25
  end: e.end
24
26
  }))
25
27
  })) : [];
26
- function h({ preset: f, whatsappHref: h, whatsappPhoneDisplay: g, openingHours: _, openingHoursOverrides: v }) {
27
- let { t: y } = a(), b = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(f.address)}`, x = p(_), S = m(v), C = x.length > 0;
28
- return /* @__PURE__ */ n("footer", {
28
+ function b({ shop: _, whatsappHref: b, whatsappPhoneDisplay: x, openingHours: S, openingHoursOverrides: C }) {
29
+ let { t: w } = u(), T = t(_), E = _?.emailAddress?.trim() ?? "", D = _?.address?.trim() ?? "", O = e(_), k = v(S), A = y(C), j = k.length > 0;
30
+ return /* @__PURE__ */ s("footer", {
29
31
  className: "border-t bg-white",
30
- children: /* @__PURE__ */ r("div", {
32
+ children: /* @__PURE__ */ c("div", {
31
33
  className: "mx-auto grid max-w-7xl gap-8 px-4 py-10 sm:px-6 md:grid-cols-3",
32
34
  children: [
33
- /* @__PURE__ */ r("div", {
35
+ /* @__PURE__ */ c("div", {
34
36
  className: "space-y-2",
35
- children: [/* @__PURE__ */ n("p", {
37
+ children: [/* @__PURE__ */ s("p", {
36
38
  className: "text-sm font-semibold text-slate-950",
37
- children: /* @__PURE__ */ n("span", { children: y("footer_brand_title") })
38
- }), /* @__PURE__ */ n("p", {
39
+ children: /* @__PURE__ */ s("span", { children: w("footer_brand_title") })
40
+ }), /* @__PURE__ */ s("p", {
39
41
  className: "text-sm text-slate-600",
40
- children: /* @__PURE__ */ n("span", { children: y("footer_brand_description") })
42
+ children: /* @__PURE__ */ s("span", { children: w("footer_brand_description") })
41
43
  })]
42
44
  }),
43
- /* @__PURE__ */ r("div", {
45
+ /* @__PURE__ */ c("div", {
44
46
  className: "space-y-2",
45
- children: [/* @__PURE__ */ n("p", {
47
+ children: [/* @__PURE__ */ s("p", {
46
48
  className: "text-sm font-semibold text-slate-950",
47
- children: /* @__PURE__ */ n("span", { children: y("footer_contact_title") })
48
- }), /* @__PURE__ */ r("div", {
49
+ children: /* @__PURE__ */ s("span", { children: w("footer_contact_title") })
50
+ }), /* @__PURE__ */ c("div", {
49
51
  className: "grid gap-2",
50
52
  children: [
51
- h ? /* @__PURE__ */ r("a", {
52
- className: i(u, "items-center"),
53
- href: h,
53
+ b ? /* @__PURE__ */ c("a", {
54
+ className: l(h, "items-center"),
55
+ href: b,
54
56
  target: "_blank",
55
57
  rel: "noreferrer",
56
58
  children: [
57
- /* @__PURE__ */ n("span", {
58
- className: i(d, "h-5 w-5"),
59
- children: /* @__PURE__ */ n("img", {
60
- src: e,
59
+ /* @__PURE__ */ s("span", {
60
+ className: l(g, "h-5 w-5"),
61
+ children: /* @__PURE__ */ s("img", {
62
+ src: n,
61
63
  className: "h-5 w-5 shrink-0",
62
64
  alt: "",
63
65
  "aria-hidden": "true"
64
66
  })
65
67
  }),
66
- /* @__PURE__ */ n("span", { children: y("footer_whatsapp_link") }),
67
- g ? /* @__PURE__ */ n("span", {
68
+ /* @__PURE__ */ s("span", { children: w("footer_whatsapp_link") }),
69
+ x ? /* @__PURE__ */ s("span", {
68
70
  className: "text-slate-500",
69
- children: g
71
+ children: x
70
72
  }) : null
71
73
  ]
72
74
  }) : null,
73
- /* @__PURE__ */ r("a", {
74
- className: i(u, "items-center"),
75
- href: f.phone_href,
76
- "aria-label": f.phone_display,
77
- children: [/* @__PURE__ */ n("span", {
78
- className: d,
79
- children: /* @__PURE__ */ n(l, {
75
+ T ? /* @__PURE__ */ c("a", {
76
+ className: l(h, "items-center"),
77
+ href: T.href,
78
+ "aria-label": T.phoneDisplay,
79
+ children: [/* @__PURE__ */ s("span", {
80
+ className: g,
81
+ children: /* @__PURE__ */ s(m, {
82
+ className: "h-4 w-4",
83
+ "aria-hidden": "true"
84
+ })
85
+ }), /* @__PURE__ */ s("span", { children: T.phoneDisplay })]
86
+ }) : /* @__PURE__ */ c("div", {
87
+ className: l(h, "items-center text-destructive hover:text-destructive hover:no-underline"),
88
+ children: [/* @__PURE__ */ s("span", {
89
+ className: g,
90
+ children: /* @__PURE__ */ s(m, {
80
91
  className: "h-4 w-4",
81
92
  "aria-hidden": "true"
82
93
  })
83
- }), /* @__PURE__ */ n("span", { children: f.phone_display })]
94
+ }), /* @__PURE__ */ s("span", { children: a })]
84
95
  }),
85
- /* @__PURE__ */ r("a", {
86
- className: i(u, "items-center"),
87
- href: `mailto:${f.email}`,
88
- "aria-label": f.email,
89
- children: [/* @__PURE__ */ n("span", {
90
- className: d,
91
- children: /* @__PURE__ */ n(s, {
96
+ E ? /* @__PURE__ */ c("a", {
97
+ className: l(h, "items-center"),
98
+ href: `mailto:${E}`,
99
+ "aria-label": E,
100
+ children: [/* @__PURE__ */ s("span", {
101
+ className: g,
102
+ children: /* @__PURE__ */ s(f, {
92
103
  className: "h-4 w-4",
93
104
  "aria-hidden": "true"
94
105
  })
95
- }), /* @__PURE__ */ n("span", { children: f.email })]
106
+ }), /* @__PURE__ */ s("span", { children: E })]
107
+ }) : /* @__PURE__ */ c("div", {
108
+ className: l(h, "items-center text-destructive hover:text-destructive hover:no-underline"),
109
+ children: [/* @__PURE__ */ s("span", {
110
+ className: g,
111
+ children: /* @__PURE__ */ s(f, {
112
+ className: "h-4 w-4",
113
+ "aria-hidden": "true"
114
+ })
115
+ }), /* @__PURE__ */ s("span", { children: i })]
96
116
  }),
97
- /* @__PURE__ */ r("a", {
98
- className: i(u, "items-start"),
99
- href: b,
117
+ O && D ? /* @__PURE__ */ c("a", {
118
+ className: l(h, "items-start"),
119
+ href: O,
100
120
  target: "_blank",
101
121
  rel: "noreferrer",
102
- children: [/* @__PURE__ */ n("span", {
103
- className: d,
104
- children: /* @__PURE__ */ n(c, {
122
+ children: [/* @__PURE__ */ s("span", {
123
+ className: g,
124
+ children: /* @__PURE__ */ s(p, {
125
+ className: "h-4 w-4",
126
+ "aria-hidden": "true"
127
+ })
128
+ }), /* @__PURE__ */ s("span", { children: D })]
129
+ }) : /* @__PURE__ */ c("div", {
130
+ className: l(h, "items-start text-destructive hover:text-destructive hover:no-underline"),
131
+ children: [/* @__PURE__ */ s("span", {
132
+ className: g,
133
+ children: /* @__PURE__ */ s(p, {
105
134
  className: "h-4 w-4",
106
135
  "aria-hidden": "true"
107
136
  })
108
- }), /* @__PURE__ */ n("span", { children: f.address })]
137
+ }), /* @__PURE__ */ s("span", { children: r })]
109
138
  })
110
139
  ]
111
140
  })]
112
141
  }),
113
- /* @__PURE__ */ r("div", {
142
+ /* @__PURE__ */ c("div", {
114
143
  className: "space-y-2",
115
- children: [/* @__PURE__ */ n("p", {
144
+ children: [/* @__PURE__ */ s("p", {
116
145
  className: "text-sm font-semibold text-slate-950",
117
- children: /* @__PURE__ */ n("span", { children: y("footer_hours_title") })
118
- }), C ? /* @__PURE__ */ n(t, {
119
- openingHours: x,
120
- openingHoursOverrides: S
121
- }) : /* @__PURE__ */ r("div", {
146
+ children: /* @__PURE__ */ s("span", { children: w("footer_hours_title") })
147
+ }), j ? /* @__PURE__ */ s(o, {
148
+ openingHours: k,
149
+ openingHoursOverrides: A
150
+ }) : /* @__PURE__ */ c("div", {
122
151
  className: "grid gap-1 text-sm text-slate-700",
123
- children: [/* @__PURE__ */ r("p", {
152
+ children: [/* @__PURE__ */ c("p", {
124
153
  className: "inline-flex items-center gap-2",
125
- children: [/* @__PURE__ */ n(o, {
154
+ children: [/* @__PURE__ */ s(d, {
126
155
  className: "h-4 w-4 text-slate-400",
127
156
  "aria-hidden": "true"
128
- }), /* @__PURE__ */ n("span", { children: y("footer_hours_week") })]
129
- }), /* @__PURE__ */ r("p", {
157
+ }), /* @__PURE__ */ s("span", { children: w("footer_hours_week") })]
158
+ }), /* @__PURE__ */ c("p", {
130
159
  className: "inline-flex items-center gap-2",
131
- children: [/* @__PURE__ */ n(o, {
160
+ children: [/* @__PURE__ */ s(d, {
132
161
  className: "h-4 w-4 text-slate-400",
133
162
  "aria-hidden": "true"
134
- }), /* @__PURE__ */ n("span", { children: y("footer_hours_weekend") })]
163
+ }), /* @__PURE__ */ s("span", { children: w("footer_hours_weekend") })]
135
164
  })]
136
165
  })]
137
166
  })
@@ -140,4 +169,4 @@ function h({ preset: f, whatsappHref: h, whatsappPhoneDisplay: g, openingHours:
140
169
  });
141
170
  }
142
171
  //#endregion
143
- export { h as Footer };
172
+ export { b as Footer };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FulfillmentSection/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAA;AAKzF,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,kBAAkB,CAAA;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAClD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,OAAO,CAAA;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+BAA+B,CAAC,EAAE,OAAO,CAAA;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kCAAkC,CAAC,EAAE,sCAAsC,CAAA;IAC3E,2BAA2B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC9C,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,aAAa,EACb,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,+BAAsC,EACtC,YAAuC,EACvC,gBAAgB,EAChB,kCAAkC,EAClC,2BAA2B,EAC3B,2BAAkC,GACnC,EAAE,uBAAuB,kDA0FzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/FulfillmentSection/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,6BAA6B,CAAA;AAKzF,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,kBAAkB,CAAA;IACzB,aAAa,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAClD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,EAAE,OAAO,CAAA;IACxB,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+BAA+B,CAAC,EAAE,OAAO,CAAA;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,kCAAkC,CAAC,EAAE,sCAAsC,CAAA;IAC3E,2BAA2B,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC9C,2BAA2B,CAAC,EAAE,OAAO,CAAA;CACtC,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,aAAa,EACb,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,+BAAsC,EACtC,YAAuC,EACvC,gBAAgB,EAChB,kCAAkC,EAClC,2BAA2B,EAC3B,2BAAkC,GACnC,EAAE,uBAAuB,kDAsGzB"}
@@ -1,3 +1,4 @@
1
+ import "../../lib/storefrontMissingValues.js";
1
2
  import { DeliveryAddressSelector as e } from "../DeliveryAddressSelector/index.js";
2
3
  import { RadioGroup as t, RadioGroupItem as n } from "../../ui/radio-group.js";
3
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
@@ -6,18 +7,18 @@ import { useTranslation as o } from "react-i18next";
6
7
  import { MapPin as s, Store as c, Truck as l } from "lucide-react";
7
8
  //#region src/components/FulfillmentSection/index.tsx
8
9
  function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, deliveryDisabledReason: m, startAddress: h, onStartAddressChange: g, endAddress: _, onEndAddressChange: v, className: y, showPickupAddressWhenPickupOnly: b = !0, testIdPrefix: x = "storefront-fulfillment", googleMapsApiKey: S, deliveryAddressLocationRestriction: C, deliveryAddressAllowedTypes: w, showDeliveryAddressSelector: T = !0 }) {
9
- let { t: E } = o(), D = f?.trim() ?? "", O = m?.trim() ?? "", k = p || O.length > 0, A = u === "delivery" && p ? "delivery" : "pickup";
10
- return k ? /* @__PURE__ */ i("div", {
10
+ let { t: E } = o(), D = f?.trim() ?? "", O = D.length === 0, k = D || "[Missing shop address]", A = m?.trim() ?? "", j = p || A.length > 0, M = u === "delivery" && p ? "delivery" : "pickup";
11
+ return j ? /* @__PURE__ */ i("div", {
11
12
  className: a("grid gap-3", y),
12
13
  "data-testid": x,
13
14
  children: [/* @__PURE__ */ i(t, {
14
- value: A,
15
+ value: M,
15
16
  onValueChange: (e) => {
16
17
  e === "delivery" && !p || d(e === "delivery" ? "delivery" : "pickup");
17
18
  },
18
19
  className: "grid gap-2",
19
20
  children: [/* @__PURE__ */ i("label", {
20
- className: a("flex items-start gap-3 rounded-xl border p-3 transition", A === "pickup" ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
21
+ className: a("flex items-start gap-3 rounded-xl border p-3 transition", M === "pickup" ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white"),
21
22
  "data-testid": `${x}-pickup`,
22
23
  children: [
23
24
  /* @__PURE__ */ r(n, {
@@ -34,14 +35,14 @@ function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, d
34
35
  children: [/* @__PURE__ */ r("span", {
35
36
  className: "text-sm font-medium text-slate-950",
36
37
  children: E("booking_pickup_label")
37
- }), D ? /* @__PURE__ */ r("span", {
38
- className: "text-xs text-slate-600",
39
- children: D
40
- }) : null]
38
+ }), /* @__PURE__ */ r("span", {
39
+ className: a("text-xs text-slate-600", O && "text-destructive"),
40
+ children: k
41
+ })]
41
42
  })
42
43
  ]
43
44
  }), /* @__PURE__ */ i("label", {
44
- className: a("flex items-start gap-3 rounded-xl border p-3 transition", p ? A === "delivery" ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white" : "cursor-not-allowed border-slate-200 bg-white opacity-60"),
45
+ className: a("flex items-start gap-3 rounded-xl border p-3 transition", p ? M === "delivery" ? "border-slate-900 bg-slate-50" : "border-slate-200 bg-white" : "cursor-not-allowed border-slate-200 bg-white opacity-60"),
45
46
  "aria-disabled": !p,
46
47
  "data-testid": `${x}-delivery`,
47
48
  children: [
@@ -62,13 +63,13 @@ function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, d
62
63
  children: E("booking_delivery_label")
63
64
  }), /* @__PURE__ */ r("span", {
64
65
  className: "text-xs text-slate-600",
65
- children: p ? E("booking_delivery_description") : O
66
+ children: p ? E("booking_delivery_description") : A
66
67
  })]
67
68
  })
68
69
  ]
69
70
  })]
70
71
  }), T ? /* @__PURE__ */ r(e, {
71
- open: A === "delivery",
72
+ open: M === "delivery",
72
73
  className: "sm:min-h-[6.75rem]",
73
74
  inputClassName: "h-10 bg-white",
74
75
  startAddress: h,
@@ -80,14 +81,14 @@ function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, d
80
81
  locationRestriction: C,
81
82
  allowedTypes: w
82
83
  }) : null]
83
- }) : !b || D.length === 0 ? null : /* @__PURE__ */ i("div", {
84
- className: a("flex items-center gap-2 text-xs text-slate-600", y),
84
+ }) : b ? /* @__PURE__ */ i("div", {
85
+ className: a("flex items-center gap-2 text-xs text-slate-600", O && "text-destructive", y),
85
86
  "data-testid": `${x}-pickup-address`,
86
87
  children: [/* @__PURE__ */ r(s, {
87
- className: "h-4 w-4 shrink-0 text-slate-900",
88
+ className: a("h-4 w-4 shrink-0 text-slate-900", O && "text-destructive"),
88
89
  "aria-hidden": "true"
89
- }), /* @__PURE__ */ r("span", { children: D })]
90
- });
90
+ }), /* @__PURE__ */ r("span", { children: k })]
91
+ }) : null;
91
92
  }
92
93
  //#endregion
93
94
  export { u as FulfillmentSection };
@@ -1,11 +1,9 @@
1
- import { StorefrontPreset } from '../../data/config';
2
1
  import { StorefrontConfiguration } from '../../storefrontSchemas';
3
2
  type HeaderProps = {
4
- preset: StorefrontPreset;
5
3
  storefrontConfiguration?: StorefrontConfiguration;
6
4
  whatsappHref?: string;
7
5
  whatsappPhoneDisplay?: string;
8
6
  };
9
- export declare function Header({ preset, storefrontConfiguration, whatsappHref, whatsappPhoneDisplay }: HeaderProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Header({ storefrontConfiguration, whatsappHref, whatsappPhoneDisplay }: HeaderProps): import("react/jsx-runtime").JSX.Element;
10
8
  export {};
11
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAOzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAKtE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,CAAA;IACxB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CAsJ1G"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAKtE,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,2CAyKlG"}
@@ -3,163 +3,168 @@ import { useStorefrontCart as t } from "../../lib/cart.js";
3
3
  import { getLocalizedValue as n } from "../../localization.js";
4
4
  import { buildStorefrontImageUrl as r } from "../../lib/storefrontImage.js";
5
5
  import i from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
6
- import { Badge as a } from "../../ui/badge.js";
7
- import { Button as o } from "../../ui/button.js";
8
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
- import { cn as l, useScrollHideOnDown as u } from "@rpcbase/ui";
10
- import { useMediaQuery as d, useThrottledMeasure as f } from "@rpcbase/client";
11
- import { Link as p, useLocation as m, useParams as h } from "@rpcbase/router";
12
- import { useTranslation as g } from "react-i18next";
13
- import { ArrowRight as _, Bike as v, ShoppingCart as y } from "lucide-react";
6
+ import { MISSING_SHOP_EMAIL as a } from "../../lib/storefrontMissingValues.js";
7
+ import { formatStorefrontAddressTagline as o } from "../../lib/storefrontAddress.js";
8
+ import { Badge as s } from "../../ui/badge.js";
9
+ import { Button as c } from "../../ui/button.js";
10
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
+ import { cn as d, useScrollHideOnDown as f } from "@rpcbase/ui";
12
+ import { useMediaQuery as p, useThrottledMeasure as m } from "@rpcbase/client";
13
+ import { Link as h, useLocation as g, useParams as _ } from "@rpcbase/router";
14
+ import { useTranslation as v } from "react-i18next";
15
+ import { ArrowRight as y, Bike as b, ShoppingCart as x } from "lucide-react";
14
16
  //#region src/components/Header/index.tsx
15
- var b = 36, x = (e, t) => {
17
+ var S = 36, C = (e, t) => {
16
18
  let n = e?.trim() ?? "";
17
19
  return n ? r(n, t ?? "") : "";
18
20
  };
19
- function S({ preset: r, storefrontConfiguration: S, whatsappHref: C, whatsappPhoneDisplay: w }) {
20
- let { t: T, i18n: E } = g(), { storeSlug: D } = h(), O = m(), { itemCount: k } = t(), A = d("(max-width: 640px)"), [j, M] = f(), N = M?.height ?? b, P = u({
21
- enabled: A,
21
+ function w({ storefrontConfiguration: r, whatsappHref: w, whatsappPhoneDisplay: T }) {
22
+ let { t: E, i18n: D } = v(), { storeSlug: O } = _(), k = g(), { itemCount: A } = t(), j = p("(max-width: 640px)"), [M, ee] = m(), N = ee?.height ?? S, P = f({
23
+ enabled: j,
22
24
  thresholdPx: N
23
- }), F = A && P ? `translateY(-${N}px)` : "translateY(0)", I = () => {
24
- let e = E.language.startsWith("fr") ? "en" : "fr";
25
- E.changeLanguage(e);
26
- }, L = `/${D ?? ""}`, R = e(new URLSearchParams(O.search), D).toString(), z = R ? `?${R}` : "", B = `${L}/booking${z}`, V = `${L}/checkout${z}`, H = S?.shop.name?.trim() || r.name, U = S?.workspace?.workspaceLanguage, W = n(S?.content?.tagline, E.language, U).trim() || r.tagline, G = n(S?.content?.topBannerMessage, E.language, U).trim() || T("top_bar_message"), K = x(S?.content?.logoWideImageId, D), q = x(S?.content?.logoSquareImageId, D), J = K.length > 0, Y = q.length > 0;
27
- return /* @__PURE__ */ c("div", {
25
+ }), F = j && P ? `translateY(-${N}px)` : "translateY(0)", I = () => {
26
+ let e = D.language.startsWith("fr") ? "en" : "fr";
27
+ D.changeLanguage(e);
28
+ }, L = `/${O ?? ""}`, R = e(new URLSearchParams(k.search), O).toString(), z = R ? `?${R}` : "", B = `${L}/booking${z}`, V = `${L}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = n(r?.content?.tagline, D.language, W).trim(), K = o(r?.shop), q = G || K || "[Missing shop address]", J = !G && !K, Y = n(r?.content?.topBannerMessage, D.language, W).trim() || E("top_bar_message"), X = C(r?.content?.logoWideImageId, O), Z = C(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, O), Q = X.length > 0, $ = Z.length > 0;
29
+ return /* @__PURE__ */ u("div", {
28
30
  className: "sticky top-0 z-30",
29
- children: [/* @__PURE__ */ s("div", {
31
+ children: [/* @__PURE__ */ l("div", {
30
32
  className: "transition-transform duration-300",
31
33
  style: { transform: F },
32
- children: /* @__PURE__ */ s("div", {
33
- ref: j,
34
+ children: /* @__PURE__ */ l("div", {
35
+ ref: M,
34
36
  className: "bg-slate-950 text-white",
35
- children: /* @__PURE__ */ c("div", {
37
+ children: /* @__PURE__ */ u("div", {
36
38
  className: "mx-auto flex max-w-7xl items-center justify-between gap-3 px-4 py-2 text-xs sm:px-6",
37
- children: [/* @__PURE__ */ s("p", {
39
+ children: [/* @__PURE__ */ l("p", {
38
40
  className: "flex items-center gap-2",
39
- children: /* @__PURE__ */ s("span", { children: G })
40
- }), /* @__PURE__ */ c("div", {
41
+ children: /* @__PURE__ */ l("span", { children: Y })
42
+ }), /* @__PURE__ */ u("div", {
41
43
  className: "hidden items-center gap-4 sm:flex",
42
- children: [/* @__PURE__ */ s("a", {
44
+ children: [U ? /* @__PURE__ */ l("a", {
43
45
  className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
44
- href: `mailto:${r.email}`,
45
- "aria-label": r.email,
46
- children: /* @__PURE__ */ s("span", { children: r.email })
47
- }), C ? /* @__PURE__ */ c("a", {
46
+ href: `mailto:${U}`,
47
+ "aria-label": U,
48
+ children: /* @__PURE__ */ l("span", { children: U })
49
+ }) : /* @__PURE__ */ l("span", {
50
+ className: "inline-flex items-center rounded-md px-2 py-1 text-destructive",
51
+ children: a
52
+ }), w ? /* @__PURE__ */ u("a", {
48
53
  className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
49
- href: C,
54
+ href: w,
50
55
  target: "_blank",
51
56
  rel: "noreferrer",
52
- "aria-label": `WhatsApp${w ? ` ${w}` : ""}`,
53
- children: [/* @__PURE__ */ s("img", {
57
+ "aria-label": `WhatsApp${T ? ` ${T}` : ""}`,
58
+ children: [/* @__PURE__ */ l("img", {
54
59
  src: i,
55
60
  className: "h-5 w-5 shrink-0",
56
61
  alt: "",
57
62
  "aria-hidden": "true"
58
- }), w ? /* @__PURE__ */ s("span", { children: w }) : null]
63
+ }), T ? /* @__PURE__ */ l("span", { children: T }) : null]
59
64
  }) : null]
60
65
  })]
61
66
  })
62
67
  })
63
- }), /* @__PURE__ */ s("header", {
68
+ }), /* @__PURE__ */ l("header", {
64
69
  className: "sticky top-0 z-30 border-b bg-white/90 backdrop-blur transition-transform duration-300",
65
70
  style: { transform: F },
66
- children: /* @__PURE__ */ c("div", {
71
+ children: /* @__PURE__ */ u("div", {
67
72
  className: "mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3 sm:px-6",
68
73
  children: [
69
- /* @__PURE__ */ c(p, {
74
+ /* @__PURE__ */ u(h, {
70
75
  to: L,
71
76
  className: "flex min-w-0 items-center gap-3",
72
- children: [Y && !J ? /* @__PURE__ */ s("span", {
77
+ children: [$ ? /* @__PURE__ */ l("span", {
73
78
  className: "inline-flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-white",
74
- children: /* @__PURE__ */ s("img", {
75
- src: q,
79
+ children: /* @__PURE__ */ l("img", {
80
+ src: Z,
76
81
  alt: "",
77
82
  className: "h-full w-full object-contain",
78
83
  "aria-hidden": "true"
79
84
  })
80
- }) : /* @__PURE__ */ s("span", {
81
- className: l("inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-slate-950 text-white", J && "hidden"),
82
- children: /* @__PURE__ */ s(v, {
85
+ }) : Q ? null : /* @__PURE__ */ l("span", {
86
+ className: "inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-slate-950 text-white",
87
+ children: /* @__PURE__ */ l(b, {
83
88
  className: "h-5 w-5",
84
89
  "aria-hidden": "true"
85
90
  })
86
- }), /* @__PURE__ */ c("span", {
91
+ }), /* @__PURE__ */ u("span", {
87
92
  className: "flex min-w-0 flex-col leading-tight",
88
- children: [J ? /* @__PURE__ */ s("img", {
89
- src: K,
93
+ children: [Q && !$ ? /* @__PURE__ */ l("img", {
94
+ src: X,
90
95
  alt: H,
91
96
  className: "h-8 max-w-[10rem] object-contain object-left sm:max-w-[14rem]"
92
- }) : /* @__PURE__ */ s("span", {
97
+ }) : /* @__PURE__ */ l("span", {
93
98
  className: "truncate text-sm font-semibold",
94
99
  children: H
95
- }), /* @__PURE__ */ s("span", {
96
- className: "truncate text-xs text-slate-600",
97
- children: W
100
+ }), /* @__PURE__ */ l("span", {
101
+ className: d("truncate text-xs text-slate-600", J && "text-destructive"),
102
+ children: q
98
103
  })]
99
104
  })]
100
105
  }),
101
- /* @__PURE__ */ c("nav", {
106
+ /* @__PURE__ */ u("nav", {
102
107
  className: "hidden items-center gap-6 text-sm font-medium text-slate-700 md:flex",
103
108
  children: [
104
- /* @__PURE__ */ s(p, {
109
+ /* @__PURE__ */ l(h, {
105
110
  className: "hover:text-slate-950",
106
111
  to: `${L}${z}#categories`,
107
- children: /* @__PURE__ */ s("span", { children: T("nav_categories") })
112
+ children: /* @__PURE__ */ l("span", { children: E("nav_categories") })
108
113
  }),
109
- /* @__PURE__ */ s(p, {
114
+ /* @__PURE__ */ l(h, {
110
115
  className: "hover:text-slate-950",
111
116
  to: `${L}${z}#featured`,
112
- children: /* @__PURE__ */ s("span", { children: T("nav_featured") })
117
+ children: /* @__PURE__ */ l("span", { children: E("nav_featured") })
113
118
  }),
114
- /* @__PURE__ */ s(p, {
119
+ /* @__PURE__ */ l(h, {
115
120
  className: "hover:text-slate-950",
116
121
  to: B,
117
- children: /* @__PURE__ */ s("span", { children: T("nav_products") })
122
+ children: /* @__PURE__ */ l("span", { children: E("nav_products") })
118
123
  }),
119
- /* @__PURE__ */ s(p, {
124
+ /* @__PURE__ */ l(h, {
120
125
  className: "hover:text-slate-950",
121
126
  to: `${L}${z}#contact`,
122
- children: /* @__PURE__ */ s("span", { children: T("nav_contact") })
127
+ children: /* @__PURE__ */ l("span", { children: E("nav_contact") })
123
128
  })
124
129
  ]
125
130
  }),
126
- /* @__PURE__ */ c("div", {
131
+ /* @__PURE__ */ u("div", {
127
132
  className: "flex items-center gap-2",
128
133
  children: [
129
- /* @__PURE__ */ s(o, {
134
+ /* @__PURE__ */ l(c, {
130
135
  variant: "outline",
131
136
  size: "sm",
132
137
  className: "hidden sm:inline-flex",
133
138
  onClick: I,
134
- children: /* @__PURE__ */ s("span", { children: T("language_toggle") })
139
+ children: /* @__PURE__ */ l("span", { children: E("language_toggle") })
135
140
  }),
136
- /* @__PURE__ */ s(o, {
141
+ /* @__PURE__ */ l(c, {
137
142
  asChild: !0,
138
143
  variant: "outline",
139
144
  size: "sm",
140
- className: l("relative gap-2", k > 0 ? "inline-flex" : "hidden"),
141
- children: /* @__PURE__ */ c(p, {
145
+ className: d("relative gap-2", A > 0 ? "inline-flex" : "hidden"),
146
+ children: /* @__PURE__ */ u(h, {
142
147
  to: V,
143
148
  children: [
144
- /* @__PURE__ */ s(y, {
149
+ /* @__PURE__ */ l(x, {
145
150
  className: "h-4 w-4",
146
151
  "aria-hidden": "true"
147
152
  }),
148
- /* @__PURE__ */ s("span", { children: T("cart_button") }),
149
- /* @__PURE__ */ s(a, {
153
+ /* @__PURE__ */ l("span", { children: E("cart_button") }),
154
+ /* @__PURE__ */ l(s, {
150
155
  className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
151
- children: /* @__PURE__ */ s("span", { children: k })
156
+ children: /* @__PURE__ */ l("span", { children: A })
152
157
  })
153
158
  ]
154
159
  })
155
160
  }),
156
- /* @__PURE__ */ s(o, {
161
+ /* @__PURE__ */ l(c, {
157
162
  asChild: !0,
158
163
  size: "sm",
159
164
  className: "gap-2",
160
- children: /* @__PURE__ */ c(p, {
165
+ children: /* @__PURE__ */ u(h, {
161
166
  to: B,
162
- children: [/* @__PURE__ */ s("span", { children: T("cta_book_now") }), /* @__PURE__ */ s(_, {
167
+ children: [/* @__PURE__ */ l("span", { children: E("cta_book_now") }), /* @__PURE__ */ l(y, {
163
168
  className: "h-4 w-4",
164
169
  "aria-hidden": "true"
165
170
  })]
@@ -173,4 +178,4 @@ function S({ preset: r, storefrontConfiguration: S, whatsappHref: C, whatsappPho
173
178
  });
174
179
  }
175
180
  //#endregion
176
- export { S as Header };
181
+ export { w as Header };
@@ -1,7 +1,9 @@
1
+ import { StorefrontProductsCollections } from '../../lib/products';
1
2
  import { StorefrontConfiguration } from '../../storefrontSchemas';
2
3
  type LayoutProps = {
3
4
  storefrontConfiguration?: StorefrontConfiguration;
5
+ storefrontProducts: StorefrontProductsCollections;
4
6
  };
5
- export declare function Layout({ storefrontConfiguration }: LayoutProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Layout({ storefrontConfiguration, storefrontProducts, }: LayoutProps): import("react/jsx-runtime").JSX.Element;
6
8
  export {};
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,EAAE,WAAW,2CA2D9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAA;AAEvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAItE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,kBAAkB,EAAE,6BAA6B,CAAA;CAClD,CAAA;AAED,wBAAgB,MAAM,CAAC,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,EAAE,WAAW,2CA2Db"}