@loczer/storefront-sdk 0.194.0 → 0.196.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/chunks/pkg/ui/dist/{Button-CxG2fSpA.js → Button-Cr_u8vnh.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Dialog-4leTWiev.js → Dialog-CczmPDwY.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Drawer/{index-DA5V7R_q.js → index-CSvSVP_J.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Map/{MapContent-BmKjdWmq.js → MapContent-CDeWtwKa.js} +1 -1
- package/dist/chunks/pkg/ui/dist/{Map-CsOTdTtL.js → Map-Cs7wgtH9.js} +2 -2
- package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-CfEqkJ0y.js → MorphingModalWizard-j1CgFGLe.js} +4 -3
- package/dist/chunks/pkg/ui/dist/{ResponsiveDialog-C6IWYoIg.js → ResponsiveDialog-BVwhTZQo.js} +3 -3
- package/dist/chunks/pkg/ui/dist/{ScrollArea-Bjwo84cv.js → ScrollArea-BqLd0xZj.js} +1 -1
- package/dist/chunks/pkg/ui/dist/Spinner/{index-DzMEU0iA.js → index-Cgi70z_E.js} +1 -1
- package/dist/chunks/pkg/ui/dist/lib/utils-DXB19bzk.js +8 -0
- package/dist/components/BikeProductCard/index.js +6 -6
- package/dist/components/BookingBikeVariantDialog/index.js +7 -7
- package/dist/components/BookingFlowSteps/index.js +11 -11
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +16 -15
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +16 -15
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +20 -23
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +39 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -0
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +830 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +52 -46
- package/dist/components/ContactSection/index.js +35 -35
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +4 -4
- package/dist/components/ContractSaleDocument/ThumbnailSidebar.js +1 -1
- package/dist/components/DeliveryAddressSelector/index.js +5 -5
- package/dist/components/Footer/index.js +11 -11
- package/dist/components/FulfillmentSection/index.js +9 -9
- package/dist/components/Header/index.js +61 -61
- package/dist/components/Map/index.js +1 -1
- package/dist/components/PoweredByLoczerBadge/index.js +5 -5
- package/dist/components/ProductPriceBadge/index.js +73 -73
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +6 -6
- package/dist/components/StorefrontCartPanel/index.js +8 -8
- package/dist/components/StorefrontInsuranceNotice/index.js +6 -6
- package/dist/components/StorefrontPopupMessages/index.js +8 -8
- package/dist/components/payment/MollieCardFieldsForm.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/lib/utils.d.ts +3 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +9 -5
- package/dist/pages/BookingPage.js +8 -8
- package/dist/pages/CheckoutPaymentPage.js +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +15 -15
- package/dist/pages/HomePage.js +19 -19
- package/dist/pages/PaymentLinkPage.js +1 -1
- package/dist/pages/PaymentLinkSuccessPage.js +1 -1
- package/dist/pages/ProductPage.js +143 -143
- package/dist/pages/checkout/components/CheckoutCouponCard.js +5 -5
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
- package/dist/storefront.css +1 -1
- package/package.json +5 -1
- package/dist/chunks/node_modules/clsx/dist/clsx-CdyIqUTr.js +0 -16
- package/dist/chunks/node_modules/tailwind-merge/dist/bundle-mjs-CF4QheV5.js +0 -1608
- package/dist/chunks/pkg/ui/dist/lib/utils-BN5KOMSm.js +0 -8
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts +0 -22
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +0 -1
- package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.js +0 -342
|
@@ -2,16 +2,16 @@ import { resolveBookingSearchParamsFromSessionStorage as e } from "../../lib/boo
|
|
|
2
2
|
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
|
-
import
|
|
6
|
-
import { MISSING_SHOP_EMAIL as
|
|
7
|
-
import { formatStorefrontAddressTagline as
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { jsx as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
5
|
+
import ee from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
|
|
6
|
+
import { MISSING_SHOP_EMAIL as i } from "../../lib/storefrontMissingValues.js";
|
|
7
|
+
import { formatStorefrontAddressTagline as a } from "../../lib/storefrontAddress.js";
|
|
8
|
+
import { Badge as o } from "../../ui/badge.js";
|
|
9
|
+
import { Button as s } from "../../ui/button.js";
|
|
10
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
+
import { useMediaQuery as u, useThrottledMeasure as d } from "@rpcbase/client";
|
|
12
|
+
import { Link as f, useLocation as p, useParams as m } from "@rpcbase/router";
|
|
13
|
+
import { useTranslation as h } from "react-i18next";
|
|
14
|
+
import { cn as g, useScrollHideOnDown as _ } from "@rpcbase/ui";
|
|
15
15
|
import { ArrowRight as v, ShoppingCart as y } from "lucide-react";
|
|
16
16
|
//#region src/components/Header/index.tsx
|
|
17
17
|
var b = 36, x = (e, t) => {
|
|
@@ -19,153 +19,153 @@ var b = 36, x = (e, t) => {
|
|
|
19
19
|
return n ? r(n, t ?? "") : "";
|
|
20
20
|
};
|
|
21
21
|
function S({ storefrontConfiguration: r, whatsappHref: S, whatsappPhoneDisplay: C }) {
|
|
22
|
-
let { t: w, i18n: T } =
|
|
22
|
+
let { t: w, i18n: T } = h(), { storeSlug: E } = m(), D = p(), { itemCount: O } = t(), k = u("(max-width: 640px)"), [A, te] = d(), j = te?.height ?? b, M = _({
|
|
23
23
|
enabled: k,
|
|
24
24
|
thresholdPx: j
|
|
25
25
|
}), N = k && M ? `translateY(-${j}px)` : "translateY(0)", P = () => {
|
|
26
26
|
let e = T.language.startsWith("fr") ? "en" : "fr";
|
|
27
27
|
T.changeLanguage(e);
|
|
28
|
-
}, F = `/${E ?? ""}`, I = e(new URLSearchParams(D.search), E), L = I.toString(), R = !!(I.get("start_time")?.trim() && I.get("end_time")?.trim()), z = L ? `?${L}` : "", B = `${F}/booking${z}`, V = `${F}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = n(r?.content?.tagline, T.language, W).trim(), K =
|
|
29
|
-
return /* @__PURE__ */
|
|
28
|
+
}, F = `/${E ?? ""}`, I = e(new URLSearchParams(D.search), E), L = I.toString(), R = !!(I.get("start_time")?.trim() && I.get("end_time")?.trim()), z = L ? `?${L}` : "", B = `${F}/booking${z}`, V = `${F}/checkout${z}`, H = r?.shop.name?.trim() ?? "", U = r?.shop.emailAddress?.trim() ?? "", W = r?.workspace?.workspaceLanguage, G = n(r?.content?.tagline, T.language, W).trim(), K = a(r?.shop), q = G || K || "[Missing shop address]", J = !G && !K, Y = n(r?.content?.topBannerMessage, T.language, W).trim() || w("top_bar_message"), X = x(r?.content?.logoWideImageId, E), Z = x(r?.shop.logoImageId ?? r?.content?.logoSquareImageId, E), Q = X.length > 0, $ = Z.length > 0;
|
|
29
|
+
return /* @__PURE__ */ l("div", {
|
|
30
30
|
className: "sticky top-0 z-30",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
31
|
+
children: [/* @__PURE__ */ c("div", {
|
|
32
32
|
className: "transition-transform duration-300",
|
|
33
33
|
style: { transform: N },
|
|
34
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ c("div", {
|
|
35
35
|
ref: A,
|
|
36
36
|
className: "bg-slate-950 text-white",
|
|
37
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ l("div", {
|
|
38
38
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-3 px-4 py-2 text-xs sm:px-6",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ c("p", {
|
|
40
40
|
className: "flex items-center gap-2",
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
}), /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ c("span", { children: Y })
|
|
42
|
+
}), /* @__PURE__ */ l("div", {
|
|
43
43
|
className: "hidden items-center gap-4 sm:flex",
|
|
44
|
-
children: [U ? /* @__PURE__ */
|
|
44
|
+
children: [U ? /* @__PURE__ */ c("a", {
|
|
45
45
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
46
46
|
href: `mailto:${U}`,
|
|
47
47
|
"aria-label": U,
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
}) : /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ c("span", { children: U })
|
|
49
|
+
}) : /* @__PURE__ */ c("span", {
|
|
50
50
|
className: "inline-flex items-center rounded-md px-2 py-1 text-destructive",
|
|
51
|
-
children:
|
|
52
|
-
}), S ? /* @__PURE__ */
|
|
51
|
+
children: i
|
|
52
|
+
}), S ? /* @__PURE__ */ l("a", {
|
|
53
53
|
className: "inline-flex items-center gap-2 rounded-md px-2 py-1 text-white/90 hover:bg-white/10 hover:text-white",
|
|
54
54
|
href: S,
|
|
55
55
|
target: "_blank",
|
|
56
56
|
rel: "noreferrer",
|
|
57
57
|
"aria-label": `WhatsApp${C ? ` ${C}` : ""}`,
|
|
58
|
-
children: [/* @__PURE__ */
|
|
59
|
-
src:
|
|
58
|
+
children: [/* @__PURE__ */ c("img", {
|
|
59
|
+
src: ee,
|
|
60
60
|
className: "h-5 w-5 shrink-0",
|
|
61
61
|
alt: "",
|
|
62
62
|
"aria-hidden": "true"
|
|
63
|
-
}), C ? /* @__PURE__ */
|
|
63
|
+
}), C ? /* @__PURE__ */ c("span", { children: C }) : null]
|
|
64
64
|
}) : null]
|
|
65
65
|
})]
|
|
66
66
|
})
|
|
67
67
|
})
|
|
68
|
-
}), /* @__PURE__ */
|
|
68
|
+
}), /* @__PURE__ */ c("header", {
|
|
69
69
|
className: "sticky top-0 z-30 border-b bg-white/90 backdrop-blur transition-transform duration-300",
|
|
70
70
|
style: { transform: N },
|
|
71
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ l("div", {
|
|
72
72
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-4 px-4 py-3 sm:px-6",
|
|
73
73
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ l(f, {
|
|
75
75
|
to: F,
|
|
76
76
|
className: "flex min-w-0 items-center gap-3",
|
|
77
|
-
children: [$ ? /* @__PURE__ */
|
|
77
|
+
children: [$ ? /* @__PURE__ */ c("span", {
|
|
78
78
|
className: "inline-flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-slate-200 bg-white",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ c("img", {
|
|
80
80
|
src: Z,
|
|
81
81
|
alt: "",
|
|
82
82
|
className: "h-full w-full object-contain",
|
|
83
83
|
"aria-hidden": "true"
|
|
84
84
|
})
|
|
85
|
-
}) : Q ? null : /* @__PURE__ */
|
|
85
|
+
}) : Q ? null : /* @__PURE__ */ c("span", {
|
|
86
86
|
className: "inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border-2 border-dashed border-slate-300 bg-slate-50 text-slate-400",
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ c("span", {
|
|
88
88
|
className: "text-lg font-semibold leading-none",
|
|
89
89
|
"aria-hidden": "true",
|
|
90
90
|
children: "?"
|
|
91
91
|
})
|
|
92
|
-
}), /* @__PURE__ */
|
|
92
|
+
}), /* @__PURE__ */ l("span", {
|
|
93
93
|
className: "flex min-w-0 flex-col leading-tight",
|
|
94
|
-
children: [Q && !$ ? /* @__PURE__ */
|
|
94
|
+
children: [Q && !$ ? /* @__PURE__ */ c("img", {
|
|
95
95
|
src: X,
|
|
96
96
|
alt: H,
|
|
97
97
|
className: "h-8 max-w-[10rem] object-contain object-left sm:max-w-[14rem]"
|
|
98
|
-
}) : /* @__PURE__ */
|
|
98
|
+
}) : /* @__PURE__ */ c("span", {
|
|
99
99
|
className: "truncate text-sm font-semibold",
|
|
100
100
|
children: H
|
|
101
|
-
}), /* @__PURE__ */
|
|
102
|
-
className:
|
|
101
|
+
}), /* @__PURE__ */ c("span", {
|
|
102
|
+
className: g("truncate text-xs text-slate-600", J && "text-destructive"),
|
|
103
103
|
children: q
|
|
104
104
|
})]
|
|
105
105
|
})]
|
|
106
106
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ l("nav", {
|
|
108
108
|
className: "hidden items-center gap-6 text-sm font-medium text-slate-700 md:flex",
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ c(f, {
|
|
111
111
|
className: "hover:text-slate-950",
|
|
112
112
|
to: `${F}${z}#categories`,
|
|
113
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ c("span", { children: w("nav_categories") })
|
|
114
114
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ c(f, {
|
|
116
116
|
className: "hover:text-slate-950",
|
|
117
117
|
to: `${F}${z}#featured`,
|
|
118
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ c("span", { children: w("nav_featured") })
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ c(f, {
|
|
121
121
|
className: "hover:text-slate-950",
|
|
122
122
|
to: B,
|
|
123
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ c("span", { children: w("nav_products") })
|
|
124
124
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ c(f, {
|
|
126
126
|
className: "hover:text-slate-950",
|
|
127
127
|
to: `${F}${z}#contact`,
|
|
128
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ c("span", { children: w("nav_contact") })
|
|
129
129
|
})
|
|
130
130
|
]
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ l("div", {
|
|
133
133
|
className: "flex items-center gap-2",
|
|
134
134
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ c(s, {
|
|
136
136
|
variant: "outline",
|
|
137
137
|
size: "sm",
|
|
138
138
|
className: "hidden sm:inline-flex",
|
|
139
139
|
onClick: P,
|
|
140
|
-
children: /* @__PURE__ */
|
|
140
|
+
children: /* @__PURE__ */ c("span", { children: w("language_toggle") })
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ c(s, {
|
|
143
143
|
asChild: !0,
|
|
144
144
|
variant: "outline",
|
|
145
145
|
size: "sm",
|
|
146
|
-
className:
|
|
147
|
-
children: /* @__PURE__ */
|
|
146
|
+
className: g("relative gap-2", O > 0 && R ? "inline-flex" : "hidden"),
|
|
147
|
+
children: /* @__PURE__ */ l(f, {
|
|
148
148
|
to: V,
|
|
149
149
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ c(y, {
|
|
151
151
|
className: "h-4 w-4",
|
|
152
152
|
"aria-hidden": "true"
|
|
153
153
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ c("span", { children: w("cart_button") }),
|
|
155
|
+
/* @__PURE__ */ c(o, {
|
|
156
156
|
className: "absolute -right-2 -top-2 h-5 min-w-5 rounded-full px-1.5 text-xs",
|
|
157
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ c("span", { children: O })
|
|
158
158
|
})
|
|
159
159
|
]
|
|
160
160
|
})
|
|
161
161
|
}),
|
|
162
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ c(s, {
|
|
163
163
|
asChild: !0,
|
|
164
164
|
size: "sm",
|
|
165
165
|
className: "gap-2",
|
|
166
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ l(f, {
|
|
167
167
|
to: B,
|
|
168
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ c("span", { children: w("cta_book_now") }), /* @__PURE__ */ c(v, {
|
|
169
169
|
className: "h-4 w-4",
|
|
170
170
|
"aria-hidden": "true"
|
|
171
171
|
})]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { I18nProvider as e } from "../../i18n/I18nProvider.js";
|
|
2
2
|
import { useId as t } from "react";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useTranslation as i } from "react-i18next";
|
|
5
|
+
import { cn as a } from "@rpcbase/ui";
|
|
6
6
|
//#region src/components/PoweredByLoczerBadge/index.tsx
|
|
7
7
|
var o = "https://loczer.com";
|
|
8
8
|
function s({ className: e }) {
|
|
@@ -47,14 +47,14 @@ function c({ language: t, ...r }) {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
function l({ className: e, href: t = o, markClassName: c, rel: l = "noopener noreferrer", showTagline: u = !0, target: d = "_blank", ...f }) {
|
|
50
|
-
let { t: p } =
|
|
50
|
+
let { t: p } = i();
|
|
51
51
|
return /* @__PURE__ */ r("a", {
|
|
52
|
-
className:
|
|
52
|
+
className: a("group inline-flex w-fit items-center gap-3 rounded-2xl border border-white/10 bg-white/5 px-3 py-2 shadow-sm transition hover:border-white/20 hover:bg-white/10", e),
|
|
53
53
|
href: t,
|
|
54
54
|
target: d,
|
|
55
55
|
rel: l,
|
|
56
56
|
...f,
|
|
57
|
-
children: [/* @__PURE__ */ n(s, { className:
|
|
57
|
+
children: [/* @__PURE__ */ n(s, { className: a("h-8 w-8 flex-shrink-0", c) }), /* @__PURE__ */ r("span", {
|
|
58
58
|
className: "flex flex-col items-start leading-tight text-left",
|
|
59
59
|
children: [/* @__PURE__ */ n("span", {
|
|
60
60
|
className: "font-medium text-white/90 group-hover:text-white",
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { buildDailyPriceRows as e, buildPriceTierLabels as t, formatStorefrontPriceMinor as n } from "../../lib/pricing.js";
|
|
2
2
|
import { Badge as r, badgeVariants as i } from "../../ui/badge.js";
|
|
3
3
|
import { useOptionalStorefront as a } from "../../StorefrontProvider.js";
|
|
4
|
-
import { useEffect as o, useId as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Info as ne, Mail as re, Phone as
|
|
10
|
-
import { Drawer as
|
|
11
|
-
import { Popover as
|
|
4
|
+
import { useEffect as o, useId as ee, useRef as s, useState as c } from "react";
|
|
5
|
+
import { Fragment as te, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
+
import { useMediaQuery as d } from "@rpcbase/client";
|
|
7
|
+
import { useTranslation as f } from "react-i18next";
|
|
8
|
+
import { cn as p } from "@rpcbase/ui";
|
|
9
|
+
import { Info as ne, Mail as re, Phone as m, TrendingDown as h } from "lucide-react";
|
|
10
|
+
import { Drawer as g } from "@base-ui/react/drawer";
|
|
11
|
+
import { Popover as _ } from "@base-ui/react/popover";
|
|
12
12
|
//#region src/components/ProductPriceBadge/index.tsx
|
|
13
|
-
var
|
|
14
|
-
typeof window > "u" || window.dispatchEvent(new CustomEvent(
|
|
15
|
-
},
|
|
16
|
-
let { t:
|
|
13
|
+
var ie = 180, ae = "(max-width: 767px)", v = "loczer:storefront:product-price-popover-open", y = (e) => typeof Node < "u" && e instanceof Node, b = (e) => {
|
|
14
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(v, { detail: { id: e } }));
|
|
15
|
+
}, x = ({ prices: x, minPriceMinor: S, className: C }) => {
|
|
16
|
+
let { t: w, i18n: T } = f(), E = ee(), D = a(), oe = d(ae), se = d("(hover: none), (pointer: coarse)"), O = !!(oe || se), [k, A] = c(null), [j, M] = c(!1), N = s(null), P = s(null), F = s(null), I = s(null), L = k !== null, R = t(x, T.language, w), z = e(x, T.language), B = R[0], V = R[1], H = () => {
|
|
17
17
|
N.current &&= (clearTimeout(N.current), null);
|
|
18
18
|
}, U = (e) => {
|
|
19
|
-
O || (H(), A((t) => t === "click" ? t : e),
|
|
19
|
+
O || (H(), A((t) => t === "click" ? t : e), b(E));
|
|
20
20
|
}, W = () => {
|
|
21
21
|
H(), A(null);
|
|
22
22
|
}, G = () => {
|
|
23
|
-
H(), M(!0),
|
|
23
|
+
H(), M(!0), b(E);
|
|
24
24
|
}, ce = () => {
|
|
25
25
|
M(!1);
|
|
26
26
|
}, le = () => {
|
|
27
27
|
L || U("hover");
|
|
28
|
-
}, ue = (e) =>
|
|
28
|
+
}, ue = (e) => y(e) ? !!(P.current?.contains(e) || I.current?.contains(e)) : !1, K = (e) => y(e) ? !!(F.current?.contains(e) || I.current?.contains(e)) : !1, q = (e) => {
|
|
29
29
|
k !== "hover" || K(e) || (H(), N.current = setTimeout(() => {
|
|
30
30
|
A((e) => e === "hover" ? null : e), N.current = null;
|
|
31
|
-
},
|
|
31
|
+
}, ie));
|
|
32
32
|
}, J = (e) => {
|
|
33
33
|
q(e?.relatedTarget);
|
|
34
34
|
}, de = (e) => {
|
|
@@ -40,12 +40,12 @@ var ae = 180, oe = "(max-width: 767px)", _ = "loczer:storefront:product-price-po
|
|
|
40
40
|
H();
|
|
41
41
|
};
|
|
42
42
|
let e = (e) => {
|
|
43
|
-
e.detail?.id !==
|
|
43
|
+
e.detail?.id !== E && (H(), A(null), M(!1));
|
|
44
44
|
};
|
|
45
|
-
return window.addEventListener(
|
|
46
|
-
window.removeEventListener(
|
|
45
|
+
return window.addEventListener(v, e), () => {
|
|
46
|
+
window.removeEventListener(v, e), H();
|
|
47
47
|
};
|
|
48
|
-
}, [
|
|
48
|
+
}, [E]), o(() => {
|
|
49
49
|
if (k !== "hover" || typeof window > "u") return;
|
|
50
50
|
let e = (e) => {
|
|
51
51
|
if (K(e.target)) {
|
|
@@ -63,94 +63,94 @@ var ae = 180, oe = "(max-width: 767px)", _ = "loczer:storefront:product-price-po
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
M(!1);
|
|
66
|
-
}, [O]), !B) return typeof
|
|
66
|
+
}, [O]), !B) return typeof S == "number" ? /* @__PURE__ */ l(r, {
|
|
67
67
|
variant: "outline",
|
|
68
|
-
className:
|
|
69
|
-
children: /* @__PURE__ */
|
|
68
|
+
className: p("border-slate-200 bg-white text-slate-700", C),
|
|
69
|
+
children: /* @__PURE__ */ l("span", { children: w("price_from", { price: n(S, T.language) }) })
|
|
70
70
|
}) : null;
|
|
71
|
-
let Y =
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
let Y = p(i({ variant: "outline" }), "gap-1.5 border-slate-200 bg-white text-slate-700 outline-none transition hover:border-slate-300 hover:text-slate-950 focus:border-slate-200 focus:outline-none focus:ring-0 focus:ring-transparent focus:ring-offset-0 focus-visible:border-slate-200 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-transparent focus-visible:ring-offset-0", z.length > 0 && "cursor-pointer", C), X = D?.storefrontConfiguration.shop.emailAddress?.trim(), Z = D?.storefrontConfiguration.shop.contactPhone1?.trim(), fe = !!(X || Z), Q = () => /* @__PURE__ */ u(te, { children: [
|
|
72
|
+
/* @__PURE__ */ l("span", {
|
|
73
73
|
className: "font-semibold",
|
|
74
74
|
children: B
|
|
75
75
|
}),
|
|
76
|
-
V ? /* @__PURE__ */
|
|
76
|
+
V ? /* @__PURE__ */ u("span", {
|
|
77
77
|
className: "inline-flex items-center gap-1 text-slate-500",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
78
|
+
children: [/* @__PURE__ */ l(h, {
|
|
79
79
|
className: "h-3 w-3",
|
|
80
80
|
strokeWidth: 2.4,
|
|
81
81
|
"aria-hidden": "true"
|
|
82
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ l("span", { children: w("price_then", { price: V }) })]
|
|
83
83
|
}) : null,
|
|
84
|
-
z.length > 0 ? /* @__PURE__ */
|
|
84
|
+
z.length > 0 ? /* @__PURE__ */ l("span", {
|
|
85
85
|
ref: F,
|
|
86
86
|
className: "inline-flex shrink-0 items-center text-slate-500",
|
|
87
87
|
onMouseEnter: () => U("hover"),
|
|
88
88
|
onMouseMove: le,
|
|
89
89
|
onMouseLeave: J,
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ l(ne, {
|
|
91
91
|
className: "h-3 w-3",
|
|
92
92
|
"aria-hidden": "true"
|
|
93
93
|
})
|
|
94
94
|
}) : null
|
|
95
|
-
] }), pe = () => fe ? /* @__PURE__ */
|
|
95
|
+
] }), pe = () => fe ? /* @__PURE__ */ u("div", {
|
|
96
96
|
className: "border-t border-slate-200 pt-2 text-slate-600",
|
|
97
|
-
children: [/* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ l("p", {
|
|
98
98
|
className: "leading-snug",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
-
}), /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ l("span", { children: w("price_table_contact_prompt") })
|
|
100
|
+
}), /* @__PURE__ */ u("div", {
|
|
101
101
|
className: "mt-2 flex flex-wrap gap-x-3 gap-y-1",
|
|
102
|
-
children: [Z ? /* @__PURE__ */
|
|
102
|
+
children: [Z ? /* @__PURE__ */ u("a", {
|
|
103
103
|
className: "inline-flex min-w-0 items-center gap-1 font-medium text-slate-800 underline-offset-4 hover:underline",
|
|
104
104
|
href: `tel:${Z}`,
|
|
105
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ l(m, {
|
|
106
106
|
className: "h-3 w-3 shrink-0",
|
|
107
107
|
"aria-hidden": "true"
|
|
108
|
-
}), /* @__PURE__ */
|
|
108
|
+
}), /* @__PURE__ */ l("span", {
|
|
109
109
|
className: "whitespace-nowrap",
|
|
110
110
|
children: Z
|
|
111
111
|
})]
|
|
112
|
-
}) : null, X ? /* @__PURE__ */
|
|
112
|
+
}) : null, X ? /* @__PURE__ */ u("a", {
|
|
113
113
|
className: "inline-flex min-w-0 items-center gap-1 font-medium text-slate-800 underline-offset-4 hover:underline",
|
|
114
114
|
href: `mailto:${X}`,
|
|
115
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ l(re, {
|
|
116
116
|
className: "h-3 w-3 shrink-0",
|
|
117
117
|
"aria-hidden": "true"
|
|
118
|
-
}), /* @__PURE__ */
|
|
118
|
+
}), /* @__PURE__ */ l("span", {
|
|
119
119
|
className: "break-all",
|
|
120
120
|
children: X
|
|
121
121
|
})]
|
|
122
122
|
}) : null]
|
|
123
123
|
})]
|
|
124
|
-
}) : null, $ = (e, t) => /* @__PURE__ */
|
|
125
|
-
className:
|
|
124
|
+
}) : null, $ = (e, t) => /* @__PURE__ */ u("div", {
|
|
125
|
+
className: p("grid gap-2", t === "popover" ? "text-xs" : "text-base"),
|
|
126
126
|
children: [
|
|
127
|
-
e ? /* @__PURE__ */
|
|
127
|
+
e ? /* @__PURE__ */ l("p", {
|
|
128
128
|
className: "font-semibold uppercase tracking-[0.12em] text-slate-500",
|
|
129
|
-
children: /* @__PURE__ */
|
|
129
|
+
children: /* @__PURE__ */ l("span", { children: w("price_table_title") })
|
|
130
130
|
}) : null,
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
className:
|
|
131
|
+
/* @__PURE__ */ l("ul", {
|
|
132
|
+
className: p("grid gap-1 text-slate-600", t === "drawer" && "gap-1.5"),
|
|
133
133
|
children: z.map(({ dayCount: e, totalPriceLabel: n, perDayPriceLabel: r }) => {
|
|
134
|
-
let i =
|
|
135
|
-
return /* @__PURE__ */
|
|
134
|
+
let i = w("price_table_day", { count: e }), a = w("price_table_per_day", { price: r });
|
|
135
|
+
return /* @__PURE__ */ l("li", { children: /* @__PURE__ */ u("div", {
|
|
136
136
|
className: "flex items-baseline gap-2",
|
|
137
137
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ l("span", {
|
|
139
139
|
className: "shrink-0 leading-tight",
|
|
140
140
|
children: i
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ l("span", {
|
|
143
143
|
className: "mx-1 flex-1 border-b border-dotted border-slate-300",
|
|
144
144
|
"aria-hidden": "true"
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ u("span", {
|
|
147
147
|
className: "shrink-0 font-medium leading-tight text-slate-950",
|
|
148
|
-
children: [n, /* @__PURE__ */
|
|
149
|
-
className:
|
|
148
|
+
children: [n, /* @__PURE__ */ u("span", {
|
|
149
|
+
className: p("ml-1 font-medium text-slate-500", t === "popover" ? "text-xs" : "text-sm"),
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ l("span", { children: "(" }),
|
|
152
|
+
/* @__PURE__ */ l("span", { children: a }),
|
|
153
|
+
/* @__PURE__ */ l("span", { children: ")" })
|
|
154
154
|
]
|
|
155
155
|
})]
|
|
156
156
|
})
|
|
@@ -161,17 +161,17 @@ var ae = 180, oe = "(max-width: 767px)", _ = "loczer:storefront:product-price-po
|
|
|
161
161
|
pe()
|
|
162
162
|
]
|
|
163
163
|
});
|
|
164
|
-
return O ? /* @__PURE__ */
|
|
164
|
+
return O ? /* @__PURE__ */ u(g.Root, {
|
|
165
165
|
open: j,
|
|
166
166
|
onOpenChange: (e) => {
|
|
167
167
|
e ? G() : ce();
|
|
168
168
|
},
|
|
169
169
|
swipeDirection: "down",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ l(g.Trigger, {
|
|
171
171
|
ref: P,
|
|
172
172
|
type: "button",
|
|
173
173
|
className: Y,
|
|
174
|
-
"aria-label":
|
|
174
|
+
"aria-label": w("price_details_aria_label", { price: B }),
|
|
175
175
|
"aria-expanded": j,
|
|
176
176
|
onClick: (e) => {
|
|
177
177
|
e.stopPropagation();
|
|
@@ -180,38 +180,38 @@ var ae = 180, oe = "(max-width: 767px)", _ = "loczer:storefront:product-price-po
|
|
|
180
180
|
e.stopPropagation();
|
|
181
181
|
},
|
|
182
182
|
children: Q()
|
|
183
|
-
}), /* @__PURE__ */
|
|
183
|
+
}), /* @__PURE__ */ u(g.Portal, { children: [/* @__PURE__ */ l(g.Backdrop, { className: "pointer-events-auto fixed inset-0 z-50 bg-black/50 outline-none data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:animate-in data-[open]:fade-in-0" }), /* @__PURE__ */ l(g.Viewport, {
|
|
184
184
|
className: "pointer-events-none fixed inset-0 z-50",
|
|
185
|
-
children: /* @__PURE__ */
|
|
185
|
+
children: /* @__PURE__ */ u(g.Popup, {
|
|
186
186
|
className: "pointer-events-auto fixed inset-x-0 bottom-0 z-50 flex max-h-[90dvh] flex-col rounded-t-2xl border-t border-slate-200 bg-white text-slate-950 shadow-xl outline-none data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-bottom data-[open]:animate-in data-[open]:fade-in-0 data-[open]:slide-in-from-bottom",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ l("div", {
|
|
188
188
|
className: "mx-auto mt-4 h-2 w-[100px] shrink-0 rounded-full bg-slate-200",
|
|
189
189
|
"aria-hidden": "true"
|
|
190
|
-
}), /* @__PURE__ */
|
|
190
|
+
}), /* @__PURE__ */ l(g.Content, { children: /* @__PURE__ */ u("div", {
|
|
191
191
|
className: "flex max-h-[calc(90dvh-1rem)] flex-col",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
192
|
+
children: [/* @__PURE__ */ l("div", {
|
|
193
193
|
className: "border-b border-slate-200 px-4 py-4 text-left",
|
|
194
|
-
children: /* @__PURE__ */
|
|
194
|
+
children: /* @__PURE__ */ l(g.Title, {
|
|
195
195
|
className: "text-left text-lg font-semibold text-slate-950",
|
|
196
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ l("span", { children: w("price_table_title") })
|
|
197
197
|
})
|
|
198
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), /* @__PURE__ */ l("div", {
|
|
199
199
|
className: "flex-1 overflow-y-auto px-4 pb-6 pt-3",
|
|
200
200
|
children: $(!1, "drawer")
|
|
201
201
|
})]
|
|
202
202
|
}) })]
|
|
203
203
|
})
|
|
204
204
|
})] })]
|
|
205
|
-
}) : /* @__PURE__ */
|
|
205
|
+
}) : /* @__PURE__ */ u(_.Root, {
|
|
206
206
|
open: L,
|
|
207
207
|
onOpenChange: (e) => {
|
|
208
208
|
e ? U("click") : W();
|
|
209
209
|
},
|
|
210
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ l(_.Trigger, {
|
|
211
211
|
ref: P,
|
|
212
212
|
type: "button",
|
|
213
213
|
className: Y,
|
|
214
|
-
"aria-label":
|
|
214
|
+
"aria-label": w("price_details_aria_label", { price: B }),
|
|
215
215
|
"aria-expanded": L,
|
|
216
216
|
onBlur: de,
|
|
217
217
|
onClick: (e) => {
|
|
@@ -221,13 +221,13 @@ var ae = 180, oe = "(max-width: 767px)", _ = "loczer:storefront:product-price-po
|
|
|
221
221
|
e.stopPropagation();
|
|
222
222
|
},
|
|
223
223
|
children: Q()
|
|
224
|
-
}), z.length > 0 ? /* @__PURE__ */
|
|
224
|
+
}), z.length > 0 ? /* @__PURE__ */ l(_.Portal, { children: /* @__PURE__ */ l(_.Positioner, {
|
|
225
225
|
side: "top",
|
|
226
226
|
align: "end",
|
|
227
227
|
sideOffset: 8,
|
|
228
228
|
collisionPadding: 12,
|
|
229
229
|
className: "pointer-events-auto z-[70] outline-none",
|
|
230
|
-
children: /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ l(_.Popup, {
|
|
231
231
|
ref: I,
|
|
232
232
|
initialFocus: !1,
|
|
233
233
|
className: "w-64 rounded-xl border border-slate-200 bg-white p-3 text-slate-950 shadow-xl outline-none data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95",
|
|
@@ -245,4 +245,4 @@ var ae = 180, oe = "(max-width: 767px)", _ = "loczer:storefront:product-price-po
|
|
|
245
245
|
});
|
|
246
246
|
};
|
|
247
247
|
//#endregion
|
|
248
|
-
export {
|
|
248
|
+
export { x as ProductPriceBadge };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Button as e } from "../../ui/button.js";
|
|
2
|
-
import { ResponsiveDialog as t, ResponsiveDialogContent as n, ResponsiveDialogDescription as r, ResponsiveDialogFooter as i, ResponsiveDialogHeader as a, ResponsiveDialogTitle as o } from "../../chunks/pkg/ui/dist/ResponsiveDialog-
|
|
2
|
+
import { ResponsiveDialog as t, ResponsiveDialogContent as n, ResponsiveDialogDescription as r, ResponsiveDialogFooter as i, ResponsiveDialogHeader as a, ResponsiveDialogTitle as o } from "../../chunks/pkg/ui/dist/ResponsiveDialog-BVwhTZQo.js";
|
|
3
3
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { useSearchParams as l } from "@rpcbase/router";
|
|
5
|
+
import { useTranslation as u } from "react-i18next";
|
|
6
|
+
import { cn as d } from "@rpcbase/ui";
|
|
7
7
|
import { CheckCircle2 as f, Info as p } from "lucide-react";
|
|
8
8
|
//#region src/components/StorefrontCancellationPolicyNotice/index.tsx
|
|
9
9
|
var m = .95, h = "show_cancellation_policy_modal", g = (e) => e.tiers.length === 0 ? [] : [...e.tiers].sort((e, t) => e.upToHours - t.upToHours), _ = (e) => g(e).find((e) => e.refundPercentage >= m) ?? null, v = (e, t) => {
|
|
@@ -17,7 +17,7 @@ var m = .95, h = "show_cancellation_policy_modal", g = (e) => e.tiers.length ===
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
function y({ policy: m, className: y }) {
|
|
20
|
-
let { t: b, i18n: x } =
|
|
20
|
+
let { t: b, i18n: x } = u(), [S, C] = l(), w = S.get(h) === "true", T = g(m), E = _(m), D = (e) => {
|
|
21
21
|
let t = new URLSearchParams(S);
|
|
22
22
|
e ? t.set(h, "true") : t.delete(h), C(t, { replace: !0 });
|
|
23
23
|
};
|
|
@@ -27,7 +27,7 @@ function y({ policy: m, className: y }) {
|
|
|
27
27
|
return t >= 72 && t % 24 == 0 ? b("cancellation_policy_duration_days", { count: t / 24 }) : b("cancellation_policy_duration_hours", { count: t });
|
|
28
28
|
};
|
|
29
29
|
return /* @__PURE__ */ c("li", {
|
|
30
|
-
className:
|
|
30
|
+
className: d("flex items-start gap-3", y),
|
|
31
31
|
"data-testid": "storefront-cancellation-policy-notice",
|
|
32
32
|
children: [
|
|
33
33
|
/* @__PURE__ */ s(f, {
|