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,29 +1,29 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
3
  import * as o from "@radix-ui/react-dialog";
4
- import { cva as N } from "class-variance-authority";
4
+ import { cva as v } from "class-variance-authority";
5
5
  import { ChevronDown as S, ChevronUp as w, X as C } from "lucide-react";
6
6
  import { cn as r } from "../../lib/utils.js";
7
- import { Tooltip as g, TooltipTrigger as x, TooltipContent as y } from "./tooltip.js";
7
+ import { Tooltip as g, TooltipTrigger as x, TooltipContent as b } from "./tooltip.js";
8
8
  import { useImpactNovaI18n as T } from "../../i18n/ImpactNovaI18nContext.js";
9
- const b = n.createContext({
9
+ const y = n.createContext({
10
10
  isExpanded: !1,
11
11
  expandable: !1,
12
12
  side: "right"
13
- }), U = o.Root, X = o.Trigger, D = o.Close, E = o.Portal, v = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
13
+ }), X = o.Root, q = o.Trigger, k = o.Close, E = o.Portal, N = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
14
14
  o.Overlay,
15
15
  {
16
16
  className: r(
17
- "fixed inset-0 z-50 bg-scrim data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
17
+ "fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
18
18
  t
19
19
  ),
20
20
  ...a,
21
21
  ref: s
22
22
  }
23
23
  ));
