impact-nova 1.6.2 → 1.6.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 (26) hide show
  1. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +7 -7
  2. package/dist/components/ui/accordion.d.ts +0 -1
  3. package/dist/components/ui/accordion.js +22 -25
  4. package/dist/components/ui/ag-grid-react/index.js +38 -35
  5. package/dist/components/ui/ag-grid-react/process-backend-columndefs.js +10 -10
  6. package/dist/components/ui/ag-grid-react/value-formatters.js +18 -18
  7. package/dist/components/ui/calendar.js +255 -247
  8. package/dist/components/ui/chart/chart.js +103 -94
  9. package/dist/components/ui/data-table/data-table.d.ts +0 -4
  10. package/dist/components/ui/data-table/data-table.js +94 -60
  11. package/dist/components/ui/date-picker/date-picker.js +90 -81
  12. package/dist/components/ui/date-picker/date-range-picker.js +144 -130
  13. package/dist/components/ui/date-picker/week-range-picker.js +157 -143
  14. package/dist/components/ui/filter-strip/filter-summary.js +161 -234
  15. package/dist/components/ui/filter-strip/filter-tag-list.js +97 -124
  16. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +29 -29
  17. package/dist/components/ui/select/select.js +536 -508
  18. package/dist/components/ui/sheet.js +71 -94
  19. package/dist/components/ui/statistics-card.d.ts +4 -10
  20. package/dist/components/ui/statistics-card.hooks.d.ts +2 -0
  21. package/dist/components/ui/statistics-card.hooks.js +26 -24
  22. package/dist/components/ui/statistics-card.js +103 -102
  23. package/dist/components/ui/types/chart.types.d.ts +1 -0
  24. package/dist/components/ui/types/statistics-card.types.d.ts +1 -1
  25. package/dist/impact-nova.css +1 -1
  26. package/package.json +1 -1
