@stenajs-webui/calendar 23.17.2 → 23.18.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/index.es.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as o, jsxs as N, Fragment as vt } from "react/jsx-runtime";
2
- import { Box as L, Text as Ce, Clickable as sn, Row as V, Spacing as Fn, useToday as xe, Column as Q, Heading as Fe, exhaustSwitchCase as Ct, Space as Ie, Indent as Ae, SeparatorLine as On, parseIntElseUndefined as Et, useBoolean as mt, useDelayedFalse as Lt, useOnClickOutside as an } from "@stenajs-webui/core";
2
+ import { Box as L, Text as Ce, Clickable as sn, Row as V, Spacing as Yn, useToday as xe, Column as Q, Heading as Ye, exhaustSwitchCase as Ct, Space as Ie, Indent as Ae, SeparatorLine as On, parseIntElseUndefined as Et, useBoolean as mt, useDelayedFalse as Lt, useOnClickOutside as an } from "@stenajs-webui/core";
3
3
  import { FlatButton as Z, stenaAngleDown as kt, PrimaryButton as _e, stenaAngleLeft as Wn, stenaAngleRight as $n, SecondaryButton as he, stenaAngleLeftDouble as Un, stenaArrowLeft as tt, stenaArrowRight as Oe, stenaAngleRightDouble as Vn, TextInputButton as jn, stenaCalendar as Pe, Icon as on, stenaArrowWideRight as zn, stenaClock as cn, Label as Kn, FlatButtonLink as qn, BaseButton as Gn, stenaBellFilled as Jn, MenuButton as Qn, stenaAngleUp as Zn, CardBody as ln } from "@stenajs-webui/elements";
4
- import { isAfter as G, eachDayOfInterval as dn, isSameDay as P, endOfMonth as un, startOfMonth as fn, min as hn, addDays as te, max as gn, subDays as we, format as z, getISOWeek as St, getDate as nt, startOfWeek as Qe, addWeeks as Xn, getMonth as ye, getYear as He, getWeek as mn, getISODay as er, addHours as pn, isBefore as Ne, parse as ve, addMonths as We, isSameMonth as me, addYears as tr, subMonths as Mt, subYears as nr, setWeek as rr, isValid as sr, isSameYear as ar, intlFormat as Dn, isWithinInterval as or } from "date-fns";
5
- import { enGB as Ze, pl as At, fr as Pt, es as Ht, cs as Yt, fi as Ft, et as Ot, it as Wt, lt as $t, lv as Ut, da as Vt, sv as jt, nb as zt, de as Kt, nl as qt, nlBE as ir, deAT as cr, enIE as lr, enUS as dr } from "date-fns/locale";
4
+ import { isAfter as G, eachDayOfInterval as dn, isSameDay as P, endOfMonth as un, startOfMonth as fn, min as hn, addDays as te, max as gn, subDays as we, format as z, getISOWeek as St, getDate as nt, startOfWeek as Qe, addWeeks as Xn, getMonth as ye, getYear as Fe, getWeek as mn, getISODay as er, addHours as pn, isBefore as Ne, parse as ve, addMonths as We, isSameMonth as me, addYears as tr, subMonths as Mt, subYears as nr, setWeek as rr, isValid as sr, isSameYear as ar, intlFormat as Dn, isWithinInterval as or } from "date-fns";
5
+ import { enGB as Ze, pl as At, fr as Pt, es as Ft, cs as Ht, fi as Yt, et as Ot, it as Wt, lt as $t, lv as Ut, da as Vt, sv as jt, nb as zt, de as Kt, nl as qt, nlBE as ir, deAT as cr, enIE as lr, enUS as dr } from "date-fns/locale";
6
6
  import { last as ur, chunk as bn, debounce as fr, padStart as hr, range as It } from "lodash-es";
7
7
  import * as Rt from "react";
8
8
  import { useMemo as x, useRef as $, useEffect as ae, useCallback as w, useId as Tt, useState as M, forwardRef as rt, createContext as gr, useLayoutEffect as wn } from "react";