24
- v.displayName = o.Overlay.displayName;
25
- const R = N(
26
- "fixed z-50 gap-4 bg-canvas p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
24
+ N.displayName = o.Overlay.displayName;
25
+ const R = v(
26
+ "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
27
27
  {
28
28
  variants: {
29
29
  side: {
@@ -37,100 +37,71 @@ const R = N(
37
37
  side: "right"
38
38
  }
39
39
  }
40
- ), k = n.forwardRef(
41
- ({
42
- side: t = "right",
43
- className: a,
44
- children: s,
45
- expandable: c = !1,
46
- defaultExpanded: d = !1,
47
- ...f
48
- }, u) => {
49
- const [h, m] = n.useState(d), p = n.useCallback(() => {
50
- m((i) => !i);
51
- }, []);
52
- return /* @__PURE__ */ e(
53
- b.Provider,
40
+ ), D = n.forwardRef(({ side: t = "right", className: a, children: s, expandable: d = !1, defaultExpanded: l = !1, ...f }, u) => {
41
+ const [h, c] = n.useState(l), m = n.useCallback(() => {
42
+ c((p) => !p);
43
+ }, []);
44
+ return /* @__PURE__ */ e(y.Provider, { value: { isExpanded: h, onExpandToggle: m, expandable: d, side: t || void 0 }, children: /* @__PURE__ */ i(E, { children: [
45
+ /* @__PURE__ */ e(N, {}),
46
+ /* @__PURE__ */ e(
47
+ o.Content,
54
48
  {
55
- value: {
56
- isExpanded: h,
57
- onExpandToggle: p,
58
- expandable: c,
59
- side: t || void 0
60
- },
61
- children: /* @__PURE__ */ l(E, { children: [
62
- /* @__PURE__ */ e(v, {}),
63
- /* @__PURE__ */ e(
64
- o.Content,
65
- {
66
- ref: u,
67
- "data-component": "sheet-content",
68
- onOpenAutoFocus: (i) => i.preventDefault(),
69
- className: r(
70
- R({ side: t }),
71
- "flex flex-col p-0 transition-all duration-300",
72
- t === "bottom" && (h ? "h-[96vh]" : "h-[40vh]"),
73
- a
74
- ),
75
- ...f,
76
- children: s
77
- }
78
- )
79
- ] })
49
+ ref: u,
50
+ "data-component": "sheet-content",
51
+ className: r(
52
+ R({ side: t }),
53
+ "flex flex-col p-0 transition-all duration-300",
54
+ t === "bottom" && (h ? "h-[96vh]" : "h-[40vh]"),
55
+ a
56
+ ),
57
+ ...f,
58
+ children: s
80
59
  }
81
- );
82
- }
83
- );
84
- k.displayName = o.Content.displayName;
60
+ )
61
+ ] }) });
62
+ });
63
+ D.displayName = o.Content.displayName;
85
64
  const L = ({
86
65
  className: t,
87
66
  children: a,
88
67
  ...s
89
68
  }) => {
90
- const { t: c } = T(), { isExpanded: d, onExpandToggle: f, expandable: u, side: h } = n.useContext(b), m = c("aria.close"), p = c("nestedList.expand"), i = c("nestedList.collapse");
91
- return /* @__PURE__ */ l(
69
+ const { t: d } = T(), { isExpanded: l, onExpandToggle: f, expandable: u, side: h } = n.useContext(y), c = d("aria.close"), m = d("nestedList.expand"), p = d("nestedList.collapse");
70
+ return /* @__PURE__ */ i(
92
71
  "div",
93
72
  {
94
73
  className: r(
95
- "flex px-4 py-4 shrink-0 items-center justify-between bg-canvas-tint border-b",
74
+ "flex px-4 py-4 shrink-0 items-center justify-between bg-light-blue border-b",
96
75
  h === "bottom" && "rounded-t-lg",
97
76
  t
98
77
  ),
99
78
  ...s,
100
79
  children: [
101
80
  /* @__PURE__ */ e("div", { className: "flex flex-col space-y-1 text-center sm:text-left", children: a }),
102
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
103
- u && /* @__PURE__ */ l(g, { children: [
104
- /* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ l(
81
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
82
+ u && /* @__PURE__ */ i(g, { children: [
83
+ /* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ i(
105
84
  "button",
106
85
  {
107
86
  type: "button",
108
87
  "data-component": "sheet-expand-toggle",
109
88
  onClick: f,
110
- className: "rounded-sm opacity-70 ring-offset-canvas transition-opacity hover:opacity-100 focus:outline-none",
111
- "aria-label": d ? i : p,
89
+ className: "rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none",
90
+ "aria-label": l ? p : m,
112
91
  children: [
113
- d ? /* @__PURE__ */ e(S, { className: "h-4 w-4" }) : /* @__PURE__ */ e(w, { className: "h-4 w-4" }),
114
- /* @__PURE__ */ e("span", { className: "sr-only", children: d ? i : p })
92
+ l ? /* @__PURE__ */ e(S, { className: "h-4 w-4" }) : /* @__PURE__ */ e(w, { className: "h-4 w-4" }),
93
+ /* @__PURE__ */ e("span", { className: "sr-only", children: l ? p : m })
115
94
  ]
116
95
  }
117
96
  ) }),
118
- /* @__PURE__ */ e(y, { variant: "tertiary", side: "top", children: d ? i : p })
97
+ /* @__PURE__ */ e(b, { variant: "tertiary", side: "top", children: l ? p : m })
119
98
  ] }),
120
- /* @__PURE__ */ l(g, { children: [
121
- /* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ l(
122
- D,
123
- {
124
- "data-component": "sheet-close",
125
- className: "rounded-sm opacity-70 ring-offset-canvas transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 disabled:pointer-events-none",
126
- "aria-label": m,
127
- children: [
128
- /* @__PURE__ */ e(C, { className: "h-4 w-4" }),
129
- /* @__PURE__ */ e("span", { className: "sr-only", children: m })
130
- ]
131
- }
132
- ) }),
133
- /* @__PURE__ */ e(y, { variant: "tertiary", side: "top", children: m })
99
+ /* @__PURE__ */ i(g, { children: [
100
+ /* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ i(k, { "data-component": "sheet-close", className: "rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", "aria-label": c, children: [
101
+ /* @__PURE__ */ e(C, { className: "h-4 w-4" }),
102
+ /* @__PURE__ */ e("span", { className: "sr-only", children: c })
103
+ ] }) }),
104
+ /* @__PURE__ */ e(b, { variant: "tertiary", side: "top", children: c })
134
105
  ] })
135
106
  ] })
136
107
  ]
