@loczer/storefront-sdk 0.157.0 → 0.158.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.
@@ -1 +1 @@
1
- {"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAsEA,eAAO,MAAM,mBAAmB,+CA0iB/B,CAAA"}
1
+ {"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAqJA,eAAO,MAAM,mBAAmB,+CA6hB/B,CAAA"}
@@ -1,87 +1,129 @@
1
- import { jsxs as J, jsx as s } from "react/jsx-runtime";
2
- import { differenceInCalendarDays as ue } from "date-fns";
3
- import { useRef as S, useState as O, useEffect as E, useMemo as Q } from "react";
4
- import { cn as b, DayPickerField as le } from "@rpcbase/ui";
5
- import { useMorphingModalWizardOverlayLayer as fe } from "../../../chunks/ui/dist/MorphingModalWizard-D7hc-dDP.js";
6
- import { DayPicker as me } from "../../../ui/day-picker.js";
7
- import { Label as pe } from "../../../ui/label.js";
8
- import { Root as ye, TooltipTrigger as Ee, Content as he, Provider as ge } from "../../../ui/tooltip.js";
9
- import { useBookingPeriod as De } from "../BookingPeriodContext.js";
10
- import { BookingPeriodFieldErrorMessage as be } from "./BookingPeriodFieldErrorMessage.js";
11
- import { ModalDayPickerField as ve } from "./internal/ModalDayPickerField.js";
12
- const X = (o) => String(o).padStart(2, "0"), x = (o) => `${o.getFullYear()}-${X(o.getMonth() + 1)}-${X(o.getDate())}`, H = (o) => o.getFullYear() * 12 + o.getMonth(), te = (o) => new Date(Math.floor(o / 12), o % 12, 1), C = (o) => te(H(o)), Z = (o, i, a) => {
13
- const g = H(o), d = H(i), f = Math.max(0, a - 1), v = g + f;
14
- if (d < g)
15
- return C(i);
16
- if (d > v) {
17
- const u = d - f;
18
- return u === g ? o : te(u);
1
+ import { jsxs as te, jsx as s } from "react/jsx-runtime";
2
+ import { differenceInCalendarDays as pe } from "date-fns";
3
+ import { createContext as ye, useRef as F, useState as Y, useEffect as h, useContext as De } from "react";
4
+ import { cn as k, DayPickerField as Ee } from "@rpcbase/ui";
5
+ import { useMorphingModalWizardOverlayLayer as he } from "../../../chunks/ui/dist/MorphingModalWizard-D7hc-dDP.js";
6
+ import { DayPicker as ve } from "../../../ui/day-picker.js";
7
+ import { Label as be } from "../../../ui/label.js";
8
+ import { Provider as ge, Root as Me, TooltipTrigger as ke, Content as Te } from "../../../ui/tooltip.js";
9
+ import { useBookingPeriod as Pe } from "../BookingPeriodContext.js";
10
+ import { BookingPeriodFieldErrorMessage as we } from "./BookingPeriodFieldErrorMessage.js";
11
+ import { ModalDayPickerField as Ce } from "./internal/ModalDayPickerField.js";
12
+ const X = (t) => String(t).padStart(2, "0"), $ = (t) => `${t.getFullYear()}-${X(t.getMonth() + 1)}-${X(t.getDate())}`, z = (t) => t.getFullYear() * 12 + t.getMonth(), ne = (t) => new Date(Math.floor(t / 12), t % 12, 1), H = (t) => ne(z(t)), Z = (t, i, r) => {
13
+ const c = z(t), d = z(i), f = Math.max(0, r - 1), b = c + f;
14
+ if (d < c)
15
+ return H(i);
16
+ if (d > b) {
17
+ const m = d - f;
18
+ return m === c ? t : ne(m);
19
19
  }
20
- return o;
21
- }, Me = (o) => {
20
+ return t;
21
+ }, Fe = (t) => {
22
22
  if (typeof PointerEvent == "function") {
23
- o.dispatchEvent(new PointerEvent("pointermove", { bubbles: !0, pointerType: "mouse" }));
23
+ t.dispatchEvent(new PointerEvent("pointermove", { bubbles: !0, pointerType: "mouse" }));
24
24
  return;
25
25
  }
26
- o.dispatchEvent(new MouseEvent("mousemove", { bubbles: !0 }));
27
- }, ee = (o) => {
26
+ t.dispatchEvent(new MouseEvent("mousemove", { bubbles: !0 }));
27
+ }, ee = (t) => {
28
28
  if (typeof PointerEvent == "function") {
29
- o.dispatchEvent(new PointerEvent("pointerout", { bubbles: !0, pointerType: "mouse" })), o.dispatchEvent(new PointerEvent("pointerleave", { bubbles: !0, pointerType: "mouse" }));
29
+ t.dispatchEvent(new PointerEvent("pointerout", { bubbles: !0, pointerType: "mouse" })), t.dispatchEvent(new PointerEvent("pointerleave", { bubbles: !0, pointerType: "mouse" }));
30
30
  return;
31
31
  }
32
- o.dispatchEvent(new MouseEvent("mouseout", { bubbles: !0 })), o.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
33
- }, xe = () => {
32
+ t.dispatchEvent(new MouseEvent("mouseout", { bubbles: !0 })), t.dispatchEvent(new MouseEvent("mouseleave", { bubbles: !0 }));
33
+ }, oe = ye(null), re = (t) => {
34
+ const i = De(oe), { day: r, modifiers: c, className: d, ...f } = t, b = c.disabled ? "cursor-not-allowed" : "cursor-pointer", m = F(null);
35
+ h(() => {
36
+ c.focused && m.current?.focus();
37
+ }, [c.focused]);
38
+ const p = /* @__PURE__ */ s(
39
+ "button",
40
+ {
41
+ ref: m,
42
+ ...f,
43
+ className: k(d, b)
44
+ }
45
+ );
46
+ if (!i)
47
+ return p;
48
+ const { labels: y, startDate: L, hoveredEndDate: T, keyboardTooltipDay: P, numberOfMonths: g, overlayLayer: M } = i;
49
+ if (!L || c.disabled || g === 1)
50
+ return p;
51
+ const l = pe(r.date, L);
52
+ if (l < 0)
53
+ return p;
54
+ const B = $(r.date), I = P === B || (!P && T ? $(T) === B : !1), O = y.selectedDaysTooltip?.({ count: l + 1 });
55
+ return O ? /* @__PURE__ */ te(Me, { open: I, children: [
56
+ /* @__PURE__ */ s(ke, { asChild: !0, children: p }),
57
+ /* @__PURE__ */ s(
58
+ Te,
59
+ {
60
+ container: M ?? void 0,
61
+ side: "top",
62
+ align: "center",
63
+ disableAnimation: !0,
64
+ positionerClassName: M ? "z-[120]" : "z-[80]",
65
+ className: k(
66
+ "pointer-events-none rounded-md border bg-popover px-2 py-1 text-xs font-semibold text-primary shadow-md",
67
+ M ? "z-[120]" : "z-[70]"
68
+ ),
69
+ children: /* @__PURE__ */ s("span", { children: O })
70
+ }
71
+ )
72
+ ] }) : p;
73
+ };
74
+ re.displayName = "BookingEndDateDayButton";
75
+ const Re = () => {
34
76
  const {
35
- labels: o,
77
+ labels: t,
36
78
  startDate: i,
37
- endDate: a,
38
- selectEndDate: g,
79
+ endDate: r,
80
+ selectEndDate: c,
39
81
  isEndDatePopoverOpen: d,
40
82
  setIsEndDatePopoverOpen: f,
41
- setIsStartTimeSelectOpen: v,
42
- hoveredEndDate: u,
43
- setHoveredEndDate: M,
44
- resetHoveredEndDate: m,
45
- labelClassName: ne,
46
- inputClassName: N,
47
- buttonClassName: A,
48
- errors: k,
49
- dateLocale: K,
50
- numberOfMonths: p,
51
- isMobile: oe,
52
- isHydrated: q,
53
- openDatePickerOnFocus: re,
54
- withMobileDateDrawer: ie,
55
- minSelectableDate: Y
56
- } = De(), l = ie && oe, y = S(null), h = S(!1), [ae, de] = O(!1), [F, I] = O(null), [$, B] = O(
57
- () => C(i ?? a ?? /* @__PURE__ */ new Date())
58
- ), D = fe(), se = !!D || !ae;
59
- E(() => {
83
+ setIsStartTimeSelectOpen: b,
84
+ hoveredEndDate: m,
85
+ setHoveredEndDate: p,
86
+ resetHoveredEndDate: y,
87
+ labelClassName: L,
88
+ inputClassName: T,
89
+ buttonClassName: P,
90
+ errors: g,
91
+ dateLocale: M,
92
+ numberOfMonths: l,
93
+ isMobile: B,
94
+ isHydrated: I,
95
+ openDatePickerOnFocus: O,
96
+ withMobileDateDrawer: ae,
97
+ minSelectableDate: U
98
+ } = Pe(), D = ae && B, E = F(null), v = F(!1), [ie, de] = Y(!1), [V, N] = Y(null), [j, A] = Y(
99
+ () => H(i ?? r ?? /* @__PURE__ */ new Date())
100
+ ), x = he(), se = !!x || !ie;
101
+ h(() => {
60
102
  de(!0);
61
- }, []), E(() => {
103
+ }, []), h(() => {
62
104
  if (typeof document > "u")
63
105
  return;
64
106
  const e = document.getElementById("end-date-picker");
65
107
  if (!(e instanceof HTMLInputElement))
66
108
  return;
67
- const t = (n) => {
68
- h.current = n.key === "ArrowUp" || n.key === "ArrowDown";
109
+ const n = (o) => {
110
+ v.current = o.key === "ArrowUp" || o.key === "ArrowDown";
69
111
  };
70
- return e.addEventListener("keydown", t, !0), () => {
71
- e.removeEventListener("keydown", t, !0);
112
+ return e.addEventListener("keydown", n, !0), () => {
113
+ e.removeEventListener("keydown", n, !0);
72
114
  };
73
- }, []), E(() => {
74
- if (!d || l)
115
+ }, []), h(() => {
116
+ if (!d || D)
75
117
  return;
76
- const e = C(i ?? a ?? /* @__PURE__ */ new Date()), t = a ?? i;
77
- B(t ? Z(e, t, p) : e);
78
- }, [a, d, p, i]), E(() => {
118
+ const e = H(i ?? r ?? /* @__PURE__ */ new Date()), n = r ?? i;
119
+ A(n ? Z(e, n, l) : e);
120
+ }, [r, d, l, i]), h(() => {
79
121
  if (!d)
80
122
  return;
81
- const e = u ?? a;
82
- e && B((t) => Z(t, e, p));
83
- }, [a, u, d, p]), E(() => {
84
- if (!d || typeof document > "u" || (m(), l))
123
+ const e = m ?? r;
124
+ e && A((n) => Z(n, e, l));
125
+ }, [r, m, d, l]), h(() => {
126
+ if (!d || typeof document > "u" || (y(), D))
85
127
  return;
86
128
  const e = document.getElementById("end-date-picker");
87
129
  if (!(e instanceof HTMLElement)) {
@@ -91,266 +133,265 @@ const X = (o) => String(o).padStart(2, "0"), x = (o) => `${o.getFullYear()}-${X(
91
133
  document.activeElement !== e && requestAnimationFrame(() => {
92
134
  e.focus({ preventScroll: !0 }), e.click();
93
135
  });
94
- }, [d, m, f]), E(() => {
136
+ }, [d, y, f]), h(() => {
95
137
  if (typeof document > "u")
96
138
  return;
97
139
  const e = document.getElementById("end-date-picker");
98
140
  if (!(e instanceof HTMLInputElement))
99
141
  return;
100
- const t = () => {
101
- v(!1);
142
+ const n = () => {
143
+ b(!1);
102
144
  };
103
- return e.addEventListener("focus", t, !0), () => {
104
- e.removeEventListener("focus", t, !0);
145
+ return e.addEventListener("focus", n, !0), () => {
146
+ e.removeEventListener("focus", n, !0);
105
147
  };
106
- }, [v]), E(() => {
148
+ }, [b]), h(() => {
107
149
  if (d || typeof document > "u")
108
150
  return;
109
- const e = y.current;
151
+ const e = E.current;
110
152
  if (!e)
111
153
  return;
112
- const n = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
113
- n instanceof HTMLElement && ee(n), y.current = null, I(null);
154
+ const o = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
155
+ o instanceof HTMLElement && ee(o), E.current = null, N(null);
114
156
  }, [d]);
115
- const z = Q(() => {
116
- const e = (t) => {
117
- const { day: n, modifiers: r, className: c, ...T } = t, P = r.disabled ? "cursor-not-allowed" : "cursor-pointer", j = S(null);
118
- E(() => {
119
- r.focused && j.current?.focus();
120
- }, [r.focused]);
121
- const w = /* @__PURE__ */ s(
122
- "button",
157
+ const W = F({
158
+ labels: t,
159
+ startDate: i,
160
+ endDate: r,
161
+ hoveredEndDate: m,
162
+ keyboardTooltipDay: V,
163
+ numberOfMonths: l,
164
+ overlayLayer: x,
165
+ calendarMonth: j,
166
+ resetHoveredEndDate: y,
167
+ setHoveredEndDate: p
168
+ });
169
+ W.current = {
170
+ labels: t,
171
+ startDate: i,
172
+ endDate: r,
173
+ hoveredEndDate: m,
174
+ keyboardTooltipDay: V,
175
+ numberOfMonths: l,
176
+ overlayLayer: x,
177
+ calendarMonth: j,
178
+ resetHoveredEndDate: y,
179
+ setHoveredEndDate: p
180
+ };
181
+ const K = F(null);
182
+ if (!K.current) {
183
+ const e = (n) => {
184
+ const {
185
+ labels: o,
186
+ startDate: a,
187
+ endDate: u,
188
+ hoveredEndDate: w,
189
+ keyboardTooltipDay: S,
190
+ numberOfMonths: Q,
191
+ overlayLayer: ce,
192
+ calendarMonth: le,
193
+ resetHoveredEndDate: ue,
194
+ setHoveredEndDate: fe
195
+ } = W.current, me = {
196
+ labels: o,
197
+ startDate: a,
198
+ hoveredEndDate: w,
199
+ keyboardTooltipDay: S,
200
+ numberOfMonths: Q,
201
+ overlayLayer: ce
202
+ };
203
+ return /* @__PURE__ */ s(oe.Provider, { value: me, children: /* @__PURE__ */ s(ge, { delayDuration: 0, children: /* @__PURE__ */ s("div", { onMouseLeave: ue, children: /* @__PURE__ */ s(
204
+ ve,
123
205
  {
124
- ref: j,
125
- ...T,
126
- className: b(c, P)
127
- }
128
- );
129
- if (!i || r.disabled || p === 1)
130
- return w;
131
- const W = ue(n.date, i);
132
- if (W < 0)
133
- return w;
134
- const _ = x(n.date), ce = F === _ || (!F && u ? x(u) === _ : !1), G = o.selectedDaysTooltip?.({ count: W + 1 });
135
- return G ? /* @__PURE__ */ J(ye, { open: ce, children: [
136
- /* @__PURE__ */ s(Ee, { asChild: !0, children: w }),
137
- /* @__PURE__ */ s(
138
- he,
139
- {
140
- container: D ?? void 0,
141
- side: "top",
142
- align: "center",
143
- disableAnimation: !0,
144
- positionerClassName: D ? "z-[120]" : "z-[80]",
145
- className: b(
146
- "pointer-events-none rounded-md border bg-popover px-2 py-1 text-xs font-semibold text-primary shadow-md",
147
- D ? "z-[120]" : "z-[70]"
148
- ),
149
- children: /* @__PURE__ */ s("span", { children: G })
206
+ ...n,
207
+ mode: "range",
208
+ month: le,
209
+ onMonthChange: (C) => {
210
+ A(H(C));
211
+ },
212
+ selected: {
213
+ from: a,
214
+ to: w || u
215
+ },
216
+ components: {
217
+ ...n.components,
218
+ DayButton: re
219
+ },
220
+ onSelect: (C, R) => {
221
+ n.onSelect?.(R);
222
+ },
223
+ onDayMouseEnter: (C, R) => {
224
+ Q !== 1 && a && !R.disabled && C >= a && fe(C);
150
225
  }
151
- )
152
- ] }) : w;
153
- };
154
- return e.displayName = "BookingEndDateDayButton", e;
155
- }, [u, F, o, D, i]), R = Q(() => {
156
- const e = (t) => /* @__PURE__ */ s(ge, { delayDuration: 0, children: /* @__PURE__ */ s("div", { onMouseLeave: m, children: /* @__PURE__ */ s(
157
- me,
158
- {
159
- ...t,
160
- mode: "range",
161
- month: $,
162
- onMonthChange: (n) => {
163
- B(C(n));
164
- },
165
- selected: {
166
- from: i,
167
- to: u || a
168
- },
169
- components: {
170
- ...t.components,
171
- DayButton: z
172
- },
173
- onSelect: (n, r) => {
174
- t.onSelect?.(r);
175
- },
176
- onDayMouseEnter: (n, r) => {
177
- p !== 1 && i && !r.disabled && n >= i && M(n);
178
226
  }
179
- }
180
- ) }) });
181
- return e.displayName = "BookingEndDateDayPicker", e;
182
- }, [
183
- z,
184
- i,
185
- a,
186
- u,
187
- $,
188
- m,
189
- M
190
- ]), L = () => {
227
+ ) }) }) });
228
+ };
229
+ e.displayName = "BookingEndDateDayPicker", K.current = e;
230
+ }
231
+ const _ = K.current, q = () => {
191
232
  if (typeof document > "u") {
192
- y.current = null;
233
+ E.current = null;
193
234
  return;
194
235
  }
195
- const e = y.current;
236
+ const e = E.current;
196
237
  if (!e)
197
238
  return;
198
- const n = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
199
- n instanceof HTMLElement && ee(n), y.current = null, I(null);
200
- }, U = (e) => {
239
+ const o = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
240
+ o instanceof HTMLElement && ee(o), E.current = null, N(null);
241
+ }, G = (e) => {
201
242
  if (typeof document > "u")
202
243
  return;
203
- const t = x(e);
204
- if (y.current === t)
244
+ const n = $(e);
245
+ if (E.current === n)
205
246
  return;
206
- L(), y.current = t, I(t);
207
- let n = 0;
208
- const r = 6, c = () => {
209
- if (y.current !== t)
247
+ q(), E.current = n, N(n);
248
+ let o = 0;
249
+ const a = 6, u = () => {
250
+ if (E.current !== n)
210
251
  return;
211
- const T = document.getElementById("end-date-calendar");
212
- if (!(T instanceof HTMLElement)) {
213
- n += 1, n <= r && requestAnimationFrame(c);
252
+ const w = document.getElementById("end-date-calendar");
253
+ if (!(w instanceof HTMLElement)) {
254
+ o += 1, o <= a && requestAnimationFrame(u);
214
255
  return;
215
256
  }
216
- const P = T.querySelector(`[data-day="${t}"] button:not([disabled])`);
217
- if (P instanceof HTMLElement) {
218
- Me(P);
257
+ const S = w.querySelector(`[data-day="${n}"] button:not([disabled])`);
258
+ if (S instanceof HTMLElement) {
259
+ Fe(S);
219
260
  return;
220
261
  }
221
- n += 1, n <= r && requestAnimationFrame(c);
262
+ o += 1, o <= a && requestAnimationFrame(u);
222
263
  };
223
- requestAnimationFrame(c);
224
- }, V = () => {
225
- l && f(!0);
264
+ requestAnimationFrame(u);
265
+ }, J = () => {
266
+ D && f(!0);
226
267
  };
227
- return /* @__PURE__ */ J(
268
+ return /* @__PURE__ */ te(
228
269
  "div",
229
270
  {
230
- className: b("group/form-item relative flex-grow", l && "cursor-pointer rounded-md"),
231
- onPointerDownCapture: V,
232
- onClick: V,
271
+ className: k("group/form-item relative flex-grow", D && "cursor-pointer rounded-md"),
272
+ onPointerDownCapture: J,
273
+ onClick: J,
233
274
  children: [
234
275
  /* @__PURE__ */ s(
235
- pe,
276
+ be,
236
277
  {
237
278
  htmlFor: "end-date-picker",
238
- className: b("mb-1 block text-sm font-medium", l && "cursor-pointer", ne),
239
- children: /* @__PURE__ */ s("span", { children: o.endDate })
279
+ className: k("mb-1 block text-sm font-medium", D && "cursor-pointer", L),
280
+ children: /* @__PURE__ */ s("span", { children: t.endDate })
240
281
  }
241
282
  ),
242
283
  se ? /* @__PURE__ */ s(
243
- ve,
284
+ Ce,
244
285
  {
245
286
  id: "end-date-picker",
246
- value: a ?? null,
247
- placeholder: o.pickEndDate,
287
+ value: r ?? null,
288
+ placeholder: t.pickEndDate,
248
289
  triggerTestId: "end-date-trigger",
249
- isHydrated: q,
250
- open: l ? !1 : d,
290
+ isHydrated: I,
291
+ open: D ? !1 : d,
251
292
  onOpenChange: f,
252
- readOnly: l,
253
- openOnFocus: re,
293
+ readOnly: D,
294
+ openOnFocus: O,
254
295
  onValueUpdate: (e) => {
255
- const t = (() => {
296
+ const n = (() => {
256
297
  if (!d || typeof document > "u")
257
298
  return !1;
258
- const n = document.activeElement;
259
- return n instanceof HTMLElement && n.id === "end-date-picker";
299
+ const o = document.activeElement;
300
+ return o instanceof HTMLElement && o.id === "end-date-picker";
260
301
  })();
261
302
  if (!i || !e || e < i) {
262
- m(), t && L();
303
+ y(), n && q();
263
304
  return;
264
305
  }
265
- M(e), t && U(e);
306
+ p(e), n && G(e);
266
307
  },
267
308
  onChange: (e) => {
268
- if (m(), (() => {
309
+ if (y(), (() => {
269
310
  if (typeof document > "u")
270
- return h.current = !1, !1;
271
- const r = document.activeElement, c = h.current && r instanceof HTMLElement && r.id === "end-date-picker";
272
- return h.current = !1, c;
273
- })() || e && a && e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate())
311
+ return v.current = !1, !1;
312
+ const a = document.activeElement, u = v.current && a instanceof HTMLElement && a.id === "end-date-picker";
313
+ return v.current = !1, u;
314
+ })() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate())
274
315
  return;
275
- const n = (() => {
316
+ const o = (() => {
276
317
  if (!e || typeof document > "u")
277
318
  return !1;
278
- const r = document.activeElement;
279
- return r instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(r) || r.id === "end-date-picker") : !1;
319
+ const a = document.activeElement;
320
+ return a instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(a) || a.id === "end-date-picker") : !1;
280
321
  })();
281
- g(e ?? void 0, { openTimePicker: n });
322
+ c(e ?? void 0, { openTimePicker: o });
282
323
  },
283
- inputClassName: b(k.endDate && "border-destructive", N, A),
284
- dayPickerComponent: R,
324
+ inputClassName: k(g.endDate && "border-destructive", T, P),
325
+ dayPickerComponent: _,
285
326
  dayPickerProps: {
286
327
  id: "end-date-calendar",
287
- locale: K,
328
+ locale: M,
288
329
  showOutsideDays: !1,
289
- numberOfMonths: p,
290
- disabled: (e) => i && e < i || e < Y,
330
+ numberOfMonths: l,
331
+ disabled: (e) => i && e < i || e < U,
291
332
  initialFocus: !0,
292
333
  "data-testid": "end-date-calendar"
293
334
  },
294
- portalContainer: D
335
+ portalContainer: x
295
336
  }
296
337
  ) : /* @__PURE__ */ s(
297
- le,
338
+ Ee,
298
339
  {
299
340
  id: "end-date-picker",
300
- value: a ?? null,
301
- placeholder: o.pickEndDate,
341
+ value: r ?? null,
342
+ placeholder: t.pickEndDate,
302
343
  triggerTestId: "end-date-trigger",
303
- isHydrated: q,
304
- open: l ? !1 : d,
344
+ isHydrated: I,
345
+ open: D ? !1 : d,
305
346
  onOpenChange: f,
306
- readOnly: l,
347
+ readOnly: D,
307
348
  onValueUpdate: (e) => {
308
- const t = (() => {
349
+ const n = (() => {
309
350
  if (!d || typeof document > "u")
310
351
  return !1;
311
- const n = document.activeElement;
312
- return n instanceof HTMLElement && n.id === "end-date-picker";
352
+ const o = document.activeElement;
353
+ return o instanceof HTMLElement && o.id === "end-date-picker";
313
354
  })();
314
355
  if (!i || !e || e < i) {
315
- m(), t && L();
356
+ y(), n && q();
316
357
  return;
317
358
  }
318
- M(e), t && U(e);
359
+ p(e), n && G(e);
319
360
  },
320
361
  onChange: (e) => {
321
- if (m(), (() => {
362
+ if (y(), (() => {
322
363
  if (typeof document > "u")
323
- return h.current = !1, !1;
324
- const r = document.activeElement, c = h.current && r instanceof HTMLElement && r.id === "end-date-picker";
325
- return h.current = !1, c;
326
- })() || e && a && e.getFullYear() === a.getFullYear() && e.getMonth() === a.getMonth() && e.getDate() === a.getDate())
364
+ return v.current = !1, !1;
365
+ const a = document.activeElement, u = v.current && a instanceof HTMLElement && a.id === "end-date-picker";
366
+ return v.current = !1, u;
367
+ })() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate())
327
368
  return;
328
- const n = (() => {
369
+ const o = (() => {
329
370
  if (!e || typeof document > "u")
330
371
  return !1;
331
- const r = document.activeElement;
332
- return r instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(r) || r.id === "end-date-picker") : !1;
372
+ const a = document.activeElement;
373
+ return a instanceof HTMLElement ? !!(document.getElementById("end-date-calendar")?.contains(a) || a.id === "end-date-picker") : !1;
333
374
  })();
334
- g(e ?? void 0, { openTimePicker: n });
375
+ c(e ?? void 0, { openTimePicker: o });
335
376
  },
336
- inputClassName: b(k.endDate && "border-destructive", N, A),
337
- dayPickerComponent: R,
377
+ inputClassName: k(g.endDate && "border-destructive", T, P),
378
+ dayPickerComponent: _,
338
379
  dayPickerProps: {
339
380
  id: "end-date-calendar",
340
- locale: K,
381
+ locale: M,
341
382
  showOutsideDays: !1,
342
- numberOfMonths: p,
343
- disabled: (e) => i && e < i || e < Y,
383
+ numberOfMonths: l,
384
+ disabled: (e) => i && e < i || e < U,
344
385
  initialFocus: !0,
345
386
  "data-testid": "end-date-calendar"
346
387
  }
347
388
  }
348
389
  ),
349
- k.endDate && /* @__PURE__ */ s(be, { children: k.endDate })
390
+ g.endDate && /* @__PURE__ */ s(we, { children: g.endDate })
350
391
  ]
351
392
  }
352
393
  );
353
394
  };
354
395
  export {
355
- xe as BookingEndDateField
396
+ Re as BookingEndDateField
356
397
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loczer/storefront-sdk",
3
- "version": "0.157.0",
3
+ "version": "0.158.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"