impact-nova 2.5.6 → 2.5.8

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 (192) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +2 -2
  2. package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
  3. package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
  4. package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
  5. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
  6. package/dist/components/data-display/calendar/calendar-apply-validation.js +82 -51
  7. package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
  8. package/dist/components/data-display/calendar/calendar-config.js +31 -20
  9. package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
  10. package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
  11. package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
  12. package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
  13. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
  14. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
  15. package/dist/components/data-display/calendar/calendar-day-picker-components.js +199 -98
  16. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +12 -4
  17. package/dist/components/data-display/calendar/calendar-day-picker-view.js +139 -92
  18. package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
  19. package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
  20. package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
  21. package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
  22. package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
  23. package/dist/components/data-display/calendar/calendar-footer.js +88 -66
  24. package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
  25. package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
  26. package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
  27. package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
  28. package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
  29. package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
  30. package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
  31. package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
  32. package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
  33. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
  34. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
  35. package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
  36. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
  37. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
  38. package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
  39. package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
  40. package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
  41. package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
  42. package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
  43. package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
  44. package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
  45. package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
  46. package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
  47. package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
  48. package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
  49. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
  50. package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
  51. package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
  52. package/dist/components/data-display/calendar/calendar-selection.js +31 -0
  53. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
  54. package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
  55. package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
  56. package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
  57. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
  58. package/dist/components/data-display/calendar/calendar-week-utils.js +50 -42
  59. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
  60. package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
  61. package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
  62. package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
  63. package/dist/components/data-display/calendar/calendar.d.ts +1 -1
  64. package/dist/components/data-display/calendar/calendar.js +303 -181
  65. package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
  66. package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
  67. package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
  68. package/dist/components/data-display/calendar/index.d.ts +1 -1
  69. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
  70. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
  71. package/dist/components/data-display/calendar/use-calendar-state.d.ts +32 -12
  72. package/dist/components/data-display/calendar/use-calendar-state.js +371 -164
  73. package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
  74. package/dist/components/data-display/calendar/use-fiscal-calendar.js +24 -0
  75. package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
  76. package/dist/components/flows/guidance/guidance-error-boundary.js +22 -14
  77. package/dist/components/flows/guidance/guidance-layer.js +34 -32
  78. package/dist/components/flows/guidance/help-center/assets/whats-new-guide-icon.svg.js +4 -0
  79. package/dist/components/flows/guidance/help-center/filter-help-center-guides.js +10 -7
  80. package/dist/components/flows/guidance/help-center/guide-catalog-section.d.ts +7 -0
  81. package/dist/components/flows/guidance/help-center/guide-catalog-section.js +24 -0
  82. package/dist/components/flows/guidance/help-center/guide-catalog-utils.d.ts +3 -0
  83. package/dist/components/flows/guidance/help-center/guide-catalog-utils.js +19 -0
  84. package/dist/components/flows/guidance/help-center/guide-catalog.d.ts +1 -1
  85. package/dist/components/flows/guidance/help-center/guide-catalog.js +89 -79
  86. package/dist/components/flows/guidance/help-center/help-center-guide-labels.d.ts +6 -0
  87. package/dist/components/flows/guidance/help-center/help-center-guide-labels.js +33 -0
  88. package/dist/components/flows/guidance/help-center/help-center-guide-row.d.ts +12 -0
  89. package/dist/components/flows/guidance/help-center/help-center-guide-row.js +57 -0
  90. package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.d.ts +9 -0
  91. package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.js +114 -0
  92. package/dist/components/flows/guidance/help-center/help-center-header.d.ts +1 -1
  93. package/dist/components/flows/guidance/help-center/help-center-header.js +20 -16
  94. package/dist/components/flows/guidance/help-center/help-center.constants.d.ts +1 -1
  95. package/dist/components/flows/guidance/help-center/help-center.constants.js +1 -1
  96. package/dist/components/flows/guidance/help-center/help-center.d.ts +3 -1
  97. package/dist/components/flows/guidance/help-center/help-center.js +74 -51
  98. package/dist/components/flows/guidance/help-center/help-center.types.d.ts +9 -1
  99. package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.d.ts +4 -0
  100. package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.js +18 -0
  101. package/dist/components/flows/guidance/help-center.d.ts +4 -2
  102. package/dist/components/flows/guidance/help-center.js +23 -14
  103. package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +19 -17
  104. package/dist/components/flows/guidance/index.d.ts +1 -1
  105. package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
  106. package/dist/components/flows/guidance/renderers/announcement-renderer.js +20 -12
  107. package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +9 -11
  108. package/dist/components/flows/guidance/renderers/guidance-card-shared.js +124 -177
  109. package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +1 -1
  110. package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +57 -72
  111. package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +23 -23
  112. package/dist/components/flows/wizard/wizard.js +41 -38
  113. package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
  114. package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
  115. package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
  116. package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
  117. package/dist/components/forms/date-picker/date-picker.js +187 -167
  118. package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
  119. package/dist/components/forms/date-picker/date-range-picker.js +273 -224
  120. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
  121. package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
  122. package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
  123. package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
  124. package/dist/components/forms/date-picker/index.d.ts +12 -0
  125. package/dist/components/forms/date-picker/index.js +19 -7
  126. package/dist/components/forms/date-picker/month-picker.js +225 -182
  127. package/dist/components/forms/date-picker/month-range-picker.js +134 -110
  128. package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
  129. package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
  130. package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
  131. package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
  132. package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
  133. package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
  134. package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
  135. package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
  136. package/dist/components/forms/date-picker/quarter-picker.js +176 -0
  137. package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
  138. package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
  139. package/dist/components/forms/date-picker/week-picker.js +148 -137
  140. package/dist/components/forms/date-picker/week-range-picker.js +216 -205
  141. package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
  142. package/dist/components/forms/date-picker/year-picker.js +176 -0
  143. package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
  144. package/dist/components/forms/date-picker/year-range-picker.js +179 -0
  145. package/dist/components/layout/horizontal-scroller/horizontal-scroller.js +35 -53
  146. package/dist/form-react/Fields/DateInputField.js +63 -58
  147. package/dist/form-react/Fields/DateRangeField.js +42 -37
  148. package/dist/form-react/Fields/MonthRangeField.js +50 -45
  149. package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
  150. package/dist/form-react/Fields/WeekRangePicker.js +44 -45
  151. package/dist/form-react/components/FieldRenderer.js +21 -23
  152. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
  153. package/dist/form-react/registry/defaultFieldRegistrations.js +11 -12
  154. package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
  155. package/dist/form-react/registry/resolveFieldComponent.js +9 -133
  156. package/dist/form-react/types/fields.types.d.ts +22 -7
  157. package/dist/form-react/utils/date.utils.d.ts +3 -1
  158. package/dist/form-react/utils/date.utils.js +82 -53
  159. package/dist/i18n/defaultMessages.d.ts +29 -1
  160. package/dist/i18n/defaultMessages.js +54 -27
  161. package/dist/i18n/locales/de.js +31 -4
  162. package/dist/i18n/locales/es.js +31 -4
  163. package/dist/i18n/locales/hi.js +31 -4
  164. package/dist/i18n/locales/kn.js +31 -4
  165. package/dist/impact-nova-components.css +379 -3
  166. package/dist/impact-nova.css +1 -1
  167. package/dist/index.js +528 -516
  168. package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
  169. package/dist/lib/fiscal-calendar/build-year.js +173 -0
  170. package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
  171. package/dist/lib/fiscal-calendar/civil-date.js +94 -0
  172. package/dist/lib/fiscal-calendar/index.d.ts +10 -0
  173. package/dist/lib/fiscal-calendar/index.js +40 -0
  174. package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
  175. package/dist/lib/fiscal-calendar/lookup.js +70 -0
  176. package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
  177. package/dist/lib/fiscal-calendar/presets.js +99 -0
  178. package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
  179. package/dist/lib/fiscal-calendar/selection.js +32 -0
  180. package/dist/lib/fiscal-calendar/types.d.ts +145 -0
  181. package/dist/lib/fiscal-calendar/types.js +10 -0
  182. package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
  183. package/dist/lib/fiscal-calendar/week-selection.js +107 -0
  184. package/dist/lib/guidance/engine/guidance-engine.d.ts +7 -5
  185. package/dist/lib/guidance/engine/guidance-engine.js +115 -47
  186. package/dist/lib/guidance/triggers/trigger-registry.js +6 -6
  187. package/dist/lib/guidance/types/guidance.types.d.ts +11 -1
  188. package/dist/llms/rules/installation.js +1 -1
  189. package/dist/llms/rules/requirements.js +1 -1
  190. package/package.json +5 -1
  191. package/dist/lib/fiscal-calendar.d.ts +0 -62
  192. package/dist/lib/fiscal-calendar.js +0 -99
