@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as e } from "./lib/utils-
|
|
1
|
+
import { cn as e } from "./lib/utils-DXB19bzk.js";
|
|
2
2
|
import { composeRefs as t, createAutoFocusHandler as n } from "./lib/slot-FQrvG282.js";
|
|
3
3
|
import { useBodyPointerEventsLock as r } from "./lib/body-pointer-events-DLBTed3C.js";
|
|
4
4
|
import { SsrHydratablePortal as i } from "./SsrHydratablePortal/index-eGyYZilF.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as e } from "../lib/utils-
|
|
1
|
+
import { cn as e } from "../lib/utils-DXB19bzk.js";
|
|
2
2
|
import { useBodyPointerEventsLock as t } from "../lib/body-pointer-events-DLBTed3C.js";
|
|
3
3
|
import { SsrHydratablePortal as n } from "../SsrHydratablePortal/index-eGyYZilF.js";
|
|
4
4
|
import * as r from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __toESM as e } from "../../../../_virtual/_rolldown/runtime-CkxIErRK.js";
|
|
2
|
-
import { cn as t } from "../lib/utils-
|
|
2
|
+
import { cn as t } from "../lib/utils-DXB19bzk.js";
|
|
3
3
|
import { DEFAULT_MAP_SKELETON_COLOR as n } from "./constants-BNmiJXfg.js";
|
|
4
4
|
import { DEFAULT_MAP_CENTER as r } from "../static/strings-1T2w7LqX.js";
|
|
5
5
|
import { classifyMapboxError as i, toSanitizedMapboxError as a } from "./mapboxError-oRn0l3EE.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cn as e } from "./lib/utils-
|
|
1
|
+
import { cn as e } from "./lib/utils-DXB19bzk.js";
|
|
2
2
|
import { isAutomationRuntime as t } from "./lib/isAutomationRuntime-CZ6KXlyz.js";
|
|
3
3
|
import { Suspense as n, lazy as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
4
4
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@ var l = ({ className: t, style: n, color: r }) => /* @__PURE__ */ c("div", {
|
|
|
14
14
|
style: { backgroundColor: r ?? "rgb(201 221 176)" }
|
|
15
15
|
})
|
|
16
16
|
}), /* @__PURE__ */ s("div", { className: "h-full w-full transition-opacity duration-500 ease-out pointer-events-none opacity-0" })]
|
|
17
|
-
}), u = r(() => import("./Map/MapContent-
|
|
17
|
+
}), u = r(() => import("./Map/MapContent-CDeWtwKa.js")), d = (e) => {
|
|
18
18
|
let r = a(null), [c, d] = o(!1);
|
|
19
19
|
i(() => {
|
|
20
20
|
if (t()) return;
|
package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-CfEqkJ0y.js → MorphingModalWizard-j1CgFGLe.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
1
|
+
import "./lib/utils-DXB19bzk.js";
|
|
2
|
+
import "./Dialog-CczmPDwY.js";
|
|
3
|
+
import "./ScrollArea-BqLd0xZj.js";
|
|
4
|
+
import "./Button-Cr_u8vnh.js";
|
|
4
5
|
import { createContext as e, useContext as t } from "react";
|
|
5
6
|
import "react/jsx-runtime";
|
|
6
7
|
import "lucide-react";
|
package/dist/chunks/pkg/ui/dist/{ResponsiveDialog-C6IWYoIg.js → ResponsiveDialog-BVwhTZQo.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cn as e } from "./lib/utils-
|
|
2
|
-
import { Dialog as t, DialogClose as n, DialogContent as r, DialogDescription as i, DialogFooter as a, DialogHeader as o, DialogTitle as s, DialogTrigger as c } from "./Dialog-
|
|
3
|
-
import { Drawer as l, DrawerClose as u, DrawerContent as d, DrawerDescription as f, DrawerFooter as p, DrawerHeader as m, DrawerTitle as h, DrawerTrigger as g } from "./Drawer/index-
|
|
1
|
+
import { cn as e } from "./lib/utils-DXB19bzk.js";
|
|
2
|
+
import { Dialog as t, DialogClose as n, DialogContent as r, DialogDescription as i, DialogFooter as a, DialogHeader as o, DialogTitle as s, DialogTrigger as c } from "./Dialog-CczmPDwY.js";
|
|
3
|
+
import { Drawer as l, DrawerClose as u, DrawerContent as d, DrawerDescription as f, DrawerFooter as p, DrawerHeader as m, DrawerTitle as h, DrawerTrigger as g } from "./Drawer/index-CSvSVP_J.js";
|
|
4
4
|
import { useMediaQuery as _ } from "./lib/useMediaQuery-CrZFwD6A.js";
|
|
5
5
|
import * as v from "react";
|
|
6
6
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
@@ -5,13 +5,13 @@ import { Button as r } from "../../ui/button.js";
|
|
|
5
5
|
import { ProductPriceBadge as i } from "../ProductPriceBadge/index.js";
|
|
6
6
|
import { resolveProductImageContainerStyle as a } from "../../lib/productImageStyles.js";
|
|
7
7
|
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { Link as l } from "@rpcbase/router";
|
|
9
|
+
import { useTranslation as u } from "react-i18next";
|
|
10
|
+
import { cn as d } from "@rpcbase/ui";
|
|
11
11
|
import { ArrowRight as f, Bike as p } from "lucide-react";
|
|
12
12
|
//#region src/components/BikeProductCard/index.tsx
|
|
13
13
|
function m({ bike: m, detailsPath: h, productDetailsLinkState: g, actionLabelKey: _ = "product_cta", onAction: v, actionDisabled: y = !1, availabilityLabel: b, fallbackLanguage: x, variant: S = "default", testId: C }) {
|
|
14
|
-
let { t: w, i18n: T } =
|
|
14
|
+
let { t: w, i18n: T } = u(), E = t(m.name, T.language, x), D = t(m.description, T.language, x), O = typeof m.images?.[0] == "string" ? m.images[0].trim() : "", k = a(m.primaryImageStyle), A = e(m.availabilityStatus), j = S === "booking", M = m.availabilityStatus === "OUT_OF_STOCK";
|
|
15
15
|
return /* @__PURE__ */ c("div", {
|
|
16
16
|
className: "flex h-full flex-col gap-2 rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
17
17
|
"data-testid": C,
|
|
@@ -20,7 +20,7 @@ function m({ bike: m, detailsPath: h, productDetailsLinkState: g, actionLabelKey
|
|
|
20
20
|
children: [/* @__PURE__ */ s("div", {
|
|
21
21
|
className: "w-24 shrink-0 sm:w-28",
|
|
22
22
|
children: /* @__PURE__ */ c("div", {
|
|
23
|
-
className:
|
|
23
|
+
className: d("relative h-full min-h-20 overflow-hidden rounded-xl", k.className),
|
|
24
24
|
style: k.style,
|
|
25
25
|
children: [O ? /* @__PURE__ */ s("img", {
|
|
26
26
|
src: O,
|
|
@@ -66,7 +66,7 @@ function m({ bike: m, detailsPath: h, productDetailsLinkState: g, actionLabelKey
|
|
|
66
66
|
className: "text-slate-400",
|
|
67
67
|
children: "·"
|
|
68
68
|
})] }),
|
|
69
|
-
/* @__PURE__ */ s(
|
|
69
|
+
/* @__PURE__ */ s(l, {
|
|
70
70
|
to: h,
|
|
71
71
|
state: g,
|
|
72
72
|
className: "text-xs font-medium text-slate-700 hover:text-slate-950",
|
|
@@ -3,7 +3,7 @@ import { getAvailabilityVariant as n } from "../../lib/utils.js";
|
|
|
3
3
|
import { getLocalizedValue as r } from "../../localization.js";
|
|
4
4
|
import { Badge as i } from "../../ui/badge.js";
|
|
5
5
|
import { Button as a } from "../../ui/button.js";
|
|
6
|
-
import { RESPONSIVE_DIALOG_MOBILE_MEDIA_QUERY as o, ResponsiveDialog as s, ResponsiveDialogContent as c, ResponsiveDialogDescription as l, ResponsiveDialogFooter as u, ResponsiveDialogHeader as d, ResponsiveDialogTitle as f } from "../../chunks/pkg/ui/dist/ResponsiveDialog-
|
|
6
|
+
import { RESPONSIVE_DIALOG_MOBILE_MEDIA_QUERY as o, ResponsiveDialog as s, ResponsiveDialogContent as c, ResponsiveDialogDescription as l, ResponsiveDialogFooter as u, ResponsiveDialogHeader as d, ResponsiveDialogTitle as f } from "../../chunks/pkg/ui/dist/ResponsiveDialog-BVwhTZQo.js";
|
|
7
7
|
import { Input as p } from "../../ui/input.js";
|
|
8
8
|
import { useStorefrontWorkspaceLanguage as m } from "../../StorefrontProvider.js";
|
|
9
9
|
import { ProductWarningNotice as h } from "../ProductWarningNotice/index.js";
|
|
@@ -11,13 +11,13 @@ import { ProductPriceBadge as g } from "../ProductPriceBadge/index.js";
|
|
|
11
11
|
import { resolveProductImageContainerStyle as _ } from "../../lib/productImageStyles.js";
|
|
12
12
|
import { useEffect as v, useState as y } from "react";
|
|
13
13
|
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { useMediaQuery as S } from "@rpcbase/client";
|
|
15
|
+
import { useTranslation as C } from "react-i18next";
|
|
16
|
+
import { cn as w } from "@rpcbase/ui";
|
|
17
17
|
import { Bike as T, CheckCircle2 as E, Plus as D } from "lucide-react";
|
|
18
18
|
//#region src/components/BookingBikeVariantDialog/index.tsx
|
|
19
19
|
function O({ open: p, product: O, onOpenChange: A, getVariantAvailabilityLabel: j, isVariantOutOfCapacity: M, addDisabled: N = !1, onAddVariant: P }) {
|
|
20
|
-
let { t: F, i18n: I } =
|
|
20
|
+
let { t: F, i18n: I } = C(), L = S(o), R = m(), [z, B] = y({});
|
|
21
21
|
if (v(() => {
|
|
22
22
|
!O || !p || B((O.productVariants ?? []).reduce((e, t) => (e[t.id] = 1, e), {}));
|
|
23
23
|
}, [p, O]), !O) return null;
|
|
@@ -57,7 +57,7 @@ function O({ open: p, product: O, onOpenChange: A, getVariantAvailabilityLabel:
|
|
|
57
57
|
className: "grid gap-4",
|
|
58
58
|
children: [
|
|
59
59
|
/* @__PURE__ */ b("div", {
|
|
60
|
-
className:
|
|
60
|
+
className: w("relative aspect-[1618/1000] overflow-hidden rounded-2xl", K.className),
|
|
61
61
|
style: K.style,
|
|
62
62
|
children: G ? /* @__PURE__ */ b("img", {
|
|
63
63
|
src: G,
|
|
@@ -140,7 +140,7 @@ function O({ open: p, product: O, onOpenChange: A, getVariantAvailabilityLabel:
|
|
|
140
140
|
let n = `storefront-booking-bike-dialog-variant-option-${O.id}-${e.id}`.toLowerCase(), { label: r, description: o } = t(e), s = z[e.id] ?? 1, c = M?.(e.id) === !0, l = j?.(e.id) ?? null;
|
|
141
141
|
return /* @__PURE__ */ x("div", {
|
|
142
142
|
"data-testid": n,
|
|
143
|
-
className:
|
|
143
|
+
className: w("flex flex-col gap-3 rounded-2xl border p-3 sm:flex-row sm:items-center sm:justify-between", "border-slate-200 bg-slate-50"),
|
|
144
144
|
children: [/* @__PURE__ */ x("div", {
|
|
145
145
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
146
146
|
children: [
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Link as n } from "@rpcbase/router";
|
|
3
|
+
import { useTranslation as r } from "react-i18next";
|
|
4
|
+
import { cn as i } from "@rpcbase/ui";
|
|
5
5
|
//#region src/components/BookingFlowSteps/index.tsx
|
|
6
|
-
var a = ({ index:
|
|
6
|
+
var a = ({ index: r, label: a, state: o, href: s }) => {
|
|
7
7
|
let c = /* @__PURE__ */ t("span", {
|
|
8
|
-
className:
|
|
8
|
+
className: i("inline-flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs font-medium sm:text-sm", o === "active" && "border-slate-900 bg-slate-900 text-white", o === "done" && "border-slate-300 bg-white text-slate-900", o === "pending" && "border-slate-200 bg-slate-50 text-slate-500"),
|
|
9
9
|
children: [/* @__PURE__ */ e("span", {
|
|
10
|
-
className:
|
|
11
|
-
children:
|
|
10
|
+
className: i("inline-flex h-5 w-5 items-center justify-center rounded-full text-xs font-semibold", o === "active" && "bg-white/20 text-white", o === "done" && "bg-slate-100 text-slate-800", o === "pending" && "bg-slate-200 text-slate-600"),
|
|
11
|
+
children: r
|
|
12
12
|
}), /* @__PURE__ */ e("span", { children: a })]
|
|
13
13
|
});
|
|
14
|
-
return !s || o === "active" ? c : /* @__PURE__ */ e(
|
|
14
|
+
return !s || o === "active" ? c : /* @__PURE__ */ e(n, {
|
|
15
15
|
to: s,
|
|
16
16
|
className: "inline-flex",
|
|
17
17
|
children: c
|
|
18
18
|
});
|
|
19
|
-
}, o = ({ currentStep: n, bookingPath:
|
|
20
|
-
let { t: c } =
|
|
19
|
+
}, o = ({ currentStep: n, bookingPath: i, checkoutPath: o, checkoutEnabled: s = !0 }) => {
|
|
20
|
+
let { t: c } = r(), l = n === "booking" ? "active" : "done", u = n === "checkout" ? "active" : "pending";
|
|
21
21
|
return /* @__PURE__ */ t("div", {
|
|
22
22
|
className: "flex flex-wrap items-center gap-2",
|
|
23
23
|
children: [
|
|
@@ -25,7 +25,7 @@ var a = ({ index: i, label: a, state: o, href: s }) => {
|
|
|
25
25
|
index: 1,
|
|
26
26
|
label: c("flow_step_booking"),
|
|
27
27
|
state: l,
|
|
28
|
-
href: n === "checkout" ?
|
|
28
|
+
href: n === "checkout" ? i : void 0
|
|
29
29
|
}),
|
|
30
30
|
/* @__PURE__ */ e("span", {
|
|
31
31
|
className: "text-slate-300",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Content as e, Provider as t, Root as n, TooltipTrigger as r } from "../../../ui/tooltip.js";
|
|
2
2
|
import { useBookingPeriod as i } from "../BookingPeriodContext.js";
|
|
3
|
-
import { useMorphingModalWizardOverlayLayer as a } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-
|
|
3
|
+
import { useMorphingModalWizardOverlayLayer as a } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-j1CgFGLe.js";
|
|
4
4
|
import { DayPicker as o } from "../../../ui/day-picker.js";
|
|
5
5
|
import { Label as s } from "../../../ui/label.js";
|
|
6
6
|
import { BookingPeriodFieldErrorMessage as c } from "./BookingPeriodFieldErrorMessage.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CAqJ/B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useBookingPeriod as e } from "../BookingPeriodContext.js";
|
|
2
|
-
import { useMorphingModalWizardOverlayLayer as t } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-
|
|
2
|
+
import { useMorphingModalWizardOverlayLayer as t } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-j1CgFGLe.js";
|
|
3
3
|
import { Label as n } from "../../../ui/label.js";
|
|
4
4
|
import { BookingPeriodFieldErrorMessage as r } from "./BookingPeriodFieldErrorMessage.js";
|
|
5
5
|
import { BookingHourPickerField as i } from "./internal/BookingHourPickerField.js";
|
|
@@ -13,8 +13,8 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
13
13
|
minimumFractionDigits: 0,
|
|
14
14
|
maximumFractionDigits: 0
|
|
15
15
|
}).format(e / 100), f = () => {
|
|
16
|
-
let { labels: f, localeCode: p, currencyCode: m, endTime: h, selectEndTime: g, availableEndTimeSlots: _, endTimeSlotsStatus: v, isEndTimeSelectOpen: y, setIsEndTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w,
|
|
17
|
-
let t = !!
|
|
16
|
+
let { labels: f, localeCode: p, currencyCode: m, endTime: h, selectEndTime: g, availableEndTimeSlots: _, endTimeSlotsStatus: v, isEndTimeSelectOpen: y, setIsEndTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isMobile: T, isHydrated: E, startMinutesValue: D, isSameDaySelection: O, isEndToday: k, earliestMinutesForToday: A } = e(), j = _.map((e) => {
|
|
17
|
+
let t = !!O && D != null && e.startMinutes <= D, n = k && A != null && e.startMinutes < A, r = e.isDisabled || t || n, i = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, a = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, o = e.isDisabled && i ? i : null, u = a && o ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
18
18
|
className: "block",
|
|
19
19
|
children: a
|
|
20
20
|
}), /* @__PURE__ */ c("span", {
|
|
@@ -27,12 +27,12 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
27
27
|
disabled: r,
|
|
28
28
|
description: u
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), M = j.some((e) => !e.disabled), N = v !== "local" && (v !== "ready" || !M), P = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !M ? f.timeSlotsUnavailable : f.endTime, F = j.find((e) => !e.disabled)?.value, I = o(h ?? F ?? null), L = t();
|
|
31
31
|
return a(() => {
|
|
32
|
-
y || (
|
|
32
|
+
y || (I.current = h ?? F ?? null);
|
|
33
33
|
}, [
|
|
34
34
|
h,
|
|
35
|
-
|
|
35
|
+
F,
|
|
36
36
|
y
|
|
37
37
|
]), a(() => {
|
|
38
38
|
let e = document.getElementById("end-time-picker");
|
|
@@ -40,7 +40,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
40
40
|
let t = (e) => {
|
|
41
41
|
if (e.key !== "Enter" || !y) return;
|
|
42
42
|
e.preventDefault(), e.stopPropagation();
|
|
43
|
-
let t =
|
|
43
|
+
let t = I.current ?? h ?? F;
|
|
44
44
|
t && g(t);
|
|
45
45
|
};
|
|
46
46
|
return e.addEventListener("keydown", t, !0), () => {
|
|
@@ -48,7 +48,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
48
48
|
};
|
|
49
49
|
}, [
|
|
50
50
|
h,
|
|
51
|
-
|
|
51
|
+
F,
|
|
52
52
|
y,
|
|
53
53
|
g
|
|
54
54
|
]), /* @__PURE__ */ l("div", {
|
|
@@ -61,23 +61,24 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
61
61
|
}),
|
|
62
62
|
/* @__PURE__ */ c(i, {
|
|
63
63
|
id: "end-time-picker",
|
|
64
|
-
placeholder:
|
|
64
|
+
placeholder: P,
|
|
65
65
|
value: h ?? null,
|
|
66
66
|
onValueUpdate: (e) => {
|
|
67
|
-
e && (
|
|
67
|
+
e && (I.current = e);
|
|
68
68
|
},
|
|
69
69
|
onChange: (e) => {
|
|
70
|
-
e && (
|
|
70
|
+
e && (I.current = e, g(e));
|
|
71
71
|
},
|
|
72
|
-
options:
|
|
73
|
-
|
|
72
|
+
options: j,
|
|
73
|
+
compact: T,
|
|
74
|
+
disabled: N,
|
|
74
75
|
open: y,
|
|
75
76
|
onOpenChange: b,
|
|
76
77
|
triggerTestId: "end-time-trigger",
|
|
77
78
|
contentTestId: "end-time-select-content",
|
|
78
|
-
isHydrated:
|
|
79
|
+
isHydrated: E,
|
|
79
80
|
inputClassName: u(w.endTime && "border-destructive", S, C),
|
|
80
|
-
portalContainer:
|
|
81
|
+
portalContainer: L
|
|
81
82
|
}),
|
|
82
83
|
w.endTime && /* @__PURE__ */ c(r, { children: w.endTime })
|
|
83
84
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useBookingPeriod as e } from "../BookingPeriodContext.js";
|
|
2
|
-
import { useMorphingModalWizardOverlayLayer as t } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-
|
|
2
|
+
import { useMorphingModalWizardOverlayLayer as t } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-j1CgFGLe.js";
|
|
3
3
|
import { DayPicker as n } from "../../../ui/day-picker.js";
|
|
4
4
|
import { Label as r } from "../../../ui/label.js";
|
|
5
5
|
import { BookingPeriodFieldErrorMessage as i } from "./BookingPeriodFieldErrorMessage.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingStartTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingStartTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,+
|
|
1
|
+
{"version":3,"file":"BookingStartTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingStartTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,+CA+IjC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useBookingPeriod as e } from "../BookingPeriodContext.js";
|
|
2
|
-
import { useMorphingModalWizardOverlayLayer as t } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-
|
|
2
|
+
import { useMorphingModalWizardOverlayLayer as t } from "../../../chunks/pkg/ui/dist/MorphingModalWizard-j1CgFGLe.js";
|
|
3
3
|
import { Label as n } from "../../../ui/label.js";
|
|
4
4
|
import { BookingPeriodFieldErrorMessage as r } from "./BookingPeriodFieldErrorMessage.js";
|
|
5
5
|
import { BookingHourPickerField as i } from "./internal/BookingHourPickerField.js";
|
|
@@ -13,8 +13,8 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
13
13
|
minimumFractionDigits: 0,
|
|
14
14
|
maximumFractionDigits: 0
|
|
15
15
|
}).format(e / 100), f = () => {
|
|
16
|
-
let { labels: f, localeCode: p, currencyCode: m, startTime: h, selectStartTime: g, startTimeSlots: _, startTimeSlotsStatus: v, isStartTimeSelectOpen: y, setIsStartTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w,
|
|
17
|
-
let t =
|
|
16
|
+
let { labels: f, localeCode: p, currencyCode: m, startTime: h, selectStartTime: g, startTimeSlots: _, startTimeSlotsStatus: v, isStartTimeSelectOpen: y, setIsStartTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isMobile: T, isHydrated: E, isStartToday: D, earliestMinutesForToday: O } = e(), k = _.map((e) => {
|
|
17
|
+
let t = D && O != null && e.startMinutes < O, n = e.isDisabled || t, r = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, i = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, a = e.isDisabled && r ? r : null, o = i && a ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
|
|
18
18
|
className: "block",
|
|
19
19
|
children: i
|
|
20
20
|
}), /* @__PURE__ */ c("span", {
|
|
@@ -27,11 +27,11 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
27
27
|
disabled: n,
|
|
28
28
|
description: o
|
|
29
29
|
};
|
|
30
|
-
}),
|
|
30
|
+
}), A = k.some((e) => !e.disabled), j = v !== "local" && (v !== "ready" || !A), M = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !A ? f.timeSlotsUnavailable : f.startTime, N = k.find((e) => !e.disabled)?.value, P = o(h ?? N ?? null), F = t();
|
|
31
31
|
return a(() => {
|
|
32
|
-
y || (
|
|
32
|
+
y || (P.current = h ?? N ?? null);
|
|
33
33
|
}, [
|
|
34
|
-
|
|
34
|
+
N,
|
|
35
35
|
y,
|
|
36
36
|
h
|
|
37
37
|
]), a(() => {
|
|
@@ -41,14 +41,14 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
41
41
|
let t = (e) => {
|
|
42
42
|
if (e.key !== "Enter" || !y) return;
|
|
43
43
|
e.preventDefault(), e.stopPropagation();
|
|
44
|
-
let t =
|
|
44
|
+
let t = P.current ?? h ?? N;
|
|
45
45
|
t && g(t);
|
|
46
46
|
};
|
|
47
47
|
return e.addEventListener("keydown", t, !0), () => {
|
|
48
48
|
e.removeEventListener("keydown", t, !0);
|
|
49
49
|
};
|
|
50
50
|
}, [
|
|
51
|
-
|
|
51
|
+
N,
|
|
52
52
|
y,
|
|
53
53
|
g,
|
|
54
54
|
h
|
|
@@ -62,23 +62,24 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
62
62
|
}),
|
|
63
63
|
/* @__PURE__ */ c(i, {
|
|
64
64
|
id: "start-time-picker",
|
|
65
|
-
placeholder:
|
|
65
|
+
placeholder: M,
|
|
66
66
|
value: h ?? null,
|
|
67
67
|
onValueUpdate: (e) => {
|
|
68
|
-
e && (
|
|
68
|
+
e && (P.current = e);
|
|
69
69
|
},
|
|
70
70
|
onChange: (e) => {
|
|
71
|
-
e && (
|
|
71
|
+
e && (P.current = e, g(e));
|
|
72
72
|
},
|
|
73
|
-
options:
|
|
74
|
-
|
|
73
|
+
options: k,
|
|
74
|
+
compact: T,
|
|
75
|
+
disabled: j,
|
|
75
76
|
open: y,
|
|
76
77
|
onOpenChange: b,
|
|
77
78
|
triggerTestId: "start-time-trigger",
|
|
78
79
|
contentTestId: "start-time-select-content",
|
|
79
|
-
isHydrated:
|
|
80
|
+
isHydrated: E,
|
|
80
81
|
inputClassName: u(w.startTime && "border-destructive", S, C),
|
|
81
|
-
portalContainer:
|
|
82
|
+
portalContainer: F
|
|
82
83
|
}),
|
|
83
84
|
w.startTime && /* @__PURE__ */ c(r, { children: w.startTime })
|
|
84
85
|
]
|
package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BookingHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,KAAK,2BAA2B,GAAG,oBAAoB,GAAG;IACxD,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,mEAMpC,2BAA2B,4CAmB7B,CAAA"}
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as e } from "../../../../lib/utils.js";
|
|
2
|
+
import { HourPickerField as t } from "./StorefrontHourPickerField.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx
|
|
5
|
-
var
|
|
6
|
-
let
|
|
5
|
+
var r = ({ options: r, className: i, inputClassName: a, portalContainer: o, ...s }) => {
|
|
6
|
+
let c = r.map((e) => ({
|
|
7
7
|
...e,
|
|
8
|
-
selectedLabel: /* @__PURE__ */
|
|
9
|
-
"data-slot": "booking-hour-picker-mobile-selected-label",
|
|
10
|
-
className: "md:hidden",
|
|
11
|
-
children: e.value
|
|
12
|
-
}), /* @__PURE__ */ n("span", {
|
|
8
|
+
selectedLabel: /* @__PURE__ */ n("span", {
|
|
13
9
|
"data-slot": "booking-hour-picker-desktop-selected-label",
|
|
14
|
-
className: "hidden md:inline",
|
|
15
10
|
children: e.label
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
}),
|
|
12
|
+
compactSelectedLabel: /* @__PURE__ */ n("span", {
|
|
13
|
+
"data-slot": "booking-hour-picker-mobile-selected-label",
|
|
14
|
+
children: e.value
|
|
15
|
+
})
|
|
16
|
+
}));
|
|
17
|
+
return /* @__PURE__ */ n(t, {
|
|
18
|
+
...s,
|
|
19
|
+
options: c,
|
|
20
|
+
className: e("w-full min-w-0", i),
|
|
21
|
+
inputClassName: e("min-w-0", a),
|
|
22
|
+
portalContainer: o
|
|
23
|
+
});
|
|
27
24
|
};
|
|
28
25
|
//#endregion
|
|
29
|
-
export {
|
|
26
|
+
export { r as BookingHourPickerField };
|
package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type HourPickerOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
selectedLabel?: React.ReactNode;
|
|
6
|
+
compactSelectedLabel?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type HourPickerInputProps = {
|
|
11
|
+
id?: string;
|
|
12
|
+
value: string | null;
|
|
13
|
+
onChange: (value: string | null) => void;
|
|
14
|
+
onValueUpdate?: (value: string | null) => void;
|
|
15
|
+
options: HourPickerOption[];
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
inputClassName?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
open?: boolean;
|
|
22
|
+
onOpenChange?: (open: boolean) => void;
|
|
23
|
+
triggerTestId?: string;
|
|
24
|
+
contentTestId?: string;
|
|
25
|
+
isHydrated?: boolean;
|
|
26
|
+
portalContainer?: HTMLElement | null;
|
|
27
|
+
};
|
|
28
|
+
export declare function HourPickerInput({ id, value, onChange, onValueUpdate, options, placeholder, className, inputClassName, disabled, readOnly, open: openProp, onOpenChange, triggerTestId, contentTestId, isHydrated, portalContainer, }: HourPickerInputProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare namespace HourPickerInput {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
export type HourPickerFieldProps = HourPickerInputProps & {
|
|
33
|
+
compact?: boolean;
|
|
34
|
+
};
|
|
35
|
+
export declare function HourPickerField({ compact, ...props }: HourPickerFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare namespace HourPickerField {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=StorefrontHourPickerField.d.ts.map
|
package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorefrontHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC9B,CAAA;AAyYD,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAO,EACP,WAA2B,EAC3B,SAAS,EACT,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,GAChB,EAAE,oBAAoB,2CA6ctB;yBA9de,eAAe;;;AAke/B,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,GAAG;IACxD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AA6YD,wBAAgB,eAAe,CAAC,EAAE,OAAe,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,2CAMlF;yBANe,eAAe"}
|