@loczer/storefront-sdk 0.211.0 → 0.213.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 +5 -5
- package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -1
- package/dist/components/BookingBikeVariantDialog/index.js +5 -4
- package/dist/components/BookingFlowSteps/index.d.ts.map +1 -1
- package/dist/components/BookingFlowSteps/index.js +73 -32
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +16 -16
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +2 -2
- package/dist/components/BookingPeriodSelector/index.js +3 -3
- package/dist/components/FulfillmentSection/index.js +10 -4
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +205 -100
- package/dist/components/Layout/index.js +2 -2
- package/dist/components/ProductPriceBadge/index.js +16 -10
- package/dist/i18n/en.d.ts +7 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +7 -1
- package/dist/i18n/fr.d.ts +7 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +7 -1
- package/dist/index.d.ts +24 -4
- package/dist/lib/cart.d.ts +6 -2
- package/dist/lib/cart.d.ts.map +1 -1
- package/dist/lib/cart.js +45 -23
- package/dist/lib/checkoutSubmit.d.ts +3 -0
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +14 -2
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +7 -2
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +235 -245
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +252 -235
- 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,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,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,SAAS,EACT,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,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,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,SAAS,EACT,WAAW,EACX,uBAAuB,EACvB,cAA8B,EAC9B,QAAQ,EACR,cAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,OAAmB,EACnB,MAAM,GACP,EAAE,oBAAoB,2CAuFtB"}
|
|
@@ -13,14 +13,14 @@ import { ArrowRight as f, Bike as p, Plus as m } from "lucide-react";
|
|
|
13
13
|
function h({ bike: h, className: g, detailsPath: _, productDetailsLinkState: v, actionLabelKey: y = "product_cta", onAction: b, actionDisabled: x = !1, availabilityLabel: S, fallbackLanguage: C, variant: w = "default", testId: T }) {
|
|
14
14
|
let { t: E, i18n: D } = u(), O = e(h.name, D.language, C), k = e(h.description, D.language, C), A = typeof h.images?.[0] == "string" ? h.images[0].trim() : "", j = a(h.primaryImageStyle), M = t(h.availabilityStatus), N = w === "booking", P = h.availabilityStatus === "OUT_OF_STOCK";
|
|
15
15
|
return /* @__PURE__ */ c("div", {
|
|
16
|
-
className: d("flex h-full flex-col gap-
|
|
16
|
+
className: d("flex h-full min-w-0 flex-col gap-3 rounded-xl border border-slate-200 bg-white p-3 shadow-sm", g),
|
|
17
17
|
"data-testid": T,
|
|
18
18
|
children: [/* @__PURE__ */ c("div", {
|
|
19
|
-
className: "flex flex-1 items-stretch gap-4",
|
|
19
|
+
className: "flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-stretch sm:gap-4",
|
|
20
20
|
children: [/* @__PURE__ */ s("div", {
|
|
21
|
-
className: "w-
|
|
21
|
+
className: "w-full min-w-0 sm:w-28 sm:shrink-0",
|
|
22
22
|
children: /* @__PURE__ */ c("div", {
|
|
23
|
-
className: d("relative
|
|
23
|
+
className: d("relative aspect-[1618/1000] min-h-20 overflow-hidden rounded-xl sm:h-full sm:aspect-auto", j.className),
|
|
24
24
|
style: j.style,
|
|
25
25
|
children: [A ? /* @__PURE__ */ s("img", {
|
|
26
26
|
src: A,
|
|
@@ -48,7 +48,7 @@ function h({ bike: h, className: g, detailsPath: _, productDetailsLinkState: v,
|
|
|
48
48
|
}),
|
|
49
49
|
/* @__PURE__ */ s(i, {
|
|
50
50
|
prices: h.prices,
|
|
51
|
-
className: "self-start"
|
|
51
|
+
className: "max-w-full self-start"
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ s("p", {
|
|
54
54
|
className: "line-clamp-2 text-xs text-slate-600",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BookingBikeVariantDialog/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAiB3D,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,kBAAkB,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,CAAA;CAChE,CAAA;AAWD,KAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,iCAAiC,GAAG,IAAI,CAAA;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,2BAA2B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IAClE,sBAAsB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;IACvD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5D,CAAA;AAED,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,2BAA2B,EAC3B,sBAAsB,EACtB,WAAmB,EACnB,YAAY,GACb,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BookingBikeVariantDialog/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAiB3D,KAAK,iCAAiC,GAAG,iBAAiB,GAAG;IAC3D,kBAAkB,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,CAAA;CAChE,CAAA;AAWD,KAAK,6BAA6B,GAAG;IACnC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,iCAAiC,GAAG,IAAI,CAAA;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,2BAA2B,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAA;IAClE,sBAAsB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAA;IACvD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5D,CAAA;AAED,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,2BAA2B,EAC3B,sBAAsB,EACtB,WAAmB,EACnB,YAAY,GACb,EAAE,6BAA6B,kDAkO/B"}
|
|
@@ -153,7 +153,7 @@ function j({ open: h, product: j, onOpenChange: N, getVariantAvailabilityLabel:
|
|
|
153
153
|
let r = `storefront-booking-bike-dialog-variant-option-${j.id}-${e.id}`.toLowerCase(), { label: i, description: s } = t(e), c = n(e), l = H[e.id] ?? "1", u = F?.(e.id) === !0, d = P?.(e.id) ?? null;
|
|
154
154
|
return /* @__PURE__ */ S("div", {
|
|
155
155
|
"data-testid": r,
|
|
156
|
-
className: T("flex
|
|
156
|
+
className: T("flex items-center justify-between gap-2 rounded-2xl border px-3 py-2.5", "border-slate-200 bg-slate-50"),
|
|
157
157
|
children: [/* @__PURE__ */ S("div", {
|
|
158
158
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
159
159
|
children: [
|
|
@@ -181,7 +181,7 @@ function j({ open: h, product: j, onOpenChange: N, getVariantAvailabilityLabel:
|
|
|
181
181
|
}) : null
|
|
182
182
|
]
|
|
183
183
|
}), /* @__PURE__ */ S("div", {
|
|
184
|
-
className: "flex
|
|
184
|
+
className: "flex shrink-0 items-center gap-2",
|
|
185
185
|
children: [/* @__PURE__ */ x(M, {
|
|
186
186
|
quantity: l,
|
|
187
187
|
ariaLabel: R("quantity_label"),
|
|
@@ -189,7 +189,8 @@ function j({ open: h, product: j, onOpenChange: N, getVariantAvailabilityLabel:
|
|
|
189
189
|
testIdPrefix: `storefront-booking-bike-dialog-variant-quantity-${j.id}-${e.id}`.toLowerCase()
|
|
190
190
|
}), /* @__PURE__ */ S(o, {
|
|
191
191
|
type: "button",
|
|
192
|
-
|
|
192
|
+
size: "sm",
|
|
193
|
+
className: "shrink-0 gap-1.5 rounded-xl px-3",
|
|
193
194
|
"data-testid": `storefront-booking-bike-dialog-variant-add-${j.id}-${e.id}`.toLowerCase(),
|
|
194
195
|
disabled: I,
|
|
195
196
|
onClick: () => {
|
|
@@ -236,7 +237,7 @@ function M({ ariaLabel: e, onQuantityChange: t, quantity: n, testIdPrefix: r })
|
|
|
236
237
|
t(n ? String(A(n)) : "");
|
|
237
238
|
},
|
|
238
239
|
onBlur: () => t(String(A(n))),
|
|
239
|
-
className: "h-9 w-
|
|
240
|
+
className: "h-9 w-12 text-center sm:w-16",
|
|
240
241
|
"aria-label": e,
|
|
241
242
|
"data-testid": `${r}-value`
|
|
242
243
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BookingFlowSteps/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/BookingFlowSteps/index.tsx"],"names":[],"mappings":"AAMA,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,SAAS,GAAG,UAAU,CAAA;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AA4CD,eAAO,MAAM,gBAAgB,GAAI,6DAAoE,qBAAqB,4CAuFzH,CAAA"}
|
|
@@ -1,45 +1,86 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useEffect as e, useRef as t, useState as n } from "react";
|
|
2
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
3
|
+
import { Link as a } from "@rpcbase/router";
|
|
4
|
+
import { useTranslation as o } from "react-i18next";
|
|
5
|
+
import { cn as s } from "@rpcbase/ui";
|
|
5
6
|
//#region src/components/BookingFlowSteps/index.tsx
|
|
6
|
-
var
|
|
7
|
-
let c = /* @__PURE__ */
|
|
8
|
-
className:
|
|
9
|
-
children: [/* @__PURE__ */
|
|
10
|
-
className:
|
|
11
|
-
children:
|
|
12
|
-
}), /* @__PURE__ */
|
|
7
|
+
var c = ({ index: e, label: t, state: n, href: o }) => {
|
|
8
|
+
let c = /* @__PURE__ */ i("span", {
|
|
9
|
+
className: s("inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-full border px-3 py-1.5 text-xs font-medium sm:text-sm", n === "active" && "border-slate-900 bg-slate-900 text-white", n === "done" && "border-slate-300 bg-white text-slate-900", n === "pending" && "border-slate-200 bg-slate-50 text-slate-500"),
|
|
10
|
+
children: [/* @__PURE__ */ r("span", {
|
|
11
|
+
className: s("inline-flex h-5 w-5 items-center justify-center rounded-full text-xs font-semibold", n === "active" && "bg-white/20 text-white", n === "done" && "bg-slate-100 text-slate-800", n === "pending" && "bg-slate-200 text-slate-600"),
|
|
12
|
+
children: e
|
|
13
|
+
}), /* @__PURE__ */ r("span", { children: t })]
|
|
13
14
|
});
|
|
14
|
-
return !
|
|
15
|
-
to:
|
|
16
|
-
className: "inline-flex",
|
|
15
|
+
return !o || n === "active" ? c : /* @__PURE__ */ r(a, {
|
|
16
|
+
to: o,
|
|
17
|
+
className: "inline-flex shrink-0",
|
|
17
18
|
children: c
|
|
18
19
|
});
|
|
19
|
-
},
|
|
20
|
-
let { t:
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
}, l = ({ currentStep: a, bookingPath: l, checkoutPath: u, checkoutEnabled: d = !0 }) => {
|
|
21
|
+
let { t: f } = o(), p = a === "booking" ? "active" : "done", m = a === "checkout" ? "active" : "pending", h = t(null), g = t(null), [_, v] = n({
|
|
22
|
+
left: !1,
|
|
23
|
+
right: !1
|
|
24
|
+
});
|
|
25
|
+
return e(() => {
|
|
26
|
+
let e = h.current, t = g.current;
|
|
27
|
+
if (!e || !t) return;
|
|
28
|
+
e.scrollLeft = a === "checkout" ? e.scrollWidth - e.clientWidth : 0;
|
|
29
|
+
let n = () => {
|
|
30
|
+
let t = Math.max(0, e.scrollWidth - e.clientWidth), n = {
|
|
31
|
+
left: e.scrollLeft > 1,
|
|
32
|
+
right: e.scrollLeft < t - 1
|
|
33
|
+
};
|
|
34
|
+
v((e) => e.left === n.left && e.right === n.right ? e : n);
|
|
35
|
+
};
|
|
36
|
+
n(), e.addEventListener("scroll", n, { passive: !0 });
|
|
37
|
+
let r = new ResizeObserver(n);
|
|
38
|
+
return r.observe(e), r.observe(t), () => {
|
|
39
|
+
e.removeEventListener("scroll", n), r.disconnect();
|
|
40
|
+
};
|
|
41
|
+
}, [a]), /* @__PURE__ */ i("div", {
|
|
42
|
+
className: "relative w-full min-w-0 max-w-full",
|
|
23
43
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
/* @__PURE__ */ r("div", {
|
|
45
|
+
ref: h,
|
|
46
|
+
className: "w-full max-w-full touch-pan-x overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-smooth [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
47
|
+
"data-testid": "booking-flow-steps-scroll",
|
|
48
|
+
children: /* @__PURE__ */ i("div", {
|
|
49
|
+
ref: g,
|
|
50
|
+
className: "flex w-max min-w-full flex-nowrap items-center gap-2",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ r(c, {
|
|
53
|
+
index: 1,
|
|
54
|
+
label: f("flow_step_booking"),
|
|
55
|
+
state: p,
|
|
56
|
+
href: a === "checkout" ? l : void 0
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ r("span", {
|
|
59
|
+
className: "shrink-0 text-slate-300",
|
|
60
|
+
"aria-hidden": "true",
|
|
61
|
+
children: "/"
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ r(c, {
|
|
64
|
+
index: 2,
|
|
65
|
+
label: f("flow_step_checkout"),
|
|
66
|
+
state: m,
|
|
67
|
+
href: a === "booking" && d ? u : void 0
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
})
|
|
29
71
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
className: "text-slate-300",
|
|
72
|
+
/* @__PURE__ */ r("span", {
|
|
32
73
|
"aria-hidden": "true",
|
|
33
|
-
|
|
74
|
+
"data-testid": "booking-flow-steps-fade-left",
|
|
75
|
+
className: s("pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-background to-transparent transition-opacity", _.left ? "opacity-100" : "opacity-0")
|
|
34
76
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
href: n === "booking" && s ? o : void 0
|
|
77
|
+
/* @__PURE__ */ r("span", {
|
|
78
|
+
"aria-hidden": "true",
|
|
79
|
+
"data-testid": "booking-flow-steps-fade-right",
|
|
80
|
+
className: s("pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-background to-transparent transition-opacity", _.right ? "opacity-100" : "opacity-0")
|
|
40
81
|
})
|
|
41
82
|
]
|
|
42
83
|
});
|
|
43
84
|
};
|
|
44
85
|
//#endregion
|
|
45
|
-
export {
|
|
86
|
+
export { l as BookingFlowSteps };
|
|
@@ -241,7 +241,7 @@ var A = () => {
|
|
|
241
241
|
B && f(!0);
|
|
242
242
|
};
|
|
243
243
|
return /* @__PURE__ */ _("div", {
|
|
244
|
-
className: y("group/form-item relative
|
|
244
|
+
className: y("group/form-item relative min-w-0 w-full", B && "cursor-pointer rounded-md"),
|
|
245
245
|
onPointerDownCapture: $,
|
|
246
246
|
onClick: $,
|
|
247
247
|
children: [
|
|
@@ -52,7 +52,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
52
52
|
y,
|
|
53
53
|
g
|
|
54
54
|
]), /* @__PURE__ */ l("div", {
|
|
55
|
-
className: "group/form-item relative
|
|
55
|
+
className: "group/form-item relative w-full min-w-0",
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ c(n, {
|
|
58
58
|
htmlFor: "end-time-picker",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button as e, buttonVariants as t } from "../../../ui/button.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Drawer as n, DrawerContent as r, DrawerHeader as i, DrawerTitle as a } from "../../../ui/drawer.js";
|
|
3
|
+
import { useBookingPeriod as o } from "../BookingPeriodContext.js";
|
|
4
|
+
import { DayPicker as s } from "../../../ui/day-picker.js";
|
|
5
5
|
import { BookingTimeSlotsStatus as c } from "./BookingTimeSlotsStatus.js";
|
|
6
6
|
import { addMonths as l, differenceInCalendarDays as u, endOfMonth as d, isSameDay as f, startOfMonth as p } from "date-fns";
|
|
7
7
|
import { useEffect as m, useRef as h, useState as g } from "react";
|
|
@@ -29,7 +29,7 @@ var x = b, S = 1, C = y(t({ variant: "outline" }), "z-10 h-11 w-11 bg-background
|
|
|
29
29
|
}, D = (e, t, n) => e ? f(e, d(e)) ? l(p(e), 1) : p(e) : p(t ?? n), O = (e) => {
|
|
30
30
|
if (!(!e || !f(e, d(e)))) return l(p(e), 1);
|
|
31
31
|
}, k = () => {
|
|
32
|
-
let { labels: t, startDate: l, endDate: d, selectStartDate: b, selectEndDate: C, isStartDatePopoverOpen: k, setIsStartDatePopoverOpen: A, isEndDatePopoverOpen: j, setIsEndDatePopoverOpen: M, resetHoveredEndDate: N, dateLocale: P, isMobile: F, withMobileDateDrawer: I, minSelectableDate: L, canCommitTimeSlots: R } =
|
|
32
|
+
let { labels: t, startDate: l, endDate: d, selectStartDate: b, selectEndDate: C, isStartDatePopoverOpen: k, setIsStartDatePopoverOpen: A, isEndDatePopoverOpen: j, setIsEndDatePopoverOpen: M, resetHoveredEndDate: N, dateLocale: P, isMobile: F, withMobileDateDrawer: I, minSelectableDate: L, canCommitTimeSlots: R } = o(), z = I && F && (k || j), B = j && !k ? "end" : "start", V = T(L), H = T(D(l, d, L)), [U, W] = g(() => p(L)), [G, K] = g(() => E(H)), q = h(!0), J = h(!1), Y = l && (d ?? l) >= l ? u(d ?? l, l) + 1 : null, X = d ?? l;
|
|
33
33
|
if (m(() => {
|
|
34
34
|
!z || B !== "start" || W(p(L));
|
|
35
35
|
}, [
|
|
@@ -66,19 +66,19 @@ var x = b, S = 1, C = y(t({ variant: "outline" }), "z-10 h-11 w-11 bg-background
|
|
|
66
66
|
}, Q = () => {
|
|
67
67
|
A(!1), M(!1), N();
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */ _(
|
|
69
|
+
return /* @__PURE__ */ _(n, {
|
|
70
70
|
open: z,
|
|
71
71
|
lockScroll: !1,
|
|
72
72
|
onOpenChange: (e) => {
|
|
73
73
|
e || Q();
|
|
74
74
|
},
|
|
75
|
-
children: /* @__PURE__ */ v(
|
|
75
|
+
children: /* @__PURE__ */ v(r, {
|
|
76
76
|
className: "overflow-hidden",
|
|
77
77
|
closeLabel: t.closeDrawer,
|
|
78
78
|
showCloseButton: !0,
|
|
79
|
-
children: [/* @__PURE__ */ v(
|
|
80
|
-
className: "border-b
|
|
81
|
-
children: [/* @__PURE__ */ _(
|
|
79
|
+
children: [/* @__PURE__ */ v(i, {
|
|
80
|
+
className: "border-b pb-3 pl-4 pr-16 pt-4 text-left",
|
|
81
|
+
children: [/* @__PURE__ */ _(a, {
|
|
82
82
|
className: "sr-only",
|
|
83
83
|
children: B === "start" ? t.startDate : t.endDate
|
|
84
84
|
}), /* @__PURE__ */ v("div", {
|
|
@@ -92,28 +92,28 @@ var x = b, S = 1, C = y(t({ variant: "outline" }), "z-10 h-11 w-11 bg-background
|
|
|
92
92
|
/* @__PURE__ */ _("button", {
|
|
93
93
|
type: "button",
|
|
94
94
|
"aria-pressed": B === "start",
|
|
95
|
-
className: y("relative z-10 h-9 rounded px-
|
|
95
|
+
className: y("relative z-10 h-9 rounded px-2 text-xs font-medium transition-colors min-[360px]:text-sm", B === "start" ? "text-foreground" : "text-muted-foreground"),
|
|
96
96
|
onClick: () => Z("start"),
|
|
97
97
|
children: t.startDate
|
|
98
98
|
}),
|
|
99
99
|
/* @__PURE__ */ _("button", {
|
|
100
100
|
type: "button",
|
|
101
101
|
"aria-pressed": B === "end",
|
|
102
|
-
className: y("relative z-10 h-9 rounded px-
|
|
102
|
+
className: y("relative z-10 h-9 rounded px-2 text-xs font-medium transition-colors min-[360px]:text-sm", B === "end" ? "text-foreground" : "text-muted-foreground"),
|
|
103
103
|
onClick: () => Z("end"),
|
|
104
104
|
children: t.endDate
|
|
105
105
|
})
|
|
106
106
|
]
|
|
107
107
|
})]
|
|
108
108
|
}), /* @__PURE__ */ _("div", {
|
|
109
|
-
className: "overflow-
|
|
109
|
+
className: "overflow-clip px-4 py-4",
|
|
110
110
|
children: /* @__PURE__ */ v("div", {
|
|
111
111
|
className: y("flex w-[200%] transition-transform duration-300 ease-out", B === "end" && "-translate-x-1/2"),
|
|
112
112
|
children: [/* @__PURE__ */ _("section", {
|
|
113
113
|
className: "max-h-[calc(95dvh-9rem)] w-1/2 shrink-0 overflow-y-auto pr-4",
|
|
114
114
|
children: /* @__PURE__ */ v("div", {
|
|
115
115
|
className: "flex flex-col gap-4",
|
|
116
|
-
children: [/* @__PURE__ */ _(
|
|
116
|
+
children: [/* @__PURE__ */ _(s, {
|
|
117
117
|
id: "start-date-calendar",
|
|
118
118
|
mode: "single",
|
|
119
119
|
locale: P,
|
|
@@ -134,7 +134,7 @@ var x = b, S = 1, C = y(t({ variant: "outline" }), "z-10 h-11 w-11 bg-background
|
|
|
134
134
|
commit: !1
|
|
135
135
|
});
|
|
136
136
|
},
|
|
137
|
-
autoFocus:
|
|
137
|
+
autoFocus: B === "start",
|
|
138
138
|
"data-testid": "start-date-calendar",
|
|
139
139
|
className: "w-full p-0",
|
|
140
140
|
classNames: w
|
|
@@ -154,7 +154,7 @@ var x = b, S = 1, C = y(t({ variant: "outline" }), "z-10 h-11 w-11 bg-background
|
|
|
154
154
|
children: /* @__PURE__ */ v("div", {
|
|
155
155
|
className: "flex flex-col gap-4",
|
|
156
156
|
children: [
|
|
157
|
-
/* @__PURE__ */ _(
|
|
157
|
+
/* @__PURE__ */ _(s, {
|
|
158
158
|
id: "end-date-calendar",
|
|
159
159
|
mode: "range",
|
|
160
160
|
locale: P,
|
|
@@ -173,7 +173,7 @@ var x = b, S = 1, C = y(t({ variant: "outline" }), "z-10 h-11 w-11 bg-background
|
|
|
173
173
|
commit: !1
|
|
174
174
|
});
|
|
175
175
|
},
|
|
176
|
-
autoFocus:
|
|
176
|
+
autoFocus: B === "end",
|
|
177
177
|
"data-testid": "end-date-calendar",
|
|
178
178
|
className: "w-full p-0",
|
|
179
179
|
classNames: w,
|
|
@@ -74,7 +74,7 @@ var h = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), g = (e) =>
|
|
|
74
74
|
I && w(!0);
|
|
75
75
|
};
|
|
76
76
|
return /* @__PURE__ */ u("div", {
|
|
77
|
-
className: f("group/form-item relative
|
|
77
|
+
className: f("group/form-item relative min-w-0 w-full", I && "cursor-pointer rounded-md"),
|
|
78
78
|
onPointerDownCapture: W,
|
|
79
79
|
onClick: W,
|
|
80
80
|
children: [
|
|
@@ -53,7 +53,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
|
|
|
53
53
|
g,
|
|
54
54
|
h
|
|
55
55
|
]), /* @__PURE__ */ l("div", {
|
|
56
|
-
className: "group/form-item relative
|
|
56
|
+
className: "group/form-item relative w-full min-w-0",
|
|
57
57
|
children: [
|
|
58
58
|
/* @__PURE__ */ c(n, {
|
|
59
59
|
htmlFor: "start-time-picker",
|
package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js
CHANGED
|
@@ -516,7 +516,7 @@ function E({ id: s, value: l, onChange: u, onValueUpdate: d, options: f, placeho
|
|
|
516
516
|
disabled: v,
|
|
517
517
|
"data-testid": E,
|
|
518
518
|
"data-hydrated": O ? "true" : void 0,
|
|
519
|
-
className: e("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-
|
|
519
|
+
className: e("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", !l && "text-muted-foreground", H && "ring-2 ring-primary ring-offset-2", _),
|
|
520
520
|
onClick: () => {
|
|
521
521
|
v || y || U(!H);
|
|
522
522
|
},
|
|
@@ -583,7 +583,7 @@ function E({ id: s, value: l, onChange: u, onValueUpdate: d, options: f, placeho
|
|
|
583
583
|
"data-value": t.value,
|
|
584
584
|
"data-state": o ? "checked" : "unchecked",
|
|
585
585
|
"data-disabled": t.disabled ? "" : void 0,
|
|
586
|
-
className: e("relative flex w-full select-none items-center justify-center rounded-sm px-2 py-
|
|
586
|
+
className: e("relative flex min-h-11 w-full cursor-pointer select-none items-center justify-center rounded-sm px-2 py-2 text-center text-base outline-none", t.disabled && "pointer-events-none opacity-50", s && "bg-accent text-accent-foreground"),
|
|
587
587
|
onMouseDown: (e) => {
|
|
588
588
|
e.preventDefault();
|
|
589
589
|
},
|
|
@@ -11,14 +11,14 @@ import { cn as d } from "@rpcbase/ui";
|
|
|
11
11
|
var f = ({ className: t, ...f }) => /* @__PURE__ */ l(e, {
|
|
12
12
|
...f,
|
|
13
13
|
children: /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("div", {
|
|
14
|
-
className: d("grid grid-cols-1 gap-x-6 gap-y-4 md:grid-cols-2", t),
|
|
14
|
+
className: d("grid min-w-0 grid-cols-1 gap-x-6 gap-y-4 md:grid-cols-2", t),
|
|
15
15
|
children: [
|
|
16
16
|
/* @__PURE__ */ u("div", {
|
|
17
|
-
className: "
|
|
17
|
+
className: "grid min-w-0 grid-cols-1 items-start gap-3 sm:grid-cols-[minmax(0,1fr)_150px]",
|
|
18
18
|
children: [/* @__PURE__ */ l(n, {}), /* @__PURE__ */ l(r, {})]
|
|
19
19
|
}),
|
|
20
20
|
/* @__PURE__ */ u("div", {
|
|
21
|
-
className: "
|
|
21
|
+
className: "grid min-w-0 grid-cols-1 items-start gap-3 sm:grid-cols-[minmax(0,1fr)_150px]",
|
|
22
22
|
children: [/* @__PURE__ */ l(i, {}), /* @__PURE__ */ l(a, {})]
|
|
23
23
|
}),
|
|
24
24
|
/* @__PURE__ */ l(s, {})
|
|
@@ -31,13 +31,16 @@ function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, d
|
|
|
31
31
|
"aria-hidden": "true"
|
|
32
32
|
}),
|
|
33
33
|
/* @__PURE__ */ i("span", {
|
|
34
|
-
className: "flex flex-1 flex-col gap-0.5",
|
|
34
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
35
35
|
children: [/* @__PURE__ */ r("span", {
|
|
36
36
|
className: "text-sm font-medium text-slate-950",
|
|
37
37
|
children: E("booking_pickup_label")
|
|
38
38
|
}), /* @__PURE__ */ r("span", {
|
|
39
39
|
className: o("text-xs text-slate-600", O && "text-destructive"),
|
|
40
|
-
children:
|
|
40
|
+
children: /* @__PURE__ */ r("span", {
|
|
41
|
+
className: "break-words",
|
|
42
|
+
children: k
|
|
43
|
+
})
|
|
41
44
|
})]
|
|
42
45
|
})
|
|
43
46
|
]
|
|
@@ -57,7 +60,7 @@ function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, d
|
|
|
57
60
|
"aria-hidden": "true"
|
|
58
61
|
}),
|
|
59
62
|
/* @__PURE__ */ i("span", {
|
|
60
|
-
className: "flex flex-1 flex-col gap-0.5",
|
|
63
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
61
64
|
children: [/* @__PURE__ */ r("span", {
|
|
62
65
|
className: "text-sm font-medium text-slate-950",
|
|
63
66
|
children: E("booking_delivery_label")
|
|
@@ -87,7 +90,10 @@ function u({ value: u, onValueChange: d, pickupAddress: f, deliveryEnabled: p, d
|
|
|
87
90
|
children: [/* @__PURE__ */ r(s, {
|
|
88
91
|
className: o("h-4 w-4 shrink-0 text-slate-900", O && "text-destructive"),
|
|
89
92
|
"aria-hidden": "true"
|
|
90
|
-
}), /* @__PURE__ */ r("span", {
|
|
93
|
+
}), /* @__PURE__ */ r("span", {
|
|
94
|
+
className: "min-w-0 break-words",
|
|
95
|
+
children: k
|
|
96
|
+
})]
|
|
91
97
|
}) : null;
|
|
92
98
|
}
|
|
93
99
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAMtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CA4PlG"}
|