impact-nova 2.2.3 → 2.2.4

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 (51) hide show
  1. package/dist/components/data/ag-grid-react/headers/custom-header.js +133 -110
  2. package/dist/components/data/ag-grid-react/headers/header-search-input.js +23 -23
  3. package/dist/components/data/ag-grid-react/index.js +202 -206
  4. package/dist/components/data/data-table/build-column-tree-from-grid.js +65 -67
  5. package/dist/components/data/data-table/data-table-column-list-sync.js +5 -10
  6. package/dist/components/data/data-table/data-table-column-list.js +64 -61
  7. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +29 -0
  8. package/dist/components/data/data-table/data-table-column-tree-cache.js +117 -0
  9. package/dist/components/data/data-table/data-table-constants.d.ts +2 -0
  10. package/dist/components/data/data-table/data-table-constants.js +3 -2
  11. package/dist/components/data/data-table/data-table-sheet.js +46 -49
  12. package/dist/components/data/data-table/data-table.js +137 -119
  13. package/dist/components/data/data-table/index.js +24 -23
  14. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +3 -0
  15. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +24 -0
  16. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +2 -1
  17. package/dist/components/data/data-table/use-data-table-column-list-sync.js +249 -150
  18. package/dist/components/data/nested-list/components/NestedListContent.js +158 -96
  19. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -0
  20. package/dist/components/data/nested-list/nested-list-constants.js +6 -0
  21. package/dist/components/data/nested-list/nested-list-tree-utils.d.ts +3 -0
  22. package/dist/components/data/nested-list/nested-list-tree-utils.js +24 -0
  23. package/dist/components/data/nested-list/nested-list.js +214 -215
  24. package/dist/components/data-display/card/card.js +6 -5
  25. package/dist/components/feedback/dialog/dialog.js +7 -5
  26. package/dist/components/feedback/sheet/sheet.js +28 -27
  27. package/dist/components/flows/filter-panel/filter-panel.js +36 -35
  28. package/dist/components/flows/filter-strip/filter-tag-list.js +33 -33
  29. package/dist/components/forms/combobox/combobox.js +110 -100
  30. package/dist/components/forms/date-picker/date-input-behavior.d.ts +9 -0
  31. package/dist/components/forms/date-picker/date-input-behavior.js +32 -19
  32. package/dist/components/forms/date-picker/date-picker.js +96 -90
  33. package/dist/components/forms/date-picker/date-range-picker.js +160 -152
  34. package/dist/components/forms/date-picker/month-picker.js +71 -65
  35. package/dist/components/forms/date-picker/month-range-picker.js +153 -145
  36. package/dist/components/forms/date-picker/multi-date-picker.js +127 -99
  37. package/dist/components/forms/date-picker/multi-month-picker.js +109 -97
  38. package/dist/components/forms/date-picker/multi-week-picker.js +98 -86
  39. package/dist/components/forms/date-picker/week-picker.js +82 -76
  40. package/dist/components/forms/date-picker/week-range-picker.js +127 -119
  41. package/dist/impact-nova-base.scss +10 -5
  42. package/dist/impact-nova-components.css +9 -5
  43. package/dist/impact-nova.css +1 -1
  44. package/dist/index.js +189 -188
  45. package/dist/lib/overlay/overlay-portal-context.d.ts +11 -2
  46. package/dist/lib/overlay/overlay-portal-context.js +39 -28
  47. package/dist/lib/primitives/create-compound.d.ts +5 -0
  48. package/dist/lib/primitives/create-compound.js +17 -16
  49. package/dist/llms/rules/installation.js +1 -1
  50. package/dist/llms/rules/requirements.js +1 -1
  51. package/package.json +1 -1
@@ -1,44 +1,44 @@
1
- import { jsxs as x, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as o } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import { Cross as se, CalendarMonth as le } from "impact-nova-icons";
4
- import { format as S } from "date-fns";
4
+ import { format as w } from "date-fns";
5
5
  import { cn as ce } from "../../../lib/utils.js";
