impact-nova 2.5.9 → 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 (73) hide show
  1. package/dist/components/data/data-table/column-runtime-state-guard.js +42 -42
  2. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +15 -0
  3. package/dist/components/data/data-table/data-table-column-tree-cache.js +109 -80
  4. package/dist/components/data/data-table/use-data-table-column-list-sync.js +65 -62
  5. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  6. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  7. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  8. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  9. package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +6 -1
  10. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +31 -23
  11. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +5 -2
  12. package/dist/components/data-display/calendar/calendar-day-picker-components.js +210 -167
  13. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
  14. package/dist/components/data-display/calendar/calendar-day-picker-view.js +126 -124
  15. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  16. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  17. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  18. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  19. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -1
  20. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +20 -16
  21. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +1 -0
  22. package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
  23. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +3 -1
  24. package/dist/components/data-display/calendar/calendar-week-number-cell.js +68 -53
  25. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
  26. package/dist/components/data-display/calendar/calendar-week-utils.js +51 -47
  27. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +2 -0
  28. package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
  29. package/dist/components/data-display/calendar/calendar.js +170 -165
  30. package/dist/components/data-display/calendar/calendar.types.d.ts +7 -0
  31. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +5 -2
  32. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +86 -76
  33. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  34. package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
  35. package/dist/components/feedback/dialog/dialog.js +12 -12
  36. package/dist/components/feedback/sheet/sheet.js +22 -22
  37. package/dist/components/forms/date-picker/calendar-selection-adapters.d.ts +2 -0
  38. package/dist/components/forms/date-picker/calendar-selection-adapters.js +36 -31
  39. package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -0
  40. package/dist/components/forms/date-picker/date-input-behavior.js +111 -90
  41. package/dist/components/forms/date-picker/date-picker.js +74 -70
  42. package/dist/components/forms/date-picker/date-picker.types.d.ts +7 -0
  43. package/dist/components/forms/date-picker/date-range-picker.js +148 -144
  44. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +2 -0
  45. package/dist/components/forms/date-picker/fiscal-pass-through.js +4 -2
  46. package/dist/components/forms/date-picker/month-picker.js +84 -80
  47. package/dist/components/forms/date-picker/month-range-picker.js +147 -143
  48. package/dist/components/forms/date-picker/multi-date-picker.js +53 -49
  49. package/dist/components/forms/date-picker/multi-month-picker.js +51 -47
  50. package/dist/components/forms/date-picker/multi-quarter-picker.js +48 -44
  51. package/dist/components/forms/date-picker/multi-week-picker.js +55 -51
  52. package/dist/components/forms/date-picker/multi-year-picker.js +50 -46
  53. package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
  54. package/dist/components/forms/date-picker/quarter-picker.js +48 -44
  55. package/dist/components/forms/date-picker/quarter-range-picker.js +47 -43
  56. package/dist/components/forms/date-picker/week-picker.js +86 -82
  57. package/dist/components/forms/date-picker/week-range-picker.js +171 -164
  58. package/dist/components/forms/date-picker/year-picker.js +49 -45
  59. package/dist/components/forms/date-picker/year-range-picker.js +49 -45
  60. package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
  61. package/dist/components/forms/select/select.js +1 -0
  62. package/dist/form-react/Fields/DateInputField.js +51 -50
  63. package/dist/form-react/Fields/DateRangeField.js +14 -13
  64. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  65. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  66. package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
  67. package/dist/form-react/Fields/WeekRangePicker.js +48 -48
  68. package/dist/form-react/types/fields.types.d.ts +14 -0
  69. package/dist/impact-nova.css +1 -1
  70. package/dist/lib/overlay/overlay-portal-context.js +16 -16
  71. package/dist/llms/rules/installation.js +1 -1
  72. package/dist/llms/rules/requirements.js +1 -1
  73. package/package.json +1 -1
