impact-nova 2.5.8 → 2.5.10

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