laif-ds 0.2.26 → 0.2.27

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.
@@ -3,7 +3,7 @@ import { stringify as w } from "../../comma-separated-tokens/index.js";
3
3
  import { ok as u } from "../../devlop/lib/default.js";
4
4
  import { svg as m, html as C } from "../../property-information/index.js";
5
5
  import { stringify as N } from "../../space-separated-tokens/index.js";
6
- import S from "../../../_virtual/index6.js";
6
+ import S from "../../../_virtual/index3.js";
7
7
  import { whitespace as j } from "../../hast-util-whitespace/lib/index.js";
8
8
  import { name as x } from "../../estree-util-is-identifier-name/lib/index.js";
9
9
  import { VFileMessage as h } from "../../vfile-message/lib/index.js";
@@ -14,7 +14,7 @@ import { getStyleForModifiers as je } from "./helpers/getStyleForModifiers.js";
14
14
  import { getWeekdays as Ve } from "./helpers/getWeekdays.js";
15
15
  import { getYearOptions as $e } from "./helpers/getYearOptions.js";
16
16
  import * as qe from "./labels/index.js";
17
- import { UI as a, DayFlag as ze, SelectionState as w } from "./UI.js";
17
+ import { UI as o, DayFlag as ze, SelectionState as w } from "./UI.js";
18
18
  import { useAnimation as Je } from "./useAnimation.js";
19
19
  import { useCalendar as Qe } from "./useCalendar.js";
20
20
  import { dayPickerContext as Xe } from "./useDayPicker.js";
@@ -31,7 +31,7 @@ function Bt(A) {
31
31
  from: e.selected.from ? new b(e.selected.from, e.timeZone) : void 0,
32
32
  to: e.selected.to ? new b(e.selected.to, e.timeZone) : void 0
33
33
  }));
