impact-nova 2.5.11 → 2.5.12

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.
Files changed (47) hide show
  1. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
  2. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
  3. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  4. package/dist/components/data-display/calendar/calendar-day-picker-components.js +205 -146
  5. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
  6. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
  7. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  8. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
  9. package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
  10. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
  11. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
  12. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
  13. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
  14. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
  15. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
  16. package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
  17. package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
  18. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +9 -0
  19. package/dist/components/data-display/calendar/calendar-selection-appearance.js +56 -43
  20. package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
  21. package/dist/components/data-display/calendar/calendar-selection.js +52 -23
  22. package/dist/components/data-display/calendar/calendar-week-number-cell.js +33 -33
  23. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +13 -3
  24. package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
  25. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +1 -0
  26. package/dist/components/data-display/calendar/calendar-year-panes.js +53 -51
  27. package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
  28. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  29. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  30. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
  31. package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -49
  32. package/dist/components/forms/date-picker/multi-year-picker.js +53 -51
  33. package/dist/components/forms/date-picker/quarter-picker.js +51 -49
  34. package/dist/components/forms/date-picker/quarter-range-picker.js +50 -48
  35. package/dist/components/forms/date-picker/year-picker.js +52 -50
  36. package/dist/components/forms/date-picker/year-range-picker.js +52 -50
  37. package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
  38. package/dist/components/forms/select/components/Submenu.js +2 -3
  39. package/dist/form-react/Fields/MultiWeekPickerField.js +33 -26
  40. package/dist/form-react/Fields/WeekRangePicker.js +16 -16
  41. package/dist/form-react/types/fields.types.d.ts +2 -0
  42. package/dist/impact-nova-components.css +13 -6
  43. package/dist/impact-nova.css +1 -1
  44. package/dist/lib/fiscal-calendar/week-selection.js +2 -2
  45. package/dist/llms/rules/installation.js +1 -1
  46. package/dist/llms/rules/requirements.js +1 -1
  47. package/package.json +1 -1
@@ -3,8 +3,7 @@ import { Badge as s } from "../../data-display/badge/badge.js";
3
3
  import { FilterPopoverContent as u } from "../../flows/filter-strip/filter-tag-list.js";
4
4
  import { Popover as b, PopoverTrigger as f } from "../../feedback/popover/popover.js";
5
5
  import { Tooltip as g, TooltipTrigger as v, TooltipContent as x } from "../../feedback/tooltip/tooltip.js";
