@loczer/storefront-sdk 0.166.0 → 0.167.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/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +40 -45
- package/dist/components/ContactSection/index.d.ts.map +1 -1
- package/dist/components/ContactSection/index.js +73 -98
- package/dist/components/DelayedReveal/index.js +1 -1
- package/dist/components/Footer/index.d.ts +2 -1
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +38 -48
- package/dist/components/Header/index.d.ts +2 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +56 -63
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Layout/index.js +35 -26
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +2 -2
- package/dist/i18n/en.d.ts +2 -4
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +5 -7
- package/dist/i18n/fr.d.ts +2 -4
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +5 -7
- package/dist/index.d.ts +8 -10
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +171 -179
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +124 -145
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +185 -173
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,OAAmB,EACnB,MAAM,GACP,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BikeProductCard/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AASrD,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,uBAAuB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,OAAmB,EACnB,MAAM,GACP,EAAE,oBAAoB,2CAgFtB"}
|
|
@@ -1,87 +1,82 @@
|
|
|
1
|
-
import { jsxs as a, jsx as e, Fragment as
|
|
2
|
-
import { Link as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { Link as B } from "@rpcbase/router";
|
|
3
|
+
import { cn as S } from "@rpcbase/ui";
|
|
4
4
|
import { Bike as C, ArrowRight as O } from "lucide-react";
|
|
5
|
-
import { useTranslation as
|
|
6
|
-
import { getAvailabilityVariant as
|
|
7
|
-
import { resolveProductImageContainerStyle as
|
|
8
|
-
import { getLocalizedValue as
|
|
9
|
-
import { Badge as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { ProductPriceBadge as
|
|
5
|
+
import { useTranslation as j } from "react-i18next";
|
|
6
|
+
import { getAvailabilityVariant as P } from "../../lib/utils.js";
|
|
7
|
+
import { resolveProductImageContainerStyle as z } from "../../lib/productImageStyles.js";
|
|
8
|
+
import { getLocalizedValue as d } from "../../localization.js";
|
|
9
|
+
import { Badge as p } from "../../ui/badge.js";
|
|
10
|
+
import { Button as I } from "../../ui/button.js";
|
|
11
|
+
import { ProductPriceBadge as T } from "../ProductPriceBadge/index.js";
|
|
12
12
|
function G({
|
|
13
13
|
bike: t,
|
|
14
|
-
detailsPath:
|
|
15
|
-
productDetailsLinkState:
|
|
16
|
-
actionLabelKey:
|
|
17
|
-
onAction:
|
|
18
|
-
actionDisabled:
|
|
19
|
-
availabilityLabel:
|
|
20
|
-
fallbackLanguage:
|
|
21
|
-
variant:
|
|
22
|
-
testId:
|
|
14
|
+
detailsPath: h,
|
|
15
|
+
productDetailsLinkState: f,
|
|
16
|
+
actionLabelKey: u = "product_cta",
|
|
17
|
+
onAction: x,
|
|
18
|
+
actionDisabled: g = !1,
|
|
19
|
+
availabilityLabel: v,
|
|
20
|
+
fallbackLanguage: i,
|
|
21
|
+
variant: N = "default",
|
|
22
|
+
testId: y
|
|
23
23
|
}) {
|
|
24
|
-
const { t:
|
|
24
|
+
const { t: l, i18n: s } = j(), r = d(t.name, s.language, i), w = d(t.description, s.language, i), n = typeof t.images?.[0] == "string" ? t.images[0].trim() : "", o = z(t.primaryImageStyle), c = P(t.availabilityStatus), m = N === "booking", b = t.availabilityStatus === "OUT_OF_STOCK";
|
|
25
25
|
return /* @__PURE__ */ a(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
28
|
className: "flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
29
|
-
"data-testid":
|
|
29
|
+
"data-testid": y,
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ a("div", { className: "flex flex-1 items-stretch gap-4", children: [
|
|
32
32
|
/* @__PURE__ */ e("div", { className: "w-24 shrink-0 sm:w-28", children: /* @__PURE__ */ a(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
36
|
-
style:
|
|
35
|
+
className: S("relative h-full min-h-20 overflow-hidden rounded-xl", o.className),
|
|
36
|
+
style: o.style,
|
|
37
37
|
children: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
n ? /* @__PURE__ */ e("img", { src: n, alt: r, className: "absolute inset-0 h-full w-full object-contain p-1", loading: "lazy" }) : /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center text-slate-400", children: /* @__PURE__ */ e(C, { className: "h-7 w-7", "aria-hidden": "true" }) }),
|
|
39
|
+
m && b ? /* @__PURE__ */ e(
|
|
40
|
+
p,
|
|
41
41
|
{
|
|
42
42
|
variant: "destructive",
|
|
43
43
|
className: "pointer-events-none absolute right-2 top-2 shadow-sm",
|
|
44
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
44
|
+
children: /* @__PURE__ */ e("span", { children: l("availability_out_of_stock") })
|
|
45
45
|
}
|
|
46
46
|
) : null
|
|
47
47
|
]
|
|
48
48
|
}
|
|
49
49
|
) }),
|
|
50
50
|
/* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
] }) : /* @__PURE__ */ a(d, { children: [
|
|
55
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: l }) }),
|
|
56
|
-
/* @__PURE__ */ e(f, { prices: t.prices, className: "self-start" })
|
|
57
|
-
] }),
|
|
58
|
-
/* @__PURE__ */ e("p", { className: "line-clamp-2 text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: _ }) })
|
|
51
|
+
/* @__PURE__ */ e("p", { className: "min-w-0 text-sm font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: r }) }),
|
|
52
|
+
/* @__PURE__ */ e(T, { prices: t.prices, className: "self-start" }),
|
|
53
|
+
/* @__PURE__ */ e("p", { className: "line-clamp-2 text-xs text-slate-600", children: /* @__PURE__ */ e("span", { children: w }) })
|
|
59
54
|
] })
|
|
60
55
|
] }),
|
|
61
56
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
|
|
62
|
-
|
|
63
|
-
/* @__PURE__ */ e(
|
|
57
|
+
m ? null : /* @__PURE__ */ a(_, { children: [
|
|
58
|
+
/* @__PURE__ */ e(p, { variant: c.variant, children: /* @__PURE__ */ e("span", { children: v ?? l(c.labelKey) }) }),
|
|
64
59
|
/* @__PURE__ */ e("span", { className: "text-slate-400", children: "·" })
|
|
65
60
|
] }),
|
|
66
61
|
/* @__PURE__ */ e(
|
|
67
|
-
|
|
62
|
+
B,
|
|
68
63
|
{
|
|
69
|
-
to:
|
|
70
|
-
state:
|
|
64
|
+
to: h,
|
|
65
|
+
state: f,
|
|
71
66
|
className: "text-xs font-medium text-slate-700 hover:text-slate-950",
|
|
72
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
67
|
+
children: /* @__PURE__ */ e("span", { children: l("product_details_link") })
|
|
73
68
|
}
|
|
74
69
|
),
|
|
75
70
|
/* @__PURE__ */ a(
|
|
76
|
-
|
|
71
|
+
I,
|
|
77
72
|
{
|
|
78
73
|
type: "button",
|
|
79
74
|
size: "sm",
|
|
80
75
|
className: "ml-auto rounded-full gap-2 text-xs",
|
|
81
|
-
onClick:
|
|
82
|
-
disabled:
|
|
76
|
+
onClick: x,
|
|
77
|
+
disabled: g,
|
|
83
78
|
children: [
|
|
84
|
-
/* @__PURE__ */ e("span", { children:
|
|
79
|
+
/* @__PURE__ */ e("span", { children: l(u) }),
|
|
85
80
|
/* @__PURE__ */ e(O, { className: "h-4 w-4", "aria-hidden": "true" })
|
|
86
81
|
]
|
|
87
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ContactSection/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ContactSection/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAoBzD,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,2CAmRpG"}
|
|
@@ -1,61 +1,60 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as l } from "react";
|
|
3
3
|
import { useTranslation as L } from "react-i18next";
|
|
4
|
-
import { useForm as O, zodResolver as
|
|
5
|
-
import { toast as
|
|
4
|
+
import { useForm as O, zodResolver as R } from "@rpcbase/form";
|
|
5
|
+
import { toast as C } from "@rpcbase/client";
|
|
6
6
|
import { PhoneNumberInput as B, cn as V } from "@rpcbase/ui";
|
|
7
|
-
import { Phone as q, Mail as
|
|
8
|
-
import { z as
|
|
9
|
-
import
|
|
10
|
-
import { ROUTE as
|
|
11
|
-
import { resolveStorefrontWhatsAppContact as
|
|
12
|
-
import { useStorefront as
|
|
13
|
-
import { COORDS as
|
|
14
|
-
import { Button as
|
|
15
|
-
import { Form as
|
|
16
|
-
import { Input as
|
|
17
|
-
import { Textarea as
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
preset: s,
|
|
7
|
+
import { Phone as q, Mail as D, MapPin as E } from "lucide-react";
|
|
8
|
+
import { z as i } from "zod";
|
|
9
|
+
import H from "../../chunks/assets/whatsapp.svg-grlzka-t.js";
|
|
10
|
+
import { ROUTE as U, responseSchema as z } from "../../lib/contactForm.js";
|
|
11
|
+
import { resolveStorefrontWhatsAppContact as W } from "../../lib/whatsapp.js";
|
|
12
|
+
import { useStorefront as $ } from "../../StorefrontProvider.js";
|
|
13
|
+
import { COORDS as J } from "../../static/strings.js";
|
|
14
|
+
import { Button as Z } from "../../ui/button.js";
|
|
15
|
+
import { Form as G, FormField as p, FormItem as f, FormLabel as u, FormControl as _, FormMessage as m } from "../../ui/form.js";
|
|
16
|
+
import { Input as k } from "../../ui/input.js";
|
|
17
|
+
import { Textarea as K } from "../../ui/textarea.js";
|
|
18
|
+
import { Map as Q } from "../Map/index.js";
|
|
19
|
+
import { createMarkerElement as X } from "../Map/createMarkerElement.js";
|
|
20
|
+
const Y = (n) => n.startsWith("fr") ? "FR" : "US", g = "text-sm font-normal text-current decoration-current underline-offset-4 group-hover:underline", x = "group flex items-start gap-3 text-slate-600 transition-colors hover:text-slate-800";
|
|
21
|
+
function be({ preset: n, storeSlug: S }) {
|
|
22
|
+
const { t, i18n: d } = L(), { storefrontConfiguration: b, mapboxToken: M } = $(), j = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(n.address)}`, h = W({
|
|
23
|
+
preset: n,
|
|
25
24
|
storefrontConfiguration: b,
|
|
26
|
-
language:
|
|
27
|
-
}),
|
|
28
|
-
name:
|
|
29
|
-
emailAddress:
|
|
30
|
-
phoneNumber:
|
|
31
|
-
message:
|
|
32
|
-
}), [t,
|
|
33
|
-
resolver:
|
|
25
|
+
language: d.language
|
|
26
|
+
}), F = h?.href, T = l(() => i.object({
|
|
27
|
+
name: i.string().trim().min(1, t("contact_form_validation_name_required")),
|
|
28
|
+
emailAddress: i.string().trim().email(t("contact_form_validation_email_invalid")),
|
|
29
|
+
phoneNumber: i.string().trim().min(6, t("contact_form_validation_phone_invalid")),
|
|
30
|
+
message: i.string().trim().min(1, t("contact_form_validation_message_required")).max(8192, t("contact_form_validation_message_too_long"))
|
|
31
|
+
}), [t, d.language]), o = O({
|
|
32
|
+
resolver: R(T),
|
|
34
33
|
defaultValues: { name: "", emailAddress: "", phoneNumber: "", message: "" }
|
|
35
|
-
}), N =
|
|
34
|
+
}), N = l(() => {
|
|
36
35
|
const a = b.shop.gpsCoordinates;
|
|
37
|
-
return a ? [a[1], a[0]] :
|
|
38
|
-
}, [b.shop.gpsCoordinates]),
|
|
36
|
+
return a ? [a[1], a[0]] : J;
|
|
37
|
+
}, [b.shop.gpsCoordinates]), w = l(() => X(), []), y = l(
|
|
39
38
|
() => ({
|
|
40
39
|
coords: N,
|
|
41
|
-
element:
|
|
40
|
+
element: w || void 0,
|
|
42
41
|
offset: [0, -25.5],
|
|
43
|
-
popupHTML:
|
|
42
|
+
popupHTML: n.address,
|
|
44
43
|
popupCloseButton: !1
|
|
45
44
|
}),
|
|
46
|
-
[
|
|
47
|
-
), I =
|
|
48
|
-
const
|
|
45
|
+
[n.address, N, w]
|
|
46
|
+
), I = l(() => [y], [y]), P = o.handleSubmit(async (a) => {
|
|
47
|
+
const c = await fetch(U, {
|
|
49
48
|
method: "POST",
|
|
50
49
|
headers: { "Content-Type": "application/json" },
|
|
51
|
-
body: JSON.stringify({ storeSlug:
|
|
52
|
-
}),
|
|
53
|
-
if (
|
|
54
|
-
|
|
50
|
+
body: JSON.stringify({ storeSlug: S, ...a })
|
|
51
|
+
}), s = await c.json().then((A) => z.safeParse(A)).catch(() => ({ success: !1 }));
|
|
52
|
+
if (c.ok && "success" in s && s.success && s.data.success) {
|
|
53
|
+
C.success(t("contact_form_success_toast")), o.reset();
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
const v = "success" in
|
|
58
|
-
|
|
56
|
+
const v = "success" in s && s.success && s.data.error ? s.data.error : t("contact_form_error_toast");
|
|
57
|
+
C.error(v);
|
|
59
58
|
});
|
|
60
59
|
return /* @__PURE__ */ e("section", { id: "contact", className: "border-t bg-slate-50 py-12 scroll-mt-16 sm:scroll-mt-20 sm:py-16", "data-testid": "storefront-contact-form", children: /* @__PURE__ */ r("div", { className: "mx-auto max-w-7xl px-4 sm:px-6", children: [
|
|
61
60
|
/* @__PURE__ */ r("div", { className: "mx-auto max-w-2xl text-center", children: [
|
|
@@ -66,66 +65,42 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
66
65
|
/* @__PURE__ */ r("div", { className: "flex flex-col gap-6 lg:border-r lg:border-slate-200 lg:pr-6", children: [
|
|
67
66
|
/* @__PURE__ */ r("div", { children: [
|
|
68
67
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-slate-950", children: t("contact_section_info_title") }),
|
|
69
|
-
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-slate-600", children: t(
|
|
68
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-slate-600", children: t(F ? "contact_section_info_description" : "contact_section_info_description_without_whatsapp") })
|
|
70
69
|
] }),
|
|
71
70
|
/* @__PURE__ */ r("div", { className: "grid gap-5", children: [
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e("img", { src:
|
|
71
|
+
h ? /* @__PURE__ */ r("a", { className: x, href: h.href, target: "_blank", rel: "noreferrer", children: [
|
|
72
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e("img", { src: H, className: "h-6 w-6", alt: "", "aria-hidden": "true" }) }),
|
|
74
73
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
75
74
|
/* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_whatsapp_label") }),
|
|
76
|
-
/* @__PURE__ */ e(
|
|
77
|
-
w,
|
|
78
|
-
{
|
|
79
|
-
value: c.phoneDisplay,
|
|
80
|
-
reserveWidth: "11.5rem",
|
|
81
|
-
fallback: /* @__PURE__ */ e(y, { value: c.phoneDisplay, className: "bg-slate-200" }),
|
|
82
|
-
children: (a) => /* @__PURE__ */ e("span", { className: g, children: a })
|
|
83
|
-
}
|
|
84
|
-
)
|
|
75
|
+
/* @__PURE__ */ e("span", { className: g, children: h.phoneDisplay })
|
|
85
76
|
] })
|
|
86
77
|
] }) : null,
|
|
87
|
-
/* @__PURE__ */ r("a", { className: x, href:
|
|
78
|
+
/* @__PURE__ */ r("a", { className: x, href: n.phone_href, children: [
|
|
88
79
|
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(q, { className: "h-5 w-5", "aria-hidden": "true" }) }),
|
|
89
80
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
90
81
|
/* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_phone_label") }),
|
|
91
|
-
/* @__PURE__ */ e(
|
|
92
|
-
w,
|
|
93
|
-
{
|
|
94
|
-
value: s.phone_display,
|
|
95
|
-
reserveWidth: "11.5rem",
|
|
96
|
-
fallback: /* @__PURE__ */ e(y, { value: s.phone_display, className: "bg-slate-200" }),
|
|
97
|
-
children: (a) => /* @__PURE__ */ e("span", { className: g, children: a })
|
|
98
|
-
}
|
|
99
|
-
)
|
|
82
|
+
/* @__PURE__ */ e("span", { className: g, children: n.phone_display })
|
|
100
83
|
] })
|
|
101
84
|
] }),
|
|
102
|
-
/* @__PURE__ */ r("a", { className: x, href: `mailto:${
|
|
103
|
-
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(
|
|
85
|
+
/* @__PURE__ */ r("a", { className: x, href: `mailto:${n.email}`, children: [
|
|
86
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(D, { className: "h-5 w-5", "aria-hidden": "true" }) }),
|
|
104
87
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
105
88
|
/* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_email_label") }),
|
|
106
|
-
/* @__PURE__ */ e(
|
|
107
|
-
w,
|
|
108
|
-
{
|
|
109
|
-
value: s.email,
|
|
110
|
-
reserveWidth: "11.5rem",
|
|
111
|
-
fallback: /* @__PURE__ */ e(y, { value: s.email, className: "bg-slate-200" }),
|
|
112
|
-
children: (a) => /* @__PURE__ */ e("span", { className: g, children: a })
|
|
113
|
-
}
|
|
114
|
-
)
|
|
89
|
+
/* @__PURE__ */ e("span", { className: g, children: n.email })
|
|
115
90
|
] })
|
|
116
91
|
] }),
|
|
117
|
-
/* @__PURE__ */ r("a", { className: x, href:
|
|
118
|
-
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(
|
|
92
|
+
/* @__PURE__ */ r("a", { className: x, href: j, target: "_blank", rel: "noreferrer", children: [
|
|
93
|
+
/* @__PURE__ */ e("span", { className: "mt-0.5 inline-flex h-8 w-8 items-center justify-center text-current transition-colors", children: /* @__PURE__ */ e(E, { className: "h-5 w-5", "aria-hidden": "true" }) }),
|
|
119
94
|
/* @__PURE__ */ r("span", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
120
95
|
/* @__PURE__ */ e("span", { className: "text-2xs font-medium uppercase tracking-[0.08em] text-slate-500", children: t("contact_section_address_label") }),
|
|
121
|
-
/* @__PURE__ */ e("span", { className: g, children:
|
|
96
|
+
/* @__PURE__ */ e("span", { className: g, children: n.address })
|
|
122
97
|
] })
|
|
123
98
|
] })
|
|
124
99
|
] }),
|
|
125
100
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
126
|
-
|
|
101
|
+
Q,
|
|
127
102
|
{
|
|
128
|
-
mapboxToken:
|
|
103
|
+
mapboxToken: M,
|
|
129
104
|
initialCenter: N,
|
|
130
105
|
initialZoom: 10,
|
|
131
106
|
markers: I,
|
|
@@ -137,7 +112,7 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
137
112
|
/* @__PURE__ */ r("div", { children: [
|
|
138
113
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-slate-950", children: t("contact_section_form_title") }),
|
|
139
114
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-slate-600", children: t("contact_section_form_description") }),
|
|
140
|
-
/* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(
|
|
115
|
+
/* @__PURE__ */ e("div", { className: "mt-6", children: /* @__PURE__ */ e(G, { ...o, children: /* @__PURE__ */ r("form", { onSubmit: P, className: "grid gap-4", children: [
|
|
141
116
|
/* @__PURE__ */ e(
|
|
142
117
|
p,
|
|
143
118
|
{
|
|
@@ -145,8 +120,8 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
145
120
|
name: "name",
|
|
146
121
|
render: ({ field: a }) => /* @__PURE__ */ r(f, { children: [
|
|
147
122
|
/* @__PURE__ */ e(u, { children: t("contact_form_name_label") }),
|
|
148
|
-
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(
|
|
149
|
-
/* @__PURE__ */ e(
|
|
123
|
+
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(k, { ...a, placeholder: t("contact_form_name_placeholder"), className: "h-11" }) }),
|
|
124
|
+
/* @__PURE__ */ e(m, {})
|
|
150
125
|
] })
|
|
151
126
|
}
|
|
152
127
|
),
|
|
@@ -158,7 +133,7 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
158
133
|
render: ({ field: a }) => /* @__PURE__ */ r(f, { children: [
|
|
159
134
|
/* @__PURE__ */ e(u, { children: t("contact_form_email_label") }),
|
|
160
135
|
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(
|
|
161
|
-
|
|
136
|
+
k,
|
|
162
137
|
{
|
|
163
138
|
...a,
|
|
164
139
|
type: "email",
|
|
@@ -166,7 +141,7 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
166
141
|
className: "h-11"
|
|
167
142
|
}
|
|
168
143
|
) }),
|
|
169
|
-
/* @__PURE__ */ e(
|
|
144
|
+
/* @__PURE__ */ e(m, {})
|
|
170
145
|
] })
|
|
171
146
|
}
|
|
172
147
|
),
|
|
@@ -175,7 +150,7 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
175
150
|
{
|
|
176
151
|
control: o.control,
|
|
177
152
|
name: "phoneNumber",
|
|
178
|
-
render: ({ field: a, fieldState:
|
|
153
|
+
render: ({ field: a, fieldState: c }) => /* @__PURE__ */ r(f, { children: [
|
|
179
154
|
/* @__PURE__ */ e(u, { children: t("contact_form_phone_label") }),
|
|
180
155
|
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(
|
|
181
156
|
B,
|
|
@@ -183,22 +158,22 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
183
158
|
name: a.name,
|
|
184
159
|
value: a.value ?? "",
|
|
185
160
|
onBlur: a.onBlur,
|
|
186
|
-
onChange: (
|
|
187
|
-
const v =
|
|
161
|
+
onChange: (s) => {
|
|
162
|
+
const v = s.e164 || s.formattedInternational || s.rawInput || "";
|
|
188
163
|
a.onChange(v);
|
|
189
164
|
},
|
|
190
|
-
defaultCountry:
|
|
191
|
-
locale:
|
|
165
|
+
defaultCountry: Y(d.language),
|
|
166
|
+
locale: d.language,
|
|
192
167
|
placeholder: t("contact_form_phone_placeholder"),
|
|
193
168
|
className: "relative",
|
|
194
169
|
inputClassName: V(
|
|
195
170
|
"flex h-11 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
196
|
-
|
|
171
|
+
c.error && "border-destructive focus-visible:ring-destructive"
|
|
197
172
|
),
|
|
198
|
-
renderValidationMessage: ({ message:
|
|
173
|
+
renderValidationMessage: ({ message: s }) => c.error?.message ? null : /* @__PURE__ */ e(m, { style: { top: "100%" }, children: /* @__PURE__ */ e("span", { children: s }) })
|
|
199
174
|
}
|
|
200
175
|
) }),
|
|
201
|
-
|
|
176
|
+
c.error?.message ? /* @__PURE__ */ e(m, {}) : null
|
|
202
177
|
] })
|
|
203
178
|
}
|
|
204
179
|
),
|
|
@@ -209,14 +184,14 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
209
184
|
name: "message",
|
|
210
185
|
render: ({ field: a }) => /* @__PURE__ */ r(f, { children: [
|
|
211
186
|
/* @__PURE__ */ e(u, { children: t("contact_form_message_label") }),
|
|
212
|
-
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(
|
|
213
|
-
/* @__PURE__ */ e(
|
|
187
|
+
/* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(K, { ...a, rows: 5, placeholder: t("contact_form_message_placeholder"), className: "min-h-[132px]" }) }),
|
|
188
|
+
/* @__PURE__ */ e(m, {})
|
|
214
189
|
] })
|
|
215
190
|
}
|
|
216
191
|
),
|
|
217
192
|
/* @__PURE__ */ r("div", { className: "mt-2 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
218
193
|
/* @__PURE__ */ e("p", { className: "text-xs text-slate-500", children: t("contact_form_privacy_hint") }),
|
|
219
|
-
/* @__PURE__ */ e(
|
|
194
|
+
/* @__PURE__ */ e(Z, { type: "submit", disabled: o.formState.isSubmitting, children: o.formState.isSubmitting ? t("contact_form_submitting_button") : t("contact_form_submit_button") })
|
|
220
195
|
] })
|
|
221
196
|
] }) }) })
|
|
222
197
|
] })
|
|
@@ -224,5 +199,5 @@ function we({ preset: s, storeSlug: j }) {
|
|
|
224
199
|
] }) });
|
|
225
200
|
}
|
|
226
201
|
export {
|
|
227
|
-
|
|
202
|
+
be as ContactSection
|
|
228
203
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { useState as p, useMemo as u, useEffect as y } from "react";
|
|
3
3
|
import { cn as o } from "@rpcbase/ui";
|
|
4
4
|
const h = (e) => e.replace(/[A-Za-z0-9]/g, "x"), E = ({
|
|
@@ -3,9 +3,10 @@ import { StorefrontConfiguration } from '../../storefrontSchemas';
|
|
|
3
3
|
type FooterProps = {
|
|
4
4
|
preset: StorefrontPreset;
|
|
5
5
|
whatsappHref?: string;
|
|
6
|
+
whatsappPhoneDisplay?: string;
|
|
6
7
|
openingHours?: StorefrontConfiguration["bookingEngine"]["shop"]["openingHours"];
|
|
7
8
|
openingHoursOverrides?: StorefrontConfiguration["bookingEngine"]["shop"]["openingHoursOverrides"];
|
|
8
9
|
};
|
|
9
|
-
export declare function Footer({ preset, whatsappHref, openingHours, openingHoursOverrides }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Footer({ preset, whatsappHref, whatsappPhoneDisplay, openingHours, openingHoursOverrides, }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAMzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Footer/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAMzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAStE,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAA;IAC/E,qBAAqB,CAAC,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,uBAAuB,CAAC,CAAA;CAClG,CAAA;AAyCD,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,GACtB,EAAE,WAAW,2CAiGb"}
|