@@ -17,7 +17,7 @@ import './index.css';const de = {
17
17
  yearAndMonth: "yyyy-MM",
18
18
  fullDate: "yyyy-MM-dd",
19
19
  fullMonthName: "LLLL"
20
- }, Ye = (e = {}, t, n) => {
20
+ }, He = (e = {}, t, n) => {
21
21
  if (t && n && G(n, t))
22
22
  return dn({ start: t, end: n }).reduce(
23
23
  (s, a) => {
@@ -34,11 +34,11 @@ import './index.css';const de = {
34
34
  n,
35
35
  fn(r),
36
36
  un(r)
37
- ), wr = (e = {}, t, n, r, s) => t && n ? Ye(
37
+ ), wr = (e = {}, t, n, r, s) => t && n ? He(
38
38
  e,
39
39
  gn([t, we(r, 1)]),
40
40
  hn([n, te(s, 1)])
41
- ) : Ye(e, t, n), Oa = (e, t, n) => {
41
+ ) : He(e, t, n), Oa = (e, t, n) => {
42
42
  const r = z(t, de.yearAndMonth), s = St(t), a = nt(t);
43
43
  return {
44
44
  ...e,
@@ -107,7 +107,7 @@ import './index.css';const de = {
107
107
  return { ...e };
108
108
  const n = t.days[0].date, r = ur(t.days)?.date;
109
109
  return {
110
- ...Ye(e, n, r)
110
+ ...He(e, n, r)
111
111
  };
112
112
  }, vr = (e, t) => x(() => e ? ge(t, /* @__PURE__ */ new Date(), ["today"]) : t, [e, t]), st = (e) => e.length === 0 ? e : e.length === 1 ? e.toUpperCase() : e.charAt(0).toUpperCase() + e.slice(1);
113
113
  var Cr = /* @__PURE__ */ ((e) => (e[e.JANUARY = 0] = "JANUARY", e[e.FEBRUARY = 1] = "FEBRUARY", e[e.MARCH = 2] = "MARCH", e[e.APRIL = 3] = "APRIL", e[e.MAY = 4] = "MAY", e[e.JUNE = 5] = "JUNE", e[e.JULY = 6] = "JULY", e[e.AUGUST = 7] = "AUGUST", e[e.SEPTEMBER = 8] = "SEPTEMBER", e[e.OCTOBER = 9] = "OCTOBER", e[e.NOVEMBER = 10] = "NOVEMBER", e[e.DECEMBER = 11] = "DECEMBER", e))(Cr || {}), kr = /* @__PURE__ */ ((e) => (e[e.SUNDAY = 0] = "SUNDAY", e[e.MONDAY = 1] = "MONDAY", e[e.TUESDAY = 2] = "TUESDAY", e[e.WEDNESDAY = 3] = "WEDNESDAY", e[e.THURSDAY = 4] = "THURSDAY", e[e.FRIDAY = 5] = "FRIDAY", e[e.SATURDAY = 6] = "SATURDAY", e))(kr || {});
@@ -143,9 +143,9 @@ const Gt = (e, t, n, r) => {
143
143
  return {
144
144
  weekNumber: mn(e, { locale: t }),
145
145
  startMonth: ye(e),
146
- startYear: He(e),
146
+ startYear: Fe(e),
147
147
  endMonth: ye(te(e, 6)),
148
- endYear: He(te(e, 6)),
148
+ endYear: Fe(te(e, 6)),
149
149
  days: Ir(e, t),
150
150
  isLastWeekOfMonth: n
151
151
  };
@@ -157,7 +157,7 @@ const Gt = (e, t, n, r) => {
157
157
  fullName: z(e, "EEEE", t ? { locale: t } : void 0),
158
158
  dateString: z(pn(e, 12), de.fullDate),
159
159
  weekNumber: mn(e, { locale: t }),
160
- year: He(e),
160
+ year: Fe(e),
161
161
  month: ye(e),
162
162
  dayOfMonth: nt(e),
163
163
  dayOfWeek: n,
@@ -482,7 +482,7 @@ const Gt = (e, t, n, r) => {
482
482
  ) : i
483
483
  }
484
484
  );
485
- }, Pr = (e, t, n) => t && Ne(e, t) ? P(e, t) : n && G(e, n) ? P(e, n) : !0, Hr = function({
485
+ }, Pr = (e, t, n) => t && Ne(e, t) ? P(e, t) : n && G(e, n) ? P(e, n) : !0, Fr = function({
486
486
  dayComponent: t,
487
487
  minDate: n,
488
488
  maxDate: r,
@@ -496,7 +496,7 @@ const Gt = (e, t, n, r) => {
496
496
  );
497
497
  return /* @__PURE__ */ o(t, { day: a, ...i, dayState: c });
498
498
  };
499
- function Yr({
499
+ function Hr({
500
500
  month: e,
501
501
  dayComponent: t = vn,
502
502
  statePerWeek: n,
@@ -560,7 +560,7 @@ function Yr({
560
560
  }
561
561
  ) }),
562
562
  C.days.map((m) => /* @__PURE__ */ o(
563
- Hr,
563
+ Fr,
564
564
  {
565
565
  dayComponent: t,
566
566
  day: m,
@@ -581,7 +581,7 @@ function Yr({
581
581
  ] }) })
582
582
  ] }) });
583
583
  }
584
- function Fr({
584
+ function Yr({
585
585
  monthRows: e,
586
586
  dayComponent: t = vn,
587
587
  userDataPerMonth: n,
@@ -614,8 +614,8 @@ function Fr({
614
614
  Jt.calendar,
615
615
  y && Jt.weekNumberVisible
616
616
  ),
617
- children: e.map((b, D) => /* @__PURE__ */ o(Fn, { children: /* @__PURE__ */ o(V, { gap: 2, children: b.map((k) => /* @__PURE__ */ o(
618
- Yr,
617
+ children: e.map((b, D) => /* @__PURE__ */ o(Yn, { children: /* @__PURE__ */ o(V, { gap: 2, children: b.map((k) => /* @__PURE__ */ o(
618
+ Hr,
619
619
  {
620
620
  month: k,
621
621
  dayComponent: t,
@@ -655,7 +655,7 @@ function pt(e) {
655
655
  e.statePerMonth
656
656
  );
657
657
  return /* @__PURE__ */ o(
658
- Fr,
658
+ Yr,
659
659
  {
660
660
  year: n,
661
661
  month: r,
@@ -674,12 +674,12 @@ const Or = (e, t, n) => {
674
674
  if (n)
675
675
  return {
676
676
  month: ye(n),
677
- year: He(n)
677
+ year: Fe(n)
678
678
  };
679
679
  const r = /* @__PURE__ */ new Date();
680
680
  return {
681
681
  month: ye(r),
682
- year: He(r)
682
+ year: Fe(r)
683
683
  };
684
684
  }, Wr = (e, t, n, r, s) => r == null ? [[at(e, t, n)]] : s == null ? [Gt(e, t, r, n)] : bn(Gt(e, t, r, n), s), Cn = (e, t) => `${e.row}-${e.column}-${t}`, $r = (e, t, n, r) => {
685
685
  let s = t;
@@ -711,9 +711,9 @@ const Or = (e, t, n) => {
711
711
  "lt-LT": $t,
712
712
  "it-IT": Wt,
713
713
  "et-EE": Ot,
714
- "fi-FI": Ft,
715
- "cs-CZ": Yt,
716
- "es-ES": Ht,
714
+ "fi-FI": Yt,
715
+ "cs-CZ": Ht,
716
+ "es-ES": Ft,
717
717
  "fr-FR": Pt,
718
718
  "pl-PL": At,
719
719
  nl: qt,
@@ -725,9 +725,9 @@ const Or = (e, t, n) => {
725
725
  lt: $t,
726
726
  it: Wt,
727
727
  et: Ot,
728
- fi: Ft,
729
- cs: Yt,
730
- es: Ht,
728
+ fi: Yt,
729
+ cs: Ht,
730
+ es: Ft,
731
731
  fr: Pt,
732
732
  pl: At
733
733
  }, kn = "en-GB", Va = "sv", Sn = (e, t, n) => {
@@ -856,7 +856,7 @@ const Or = (e, t, n) => {
856
856
  return /* @__PURE__ */ o(Q, { gap: 1, maxWidth: qr(i), onKeyDown: p, children: g.yearOrder.map((y, v) => {
857
857
  const { rows: C } = g.years[y];
858
858
  return /* @__PURE__ */ N(Rt.Fragment, { children: [
859
- (v !== 0 || y !== l.getFullYear()) && /* @__PURE__ */ o(Fe, { variant: "h4", children: y }),
859
+ (v !== 0 || y !== l.getFullYear()) && /* @__PURE__ */ o(Ye, { variant: "h4", children: y }),
860
860
  /* @__PURE__ */ o("table", { style: { borderSpacing: "0 8px" }, children: /* @__PURE__ */ o("tbody", { children: C.map((m) => {
861
861
  const { columns: b } = g.rows[m];
862
862
  return /* @__PURE__ */ o("tr", { children: b.map(({ month: D, position: k }) => /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(
@@ -1201,7 +1201,7 @@ const ns = (e, t) => e || (t || 1) > 1 ? "below" : "header", rs = (e) => ({
1201
1201
  e,
1202
1202
  r
1203
1203
  ), g = x(
1204
- () => Ye(
1204
+ () => He(
1205
1205
  s,
1206
1206
  t?.startDate,
1207
1207
  t?.endDate
@@ -1386,6 +1386,8 @@ const Ve = "bottom", ds = (e, t, n) => {
1386
1386
  $e,
1387
1387
  {
1388
1388
  hideArrow: !0,
1389
+ restoreFocus: !1,
1390
+ returnFocus: !1,
1389
1391
  open: v,
1390
1392
  onRequestClose: y,
1391
1393
  appendTo: f,
@@ -1479,13 +1481,15 @@ function Za({
1479
1481
  } = us(r, s), [B, R] = M(
1480
1482
  () => (b && r?.[b]) ?? /* @__PURE__ */ new Date()
1481
1483
  ), _ = x(
1482
- () => Ye(void 0, r?.startDate, r?.endDate),
1484
+ () => He(void 0, r?.startDate, r?.endDate),
1483
1485
  [r]
1484
1486
  );
1485
1487
  return /* @__PURE__ */ o(
1486
1488
  $e,
1487
1489
  {
1488
1490
  hideArrow: !0,
1491
+ restoreFocus: !1,
1492
+ returnFocus: !1,
1489
1493
  appendTo: h,
1490
1494
  zIndex: g,
1491
1495
  renderTrigger: (A) => /* @__PURE__ */ N(V, { alignItems: "center", ...A, children: [
@@ -1766,9 +1770,9 @@ const Xa = ({
1766
1770
  onFocusLeft: R,
1767
1771
  onFocusRight: _,
1768
1772
  inputRefLeft: A,
1769
- inputRefRight: F,
1773
+ inputRefRight: Y,
1770
1774
  variant: E,
1771
- variantLeft: H,
1775
+ variantLeft: F,
1772
1776
  variantRight: q,
1773
1777
  onBlur: J,
1774
1778
  showPresets: T,
@@ -1776,31 +1780,31 @@ const Xa = ({
1776
1780
  widthRight: U,
1777
1781
  disabled: j
1778
1782
  }) => {
1779
- const O = $(0), Y = x(
1783
+ const O = $(0), H = x(
1780
1784
  () => fr((W) => {
1781
1785
  W === 0 && J?.();
1782
1786
  }, 10),
1783
1787
  [J]
1784
1788
  ), X = w(
1785
1789
  (W) => {
1786
- O.current++, Y(O.current), R && R(W);
1790
+ O.current++, H(O.current), R && R(W);
1787
1791
  },
1788
- [R, O, Y]
1792
+ [R, O, H]
1789
1793
  ), re = w(
1790
1794
  (W) => {
1791
- O.current++, Y(O.current), _ && _(W);
1795
+ O.current++, H(O.current), _ && _(W);
1792
1796
  },
1793
- [_, O, Y]
1797
+ [_, O, H]
1794
1798
  ), oe = w(
1795
1799
  (W) => {
1796
- O.current--, Y(O.current), I && I(W);
1800
+ O.current--, H(O.current), I && I(W);
1797
1801
  },
1798
- [I, O, Y]
1802
+ [I, O, H]
1799
1803
  ), ue = w(
1800
1804
  (W) => {
1801
- O.current--, Y(O.current), B && B(W);
1805
+ O.current--, H(O.current), B && B(W);
1802
1806
  },
1803
- [B, O, Y]
1807
+ [B, O, H]
1804
1808
  );
1805
1809
  return /* @__PURE__ */ o(L, { children: /* @__PURE__ */ N(
1806
1810
  mr,
@@ -1847,7 +1851,7 @@ const Xa = ({
1847
1851
  onBlur: oe,
1848
1852
  onFocus: X,
1849
1853
  inputRef: A,
1850
- variant: H,
1854
+ variant: F,
1851
1855
  type: d,
1852
1856
  autoFocus: e,
1853
1857
  min: y,
@@ -1876,7 +1880,7 @@ const Xa = ({
1876
1880
  onChange: g,
1877
1881
  onBlur: ue,
1878
1882
  onFocus: re,
1879
- inputRef: F,
1883
+ inputRef: Y,
1880
1884
  variant: q,
1881
1885
  type: u,
1882
1886
  autoFocus: t,
@@ -2213,9 +2217,9 @@ const Xa = ({
2213
2217
  } = v, {
2214
2218
  showCalendar: _,
2215
2219
  hideCalendar: A,
2216
- inputLeftChangeHandler: F,
2220
+ inputLeftChangeHandler: Y,
2217
2221
  inputRightChangeHandler: E,
2218
- onChangeTime: H,
2222
+ onChangeTime: F,
2219
2223
  onChangeDate: q
2220
2224
  } = ks(e, t, v, p), {
2221
2225
  onKeyDownHandler: J,
@@ -2232,7 +2236,7 @@ const Xa = ({
2232
2236
  v
2233
2237
  );
2234
2238
  Cs(e, k, p);
2235
- const Y = x(() => {
2239
+ const H = x(() => {
2236
2240
  const W = e || R;
2237
2241
  return W ? ge(void 0, W, [
2238
2242
  "singleSelected",
@@ -2248,6 +2252,8 @@ const Xa = ({
2248
2252
  $e,
2249
2253
  {
2250
2254
  hideArrow: !0,
2255
+ restoreFocus: !1,
2256
+ returnFocus: !1,
2251
2257
  zIndex: g,
2252
2258
  appendTo: f,
2253
2259
  renderTrigger: (W) => /* @__PURE__ */ o(L, { ...W, children: /* @__PURE__ */ o(
@@ -2263,7 +2269,7 @@ const Xa = ({
2263
2269
  typeRight: "time",
2264
2270
  placeholderLeft: "yyyy-mm-dd",
2265
2271
  placeholderRight: "hh:mm",
2266
- onChangeLeft: F,
2272
+ onChangeLeft: Y,
2267
2273
  onChangeRight: E,
2268
2274
  onClickArrowDown: O,
2269
2275
  onClickCalendar: j,
@@ -2287,7 +2293,7 @@ const Xa = ({
2287
2293
  children: (oe || ue) && /* @__PURE__ */ o(Q, { children: oe ? /* @__PURE__ */ o(
2288
2294
  Se,
2289
2295
  {
2290
- statePerMonth: Y,
2296
+ statePerMonth: H,
2291
2297
  onClickDay: U,
2292
2298
  dateInFocus: D,
2293
2299
  setDateInFocus: k,
@@ -2301,7 +2307,7 @@ const Xa = ({
2301
2307
  vs,
2302
2308
  {
2303
2309
  value: re ?? "",
2304
- onValueChange: H
2310
+ onValueChange: F
2305
2311
  }
2306
2312
  ) }),
2307
2313
  /* @__PURE__ */ o(Ie, {}),
@@ -2566,9 +2572,9 @@ function ro({
2566
2572
  currentPanel: _,
2567
2573
  setCurrentPanel: A
2568
2574
  } = S, {
2569
- showCalendar: F,
2575
+ showCalendar: Y,
2570
2576
  hideCalendar: E,
2571
- inputLeftChangeHandler: H,
2577
+ inputLeftChangeHandler: F,
2572
2578
  inputRightChangeHandler: q
2573
2579
  } = xs(m, b, t, S), {
2574
2580
  onKeyDownHandler: J,
@@ -2583,7 +2589,7 @@ function ro({
2583
2589
  t,
2584
2590
  D,
2585
2591
  k,
2586
- F,
2592
+ Y,
2587
2593
  E,
2588
2594
  S
2589
2595
  );
@@ -2594,7 +2600,7 @@ function ro({
2594
2600
  D,
2595
2601
  k
2596
2602
  );
2597
- const Y = x(
2603
+ const H = x(
2598
2604
  () => m && b && G(m, b),
2599
2605
  [m, b]
2600
2606
  ), X = x(
@@ -2627,7 +2633,7 @@ function ro({
2627
2633
  typeRight: "date",
2628
2634
  placeholderLeft: "Start date",
2629
2635
  placeholderRight: "End date",
2630
- onChangeLeft: H,
2636
+ onChangeLeft: F,
2631
2637
  onChangeRight: q,
2632
2638
  onClickArrowDown: O,
2633
2639
  onClickCalendar: j,
@@ -2637,7 +2643,7 @@ function ro({
2637
2643
  onClickRight: T,
2638
2644
  inputRefLeft: D,
2639
2645
  inputRefRight: k,
2640
- variant: Y ? "error" : f,
2646
+ variant: H ? "error" : f,
2641
2647
  widthLeft: d,
2642
2648
  widthRight: u,
2643
2649
  minLeft: i,
@@ -2716,7 +2722,7 @@ const bt = ({
2716
2722
  f?.(E), I(!1);
2717
2723
  },
2718
2724
  [f]
2719
- ), F = S ? y : p ?? y;
2725
+ ), Y = S ? y : p ?? y;
2720
2726
  return m === "standard" ? /* @__PURE__ */ o(Kn, { text: C ?? "", children: /* @__PURE__ */ o(
2721
2727
  pe,
2722
2728
  {
@@ -2727,7 +2733,7 @@ const bt = ({
2727
2733
  "aria-live": "polite",
2728
2734
  value: (S ? i : v) ?? "",
2729
2735
  inputRef: B,
2730
- placeholder: F,
2736
+ placeholder: Y,
2731
2737
  onFocus: _,
2732
2738
  onBlur: A,
2733
2739
  onChange: R,
@@ -2745,7 +2751,7 @@ const bt = ({
2745
2751
  "aria-live": "polite",
2746
2752
  value: (S ? i : v) ?? "",
2747
2753
  ref: B,
2748
- placeholder: F,
2754
+ placeholder: Y,
2749
2755
  onFocus: _,
2750
2756
  onBlur: A,
2751
2757
  onChange: R,
@@ -2824,9 +2830,9 @@ const bt = ({
2824
2830
  const n = le(e, t);
2825
2831
  if (n != null)
2826
2832
  return be(n, t);
2827
- }, Hs = "_navBarButton_b3x3w_1", Ys = "_selected_b3x3w_14", en = {
2828
- navBarButton: Hs,
2829
- selected: Ys
2833
+ }, Fs = "_navBarButton_b3x3w_1", Hs = "_selected_b3x3w_14", en = {
2834
+ navBarButton: Fs,
2835
+ selected: Hs
2830
2836
  };
2831
2837
  rt(
2832
2838
  function({ selected: e, className: t, ...n }, r) {
@@ -2844,8 +2850,8 @@ rt(
2844
2850
  );
2845
2851
  }
2846
2852
  );
2847
- const Fs = "_navBarLink_1u1b2_1", Os = "_selected_1u1b2_14", tn = {
2848
- navBarLink: Fs,
2853
+ const Ys = "_navBarLink_1u1b2_1", Os = "_selected_1u1b2_14", tn = {
2854
+ navBarLink: Ys,
2849
2855
  selected: Os
2850
2856
  };
2851
2857
  rt(
@@ -3069,7 +3075,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3069
3075
  { month: "long", year: "numeric" },
3070
3076
  { locale: d.code }
3071
3077
  )
3072
- ), [d, m]), I = x(() => me(h, m), [h, m]), [B, R] = M(), [_, A] = M("calendar"), F = w(
3078
+ ), [d, m]), I = x(() => me(h, m), [h, m]), [B, R] = M(), [_, A] = M("calendar"), Y = w(
3073
3079
  (T) => {
3074
3080
  const K = T?.startDate?.length === f.length ? le(T.startDate, n) : void 0, U = T?.endDate?.length === f.length ? le(T.endDate, n) : void 0;
3075
3081
  K ? D(K) : U && D(U), t?.({
@@ -3087,17 +3093,17 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3087
3093
  ), E = x(
3088
3094
  () => p && y ? G(y, p) || P(y, p) : !1,
3089
3095
  [y, p]
3090
- ), H = x(() => {
3096
+ ), F = x(() => {
3091
3097
  const T = a === "startDate" ? e?.endDate : e?.startDate;
3092
3098
  return T ? le(T, n) : void 0;
3093
3099
  }, [a, n, e?.endDate, e?.startDate]), q = x(() => {
3094
- if (B && H) {
3100
+ if (B && F) {
3095
3101
  if (a === "endDate")
3096
3102
  return "right";
3097
3103
  if (a === "startDate")
3098
3104
  return "left";
3099
3105
  }
3100
- }, [a, H, B]);
3106
+ }, [a, F, B]);
3101
3107
  return {
3102
3108
  onClickDate: (T) => {
3103
3109
  if (!(T.getFullYear() === m.getFullYear() && T.getMonth() === m.getMonth()))
@@ -3105,7 +3111,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3105
3111
  const U = (j, O) => t?.(
3106
3112
  js(
3107
3113
  j,
3108
- (Y) => le(Y, n),
3114
+ (H) => le(H, n),
3109
3115
  O
3110
3116
  )
3111
3117
  );
@@ -3135,7 +3141,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3135
3141
  "startDate"
3136
3142
  ), c("endDate"));
3137
3143
  },
3138
- onValueChangeByInputs: F,
3144
+ onValueChangeByInputs: Y,
3139
3145
  isValidDateRange: E,
3140
3146
  monthPickerButtonRef: g,
3141
3147
  calendarId: u,
@@ -3147,7 +3153,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3147
3153
  todayIsInVisibleMonth: I,
3148
3154
  hoverDate: B,
3149
3155
  setHoverDate: R,
3150
- hoverAnchor: H,
3156
+ hoverAnchor: F,
3151
3157
  hoverHighlightDirection: q,
3152
3158
  selectedStartDate: p,
3153
3159
  selectedEndDate: y,
@@ -3376,11 +3382,11 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3376
3382
  hoverHighlightDirection: C
3377
3383
  }) => {
3378
3384
  const m = w(
3379
- async (F) => {
3380
- const E = la(r.date, F.key), H = (E && p?.(E)) ?? !1;
3381
- E && !H && (c(E), me(r.date, E) ? document.getElementById(ft(E, f))?.focus() : (n(E), setTimeout(() => {
3385
+ async (Y) => {
3386
+ const E = la(r.date, Y.key), F = (E && p?.(E)) ?? !1;
3387
+ E && !F && (c(E), me(r.date, E) ? document.getElementById(ft(E, f))?.focus() : (n(E), setTimeout(() => {
3382
3388
  document.getElementById(ft(E, f))?.focus();
3383
- }, 10))), (F.key === "Enter" || F.code === "Space") && e(r.date);
3389
+ }, 10))), (Y.key === "Enter" || Y.code === "Space") && e(r.date);
3384
3390
  },
3385
3391
  [
3386
3392
  f,
@@ -3545,20 +3551,20 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3545
3551
  nextMonthButtonTestId: R,
3546
3552
  textInputVariant: _ = "standard",
3547
3553
  autoFocusStartDate: A,
3548
- autoFocusEndDate: F
3554
+ autoFocusEndDate: Y
3549
3555
  }) => {
3550
- const [E, H] = M(!1), [q, J] = M(!1), [T, K] = M({
3556
+ const [E, F] = M(!1), [q, J] = M(!1), [T, K] = M({
3551
3557
  // Sane defaults, this will be updated with actual data from DOM.
3552
3558
  width: 336,
3553
3559
  height: 66
3554
- }), [U, j] = M(void 0), O = $(null), Y = $(null), X = (ee) => {
3555
- ee === "startDate" ? O.current?.focus() : ee === "endDate" && Y.current?.focus();
3560
+ }), [U, j] = M(void 0), O = $(null), H = $(null), X = (ee) => {
3561
+ ee === "startDate" ? O.current?.focus() : ee === "endDate" && H.current?.focus();
3556
3562
  }, re = S === "large" ? "8.8rem" : "6.6rem", oe = $(!1), ue = w((ee) => {
3557
3563
  j(ee), oe.current = !0, J(!0), setTimeout(() => {
3558
- H(!0);
3564
+ F(!0);
3559
3565
  }, 10);
3560
3566
  }, []), W = w(() => {
3561
- q && (H(!1), oe.current = !1, D?.(), setTimeout(() => {
3567
+ q && (F(!1), oe.current = !1, D?.(), setTimeout(() => {
3562
3568
  oe.current || J(!1);
3563
3569
  }, 120));
3564
3570
  }, [q, D]), ze = $(null), Me = $(null);
@@ -3580,10 +3586,10 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3580
3586
  visiblePanel: Ke,
3581
3587
  visibleMonth: ce,
3582
3588
  onValueChangeByInputs: Ee,
3583
- setVisibleMonth: Hn,
3589
+ setVisibleMonth: Fn,
3584
3590
  setVisiblePanel: Nt,
3585
3591
  monthPickerButtonRef: Bt
3586
- } = De, Yn = w(
3592
+ } = De, Hn = w(
3587
3593
  (ee) => {
3588
3594
  ee.key === "Escape" && W();
3589
3595
  },
@@ -3595,7 +3601,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3595
3601
  position: "relative",
3596
3602
  className: ht.travelDateRangeInput,
3597
3603
  ref: ze,
3598
- onKeyDown: Yn,
3604
+ onKeyDown: Hn,
3599
3605
  height: T.height,
3600
3606
  width: T.width,
3601
3607
  children: [
@@ -3612,7 +3618,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3612
3618
  value: e,
3613
3619
  onValueChange: Ee,
3614
3620
  startDateRef: O,
3615
- endDateRef: Y,
3621
+ endDateRef: H,
3616
3622
  localeCode: s,
3617
3623
  startDateLabel: n,
3618
3624
  endDateLabel: r,
@@ -3622,7 +3628,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3622
3628
  placeholderWhenBlurredEndDate: u,
3623
3629
  variant: _,
3624
3630
  autoFocusStartDate: A,
3625
- autoFocusEndDate: F,
3631
+ autoFocusEndDate: Y,
3626
3632
  readOnlyOnMobile: !0
3627
3633
  }
3628
3634
  )
@@ -3643,7 +3649,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3643
3649
  shadow: "popover",
3644
3650
  borderRadius: "var(--swui-border-radius-large)",
3645
3651
  children: /* @__PURE__ */ N(ln, { gap: 3, children: [
3646
- h && /* @__PURE__ */ o(Fe, { variant: "h2", as: g, children: h }),
3652
+ h && /* @__PURE__ */ o(Ye, { variant: "h2", as: g, children: h }),
3647
3653
  /* @__PURE__ */ o(L, { height: re }),
3648
3654
  /* @__PURE__ */ o(
3649
3655
  it,
@@ -3677,7 +3683,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3677
3683
  size: S,
3678
3684
  localeCode: a,
3679
3685
  onValueChange: (ee) => {
3680
- Hn(ee), Nt("calendar"), Bt.current?.focus();
3686
+ Fn(ee), Nt("calendar"), Bt.current?.focus();
3681
3687
  },
3682
3688
  onCancel: () => {
3683
3689
  Nt("calendar"), Bt.current?.focus();
@@ -3824,7 +3830,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3824
3830
  nextMonthButtonTestId: B,
3825
3831
  textInputVariant: R = "standard"
3826
3832
  }) => {
3827
- const [_, A] = M(!1), [F, E] = M(!1), [H, q] = M({
3833
+ const [_, A] = M(!1), [Y, E] = M(!1), [F, q] = M({
3828
3834
  // Sane defaults, this will be updated with actual data from DOM.
3829
3835
  width: 336,
3830
3836
  height: 66
@@ -3833,18 +3839,18 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3833
3839
  A(!0);
3834
3840
  }, 10);
3835
3841
  }, []), U = w(() => {
3836
- F && (A(!1), T.current = !1, b?.(), setTimeout(() => {
3842
+ Y && (A(!1), T.current = !1, b?.(), setTimeout(() => {
3837
3843
  T.current || E(!1);
3838
3844
  }, 120));
3839
- }, [F, b]), j = w(() => {
3845
+ }, [Y, b]), j = w(() => {
3840
3846
  setTimeout(() => {
3841
3847
  U();
3842
3848
  }, 250);
3843
- }, [U]), O = $(null), Y = $(null);
3849
+ }, [U]), O = $(null), H = $(null);
3844
3850
  an(O, U), wn(() => {
3845
- const ce = Y.current?.offsetWidth, Ee = Y.current?.offsetHeight;
3846
- ce != null && Ee != null && (H.height !== Ee || H.width !== ce) && q({ width: ce, height: Ee });
3847
- }, [H.height, H.width]);
3851
+ const ce = H.current?.offsetWidth, Ee = H.current?.offsetHeight;
3852
+ ce != null && Ee != null && (F.height !== Ee || F.width !== ce) && q({ width: ce, height: Ee });
3853
+ }, [F.height, F.width]);
3848
3854
  const X = Pn(
3849
3855
  e,
3850
3856
  t,
@@ -3873,15 +3879,15 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3873
3879
  className: gt.travelDateInput,
3874
3880
  ref: O,
3875
3881
  onKeyDown: Ke,
3876
- height: H.height,
3877
- width: H.width,
3882
+ height: F.height,
3883
+ width: F.width,
3878
3884
  children: [
3879
3885
  /* @__PURE__ */ o(
3880
3886
  L,
3881
3887
  {
3882
3888
  position: "absolute",
3883
- ref: Y,
3884
- zIndex: F ? C : m,
3889
+ ref: H,
3890
+ zIndex: Y ? C : m,
3885
3891
  children: /* @__PURE__ */ o(
3886
3892
  An,
3887
3893
  {
@@ -3900,7 +3906,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3900
3906
  )
3901
3907
  }
3902
3908
  ),
3903
- F && /* @__PURE__ */ o(
3909
+ Y && /* @__PURE__ */ o(
3904
3910
  L,
3905
3911
  {
3906
3912
  position: "absolute",
@@ -3915,7 +3921,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
3915
3921
  shadow: "popover",
3916
3922
  borderRadius: "var(--swui-border-radius-large)",
3917
3923
  children: /* @__PURE__ */ N(ln, { gap: 3, children: [
3918
- u && /* @__PURE__ */ o(Fe, { variant: "h2", as: h, children: u }),
3924
+ u && /* @__PURE__ */ o(Ye, { variant: "h2", as: h, children: u }),
3919
3925
  /* @__PURE__ */ o(L, { height: J }),
3920
3926
  /* @__PURE__ */ o(
3921
3927
  it,
@@ -4005,11 +4011,11 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4005
4011
  onValueChangeByInputs: R,
4006
4012
  setVisibleMonth: _,
4007
4013
  setVisiblePanel: A,
4008
- monthPickerButtonRef: F,
4014
+ monthPickerButtonRef: Y,
4009
4015
  selectedDate: E
4010
4016
  } = S;
4011
4017
  return /* @__PURE__ */ N(Q, { gap: 3, children: [
4012
- d && /* @__PURE__ */ o(Fe, { variant: "h2", as: u, children: d }),
4018
+ d && /* @__PURE__ */ o(Ye, { variant: "h2", as: u, children: d }),
4013
4019
  /* @__PURE__ */ o(
4014
4020
  An,
4015
4021
  {
@@ -4060,11 +4066,11 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4060
4066
  value: B,
4061
4067
  localeCode: s,
4062
4068
  size: C,
4063
- onValueChange: (H) => {
4064
- _(H), A("calendar"), F.current?.focus();
4069
+ onValueChange: (F) => {
4070
+ _(F), A("calendar"), Y.current?.focus();
4065
4071
  },
4066
4072
  onCancel: () => {
4067
- A("calendar"), F.current?.focus();
4073
+ A("calendar"), Y.current?.focus();
4068
4074
  }
4069
4075
  }
4070
4076
  )
@@ -4096,9 +4102,9 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4096
4102
  autoFocusStartDate: I,
4097
4103
  autoFocusEndDate: B
4098
4104
  }) => {
4099
- const [R, _] = M(void 0), A = $(null), F = $(null), E = w((Y) => {
4100
- Y === "startDate" ? A.current?.focus() : Y === "endDate" && F.current?.focus();
4101
- }, []), H = Ln(
4105
+ const [R, _] = M(void 0), A = $(null), Y = $(null), E = w((H) => {
4106
+ H === "startDate" ? A.current?.focus() : H === "endDate" && Y.current?.focus();
4107
+ }, []), F = Ln(
4102
4108
  e,
4103
4109
  t,
4104
4110
  s,
@@ -4108,8 +4114,8 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4108
4114
  _,
4109
4115
  E,
4110
4116
  void 0
4111
- ), q = w((Y) => {
4112
- _(Y);
4117
+ ), q = w((H) => {
4118
+ _(H);
4113
4119
  }, []), {
4114
4120
  visiblePanel: J,
4115
4121
  visibleMonth: T,
@@ -4117,17 +4123,17 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4117
4123
  setVisibleMonth: U,
4118
4124
  setVisiblePanel: j,
4119
4125
  monthPickerButtonRef: O
4120
- } = H;
4126
+ } = F;
4121
4127
  return /* @__PURE__ */ N(Q, { gap: 3, children: [
4122
- d && /* @__PURE__ */ o(Fe, { variant: "h2", as: u, children: d }),
4128
+ d && /* @__PURE__ */ o(Ye, { variant: "h2", as: u, children: d }),
4123
4129
  /* @__PURE__ */ o(
4124
4130
  En,
4125
4131
  {
4126
- ...H,
4132
+ ...F,
4127
4133
  value: e,
4128
4134
  onValueChange: K,
4129
4135
  startDateRef: A,
4130
- endDateRef: F,
4136
+ endDateRef: Y,
4131
4137
  localeCode: s,
4132
4138
  startDateLabel: n,
4133
4139
  endDateLabel: r,
@@ -4144,7 +4150,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4144
4150
  /* @__PURE__ */ o(
4145
4151
  it,
4146
4152
  {
4147
- ...H,
4153
+ ...F,
4148
4154
  previousMonthButtonAriaLabel: c,
4149
4155
  nextMonthButtonAriaLabel: l,
4150
4156
  calendarSize: v,
@@ -4157,7 +4163,7 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4157
4163
  J === "calendar" && /* @__PURE__ */ o(
4158
4164
  ct,
4159
4165
  {
4160
- ...H,
4166
+ ...F,
4161
4167
  size: v,
4162
4168
  multiSelectable: !0,
4163
4169
  isDateDisabled: g,
@@ -4172,8 +4178,8 @@ const Ln = (e, t, n, r, s, a, i, c, l) => {
4172
4178
  value: T,
4173
4179
  size: v,
4174
4180
  localeCode: a,
4175
- onValueChange: (Y) => {
4176
- U(Y), j("calendar"), O.current?.focus();
4181
+ onValueChange: (H) => {
4182
+ U(H), j("calendar"), O.current?.focus();
4177
4183
  },
4178
4184
  onCancel: () => {
4179
4185
  j("calendar"), O.current?.focus();
@@ -4222,7 +4228,7 @@ export {
4222
4228
  yn as addDayStateHighlightsOnSingleDay,
4223
4229
  yr as addWeekRangeHighlights,
4224
4230
  $a as addWeekStateHighlights,
4225
- Ye as buildDayStateForDateRange,
4231
+ He as buildDayStateForDateRange,
4226
4232
  wr as buildDayStateForRange,
4227
4233
  br as buildDayStateForSingleMonth,
4228
4234
  Rr as calculateOverflowingMonth,