6
- import "react";
7
- function I({
6
+ function w({
8
7
  tags: o,
9
8
  title: l = "Attributes",
10
9
  maxVisibleTags: n = 4,
@@ -71,5 +70,5 @@ function I({
71
70
  );
72
71
  }
73
72
  export {
74
- I as ExpandableListItemAttributes
73
+ w as ExpandableListItemAttributes
75
74
  };
@@ -1,9 +1,8 @@
1
1
  import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { ScrollOverflowAffordance as o } from "../../layout/horizontal-scroller/scroll-overflow-affordance.js";
3
- import "react";
4
3
  import { OverflowTooltip as r } from "../../feedback/tooltip/overflow-tooltip.js";
5
4
  const m = 128;
6
- function f({
5
+ function x({
7
6
  columns: i,
8
7
  sectionId: l = "metrics"
9
8
  }) {
@@ -51,5 +50,5 @@ function f({
51
50
  );
52
51
  }
53
52
  export {
54
- f as ExpandableListItemMetrics
53
+ x as ExpandableListItemMetrics
55
54
  };
@@ -14,7 +14,7 @@ function g(t) {
14
14
  const { calendarKind: n, fiscalMode: r, fiscalMonthPattern: e } = t;
15
15
  if (n === "fiscal") {
16
16
  if (e) return e;
17
- if (r === "advanced") return a["4-4-5"];
17
+ if (r === "advanced") return a["4-5-4"];
18
18
  }
19
19
  }
20
20
  function s(t) {
@@ -1,92 +1,98 @@
1
- import { jsx as i, jsxs as M } from "react/jsx-runtime";
2
- import * as k from "react";
1
+ import { jsx as s, jsxs as A } from "react/jsx-runtime";
2
+ import * as y from "react";
3
3
  import { useDayPicker as ue } from "react-day-picker";
4
4
  import { ChevronRight as Q } from "impact-nova-icons";
5
- import { cn as y } from "../../../lib/utils.js";
5
+ import { cn as w } from "../../../lib/utils.js";
6
6
  import { Button as U } from "../../primitives/button/button.js";
7
7
  import { Select as X } from "../../forms/select/select.js";
8
- import { CalendarCaptionHeader as me } from "./calendar-caption-header.js";
9
- import { CalendarDayButton as pe } from "./calendar-day-button.js";
10
- import { PanelIndexContext as D } from "./calendar-panel-context.js";
11
- import { CalendarWeekNumberCell as he } from "./calendar-week-number-cell.js";
12
- import { paneCivilMonthIndex as ve } from "./calendar-week-number-header.js";
13
- import { buildFiscalYear as xe } from "../../../lib/fiscal-calendar/build-year.js";
14
- import { civilMonthAtOffset as N, midMonthDate as g, periodForFiscalYearChange as ke, visibleMonthForPeriod as Z, periodsAvailableInBounds as Pe, periodForCivilMonth as $ } from "./calendar-fiscal-period-nav.js";
15
- import { getAvailableMonths as ye, isWeekSelectableInBounds as De } from "./calendar-month-utils.js";
16
- import { isCalendarPaddingWeek as L, weekHasInMonthSelection as Se, weekIntervalContinues as We } from "./calendar-padding-week.utils.js";
17
- import { isForeignFiscalWeekRow as T, fiscalPeriodForWeek as V } from "./calendar-week-utils.js";
18
- import { FiscalPeriodCaptionSelect as be } from "./fiscal-period-caption-select.js";
19
- function C(h, f, l) {
20
- if (f != null && h)
8
+ import { CalendarCaptionHeader as fe } from "./calendar-caption-header.js";
9
+ import { CalendarDayButton as me } from "./calendar-day-button.js";
10
+ import { PanelIndexContext as P } from "./calendar-panel-context.js";
11
+ import { CalendarWeekNumberCell as pe } from "./calendar-week-number-cell.js";
12
+ import { paneCivilMonthIndex as he } from "./calendar-week-number-header.js";
13
+ import { buildFiscalYear as ve } from "../../../lib/fiscal-calendar/build-year.js";
14
+ import { civilMonthAtOffset as S, midMonthDate as N, periodForFiscalYearChange as xe, visibleMonthForPeriod as Z, periodsAvailableInBounds as ye, periodForCivilMonth as $ } from "./calendar-fiscal-period-nav.js";
15
+ import { getAvailableMonths as ke, isWeekSelectableInBounds as we } from "./calendar-month-utils.js";
16
+ import { weekHasInMonthSelection as Pe, weekIntervalContinues as We } from "./calendar-padding-week.utils.js";
17
+ import { shouldHideCalendarWeekRow as L, fiscalPeriodForWeek as T, isOwnedFiscalWeekRow as De } from "./calendar-week-utils.js";
18
+ import { InjectedFiscalWeekRow as V } from "./calendar-injected-week-row.js";
19
+ import { FiscalDayCell as Ie } from "./calendar-fiscal-day-cell.js";
20
+ import { ownedWeeksOutsidePane as be, injectedWeekCollapseClass as ge } from "./calendar-leading-week.utils.js";
21
+ import { FiscalPeriodCaptionSelect as Fe } from "./fiscal-period-caption-select.js";
22
+ function O(m, v, d) {
23
+ if (v != null && m)
21
24
  try {
22
- return xe(h, f).periods;
25
+ return ve(m, v).periods;
23
26
  } catch {
24
27
  }
25
- return l ?? [];
28
+ return d ?? [];
26
29
  }
27
- function K(h, f, l) {
28
- const S = h.days[0]?.date, m = h.days[h.days.length - 1]?.date;
29
- return !S || !m ? !1 : De(S, m, f, l);
30
+ function K(m, v, d) {
31
+ const I = m.days[0]?.date, x = m.days[m.days.length - 1]?.date;
32
+ return !I || !x ? !1 : we(I, x, v, d);
30
33
  }
31
- function Je({
32
- buttonVariant: h,
33
- pickerType: f,
34
- calendarKind: l,
35
- granularity: S,
36
- currentMonth: m,
37
- monthsFull: A,
34
+ function Se(m) {
35
+ return y.isValidElement(m) && !!m.props["aria-hidden"];
36
+ }
37
+ function Le({
38
+ buttonVariant: m,
39
+ pickerType: v,
40
+ calendarKind: d,
41
+ granularity: I,
42
+ currentMonth: x,
43
+ monthsFull: R,
38
44
  monthsShort: ee,
39
45
  resolvedStartMonth: te,
40
46
  resolvedEndMonth: oe,
41
- availableYears: Y,
42
- fiscalPeriods: F,
43
- fiscalConfig: W,
47
+ availableYears: j,
48
+ fiscalPeriods: C,
49
+ fiscalConfig: k,
44
50
  weekStartsOn: ne,
45
51
  previousMonthLabel: B,
46
- nextMonthLabel: j,
47
- monthPlaceholder: O,
52
+ nextMonthLabel: z,
53
+ monthPlaceholder: _,
48
54
  yearPlaceholder: re,
49
55
  weekNumberLabel: ie,
50
- weekNumberHeader: R,
56
+ weekNumberHeader: E,
51
57
  weekLabel: se,
52
58
  fiscalWeekNumberLabel: ae,
53
59
  fiscalWeekAriaLabel: le,
54
- getCellMeta: d,
55
- onMonthChange: P,
56
- onWeekSelect: z,
57
- periodRowHover: _ = !1,
58
- weekMode: E = "single",
59
- showPeriodBoundaries: ce = !1,
60
- disabled: w,
61
- components: de
60
+ getCellMeta: u,
61
+ onMonthChange: W,
62
+ onWeekSelect: H,
63
+ periodRowHover: G = !1,
64
+ weekMode: M = "single",
65
+ showPeriodBoundaries: de = !1,
66
+ disabled: F,
67
+ components: ce
62
68
  }) {
63
- function G(e) {
64
- if (l !== "fiscal") return;
65
- const t = N(m, e);
69
+ function Y(e) {
70
+ if (d !== "fiscal") return;
71
+ const t = S(x, e);
66
72
  return $(
67
- C(
68
- W,
69
- d?.(g(t))?.fy ?? d?.(t)?.fy,
70
- F
73
+ O(
74
+ k,
75
+ u?.(N(t))?.fy ?? u?.(t)?.fy,
76
+ C
71
77
  ),
72
78
  t.getFullYear(),
73
79
  t.getMonth()
74
80
  )?.period;
75
81
  }
76
82
  return {
77
- Root: ({ className: e, rootRef: t, ...o }) => /* @__PURE__ */ i("div", { "data-slot": "calendar", ref: t, className: y(e), ...o }),
78
- Chevron: ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */ i(
83
+ Root: ({ className: e, rootRef: t, ...o }) => /* @__PURE__ */ s("div", { "data-slot": "calendar", ref: t, className: w(e), ...o }),
84
+ Chevron: ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */ s(
79
85
  Q,
80
86
  {
81
87
  size: 16,
82
- className: y("rotate-180 text-content", e),
88
+ className: w("rotate-180 text-content", e),
83
89
  ...o
84
90
  }
85
- ) : t === "right" ? /* @__PURE__ */ i(Q, { size: 16, className: y("text-content", e), ...o }) : /* @__PURE__ */ i("span", {}),
86
- PreviousMonthButton: (e) => /* @__PURE__ */ i(
91
+ ) : t === "right" ? /* @__PURE__ */ s(Q, { size: 16, className: w("text-content", e), ...o }) : /* @__PURE__ */ s("span", {}),
92
+ PreviousMonthButton: (e) => /* @__PURE__ */ s(
87
93
  U,
88
94
  {
89
- variant: h,
95
+ variant: m,
90
96
  size: "icon",
91
97
  className: "h-7 w-7",
92
98
  "aria-label": B,
@@ -94,83 +100,127 @@ function Je({
94
100
  ...e
95
101
  }
96
102
  ),
97
- NextMonthButton: (e) => /* @__PURE__ */ i(
103
+ NextMonthButton: (e) => /* @__PURE__ */ s(
98
104
  U,
99
105
  {
100
- variant: h,
106
+ variant: m,
101
107
  size: "icon",
102
108
  className: "h-7 w-7",
103
- "aria-label": j,
104
- title: j,
109
+ "aria-label": z,
110
+ title: z,
105
111
  ...e
106
112
  }
107
113
  ),
108
- MonthCaption: ({ displayIndex: e, calendarMonth: t, ...o }) => /* @__PURE__ */ i("div", { ...o }),
109
- Month: ({ calendarMonth: e, displayIndex: t, className: o, children: r, ...s }) => {
110
- const c = k.Children.toArray(r), p = c[c.length - 1], a = c.slice(0, -1);
111
- return /* @__PURE__ */ i(D.Provider, { value: t, children: /* @__PURE__ */ M("div", { className: y(o), ...s, children: [
112
- a.length > 0 ? /* @__PURE__ */ i(me, { children: a }) : null,
114
+ MonthCaption: ({ displayIndex: e, calendarMonth: t, ...o }) => /* @__PURE__ */ s("div", { ...o }),
115
+ Month: ({ calendarMonth: e, displayIndex: t, className: o, children: r, ...i }) => {
116
+ const c = y.Children.toArray(r), p = c[c.length - 1], a = c.slice(0, -1);
117
+ return /* @__PURE__ */ s(P.Provider, { value: t, children: /* @__PURE__ */ A("div", { className: w(o), ...i, children: [
118
+ a.length > 0 ? /* @__PURE__ */ s(fe, { children: a }) : null,
113
119
  p
114
120
  ] }) });
115
121
  },
116
- Months: ({ className: e, children: t, ...o }) => /* @__PURE__ */ i(
122
+ Weeks: ({ className: e, children: t, ...o }) => {
123
+ const r = y.useContext(P);
124
+ if (d !== "fiscal" || !k)
125
+ return /* @__PURE__ */ s("tbody", { className: e, ...o, children: t });
126
+ const i = S(x, r), c = Y(r), p = u?.(N(i))?.fy ?? u?.(i)?.fy, { leading: a, trailing: n } = be({
127
+ paneYear: i.getFullYear(),
128
+ paneMonthIndex: i.getMonth(),
129
+ panePeriod: c,
130
+ fiscalConfig: k,
131
+ fy: p
132
+ }), f = y.Children.toArray(t), l = [], D = [];
133
+ for (const h of f)
134
+ Se(h) ? D.push(h) : l.push(h);
135
+ const b = a.length + n.length;
136
+ return /* @__PURE__ */ A(
137
+ "tbody",
138
+ {
139
+ className: w(e, ge(b)),
140
+ "data-leading-week-count": a.length || void 0,
141
+ "data-trailing-week-count": n.length || void 0,
142
+ ...o,
143
+ children: [
144
+ a.map((h) => /* @__PURE__ */ s(
145
+ V,
146
+ {
147
+ fiscalWeek: h,
148
+ displayMonth: i
149
+ },
150
+ h.start
151
+ )),
152
+ l,
153
+ n.map((h) => /* @__PURE__ */ s(
154
+ V,
155
+ {
156
+ fiscalWeek: h,
157
+ displayMonth: i
158
+ },
159
+ h.start
160
+ )),
161
+ D
162
+ ]
163
+ }
164
+ );
165
+ },
166
+ Months: ({ className: e, children: t, ...o }) => /* @__PURE__ */ s(
117
167
  "div",
118
168
  {
119
169
  "data-slot": "day-months",
120
- "data-period-row-hover": _ ? "true" : void 0,
121
- "data-week-gutter-track": f === "week" ? "true" : void 0,
122
- className: y(e),
170
+ "data-period-row-hover": G ? "true" : void 0,
171
+ "data-week-gutter-track": v === "week" ? "true" : void 0,
172
+ className: w(e),
123
173
  ...o,
124
174
  children: t
125
175
  }
126
176
  ),
127
177
  DropdownNav: ({ children: e, className: t, ...o }) => {
128
- if (l !== "fiscal")
129
- return /* @__PURE__ */ i("div", { className: t, ...o, children: e });
130
- const r = k.Children.toArray(e), s = (n) => k.isValidElement(n) && n.key != null ? String(n.key) : "", c = r.find((n) => s(n).endsWith("year")), p = r.find((n) => s(n).endsWith("month")), a = r.filter((n) => {
131
- const u = s(n);
132
- return !u.endsWith("year") && !u.endsWith("month");
178
+ if (d !== "fiscal")
179
+ return /* @__PURE__ */ s("div", { className: t, ...o, children: e });
180
+ const r = y.Children.toArray(e), i = (n) => y.isValidElement(n) && n.key != null ? String(n.key) : "", c = r.find((n) => i(n).endsWith("year")), p = r.find((n) => i(n).endsWith("month")), a = r.filter((n) => {
181
+ const f = i(n);
182
+ return !f.endsWith("year") && !f.endsWith("month");
133
183
  });
134
- return /* @__PURE__ */ M("div", { className: t, ...o, children: [
184
+ return /* @__PURE__ */ A("div", { className: t, ...o, children: [
135
185
  c,
136
186
  p,
137
187
  a
138
188
  ] });
139
189
  },
140
190
  MonthsDropdown: ({ value: e }) => {
141
- const t = k.useContext(D), o = t > 0, r = N(m, t), s = r.getFullYear();
142
- if (l === "fiscal" && W) {
143
- const a = d?.(g(r)) ?? d?.(r), n = C(W, a?.fy, F), u = Pe(n, w), v = $(
191
+ const t = y.useContext(P), o = t > 0, r = S(x, t), i = r.getFullYear();
192
+ if (d === "fiscal" && k) {
193
+ const a = u?.(N(r)) ?? u?.(r), n = O(k, a?.fy, C), f = ye(n, F), l = $(
144
194
  n,
145
195
  r.getFullYear(),
146
196
  r.getMonth()
147
197
  );
148
- return /* @__PURE__ */ i(
149
- be,
198
+ return /* @__PURE__ */ s(
199
+ Fe,
150
200
  {
151
- periods: u,
152
- selectedPeriod: v,
153
- placeholder: O,
154
- onPeriodChange: (x) => {
155
- P(Z(x, o));
201
+ periods: f,
202
+ selectedPeriod: l,
203
+ placeholder: _,
204
+ onPeriodChange: (D) => {
205
+ W(Z(D, o));
156
206
  }
157
207
  }
158
208
  );
159
209
  }
160
- const p = ye(
161
- s,
162
- A,
210
+ const p = ke(
211
+ i,
212
+ R,
163
213
  te,
164
214
  oe
165
215
  );
166
- return /* @__PURE__ */ i(
216
+ return /* @__PURE__ */ s(
167
217
  X,
168
218
  {
169
219
  value: p.find((a) => a.value === e?.toString()),
170
220
  onChange: (a) => {
171
221
  if (a && "value" in a) {
172
222
  const n = parseInt(a.value);
173
- P(o ? new Date(s, n - 1, 1) : new Date(s, n, 1));
223
+ W(o ? new Date(i, n - 1, 1) : new Date(i, n, 1));
174
224
  }
175
225
  },
176
226
  scrollToSelectedOnOpen: !0,
@@ -179,41 +229,41 @@ function Je({
179
229
  menuWidth: "160px",
180
230
  isSearchable: !0,
181
231
  isClearable: !1,
182
- placeholder: O
232
+ placeholder: _
183
233
  }
184
234
  );
185
235
  },
186
236
  YearsDropdown: ({ value: e }) => {
187
- const t = k.useContext(D), o = t > 0, r = l === "fiscal" && W, s = N(m, t), c = r ? d?.(g(s)) ?? d?.(s) : void 0, p = r && c?.fy != null ? String(c.fy) : e?.toString();
188
- return /* @__PURE__ */ i(
237
+ const t = y.useContext(P), o = t > 0, r = d === "fiscal" && k, i = S(x, t), c = r ? u?.(N(i)) ?? u?.(i) : void 0, p = r && c?.fy != null ? String(c.fy) : e?.toString();
238
+ return /* @__PURE__ */ s(
189
239
  X,
190
240
  {
191
- value: Y.find((n) => n.value === p),
241
+ value: j.find((n) => n.value === p),
192
242
  onChange: (n) => {
193
243
  if (n && "value" in n) {
194
- const u = parseInt(n.value);
244
+ const f = parseInt(n.value);
195
245
  if (r) {
196
- const v = ke({
197
- periods: C(W, u, F),
246
+ const l = xe({
247
+ periods: O(k, f, C),
198
248
  preferredPeriod: c?.fiscalPeriod,
199
- disabled: w
249
+ disabled: F
200
250
  });
201
- v && P(Z(v, o));
251
+ l && W(Z(l, o));
202
252
  return;
203
253
  }
204
254
  if (o) {
205
- const v = new Date(
206
- m.getFullYear(),
207
- m.getMonth() + 1,
255
+ const l = new Date(
256
+ x.getFullYear(),
257
+ x.getMonth() + 1,
208
258
  1
209
259
  ).getMonth();
210
- P(new Date(u, v - 1, 1));
260
+ W(new Date(f, l - 1, 1));
211
261
  } else
212
- P(new Date(u, m.getMonth(), 1));
262
+ W(new Date(f, x.getMonth(), 1));
213
263
  }
214
264
  },
215
265
  scrollToSelectedOnOpen: !0,
216
- options: Y,
266
+ options: j,
217
267
  className: "w-[116px] shrink-0",
218
268
  menuWidth: "140px",
219
269
  isSearchable: !0,
@@ -222,85 +272,94 @@ function Je({
222
272
  }
223
273
  );
224
274
  },
225
- DayButton: (e) => /* @__PURE__ */ i(
226
- pe,
275
+ Day: (e) => {
276
+ if (d !== "fiscal") {
277
+ const { day: t, modifiers: o, children: r, ...i } = e;
278
+ return /* @__PURE__ */ s("td", { ...i, children: r });
279
+ }
280
+ return /* @__PURE__ */ s(Ie, { ...e });
281
+ },
282
+ DayButton: (e) => /* @__PURE__ */ s(
283
+ me,
227
284
  {
228
285
  ...e,
229
- pickerType: f,
286
+ pickerType: v,
230
287
  modifiers: {
231
288
  ...e.modifiers,
232
- ...ce ? {
233
- fiscal_period_start: !!d?.(e.day.date)?.isPeriodStart,
234
- fiscal_period_end: !!d?.(e.day.date)?.isPeriodEnd
289
+ ...de ? {
290
+ fiscal_period_start: !!u?.(e.day.date)?.isPeriodStart,
291
+ fiscal_period_end: !!u?.(e.day.date)?.isPeriodEnd
235
292
  } : {}
236
293
  }
237
294
  }
238
295
  ),
239
- Week: ({ week: e, className: t, children: o, onClick: r, ...s }) => {
240
- const { isSelected: c } = ue(), p = k.useContext(D), a = L(e), n = f === "week", u = V(e, d), v = G(p), x = a || T({
241
- calendarKind: l,
242
- weekPeriod: u,
243
- panePeriod: v
244
- }), fe = _ && !x ? u : void 0, I = n && !x && !K(e, w, S), H = !x && !I && Se(e, c), q = f === "week" && E !== "multiple" && E !== "multi-range" && H ? We(e, c, {
245
- joinAdjacentWeek: l === "fiscal",
246
- panePeriod: v,
247
- periodForDate: (b) => d?.(b)?.fiscalPeriod
296
+ Week: ({ week: e, className: t, children: o, onClick: r, ...i }) => {
297
+ const { isSelected: c } = ue(), p = y.useContext(P), a = v === "week", n = T(e, u), f = Y(p), l = L(e, {
298
+ calendarKind: d,
299
+ weekPeriod: n,
300
+ panePeriod: f
301
+ }), D = G && !l ? n : void 0, b = a && !l && !K(e, F, I), h = !l && !b && Pe(e, c, {
302
+ includeOutside: De({ calendarKind: d, weekPeriod: n, panePeriod: f })
303
+ }), q = v === "week" && M !== "multiple" && M !== "multi-range" && h ? We(e, c, {
304
+ joinAdjacentWeek: d === "fiscal",
305
+ panePeriod: f,
306
+ periodForDate: (g) => u?.(g)?.fiscalPeriod
248
307
  }) : { prev: !1, next: !1 };
249
- return /* @__PURE__ */ i(
308
+ return /* @__PURE__ */ s(
250
309
  "tr",
251
310
  {
252
- className: y(
311
+ className: w(
253
312
  t,
254
- x && "invisible order-last",
255
- n && !x && !I && "cursor-pointer"
313
+ l && "invisible order-last",
314
+ a && !l && !b && "cursor-pointer"
256
315
  ),
257
- ...s,
258
- "aria-hidden": x || void 0,
259
- "data-fiscal-period": fe,
260
- "data-week-selected": H ? !0 : void 0,
316
+ ...i,
317
+ "aria-hidden": l || void 0,
318
+ "data-fiscal-period": D,
319
+ "data-week-selected": h ? !0 : void 0,
261
320
  "data-week-continues-next": q.next || void 0,
262
321
  "data-week-continues-prev": q.prev || void 0,
263
- onClick: n && !x && !I ? (b) => {
264
- if (r?.(b), b.defaultPrevented) return;
265
- const J = b.target;
266
- J.closest("button") || J.closest("[data-week-number]") || z(e);
322
+ onClick: a && !l && !b ? (g) => {
323
+ if (r?.(g), g.defaultPrevented) return;
324
+ const J = g.target;
325
+ J.closest("button") || J.closest("[data-week-number]") || H(e);
267
326
  } : r,
268
327
  children: o
269
328
  }
270
329
  );
271
330
  },
272
331
  WeekNumber: ({ week: e, ...t }) => {
273
- const o = k.useContext(D), r = L(e) || T({
274
- calendarKind: l,
275
- weekPeriod: V(e, d),
276
- panePeriod: G(o)
332
+ const o = y.useContext(P), r = L(e, {
333
+ calendarKind: d,
334
+ weekPeriod: T(e, u),
335
+ panePeriod: Y(o)
277
336
  });
278
- return /* @__PURE__ */ i(
279
- he,
337
+ return /* @__PURE__ */ s(
338
+ pe,
280
339
  {
281
340
  week: e,
282
341
  weekStartsOn: ne,
283
- pickerType: f,
284
- calendarKind: l,
342
+ pickerType: v,
343
+ calendarKind: d,
285
344
  weekNumberLabel: ie,
286
345
  weekLabel: se,
287
346
  fiscalWeekNumberLabel: ae,
288
347
  fiscalWeekAriaLabel: le,
289
- getCellMeta: d,
290
- onWeekSelect: z,
348
+ getCellMeta: u,
349
+ onWeekSelect: H,
291
350
  ...t,
292
351
  blank: r,
293
- blocked: f === "week" && !K(e, w, S)
352
+ blocked: v === "week" && !K(e, F, I)
294
353
  }
295
354
  );
296
355
  },
297
356
  WeekNumberHeader: (e) => {
298
- const t = k.useContext(D), o = ve(l, m, t), r = o === void 0 ? R : ee[o], s = o === void 0 ? R : A[o];
299
- return /* @__PURE__ */ i("th", { ...e, "aria-label": s, children: r });
357
+ const t = y.useContext(P), o = he(d, x, t), r = o === void 0 ? E : ee[o], i = o === void 0 ? E : R[o];
358
+ return /* @__PURE__ */ s("th", { ...e, "aria-label": i, children: r });
300
359
  },
301
- ...de
360
+ ...ce
302
361
  };
303
362
  }
304
363
  export {
305
- Je as buildCalendarDayPickerComponents
364
+ Le as buildCalendarDayPickerComponents
306
365
  };
@@ -0,0 +1,9 @@
1
+ import { CalendarDay } from 'react-day-picker';
2
+ import * as React from "react";
3
+ /** DayPicker hides days before startMonth. Fiscal first-week July days still belong in the August grid. */
4
+ export declare function FiscalDayCell({ day, modifiers, children, className, ...tdProps }: {
5
+ day: CalendarDay;
6
+ modifiers: Record<string, boolean>;
7
+ children?: React.ReactNode;
8
+ className?: string;
9
+ } & React.TdHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useDayPicker as m } from "react-day-picker";
4
+ import { cn as h } from "../../../lib/utils.js";
5
+ import { callDayPickerSelect as p } from "./calendar-selection.js";
6
+ function b(t) {
7
+ return t && (t.split(/\s+/).filter((i) => i !== "invisible" && i !== "rdp-hidden" && i !== "hidden").join(" ") || void 0);
8
+ }
9
+ function B({
10
+ day: t,
11
+ modifiers: e,
12
+ children: i,
13
+ className: o,
14
+ ...d
15
+ }) {
16
+ const l = !!(e.hidden && t.outside), { classNames: r, components: c, formatters: a, select: u } = m();
17
+ if (!l)
18
+ return /* @__PURE__ */ n("td", { className: o, ...d, children: i });
19
+ const s = { ...e, hidden: !1 };
20
+ return /* @__PURE__ */ n(
21
+ "td",
22
+ {
23
+ ...d,
24
+ "data-hidden": void 0,
25
+ className: h(b(o), r.outside),
26
+ children: /* @__PURE__ */ n(
27
+ c.DayButton,
28
+ {
29
+ className: r.day_button,
30
+ type: "button",
31
+ day: t,
32
+ modifiers: s,
33
+ disabled: e.disabled || void 0,
34
+ onClick: (f) => {
35
+ p(u, t.date, s, f);
36
+ },
37
+ children: a.formatDay(t.date)
38
+ }
39
+ )
40
+ }
41
+ );
42
+ }
43
+ export {
44
+ B as FiscalDayCell
45
+ };