@@ -1,26 +1,26 @@
1
- import { jsx as l, jsxs as w } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as F } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import { Cross as ye, CalendarMonth as ge } from "impact-nova-icons";
4
- import { cn as ke } from "../../../lib/utils.js";
5
- import { usePickerDismissActionsRef as De, usePickerFooterDismissNudge as Me, isDateInputInvalid as K, resolveSingleValueDismissFlash as Pe, compareMonthSelection as Ie, handlePickerSurfacePointerDown as Se, maskDateInput as Ce, parseDateInput as xe, resolveDateInputOnEnter as Re, resolveDateInputOnBlur as be } from "./date-input-behavior.js";
6
- import { Input as Fe } from "../input/input.js";
7
- import { Calendar as we } from "../../data-display/calendar/calendar.js";
8
- import { Tooltip as $, TooltipTrigger as q, TooltipContent as G } from "../../feedback/tooltip/tooltip.js";
9
- import { useImpactNovaI18n as Ne } from "../../../i18n/use-impact-nova-i18n.js";
10
- import { coerceSingleMonthApply as Te, coerceSingleMonth as Ae } from "./calendar-selection-adapters.js";
11
- import { buildDateBoundsMatcher as Ee } from "../../../lib/date-bounds-matcher.js";
12
- import { fiscalCalendarPassThrough as Oe } from "./fiscal-pass-through.js";
13
- import { DatePickerShell as Ve } from "./date-picker-shell.js";
14
- import { looksLikeFiscalPeriodInput as N, monthSelectionFromFiscalInput as T, formatFiscalPeriod as Be } from "./fiscal-period-format.js";
15
- import { resolveFiscalConfig as je } from "../../data-display/calendar/calendar-config.js";
3
+ import { Cross as ke, CalendarMonth as De } from "impact-nova-icons";
4
+ import { cn as Me } from "../../../lib/utils.js";
5
+ import { usePickerDismissActionsRef as Pe, usePickerFooterDismissNudge as Ie, isDateInputInvalid as $, resolveSingleValueDismissFlash as Se, compareMonthSelection as Ce, handlePickerEscapeKeyDown as xe, handlePickerSurfacePointerDown as Re, maskDateInput as be, parseDateInput as we, resolveDateInputOnEnter as Fe, resolveDateInputOnBlur as Ee } from "./date-input-behavior.js";
6
+ import { Input as Ne } from "../input/input.js";
7
+ import { Calendar as Te } from "../../data-display/calendar/calendar.js";
8
+ import { Tooltip as v, TooltipTrigger as q, TooltipContent as G } from "../../feedback/tooltip/tooltip.js";
9
+ import { useImpactNovaI18n as Ae } from "../../../i18n/use-impact-nova-i18n.js";
10
+ import { coerceSingleMonthApply as Oe, coerceSingleMonth as Ve } from "./calendar-selection-adapters.js";
11
+ import { buildDateBoundsMatcher as Be } from "../../../lib/date-bounds-matcher.js";
12
+ import { fiscalCalendarPassThrough as je } from "./fiscal-pass-through.js";
13
+ import { DatePickerShell as Ke } from "./date-picker-shell.js";
14
+ import { looksLikeFiscalPeriodInput as E, monthSelectionFromFiscalInput as N, formatFiscalPeriod as Le } from "./fiscal-period-format.js";
15
+ import { resolveFiscalConfig as Ye } from "../../data-display/calendar/calendar-config.js";
16
16
  const y = (t) => {
17
- const s = Be(t);
17
+ const s = Le(t);
18
18
  return s || `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`;
19
- }, Le = o.forwardRef(
19
+ }, ze = o.forwardRef(
20
20
  ({
21
21
  value: t,
22
22
  onChange: s,
23
- placeholder: A,
23
+ placeholder: T,
24
24
  minDate: J,
25
25
  maxDate: Q,
26
26
  startMonth: U,
@@ -30,78 +30,82 @@ const y = (t) => {
30
30
  className: X,
31
31
  onBlur: Z,
32
32
  calendarKind: S,
33
- fiscalMode: E,
33
+ fiscalMode: A,
34
34
  granularity: _,
35
35
  fiscalMonthPattern: O,
36
36
  fiscalYearStartMonth: V,
37
37
  fiscalConfig: B,
38
38
  showPresets: ee,
39
- ...te
40
- }, ne) => {
41
- const { t: d } = Ne(), re = A ?? d("datePicker.selectMonth"), C = o.useRef(null), j = o.useRef(null);
42
- o.useImperativeHandle(ne, () => C.current);
43
- const [r, L] = o.useState(!1), u = o.useCallback(() => {
44
- L(!1);
39
+ showPeriodBoundaries: te,
40
+ autoNavigateToAvailable: ne,
41
+ ...re
42
+ }, oe) => {
43
+ const { t: d } = Ae(), ie = T ?? d("datePicker.selectMonth"), C = o.useRef(null), j = o.useRef(null);
44
+ o.useImperativeHandle(oe, () => C.current);
45
+ const [r, K] = o.useState(!1), u = o.useCallback(() => {
46
+ K(!1);
45
47
  }, []), h = (e) => {
46
48
  if (!f) {
47
49
  if (e) {
48
- L(!0);
50
+ K(!0);
49
51
  return;
50
52
  }
51
53
  u();
52
54
  }
53
- }, Y = De(), { footerFlashKey: oe, footerFlashTarget: ie, popoverHandlers: se } = Me(p, r, Y, j), [M, i] = o.useState(t), [c, a] = o.useState(t ? y(t) : ""), [ce, P] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
55
+ }, L = Pe(), { footerFlashKey: se, footerFlashTarget: ce, popoverHandlers: ae } = Ie(p, r, L, j), [M, i] = o.useState(t), [c, a] = o.useState(t ? y(t) : ""), [le, P] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
54
56
  o.useEffect(() => {
55
57
  r || (a(t ? y(t) : ""), i(t));
56
58
  }, [r, t]), o.useEffect(() => {
57
59
  r && (i(t), P(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), a(t ? y(t) : ""));
58
60
  }, [r, t]);
59
- const ae = (e) => {
60
- const n = Ae(e);
61
+ const pe = (e) => {
62
+ const n = Ve(e);
61
63
  i(n), n && a(y(n)), p || (s?.(n), u());
62
- }, v = (e) => {
63
- const n = Te(e, M);
64
+ }, Y = (e) => {
65
+ const n = Oe(e, M);
64
66
  s?.(n), u();
65
67
  }, x = () => {
66
68
  i(t), a(t ? y(t) : ""), u();
67
69
  }, z = () => {
68
70
  i(void 0), a(""), s?.(void 0), p || u();
69
- }, le = Oe({
71
+ }, fe = je({
70
72
  calendarKind: S,
71
- fiscalMode: E,
73
+ fiscalMode: A,
72
74
  granularity: _,
73
75
  fiscalMonthPattern: O,
74
76
  fiscalYearStartMonth: V,
75
77
  fiscalConfig: B,
76
- showPresets: ee
77
- }), R = je({
78
+ showPresets: ee,
79
+ showPeriodBoundaries: te,
80
+ autoNavigateToAvailable: ne
81
+ }), R = Ye({
78
82
  fiscalConfig: B,
79
83
  calendarKind: S,
80
- fiscalMode: E,
84
+ fiscalMode: A,
81
85
  fiscalMonthPattern: O,
82
86
  fiscalYearStartMonth: V
83
- }), b = S === "fiscal", g = "MM/yyyy", k = t ? y(t) : "", D = o.useRef(!1), pe = (e) => {
87
+ }), b = S === "fiscal", g = "MM/yyyy", k = t ? y(t) : "", D = o.useRef(!1), ue = (e) => {
84
88
  const n = e.target.value;
85
- if (b && N(n)) {
89
+ if (b && E(n)) {
86
90
  a(n);
87
- const m = T(n, R);
91
+ const m = N(n, R);
88
92
  m && (i(m), P(new Date(m.year, m.month, 1)), p || s?.(m));
89
93
  return;
90
94
  }
91
- const F = Ce(n, g, c);
92
- if (a(F), F === "") {
95
+ const w = be(n, g, c);
96
+ if (a(w), w === "") {
93
97
  i(void 0), p || s?.(void 0);
94
98
  return;
95
99
  }
96
- const { parsed: I, isValid: he } = xe(F, g);
97
- if (he && I) {
100
+ const { parsed: I, isValid: ge } = we(w, g);
101
+ if (ge && I) {
98
102
  const m = { month: I.getMonth(), year: I.getFullYear() };
99
103
  i(m), P(I), p || s?.(m);
100
104
  }
101
- }, fe = () => {
105
+ }, me = () => {
102
106
  if (r) return;
103
- if (b && N(c)) {
104
- const n = T(c, R);
107
+ if (b && E(c)) {
108
+ const n = N(c, R);
105
109
  if (n) {
106
110
  a(y(n)), i(n), p || s?.(n);
107
111
  return;
@@ -109,7 +113,7 @@ const y = (t) => {
109
113
  a(k), i(t);
110
114
  return;
111
115
  }
112
- const e = be(c, g, k);
116
+ const e = Ee(c, g, k);
113
117
  if (e.resetToCommitted) {
114
118
  a(k), i(t);
115
119
  return;
@@ -120,12 +124,12 @@ const y = (t) => {
120
124
  return;
121
125
  }
122
126
  a(k), i(t);
123
- }, ue = () => {
127
+ }, de = () => {
124
128
  if (r && p) {
125
- v();
129
+ Y();
126
130
  return;
127
131
  }
128
- const e = Re(c, g);
132
+ const e = Fe(c, g);
129
133
  if (e.parsed) {
130
134
  const n = {
131
135
  month: e.parsed.getMonth(),
@@ -135,21 +139,21 @@ const y = (t) => {
135
139
  return;
136
140
  }
137
141
  r || (D.current = !0, h(!0));
138
- }, H = k !== c, me = b ? N(c) ? T(c, R) == null && c !== "" : K(c, g) : K(c, g), de = o.useCallback(
139
- () => Pe(
142
+ }, H = k !== c, he = b ? E(c) ? N(c, R) == null && c !== "" : $(c, g) : $(c, g), ye = o.useCallback(
143
+ () => Se(
140
144
  M,
141
145
  t,
142
- (e, n) => Ie(e, n) === 0
146
+ (e, n) => Ce(e, n) === 0
143
147
  ),
144
148
  [M, t]
145
149
  );
146
150
  return o.useLayoutEffect(() => {
147
- Y.current = {
151
+ L.current = {
148
152
  onDismiss: x,
149
- resolveFlash: de
153
+ resolveFlash: ye
150
154
  };
151
155
  }), /* @__PURE__ */ l(
152
- Ve,
156
+ Ke,
153
157
  {
154
158
  open: r,
155
159
  disabled: f,
@@ -158,7 +162,7 @@ const y = (t) => {
158
162
  onOpenAutoFocus: (e) => {
159
163
  D.current || e.preventDefault(), D.current = !1;
160
164
  },
161
- popoverHandlers: se,
165
+ popoverHandlers: ae,
162
166
  trigger: /* @__PURE__ */ l(
163
167
  "div",
164
168
  {
@@ -166,35 +170,35 @@ const y = (t) => {
166
170
  "data-component": "month-picker",
167
171
  "data-state": r ? "open" : "closed",
168
172
  "data-pending": H || void 0,
169
- onPointerDown: (e) => Se({
173
+ onPointerDown: (e) => Re({
170
174
  disabled: f,
171
175
  event: e,
172
176
  onOpen: () => h(!0),
173
177
  focusField: () => C.current?.focus()
174
178
  }),
175
179
  children: /* @__PURE__ */ l(
176
- Fe,
180
+ Ne,
177
181
  {
178
182
  ref: C,
179
183
  value: c,
180
- onChange: pe,
184
+ onChange: ue,
181
185
  onBlur: (e) => {
182
- fe(), Z?.(e);
186
+ me(), Z?.(e);
183
187
  },
184
188
  onClick: () => !f && h(!0),
185
189
  onKeyDown: (e) => {
186
- e.key === "Enter" && !f && (e.preventDefault(), ue()), e.key === "ArrowDown" && !r && !f && (e.preventDefault(), D.current = !0, h(!0)), e.key === "Escape" && r && (e.preventDefault(), x());
190
+ e.key === "Enter" && !f && (e.preventDefault(), de()), e.key === "ArrowDown" && !r && !f && (e.preventDefault(), D.current = !0, h(!0)), e.key === "Escape" && r && xe(e, { open: r, onCancel: x });
187
191
  },
188
- placeholder: r ? d("datePicker.monthYearFormat") : re,
192
+ placeholder: r ? d("datePicker.monthYearFormat") : ie,
189
193
  disabled: f,
190
194
  "data-form-control": "input",
191
- className: ke(
195
+ className: Me(
192
196
  "cursor-pointer",
193
- me ? "text-destructive" : H ? "text-content-placeholder" : "",
197
+ he ? "text-destructive" : H ? "text-content-placeholder" : "",
194
198
  X
195
199
  ),
196
- suffix: /* @__PURE__ */ w("div", { className: "flex items-center gap-1", children: [
197
- t && !f && /* @__PURE__ */ w($, { children: [
200
+ suffix: /* @__PURE__ */ F("div", { className: "flex items-center gap-1", children: [
201
+ t && !f && /* @__PURE__ */ F(v, { children: [
198
202
  /* @__PURE__ */ l(q, { asChild: !0, children: /* @__PURE__ */ l(
199
203
  "button",
200
204
  {
@@ -205,12 +209,12 @@ const y = (t) => {
205
209
  e.stopPropagation(), z();
206
210
  },
207
211
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
208
- children: /* @__PURE__ */ l(ye, { className: "size-3 hover:text-content" })
212
+ children: /* @__PURE__ */ l(ke, { className: "size-3 hover:text-content" })
209
213
  }
210
214
  ) }),
211
215
  /* @__PURE__ */ l(G, { variant: "tertiary", side: "top", children: d("calendar.clear") })
212
216
  ] }),
213
- /* @__PURE__ */ w($, { children: [
217
+ /* @__PURE__ */ F(v, { children: [
214
218
  /* @__PURE__ */ l(q, { asChild: !0, children: /* @__PURE__ */ l(
215
219
  "button",
216
220
  {
@@ -225,43 +229,43 @@ const y = (t) => {
225
229
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), f || (D.current = !0, r ? u() : h(!0)));
226
230
  },
227
231
  className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
228
- children: /* @__PURE__ */ l(ge, { className: "h-4 w-4 text-secondary-foreground" })
232
+ children: /* @__PURE__ */ l(De, { className: "h-4 w-4 text-secondary-foreground" })
229
233
  }
230
234
  ) }),
231
235
  /* @__PURE__ */ l(G, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
232
236
  ] })
233
237
  ] }),
234
- ...te
238
+ ...re
235
239
  }
236
240
  )
237
241
  }
238
242
  ),
239
243
  children: /* @__PURE__ */ l(
240
- we,
244
+ Te,
241
245
  {
242
246
  pickerType: "month",
243
247
  monthMode: "single",
244
248
  selectedMonths: M,
245
- footerFlashKey: oe,
246
- footerFlashTarget: ie,
247
- onMonthSelect: ae,
248
- month: ce,
249
+ footerFlashKey: se,
250
+ footerFlashTarget: ce,
251
+ onMonthSelect: pe,
252
+ month: le,
249
253
  onMonthChange: P,
250
- disabled: Ee(J, Q),
254
+ disabled: Be(J, Q),
251
255
  startMonth: U,
252
256
  endMonth: W,
253
257
  showFooter: p,
254
- onApply: v,
258
+ onApply: Y,
255
259
  onCancel: x,
256
260
  onClear: z,
257
- ...le
261
+ ...fe
258
262
  }
259
263
  )
260
264
  }
261
265
  );
262
266
  }
263
267
  );
264
- Le.displayName = "MonthPicker";
268
+ ze.displayName = "MonthPicker";
265
269
  export {
266
- Le as MonthPicker
270
+ ze as MonthPicker
267
271
  };