@@ -1,106 +1,153 @@
1
- import { jsx as J } from "react/jsx-runtime";
2
- import "react";
3
- import { DayPicker as K } from "react-day-picker";
4
- import { cn as Q } from "../../../lib/utils.js";
5
- import { useCalendarDayPickerConfig as R } from "./use-calendar-day-picker-config.js";
6
- function E({
7
- className: u,
8
- pickerType: t,
9
- mode: r,
10
- weekMode: o,
11
- calendarType: a,
12
- showOutsideDays: n,
13
- fixedWeeks: e,
14
- captionLayout: p,
15
- buttonVariant: d,
16
- weekStartsOn: s,
17
- formatters: g,
18
- classNames: f,
19
- components: w,
20
- selected: b,
21
- showFooter: P,
22
- pendingSelection: y,
23
- selectedDaysFromWeeks: D,
24
- currentMonth: i,
25
- monthsFull: h,
26
- resolvedStartMonth: m,
27
- resolvedEndMonth: c,
28
- availableYears: k,
29
- dateFnsLocale: v,
30
- intlLocale: C,
31
- weekRangeModifiers: N,
32
- onSelect: _,
33
- onMonthChange: l,
34
- onWeekSelect: S,
35
- previousMonthLabel: x,
36
- nextMonthLabel: L,
37
- monthPlaceholder: O,
38
- yearPlaceholder: j,
39
- weekNumberLabel: V,
40
- weekLabel: q,
41
- formatWeekNumber: z,
42
- disabled: A,
43
- ...B
1
+ import { jsx as C } from "react/jsx-runtime";
2
+ import * as S from "react";
3
+ import { DayPicker as lr } from "react-day-picker";
4
+ import { cn as mr } from "../../../lib/utils.js";
5
+ import { formatPeriodOption as pr } from "./calendar-fiscal-labels.js";
6
+ import { CalendarDayHoverProvider as dr } from "./calendar-day-hover.js";
7
+ import { previewModifierClassNames as ur } from "./calendar-day-picker-classnames.js";
8
+ import { isPreviewCap as p, dayKey as m, isPreviewMiddle as br } from "./calendar-selection.js";
9
+ import { useCalendarDayPickerConfig as gr } from "./use-calendar-day-picker-config.js";
10
+ function Sr({
11
+ className: j,
12
+ pickerType: s,
13
+ mode: n,
14
+ weekMode: c,
15
+ calendarKind: l,
16
+ granularity: k,
17
+ showOutsideDays: d,
18
+ fixedWeeks: u,
19
+ captionLayout: B,
20
+ buttonVariant: H,
21
+ weekStartsOn: b,
22
+ formatters: E,
23
+ classNames: F,
24
+ components: L,
25
+ selected: g,
26
+ showFooter: v,
27
+ pendingSelection: _,
28
+ selectedDaysFromWeeks: O,
29
+ currentMonth: P,
30
+ monthsFull: V,
31
+ monthsShort: Y,
32
+ weekNumberHeader: R,
33
+ resolvedStartMonth: w,
34
+ resolvedEndMonth: y,
35
+ availableYears: W,
36
+ fiscalPeriods: D,
37
+ fiscalConfig: $,
38
+ dateFnsLocale: q,
39
+ intlLocale: z,
40
+ weekRangeModifiers: A,
41
+ onSelect: G,
42
+ onMonthChange: h,
43
+ onWeekSelect: I,
44
+ previousMonthLabel: J,
45
+ nextMonthLabel: M,
46
+ monthPlaceholder: Q,
47
+ yearPlaceholder: U,
48
+ weekNumberLabel: x,
49
+ weekLabel: X,
50
+ fiscalWeekAriaLabel: Z,
51
+ getCellMeta: i,
52
+ formatWeekNumber: K,
53
+ disabled: T,
54
+ ...rr
44
55
  }) {
45
- const { dayPickerClassNames: F, dayPickerComponents: G } = R({
46
- buttonVariant: d,
47
- pickerType: t,
48
- calendarType: a,
49
- showOutsideDays: n,
50
- classNames: f,
51
- currentMonth: i,
52
- monthsFull: h,
53
- resolvedStartMonth: m,
54
- resolvedEndMonth: c,
55
- availableYears: k,
56
- weekStartsOn: s,
57
- previousMonthLabel: x,
58
- nextMonthLabel: L,
59
- monthPlaceholder: O,
60
- yearPlaceholder: j,
61
- weekNumberLabel: V,
62
- weekLabel: q,
63
- onMonthChange: l,
64
- onWeekSelect: S,
65
- components: w
66
- }), H = r === "range" || r === "multiple" || o === "range" || o === "multiple" ? 2 : 1;
67
- return /* @__PURE__ */ J(
68
- K,
56
+ const { dayPickerClassNames: er, dayPickerComponents: tr } = gr({
57
+ buttonVariant: H,
58
+ pickerType: s,
59
+ calendarKind: l,
60
+ granularity: k,
61
+ showOutsideDays: d,
62
+ classNames: F,
63
+ currentMonth: P,
64
+ monthsFull: V,
65
+ monthsShort: Y,
66
+ weekNumberHeader: R,
67
+ resolvedStartMonth: w,
68
+ resolvedEndMonth: y,
69
+ availableYears: W,
70
+ fiscalPeriods: D,
71
+ fiscalConfig: $,
72
+ weekStartsOn: b,
73
+ previousMonthLabel: J,
74
+ nextMonthLabel: M,
75
+ monthPlaceholder: Q,
76
+ yearPlaceholder: U,
77
+ weekNumberLabel: x,
78
+ weekLabel: X,
79
+ fiscalWeekNumberLabel: x,
80
+ fiscalWeekAriaLabel: Z,
81
+ getCellMeta: i,
82
+ onMonthChange: h,
83
+ onWeekSelect: I,
84
+ weekMode: c,
85
+ components: L
86
+ }), or = n === "range" || n === "multiple" || n === "multi-range" || c === "range" || c === "multiple" || c === "multi-range" ? 2 : 1, ar = s === "week" || n === "multi-range" ? "multiple" : n, nr = u || l === "fiscal" || d, N = i ? {
87
+ fiscal_period_start: (r) => !!i(r)?.isPeriodStart,
88
+ fiscal_period_end: (r) => !!i(r)?.isPeriodEnd
89
+ } : void 0, [t, ir] = S.useState(), sr = S.useCallback((r) => {
90
+ ir((e) => !e && !r || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate() ? e : r);
91
+ }, []), o = v ? _ : g, a = n === "range" && o && typeof o == "object" && "from" in o ? o.from : void 0, fr = n === "range" && o && typeof o == "object" && "to" in o ? o.to : void 0;
92
+ return /* @__PURE__ */ C(dr, { onDayHover: sr, children: /* @__PURE__ */ C(
93
+ lr,
69
94
  {
70
- mode: t === "week" ? "multiple" : r,
71
- selected: t === "week" ? D : P ? y : b,
72
- onSelect: _,
73
- month: i,
74
- onMonthChange: l,
75
- fixedWeeks: e,
76
- showOutsideDays: e || a === "fiscal" || n,
77
- weekStartsOn: s,
78
- modifiers: t === "week" ? N : void 0,
79
- locale: v,
80
- className: Q(
95
+ mode: ar,
96
+ selected: s === "week" ? O : v ? _ : g,
97
+ onSelect: (...r) => {
98
+ const [e, f] = r;
99
+ G(e, f instanceof Date ? f : void 0);
100
+ },
101
+ month: P,
102
+ onMonthChange: h,
103
+ fixedWeeks: u,
104
+ showOutsideDays: nr,
105
+ weekStartsOn: b,
106
+ modifiers: s === "week" ? { ...A, ...N } : { ...N, ...s === "date" && !!(a && !fr && t) && a && t ? {
107
+ preview: (r) => br(r, a, t),
108
+ preview_cap: (r) => p(r, a, t),
109
+ preview_cap_start: (r) => p(r, a, t) && m(t) < m(a),
110
+ preview_cap_end: (r) => p(r, a, t) && m(t) > m(a)
111
+ } : void 0 },
112
+ modifiersClassNames: {
113
+ ...l === "fiscal" ? {
114
+ fiscal_period_start: "before:pointer-events-none before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:content-['('] before:text-sm before:font-normal before:text-brand",
115
+ fiscal_period_end: "after:pointer-events-none after:absolute after:right-0 after:top-1/2 after:-translate-y-1/2 after:content-[')'] after:text-sm after:font-normal after:text-brand"
116
+ } : void 0,
117
+ ...ur
118
+ },
119
+ locale: q,
120
+ className: mr(
81
121
  "bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
82
122
  String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
83
123
  String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
84
- u
124
+ j
85
125
  ),
86
- captionLayout: p,
126
+ captionLayout: B,
87
127
  navLayout: "around",
88
- startMonth: m,
89
- endMonth: c,
90
- disabled: A,
91
- numberOfMonths: H,
128
+ startMonth: w,
129
+ endMonth: y,
130
+ disabled: T,
131
+ numberOfMonths: or,
92
132
  showWeekNumber: !0,
93
133
  formatters: {
94
- formatMonthDropdown: (I) => I.toLocaleString(C, { month: "short" }),
95
- formatWeekNumber: z,
96
- ...g
134
+ formatMonthDropdown: (r) => {
135
+ if (l === "fiscal" && i) {
136
+ const e = i(r), f = D?.find((cr) => cr.period === e?.fiscalPeriod);
137
+ if (f) return pr(f);
138
+ if (e?.fiscalPeriod != null) return `P${e.fiscalPeriod}`;
139
+ }
140
+ return r.toLocaleString(z, { month: "short" });
141
+ },
142
+ formatWeekNumber: K,
143
+ ...E
97
144
  },
98
- classNames: F,
99
- components: G,
100
- ...B
145
+ classNames: er,
146
+ components: tr,
147
+ ...rr
101
148
  }
102
- );
149
+ ) });
103
150
  }
104
151
  export {
105
- E as CalendarDayPickerView
152
+ Sr as CalendarDayPickerView
106
153
  };
@@ -0,0 +1,38 @@
1
+ import { CivilDate, FiscalCalendarConfig, FyLabelStyle } from '../../../lib/fiscal-calendar';
2
+ import { QuarterSelection, YearSelection } from './calendar.types';
3
+ export declare function formatFiscalYearLabel(fy: number, style?: FyLabelStyle): string;
4
+ export declare function formatYearIntervalCaption(year: number, fiscalConfig?: FiscalCalendarConfig): string;
5
+ export declare function formatPeriodTooltip(period: {
6
+ period: number;
7
+ start: CivilDate;
8
+ end: CivilDate;
9
+ }): string;
10
+ export declare function formatPeriodCell(period: {
11
+ period: number;
12
+ start: CivilDate;
13
+ end: CivilDate;
14
+ }): {
15
+ label: string;
16
+ caption: string;
17
+ };
18
+ export declare function formatPeriodOption(period: {
19
+ period: number;
20
+ start: CivilDate;
21
+ end: CivilDate;
22
+ }): string;
23
+ export declare function formatQuarterCell(quarter: {
24
+ quarter: number;
25
+ start: CivilDate;
26
+ end: CivilDate;
27
+ }): {
28
+ label: string;
29
+ caption: string;
30
+ };
31
+ export declare function formatFiscalPeriodInput(period: number, fy: number): string;
32
+ export declare function formatFiscalQuarterInput(quarter: number, fy: number): string;
33
+ export declare function formatQuarterInput(quarter: Pick<QuarterSelection, "year" | "quarter" | "fy">): string;
34
+ export declare function formatYearInput(year: Pick<YearSelection, "year" | "fy">, fyLabel?: FyLabelStyle): string;
35
+ export declare function formatQuarterLabelsForYear(year: number, fiscalConfig?: FiscalCalendarConfig): Array<{
36
+ label: string;
37
+ caption?: string;
38
+ }>;
@@ -0,0 +1,90 @@
1
+ import { formatCivilRange as o, parseCivilDate as l } from "../../../lib/fiscal-calendar/civil-date.js";
2
+ import { formatFyLabel as c, buildFiscalYear as f } from "../../../lib/fiscal-calendar/build-year.js";
3
+ const a = [
4
+ "January",
5
+ "February",
6
+ "March",
7
+ "April",
8
+ "May",
9
+ "June",
10
+ "July",
11
+ "August",
12
+ "September",
13
+ "October",
14
+ "November",
15
+ "December"
16
+ ];
17
+ function u(r, t = "fy-short") {
18
+ return c(r, t);
19
+ }
20
+ function p(r, t) {
21
+ if (t)
22
+ try {
23
+ const n = f(t, r);
24
+ return `(${o(n.start, n.end)})`;
25
+ } catch {
26
+ }
27
+ return `(${o(`${r}-01-01`, `${r}-12-31`)})`;
28
+ }
29
+ function $(r, t) {
30
+ const n = l(r), e = l(t);
31
+ return n.y === e.y && n.m === e.m ? `${a[n.m - 1]} ${n.d} – ${e.d}` : n.y === e.y ? `${a[n.m - 1]} ${n.d} – ${a[e.m - 1]} ${e.d}` : `${a[n.m - 1]} ${n.d} ${n.y} – ${a[e.m - 1]} ${e.d} ${e.y}`;
32
+ }
33
+ function Q(r) {
34
+ return `Period ${r.period} (${$(r.start, r.end)})`;
35
+ }
36
+ function m(r) {
37
+ return {
38
+ label: `P${r.period}`,
39
+ caption: `(${o(r.start, r.end)})`
40
+ };
41
+ }
42
+ function F(r) {
43
+ const t = m(r);
44
+ return `${t.label} ${t.caption}`;
45
+ }
46
+ function s(r) {
47
+ return {
48
+ label: `Q${r.quarter}`,
49
+ caption: `(${o(r.start, r.end)})`
50
+ };
51
+ }
52
+ function L(r, t) {
53
+ return `P${r} ${u(t)}`;
54
+ }
55
+ function y(r, t) {
56
+ return `Q${r} ${u(t)}`;
57
+ }
58
+ function P(r) {
59
+ return r.fy != null ? y(r.quarter, r.fy) : `Q${r.quarter} ${r.year}`;
60
+ }
61
+ function I(r, t = "fy-long") {
62
+ return r.fy != null ? u(r.fy, t) : String(r.year);
63
+ }
64
+ const i = [
65
+ { label: "Q1" },
66
+ { label: "Q2" },
67
+ { label: "Q3" },
68
+ { label: "Q4" }
69
+ ];
70
+ function R(r, t) {
71
+ if (!t) return i;
72
+ try {
73
+ return f(t, r).quarters.map(s);
74
+ } catch {
75
+ return i;
76
+ }
77
+ }
78
+ export {
79
+ L as formatFiscalPeriodInput,
80
+ y as formatFiscalQuarterInput,
81
+ u as formatFiscalYearLabel,
82
+ m as formatPeriodCell,
83
+ F as formatPeriodOption,
84
+ Q as formatPeriodTooltip,
85
+ s as formatQuarterCell,
86
+ P as formatQuarterInput,
87
+ R as formatQuarterLabelsForYear,
88
+ I as formatYearInput,
89
+ p as formatYearIntervalCaption
90
+ };
@@ -1,14 +1,23 @@
1
1
  import { DateRange } from 'react-day-picker';
2
- import { FiscalMonthPattern } from '../../../lib/fiscal-calendar';
3
- import { MonthRange, MonthSelection, WeekRange, WeekSelection } from './calendar.types';
2
+ import { FiscalCalendarConfig, FiscalMonthPattern, CalendarKind, Granularity } from '../../../lib/fiscal-calendar';
3
+ import { MonthRange, MonthSelection, QuarterRange, QuarterSelection, WeekRange, WeekSelection, YearRange, YearSelection } from './calendar.types';
4
4
  export declare function formatDateRangeFooterSummary(selection: DateRange | undefined): string;
5
5
  export declare function formatWeekFooterSummary(params: {
6
6
  selection: WeekSelection | WeekSelection[] | WeekRange | undefined;
7
- calendarType: "calendar" | "fiscal";
8
- selectionMode: "week" | "fiscalMonth";
7
+ calendarKind: CalendarKind;
8
+ granularity?: Granularity;
9
9
  resolvedFiscalPattern?: FiscalMonthPattern;
10
+ fiscalConfig?: FiscalCalendarConfig;
10
11
  }): string;
11
12
  export declare function formatMonthFooterSummary(selection: MonthSelection | MonthSelection[] | MonthRange | undefined, labels: {
12
13
  single: string;
13
14
  plural: (count: number) => string;
14
15
  }): string;
16
+ export declare function formatQuarterFooterSummary(selection: QuarterSelection | QuarterSelection[] | QuarterRange | undefined, labels: {
17
+ single: string;
18
+ plural: (count: number) => string;
19
+ }): string;
20
+ export declare function formatYearFooterSummary(selection: YearSelection | YearSelection[] | YearRange | undefined, labels: {
21
+ single: string;
22
+ plural: (count: number) => string;
23
+ }): string;
@@ -1,69 +1,120 @@
1
- function F(n) {
2
- if (n?.from && n?.to) {
3
- const t = Math.abs(n.to.getTime() - n.from.getTime()), r = Math.ceil(t / (1e3 * 60 * 60 * 24)) + 1;
4
- return `${r} day${r !== 1 ? "s" : ""}`;
1
+ import { civilFromLocalDate as D } from "../../../lib/fiscal-calendar/civil-date.js";
2
+ import { buildFiscalYear as S } from "../../../lib/fiscal-calendar/build-year.js";
3
+ import { getCellMeta as $ } from "../../../lib/fiscal-calendar/lookup.js";
4
+ import { quarterRank as k } from "./calendar-quarter-utils.js";
5
+ import { yearKey as w } from "./calendar-year-utils.js";
6
+ function O(r) {
7
+ if (r?.from && r?.to) {
8
+ const n = Math.abs(r.to.getTime() - r.from.getTime()), t = Math.ceil(n / (1e3 * 60 * 60 * 24)) + 1;
9
+ return `${t} day${t !== 1 ? "s" : ""}`;
5
10
  }
6
11
  return "0 days";
7
12
  }
8
- function o(n) {
9
- return Date.UTC(n.getFullYear(), n.getMonth(), n.getDate());
13
+ function c(r) {
14
+ return Date.UTC(r.getFullYear(), r.getMonth(), r.getDate());
10
15
  }
11
- function y(n) {
12
- const t = Math.floor(n / 7), r = n % 7, a = [];
13
- return t > 0 && a.push(`${t} week${t !== 1 ? "s" : ""}`), (r > 0 || t === 0) && a.push(`${r} day${r !== 1 ? "s" : ""}`), a.join(" ");
16
+ function g(r) {
17
+ const n = Math.floor(r / 7), t = r % 7, o = [];
18
+ return n > 0 && o.push(`${n} week${n !== 1 ? "s" : ""}`), (t > 0 || n === 0) && o.push(`${t} day${t !== 1 ? "s" : ""}`), o.join(" ");
14
19
  }
15
- function C(n) {
16
- const { selection: t, calendarType: r, selectionMode: a, resolvedFiscalPattern: u } = n;
17
- if (!t) return "0 weeks";
18
- const c = r === "fiscal" && a === "fiscalMonth", d = r === "fiscal", f = c ? "fiscal month" : d ? "fiscal week" : "week", D = c ? "fiscal months" : d ? "fiscal weeks" : "weeks";
19
- if (Array.isArray(t)) {
20
- if (d || c) {
21
- const e = t.length;
22
- return `${e} ${e !== 1 ? D : f}`;
20
+ function A(r, n, t) {
21
+ if (!t)
22
+ return Math.max(1, Math.abs(n.weekOfMonth - r.weekOfMonth) + 1);
23
+ const o = $(t, D(r.startDate)), e = $(t, D(n.endDate));
24
+ if (o?.fy == null || e?.fy == null || o.fiscalPeriod == null || e.fiscalPeriod == null)
25
+ return Math.max(1, Math.abs(n.weekOfMonth - r.weekOfMonth) + 1);
26
+ let a = 0;
27
+ for (let i = o.fy; i <= e.fy; i++) {
28
+ const u = S(t, i);
29
+ for (const m of u.periods)
30
+ i === o.fy && m.period < o.fiscalPeriod || i === e.fy && m.period > e.fiscalPeriod || (a += 1);
31
+ }
32
+ return Math.max(1, a);
33
+ }
34
+ function j(r) {
35
+ const { selection: n, calendarKind: t, granularity: o, fiscalConfig: e } = r;
36
+ if (!n) return "0 weeks";
37
+ const a = t === "fiscal" && o === "period", i = t === "fiscal", u = a ? "fiscal month" : i ? "fiscal week" : "week", m = a ? "fiscal months" : i ? "fiscal weeks" : "weeks";
38
+ if (Array.isArray(n)) {
39
+ if (i || a) {
40
+ const f = n.length;
41
+ return `${f} ${f !== 1 ? m : u}`;
23
42
  }
24
43
  let s = 0;
25
- return t.forEach((e) => {
26
- const M = o(e.startDate), g = o(e.endDate);
27
- s += Math.round((g - M) / (1e3 * 60 * 60 * 24)) + 1;
28
- }), y(s);
44
+ return n.forEach((f) => {
45
+ const y = c(f.startDate), l = c(f.endDate);
46
+ s += Math.round((l - y) / (1e3 * 60 * 60 * 24)) + 1;
47
+ }), g(s);
29
48
  }
30
- if ("from" in t) {
31
- const { from: s, to: e } = t;
32
- if (c) {
33
- if (!e) return `1 ${f}`;
34
- const h = o(s.startDate), m = o(e.endDate), i = Math.round(Math.abs(m - h) / (1e3 * 60 * 60 * 24)) + 1, l = u ? u.reduce((k, w) => k + w, 0) / 12 : 4.33, $ = Math.max(1, Math.round(i / (l * 7)));
35
- return `${$} ${$ !== 1 ? D : f}`;
49
+ if ("from" in n) {
50
+ const { from: s, to: f } = n;
51
+ if (a) {
52
+ if (!f) return `1 ${u}`;
53
+ const h = A(s, f, e);
54
+ return `${h} ${h !== 1 ? m : u}`;
36
55
  }
37
- if (d) {
38
- if (!e) return `1 ${f}`;
39
- const h = o(s.startDate), m = o(e.endDate), i = Math.round((m - h) / (10080 * 60 * 1e3)), l = i > 0 ? i : 1;
40
- return `${l} ${l !== 1 ? D : f}`;
56
+ if (i) {
57
+ if (!f) return `1 ${u}`;
58
+ const h = c(s.startDate), M = c(f.endDate), d = Math.round((M - h) / (10080 * 60 * 1e3)), p = d > 0 ? d : 1;
59
+ return `${p} ${p !== 1 ? m : u}`;
41
60
  }
42
- if (!e) {
43
- const h = o(s.startDate), m = o(s.endDate), i = Math.round((m - h) / (1e3 * 60 * 60 * 24)) + 1;
44
- return y(i);
61
+ if (!f) {
62
+ const h = c(s.startDate), M = c(s.endDate), d = Math.round((M - h) / (1e3 * 60 * 60 * 24)) + 1;
63
+ return g(d);
45
64
  }
46
- const M = o(s.startDate), g = o(e.endDate), T = Math.round(Math.abs(g - M) / (1e3 * 60 * 60 * 24)) + 1;
47
- return y(T);
65
+ const y = c(s.startDate), l = c(f.endDate), T = Math.round(Math.abs(l - y) / (1e3 * 60 * 60 * 24)) + 1;
66
+ return g(T);
48
67
  }
49
- return `1 ${f}`;
68
+ return `1 ${u}`;
50
69
  }
51
- function U(n, t) {
52
- if (!n) return "0 months";
53
- if (Array.isArray(n)) {
54
- const r = n.length;
55
- return r === 1 ? t.single : t.plural(r);
70
+ function K(r, n) {
71
+ if (!r) return "0 months";
72
+ if (Array.isArray(r)) {
73
+ const t = r.length;
74
+ return t === 1 ? n.single : n.plural(t);
56
75
  }
57
- if ("from" in n) {
58
- const r = n;
59
- if (!r.from || !r.to) return t.single;
60
- const a = new Date(r.from.year, r.from.month, 1), u = new Date(r.to.year, r.to.month, 1), c = (u.getFullYear() - a.getFullYear()) * 12 + (u.getMonth() - a.getMonth()) + 1;
61
- return c === 1 ? t.single : t.plural(c);
76
+ if ("from" in r) {
77
+ const t = r;
78
+ if (!t.from || !t.to) return n.single;
79
+ const o = new Date(t.from.year, t.from.month, 1), e = new Date(t.to.year, t.to.month, 1), a = (e.getFullYear() - o.getFullYear()) * 12 + (e.getMonth() - o.getMonth()) + 1;
80
+ return a === 1 ? n.single : n.plural(a);
81
+ }
82
+ return n.single;
83
+ }
84
+ function F(r, n, t, o) {
85
+ if (!r) return o;
86
+ if (Array.isArray(r)) {
87
+ const e = r.length;
88
+ return e === 1 ? t.single : t.plural(e);
89
+ }
90
+ if (typeof r == "object" && "from" in r) {
91
+ const e = r;
92
+ if (!e.from || !e.to) return t.single;
93
+ const a = n(e.from, e.to);
94
+ return a === 1 ? t.single : t.plural(a);
62
95
  }
63
96
  return t.single;
64
97
  }
98
+ function R(r, n) {
99
+ return F(
100
+ r,
101
+ (t, o) => Math.abs(k(o) - k(t)) + 1,
102
+ n,
103
+ n.plural(0)
104
+ );
105
+ }
106
+ function q(r, n) {
107
+ return F(
108
+ r,
109
+ (t, o) => Math.abs(w(o) - w(t)) + 1,
110
+ n,
111
+ n.plural(0)
112
+ );
113
+ }
65
114
  export {
66
- F as formatDateRangeFooterSummary,
67
- U as formatMonthFooterSummary,
68
- C as formatWeekFooterSummary
115
+ O as formatDateRangeFooterSummary,
116
+ K as formatMonthFooterSummary,
117
+ R as formatQuarterFooterSummary,
118
+ j as formatWeekFooterSummary,
119
+ q as formatYearFooterSummary
69
120
  };
@@ -1,18 +1,23 @@
1
1
  import { DateRange } from 'react-day-picker';
2
- import { FiscalMonthPattern } from '../../../lib/fiscal-calendar';
2
+ import { CalendarKind, FiscalMonthPattern, Granularity } from '../../../lib/fiscal-calendar';
3
3
  import { FooterFlashTarget } from './calendar-footer-emphasis';
4
- import { MonthRange, MonthSelection, WeekRange, WeekSelection } from './calendar.types';
4
+ import { MonthRange, MonthSelection, QuarterRange, QuarterSelection, WeekRange, WeekSelection, YearRange, YearSelection } from './calendar.types';
5
5
  export interface CalendarFooterProps {
6
- pickerType: "date" | "week" | "month";
7
- mode: "single" | "multiple" | "range";
6
+ pickerType: "date" | "week" | "month" | "quarter" | "year";
7
+ mode: "single" | "multiple" | "range" | "multi-range";
8
8
  weekMode: "single" | "multiple" | "range";
9
9
  monthMode: "single" | "multiple" | "range";
10
- calendarType: "calendar" | "fiscal";
11
- selectionMode: "week" | "fiscalMonth";
10
+ yearMode?: "single" | "multiple" | "range";
11
+ calendarKind: CalendarKind;
12
+ granularity?: Granularity;
12
13
  resolvedFiscalPattern?: FiscalMonthPattern;
14
+ fiscalConfig?: import('../../../lib/fiscal-calendar').FiscalCalendarConfig;
13
15
  pendingSelection?: Date | Date[] | DateRange;
14
16
  pendingWeekSelection?: WeekSelection | WeekSelection[] | WeekRange;
15
17
  pendingMonthSelection?: MonthSelection | MonthSelection[] | MonthRange;
18
+ pendingQuarterSelection?: QuarterSelection | QuarterSelection[] | QuarterRange;
19
+ pendingYearSelection?: YearSelection | YearSelection[] | YearRange;
20
+ multiRangeSummary?: string;
16
21
  disableApply: boolean;
17
22
  isApplyDisabled: boolean;
18
23
  footerFlashKey?: number;
@@ -24,9 +29,13 @@ export interface CalendarFooterProps {
24
29
  selected: string;
25
30
  monthSingle: string;
26
31
  monthPlural: (count: number) => string;
32
+ quarterSingle: string;
33
+ quarterPlural: (count: number) => string;
34
+ yearSingle: string;
35
+ yearPlural: (count: number) => string;
27
36
  };
28
37
  onClear: () => void;
29
38
  onCancel: () => void;
30
39
  onApply: () => void;
31
40
  }
32
- export declare function CalendarFooter({ pickerType, mode, weekMode, monthMode, calendarType, selectionMode, resolvedFiscalPattern, pendingSelection, pendingWeekSelection, pendingMonthSelection, disableApply, isApplyDisabled, footerFlashKey, footerFlashTarget, labels, onClear, onCancel, onApply, }: CalendarFooterProps): import("react/jsx-runtime").JSX.Element;
41
+ export declare function CalendarFooter({ pickerType, mode, weekMode, monthMode, yearMode, calendarKind, granularity, resolvedFiscalPattern, fiscalConfig, pendingSelection, pendingWeekSelection, pendingMonthSelection, pendingQuarterSelection, pendingYearSelection, multiRangeSummary, disableApply, isApplyDisabled, footerFlashKey, footerFlashTarget, labels, onClear, onCancel, onApply, }: CalendarFooterProps): import("react/jsx-runtime").JSX.Element;