impact-nova 2.1.0-alpha.9 → 2.2.0

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 (72) hide show
  1. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-editor.js +73 -94
  2. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.d.ts +53 -0
  3. package/dist/components/data/ag-grid-react/cell-renderers/editors/split-cell-focus.js +98 -0
  4. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +15 -13
  5. package/dist/components/data/ag-grid-react/headers/custom-header.js +56 -58
  6. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.d.ts +12 -0
  7. package/dist/components/data/ag-grid-react/headers/custom-inner-header-group.js +31 -0
  8. package/dist/components/data/ag-grid-react/headers/header-search-active-state.d.ts +10 -0
  9. package/dist/components/data/ag-grid-react/headers/header-search-active-state.js +38 -0
  10. package/dist/components/data/ag-grid-react/index.js +166 -163
  11. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -4
  12. package/dist/components/data/ag-grid-react/theme.js +0 -2
  13. package/dist/components/data/data-table/data-table-column-list.js +1 -1
  14. package/dist/components/data/data-table/data-table-saved-views.js +1 -1
  15. package/dist/components/data/nested-list/components/SortableItem.d.ts +3 -1
  16. package/dist/components/data/nested-list/components/SortableItem.js +111 -109
  17. package/dist/components/data-display/calendar/calendar-footer-emphasis.d.ts +28 -0
  18. package/dist/components/data-display/calendar/calendar-footer-emphasis.js +8 -0
  19. package/dist/components/data-display/calendar/calendar-footer.d.ts +4 -1
  20. package/dist/components/data-display/calendar/calendar-footer.js +60 -38
  21. package/dist/components/data-display/calendar/calendar.js +86 -82
  22. package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
  23. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -0
  24. package/dist/components/flows/filter-strip/filter-strip.js +36 -29
  25. package/dist/components/flows/filter-strip/filter-summary.js +2 -2
  26. package/dist/components/forms/date-picker/date-input-behavior.d.ts +118 -0
  27. package/dist/components/forms/date-picker/date-input-behavior.js +164 -0
  28. package/dist/components/forms/date-picker/date-picker.js +202 -138
  29. package/dist/components/forms/date-picker/date-range-picker.js +302 -215
  30. package/dist/components/forms/date-picker/month-picker.js +160 -119
  31. package/dist/components/forms/date-picker/month-range-picker.js +302 -245
  32. package/dist/components/forms/date-picker/multi-date-picker.js +94 -80
  33. package/dist/components/forms/date-picker/multi-month-picker.js +97 -83
  34. package/dist/components/forms/date-picker/multi-week-picker.js +107 -93
  35. package/dist/components/forms/date-picker/week-picker.js +230 -140
  36. package/dist/components/forms/date-picker/week-range-picker.js +332 -226
  37. package/dist/components/forms/file-upload/file-upload.js +312 -174
  38. package/dist/components/forms/file-upload/file-upload.types.d.ts +17 -2
  39. package/dist/components/layout/dynamic-layout/dynamic-layout.variants.d.ts +1 -1
  40. package/dist/components/layout/header/header.js +45 -38
  41. package/dist/components/layout/horizontal-scroller/index.d.ts +1 -0
  42. package/dist/components/layout/horizontal-scroller/index.js +3 -2
  43. package/dist/components/ui/local-raster-icons/assets/excel-error-icon.webp.js +4 -0
  44. package/dist/components/ui/local-raster-icons/assets/file-upload-error.webp.js +4 -0
  45. package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +2 -0
  46. package/dist/components/ui/local-raster-icons/rasterIcons.js +32 -22
  47. package/dist/components/ui/show.d.ts +10 -0
  48. package/dist/components/ui/show.js +7 -0
  49. package/dist/components/ui/show.types.d.ts +5 -0
  50. package/dist/i18n/defaultMessages.d.ts +17 -0
  51. package/dist/i18n/defaultMessages.js +29 -17
  52. package/dist/i18n/index.d.ts +1 -1
  53. package/dist/i18n/locales/de.js +12 -0
  54. package/dist/i18n/locales/es.js +12 -0
  55. package/dist/i18n/locales/hi.js +12 -0
  56. package/dist/i18n/locales/kn.js +12 -0
  57. package/dist/impact-nova-base.scss +6 -2
  58. package/dist/impact-nova-components.css +141 -16
  59. package/dist/impact-nova-tokens.scss +12 -0
  60. package/dist/impact-nova.css +1 -1
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +273 -271
  63. package/dist/lib/utils.js +40 -24
  64. package/dist/llms/rules/ag-grid.js +1 -1
  65. package/dist/llms/rules/installation.js +1 -1
  66. package/dist/llms/rules/requirements.js +1 -1
  67. package/dist/tailwind.config.js +36 -4
  68. package/dist/theme/tailwind-colors.js +3 -1
  69. package/package.json +11 -3
  70. package/tailwind.config.d.ts +3 -0
  71. package/dist/components/data/ag-grid-react/headers/custom-header-group.d.ts +0 -10
  72. package/dist/components/data/ag-grid-react/headers/custom-header-group.js +0 -58
