@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.
- package/dist/StorefrontProvider.d.ts +18 -15
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +24 -34
- package/dist/chunks/booking-engine/dist/models/{Product.shared-CJ6vPb6n.js → Product.shared-CTuk4fiR.js} +2 -2
- package/dist/chunks/booking-engine/dist/schemas/{base-asset-PqhtKnZA.js → base-asset-B_Dm8_Vk.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-booking-BM3jZzqu.js → base-booking-DW8AEPKo.js} +1 -1
- package/dist/chunks/booking-engine/dist/schemas/{base-product-BJd4ttMP.js → base-product-1H8l2aUv.js} +1 -1
- package/dist/chunks/booking-engine/dist/{schemas-BNlwu75Z.js → schemas-34QQv0EH.js} +4 -4
- package/dist/chunks/ui/dist/Map/{MapContent--PwVTg2W.js → MapContent-QPkuTBvK.js} +2 -2
- package/dist/chunks/ui/dist/Map/{constants-DqrK8UkE.js → constants-BNmiJXfg.js} +1 -1
- package/dist/chunks/ui/dist/{Map-B45AxZ-D.js → Map-BXmRf5Ep.js} +3 -3
- package/dist/chunks/ui/dist/static/strings-1T2w7LqX.js +4 -0
- package/dist/components/AboutSection/index.d.ts +1 -6
- package/dist/components/AboutSection/index.d.ts.map +1 -1
- package/dist/components/AboutSection/index.js +43 -39
- package/dist/components/ContactSection/index.d.ts +1 -3
- package/dist/components/ContactSection/index.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +222 -164
- package/dist/components/Footer/index.d.ts +3 -4
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +98 -69
- package/dist/components/FulfillmentSection/index.d.ts.map +1 -1
- package/dist/components/FulfillmentSection/index.js +17 -16
- package/dist/components/Header/index.d.ts +1 -3
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +77 -72
- package/dist/components/Layout/index.d.ts +3 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +45 -47
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +68 -60
- package/dist/i18n/I18nProvider.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +151 -150
- package/dist/index.js +62 -62
- package/dist/lib/cart.d.ts +4 -1
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +64 -40
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +4 -3
- package/dist/lib/checkoutSubmit.js +2 -2
- package/dist/lib/productVariants.d.ts.map +1 -1
- package/dist/lib/productVariants.js +20 -9
- package/dist/lib/storefrontAddress.d.ts +5 -0
- package/dist/lib/storefrontAddress.d.ts.map +1 -0
- package/dist/lib/storefrontAddress.js +24 -0
- package/dist/lib/storefrontAvailability.d.ts +6 -6
- package/dist/lib/storefrontContact.d.ts +10 -0
- package/dist/lib/storefrontContact.d.ts.map +1 -0
- package/dist/lib/storefrontContact.js +24 -0
- package/dist/lib/storefrontMissingValues.d.ts +5 -0
- package/dist/lib/storefrontMissingValues.d.ts.map +1 -0
- package/dist/lib/storefrontMissingValues.js +4 -0
- package/dist/lib/storefrontProducts.d.ts +23 -21
- package/dist/lib/storefrontProducts.d.ts.map +1 -1
- package/dist/lib/storefrontProducts.js +7 -5
- package/dist/lib/whatsapp.d.ts +8 -6
- package/dist/lib/whatsapp.d.ts.map +1 -1
- package/dist/lib/whatsapp.js +16 -43
- package/dist/pages/BookingPage.js +36 -36
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +126 -128
- package/dist/pages/ProductPage.js +160 -160
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +14 -12
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +3 -2
- package/dist/ui/radio-group.d.ts +1 -1
- package/package.json +7 -6
- package/dist/chunks/ui/dist/static/strings-CPnO-KbA.js +0 -4
- package/dist/data/config.d.ts +0 -15
- package/dist/data/config.d.ts.map +0 -1
- package/dist/data/config.js +0 -24
- package/dist/static/strings.d.ts +0 -2
- package/dist/static/strings.d.ts.map +0 -1
- package/dist/static/strings.js +0 -4
|
@@ -1,137 +1,166 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
|
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:
|
|
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
|
-
})) : [],
|
|
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
|
|
27
|
-
let { t:
|
|
28
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
35
|
+
/* @__PURE__ */ c("div", {
|
|
34
36
|
className: "space-y-2",
|
|
35
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ s("p", {
|
|
36
38
|
className: "text-sm font-semibold text-slate-950",
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
42
|
+
children: /* @__PURE__ */ s("span", { children: w("footer_brand_description") })
|
|
41
43
|
})]
|
|
42
44
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ c("div", {
|
|
44
46
|
className: "space-y-2",
|
|
45
|
-
children: [/* @__PURE__ */
|
|
47
|
+
children: [/* @__PURE__ */ s("p", {
|
|
46
48
|
className: "text-sm font-semibold text-slate-950",
|
|
47
|
-
children: /* @__PURE__ */
|
|
48
|
-
}), /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ s("span", { children: w("footer_contact_title") })
|
|
50
|
+
}), /* @__PURE__ */ c("div", {
|
|
49
51
|
className: "grid gap-2",
|
|
50
52
|
children: [
|
|
51
|
-
|
|
52
|
-
className:
|
|
53
|
-
href:
|
|
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__ */
|
|
58
|
-
className:
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
src:
|
|
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__ */
|
|
67
|
-
|
|
68
|
+
/* @__PURE__ */ s("span", { children: w("footer_whatsapp_link") }),
|
|
69
|
+
x ? /* @__PURE__ */ s("span", {
|
|
68
70
|
className: "text-slate-500",
|
|
69
|
-
children:
|
|
71
|
+
children: x
|
|
70
72
|
}) : null
|
|
71
73
|
]
|
|
72
74
|
}) : null,
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
className:
|
|
75
|
-
href:
|
|
76
|
-
"aria-label":
|
|
77
|
-
children: [/* @__PURE__ */
|
|
78
|
-
className:
|
|
79
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
94
|
+
}), /* @__PURE__ */ s("span", { children: a })]
|
|
84
95
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
className:
|
|
87
|
-
href: `mailto:${
|
|
88
|
-
"aria-label":
|
|
89
|
-
children: [/* @__PURE__ */
|
|
90
|
-
className:
|
|
91
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
98
|
-
className:
|
|
99
|
-
href:
|
|
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__ */
|
|
103
|
-
className:
|
|
104
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
137
|
+
}), /* @__PURE__ */ s("span", { children: r })]
|
|
109
138
|
})
|
|
110
139
|
]
|
|
111
140
|
})]
|
|
112
141
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ c("div", {
|
|
114
143
|
className: "space-y-2",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ s("p", {
|
|
116
145
|
className: "text-sm font-semibold text-slate-950",
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
-
}),
|
|
119
|
-
openingHours:
|
|
120
|
-
openingHoursOverrides:
|
|
121
|
-
}) : /* @__PURE__ */
|
|
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__ */
|
|
152
|
+
children: [/* @__PURE__ */ c("p", {
|
|
124
153
|
className: "inline-flex items-center gap-2",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ s(d, {
|
|
126
155
|
className: "h-4 w-4 text-slate-400",
|
|
127
156
|
"aria-hidden": "true"
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
160
|
+
children: [/* @__PURE__ */ s(d, {
|
|
132
161
|
className: "h-4 w-4 text-slate-400",
|
|
133
162
|
"aria-hidden": "true"
|
|
134
|
-
}), /* @__PURE__ */
|
|
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 {
|
|
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;
|
|
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() ?? "",
|
|
10
|
-
return
|
|
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:
|
|
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",
|
|
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
|
-
}),
|
|
38
|
-
className: "text-xs text-slate-600",
|
|
39
|
-
children:
|
|
40
|
-
})
|
|
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 ?
|
|
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") :
|
|
66
|
+
children: p ? E("booking_delivery_description") : A
|
|
66
67
|
})]
|
|
67
68
|
})
|
|
68
69
|
]
|
|
69
70
|
})]
|
|
70
71
|
}), T ? /* @__PURE__ */ r(e, {
|
|
71
|
-
open:
|
|
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
|
-
}) :
|
|
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:
|
|
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({
|
|
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":"
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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
|
|
17
|
+
var S = 36, C = (e, t) => {
|
|
16
18
|
let n = e?.trim() ?? "";
|
|
17
19
|
return n ? r(n, t ?? "") : "";
|
|
18
20
|
};
|
|
19
|
-
function
|
|
20
|
-
let { t:
|
|
21
|
-
enabled:
|
|
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 =
|
|
24
|
-
let e =
|
|
25
|
-
|
|
26
|
-
}, L = `/${
|
|
27
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
31
|
+
children: [/* @__PURE__ */ l("div", {
|
|
30
32
|
className: "transition-transform duration-300",
|
|
31
33
|
style: { transform: F },
|
|
32
|
-
children: /* @__PURE__ */
|
|
33
|
-
ref:
|
|
34
|
+
children: /* @__PURE__ */ l("div", {
|
|
35
|
+
ref: M,
|
|
34
36
|
className: "bg-slate-950 text-white",
|
|
35
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
39
|
+
children: [/* @__PURE__ */ l("p", {
|
|
38
40
|
className: "flex items-center gap-2",
|
|
39
|
-
children: /* @__PURE__ */
|
|
40
|
-
}), /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ l("span", { children: Y })
|
|
42
|
+
}), /* @__PURE__ */ u("div", {
|
|
41
43
|
className: "hidden items-center gap-4 sm:flex",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
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:${
|
|
45
|
-
"aria-label":
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
})
|
|
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:
|
|
54
|
+
href: w,
|
|
50
55
|
target: "_blank",
|
|
51
56
|
rel: "noreferrer",
|
|
52
|
-
"aria-label": `WhatsApp${
|
|
53
|
-
children: [/* @__PURE__ */
|
|
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
|
-
}),
|
|
63
|
+
}), T ? /* @__PURE__ */ l("span", { children: T }) : null]
|
|
59
64
|
}) : null]
|
|
60
65
|
})]
|
|
61
66
|
})
|
|
62
67
|
})
|
|
63
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
74
|
+
/* @__PURE__ */ u(h, {
|
|
70
75
|
to: L,
|
|
71
76
|
className: "flex min-w-0 items-center gap-3",
|
|
72
|
-
children: [
|
|
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__ */
|
|
75
|
-
src:
|
|
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__ */
|
|
81
|
-
className:
|
|
82
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
91
|
+
}), /* @__PURE__ */ u("span", {
|
|
87
92
|
className: "flex min-w-0 flex-col leading-tight",
|
|
88
|
-
children: [
|
|
89
|
-
src:
|
|
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__ */
|
|
97
|
+
}) : /* @__PURE__ */ l("span", {
|
|
93
98
|
className: "truncate text-sm font-semibold",
|
|
94
99
|
children: H
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
-
className: "truncate text-xs text-slate-600",
|
|
97
|
-
children:
|
|
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__ */
|
|
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__ */
|
|
109
|
+
/* @__PURE__ */ l(h, {
|
|
105
110
|
className: "hover:text-slate-950",
|
|
106
111
|
to: `${L}${z}#categories`,
|
|
107
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ l("span", { children: E("nav_categories") })
|
|
108
113
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ l(h, {
|
|
110
115
|
className: "hover:text-slate-950",
|
|
111
116
|
to: `${L}${z}#featured`,
|
|
112
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ l("span", { children: E("nav_featured") })
|
|
113
118
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ l(h, {
|
|
115
120
|
className: "hover:text-slate-950",
|
|
116
121
|
to: B,
|
|
117
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ l("span", { children: E("nav_products") })
|
|
118
123
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ l(h, {
|
|
120
125
|
className: "hover:text-slate-950",
|
|
121
126
|
to: `${L}${z}#contact`,
|
|
122
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ l("span", { children: E("nav_contact") })
|
|
123
128
|
})
|
|
124
129
|
]
|
|
125
130
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ u("div", {
|
|
127
132
|
className: "flex items-center gap-2",
|
|
128
133
|
children: [
|
|
129
|
-
/* @__PURE__ */
|
|
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__ */
|
|
139
|
+
children: /* @__PURE__ */ l("span", { children: E("language_toggle") })
|
|
135
140
|
}),
|
|
136
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ l(c, {
|
|
137
142
|
asChild: !0,
|
|
138
143
|
variant: "outline",
|
|
139
144
|
size: "sm",
|
|
140
|
-
className:
|
|
141
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
149
|
+
/* @__PURE__ */ l(x, {
|
|
145
150
|
className: "h-4 w-4",
|
|
146
151
|
"aria-hidden": "true"
|
|
147
152
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */ s
|
|
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__ */
|
|
156
|
+
children: /* @__PURE__ */ l("span", { children: A })
|
|
152
157
|
})
|
|
153
158
|
]
|
|
154
159
|
})
|
|
155
160
|
}),
|
|
156
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ l(c, {
|
|
157
162
|
asChild: !0,
|
|
158
163
|
size: "sm",
|
|
159
164
|
className: "gap-2",
|
|
160
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ u(h, {
|
|
161
166
|
to: B,
|
|
162
|
-
children: [/* @__PURE__ */
|
|
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 {
|
|
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":"
|
|
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"}
|