6
- import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as pe, isDateInputInvalid as ue, resolveSingleValueDismissFlash as de, maskDateInput as fe, parseDateInput as me, resolveDateInputOnBlur as he, resolveDateInputOnEnter as De } from "./date-input-behavior.js";
7
- import { Input as ge } from "../input/input.js";
8
- import { Popover as ye, PopoverAnchor as ve, PopoverContent as ke } from "../../feedback/popover/popover.js";
9
- import { Calendar as Ce } from "../../data-display/calendar/calendar.js";
6
+ import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as pe, isDateInputInvalid as ue, resolveSingleValueDismissFlash as fe, handlePickerSurfacePointerDown as de, maskDateInput as me, parseDateInput as he, resolveDateInputOnBlur as De, resolveDateInputOnEnter as ge } from "./date-input-behavior.js";
7
+ import { Input as ye } from "../input/input.js";
8
+ import { Popover as ke, PopoverAnchor as ve, PopoverContent as Ce } from "../../feedback/popover/popover.js";
9
+ import { Calendar as Ie } from "../../data-display/calendar/calendar.js";
10
10
  import { Tooltip as j, TooltipTrigger as B, TooltipContent as K } from "../../feedback/tooltip/tooltip.js";
11
- import { useImpactNovaI18n as Ie } from "../../../i18n/use-impact-nova-i18n.js";
12
- import { getDateFnsLocale as Pe } from "../../../i18n/getDateFnsLocale.js";
13
- import { createComponent as Me } from "../../../lib/primitives/create-component.js";
14
- import { coerceSingleDateApply as xe, coerceSingleDate as Re } from "./calendar-selection-adapters.js";
15
- import { buildDateBoundsMatcher as be } from "../../../lib/date-bounds-matcher.js";
16
- const qe = Me(
11
+ import { useImpactNovaI18n as Pe } from "../../../i18n/use-impact-nova-i18n.js";
12
+ import { getDateFnsLocale as Me } from "../../../i18n/getDateFnsLocale.js";
13
+ import { createComponent as xe } from "../../../lib/primitives/create-component.js";
14
+ import { coerceSingleDateApply as Re, coerceSingleDate as be } from "./calendar-selection-adapters.js";
15
+ import { buildDateBoundsMatcher as we } from "../../../lib/date-bounds-matcher.js";
16
+ const Ge = xe(
17
17
  "DatePicker",
18
18
  ({
19
19
  value: n,
20
20
  onChange: u,
21
- format: l = "MM/dd/yyyy",
21
+ format: c = "MM/dd/yyyy",
22
22
  placeholder: z,
23
23
  minDate: H,
24
24
  maxDate: q,
25
25
  startMonth: G,
26
26
  endMonth: J,
27
- showFooter: c = !0,
28
- weekStartsOn: w,
29
- disabled: a,
27
+ showFooter: a = !0,
28
+ weekStartsOn: S,
29
+ disabled: l,
30
30
  className: Q,
31
31
  ...U
32
32
  }, W) => {
33
- const { locale: T, t: m } = Ie(), d = r.useMemo(() => Pe(T), [T]), X = z ?? m("datePicker.selectDate"), C = r.useRef(null), A = r.useRef(null), I = r.useRef(null);
34
- r.useImperativeHandle(W, () => C.current);
35
- const [o, E] = r.useState(!1), N = ae(), { footerFlashKey: Y, footerFlashTarget: Z, popoverHandlers: _ } = pe(c, o, N, A), g = r.useRef(!1), [R, s] = r.useState(null), y = n ? S(n, l, { locale: d }) : "", f = R?.input ?? y, P = o ? R?.pending ?? n : n, $ = R?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), p = r.useCallback(() => {
33
+ const { locale: T, t: h } = Pe(), f = r.useMemo(() => Me(T), [T]), X = z ?? h("datePicker.selectDate"), g = r.useRef(null), A = r.useRef(null), I = r.useRef(null);
34
+ r.useImperativeHandle(W, () => g.current);
35
+ const [i, E] = r.useState(!1), N = ae(), { footerFlashKey: Y, footerFlashTarget: Z, popoverHandlers: _ } = pe(a, i, N, A), y = r.useRef(!1), [R, s] = r.useState(null), k = n ? w(n, c, { locale: f }) : "", d = R?.input ?? k, P = i ? R?.pending ?? n : n, $ = R?.viewMonth ?? n ?? /* @__PURE__ */ new Date(), p = r.useCallback(() => {
36
36
  s(null), E(!1);
37
- }, []), h = (e) => {
38
- if (!a) {
37
+ }, []), m = (e) => {
38
+ if (!l) {
39
39
  if (e) {
40
40
  s({
41
- input: y,
41
+ input: k,
42
42
  pending: n,
43
43
  viewMonth: n ?? /* @__PURE__ */ new Date()
44
44
  }), E(!0);
@@ -48,54 +48,54 @@ const qe = Me(
48
48
  }
49
49
  };
50
50
  r.useEffect(() => {
51
- C.current && I.current !== null && (C.current.setSelectionRange(I.current, I.current), I.current = null);
52
- }, [f]);
51
+ g.current && I.current !== null && (g.current.setSelectionRange(I.current, I.current), I.current = null);
52
+ }, [d]);
53
53
  const F = (e) => {
54
- const t = Re(e), D = t ? S(t, l, { locale: d }) : "";
54
+ const t = be(e), D = t ? w(t, c, { locale: f }) : "";
55
55
  s(
56
56
  (v) => v ? { ...v, pending: t, input: D, viewMonth: t ?? v.viewMonth } : null
57
- ), t && !c && (u?.(t), p());
58
- }, V = (e) => {
59
- const t = xe(e, P);
57
+ ), t && !a && (u?.(t), p());
58
+ }, O = (e) => {
59
+ const t = Re(e, P);
60
60
  u?.(t), p();
61
61
  }, b = () => {
62
62
  p();
63
- }, L = () => {
64
- u?.(void 0), c ? s(
63
+ }, V = () => {
64
+ u?.(void 0), a ? s(
65
65
  (e) => e ? { ...e, pending: void 0, input: "" } : null
66
66
  ) : p();
67
67
  }, M = r.useCallback(
68
68
  () => ({
69
- input: y,
69
+ input: k,
70
70
  pending: n,
71
71
  viewMonth: n ?? /* @__PURE__ */ new Date()
72
72
  }),
73
- [y, n]
73
+ [k, n]
74
74
  ), ee = (e) => {
75
- const t = fe(e.target.value, l, f);
76
- if (s((k) => ({ ...k ?? M(), input: t })), t === "") {
77
- s((k) => ({ ...k ?? M(), input: "", pending: void 0 })), c || u?.(void 0);
75
+ const t = me(e.target.value, c, d);
76
+ if (s((C) => ({ ...C ?? M(), input: t })), t === "") {
77
+ s((C) => ({ ...C ?? M(), input: "", pending: void 0 })), a || u?.(void 0);
78
78
  return;
79
79
  }
80
- const { parsed: D, isValid: v } = me(t, l, d);
81
- v && D && (s((k) => ({
82
- ...k ?? M(),
80
+ const { parsed: D, isValid: v } = he(t, c, f);
81
+ v && D && (s((C) => ({
82
+ ...C ?? M(),
83
83
  input: t,
84
84
  pending: D,
85
85
  viewMonth: D
86
- })), c || u?.(D));
86
+ })), a || u?.(D));
87
87
  }, te = r.useCallback(
88
88
  (e) => {
89
89
  u?.(e), p();
90
90
  },
91
91
  [u, p]
92
92
  ), ne = () => {
93
- if (o) return;
94
- const e = he(
95
- f,
96
- l,
97
- y,
98
- d
93
+ if (i) return;
94
+ const e = De(
95
+ d,
96
+ c,
97
+ k,
98
+ f
99
99
  );
100
100
  if (e.resetToCommitted) {
101
101
  s(null);
@@ -107,23 +107,23 @@ const qe = Me(
107
107
  input: e.display,
108
108
  pending: e.parsed,
109
109
  viewMonth: e.parsed
110
- })), c || (u?.(e.parsed), s(null));
110
+ })), a || (u?.(e.parsed), s(null));
111
111
  return;
112
112
  }
113
113
  s(null);
114
114
  }, re = () => {
115
- if (o && c) {
116
- V();
115
+ if (i && a) {
116
+ O();
117
117
  return;
118
118
  }
119
- const e = De(f, l, d);
119
+ const e = ge(d, c, f);
120
120
  if (e.parsed) {
121
- c && te(e.parsed);
121
+ a && te(e.parsed);
122
122
  return;
123
123
  }
124
- o || (g.current = !0, h(!0));
125
- }, O = (n ? S(n, l, { locale: d }) : "") !== f, ie = ue(f, l, d), oe = r.useCallback(
126
- () => de(
124
+ i || (y.current = !0, m(!0));
125
+ }, L = (n ? w(n, c, { locale: f }) : "") !== d, oe = ue(d, c, f), ie = r.useCallback(
126
+ () => fe(
127
127
  P,
128
128
  n,
129
129
  (e, t) => e.getTime() === t.getTime()
@@ -133,59 +133,65 @@ const qe = Me(
133
133
  return r.useLayoutEffect(() => {
134
134
  N.current = {
135
135
  onDismiss: b,
136
- resolveFlash: oe
136
+ resolveFlash: ie
137
137
  };
138
- }), /* @__PURE__ */ x(ye, { open: a ? !1 : o, onOpenChange: h, children: [
139
- /* @__PURE__ */ i(ve, { asChild: !0, children: /* @__PURE__ */ i(
138
+ }), /* @__PURE__ */ x(ke, { open: l ? !1 : i, onOpenChange: m, children: [
139
+ /* @__PURE__ */ o(ve, { asChild: !0, children: /* @__PURE__ */ o(
140
140
  "div",
141
141
  {
142
142
  ref: A,
143
143
  "data-component": "date-picker",
144
- "data-state": o ? "open" : "closed",
145
- "data-pending": O || void 0,
146
- children: /* @__PURE__ */ i(
147
- ge,
144
+ "data-state": i ? "open" : "closed",
145
+ "data-pending": L || void 0,
146
+ onPointerDown: (e) => de({
147
+ disabled: l,
148
+ event: e,
149
+ onOpen: () => m(!0),
150
+ focusField: () => g.current?.focus()
151
+ }),
152
+ children: /* @__PURE__ */ o(
153
+ ye,
148
154
  {
149
- ref: C,
150
- value: f,
155
+ ref: g,
156
+ value: d,
151
157
  onChange: ee,
152
158
  onBlur: ne,
153
- onClick: () => !a && h(!0),
159
+ onClick: () => !l && m(!0),
154
160
  onKeyDown: (e) => {
155
- e.key === "Enter" && !a && (e.preventDefault(), re()), e.key === "ArrowDown" && !o && !a && (e.preventDefault(), g.current = !0, h(!0)), e.key === "Escape" && o && (e.preventDefault(), b());
161
+ e.key === "Enter" && !l && (e.preventDefault(), re()), e.key === "ArrowDown" && !i && !l && (e.preventDefault(), y.current = !0, m(!0)), e.key === "Escape" && i && (e.preventDefault(), b());
156
162
  },
157
- placeholder: o ? l : X,
158
- disabled: a,
163
+ placeholder: i ? c : X,
164
+ disabled: l,
159
165
  "data-form-control": "input",
160
166
  className: ce(
161
167
  "cursor-pointer",
162
- ie ? "text-destructive" : O ? "text-content-placeholder" : "",
168
+ oe ? "text-destructive" : L ? "text-content-placeholder" : "",
163
169
  Q
164
170
  ),
165
171
  suffix: /* @__PURE__ */ x("div", { className: "flex items-center gap-1", children: [
166
- n && !a && /* @__PURE__ */ x(j, { children: [
167
- /* @__PURE__ */ i(B, { asChild: !0, children: /* @__PURE__ */ i(
172
+ n && !l && /* @__PURE__ */ x(j, { children: [
173
+ /* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o(
168
174
  "button",
169
175
  {
170
176
  type: "button",
171
177
  tabIndex: 0,
172
- "aria-label": m("calendar.clear"),
178
+ "aria-label": h("calendar.clear"),
173
179
  onClick: (e) => {
174
- e.stopPropagation(), L();
180
+ e.stopPropagation(), V();
175
181
  },
176
182
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
177
- children: /* @__PURE__ */ i(se, { className: "size-3 hover:text-content" })
183
+ children: /* @__PURE__ */ o(se, { className: "size-3 hover:text-content" })
178
184
  }
179
185
  ) }),
180
- /* @__PURE__ */ i(K, { variant: "tertiary", side: "top", children: m("calendar.clear") })
186
+ /* @__PURE__ */ o(K, { variant: "tertiary", side: "top", children: h("calendar.clear") })
181
187
  ] }),
182
188
  /* @__PURE__ */ x(j, { children: [
183
- /* @__PURE__ */ i(B, { asChild: !0, children: /* @__PURE__ */ i("button", { type: "button", tabIndex: 0, "aria-label": m("datePicker.selectDate"), onClick: (e) => {
184
- e.stopPropagation(), a || (o ? p() : h(!0));
189
+ /* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ o("button", { type: "button", tabIndex: 0, "aria-label": h("datePicker.selectDate"), onClick: (e) => {
190
+ e.stopPropagation(), l || (i ? p() : m(!0));
185
191
  }, onKeyDown: (e) => {
186
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), a || (g.current = !0, o ? p() : h(!0)));
187
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ i(le, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
188
- /* @__PURE__ */ i(K, { variant: "tertiary", side: "top", children: m("datePicker.selectDate") })
192
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), l || (y.current = !0, i ? p() : m(!0)));
193
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ o(le, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
194
+ /* @__PURE__ */ o(K, { variant: "tertiary", side: "top", children: h("datePicker.selectDate") })
189
195
  ] })
190
196
  ] }),
191
197
  ...U
@@ -193,18 +199,18 @@ const qe = Me(
193
199
  )
194
200
  }
195
201
  ) }),
196
- /* @__PURE__ */ i(
197
- ke,
202
+ /* @__PURE__ */ o(
203
+ Ce,
198
204
  {
199
205
  className: "w-auto p-0",
200
206
  align: "start",
201
- "aria-label": m("datePicker.selectDate"),
207
+ "aria-label": h("datePicker.selectDate"),
202
208
  onOpenAutoFocus: (e) => {
203
- g.current || e.preventDefault(), g.current = !1;
209
+ y.current || e.preventDefault(), y.current = !1;
204
210
  },
205
211
  ..._,
206
- children: /* @__PURE__ */ i(
207
- Ce,
212
+ children: /* @__PURE__ */ o(
213
+ Ie,
208
214
  {
209
215
  mode: "single",
210
216
  selected: P,
@@ -215,15 +221,15 @@ const qe = Me(
215
221
  onMonthChange: (e) => s(
216
222
  (t) => t ? { ...t, viewMonth: e } : null
217
223
  ),
218
- disabled: be(H, q),
224
+ disabled: we(H, q),
219
225
  startMonth: G,
220
226
  endMonth: J,
221
- showFooter: c,
222
- onApply: V,
227
+ showFooter: a,
228
+ onApply: O,
223
229
  onCancel: b,
224
- onClear: L,
230
+ onClear: V,
225
231
  captionLayout: "dropdown",
226
- ...w !== void 0 ? { weekStartsOn: w } : {}
232
+ ...S !== void 0 ? { weekStartsOn: S } : {}
227
233
  }
228
234
  )
229
235
  }
@@ -232,5 +238,5 @@ const qe = Me(
232
238
  }
233
239
  );
234
240
  export {
235
- qe as DatePicker
241
+ Ge as DatePicker
236
242
  };