@@ -1,135 +1,176 @@
1
- import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { Cross as L, CalendarMonth as Q } from "impact-nova-icons";
4
- import { isValid as C, parse as S } from "date-fns";
5
- import { cn as U, padValidDateString as W, maskDate as X } from "../../../lib/utils.js";
6
- import { Input as Z } from "../input/input.js";
7
- import { Popover as _, PopoverAnchor as F, PopoverContent as v } from "../../feedback/popover/popover.js";
8
- import { Calendar as tt } from "../../data-display/calendar/calendar.js";
9
- import { Tooltip as I, TooltipTrigger as N, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
10
- import { useImpactNovaI18n as et } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { coerceSingleMonthApply as nt, coerceSingleMonth as ot } from "./calendar-selection-adapters.js";
12
- import { buildDateBoundsMatcher as rt } from "../../../lib/date-bounds-matcher.js";
13
- const l = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, at = r.forwardRef(
1
+ import { jsxs as k, jsx as s } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { Cross as _, CalendarMonth as ee } from "impact-nova-icons";
4
+ import { cn as te } from "../../../lib/utils.js";
5
+ import { usePickerDismissActionsRef as ne, usePickerFooterDismissNudge as re, isDateInputInvalid as oe, compareMonthSelection as se, resolveDateInputOnBlur as ie, maskDateInput as ae, parseDateInput as ce, resolveDateInputOnEnter as le } from "./date-input-behavior.js";
6
+ import { Input as pe } from "../input/input.js";
7
+ import { Popover as fe, PopoverAnchor as de, PopoverContent as me } from "../../feedback/popover/popover.js";
8
+ import { Calendar as ue } from "../../data-display/calendar/calendar.js";
9
+ import { Tooltip as E, TooltipTrigger as b, TooltipContent as V } from "../../feedback/tooltip/tooltip.js";
10
+ import { useImpactNovaI18n as he } from "../../../i18n/use-impact-nova-i18n.js";
11
+ import { coerceSingleMonthApply as ye, coerceSingleMonth as Me } from "./calendar-selection-adapters.js";
12
+ import { buildDateBoundsMatcher as ge } from "../../../lib/date-bounds-matcher.js";
13
+ const u = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, De = o.forwardRef(
14
14
  ({
15
- value: t,
16
- onChange: s,
17
- placeholder: A,
18
- minDate: T,
19
- maxDate: b,
20
- startMonth: R,
21
- endMonth: j,
22
- showFooter: p = !0,
23
- disabled: y,
24
- className: B,
25
- ...O
26
- }, Y) => {
27
- const { t: d } = et(), z = A ?? d("datePicker.selectMonth"), P = r.useRef(null);
28
- r.useImperativeHandle(Y, () => P.current);
29
- const [a, h] = r.useState(!1), [k, i] = r.useState(t), [m, c] = r.useState(t ? l(t) : ""), [E, g] = r.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
30
- r.useEffect(() => {
31
- a || (c(t ? l(t) : ""), i(t));
32
- }, [a, t]), r.useEffect(() => {
33
- a && (i(t), g(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), c(t ? l(t) : ""));
34
- }, [a, t]);
35
- const $ = (e) => {
36
- const n = ot(e);
37
- i(n), n && c(l(n)), p || (s?.(n), h(!1));
38
- }, H = (e) => {
39
- const n = nt(e, k);
40
- s?.(n), h(!1);
41
- }, q = () => {
42
- i(t), c(t ? l(t) : ""), h(!1);
43
- }, x = () => {
44
- i(void 0), c(""), s?.(void 0), p || h(!1);
45
- }, G = (e) => {
46
- const n = e.target.value, f = X(n, "MM/yyyy", m);
47
- if (c(f), f === "") {
48
- i(void 0), p || s?.(void 0);
15
+ value: e,
16
+ onChange: p,
17
+ placeholder: w,
18
+ minDate: v,
19
+ maxDate: B,
20
+ startMonth: O,
21
+ endMonth: Y,
22
+ showFooter: i = !0,
23
+ disabled: f,
24
+ className: j,
25
+ ...K
26
+ }, z) => {
27
+ const { t: d } = he(), F = w ?? d("datePicker.selectMonth"), P = o.useRef(null), S = o.useRef(null);
28
+ o.useImperativeHandle(z, () => P.current);
29
+ const [r, c] = o.useState(!1), R = ne(), { footerFlashKey: H, footerFlashTarget: $, popoverHandlers: L } = re(i, r, R, S), [h, a] = o.useState(e), [m, l] = o.useState(e ? u(e) : ""), [q, I] = o.useState(e ? new Date(e.year, e.month) : /* @__PURE__ */ new Date());
30
+ o.useEffect(() => {
31
+ r || (l(e ? u(e) : ""), a(e));
32
+ }, [r, e]), o.useEffect(() => {
33
+ r && (a(e), I(e ? new Date(e.year, e.month) : /* @__PURE__ */ new Date()), l(e ? u(e) : ""));
34
+ }, [r, e]);
35
+ const G = (t) => {
36
+ const n = Me(t);
37
+ a(n), n && l(u(n)), i || (p?.(n), c(!1));
38
+ }, x = (t) => {
39
+ const n = ye(t, h);
40
+ p?.(n), c(!1);
41
+ }, C = () => {
42
+ a(e), l(e ? u(e) : ""), c(!1);
43
+ }, A = () => {
44
+ a(void 0), l(""), p?.(void 0), i || c(!1);
45
+ }, y = "MM/yyyy", M = e ? u(e) : "", g = o.useRef(!1), J = (t) => {
46
+ const n = ae(t.target.value, y, m);
47
+ if (l(n), n === "") {
48
+ a(void 0), i || p?.(void 0);
49
49
  return;
50
50
  }
51
- const M = S(f, "MM/yyyy", /* @__PURE__ */ new Date());
52
- if (C(M) && f.length === 7) {
53
- const w = { month: M.getMonth(), year: M.getFullYear() };
54
- i(w), g(M), p || s?.(w);
51
+ const { parsed: D, isValid: Z } = ce(n, y);
52
+ if (Z && D) {
53
+ const T = { month: D.getMonth(), year: D.getFullYear() };
54
+ a(T), I(D), i || p?.(T);
55
55
  }
56
- }, J = () => {
57
- if (a) return;
58
- const e = W(m, "MM/yyyy"), n = S(e, "MM/yyyy", /* @__PURE__ */ new Date());
59
- if (!C(n) || e.length !== 7)
60
- c(t ? l(t) : ""), i(t);
61
- else if (c(e), !p) {
62
- const f = { month: n.getMonth(), year: n.getFullYear() };
63
- s?.(f);
56
+ }, Q = () => {
57
+ if (r) return;
58
+ const t = ie(m, y, M);
59
+ if (t.resetToCommitted) {
60
+ l(M), a(e);
61
+ return;
62
+ }
63
+ if (t.parsed) {
64
+ const n = { month: t.parsed.getMonth(), year: t.parsed.getFullYear() };
65
+ l(t.display), a(n), i || p?.(n);
66
+ return;
67
+ }
68
+ l(M), a(e);
69
+ }, U = () => {
70
+ if (r && i) {
71
+ x();
72
+ return;
64
73
  }
65
- }, D = (t ? l(t) : "") !== m, K = m.length === 7 && !C(S(m, "MM/yyyy", /* @__PURE__ */ new Date()));
66
- return /* @__PURE__ */ u(_, { open: y ? !1 : a, onOpenChange: (e) => {
67
- y || h(e);
74
+ const t = le(m, y);
75
+ if (t.parsed) {
76
+ const n = {
77
+ month: t.parsed.getMonth(),
78
+ year: t.parsed.getFullYear()
79
+ };
80
+ i && (p?.(n), c(!1));
81
+ return;
82
+ }
83
+ r || (g.current = !0, c(!0));
84
+ }, N = M !== m, W = oe(m, y), X = o.useCallback(() => h && (!e || se(h, e) !== 0) ? "apply" : "cancel", [h, e]);
85
+ return o.useLayoutEffect(() => {
86
+ R.current = {
87
+ onDismiss: C,
88
+ resolveFlash: X
89
+ };
90
+ }), /* @__PURE__ */ k(fe, { open: f ? !1 : r, onOpenChange: (t) => {
91
+ f || !t && i || c(t);
68
92
  }, children: [
69
- /* @__PURE__ */ o(F, { asChild: !0, children: /* @__PURE__ */ o("div", { "data-component": "month-picker", "data-state": a ? "open" : "closed", "data-pending": D || void 0, children: /* @__PURE__ */ o(
70
- Z,
93
+ /* @__PURE__ */ s(de, { asChild: !0, children: /* @__PURE__ */ s(
94
+ "div",
71
95
  {
72
- ref: P,
73
- value: m,
74
- onChange: G,
75
- onBlur: J,
76
- onClick: () => !y && h(!0),
77
- placeholder: a ? d("datePicker.monthYearFormat") : z,
78
- disabled: y,
79
- "data-form-control": "input",
80
- className: U(
81
- "cursor-pointer",
82
- K ? "text-destructive" : D ? "text-content-placeholder" : "",
83
- B
84
- ),
85
- suffix: /* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: [
86
- t && !y && /* @__PURE__ */ u(I, { children: [
87
- /* @__PURE__ */ o(N, { asChild: !0, children: /* @__PURE__ */ o(
88
- "button",
89
- {
90
- type: "button",
91
- tabIndex: 0,
92
- "aria-label": d("calendar.clear"),
93
- onClick: (e) => {
94
- e.stopPropagation(), x();
95
- },
96
- className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
97
- children: /* @__PURE__ */ o(L, { className: "size-3 hover:text-content" })
98
- }
99
- ) }),
100
- /* @__PURE__ */ o(V, { variant: "tertiary", side: "top", children: d("calendar.clear") })
101
- ] }),
102
- /* @__PURE__ */ u(I, { children: [
103
- /* @__PURE__ */ o(N, { asChild: !0, children: /* @__PURE__ */ o(Q, { className: "h-4 w-4 text-secondary-foreground" }) }),
104
- /* @__PURE__ */ o(V, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
105
- ] })
106
- ] }),
107
- ...O
96
+ ref: S,
97
+ "data-component": "month-picker",
98
+ "data-state": r ? "open" : "closed",
99
+ "data-pending": N || void 0,
100
+ children: /* @__PURE__ */ s(
101
+ pe,
102
+ {
103
+ ref: P,
104
+ value: m,
105
+ onChange: J,
106
+ onBlur: Q,
107
+ onClick: () => !f && c(!0),
108
+ onKeyDown: (t) => {
109
+ t.key === "Enter" && !f && (t.preventDefault(), U()), t.key === "ArrowDown" && !r && !f && (t.preventDefault(), g.current = !0, c(!0)), t.key === "Escape" && r && (t.preventDefault(), C());
110
+ },
111
+ placeholder: r ? d("datePicker.monthYearFormat") : F,
112
+ disabled: f,
113
+ "data-form-control": "input",
114
+ className: te(
115
+ "cursor-pointer",
116
+ W ? "text-destructive" : N ? "text-content-placeholder" : "",
117
+ j
118
+ ),
119
+ suffix: /* @__PURE__ */ k("div", { className: "flex items-center gap-1", children: [
120
+ e && !f && /* @__PURE__ */ k(E, { children: [
121
+ /* @__PURE__ */ s(b, { asChild: !0, children: /* @__PURE__ */ s(
122
+ "button",
123
+ {
124
+ type: "button",
125
+ tabIndex: 0,
126
+ "aria-label": d("calendar.clear"),
127
+ onClick: (t) => {
128
+ t.stopPropagation(), A();
129
+ },
130
+ className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
131
+ children: /* @__PURE__ */ s(_, { className: "size-3 hover:text-content" })
132
+ }
133
+ ) }),
134
+ /* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("calendar.clear") })
135
+ ] }),
136
+ /* @__PURE__ */ k(E, { children: [
137
+ /* @__PURE__ */ s(b, { asChild: !0, children: /* @__PURE__ */ s(ee, { className: "h-4 w-4 text-secondary-foreground" }) }),
138
+ /* @__PURE__ */ s(V, { variant: "tertiary", side: "top", children: d("datePicker.selectMonth") })
139
+ ] })
140
+ ] }),
141
+ ...K
142
+ }
143
+ )
108
144
  }
109
- ) }) }),
110
- /* @__PURE__ */ o(
111
- v,
145
+ ) }),
146
+ /* @__PURE__ */ s(
147
+ me,
112
148
  {
113
149
  className: "w-auto p-0",
114
150
  align: "start",
115
151
  "aria-label": d("datePicker.selectMonth"),
116
- onOpenAutoFocus: (e) => e.preventDefault(),
117
- children: /* @__PURE__ */ o(
118
- tt,
152
+ onOpenAutoFocus: (t) => {
153
+ g.current || t.preventDefault(), g.current = !1;
154
+ },
155
+ ...L,
156
+ children: /* @__PURE__ */ s(
157
+ ue,
119
158
  {
120
159
  pickerType: "month",
121
160
  monthMode: "single",
122
- selectedMonths: k,
123
- onMonthSelect: $,
124
- month: E,
125
- onMonthChange: g,
126
- disabled: rt(T, b),
127
- startMonth: R,
128
- endMonth: j,
129
- showFooter: p,
130
- onApply: H,
131
- onCancel: q,
132
- onClear: x
161
+ selectedMonths: h,
162
+ footerFlashKey: H,
163
+ footerFlashTarget: $,
164
+ onMonthSelect: G,
165
+ month: q,
166
+ onMonthChange: I,
167
+ disabled: ge(v, B),
168
+ startMonth: O,
169
+ endMonth: Y,
170
+ showFooter: i,
171
+ onApply: x,
172
+ onCancel: C,
173
+ onClear: A
133
174
  }
134
175
  )
135
176
  }
@@ -137,7 +178,7 @@ const l = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, at =
137
178
  ] });
138
179
  }
139
180
  );
140
- at.displayName = "MonthPicker";
181
+ De.displayName = "MonthPicker";
141
182
  export {
142
- at as MonthPicker
183
+ De as MonthPicker
143
184
  };