@@ -1,173 +1,146 @@
1
- import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
- import * as k from "react";
3
- import T from "../horizontal-scroller/horizontal-scroller.js";
4
- import { TagGroup as z } from "../tag-group.js";
5
- import { Tag as y } from "../tag.js";
6
- import { Tooltip as x, TooltipTrigger as f, TooltipContent as g } from "../tooltip.js";
7
- import { Popover as j, PopoverTrigger as O, PopoverContent as I } from "../popover.js";
8
- import { Button as P } from "../button.js";
9
- import { X as V } from "lucide-react";
10
- import { cn as i } from "../../../lib/utils.js";
11
- const C = i(
12
- "h-auto min-h-0 border-0 shadow-none",
13
- "inline-flex items-center justify-start gap-2.5 rounded-lg bg-brand-subtle px-2 py-1.5",
14
- "text-xs font-medium capitalize leading-4 font-['Manrope']",
15
- "[&_[data-component=tag-remove]]:ml-0"
16
- ), A = i(
17
- C,
18
- "text-content",
19
- "hover:bg-canvas-muted"
20
- ), N = i(
21
- C,
22
- "text-brand",
23
- "hover:bg-brand-tint-hover"
24
- ), F = ({
25
- remainingValues: n,
26
- viewAllTrigger: l = "expand",
27
- onViewAll: d,
28
- onItemRemove: m,
29
- isRemovable: w
1
+ import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
+ import * as N from "react";
3
+ import C from "../horizontal-scroller/horizontal-scroller.js";
4
+ import { TagGroup as k } from "../tag-group.js";
5
+ import { Tag as w } from "../tag.js";
6
+ import { Tooltip as u, TooltipTrigger as v, TooltipContent as f } from "../tooltip.js";
7
+ import { Popover as S, PopoverTrigger as T, PopoverContent as z } from "../popover.js";
8
+ import { Button as $ } from "../button.js";
9
+ import { X as I } from "lucide-react";
10
+ const j = ({
11
+ remainingValues: l,
12
+ viewAllTrigger: s = "expand",
13
+ onViewAll: i,
14
+ onItemRemove: d,
15
+ isRemovable: g
30
16
  }) => {
31
- const [e, p] = k.useState(!1), s = e ? n : n.slice(0, 3), h = n.length > 3, o = () => {
32
- l === "custom" ? d?.() : p(!0);
17
+ const [e, m] = N.useState(!1), c = e ? l : l.slice(0, 3), p = l.length > 3, t = () => {
18
+ s === "custom" ? i?.() : m(!0);
33
19
  };
34
- return /* @__PURE__ */ t(
35
- I,
20
+ return /* @__PURE__ */ r(
21
+ z,
36
22
  {
37
- className: "w-[200px] p-0 rounded-[8px] bg-canvas-elevated shadow-elevation-floating border-none",
23
+ className: "w-[200px] p-0 rounded-[8px] bg-white shadow-[0_0_4px_0_rgba(0,0,0,0.12)] border-none",
38
24
  align: "start",
39
25
  sideOffset: 8,
40
- children: /* @__PURE__ */ r("div", { className: "flex flex-col py-2 px-[6px]", children: [
41
- /* @__PURE__ */ t(
42
- "div",
43
- {
44
- className: `flex flex-col gap-1 mb-2 ${e ? "max-h-[200px] overflow-y-auto" : ""}`,
45
- children: s.map((a, v) => /* @__PURE__ */ r(
46
- "div",
47
- {
48
- className: "flex items-center justify-between text-[14px] font-medium leading-[20px] text-content px-3 py-2 overflow-hidden hover:bg-canvas-muted rounded group shrink-0",
49
- children: [
50
- /* @__PURE__ */ r(x, { children: [
51
- /* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t("span", { className: "truncate", children: String(a) }) }),
52
- /* @__PURE__ */ t(g, { variant: "tertiary", side: "right", children: String(a) })
53
- ] }),
54
- w && /* @__PURE__ */ t(
55
- "button",
56
- {
57
- onClick: (u) => {
58
- u.stopPropagation(), m(a);
59
- },
60
- className: "ml-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-content-icon hover:bg-muted/60 hover:text-content-secondary opacity-0 group-hover:opacity-100 transition-opacity",
61
- children: /* @__PURE__ */ t(V, { size: 12 })
62
- }
63
- )
64
- ]
26
+ children: /* @__PURE__ */ o("div", { className: "flex flex-col py-2 px-[6px]", children: [
27
+ /* @__PURE__ */ r("div", { className: `flex flex-col gap-1 mb-2 ${e ? "max-h-[200px] overflow-y-auto" : ""}`, children: c.map((n, h) => /* @__PURE__ */ o("div", { className: "flex items-center justify-between text-[14px] font-medium leading-[20px] text-[#1f2b4d] px-3 py-2 overflow-hidden hover:bg-slate-50 rounded group shrink-0", children: [
28
+ /* @__PURE__ */ o(u, { children: [
29
+ /* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ r("span", { className: "truncate", children: String(n) }) }),
30
+ /* @__PURE__ */ r(f, { variant: "tertiary", side: "right", children: String(n) })
31
+ ] }),
32
+ g && /* @__PURE__ */ r(
33
+ "button",
34
+ {
35
+ onClick: (x) => {
36
+ x.stopPropagation(), d(n);
65
37
  },
66
- v
67
- ))
68
- }
69
- ),
70
- !e && h && /* @__PURE__ */ r("div", { className: "flex flex-col gap-2", children: [
71
- /* @__PURE__ */ t("div", { className: "h-[1px] bg-stroke-hairline w-full" }),
72
- /* @__PURE__ */ t(
73
- P,
38
+ "aria-label": `Remove ${String(n)}`,
39
+ className: "ml-2 flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-gray-400 hover:bg-black/5 hover:text-gray-600 opacity-0 group-hover:opacity-100 focus:opacity-100 transition-opacity",
40
+ children: /* @__PURE__ */ r(I, { size: 12 })
41
+ }
42
+ )
43
+ ] }, h)) }),
44
+ !e && p && /* @__PURE__ */ o("div", { className: "flex flex-col gap-2", children: [
45
+ /* @__PURE__ */ r("div", { className: "h-[1px] bg-[#e6e8f0] w-full" }),
46
+ /* @__PURE__ */ r(
47
+ $,
74
48
  {
75
49
  variant: "secondary",
50
+ size: "sm",
76
51
  className: "w-full justify-center",
77
- onClick: o,
78
- children: l === "custom" ? "View all" : `View all (${n.length})`
52
+ onClick: t,
53
+ children: s === "custom" ? "View all" : `View all (${l.length})`
79
54
  }
80
55
  )
81
56
  ] })
82
57
  ] })
83
58
  }
84
59
  );
85
- }, X = ({
86
- filters: n,
87
- onFilterRemove: l,
88
- onOverflowClick: d,
89
- onViewAll: m
90
- }) => /* @__PURE__ */ t("div", { className: "flex flex-1 items-center min-w-0", children: /* @__PURE__ */ t(
91
- T,
60
+ }, M = ({
61
+ filters: l,
62
+ onFilterRemove: s,
63
+ onOverflowClick: i,
64
+ onViewAll: d
65
+ }) => /* @__PURE__ */ r("div", { className: "flex flex-1 items-center min-w-0", children: /* @__PURE__ */ r(
66
+ C,
92
67
  {
93
- items: n,
94
- renderItem: (e, p) => {
95
- const s = Array.isArray(e.value) ? e.value : [e.value], h = s.slice(0, 2), o = s.slice(2), a = !!e.overflow, v = e.overflow?.label ? e.overflow.label : e.overflow?.count ? `+${e.overflow.count}` : null, u = o.length > 0, S = a || u, b = `+${o.length}`;
96
- return /* @__PURE__ */ r("div", { className: "flex items-center px-1", children: [
97
- p > 0 && /* @__PURE__ */ t("div", { className: "mx-3 h-4 w-[1px] bg-stroke-hairline shrink-0" }),
98
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
99
- /* @__PURE__ */ r("span", { className: "text-xs font-medium leading-[21px] text-content-tertiary whitespace-nowrap", children: [
68
+ items: l,
69
+ renderItem: (e, m) => {
70
+ const c = Array.isArray(e.value) ? e.value : [e.value], p = c.slice(0, 2), t = c.slice(2), n = !!e.overflow, h = e.overflow?.label ? e.overflow.label : e.overflow?.count ? `+${e.overflow.count}` : null, x = t.length > 0, y = n || x, b = `+${t.length}`;
71
+ return /* @__PURE__ */ o("div", { className: "flex items-center px-1", children: [
72
+ m > 0 && /* @__PURE__ */ r("div", { className: "mx-3 h-4 w-[1px] bg-[#e6e8f0] shrink-0" }),
73
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
74
+ /* @__PURE__ */ o("span", { className: "text-xs font-medium leading-[21px] text-[#60697d] whitespace-nowrap", children: [
100
75
  e.label,
101
- e.required && /* @__PURE__ */ t("span", { className: "text-validation ml-0.5", children: "*" })
76
+ e.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
102
77
  ] }),
103
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
104
- /* @__PURE__ */ t(
105
- z,
78
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
79
+ /* @__PURE__ */ r(
80
+ k,
106
81
  {
107
- spacing: "none",
108
- className: "gap-2.5",
109
- tags: h.map((c) => ({
110
- label: String(c),
82
+ spacing: "sm",
83
+ tags: p.map((a) => ({
84
+ label: String(a),
111
85
  variant: "secondary",
112
- size: "sm",
86
+ size: "md",
113
87
  shape: "rounded",
114
88
  removable: e.removable,
115
- onRemove: () => l(e.id, c),
116
- className: A
89
+ onRemove: () => s(e.id, a)
117
90
  }))
118
91
  }
119
92
  ),
120
- S && (a ? (
93
+ y && (n ? (
121
94
  // Server-side overflow: Simple tag, no popover
122
- /* @__PURE__ */ r(x, { children: [
123
- /* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t(
124
- y,
95
+ /* @__PURE__ */ o(u, { children: [
96
+ /* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ r(
97
+ w,
125
98
  {
126
99
  variant: "secondary",
127
- size: "sm",
100
+ size: "md",
128
101
  shape: "rounded",
129
- className: i(
130
- N,
131
- "cursor-pointer whitespace-nowrap"
132
- ),
133
- onClick: () => d?.(e.id),
134
- children: v || b
102
+ className: "whitespace-nowrap bg-[#eceefd] text-[#4259ee] hover:bg-[#dce1fc] border-0 h-6 px-2 text-xs font-medium font-['Manrope'] cursor-pointer",
103
+ onClick: () => i?.(e.id),
104
+ tabIndex: 0,
105
+ role: "button",
106
+ "aria-label": `${e.overflow?.count || t.length} more filters for ${e.label}`,
107
+ onKeyDown: (a) => {
108
+ (a.key === "Enter" || a.key === " ") && (a.preventDefault(), i?.(e.id));
109
+ },
110
+ children: h || b
135
111
  }
136
112
  ) }),
137
- /* @__PURE__ */ r(g, { variant: "tertiary", side: "top", children: [
138
- e.overflow?.count || o.length,
113
+ /* @__PURE__ */ o(f, { variant: "tertiary", side: "top", children: [
114
+ e.overflow?.count || t.length,
139
115
  " more filters"
140
116
  ] })
141
117
  ] })
142
118
  ) : (
143
119
  // Client-side overflow: Popover
144
- /* @__PURE__ */ r(j, { children: [
145
- /* @__PURE__ */ r(x, { children: [
146
- /* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t(O, { asChild: !0, children: /* @__PURE__ */ t(
147
- y,
120
+ /* @__PURE__ */ o(S, { children: [
121
+ /* @__PURE__ */ o(u, { children: [
122
+ /* @__PURE__ */ r(v, { asChild: !0, children: /* @__PURE__ */ r(T, { asChild: !0, children: /* @__PURE__ */ r(
123
+ w,
148
124
  {
149
125
  variant: "secondary",
150
- size: "sm",
126
+ size: "md",
151
127
  shape: "rounded",
152
- className: i(
153
- N,
154
- "cursor-pointer whitespace-nowrap"
155
- ),
128
+ className: "whitespace-nowrap bg-[#eceefd] text-[#4259ee] hover:bg-[#dce1fc] border-0 h-6 px-2 text-xs font-medium font-['Manrope'] cursor-pointer",
156
129
  children: b
157
130
  }
158
131
  ) }) }),
159
- /* @__PURE__ */ r(g, { variant: "tertiary", side: "top", children: [
160
- o.length,
132
+ /* @__PURE__ */ o(f, { variant: "tertiary", side: "top", children: [
133
+ t.length,
161
134
  " more filters"
162
135
  ] })
163
136
  ] }),
164
- /* @__PURE__ */ t(
165
- F,
137
+ /* @__PURE__ */ r(
138
+ j,
166
139
  {
167
- remainingValues: o,
140
+ remainingValues: t,
168
141
  viewAllTrigger: e.viewAllTrigger,
169
- onViewAll: m,
170
- onItemRemove: (c) => l(e.id, c),
142
+ onViewAll: d,
143
+ onItemRemove: (a) => s(e.id, a),
171
144
  isRemovable: e.removable
172
145
  }
173
146
  )
@@ -182,5 +155,5 @@ const C = i(
182
155
  }
183
156
  ) });
184
157
  export {
185
- X as FilterTagList
158
+ M as FilterTagList
186
159
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as i, jsx as t, Fragment as O } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as t, Fragment as O } from "react/jsx-runtime";
2
2
  import * as a from "react";
3
3
  import { ChevronRight as T } from "lucide-react";
4
4
  import { useVirtualizer as $ } from "@tanstack/react-virtual";
@@ -10,10 +10,10 @@ const F = a.forwardRef(
10
10
  className: N,
11
11
  items: u,
12
12
  renderItem: R,
13
- scrollStep: v = 200,
13
+ scrollStep: g = 200,
14
14
  hideScrollbar: p = !0,
15
15
  controlsPosition: s = "right",
16
- renderPrevious: g,
16
+ renderPrevious: v,
17
17
  renderNext: b,
18
18
  maxWidth: L = "100%",
19
19
  estimateSize: m = 200,
@@ -22,41 +22,41 @@ const F = a.forwardRef(
22
22
  }, B) => {
23
23
  const { t: x } = D(), l = a.useRef(null), [n, E] = a.useState(!1), [o, H] = a.useState(!1);
24
24
  a.useImperativeHandle(B, () => l.current);
25
- const c = $({
25
+ const i = $({
26
26
  count: u.length,
27
27
  getScrollElement: () => l.current,
28
28
  estimateSize: typeof m == "function" ? m : () => m,
29
29
  horizontal: !0,
30
30
  overscan: k
31
- }), V = c.getTotalSize(), f = a.useCallback(() => {
31
+ }), V = i.getTotalSize(), d = a.useCallback(() => {
32
32
  const e = l.current;
33
33
  e && (E(e.scrollLeft > 0), H(Math.ceil(e.scrollLeft + e.clientWidth) < e.scrollWidth));
34
34
  }, []);
35
35
  a.useEffect(() => {
36
36
  const e = l.current;
37
37
  if (!e) return;
38
- f();
39
- const r = () => f();
38
+ d();
39
+ const r = () => d();
40
40
  e.addEventListener("scroll", r);
41
- const d = new ResizeObserver(() => {
42
- f();
41
+ const f = new ResizeObserver(() => {
42
+ d();
43
43
  });
44
- return d.observe(e), () => {
45
- e.removeEventListener("scroll", r), d.disconnect();
44
+ return f.observe(e), () => {
45
+ e.removeEventListener("scroll", r), f.disconnect();
46
46
  };
47
- }, [f, u, V]);
47
+ }, [d, u, V]);
48
48
  const z = () => {
49
- l.current?.scrollBy({ left: -v, behavior: "smooth" });
49
+ l.current?.scrollBy({ left: -g, behavior: "smooth" });
50
50
  }, y = () => {
51
- l.current?.scrollBy({ left: v, behavior: "smooth" });
51
+ l.current?.scrollBy({ left: g, behavior: "smooth" });
52
52
  }, w = ({
53
53
  direction: e,
54
54
  onClick: r,
55
- disabled: d
55
+ disabled: f
56
56
  }) => {
57
- if (d) return null;
57
+ if (f) return null;
58
58
  const S = x(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
59
- return /* @__PURE__ */ i(
59
+ return /* @__PURE__ */ c(
60
60
  A,
61
61
  {
62
62
  variant: "ghost",
@@ -65,7 +65,7 @@ const F = a.forwardRef(
65
65
  "h-8 w-8 rounded-md bg-canvas-muted text-content-tertiary hover:bg-brand-tint hover:text-brand"
66
66
  ),
67
67
  onClick: r,
68
- disabled: d,
68
+ disabled: f,
69
69
  "aria-label": S,
70
70
  "data-component": e === "left" ? "horizontal-scroller-prev" : "horizontal-scroller-next",
71
71
  children: [
@@ -80,7 +80,7 @@ const F = a.forwardRef(
80
80
  }
81
81
  );
82
82
  }, W = () => {
83
- const e = g ? g({ onClick: z, disabled: !n }) : /* @__PURE__ */ t(
83
+ const e = v ? v({ onClick: z, disabled: !n }) : /* @__PURE__ */ t(
84
84
  w,
85
85
  {
86
86
  direction: "left",
@@ -95,22 +95,22 @@ const F = a.forwardRef(
95
95
  disabled: !o
96
96
  }
97
97
  );
98
- return s === "split" ? /* @__PURE__ */ i(O, { children: [
98
+ return s === "split" ? /* @__PURE__ */ c(O, { children: [
99
99
  /* @__PURE__ */ t("div", { className: "absolute left-0 top-1/2 z-20 -translate-y-1/2", children: e }),
100
100
  /* @__PURE__ */ t("div", { className: "absolute right-0 top-1/2 z-20 -translate-y-1/2", children: r })
101
- ] }) : s === "left" ? /* @__PURE__ */ i("div", { className: "absolute left-0 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", children: [
101
+ ] }) : s === "left" ? /* @__PURE__ */ c("div", { className: "absolute left-0 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", children: [
102
102
  e,
103
103
  r
104
- ] }) : /* @__PURE__ */ i("div", { className: "absolute right-0 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", children: [
104
+ ] }) : /* @__PURE__ */ c("div", { className: "absolute right-0 top-1/2 z-20 flex -translate-y-1/2 items-center gap-1", children: [
105
105
  e,
106
106
  r
107
107
  ] });
108
108
  }, j = () => s === "left" ? n && o ? "pl-20" : n || o ? "pl-12" : "" : s === "split" && n ? "pl-12" : "", I = () => s === "right" ? n && o ? "pr-20" : n || o ? "pr-12" : "" : s === "split" && o ? "pr-12" : "";
109
- return /* @__PURE__ */ i(
109
+ return /* @__PURE__ */ c(
110
110
  "div",
111
111
  {
112
112
  className: h(
113
- "relative group min-w-0 w-full overflow-hidden bg-transparent",
113
+ "relative group min-w-0 w-full bg-transparent",
114
114
  j(),
115
115
  I(),
116
116
  N
@@ -134,20 +134,20 @@ const F = a.forwardRef(
134
134
  msOverflowStyle: p ? "none" : "auto"
135
135
  },
136
136
  "data-component": "horizontal-scroller-viewport",
137
- children: /* @__PURE__ */ i(
137
+ children: /* @__PURE__ */ c(
138
138
  "div",
139
139
  {
140
140
  style: {
141
- width: `${c.getTotalSize()}px`,
141
+ width: `${i.getTotalSize()}px`,
142
142
  display: "flex",
143
143
  position: "relative"
144
144
  },
145
145
  children: [
146
- /* @__PURE__ */ t("div", { style: { width: `${c.getVirtualItems()[0]?.start ?? 0}px`, flexShrink: 0 } }),
147
- c.getVirtualItems().map((e) => /* @__PURE__ */ t(
146
+ /* @__PURE__ */ t("div", { style: { width: `${i.getVirtualItems()[0]?.start ?? 0}px`, flexShrink: 0 } }),
147
+ i.getVirtualItems().map((e) => /* @__PURE__ */ t(
148
148
  "div",
149
149
  {
150
- ref: c.measureElement,
150
+ ref: i.measureElement,
151
151
  "data-index": e.index,
152
152
  className: "flex-shrink-0",
153
153
  children: R(u[e.index], e.index)