impact-nova 1.6.3 → 1.6.5

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.
@@ -1,65 +1,65 @@
1
- import { jsx as e, jsxs as r } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
- import * as o from "@radix-ui/react-accordion";
3
+ import * as a from "@radix-ui/react-accordion";
4
4
  import { ChevronRight as f } from "lucide-react";
5
5
  import { cn as n } from "../../lib/utils.js";
6
6
  import { Tooltip as p, TooltipTrigger as g, TooltipContent as h } from "./tooltip.js";
7
- import { useImpactNovaI18n as v } from "../../i18n/ImpactNovaI18nContext.js";
8
- const C = o.Root, u = c.forwardRef(({ className: i, ...t }, a) => /* @__PURE__ */ e(
9
- o.Item,
7
+ import { useImpactNovaI18n as x } from "../../i18n/ImpactNovaI18nContext.js";
8
+ const C = a.Root, v = c.forwardRef(({ className: o, ...t }, r) => /* @__PURE__ */ e(
9
+ a.Item,
10
10
  {
11
- ref: a,
11
+ ref: r,
12
12
  "data-item": t.value,
13
13
  "data-disabled": t.disabled ? "" : void 0,
14
14
  className: n(
15
15
  "ia-accordion-item border-b rounded-lg bg-white border-b-[#D9DDE7]",
16
- i
16
+ o
17
17
  ),
18
18
  ...t
19
19
  }
20
20
  ));
21
- u.displayName = "AccordionItem";
22
- const x = c.forwardRef(({ className: i, children: t, badge: a, rightActions: s, ...d }, l) => {
23
- const { t: m } = v();
24
- return /* @__PURE__ */ e(o.Header, { className: "flex", children: /* @__PURE__ */ r(
25
- o.Trigger,
21
+ v.displayName = "AccordionItem";
22
+ const N = c.forwardRef(({ className: o, children: t, badge: r, rightActions: d, ...s }, l) => {
23
+ const { t: m } = x();
24
+ return /* @__PURE__ */ e(a.Header, { className: "flex", children: /* @__PURE__ */ i(
25
+ a.Trigger,
26
26
  {
27
27
  ref: l,
28
28
  className: n(
29
- "flex flex-1 items-center gap-3 px-4 py-2 text-sm font-semibold transition-all text-left [&[data-state=open]>div>svg]:-rotate-90 outline-none focus-visible:outline-none focus-visible:shadow-none",
30
- i
29
+ "flex flex-1 items-center gap-3 px-4 py-2 text-sm font-semibold transition-all text-left [&[data-state=open]>div>svg]:-rotate-90",
30
+ o
31
31
  ),
32
- ...d,
32
+ ...s,
33
33
  children: [
34
- /* @__PURE__ */ r(p, { children: [
34
+ /* @__PURE__ */ i(p, { children: [
35
35
  /* @__PURE__ */ e(g, { asChild: !0, children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-8 w-8 shrink-0 rounded-lg bg-secondary text-secondary-foreground transition-transform duration-200", children: /* @__PURE__ */ e(f, { className: "h-4 w-4 transition-transform duration-200" }) }) }),
36
36
  /* @__PURE__ */ e(h, { side: "top", variant: "tertiary", children: m("aria.toggle") })
37
37
  ] }),
38
- /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-between", children: [
39
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
38
+ /* @__PURE__ */ i("div", { className: "flex flex-1 items-center justify-between", children: [
39
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
40
40
  t,
41
- a
41
+ r
42
42
  ] }),
43
- s
43
+ d
44
44
  ] })
45
45
  ]
46
46
  }
47
47
  ) });
48
48
  });
49
- x.displayName = o.Trigger.displayName;
50
- const N = c.forwardRef(({ className: i, children: t, surfaceClassName: a, ...s }, d) => /* @__PURE__ */ e(
51
- o.Content,
49
+ N.displayName = a.Trigger.displayName;
50
+ const b = c.forwardRef(({ className: o, children: t, surfaceClassName: r, ...d }, s) => /* @__PURE__ */ e(
51
+ a.Content,
52
52
  {
53
- ref: d,
54
- className: n("overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down data-[state=open]:overflow-visible", a),
55
- ...s,
56
- children: /* @__PURE__ */ e("div", { className: n("px-4 pb-4 pt-2", i), children: t })
53
+ ref: s,
54
+ className: n("overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down data-[state=open]:overflow-visible", r),
55
+ ...d,
56
+ children: /* @__PURE__ */ e("div", { className: n("px-4 pb-4 pt-2", o), children: t })
57
57
  }
58
58
  ));
59
- N.displayName = o.Content.displayName;
59
+ b.displayName = a.Content.displayName;
60
60
  export {
61
61
  C as Accordion,
62
- N as AccordionContent,
63
- u as AccordionItem,
64
- x as AccordionTrigger
62
+ b as AccordionContent,
63
+ v as AccordionItem,
64
+ N as AccordionTrigger
65
65
  };
@@ -1,9 +1,9 @@
1
- import { jsx as s, jsxs as F } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as b } from "react/jsx-runtime";
2
2
  import * as n from "react";
3
- import * as l from "highcharts";
4
- import H from "highcharts-react-official";
5
- import { cn as g } from "../../../lib/utils.js";
6
- import { Skeleton as L } from "../skeleton.js";
3
+ import * as i from "highcharts";
4
+ import F from "highcharts-react-official";
5
+ import { cn as p } from "../../../lib/utils.js";
6
+ import { Skeleton as k } from "../skeleton.js";
7
7
  import { Minimize2 as A, Maximize2 as j } from "lucide-react";
8
8
  import { Button as I } from "../button.js";
9
9
  import B from "highcharts/highcharts-more";
@@ -13,41 +13,41 @@ import P from "highcharts/modules/treemap";
13
13
  import D from "highcharts/modules/venn";
14
14
  import V from "highcharts/modules/stock";
15
15
  import O from "highcharts/modules/accessibility";
16
- import G from "highcharts/modules/exporting";
17
- import J from "highcharts/modules/dumbbell";
18
- import K from "highcharts/modules/lollipop";
19
- import Q from "highcharts-border-radius";
20
- import { getBaseChartOptions as U } from "./chart.utils.js";
21
- import { useImpactNovaI18n as W } from "../../../i18n/ImpactNovaI18nContext.js";
16
+ import W from "highcharts/modules/exporting";
17
+ import G from "highcharts/modules/dumbbell";
18
+ import J from "highcharts/modules/lollipop";
19
+ import K from "highcharts-border-radius";
20
+ import { getBaseChartOptions as Q } from "./chart.utils.js";
21
+ import { useImpactNovaI18n as U } from "../../../i18n/ImpactNovaI18nContext.js";
22
22
  const c = (e, r) => {
23
23
  typeof e == "function" ? e(r) : typeof e == "object" && e.default && typeof e.default == "function" && e.default(r);
24
24
  };
25
- typeof l == "object" && (c(B, l), c(M, l), c(T, l), c(P, l), c(D, l), c(O, l), c(G, l), c(J, l), c(K, l), c(V, l), c(Q, l));
26
- const b = n.createContext(null), k = () => {
27
- const e = n.useContext(b);
25
+ typeof i == "object" && (c(B, i), c(M, i), c(T, i), c(P, i), c(D, i), c(O, i), c(W, i), c(G, i), c(J, i), c(V, i), c(K, i));
26
+ const E = n.createContext(null), z = () => {
27
+ const e = n.useContext(E);
28
28
  if (!e)
29
29
  throw new Error("Chart components must be used within a ChartContainer");
30
30
  return e;
31
- }, z = n.forwardRef(
32
- ({ className: e, children: r, isLoading: i = !1, ...o }, f) => {
33
- const a = n.useRef(null), m = n.useRef(null), [u, h] = n.useState(!1), [x, p] = n.useState(!1);
34
- n.useImperativeHandle(f, () => a.current);
35
- const w = () => {
36
- const t = a.current;
37
- t && (p(!0), t.classList.add("fullscreen-animating"), setTimeout(() => {
38
- t.requestFullscreen ? t.requestFullscreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : t.msRequestFullscreen && t.msRequestFullscreen(), h(!0), t.classList.remove("fullscreen-animating");
31
+ }, S = n.forwardRef(
32
+ ({ className: e, children: r, isLoading: a = !1, ...o }, h) => {
33
+ const l = n.useRef(null), u = n.useRef(null), [m, f] = n.useState(!1), [R, w] = n.useState(!1);
34
+ n.useImperativeHandle(h, () => l.current);
35
+ const x = () => {
36
+ const t = l.current;
37
+ t && (w(!0), t.classList.add("fullscreen-animating"), setTimeout(() => {
38
+ t.requestFullscreen ? t.requestFullscreen() : t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : t.msRequestFullscreen && t.msRequestFullscreen(), f(!0), t.classList.remove("fullscreen-animating");
39
39
  }, 200));
40
- }, C = () => {
41
- const t = a.current;
42
- t && (p(!0), t.classList.add("fullscreen-animating-out"), setTimeout(() => {
43
- document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), h(!1), t.classList.remove("fullscreen-animating-out");
40
+ }, g = () => {
41
+ const t = l.current;
42
+ t && (w(!0), t.classList.add("fullscreen-animating-out"), setTimeout(() => {
43
+ document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), f(!1), t.classList.remove("fullscreen-animating-out");
44
44
  }, 200));
45
- }, q = () => {
46
- u ? C() : w();
45
+ }, C = () => {
46
+ m ? g() : x();
47
47
  };
48
48
  return n.useEffect(() => {
49
49
  const t = () => {
50
- document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || h(!1);
50
+ document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || f(!1);
51
51
  };
52
52
  return document.addEventListener("fullscreenchange", t), document.addEventListener("webkitfullscreenchange", t), () => {
53
53
  document.removeEventListener("fullscreenchange", t), document.removeEventListener(
@@ -56,44 +56,44 @@ const b = n.createContext(null), k = () => {
56
56
  );
57
57
  };
58
58
  }, []), n.useEffect(() => {
59
- if (!m?.current?.chart) return;
60
- const t = m.current.chart;
59
+ if (!u?.current?.chart) return;
60
+ const t = u.current.chart;
61
61
  let d = null;
62
- const E = () => {
63
- u && a.current ? (d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
64
- const v = a.current;
62
+ const N = () => {
63
+ m && l.current ? (d && cancelAnimationFrame(d), d = requestAnimationFrame(() => {
64
+ const v = l.current;
65
65
  if (!v) return;
66
- const R = v.getBoundingClientRect(), N = v.querySelector('[class*="ChartContent"]');
67
- if (N) {
68
- const y = N.getBoundingClientRect();
69
- t.setSize(y.width, y.height, !1);
66
+ const y = v.getBoundingClientRect(), H = v.querySelector('[class*="ChartContent"]');
67
+ if (H) {
68
+ const L = H.getBoundingClientRect();
69
+ t.setSize(L.width, L.height, !1);
70
70
  } else
71
- t.setSize(R.width, R.height, !1);
71
+ t.setSize(y.width, y.height, !1);
72
72
  d = null;
73
73
  })) : (t.setSize(null, null, !1), t.reflow());
74
74
  };
75
- return window.addEventListener("resize", E), () => {
76
- d && cancelAnimationFrame(d), window.removeEventListener("resize", E);
75
+ return window.addEventListener("resize", N), () => {
76
+ d && cancelAnimationFrame(d), window.removeEventListener("resize", N);
77
77
  };
78
- }, [u]), /* @__PURE__ */ s(
79
- b.Provider,
78
+ }, [m]), /* @__PURE__ */ s(
79
+ E.Provider,
80
80
  {
81
81
  value: {
82
- isExpanded: u,
83
- toggleFullscreen: q,
84
- isLoading: i,
85
- containerRef: a,
86
- chartComponentRef: m
82
+ isExpanded: m,
83
+ toggleFullscreen: C,
84
+ isLoading: a,
85
+ containerRef: l,
86
+ chartComponentRef: u
87
87
  },
88
88
  children: /* @__PURE__ */ s(
89
89
  "div",
90
90
  {
91
- ref: a,
92
- className: g(
91
+ ref: l,
92
+ className: p(
93
93
  e,
94
94
  "w-full relative bg-canvas-elevated transition-all duration-200 ease-in-out",
95
- u && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
96
- x && "overflow-hidden"
95
+ m && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
96
+ R && "overflow-hidden"
97
97
  ),
98
98
  ...o,
99
99
  children: r
@@ -103,89 +103,98 @@ const b = n.createContext(null), k = () => {
103
103
  );
104
104
  }
105
105
  );
106
- z.displayName = "ChartContainer";
106
+ S.displayName = "ChartContainer";
107
107
  const X = n.forwardRef(
108
- ({ className: e, children: r, ...i }, o) => /* @__PURE__ */ s("div", { ref: o, className: g("flex items-center justify-between mb-4", e), ...i, children: r })
108
+ ({ className: e, children: r, ...a }, o) => /* @__PURE__ */ s("div", { ref: o, className: p("flex items-center justify-between mb-4", e), ...a, children: r })
109
109
  );
110
110
  X.displayName = "ChartHeader";
111
111
  const Y = n.forwardRef(
112
- ({ className: e, ...r }, i) => /* @__PURE__ */ s("h3", { ref: i, className: g("text-lg font-semibold leading-none tracking-tight", e), ...r })
112
+ ({ className: e, ...r }, a) => /* @__PURE__ */ s("h3", { ref: a, className: p("text-lg font-semibold leading-none tracking-tight", e), ...r })
113
113
  );
114
114
  Y.displayName = "ChartTitle";
115
115
  const Z = n.forwardRef(
116
- ({ className: e, ...r }, i) => /* @__PURE__ */ s("div", { ref: i, className: g("flex items-center gap-2", e), ...r })
116
+ ({ className: e, ...r }, a) => /* @__PURE__ */ s("div", { ref: a, className: p("flex items-center gap-2", e), ...r })
117
117
  );
118
118
  Z.displayName = "ChartActions";
119
119
  const _ = n.forwardRef(
120
- ({ className: e, ...r }, i) => {
121
- const { t: o } = W(), { toggleFullscreen: f, isExpanded: a } = k(), m = o("aria.toggleFullscreen");
122
- return /* @__PURE__ */ F(
120
+ ({ className: e, ...r }, a) => {
121
+ const { t: o } = U(), { toggleFullscreen: h, isExpanded: l } = z(), u = o("aria.toggleFullscreen");
122
+ return /* @__PURE__ */ b(
123
123
  I,
124
124
  {
125
125
  variant: "ghost",
126
126
  size: "icon",
127
- onClick: f,
128
- ref: i,
129
- className: g("h-8 w-8", e),
130
- "aria-label": m,
127
+ onClick: h,
128
+ ref: a,
129
+ className: p("h-8 w-8", e),
130
+ "aria-label": u,
131
131
  ...r,
132
132
  children: [
133
- a ? /* @__PURE__ */ s(A, { className: "h-4 w-4" }) : /* @__PURE__ */ s(j, { className: "h-4 w-4" }),
134
- /* @__PURE__ */ s("span", { className: "sr-only", children: m })
133
+ l ? /* @__PURE__ */ s(A, { className: "h-4 w-4" }) : /* @__PURE__ */ s(j, { className: "h-4 w-4" }),
134
+ /* @__PURE__ */ s("span", { className: "sr-only", children: u })
135
135
  ]
136
136
  }
137
137
  );
138
138
  }
139
139
  );
140
140
  _.displayName = "ChartFullScreen";
141
- const S = n.forwardRef(
142
- ({ className: e, children: r, loader: i, ...o }, f) => {
143
- const { isLoading: a, chartComponentRef: m, isExpanded: u } = k();
144
- return a && i ? /* @__PURE__ */ s("div", { ref: f, className: g(e, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", u && "min-h-0"), ...o, children: i }) : /* @__PURE__ */ F("div", { ref: f, className: g(e, "w-full relative flex-1 min-h-[300px]", u && "min-h-0"), ...o, children: [
145
- a && /* @__PURE__ */ F("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
146
- /* @__PURE__ */ s(L, { className: "h-8 w-1/3" }),
147
- /* @__PURE__ */ s(L, { className: "flex-1 w-full" })
141
+ const q = n.forwardRef(
142
+ ({ className: e, children: r, loader: a, ...o }, h) => {
143
+ const { isLoading: l, chartComponentRef: u, isExpanded: m } = z();
144
+ return l && a ? /* @__PURE__ */ s("div", { ref: h, className: p(e, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", m && "min-h-0"), ...o, children: a }) : /* @__PURE__ */ b("div", { ref: h, className: p(e, "w-full relative flex-1 min-h-[300px]", m && "min-h-0"), ...o, children: [
145
+ l && /* @__PURE__ */ b("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
146
+ /* @__PURE__ */ s(k, { className: "h-8 w-1/3" }),
147
+ /* @__PURE__ */ s(k, { className: "flex-1 w-full" })
148
148
  ] }),
149
- n.Children.map(r, (h) => n.isValidElement(h) ? n.cloneElement(h, { ref: m }) : h)
149
+ n.Children.map(r, (f) => n.isValidElement(f) ? n.cloneElement(f, { ref: u }) : f)
150
150
  ] });
151
151
  }
152
152
  );
153
- S.displayName = "ChartContent";
153
+ q.displayName = "ChartContent";
154
154
  const $ = n.forwardRef(
155
155
  (e, r) => {
156
156
  const {
157
- height: i,
157
+ height: a,
158
158
  width: o,
159
- className: f,
160
- isLoading: a,
161
- loader: m,
162
- title: u,
163
- children: h,
164
- ...x
165
- } = e, p = n.useContext(b), w = n.useMemo(() => {
166
- const C = U({ title: u, ...x });
159
+ className: h,
160
+ isLoading: l,
161
+ loader: u,
162
+ title: m,
163
+ noWrapper: f,
164
+ children: R,
165
+ ...w
166
+ } = e, x = n.useContext(E), g = n.useMemo(() => {
167
+ const C = Q({ title: m, ...w });
167
168
  return {
168
169
  ...C,
169
170
  chart: {
170
171
  ...C.chart,
171
- height: i ?? null,
172
+ height: a ?? null,
172
173
  width: o ?? null
173
174
  }
174
175
  };
175
176
  }, [e]);
176
- return p ? /* @__PURE__ */ s(
177
- H,
177
+ return f ? /* @__PURE__ */ s(
178
+ F,
179
+ {
180
+ highcharts: i,
181
+ options: g,
182
+ ref: r,
183
+ containerProps: { style: { height: "100%", width: "100%" } }
184
+ }
185
+ ) : x ? /* @__PURE__ */ s(
186
+ F,
178
187
  {
179
- highcharts: l,
180
- options: w,
188
+ highcharts: i,
189
+ options: g,
181
190
  ref: r,
182
191
  containerProps: { style: { height: "100%", width: "100%" } }
183
192
  }
184
- ) : /* @__PURE__ */ s(z, { className: f, isLoading: a, children: /* @__PURE__ */ s(S, { loader: m, children: /* @__PURE__ */ s(
185
- H,
193
+ ) : /* @__PURE__ */ s(S, { className: h, isLoading: l, children: /* @__PURE__ */ s(q, { loader: u, children: /* @__PURE__ */ s(
194
+ F,
186
195
  {
187
- highcharts: l,
188
- options: w,
196
+ highcharts: i,
197
+ options: g,
189
198
  ref: r,
190
199
  containerProps: { style: { height: "100%", width: "100%" } }
191
200
  }
@@ -196,8 +205,8 @@ $.displayName = "Chart";
196
205
  export {
197
206
  $ as Chart,
198
207
  Z as ChartActions,
199
- z as ChartContainer,
200
- S as ChartContent,
208
+ S as ChartContainer,
209
+ q as ChartContent,
201
210
  _ as ChartFullScreen,
202
211
  X as ChartHeader,
203
212
  Y as ChartTitle