34
- const { components: l, formatters: k, labels: T, dateLib: t, locale: oe, classNames: r } = Z(() => {
34
+ const { components: l, formatters: N, labels: T, dateLib: t, locale: oe, classNames: r } = Z(() => {
35
35
  const n = { ...nt, ...e.locale };
36
36
  return {
37
37
  dateLib: new Te({
@@ -63,62 +63,62 @@ function Bt(A) {
63
63
  e.formatters,
64
64
  e.labels,
65
65
  e.classNames
66
- ]), { captionLayout: N, mode: g, navLayout: D, numberOfMonths: K = 1, onDayBlur: R, onDayClick: C, onDayFocus: G, onDayKeyDown: H, onDayMouseEnter: _, onDayMouseLeave: I, onNextClick: U, onPrevClick: j, showWeekNumber: V, styles: c } = e, { formatCaption: $, formatDay: q, formatMonthDropdown: ne, formatWeekNumber: se, formatWeekNumberHeader: re, formatWeekdayName: ie, formatYearDropdown: le } = k, z = Qe(e, t), { days: de, months: W, navStart: E, navEnd: B, previousMonth: f, nextMonth: p, goToMonth: h } = z, x = Ke(de, e, E, B, t), { isSelected: S, select: Y, selected: M } = tt(e, t) ?? {}, { blur: J, focused: Q, isFocusTarget: me, moveFocus: X, setFocused: v } = et(e, z, x, S ?? (() => !1), t), { labelDayButton: ce, labelGridcell: ue, labelGrid: fe, labelMonthDropdown: pe, labelNav: ee, labelPrevious: ye, labelNext: he, labelWeekday: be, labelWeekNumber: Ne, labelWeekNumberHeader: ke, labelYearDropdown: De } = T, Me = Z(() => Ve(t, e.ISOWeek), [t, e.ISOWeek]), te = g !== void 0 || C !== void 0, L = y(() => {
66
+ ]), { captionLayout: k, mode: g, navLayout: M, numberOfMonths: K = 1, onDayBlur: R, onDayClick: C, onDayFocus: G, onDayKeyDown: H, onDayMouseEnter: _, onDayMouseLeave: I, onNextClick: U, onPrevClick: j, showWeekNumber: V, styles: c } = e, { formatCaption: $, formatDay: q, formatMonthDropdown: ne, formatWeekNumber: se, formatWeekNumberHeader: re, formatWeekdayName: ie, formatYearDropdown: le } = N, z = Qe(e, t), { days: de, months: W, navStart: E, navEnd: B, previousMonth: f, nextMonth: p, goToMonth: h } = z, x = Ke(de, e, E, B, t), { isSelected: S, select: Y, selected: D } = tt(e, t) ?? {}, { blur: J, focused: Q, isFocusTarget: me, moveFocus: X, setFocused: v } = et(e, z, x, S ?? (() => !1), t), { labelDayButton: ce, labelGridcell: ue, labelGrid: fe, labelMonthDropdown: pe, labelNav: ee, labelPrevious: ye, labelNext: he, labelWeekday: be, labelWeekNumber: ke, labelWeekNumberHeader: Ne, labelYearDropdown: Me } = T, De = Z(() => Ve(t, e.ISOWeek), [t, e.ISOWeek]), te = g !== void 0 || C !== void 0, O = y(() => {
67
67
  f && (h(f), j?.(f));
68
- }, [f, h, j]), O = y(() => {
68
+ }, [f, h, j]), L = y(() => {
69
69
  p && (h(p), U?.(p));
70
- }, [h, p, U]), ve = y((n, d) => (o) => {
71
- o.preventDefault(), o.stopPropagation(), v(n), Y?.(n.date, d, o), C?.(n.date, d, o);
72
- }, [Y, C, v]), we = y((n, d) => (o) => {
73
- v(n), G?.(n.date, d, o);
74
- }, [G, v]), ge = y((n, d) => (o) => {
75
- J(), R?.(n.date, d, o);
76
- }, [J, R]), Ce = y((n, d) => (o) => {
77
- const m = {
70
+ }, [h, p, U]), ve = y((n, m) => (a) => {
71
+ a.preventDefault(), a.stopPropagation(), v(n), Y?.(n.date, m, a), C?.(n.date, m, a);
72
+ }, [Y, C, v]), we = y((n, m) => (a) => {
73
+ v(n), G?.(n.date, m, a);
74
+ }, [G, v]), ge = y((n, m) => (a) => {
75
+ J(), R?.(n.date, m, a);
76
+ }, [J, R]), Ce = y((n, m) => (a) => {
77
+ const d = {
78
78
  ArrowLeft: [
79
- o.shiftKey ? "month" : "day",
79
+ a.shiftKey ? "month" : "day",
80
80
  e.dir === "rtl" ? "after" : "before"
81
81
  ],
82
82
  ArrowRight: [
83
- o.shiftKey ? "month" : "day",
83
+ a.shiftKey ? "month" : "day",
84
84
  e.dir === "rtl" ? "before" : "after"
85
85
  ],
86
- ArrowDown: [o.shiftKey ? "year" : "week", "after"],
87
- ArrowUp: [o.shiftKey ? "year" : "week", "before"],
88
- PageUp: [o.shiftKey ? "year" : "month", "before"],
89
- PageDown: [o.shiftKey ? "year" : "month", "after"],
86
+ ArrowDown: [a.shiftKey ? "year" : "week", "after"],
87
+ ArrowUp: [a.shiftKey ? "year" : "week", "before"],
88
+ PageUp: [a.shiftKey ? "year" : "month", "before"],
89
+ PageDown: [a.shiftKey ? "year" : "month", "after"],
90
90
  Home: ["startOfWeek", "before"],
91
91
  End: ["endOfWeek", "after"]
92
92
  };
93
- if (m[o.key]) {
94
- o.preventDefault(), o.stopPropagation();
95
- const [u, s] = m[o.key];
93
+ if (d[a.key]) {
94
+ a.preventDefault(), a.stopPropagation();
95
+ const [u, s] = d[a.key];
96
96
  X(u, s);
97
97
  }
98
- H?.(n.date, d, o);
99
- }, [X, H, e.dir]), We = y((n, d) => (o) => {
100
- _?.(n.date, d, o);
101
- }, [_]), Ee = y((n, d) => (o) => {
102
- I?.(n.date, d, o);
103
- }, [I]), Be = y((n) => (d) => {
104
- const o = Number(d.target.value), m = t.setMonth(t.startOfMonth(n), o);
105
- h(m);
106
- }, [t, h]), xe = y((n) => (d) => {
107
- const o = Number(d.target.value), m = t.setYear(t.startOfMonth(n), o);
108
- h(m);
98
+ H?.(n.date, m, a);
99
+ }, [X, H, e.dir]), We = y((n, m) => (a) => {
100
+ _?.(n.date, m, a);
101
+ }, [_]), Ee = y((n, m) => (a) => {
102
+ I?.(n.date, m, a);
103
+ }, [I]), Be = y((n) => (m) => {
104
+ const a = Number(m.target.value), d = t.setMonth(t.startOfMonth(n), a);
105
+ h(d);
106
+ }, [t, h]), xe = y((n) => (m) => {
107
+ const a = Number(m.target.value), d = t.setYear(t.startOfMonth(n), a);
108
+ h(d);
109
109
  }, [t, h]), { className: Se, style: Ye } = Z(() => ({
110
- className: [r[a.Root], e.className].filter(Boolean).join(" "),
111
- style: { ...c?.[a.Root], ...e.style }
112
- }), [r, e.className, e.style, c]), Le = He(e), ae = Ae(null);
110
+ className: [r[o.Root], e.className].filter(Boolean).join(" "),
111
+ style: { ...c?.[o.Root], ...e.style }
112
+ }), [r, e.className, e.style, c]), Oe = He(e), ae = Ae(null);
113
113
  Je(ae, !!e.animate, {
114
114
  classNames: r,
115
115
  months: W,
116
116
  focused: Q,
117
117
  dateLib: t
118
118
  });
119
- const Oe = {
119
+ const Le = {
120
120
  dayPickerProps: e,
121
- selected: M,
121
+ selected: D,
122
122
  select: Y,
123
123
  isSelected: S,
124
124
  months: W,
@@ -130,39 +130,41 @@ function Bt(A) {
130
130
  classNames: r,
131
131
  styles: c,
132
132
  labels: T,
133
- formatters: k
133
+ formatters: N
134
134
  };
135
135
  return i.createElement(
136
136
  Xe.Provider,
137
- { value: Oe },
137
+ { value: Le },
138
138
  i.createElement(
139
139
  l.Root,
140
- { rootRef: e.animate ? ae : void 0, className: Se, style: Ye, dir: e.dir, id: e.id, lang: e.lang, nonce: e.nonce, title: e.title, role: e.role, "aria-label": e["aria-label"], ...Le },
140
+ { rootRef: e.animate ? ae : void 0, className: Se, style: Ye, dir: e.dir, id: e.id, lang: e.lang, nonce: e.nonce, title: e.title, role: e.role, "aria-label": e["aria-label"], "aria-labelledby": e["aria-labelledby"], ...Oe },
141
141
  i.createElement(
142
142
  l.Months,
143
- { className: r[a.Months], style: c?.[a.Months] },
144
- !e.hideNavigation && !D && i.createElement(l.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: r[a.Nav], style: c?.[a.Nav], "aria-label": ee(), onPreviousClick: L, onNextClick: O, previousMonth: f, nextMonth: p }),
145
- W.map((n, d) => i.createElement(
143
+ { className: r[o.Months], style: c?.[o.Months] },
144
+ !e.hideNavigation && !M && i.createElement(l.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: r[o.Nav], style: c?.[o.Nav], "aria-label": ee(), onPreviousClick: O, onNextClick: L, previousMonth: f, nextMonth: p }),
145
+ W.map((n, m) => i.createElement(
146
146
  l.Month,
147
147
  {
148
148
  "data-animated-month": e.animate ? "true" : void 0,
149
- className: r[a.Month],
150
- style: c?.[a.Month],
149
+ className: r[o.Month],
150
+ style: c?.[o.Month],
151
151
  // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
152
- key: d,
153
- displayIndex: d,
152
+ key: m,
153
+ displayIndex: m,
154
154
  calendarMonth: n
155
155
  },
156
- D === "around" && !e.hideNavigation && d === 0 && i.createElement(
156
+ M === "around" && !e.hideNavigation && m === 0 && i.createElement(
157
157
  l.PreviousMonthButton,
158
- { type: "button", className: r[a.PreviousMonthButton], tabIndex: f ? void 0 : -1, "aria-disabled": f ? void 0 : !0, "aria-label": ye(f), onClick: L, "data-animated-button": e.animate ? "true" : void 0 },
159
- i.createElement(l.Chevron, { disabled: f ? void 0 : !0, className: r[a.Chevron], orientation: e.dir === "rtl" ? "right" : "left" })
158
+ { type: "button", className: r[o.PreviousMonthButton], tabIndex: f ? void 0 : -1, "aria-disabled": f ? void 0 : !0, "aria-label": ye(f), onClick: O, "data-animated-button": e.animate ? "true" : void 0 },
159
+ i.createElement(l.Chevron, { disabled: f ? void 0 : !0, className: r[o.Chevron], orientation: e.dir === "rtl" ? "right" : "left" })
160
160
  ),
161
- i.createElement(l.MonthCaption, { "data-animated-caption": e.animate ? "true" : void 0, className: r[a.MonthCaption], style: c?.[a.MonthCaption], calendarMonth: n, displayIndex: d }, N?.startsWith("dropdown") ? i.createElement(
161
+ i.createElement(l.MonthCaption, { "data-animated-caption": e.animate ? "true" : void 0, className: r[o.MonthCaption], style: c?.[o.MonthCaption], calendarMonth: n, displayIndex: m }, k?.startsWith("dropdown") ? i.createElement(
162
162
  l.DropdownNav,
163
- { className: r[a.Dropdowns], style: c?.[a.Dropdowns] },
164
- N === "dropdown" || N === "dropdown-months" ? i.createElement(l.MonthsDropdown, { className: r[a.MonthsDropdown], "aria-label": pe(), classNames: r, components: l, disabled: !!e.disableNavigation, onChange: Be(n.date), options: Ue(n.date, E, B, k, t), style: c?.[a.Dropdown], value: t.getMonth(n.date) }) : i.createElement("span", null, ne(n.date, t)),
165
- N === "dropdown" || N === "dropdown-years" ? i.createElement(l.YearsDropdown, { className: r[a.YearsDropdown], "aria-label": De(t.options), classNames: r, components: l, disabled: !!e.disableNavigation, onChange: xe(n.date), options: $e(E, B, k, t, !!e.reverseYears), style: c?.[a.Dropdown], value: t.getYear(n.date) }) : i.createElement("span", null, le(n.date, t)),
163
+ { className: r[o.Dropdowns], style: c?.[o.Dropdowns] },
164
+ (() => {
165
+ const a = k === "dropdown" || k === "dropdown-months" ? i.createElement(l.MonthsDropdown, { key: "month", className: r[o.MonthsDropdown], "aria-label": pe(), classNames: r, components: l, disabled: !!e.disableNavigation, onChange: Be(n.date), options: Ue(n.date, E, B, N, t), style: c?.[o.Dropdown], value: t.getMonth(n.date) }) : i.createElement("span", { key: "month" }, ne(n.date, t)), d = k === "dropdown" || k === "dropdown-years" ? i.createElement(l.YearsDropdown, { key: "year", className: r[o.YearsDropdown], "aria-label": Me(t.options), classNames: r, components: l, disabled: !!e.disableNavigation, onChange: xe(n.date), options: $e(E, B, N, t, !!e.reverseYears), style: c?.[o.Dropdown], value: t.getYear(n.date) }) : i.createElement("span", { key: "year" }, le(n.date, t));
166
+ return t.getMonthYearOrder() === "year-first" ? [d, a] : [a, d];
167
+ })(),
166
168
  i.createElement("span", { role: "status", "aria-live": "polite", style: {
167
169
  border: 0,
168
170
  clip: "rect(0 0 0 0)",
@@ -177,40 +179,40 @@ function Bt(A) {
177
179
  } }, $(n.date, t.options, t))
178
180
  ) : (
179
181
  // biome-ignore lint/a11y/useSemanticElements: breaking change
180
- i.createElement(l.CaptionLabel, { className: r[a.CaptionLabel], role: "status", "aria-live": "polite" }, $(n.date, t.options, t))
182
+ i.createElement(l.CaptionLabel, { className: r[o.CaptionLabel], role: "status", "aria-live": "polite" }, $(n.date, t.options, t))
181
183
  )),
182
- D === "around" && !e.hideNavigation && d === K - 1 && i.createElement(
184
+ M === "around" && !e.hideNavigation && m === K - 1 && i.createElement(
183
185
  l.NextMonthButton,
184
- { type: "button", className: r[a.NextMonthButton], tabIndex: p ? void 0 : -1, "aria-disabled": p ? void 0 : !0, "aria-label": he(p), onClick: O, "data-animated-button": e.animate ? "true" : void 0 },
185
- i.createElement(l.Chevron, { disabled: p ? void 0 : !0, className: r[a.Chevron], orientation: e.dir === "rtl" ? "left" : "right" })
186
+ { type: "button", className: r[o.NextMonthButton], tabIndex: p ? void 0 : -1, "aria-disabled": p ? void 0 : !0, "aria-label": he(p), onClick: L, "data-animated-button": e.animate ? "true" : void 0 },
187
+ i.createElement(l.Chevron, { disabled: p ? void 0 : !0, className: r[o.Chevron], orientation: e.dir === "rtl" ? "left" : "right" })
186
188
  ),
187
- d === K - 1 && D === "after" && !e.hideNavigation && i.createElement(l.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: r[a.Nav], style: c?.[a.Nav], "aria-label": ee(), onPreviousClick: L, onNextClick: O, previousMonth: f, nextMonth: p }),
189
+ m === K - 1 && M === "after" && !e.hideNavigation && i.createElement(l.Nav, { "data-animated-nav": e.animate ? "true" : void 0, className: r[o.Nav], style: c?.[o.Nav], "aria-label": ee(), onPreviousClick: O, onNextClick: L, previousMonth: f, nextMonth: p }),
188
190
  i.createElement(
189
191
  l.MonthGrid,
190
- { role: "grid", "aria-multiselectable": g === "multiple" || g === "range", "aria-label": fe(n.date, t.options, t) || void 0, className: r[a.MonthGrid], style: c?.[a.MonthGrid] },
192
+ { role: "grid", "aria-multiselectable": g === "multiple" || g === "range", "aria-label": fe(n.date, t.options, t) || void 0, className: r[o.MonthGrid], style: c?.[o.MonthGrid] },
191
193
  !e.hideWeekdays && i.createElement(
192
194
  l.Weekdays,
193
- { "data-animated-weekdays": e.animate ? "true" : void 0, className: r[a.Weekdays], style: c?.[a.Weekdays] },
194
- V && i.createElement(l.WeekNumberHeader, { "aria-label": ke(t.options), className: r[a.WeekNumberHeader], style: c?.[a.WeekNumberHeader], scope: "col" }, re()),
195
- Me.map((o) => i.createElement(l.Weekday, { "aria-label": be(o, t.options, t), className: r[a.Weekday], key: String(o), style: c?.[a.Weekday], scope: "col" }, ie(o, t.options, t)))
195
+ { "data-animated-weekdays": e.animate ? "true" : void 0, className: r[o.Weekdays], style: c?.[o.Weekdays] },
196
+ V && i.createElement(l.WeekNumberHeader, { "aria-label": Ne(t.options), className: r[o.WeekNumberHeader], style: c?.[o.WeekNumberHeader], scope: "col" }, re()),
197
+ De.map((a) => i.createElement(l.Weekday, { "aria-label": be(a, t.options, t), className: r[o.Weekday], key: String(a), style: c?.[o.Weekday], scope: "col" }, ie(a, t.options, t)))
196
198
  ),
197
- i.createElement(l.Weeks, { "data-animated-weeks": e.animate ? "true" : void 0, className: r[a.Weeks], style: c?.[a.Weeks] }, n.weeks.map((o) => i.createElement(
199
+ i.createElement(l.Weeks, { "data-animated-weeks": e.animate ? "true" : void 0, className: r[o.Weeks], style: c?.[o.Weeks] }, n.weeks.map((a) => i.createElement(
198
200
  l.Week,
199
- { className: r[a.Week], key: o.weekNumber, style: c?.[a.Week], week: o },
201
+ { className: r[o.Week], key: a.weekNumber, style: c?.[o.Week], week: a },
200
202
  V && // biome-ignore lint/a11y/useSemanticElements: react component
201
- i.createElement(l.WeekNumber, { week: o, style: c?.[a.WeekNumber], "aria-label": Ne(o.weekNumber, {
203
+ i.createElement(l.WeekNumber, { week: a, style: c?.[o.WeekNumber], "aria-label": ke(a.weekNumber, {
202
204
  locale: oe
203
- }), className: r[a.WeekNumber], scope: "row", role: "rowheader" }, se(o.weekNumber, t)),
204
- o.days.map((m) => {
205
- const { date: u } = m, s = x(m);
206
- if (s[ze.focused] = !s.hidden && !!Q?.isEqualTo(m), s[w.selected] = S?.(u) || s.selected, ot(M)) {
207
- const { from: P, to: F } = M;
208
- s[w.range_start] = !!(P && F && t.isSameDay(u, P)), s[w.range_end] = !!(P && F && t.isSameDay(u, F)), s[w.range_middle] = at(M, u, !0, t);
205
+ }), className: r[o.WeekNumber], scope: "row", role: "rowheader" }, se(a.weekNumber, t)),
206
+ a.days.map((d) => {
207
+ const { date: u } = d, s = x(d);
208
+ if (s[ze.focused] = !s.hidden && !!Q?.isEqualTo(d), s[w.selected] = S?.(u) || s.selected, ot(D)) {
209
+ const { from: P, to: F } = D;
210
+ s[w.range_start] = !!(P && F && t.isSameDay(u, P)), s[w.range_end] = !!(P && F && t.isSameDay(u, F)), s[w.range_middle] = at(D, u, !0, t);
209
211
  }
210
212
  const Pe = je(s, c, e.modifiersStyles), Fe = Re(s, r, e.modifiersClassNames), Ze = !te && !s.hidden ? ue(u, s, t.options, t) : void 0;
211
213
  return (
212
214
  // biome-ignore lint/a11y/useSemanticElements: react component
213
- i.createElement(l.Day, { key: `${t.format(u, "yyyy-MM-dd")}_${t.format(m.displayMonth, "yyyy-MM")}`, day: m, modifiers: s, className: Fe.join(" "), style: Pe, role: "gridcell", "aria-selected": s.selected || void 0, "aria-label": Ze, "data-day": t.format(u, "yyyy-MM-dd"), "data-month": m.outside ? t.format(u, "yyyy-MM") : void 0, "data-selected": s.selected || void 0, "data-disabled": s.disabled || void 0, "data-hidden": s.hidden || void 0, "data-outside": m.outside || void 0, "data-focused": s.focused || void 0, "data-today": s.today || void 0 }, !s.hidden && te ? i.createElement(l.DayButton, { className: r[a.DayButton], style: c?.[a.DayButton], type: "button", day: m, modifiers: s, disabled: s.disabled || void 0, tabIndex: me(m) ? 0 : -1, "aria-label": ce(u, s, t.options, t), onClick: ve(m, s), onBlur: ge(m, s), onFocus: we(m, s), onKeyDown: Ce(m, s), onMouseEnter: We(m, s), onMouseLeave: Ee(m, s) }, q(u, t.options, t)) : !s.hidden && q(m.date, t.options, t))
215
+ i.createElement(l.Day, { key: `${t.format(u, "yyyy-MM-dd")}_${t.format(d.displayMonth, "yyyy-MM")}`, day: d, modifiers: s, className: Fe.join(" "), style: Pe, role: "gridcell", "aria-selected": s.selected || void 0, "aria-label": Ze, "data-day": t.format(u, "yyyy-MM-dd"), "data-month": d.outside ? t.format(u, "yyyy-MM") : void 0, "data-selected": s.selected || void 0, "data-disabled": s.disabled || void 0, "data-hidden": s.hidden || void 0, "data-outside": d.outside || void 0, "data-focused": s.focused || void 0, "data-today": s.today || void 0 }, !s.hidden && te ? i.createElement(l.DayButton, { className: r[o.DayButton], style: c?.[o.DayButton], type: "button", day: d, modifiers: s, disabled: s.disabled || void 0, tabIndex: me(d) ? 0 : -1, "aria-label": ce(u, s, t.options, t), onClick: ve(d, s), onBlur: ge(d, s), onFocus: we(d, s), onKeyDown: Ce(d, s), onMouseEnter: We(d, s), onMouseLeave: Ee(d, s) }, q(u, t.options, t)) : !s.hidden && q(d.date, t.options, t))
214
216
  );
215
217
  })
216
218
  )))
@@ -218,7 +220,7 @@ function Bt(A) {
218
220
  ))
219
221
  ),
220
222
  e.footer && // biome-ignore lint/a11y/useSemanticElements: react component
221
- i.createElement(l.Footer, { className: r[a.Footer], style: c?.[a.Footer], role: "status", "aria-live": "polite" }, e.footer)
223
+ i.createElement(l.Footer, { className: r[o.Footer], style: c?.[o.Footer], role: "status", "aria-live": "polite" }, e.footer)
222
224
  )
223
225
  );
224
226
  }
@@ -1,52 +1,52 @@
1
1
  "use client";
2
- import { TZDate as n } from "../../../../@date-fns/tz/date/index.js";
2
+ import { TZDate as h } from "../../../../@date-fns/tz/date/index.js";
3
3
  import "../../../../@date-fns/tz/date/mini.js";
4
- import { enUS as h } from "../../../../date-fns/locale/en-US.js";
5
- import { endOfBroadcastWeek as a } from "../helpers/endOfBroadcastWeek.js";
6
- import { startOfBroadcastWeek as f } from "../helpers/startOfBroadcastWeek.js";
7
- import { addDays as d } from "../../../../date-fns/addDays.js";
8
- import { addMonths as m } from "../../../../date-fns/addMonths.js";
9
- import { addWeeks as v } from "../../../../date-fns/addWeeks.js";
10
- import { addYears as p } from "../../../../date-fns/addYears.js";
11
- import { differenceInCalendarDays as O } from "../../../../date-fns/differenceInCalendarDays.js";
12
- import { differenceInCalendarMonths as u } from "../../../../date-fns/differenceInCalendarMonths.js";
13
- import { eachMonthOfInterval as c } from "../../../../date-fns/eachMonthOfInterval.js";
14
- import { endOfISOWeek as k } from "../../../../date-fns/endOfISOWeek.js";
15
- import { endOfMonth as D } from "../../../../date-fns/endOfMonth.js";
16
- import { endOfWeek as M } from "../../../../date-fns/endOfWeek.js";
17
- import { endOfYear as W } from "../../../../date-fns/endOfYear.js";
18
- import { formatDate as l } from "../../../../date-fns/format.js";
19
- import { getISOWeek as S } from "../../../../date-fns/getISOWeek.js";
20
- import { getMonth as Y } from "../../../../date-fns/getMonth.js";
21
- import { getYear as g } from "../../../../date-fns/getYear.js";
4
+ import { enUS as a } from "../../../../date-fns/locale/en-US.js";
5
+ import { endOfBroadcastWeek as f } from "../helpers/endOfBroadcastWeek.js";
6
+ import { startOfBroadcastWeek as d } from "../helpers/startOfBroadcastWeek.js";
7
+ import { addDays as m } from "../../../../date-fns/addDays.js";
8
+ import { addMonths as v } from "../../../../date-fns/addMonths.js";
9
+ import { addWeeks as p } from "../../../../date-fns/addWeeks.js";
10
+ import { addYears as O } from "../../../../date-fns/addYears.js";
11
+ import { differenceInCalendarDays as u } from "../../../../date-fns/differenceInCalendarDays.js";
12
+ import { differenceInCalendarMonths as c } from "../../../../date-fns/differenceInCalendarMonths.js";
13
+ import { eachMonthOfInterval as l } from "../../../../date-fns/eachMonthOfInterval.js";
14
+ import { endOfISOWeek as M } from "../../../../date-fns/endOfISOWeek.js";
15
+ import { endOfMonth as k } from "../../../../date-fns/endOfMonth.js";
16
+ import { endOfWeek as W } from "../../../../date-fns/endOfWeek.js";
17
+ import { endOfYear as D } from "../../../../date-fns/endOfYear.js";
18
+ import { formatDate as S } from "../../../../date-fns/format.js";
19
+ import { getISOWeek as g } from "../../../../date-fns/getISOWeek.js";
20
+ import { getMonth as y } from "../../../../date-fns/getMonth.js";
21
+ import { getYear as Y } from "../../../../date-fns/getYear.js";
22
22
  import { getWeek as I } from "../../../../date-fns/getWeek.js";
23
- import { isAfter as y } from "../../../../date-fns/isAfter.js";
24
- import { isBefore as B } from "../../../../date-fns/isBefore.js";
25
- import { isDate as w } from "../../../../date-fns/isDate.js";
26
- import { isSameDay as b } from "../../../../date-fns/isSameDay.js";
27
- import { isSameMonth as C } from "../../../../date-fns/isSameMonth.js";
28
- import { isSameYear as _ } from "../../../../date-fns/isSameYear.js";
29
- import { max as Z } from "../../../../date-fns/max.js";
30
- import { min as A } from "../../../../date-fns/min.js";
31
- import { setMonth as x } from "../../../../date-fns/setMonth.js";
23
+ import { isAfter as B } from "../../../../date-fns/isAfter.js";
24
+ import { isBefore as w } from "../../../../date-fns/isBefore.js";
25
+ import { isDate as L } from "../../../../date-fns/isDate.js";
26
+ import { isSameDay as C } from "../../../../date-fns/isSameDay.js";
27
+ import { isSameMonth as Z } from "../../../../date-fns/isSameMonth.js";
28
+ import { isSameYear as b } from "../../../../date-fns/isSameYear.js";
29
+ import { max as z } from "../../../../date-fns/max.js";
30
+ import { min as F } from "../../../../date-fns/min.js";
31
+ import { setMonth as A } from "../../../../date-fns/setMonth.js";
32
32
  import { setYear as N } from "../../../../date-fns/setYear.js";
33
- import { startOfDay as U } from "../../../../date-fns/startOfDay.js";
34
- import { startOfISOWeek as z } from "../../../../date-fns/startOfISOWeek.js";
35
- import { startOfMonth as F } from "../../../../date-fns/startOfMonth.js";
36
- import { startOfWeek as j } from "../../../../date-fns/startOfWeek.js";
37
- import { startOfYear as q } from "../../../../date-fns/startOfYear.js";
38
- class E {
33
+ import { startOfDay as _ } from "../../../../date-fns/startOfDay.js";
34
+ import { startOfISOWeek as j } from "../../../../date-fns/startOfISOWeek.js";
35
+ import { startOfMonth as x } from "../../../../date-fns/startOfMonth.js";
36
+ import { startOfWeek as H } from "../../../../date-fns/startOfWeek.js";
37
+ import { startOfYear as K } from "../../../../date-fns/startOfYear.js";
38
+ class o {
39
39
  /**
40
40
  * Creates an instance of `DateLib`.
41
41
  *
42
42
  * @param options Configuration options for the date library.
43
43
  * @param overrides Custom overrides for the date library functions.
44
44
  */
45
- constructor(t, s) {
46
- this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? n.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, e, i) => this.overrides?.newDate ? this.overrides.newDate(r, e, i) : this.options.timeZone ? new n(r, e, i, this.options.timeZone) : new Date(r, e, i), this.addDays = (r, e) => this.overrides?.addDays ? this.overrides.addDays(r, e) : d(r, e), this.addMonths = (r, e) => this.overrides?.addMonths ? this.overrides.addMonths(r, e) : m(r, e), this.addWeeks = (r, e) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, e) : v(r, e), this.addYears = (r, e) => this.overrides?.addYears ? this.overrides.addYears(r, e) : p(r, e), this.differenceInCalendarDays = (r, e) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, e) : O(r, e), this.differenceInCalendarMonths = (r, e) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, e) : u(r, e), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : c(r), this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : a(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : k(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : D(r), this.endOfWeek = (r, e) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, e) : M(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : W(r), this.format = (r, e, i) => {
47
- const o = this.overrides?.format ? this.overrides.format(r, e, this.options) : l(r, e, this.options);
48
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(o) : o;
49
- }, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : S(r), this.getMonth = (r, e) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : Y(r, this.options), this.getYear = (r, e) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : g(r, this.options), this.getWeek = (r, e) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : I(r, this.options), this.isAfter = (r, e) => this.overrides?.isAfter ? this.overrides.isAfter(r, e) : y(r, e), this.isBefore = (r, e) => this.overrides?.isBefore ? this.overrides.isBefore(r, e) : B(r, e), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : w(r), this.isSameDay = (r, e) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, e) : b(r, e), this.isSameMonth = (r, e) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, e) : C(r, e), this.isSameYear = (r, e) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, e) : _(r, e), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : Z(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : A(r), this.setMonth = (r, e) => this.overrides?.setMonth ? this.overrides.setMonth(r, e) : x(r, e), this.setYear = (r, e) => this.overrides?.setYear ? this.overrides.setYear(r, e) : N(r, e), this.startOfBroadcastWeek = (r, e) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : f(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : U(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : z(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : F(r), this.startOfWeek = (r, e) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : j(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : q(r), this.options = { locale: h, ...t }, this.overrides = s;
45
+ constructor(t, i) {
46
+ this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? h.tz(this.options.timeZone) : new this.Date(), this.newDate = (r, e, s) => this.overrides?.newDate ? this.overrides.newDate(r, e, s) : this.options.timeZone ? new h(r, e, s, this.options.timeZone) : new Date(r, e, s), this.addDays = (r, e) => this.overrides?.addDays ? this.overrides.addDays(r, e) : m(r, e), this.addMonths = (r, e) => this.overrides?.addMonths ? this.overrides.addMonths(r, e) : v(r, e), this.addWeeks = (r, e) => this.overrides?.addWeeks ? this.overrides.addWeeks(r, e) : p(r, e), this.addYears = (r, e) => this.overrides?.addYears ? this.overrides.addYears(r, e) : O(r, e), this.differenceInCalendarDays = (r, e) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, e) : u(r, e), this.differenceInCalendarMonths = (r, e) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, e) : c(r, e), this.eachMonthOfInterval = (r) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : l(r), this.endOfBroadcastWeek = (r) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : f(r, this), this.endOfISOWeek = (r) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(r) : M(r), this.endOfMonth = (r) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(r) : k(r), this.endOfWeek = (r, e) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(r, e) : W(r, this.options), this.endOfYear = (r) => this.overrides?.endOfYear ? this.overrides.endOfYear(r) : D(r), this.format = (r, e, s) => {
47
+ const n = this.overrides?.format ? this.overrides.format(r, e, this.options) : S(r, e, this.options);
48
+ return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(n) : n;
49
+ }, this.getISOWeek = (r) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(r) : g(r), this.getMonth = (r, e) => this.overrides?.getMonth ? this.overrides.getMonth(r, this.options) : y(r, this.options), this.getYear = (r, e) => this.overrides?.getYear ? this.overrides.getYear(r, this.options) : Y(r, this.options), this.getWeek = (r, e) => this.overrides?.getWeek ? this.overrides.getWeek(r, this.options) : I(r, this.options), this.isAfter = (r, e) => this.overrides?.isAfter ? this.overrides.isAfter(r, e) : B(r, e), this.isBefore = (r, e) => this.overrides?.isBefore ? this.overrides.isBefore(r, e) : w(r, e), this.isDate = (r) => this.overrides?.isDate ? this.overrides.isDate(r) : L(r), this.isSameDay = (r, e) => this.overrides?.isSameDay ? this.overrides.isSameDay(r, e) : C(r, e), this.isSameMonth = (r, e) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(r, e) : Z(r, e), this.isSameYear = (r, e) => this.overrides?.isSameYear ? this.overrides.isSameYear(r, e) : b(r, e), this.max = (r) => this.overrides?.max ? this.overrides.max(r) : z(r), this.min = (r) => this.overrides?.min ? this.overrides.min(r) : F(r), this.setMonth = (r, e) => this.overrides?.setMonth ? this.overrides.setMonth(r, e) : A(r, e), this.setYear = (r, e) => this.overrides?.setYear ? this.overrides.setYear(r, e) : N(r, e), this.startOfBroadcastWeek = (r, e) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : d(r, this), this.startOfDay = (r) => this.overrides?.startOfDay ? this.overrides.startOfDay(r) : _(r), this.startOfISOWeek = (r) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(r) : j(r), this.startOfMonth = (r) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(r) : x(r), this.startOfWeek = (r, e) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(r, this.options) : H(r, this.options), this.startOfYear = (r) => this.overrides?.startOfYear ? this.overrides.startOfYear(r) : K(r), this.options = { locale: a, ...t }, this.overrides = i;
50
50
  }
51
51
  /**
52
52
  * Generates a mapping of Arabic digits (0-9) to the target numbering system
@@ -56,11 +56,11 @@ class E {
56
56
  * @returns A record mapping Arabic digits to the target numerals.
57
57
  */
58
58
  getDigitMap() {
59
- const { numerals: t = "latn" } = this.options, s = new Intl.NumberFormat("en-US", {
59
+ const { numerals: t = "latn" } = this.options, i = new Intl.NumberFormat("en-US", {
60
60
  numberingSystem: t
61
61
  }), r = {};
62
62
  for (let e = 0; e < 10; e++)
63
- r[e.toString()] = s.format(e);
63
+ r[e.toString()] = i.format(e);
64
64
  return r;
65
65
  }
66
66
  /**
@@ -71,8 +71,8 @@ class E {
71
71
  * @returns The string with digits replaced.
72
72
  */
73
73
  replaceDigits(t) {
74
- const s = this.getDigitMap();
75
- return t.replace(/\d/g, (r) => s[r] || r);
74
+ const i = this.getDigitMap();
75
+ return t.replace(/\d/g, (r) => i[r] || r);
76
76
  }
77
77
  /**
78
78
  * Formats a number using the configured numbering system.
@@ -84,10 +84,57 @@ class E {
84
84
  formatNumber(t) {
85
85
  return this.replaceDigits(t.toString());
86
86
  }
87
+ /**
88
+ * Returns the preferred ordering for month and year labels for the current
89
+ * locale.
90
+ */
91
+ getMonthYearOrder() {
92
+ const t = this.options.locale?.code;
93
+ return t && o.yearFirstLocales.has(t) ? "year-first" : "month-first";
94
+ }
95
+ /**
96
+ * Formats the month/year pair respecting locale conventions.
97
+ *
98
+ * @since 9.11.0
99
+ */
100
+ formatMonthYear(t) {
101
+ const { locale: i, timeZone: r, numerals: e } = this.options, s = i?.code;
102
+ if (s && o.yearFirstLocales.has(s))
103
+ try {
104
+ return new Intl.DateTimeFormat(s, {
105
+ month: "long",
106
+ year: "numeric",
107
+ timeZone: r,
108
+ numberingSystem: e
109
+ }).format(t);
110
+ } catch {
111
+ }
112
+ const n = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
113
+ return this.format(t, n);
114
+ }
87
115
  }
88
- const Ir = new E();
116
+ o.yearFirstLocales = /* @__PURE__ */ new Set([
117
+ "eu",
118
+ "hu",
119
+ "ja",
120
+ "ja-Hira",
121
+ "ja-JP",
122
+ "ko",
123
+ "ko-KR",
124
+ "lt",
125
+ "lt-LT",
126
+ "lv",
127
+ "lv-LV",
128
+ "mn",
129
+ "mn-MN",
130
+ "zh",
131
+ "zh-CN",
132
+ "zh-HK",
133
+ "zh-TW"
134
+ ]);
135
+ const Ir = new o();
89
136
  export {
90
- E as DateLib,
137
+ o as DateLib,
91
138
  Ir as defaultDateLib,
92
- h as defaultLocale
139
+ a as defaultLocale
93
140
  };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { DateLib as r } from "../classes/DateLib.js";
3
- function a(t, o, n) {
4
- return (n ?? new r(o)).format(t, "LLLL y");
3
+ function i(t, o, n) {
4
+ return (n ?? new r(o)).formatMonthYear(t);
5
5
  }
6
- const i = a;
6
+ const f = i;
7
7
  export {
8
- a as formatCaption,
9
- i as formatMonthCaption
8
+ i as formatCaption,
9
+ f as formatMonthCaption
10
10
  };
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { DateLib as o } from "../classes/DateLib.js";
3
- function r(t, e, n) {
4
- return (n ?? new o(e)).format(t, "LLLL y");
3
+ function i(t, e, n) {
4
+ return (n ?? new o(e)).formatMonthYear(t);
5
5
  }
6
- const a = r;
6
+ const a = i;
7
7
  export {
8
8
  a as labelCaption,
9
- r as labelGrid
9
+ i as labelGrid
10
10
  };