impact-nova 2.5.10 → 2.5.11

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 (59) hide show
  1. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  2. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  3. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  4. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  5. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  6. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  7. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
  8. package/dist/components/data-display/calendar/calendar-day-picker-components.js +163 -152
  9. package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
  10. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  11. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  12. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  13. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  14. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +1 -0
  15. package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
  16. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
  17. package/dist/components/data-display/calendar/calendar-week-number-cell.js +55 -41
  18. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +2 -0
  19. package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
  20. package/dist/components/data-display/calendar/calendar.js +146 -143
  21. package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
  22. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
  23. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
  24. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  25. package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
  26. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  27. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  28. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  29. package/dist/components/forms/date-picker/date-picker.js +60 -58
  30. package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
  31. package/dist/components/forms/date-picker/date-range-picker.js +66 -64
  32. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
  33. package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
  34. package/dist/components/forms/date-picker/month-picker.js +61 -59
  35. package/dist/components/forms/date-picker/month-range-picker.js +63 -61
  36. package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
  37. package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
  38. package/dist/components/forms/date-picker/multi-quarter-picker.js +46 -44
  39. package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
  40. package/dist/components/forms/date-picker/multi-year-picker.js +48 -46
  41. package/dist/components/forms/date-picker/quarter-picker.js +46 -44
  42. package/dist/components/forms/date-picker/quarter-range-picker.js +45 -43
  43. package/dist/components/forms/date-picker/week-picker.js +68 -66
  44. package/dist/components/forms/date-picker/week-range-picker.js +82 -80
  45. package/dist/components/forms/date-picker/year-picker.js +47 -45
  46. package/dist/components/forms/date-picker/year-range-picker.js +47 -45
  47. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  48. package/dist/components/forms/select/components/Submenu.js +3 -2
  49. package/dist/form-react/Fields/DateInputField.js +51 -50
  50. package/dist/form-react/Fields/DateRangeField.js +14 -13
  51. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  52. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  53. package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
  54. package/dist/form-react/Fields/WeekRangePicker.js +22 -21
  55. package/dist/form-react/types/fields.types.d.ts +12 -0
  56. package/dist/impact-nova.css +1 -1
  57. package/dist/llms/rules/installation.js +1 -1
  58. package/dist/llms/rules/requirements.js +1 -1
  59. package/package.json +1 -1