@@ -141,24 +112,30 @@ L.displayName = "SheetHeader";
141
112
  const j = ({
142
113
  className: t,
143
114
  ...a
144
- }) => /* @__PURE__ */ e("div", { className: r("flex-1 overflow-y-auto p-4", t), ...a });
115
+ }) => /* @__PURE__ */ e(
116
+ "div",
117
+ {
118
+ className: r("flex-1 overflow-y-auto p-4", t),
119
+ ...a
120
+ }
121
+ );
145
122
  j.displayName = "SheetBody";
146
- const O = ({
123
+ const P = ({
147
124
  className: t,
148
125
  ...a
149
126
  }) => /* @__PURE__ */ e(
150
127
  "div",
151
128
  {
152
129
  className: r(
153
- "mt-auto flex px-4 py-3 shrink-0 items-center justify-end gap-2 border-t bg-canvas",
130
+ "mt-auto flex px-4 py-3 shrink-0 items-center justify-end gap-2 border-t bg-background",
154
131
  t
155
132
  ),
156
133
  ...a,
157
134
  children: a.children
158
135
  }
159
136
  );
160
- O.displayName = "SheetFooter";
161
- const P = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
137
+ P.displayName = "SheetFooter";
138
+ const I = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
162
139
  o.Title,
163
140
  {
164
141
  ref: s,
@@ -167,26 +144,26 @@ const P = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
167
144
  ...a
168
145
  }
169
146
  ));
170
- P.displayName = o.Title.displayName;
171
- const F = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
147
+ I.displayName = o.Title.displayName;
148
+ const O = n.forwardRef(({ className: t, ...a }, s) => /* @__PURE__ */ e(
172
149
  o.Description,
173
150
  {
174
151
  ref: s,
175
- className: r("text-sm text-content-muted", t),
152
+ className: r("text-sm text-muted-foreground", t),
176
153
  ...a
177
154
  }
178
155
  ));
179
- F.displayName = o.Description.displayName;
156
+ O.displayName = o.Description.displayName;
180
157
  export {
181
- U as Sheet,
158
+ X as Sheet,
182
159
  j as SheetBody,
183
- D as SheetClose,
184
- k as SheetContent,
185
- F as SheetDescription,
186
- O as SheetFooter,
160
+ k as SheetClose,
161
+ D as SheetContent,
162
+ O as SheetDescription,
163
+ P as SheetFooter,
187
164
  L as SheetHeader,
188
- v as SheetOverlay,
165
+ N as SheetOverlay,
189
166
  E as SheetPortal,
190
- P as SheetTitle,
191
- X as SheetTrigger
167
+ I as SheetTitle,
168
+ q as SheetTrigger
192
169
  };
@@ -33,17 +33,13 @@ interface StatisticsCardRootProps<T = StatisticsCardItem> extends React.HTMLAttr
33
33
  }
34
34
  declare const StatisticsCardRoot: React.ForwardRefExoticComponent<StatisticsCardRootProps<StatisticsCardItem> & React.RefAttributes<HTMLDivElement>>;
35
35
  declare const StatisticsCardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
36
- interface StatisticsCardTitleProps extends React.HTMLAttributes<HTMLDivElement> {
37
- }
38
- declare const StatisticsCardTitle: React.ForwardRefExoticComponent<StatisticsCardTitleProps & React.RefAttributes<HTMLDivElement>>;
36
+ declare const StatisticsCardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
39
37
  interface StatisticsCardTitleIconProps extends React.HTMLAttributes<HTMLDivElement> {
40
38
  icon: React.ReactNode;
41
39
  className?: string;
42
40
  }
43
41
  declare const StatisticsCardTitleIcon: React.ForwardRefExoticComponent<StatisticsCardTitleIconProps & React.RefAttributes<HTMLDivElement>>;
44
- interface StatisticsCardTitleTextProps extends React.HTMLAttributes<HTMLSpanElement> {
45
- }
46
- declare const StatisticsCardTitleText: React.ForwardRefExoticComponent<StatisticsCardTitleTextProps & React.RefAttributes<HTMLSpanElement>>;
42
+ declare const StatisticsCardTitleText: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
47
43
  interface StatisticsCardTitleTooltipProps extends React.HTMLAttributes<HTMLDivElement> {
48
44
  content: string;
49
45
  icon?: React.ReactNode;
@@ -73,9 +69,7 @@ interface StatisticsCardLegendItemProps extends React.HTMLAttributes<HTMLDivElem
73
69
  item?: StatisticsCardItem;
74
70
  }
