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
@@ -2,7 +2,7 @@ import { jsxs as f, jsx as l } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { cn as u } from "../../../lib/utils.js";
4
4
  import { Button as d } from "../../primitives/button/button.js";
5
- import { formatDateRangeFooterSummary as w, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
5
+ import { formatDateRangeFooterSummary as _, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
6
6
  const h = "relative isolate overflow-hidden animate-flash-highlight motion-reduce:animate-none", $ = {
7
7
  "--flash-overlay": "color-mix(in srgb, white 55%, transparent)"
8
8
  };
@@ -13,7 +13,7 @@ function a({
13
13
  return /* @__PURE__ */ f(
14
14
  "div",
15
15
  {
16
- className: "flex flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
16
+ className: "flex min-w-0 flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
17
17
  "aria-live": "polite",
18
18
  "aria-atomic": "true",
19
19
  children: [
@@ -28,7 +28,7 @@ function O({
28
28
  mode: n,
29
29
  weekMode: i,
30
30
  monthMode: r,
31
- yearMode: s = "single",
31
+ yearMode: m = "single",
32
32
  calendarKind: S,
33
33
  granularity: v,
34
34
  resolvedFiscalPattern: B,
@@ -39,26 +39,26 @@ function O({
39
39
  pendingQuarterSelection: N,
40
40
  pendingYearSelection: P,
41
41
  multiRangeSummary: g,
42
- disableApply: C,
43
- isApplyDisabled: H,
42
+ disableApply: w,
43
+ isApplyDisabled: C,
44
44
  footerFlashKey: c = 0,
45
45
  footerFlashTarget: p,
46
46
  labels: e,
47
- onClear: j,
48
- onCancel: q,
49
- onApply: A
47
+ onClear: H,
48
+ onCancel: j,
49
+ onApply: q
50
50
  }) {
51
- const _ = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && s !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", m = c > 0 && p === "cancel", o = c > 0 && p === "apply";
51
+ const A = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && m !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", s = c > 0 && p === "cancel", o = c > 0 && p === "apply";
52
52
  return /* @__PURE__ */ f(
53
53
  "div",
54
54
  {
55
55
  className: u(
56
- "flex items-center gap-2 border-t p-3 pt-3",
57
- _ ? "justify-between" : "justify-end"
56
+ "flex min-w-0 items-center gap-2 border-t p-3 pt-3",
57
+ A ? "justify-between" : "justify-end"
58
58
  ),
59
59
  children: [
60
60
  n === "multi-range" && g ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: g }) : null,
61
- n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: w(L) }) : null,
61
+ n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: _(L) }) : null,
62
62
  t === "week" && (i === "range" || i === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: z({
63
63
  selection: y,
64
64
  calendarKind: S,
@@ -73,23 +73,23 @@ function O({
73
73
  single: e.quarterSingle,
74
74
  plural: e.quarterPlural
75
75
  }) }) : null,
76
- t === "year" && (s === "range" || s === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
76
+ t === "year" && (m === "range" || m === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
77
77
  single: e.yearSingle,
78
78
  plural: e.yearPlural
79
79
  }) }) : null,
80
- /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
81
- /* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: j, children: e.clear }),
80
+ /* @__PURE__ */ f("div", { className: "flex shrink-0 items-center gap-2", children: [
81
+ /* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: H, children: e.clear }),
82
82
  /* @__PURE__ */ l(
83
83
  d,
84
84
  {
85
85
  variant: "outline",
86
86
  size: "md",
87
- "data-footer-flash": m ? "cancel" : void 0,
88
- className: u(m && h),
89
- onClick: q,
87
+ "data-footer-flash": s ? "cancel" : void 0,
88
+ className: u(s && h),
89
+ onClick: j,
90
90
  children: e.cancel
91
91
  },
92
- m ? `footer-cancel-${c}` : "footer-cancel"
92
+ s ? `footer-cancel-${c}` : "footer-cancel"
93
93
  ),
94
94
  /* @__PURE__ */ l(
95
95
  d,
@@ -99,8 +99,8 @@ function O({
99
99
  "data-footer-flash": o ? "apply" : void 0,
100
100
  style: o ? $ : void 0,
101
101
  className: u(o && h),
102
- onClick: A,
103
- disabled: C || H,
102
+ onClick: q,
103
+ disabled: w || C,
104
104
  children: e.apply
105
105
  },
106
106
  o ? `footer-apply-${c}` : "footer-apply"
@@ -0,0 +1,5 @@
1
+ import { FiscalWeek } from '../../../lib/fiscal-calendar';
2
+ export declare function InjectedFiscalWeekRow({ fiscalWeek, displayMonth, }: {
3
+ fiscalWeek: FiscalWeek;
4
+ displayMonth: Date;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,92 @@
1
+ import { jsxs as w, jsx as r } from "react/jsx-runtime";
2
+ import { useDayPicker as g } from "react-day-picker";
3
+ import { cn as D } from "../../../lib/utils.js";
4
+ import { fiscalWeekToCalendarWeek as N } from "./calendar-leading-week.utils.js";
5
+ import { injectedCalendarDayModifiers as W, callDayPickerSelect as _ } from "./calendar-selection.js";
6
+ function x({
7
+ fiscalWeek: c,
8
+ displayMonth: n
9
+ }) {
10
+ const {
11
+ classNames: t,
12
+ components: s,
13
+ formatters: m,
14
+ getModifiers: u,
15
+ isSelected: f,
16
+ select: k,
17
+ dayPickerProps: a
18
+ } = g(), o = N(c, n), b = a.showWeekNumber !== !1;
19
+ return /* @__PURE__ */ w(
20
+ s.Week,
21
+ {
22
+ className: t.week,
23
+ week: o,
24
+ "data-fiscal-injected": "true",
25
+ children: [
26
+ b ? /* @__PURE__ */ r(
27
+ s.WeekNumber,
28
+ {
29
+ week: o,
30
+ className: t.week_number,
31
+ scope: "row",
32
+ role: "rowheader"
33
+ }
34
+ ) : null,
35
+ o.days.map((d) => {
36
+ const i = u(d), l = W({
37
+ date: d.date,
38
+ disabled: a.disabled,
39
+ today: a.today,
40
+ isSelected: f,
41
+ customModifiers: a.modifiers
42
+ }), e = {
43
+ ...i,
44
+ ...l,
45
+ outside: d.outside || i.outside,
46
+ selected: l.selected || i.selected
47
+ };
48
+ return /* @__PURE__ */ r(
49
+ s.Day,
50
+ {
51
+ day: d,
52
+ modifiers: e,
53
+ className: D(
54
+ t.day,
55
+ e.outside && t.outside,
56
+ e.selected && t.selected,
57
+ e.disabled && t.disabled,
58
+ e.today && t.today,
59
+ e.range_start && t.range_start,
60
+ e.range_middle && t.range_middle,
61
+ e.range_end && t.range_end
62
+ ),
63
+ role: "gridcell",
64
+ "data-day": d.isoDate,
65
+ "data-outside": d.outside || void 0,
66
+ "data-selected": e.selected || void 0,
67
+ "data-disabled": e.disabled || void 0,
68
+ children: /* @__PURE__ */ r(
69
+ s.DayButton,
70
+ {
71
+ className: t.day_button,
72
+ type: "button",
73
+ day: d,
74
+ modifiers: e,
75
+ disabled: e.disabled || void 0,
76
+ onClick: (p) => {
77
+ e.disabled || _(k, d.date, e, p);
78
+ },
79
+ children: m.formatDay(d.date)
80
+ }
81
+ )
82
+ },
83
+ d.isoDate
84
+ );
85
+ })
86
+ ]
87
+ }
88
+ );
89
+ }
90
+ export {
91
+ x as InjectedFiscalWeekRow
92
+ };
@@ -0,0 +1,16 @@
1
+ import { CalendarWeek } from 'react-day-picker';
2
+ import { FiscalCalendarConfig, FiscalWeek } from '../../../lib/fiscal-calendar';
3
+ /** Fiscal weeks owned by this pane that DayPicker never puts in this civil month. */
4
+ export declare function ownedWeeksOutsidePane(options: {
5
+ paneYear: number;
6
+ paneMonthIndex: number;
7
+ panePeriod?: number;
8
+ fiscalConfig?: FiscalCalendarConfig;
9
+ fy?: number;
10
+ }): {
11
+ leading: FiscalWeek[];
12
+ trailing: FiscalWeek[];
13
+ };
14
+ /** Static Tailwind classes — JIT cannot see dynamic nth-last-child counts. */
15
+ export declare function injectedWeekCollapseClass(count: number): string | undefined;
16
+ export declare function fiscalWeekToCalendarWeek(week: FiscalWeek, displayMonth: Date): CalendarWeek;
@@ -0,0 +1,51 @@
1
+ import { CalendarDay as f, CalendarWeek as u } from "react-day-picker";
2
+ import { localDateFromCivil as c, addDays as h, parseCivilDate as s } from "../../../lib/fiscal-calendar/civil-date.js";
3
+ import { buildFiscalYear as m } from "../../../lib/fiscal-calendar/build-year.js";
4
+ function p(e, i, n, r) {
5
+ const t = (l) => {
6
+ const { y: d, m: o } = s(l);
7
+ return d < n || d === n && o - 1 < r;
8
+ };
9
+ return t(e) && t(i);
10
+ }
11
+ function C(e, i, n, r) {
12
+ const t = (l) => {
13
+ const { y: d, m: o } = s(l);
14
+ return d > n || d === n && o - 1 > r;
15
+ };
16
+ return t(e) && t(i);
17
+ }
18
+ function W(e) {
19
+ const { paneYear: i, paneMonthIndex: n, panePeriod: r, fiscalConfig: t, fy: l } = e;
20
+ if (r == null || !t || l == null)
21
+ return { leading: [], trailing: [] };
22
+ try {
23
+ const o = m(t, l).weeks.filter((a) => a.period === r);
24
+ return {
25
+ leading: o.filter(
26
+ (a) => p(a.start, a.end, i, n)
27
+ ),
28
+ trailing: o.filter(
29
+ (a) => C(a.start, a.end, i, n)
30
+ )
31
+ };
32
+ } catch {
33
+ return { leading: [], trailing: [] };
34
+ }
35
+ }
36
+ function k(e) {
37
+ if (!(e <= 0))
38
+ return e === 1 ? "[&>tr[aria-hidden]:last-child]:hidden" : e === 2 ? "[&>tr[aria-hidden]:nth-last-child(-n+2)]:hidden" : "[&>tr[aria-hidden]:nth-last-child(-n+3)]:hidden";
39
+ }
40
+ function D(e, i) {
41
+ const n = [];
42
+ let r = e.start;
43
+ for (let t = 0; t < 7; t += 1)
44
+ n.push(new f(c(r), i)), r = h(r, 1);
45
+ return new u(e.week, n);
46
+ }
47
+ export {
48
+ D as fiscalWeekToCalendarWeek,
49
+ k as injectedWeekCollapseClass,
50
+ W as ownedWeeksOutsidePane
51
+ };
@@ -1,56 +1,57 @@
1
1
  import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { ChevronRight as g } from "impact-nova-icons";
3
- import { cn as A } from "../../../lib/utils.js";
4
- import { Button as f } from "../../primitives/button/button.js";
5
- import { Select as D } from "../../forms/select/select.js";
6
- import { isMonthRangeSelection as F } from "../../forms/date-picker/calendar-selection-adapters.js";
7
- import { CalendarPeriodCell as G } from "./calendar-period-cell.js";
2
+ import { ChevronRight as f } from "impact-nova-icons";
3
+ import { cn as T } from "../../../lib/utils.js";
4
+ import { Button as g } from "../../primitives/button/button.js";
5
+ import { Select as B } from "../../forms/select/select.js";
6
+ import { isMonthRangeSelection as W } from "../../forms/date-picker/calendar-selection-adapters.js";
7
+ import { CalendarPeriodCell as q } from "./calendar-period-cell.js";
8
+ import { PERIOD_RANGE_GRID_CLASSNAME as F } from "./calendar-selection-appearance.js";
8
9
  function Z({
9
- yearOffset: o = 0,
10
+ yearOffset: c = 0,
10
11
  displayYear: e,
11
12
  monthMode: s,
12
13
  monthsShort: u,
13
- showFooter: p,
14
+ showFooter: N,
14
15
  pendingMonthSelection: v,
15
- selectedMonths: N,
16
- resolvedStartYear: x,
17
- resolvedEndYear: C,
16
+ selectedMonths: p,
17
+ resolvedStartYear: C,
18
+ resolvedEndYear: S,
18
19
  yearOptions: l,
19
- previousYearLabel: a,
20
- nextYearLabel: r,
21
- isMonthSelected: S,
22
- getMonthRangeProps: k,
23
- isMonthDisabled: w,
24
- onPreviousYear: j,
25
- onNextYear: z,
26
- onYearSelect: b,
27
- onMonthClick: R,
20
+ previousYearLabel: r,
21
+ nextYearLabel: a,
22
+ isMonthSelected: x,
23
+ getMonthRangeProps: R,
24
+ isMonthDisabled: k,
25
+ onPreviousYear: w,
26
+ onNextYear: j,
27
+ onYearSelect: z,
28
+ onMonthClick: E,
28
29
  periodLabels: i
29
30
  }) {
30
31
  return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4 p-3 min-w-[280px]", children: [
31
32
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
32
- o === 0 ? /* @__PURE__ */ t(
33
- f,
33
+ c === 0 ? /* @__PURE__ */ t(
34
+ g,
34
35
  {
35
36
  variant: "ghost",
36
37
  size: "icon",
37
38
  className: "h-7 w-7 shrink-0",
38
- "aria-label": a,
39
- title: a,
40
- disabled: e <= x,
41
- onClick: () => j(e),
42
- children: /* @__PURE__ */ t(g, { size: 16, className: "rotate-180" })
39
+ "aria-label": r,
40
+ title: r,
41
+ disabled: e <= C,
42
+ onClick: () => w(e),
43
+ children: /* @__PURE__ */ t(f, { size: 16, className: "rotate-180" })
43
44
  }
44
45
  ) : /* @__PURE__ */ t("span", { className: "size-7 shrink-0", "aria-hidden": !0 }),
45
46
  /* @__PURE__ */ t("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ t(
46
- D,
47
+ B,
47
48
  {
48
49
  value: l.find((n) => n.value === e.toString()) ?? {
49
50
  label: e.toString(),
50
51
  value: e.toString()
51
52
  },
52
53
  onChange: (n) => {
53
- n && "value" in n && b(parseInt(n.value), o);
54
+ n && "value" in n && z(parseInt(n.value), c);
54
55
  },
55
56
  scrollToSelectedOnOpen: !0,
56
57
  options: l,
@@ -59,17 +60,17 @@ function Z({
59
60
  menuWidth: "140px"
60
61
  }
61
62
  ) }),
62
- (s === "single" || o === 1) && /* @__PURE__ */ t(
63
- f,
63
+ (s === "single" || c === 1) && /* @__PURE__ */ t(
64
+ g,
64
65
  {
65
66
  variant: "ghost",
66
67
  size: "icon",
67
68
  className: "h-7 w-7",
68
- "aria-label": r,
69
- title: r,
70
- disabled: e >= C,
71
- onClick: () => z(e),
72
- children: /* @__PURE__ */ t(g, { className: "h-4 w-4" })
69
+ "aria-label": a,
70
+ title: a,
71
+ disabled: e >= S,
72
+ onClick: () => j(e),
73
+ children: /* @__PURE__ */ t(f, { className: "h-4 w-4" })
73
74
  }
74
75
  )
75
76
  ] }),
@@ -77,23 +78,23 @@ function Z({
77
78
  "div",
78
79
  {
79
80
  "data-period-grid": "",
80
- className: A("grid gap-x-0 gap-y-4", i ? "grid-cols-3" : "grid-cols-4"),
81
- children: (i ?? u.map((n) => ({ label: n }))).map((n, c) => {
82
- const m = n.label, P = S(e, c), { isStart: E, isEnd: M, isMiddle: T } = k(e, c), B = s === "range", h = p ? v : N, I = F(h) && !!h.to, W = w(e, c), q = "caption" in n && typeof n.caption == "string" ? n.caption : void 0;
81
+ className: T(F, i ? "grid-cols-3" : "grid-cols-4"),
82
+ children: (i ?? u.map((n) => ({ label: n }))).map((n, o) => {
83
+ const m = n.label, b = x(e, o), { isStart: P, isEnd: A, isMiddle: I } = R(e, o), M = s === "range", h = N ? v : p, _ = W(h) && !!h.to, D = k(e, o), G = "caption" in n && typeof n.caption == "string" ? n.caption : void 0;
83
84
  return /* @__PURE__ */ t(
84
- G,
85
+ q,
85
86
  {
86
- selected: P,
87
- disabled: W,
88
- isRange: B,
89
- isStart: E,
90
- isEnd: M,
91
- isMiddle: T,
92
- hasRangeEnd: I,
87
+ selected: b,
88
+ disabled: D,
89
+ isRange: M,
90
+ isStart: P,
91
+ isEnd: A,
92
+ isMiddle: I,
93
+ hasRangeEnd: _,
93
94
  size: i ? "period" : "month",
94
95
  columns: i ? 3 : 4,
95
- onClick: () => R(e, c),
96
- caption: q,
96
+ onClick: () => E(e, o),
97
+ caption: G,
97
98
  children: m
98
99
  },
99
100
  m
@@ -0,0 +1,23 @@
1
+ import { FiscalCalendarConfig } from '../../../lib/fiscal-calendar';
2
+ export type FiscalOrphanWeek = {
3
+ fy: number;
4
+ period: number;
5
+ week: number;
6
+ weekStart: string;
7
+ weekEnd: string;
8
+ periodStart: string;
9
+ periodEnd: string;
10
+ weekCount: number;
11
+ dominantMonth: string;
12
+ paneMonth: string;
13
+ side: "leading" | "trailing";
14
+ };
15
+ export declare function retailFiscalConfig(pattern: "4-4-5" | "4-5-4" | "5-4-4", weekStartsOn: 0 | 1, fyStartMonth: number, leapWeekPolicy?: "append-last-period" | "period-13"): FiscalCalendarConfig;
16
+ /** Last week sits fully in November; dominant civil month is October. P2 owns November. */
17
+ export declare const TRAILING_ORPHAN_CUSTOM_TABLE: FiscalCalendarConfig;
18
+ export declare function scanFiscalOrphanWeeks(config: FiscalCalendarConfig, fy: number): FiscalOrphanWeek[];
19
+ export declare function civilDayNumbers(start: string, end: string): string[];
20
+ export declare function parseYearMonth(value: string): {
21
+ year: number;
22
+ monthIndex: number;
23
+ };
@@ -8,7 +8,9 @@ export declare function weekHasInMonthSelection(week: {
8
8
  date: Date;
9
9
  outside?: boolean;
10
10
  }>;
11
- }, isSelected?: (date: Date) => boolean): boolean;
11
+ }, isSelected?: (date: Date) => boolean, options?: {
12
+ includeOutside?: boolean;
13
+ }): boolean;
12
14
  export declare function weekIntervalContinues(week: {
13
15
  days: Array<{
14
16
  date: Date;
@@ -1,8 +1,10 @@
1
1
  function y(e) {
2
2
  return e.days.length > 0 && e.days.every((t) => t.outside);
3
3
  }
4
- function g(e, t) {
5
- return t ? e.days.some((r) => !r.outside && t(r.date)) : !1;
4
+ function g(e, t, r) {
5
+ return t ? e.days.some(
6
+ (a) => (r?.includeOutside || !a.outside) && t(a.date)
7
+ ) : !1;
6
8
  }
7
9
  function d(e, t) {
8
10
  return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
@@ -12,14 +14,14 @@ function c(e, t) {
12
14
  }
13
15
  function h(e, t, r) {
14
16
  if (!t) return { prev: !1, next: !1 };
15
- const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date, s = r?.joinAdjacentWeek ? e.days.at(-1)?.date : e.days.filter((n) => !n.outside).at(-1)?.date, f = o ? d(o, -1) : void 0, l = s ? d(s, 1) : void 0, i = (n) => {
17
+ const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date, i = r?.joinAdjacentWeek ? e.days.at(-1)?.date : e.days.filter((n) => !n.outside).at(-1)?.date, f = o ? d(o, -1) : void 0, l = i ? d(i, 1) : void 0, s = (n) => {
16
18
  if (!n || !t(n)) return !1;
17
19
  const u = r?.periodForDate?.(n);
18
20
  return r?.panePeriod != null && u != null ? u !== r.panePeriod : !!(a && c(n, a));
19
21
  };
20
22
  return {
21
- prev: i(f),
22
- next: i(l)
23
+ prev: s(f),
24
+ next: s(l)
23
25
  };
24
26
  }
25
27
  export {
@@ -1,78 +1,77 @@
1
- import { jsxs as s, jsx as p } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as d } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as e } from "../../../lib/utils.js";
4
- import { Button as N } from "../../primitives/button/button.js";
5
- import { intervalCaptionClassName as v } from "./calendar-interval-caption.js";
6
- import { SELECTION_RADIUS_END as g, SELECTION_RADIUS_START as T, SELECTION_RADIUS as I, periodRangeTrackClassName as j, periodTileAppearanceClassName as A } from "./calendar-selection-appearance.js";
7
- import { periodCellKind as D } from "./calendar-selection.js";
8
- import { handlePeriodGridKeyDown as S } from "./calendar-period-keyboard.js";
9
- const _ = {
3
+ import { cn as t } from "../../../lib/utils.js";
4
+ import { Button as g } from "../../primitives/button/button.js";
5
+ import { intervalCaptionClassName as y } from "./calendar-interval-caption.js";
6
+ import { periodRangeTrackPositionClassName as v, periodRangeTrackClassName as T, periodTileInsetClassName as k, periodTileAppearanceClassName as j, rangeStartCellClassName as q, rangeEndCellClassName as K, rangeMiddleCellClassName as P } from "./calendar-selection-appearance.js";
7
+ import { periodCellKind as A } from "./calendar-selection.js";
8
+ import { handlePeriodGridKeyDown as D } from "./calendar-period-keyboard.js";
9
+ const I = {
10
10
  month: "h-10 w-10",
11
- period: "min-h-16 h-auto w-full flex-col items-center justify-center px-1 py-1",
12
- quarter: "h-16 min-h-16 max-h-16 w-full min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
13
- year: "h-10 min-h-10 max-h-10 w-full min-w-0 overflow-hidden",
14
- "year-caption": "h-16 min-h-16 max-h-16 w-full min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
11
+ period: "min-h-16 h-auto min-w-0 flex-col items-center justify-center px-1 py-1",
12
+ quarter: "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
13
+ year: "h-10 min-h-10 max-h-10 min-w-0 overflow-hidden",
14
+ "year-caption": "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
15
15
  };
16
- function P({
17
- selected: u,
16
+ function O({
17
+ selected: C,
18
18
  disabled: n = !1,
19
19
  isRange: i = !1,
20
- isStart: t = !1,
21
- isEnd: r = !1,
22
- isMiddle: o = !1,
23
- hasRangeEnd: d = !1,
20
+ isStart: e = !1,
21
+ isEnd: a = !1,
22
+ isMiddle: s = !1,
23
+ hasRangeEnd: w = !1,
24
24
  size: l,
25
- onClick: w,
26
- onKeyDown: x,
27
- children: y,
25
+ onClick: u,
26
+ onKeyDown: N,
27
+ children: x,
28
28
  caption: m,
29
- columns: f
29
+ columns: c
30
30
  }) {
31
- const a = D({ selected: u, isRange: i, isStart: t, isEnd: r, isMiddle: o }), C = i && d && (o || t || r) && !n, c = l === "month";
32
- return /* @__PURE__ */ s(
31
+ const r = A({ selected: C, isRange: i, isStart: e, isEnd: a, isMiddle: s }), p = i && w && (s || e || a) && !n, o = l === "month";
32
+ return /* @__PURE__ */ f(
33
33
  "div",
34
34
  {
35
- className: e(
35
+ className: t(
36
36
  "group relative flex w-full items-center justify-center",
37
- l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10"
37
+ l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10",
38
+ !o && p && !(e && a) && (e ? q : a ? K : P)
38
39
  ),
39
40
  children: [
40
- C ? /* @__PURE__ */ p(
41
+ o && p ? /* @__PURE__ */ d(
41
42
  "div",
42
43
  {
43
- className: e(
44
+ className: t(
44
45
  "absolute inset-y-0",
45
- j,
46
- t && r && e("inset-x-2", I),
47
- t && !r && e("left-1/2 right-0", c && "-ml-5", T),
48
- r && !t && e("right-1/2 left-0", c && "-mr-5", g),
49
- o && "inset-x-0"
46
+ T,
47
+ v({ isStart: e, isEnd: a })
50
48
  )
51
49
  }
52
50
  ) : null,
53
- /* @__PURE__ */ s(
54
- N,
51
+ /* @__PURE__ */ f(
52
+ g,
55
53
  {
56
54
  variant: "ghost",
57
- onClick: w,
55
+ onClick: u,
58
56
  onKeyDown: (h) => {
59
- f && S(h, f), x?.(h);
57
+ c && D(h, c), N?.(h);
60
58
  },
61
59
  disabled: n,
62
- "data-selection": a,
60
+ "data-selection": r,
63
61
  "data-period-tile": "",
64
- className: e(
65
- A({ kind: a, disabled: n }),
66
- _[l]
62
+ className: t(
63
+ j({ kind: r, disabled: n }),
64
+ I[l],
65
+ !o && k
67
66
  ),
68
67
  children: [
69
- y,
70
- m ? /* @__PURE__ */ p(
68
+ x,
69
+ m ? /* @__PURE__ */ d(
71
70
  "span",
72
71
  {
73
72
  "data-slot": "interval-caption",
74
- className: v(
75
- a === "point" || a === "interval-start" || a === "interval-end"
73
+ className: y(
74
+ r === "point" || r === "interval-start" || r === "interval-end"
76
75
  ),
77
76
  children: m
78
77
  }
@@ -85,5 +84,5 @@ function P({
85
84
  );
86
85
  }
87
86
  export {
88
- P as CalendarPeriodCell
87
+ O as CalendarPeriodCell
89
88
  };