@@ -3,7 +3,8 @@ 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
- function w({
6
+ import "react";
7
+ function I({
7
8
  tags: o,
8
9
  title: l = "Attributes",
9
10
  maxVisibleTags: n = 4,
@@ -70,5 +71,5 @@ function w({
70
71
  );
71
72
  }
72
73
  export {
73
- w as ExpandableListItemAttributes
74
+ I as ExpandableListItemAttributes
74
75
  };
@@ -1,8 +1,9 @@
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";
3
4
  import { OverflowTooltip as r } from "../../feedback/tooltip/overflow-tooltip.js";
4
5
  const m = 128;
5
- function x({
6
+ function f({
6
7
  columns: i,
7
8
  sectionId: l = "metrics"
8
9
  }) {
@@ -50,5 +51,5 @@ function x({
50
51
  );
51
52
  }
52
53
  export {
53
- x as ExpandableListItemMetrics
54
+ f as ExpandableListItemMetrics
54
55
  };
@@ -1,8 +1,10 @@
1
1
  import { DateRange } from 'react-day-picker';
2
+ import { Granularity } from '../../../lib/fiscal-calendar';
2
3
  import { MonthRange, MonthSelection, QuarterRange, QuarterSelection, WeekRange, WeekSelection, YearRange, YearSelection } from './calendar.types';
3
4
  export declare function isCalendarApplyDisabled(params: {
4
5
  showFooter: boolean;
5
6
  pickerType: "date" | "week" | "month" | "quarter" | "year";
7
+ granularity?: Granularity;
6
8
  disabled?: unknown;
7
9
  pendingSelection?: Date | Date[] | DateRange;
8
10
  pendingWeekSelection?: WeekSelection | WeekSelection[] | WeekRange;
@@ -1,96 +1,93 @@
1
- import { isMonthDisabled as S, isDateIntervalDisabled as b } from "./calendar-month-utils.js";
2
- function u(e) {
3
- return new Date(e.getFullYear(), e.getMonth(), e.getDate());
1
+ import { isMonthDisabled as S, isWeekSelectableInBounds as O, isDateIntervalDisabled as A } from "./calendar-month-utils.js";
2
+ function d(r) {
3
+ return new Date(r.getFullYear(), r.getMonth(), r.getDate());
4
4
  }
5
- function c(e, i, t) {
6
- const f = u(e);
5
+ function l(r, i, n) {
6
+ const a = d(r);
7
7
  if (i) {
8
- const o = u(i);
9
- if (f < o) return !0;
8
+ const f = d(i);
9
+ if (a < f) return !0;
10
10
  }
11
- if (t) {
12
- const o = u(t);
13
- if (f > o) return !0;
11
+ if (n) {
12
+ const f = d(n);
13
+ if (a > f) return !0;
14
14
  }
15
15
  return !1;
16
16
  }
17
- function O(e, i, t, f) {
18
- const o = u(e), g = u(i);
19
- return !!(t && g < u(t) || f && o > u(f));
17
+ function D(r, i, n) {
18
+ return !r || !i ? !1 : A(r, i, n);
20
19
  }
21
- function p(e, i, t) {
22
- return !e || !i ? !1 : b(e, i, t);
23
- }
24
- function d(e, i) {
25
- if (Array.isArray(e)) return e.some(i);
26
- if (typeof e == "object" && e !== null && "from" in e) {
27
- const t = e;
28
- return !!(t.from && i(t.from) || t.to && i(t.to));
20
+ function c(r, i) {
21
+ if (Array.isArray(r)) return r.some(i);
22
+ if (typeof r == "object" && r !== null && "from" in r) {
23
+ const n = r;
24
+ return !!(n.from && i(n.from) || n.to && i(n.to));
29
25
  }
30
- return i(e);
26
+ return i(r);
31
27
  }
32
- function v(e) {
28
+ function I(r) {
33
29
  const {
34
30
  showFooter: i,
35
- pickerType: t,
31
+ pickerType: n,
32
+ granularity: a,
36
33
  disabled: f,
37
- pendingSelection: o,
38
- pendingWeekSelection: g,
34
+ pendingSelection: g,
35
+ pendingWeekSelection: m,
39
36
  pendingMonthSelection: y,
40
- pendingQuarterSelection: D,
41
- pendingYearSelection: m
42
- } = e;
37
+ pendingQuarterSelection: p,
38
+ pendingYearSelection: b
39
+ } = r;
43
40
  if (!i) return !1;
44
- const a = f;
45
- if (!a || typeof a != "object" || !("before" in a) && !("after" in a)) return !1;
46
- const s = a.before, l = a.after;
47
- if (t === "month") {
48
- const r = y;
49
- return r ? d(
50
- r,
51
- (n) => S(n.year, n.month, f)
41
+ const o = f;
42
+ if (!o || typeof o != "object" || !("before" in o) && !("after" in o)) return !1;
43
+ const u = o.before, s = o.after;
44
+ if (n === "month") {
45
+ const e = y;
46
+ return e ? c(
47
+ e,
48
+ (t) => S(t.year, t.month, f)
52
49
  ) : !1;
53
50
  }
54
- if (t === "quarter") {
55
- const r = D;
56
- return r ? d(
57
- r,
58
- (n) => p(n.start, n.end, f)
51
+ if (n === "quarter") {
52
+ const e = p;
53
+ return e ? c(
54
+ e,
55
+ (t) => D(t.start, t.end, f)
59
56
  ) : !1;
60
57
  }
61
- if (t === "year") {
62
- const r = m;
63
- return r ? d(
64
- r,
65
- (n) => p(n.start, n.end, f)
58
+ if (n === "year") {
59
+ const e = b;
60
+ return e ? c(
61
+ e,
62
+ (t) => D(t.start, t.end, f)
66
63
  ) : !1;
67
64
  }
68
- if (t === "week") {
69
- const r = g;
70
- return r ? d(
71
- r,
72
- (n) => O(
73
- n.startDate,
74
- n.endDate,
75
- s,
76
- l
65
+ if (n === "week") {
66
+ const e = m;
67
+ return e ? c(
68
+ e,
69
+ (t) => !O(
70
+ t.startDate,
71
+ t.endDate,
72
+ f,
73
+ a
77
74
  )
78
75
  ) : !1;
79
76
  }
80
- if (t === "date") {
81
- const r = o;
82
- if (!r) return !1;
83
- if (Array.isArray(r))
84
- return r.some((n) => c(n, s, l));
85
- if (r instanceof Date)
86
- return c(r, s, l);
87
- if ("from" in r) {
88
- const n = r;
89
- if (n.from && c(n.from, s, l) || n.to && c(n.to, s, l)) return !0;
77
+ if (n === "date") {
78
+ const e = g;
79
+ if (!e) return !1;
80
+ if (Array.isArray(e))
81
+ return e.some((t) => l(t, u, s));
82
+ if (e instanceof Date)
83
+ return l(e, u, s);
84
+ if ("from" in e) {
85
+ const t = e;
86
+ if (t.from && l(t.from, u, s) || t.to && l(t.to, u, s)) return !0;
90
87
  }
91
88
  }
92
89
  return !1;
93
90
  }
94
91
  export {
95
- v as isCalendarApplyDisabled
92
+ I as isCalendarApplyDisabled
96
93
  };
@@ -0,0 +1,27 @@
1
+ export type AvailableViewPickerType = "date" | "week" | "month" | "quarter" | "year";
2
+ export declare const DEFAULT_YEAR_PAGE_SIZE = 12;
3
+ export interface ResolveAvailableViewMonthOptions {
4
+ seed: Date;
5
+ pickerType: AvailableViewPickerType;
6
+ minDate?: Date;
7
+ maxDate?: Date;
8
+ numberOfMonths?: number;
9
+ hasSelection?: boolean;
10
+ autoNavigateToAvailable?: boolean;
11
+ yearPageSize?: number;
12
+ }
13
+ export declare function startOfDayDate(date: Date): Date;
14
+ export declare function startOfMonthDate(date: Date): Date;
15
+ export declare function isSameCalendarMonth(left: Date, right: Date): boolean;
16
+ export declare function boundsFromDisabled(disabled?: unknown): {
17
+ minDate?: Date;
18
+ maxDate?: Date;
19
+ };
20
+ export declare function hasCalendarValue(value: unknown): boolean;
21
+ /** Clamp `from` into `[minDate, maxDate]`. O(1). */
22
+ export declare function firstAvailableDate(minDate?: Date, maxDate?: Date, from?: Date): Date;
23
+ /**
24
+ * When auto-navigate is on and there is no selection, land the visible pane on the
25
+ * first enabled period. Does not write a selected value.
26
+ */
27
+ export declare function resolveAvailableViewMonth(options: ResolveAvailableViewMonthOptions): Date;
@@ -0,0 +1,85 @@
1
+ const F = 12;
2
+ function u(t) {
3
+ return new Date(t.getFullYear(), t.getMonth(), t.getDate());
4
+ }
5
+ function f(t) {
6
+ return new Date(t.getFullYear(), t.getMonth(), 1);
7
+ }
8
+ function h(t, e) {
9
+ return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
10
+ }
11
+ function A(t) {
12
+ if (!t || typeof t != "object" || Array.isArray(t))
13
+ return {};
14
+ const e = t;
15
+ return {
16
+ ...e.before instanceof Date ? { minDate: e.before } : {},
17
+ ...e.after instanceof Date ? { maxDate: e.after } : {}
18
+ };
19
+ }
20
+ function Y(t) {
21
+ if (t == null) return !1;
22
+ if (Array.isArray(t)) return t.length > 0;
23
+ if (t instanceof Date) return !0;
24
+ if (typeof t == "object") {
25
+ if ("from" in t || "to" in t) {
26
+ const e = t;
27
+ return e.from != null || e.to != null;
28
+ }
29
+ return !0;
30
+ }
31
+ return !1;
32
+ }
33
+ function g(t, e, n = /* @__PURE__ */ new Date()) {
34
+ const r = u(n);
35
+ if (t) {
36
+ const a = u(t);
37
+ if (r < a) return a;
38
+ }
39
+ if (e) {
40
+ const a = u(e);
41
+ if (r > a) return a;
42
+ }
43
+ return r;
44
+ }
45
+ function D(t, e, n) {
46
+ const r = f(t), a = new Date(
47
+ t.getFullYear(),
48
+ t.getMonth() + e,
49
+ 0,
50
+ 23,
51
+ 59,
52
+ 59,
53
+ 999
54
+ ), i = u(n).getTime();
55
+ return i >= r.getTime() && i <= a.getTime();
56
+ }
57
+ function m(t, e, n) {
58
+ const r = Math.floor(t / n) * n;
59
+ return e >= r && e <= r + n - 1;
60
+ }
61
+ function w(t) {
62
+ const {
63
+ seed: e,
64
+ pickerType: n,
65
+ minDate: r,
66
+ maxDate: a,
67
+ numberOfMonths: i = 1,
68
+ hasSelection: l = !1,
69
+ autoNavigateToAvailable: c = !1,
70
+ yearPageSize: s = 12
71
+ } = t;
72
+ if (!c || l) return e;
73
+ const o = g(r, a, e);
74
+ return n === "date" || n === "week" ? D(e, i, o) ? e : f(o) : n === "month" || n === "quarter" ? e.getFullYear() === o.getFullYear() ? e : new Date(o.getFullYear(), 0, 1) : m(e.getFullYear(), o.getFullYear(), s) ? e : new Date(o.getFullYear(), 0, 1);
75
+ }
76
+ export {
77
+ F as DEFAULT_YEAR_PAGE_SIZE,
78
+ A as boundsFromDisabled,
79
+ g as firstAvailableDate,
80
+ Y as hasCalendarValue,
81
+ h as isSameCalendarMonth,
82
+ w as resolveAvailableViewMonth,
83
+ u as startOfDayDate,
84
+ f as startOfMonthDate
85
+ };
@@ -1,13 +1,14 @@
1
1
  import { DayPicker } from 'react-day-picker';
2
2
  import { Button } from '../../primitives/button/button';
3
3
  import { Option } from '../../forms/select';
4
- import { FiscalCalendarConfig, FiscalPeriod, CalendarKind } from '../../../lib/fiscal-calendar';
4
+ import { FiscalCalendarConfig, FiscalPeriod, CalendarKind, Granularity } from '../../../lib/fiscal-calendar';
5
5
  import { WeekPickerInput } from './calendar-week-utils';
6
6
  import * as React from "react";
7
7
  export interface BuildCalendarDayPickerComponentsParams {
8
8
  buttonVariant: React.ComponentProps<typeof Button>["variant"];
9
9
  pickerType: "date" | "week" | "month";
10
10
  calendarKind: CalendarKind;
11
+ granularity?: Granularity;
11
12
  currentMonth: Date;
12
13
  monthsFull: string[];
13
14
  monthsShort: string[];
@@ -32,6 +33,7 @@ export interface BuildCalendarDayPickerComponentsParams {
32
33
  periodRowHover?: boolean;
33
34
  weekMode?: "single" | "multiple" | "range" | "multi-range";
34
35
  showPeriodBoundaries?: boolean;
36
+ disabled?: unknown;
35
37
  components?: React.ComponentProps<typeof DayPicker>["components"];
36
38
  }
37
- export declare function buildCalendarDayPickerComponents({ buttonVariant, pickerType, calendarKind, currentMonth, monthsFull, monthsShort, resolvedStartMonth, resolvedEndMonth, availableYears, fiscalPeriods, fiscalConfig, weekStartsOn, previousMonthLabel, nextMonthLabel, monthPlaceholder, yearPlaceholder, weekNumberLabel, weekNumberHeader, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onMonthChange, onWeekSelect, periodRowHover, weekMode, showPeriodBoundaries, components, }: BuildCalendarDayPickerComponentsParams): React.ComponentProps<typeof DayPicker>["components"];
39
+ export declare function buildCalendarDayPickerComponents({ buttonVariant, pickerType, calendarKind, granularity, currentMonth, monthsFull, monthsShort, resolvedStartMonth, resolvedEndMonth, availableYears, fiscalPeriods, fiscalConfig, weekStartsOn, previousMonthLabel, nextMonthLabel, monthPlaceholder, yearPlaceholder, weekNumberLabel, weekNumberHeader, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onMonthChange, onWeekSelect, periodRowHover, weekMode, showPeriodBoundaries, disabled, components, }: BuildCalendarDayPickerComponentsParams): React.ComponentProps<typeof DayPicker>["components"];