75
71
  declare const StatisticsCardLegendItem: React.ForwardRefExoticComponent<StatisticsCardLegendItemProps & React.RefAttributes<HTMLDivElement>>;
76
- interface StatisticsCardSummaryProps extends React.HTMLAttributes<HTMLDivElement> {
77
- }
78
- declare const StatisticsCardSummary: React.ForwardRefExoticComponent<StatisticsCardSummaryProps & React.RefAttributes<HTMLDivElement>>;
72
+ declare const StatisticsCardSummary: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
79
73
  interface StatisticsCardSummaryItemProps extends React.HTMLAttributes<HTMLDivElement> {
80
74
  label: string;
81
75
  count: number | string | React.ReactNode;
@@ -83,4 +77,4 @@ interface StatisticsCardSummaryItemProps extends React.HTMLAttributes<HTMLDivEle
83
77
  }
84
78
  declare const StatisticsCardSummaryItem: React.ForwardRefExoticComponent<StatisticsCardSummaryItemProps & React.RefAttributes<HTMLDivElement>>;
85
79
  export { StatisticsCardRoot, StatisticsCardHeader, StatisticsCardTitle, StatisticsCardTitleIcon, StatisticsCardTitleText, StatisticsCardTitleTooltip, StatisticsCardChart, StatisticsCardLegend, StatisticsCardLegendItem, StatisticsCardSummary, StatisticsCardSummaryItem, };
86
- export type { StatisticsCardRootProps, StatisticsCardTitleProps, StatisticsCardTitleIconProps, StatisticsCardTitleTextProps, StatisticsCardTitleTooltipProps, StatisticsCardChartProps, StatisticsCardLegendItemProps, StatisticsCardSummaryProps, StatisticsCardSummaryItemProps };
80
+ export type { StatisticsCardRootProps, StatisticsCardTitleIconProps, StatisticsCardTitleTooltipProps, StatisticsCardChartProps, StatisticsCardLegendItemProps, StatisticsCardSummaryItemProps };
@@ -83,6 +83,7 @@ export declare const useStatisticsChartPlotOptions: (items: StatisticsCardItem[]
83
83
  enabled: boolean;
84
84
  };
85
85
  showInLegend: boolean;
86
+ allowPointSelect: boolean;
86
87
  states: {
87
88
  hover: {
88
89
  enabled: boolean;
@@ -134,6 +135,7 @@ export declare const useStatisticsChartOptions: (items: StatisticsCardItem[], on
134
135
  enabled: boolean;
135
136
  };
136
137
  showInLegend: boolean;
138
+ allowPointSelect: boolean;
137
139
  states: {
138
140
  hover: {
139
141
  enabled: boolean;
@@ -1,17 +1,17 @@
1
1
  import * as a from "react";
2
2
  const f = (e) => {
3
- const s = a.useMemo(
4
- () => e.reduce((o, n) => o + n.value, 0),
3
+ const o = a.useMemo(
4
+ () => e.reduce((s, n) => s + n.value, 0),
5
5
  [e]
6
6
  ), t = a.useMemo(
7
- () => e.reduce((o, n) => o + (n.checked ? n.value : 0), 0),
7
+ () => e.reduce((s, n) => s + (n.checked ? n.value : 0), 0),
8
8
  [e]
9
- ), r = e.some((o) => o.checked);
10
- return { total: s, checkedTotal: t, hasChecked: r };
11
- }, p = (e, s = 0.4) => {
12
- const t = e.replace("#", ""), r = parseInt(t.substring(0, 2), 16), o = parseInt(t.substring(2, 4), 16), n = parseInt(t.substring(4, 6), 16);
13
- return `rgba(${r}, ${o}, ${n}, ${s})`;
14
- }, x = (e, s) => a.useMemo(
9
+ ), r = e.some((s) => s.checked);
10
+ return { total: o, checkedTotal: t, hasChecked: r };
11
+ }, p = (e, o = 0.4) => {
12
+ const t = e.replace("#", ""), r = parseInt(t.substring(0, 2), 16), s = parseInt(t.substring(2, 4), 16), n = parseInt(t.substring(4, 6), 16);
13
+ return `rgba(${r}, ${s}, ${n}, ${o})`;
14
+ }, x = (e, o) => a.useMemo(
15
15
  () => [
16
16
  {
17
17
  type: "pie",
@@ -20,14 +20,14 @@ const f = (e) => {
20
20
  data: e.map((t) => ({
21
21
  name: t.label,
22
22
  y: t.value,
23
- color: s ? t.checked ? t.borderColor : p(t.borderColor, 0.4) : t.borderColor
23
+ color: o ? t.checked ? t.borderColor : p(t.borderColor, 0.4) : t.borderColor
24
24
  }))
25
25
  }
26
26
  ],
27
- [e, s]
28
- ), y = (e, s, t, r) => a.useMemo(
29
- () => e ?? String(s ? t : r),
30
- [e, s, t, r]
27
+ [e, o]
28
+ ), y = (e, o, t, r) => a.useMemo(
29
+ () => e ?? String(o ? t : r),
30
+ [e, o, t, r]
31
31
  ), b = () => a.useMemo(
32
32
  () => ({
33
33
  enabled: !0,
@@ -51,16 +51,18 @@ const f = (e) => {
51
51
  }
52
52
  }),
53
53
  []
54
- ), h = (e, s, t) => {
55
- const r = t?.borderWidth ?? 2, o = t?.borderColor ?? "#F8F9FB", n = t?.borderRadius ?? 4, i = t?.enableHover ?? !0, l = t?.enableClick ?? !0;
54
+ ), h = (e, o, t) => {
55
+ const r = t?.borderWidth ?? 2, s = t?.borderColor ?? "#F8F9FB", n = t?.borderRadius ?? 4, i = t?.enableHover ?? !0, l = t?.enableClick ?? !0;
56
56
  return a.useMemo(
57
57
  () => ({
58
58
  pie: {
59
59
  borderWidth: r,
60
- borderColor: o,
60
+ borderColor: s,
61
61
  borderRadius: n,
62
62
  dataLabels: { enabled: !1 },
63
63
  showInLegend: !1,
64
+ allowPointSelect: !1,
65
+ // Disable pull-out effect on click
64
66
  states: { hover: { enabled: i, brightness: 0.05 } },
65
67
  // Handle slice click to toggle corresponding legend item
66
68
  point: {
@@ -68,16 +70,16 @@ const f = (e) => {
68
70
  click: function() {
69
71
  if (!l) return;
70
72
  const u = this.name, c = e.findIndex((d) => d.label === u);
71
- c !== -1 && s && s(c, !e[c].checked);
73
+ c !== -1 && o && o(c, !e[c].checked);
72
74
  }
73
75
  }
74
76
  }
75
77
  }
76
78
  }),
77
- [e, s, r, o, n, i, l]
79
+ [e, o, r, s, n, i, l]
78
80
  );
79
- }, g = (e, s, t) => {
80
- const r = b(), o = h(e, s, t);
81
+ }, S = (e, o, t) => {
82
+ const r = b(), s = h(e, o, t);
81
83
  return a.useMemo(
82
84
  () => ({
83
85
  chart: {
@@ -85,15 +87,15 @@ const f = (e) => {
85
87
  spacing: [0, 0, 0, 0]
86
88
  },
87
89
  tooltip: r,
88
- plotOptions: o
90
+ plotOptions: s
89
91
  }),
90
- [r, o]
92
+ [r, s]
91
93
  );
92
94
  };
93
95
  export {
94
96
  f as useStatisticsChartData,
95
97
  y as useStatisticsChartLabel,
96
- g as useStatisticsChartOptions,
98
+ S as useStatisticsChartOptions,
97
99
  h as useStatisticsChartPlotOptions,
98
100
  x as useStatisticsChartSeries,
99
101
  b as useStatisticsChartTooltip