impact-nova 3.0.0-alpha.20 → 3.0.0-alpha.22

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 (40) hide show
  1. package/dist/_virtual/index.js +4 -4
  2. package/dist/_virtual/index2.js +4 -4
  3. package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.js +32 -31
  4. package/dist/components/data-display/chart/chart-heatmap-layout.d.ts +31 -0
  5. package/dist/components/data-display/chart/chart-heatmap-layout.js +72 -0
  6. package/dist/components/data-display/chart/chart.category-cluster-heatmap.stories-data.d.ts +1 -1
  7. package/dist/components/data-display/chart/chart.js +165 -150
  8. package/dist/components/data-display/chart/chart.types.d.ts +17 -0
  9. package/dist/components/data-display/heatmap-grid/heatmap-grid-play.d.ts +9 -0
  10. package/dist/components/data-display/heatmap-grid/heatmap-grid.d.ts +32 -0
  11. package/dist/components/data-display/heatmap-grid/heatmap-grid.js +93 -0
  12. package/dist/components/data-display/heatmap-grid/heatmap-grid.layout.d.ts +46 -0
  13. package/dist/components/data-display/heatmap-grid/heatmap-grid.layout.js +80 -0
  14. package/dist/components/data-display/heatmap-grid/heatmap-grid.types.d.ts +54 -0
  15. package/dist/components/data-display/heatmap-grid/heatmap-grid.variants.d.ts +18 -0
  16. package/dist/components/data-display/heatmap-grid/heatmap-grid.variants.js +80 -0
  17. package/dist/components/data-display/heatmap-grid/index.d.ts +3 -0
  18. package/dist/components/data-display/heatmap-grid/index.js +14 -0
  19. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-cell.d.ts +14 -0
  20. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-cell.js +39 -0
  21. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-context.d.ts +29 -0
  22. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-context.js +33 -0
  23. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-tooltip.d.ts +4 -0
  24. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-tooltip.js +49 -0
  25. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-viewport.d.ts +3 -0
  26. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-viewport.js +173 -0
  27. package/dist/components/data-display/heatmap-grid/internals/use-heatmap-grid-viewport.d.ts +12 -0
  28. package/dist/components/data-display/heatmap-grid/internals/use-heatmap-grid-viewport.js +161 -0
  29. package/dist/i18n/defaultMessages.d.ts +6 -0
  30. package/dist/i18n/defaultMessages.js +16 -11
  31. package/dist/i18n/locales/de.js +5 -0
  32. package/dist/i18n/locales/es.js +5 -0
  33. package/dist/i18n/locales/hi.js +5 -0
  34. package/dist/i18n/locales/kn.js +5 -0
  35. package/dist/impact-nova.css +1 -1
  36. package/dist/llms/rules/installation.js +1 -1
  37. package/dist/llms/rules/requirements.js +1 -1
  38. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  39. package/dist/node_modules/unified/lib/index.js +1 -1
  40. package/package.json +5 -1
@@ -1,43 +1,44 @@
1
- import { jsx as s, jsxs as z } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as A } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import L from "highcharts-react-official";
4
- import { cn as h } from "../../../lib/utils.js";
5
- import { Skeleton as A } from "../skeleton/skeleton.js";
6
- import { Collapse as B, Expand as P } from "impact-nova-icons";
7
- import { Button as T } from "../../primitives/button/button.js";
8
- import { getInitializedHighcharts as O } from "./initializeHighcharts.js";
9
- import { getBaseChartOptions as D, applySeriesGradient as G } from "./chart.utils.js";
10
- import { resolveHighchartsOptions as M } from "./resolve-highcharts-options.js";
11
- import { chartUsesScatter3d as U } from "./chart-scatter3d.js";
12
- import { useImpactNovaI18n as V } from "../../../i18n/use-impact-nova-i18n.js";
3
+ import k from "highcharts-react-official";
4
+ import { cn as p } from "../../../lib/utils.js";
5
+ import { Skeleton as I } from "../skeleton/skeleton.js";
6
+ import { Collapse as U, Expand as V } from "impact-nova-icons";
7
+ import { Button as J } from "../../primitives/button/button.js";
8
+ import { getInitializedHighcharts as K } from "./initializeHighcharts.js";
9
+ import { readHeatmapChartBoxSizeFromProps as Q } from "./chart-heatmap-layout.js";
10
+ import { getBaseChartOptions as X, applySeriesGradient as Y } from "./chart.utils.js";
11
+ import { resolveHighchartsOptions as Z } from "./resolve-highcharts-options.js";
12
+ import { chartUsesScatter3d as _ } from "./chart-scatter3d.js";
13
+ import { useImpactNovaI18n as $ } from "../../../i18n/use-impact-nova-i18n.js";
13
14
  /* empty css */
14
- const k = O(), q = t.createContext(null), H = () => {
15
- const r = t.useContext(q);
16
- if (!r)
15
+ const z = K(), H = t.createContext(null), W = () => {
16
+ const n = t.useContext(H);
17
+ if (!n)
17
18
  throw new Error("Chart components must be used within a ChartContainer");
18
- return r;
19
- }, I = t.forwardRef(
20
- ({ className: r, children: l, isLoading: n = !1, ...a }, u) => {
21
- const c = t.useRef(null), i = t.useRef(null), [m, f] = t.useState(null), [d, E] = t.useState(!1), [w, p] = t.useState(!1), x = t.useCallback((e) => {
22
- c.current = e, f(e);
19
+ return n;
20
+ }, B = t.forwardRef(
21
+ ({ className: n, children: r, isLoading: i = !1, ...o }, m) => {
22
+ const a = t.useRef(null), c = t.useRef(null), [g, d] = t.useState(null), [f, C] = t.useState(!1), [R, y] = t.useState(!1), q = t.useCallback((e) => {
23
+ a.current = e, d(e);
23
24
  }, []);
24
- t.useImperativeHandle(u, () => c.current);
25
- const F = () => {
26
- const e = c.current;
27
- e && (p(!0), e.classList.add("fullscreen-animating"), setTimeout(() => {
28
- e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(), E(!0), e.classList.remove("fullscreen-animating");
25
+ t.useImperativeHandle(m, () => a.current);
26
+ const w = () => {
27
+ const e = a.current;
28
+ e && (y(!0), e.classList.add("fullscreen-animating"), setTimeout(() => {
29
+ e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(), C(!0), e.classList.remove("fullscreen-animating");
29
30
  }, 200));
30
- }, b = () => {
31
- const e = c.current;
32
- e && (p(!0), e.classList.add("fullscreen-animating-out"), setTimeout(() => {
33
- document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), E(!1), e.classList.remove("fullscreen-animating-out");
31
+ }, x = () => {
32
+ const e = a.current;
33
+ e && (y(!0), e.classList.add("fullscreen-animating-out"), setTimeout(() => {
34
+ document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), C(!1), e.classList.remove("fullscreen-animating-out");
34
35
  }, 200));
35
- }, S = () => {
36
- d ? b() : F();
36
+ }, v = () => {
37
+ f ? x() : w();
37
38
  };
38
39
  return t.useEffect(() => {
39
40
  const e = () => {
40
- document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || E(!1);
41
+ document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || C(!1);
41
42
  };
42
43
  return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), () => {
43
44
  document.removeEventListener("fullscreenchange", e), document.removeEventListener(
@@ -46,180 +47,194 @@ const k = O(), q = t.createContext(null), H = () => {
46
47
  );
47
48
  };
48
49
  }, []), t.useEffect(() => {
49
- if (!i?.current?.chart) return;
50
- const e = i.current.chart;
51
- let o = null;
52
- const N = () => {
53
- d && c.current ? (o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
54
- const v = c.current;
55
- if (!v) return;
56
- const R = v.getBoundingClientRect(), g = v.querySelector('[class*="ChartContent"]');
57
- if (g) {
58
- const C = g.getBoundingClientRect();
59
- e.setSize(C.width, C.height, !1);
50
+ if (!c?.current?.chart) return;
51
+ const e = c.current.chart;
52
+ let l = null;
53
+ const h = () => {
54
+ f && a.current ? (l && cancelAnimationFrame(l), l = requestAnimationFrame(() => {
55
+ const u = a.current;
56
+ if (!u) return;
57
+ const E = u.getBoundingClientRect(), F = u.querySelector('[class*="ChartContent"]');
58
+ if (F) {
59
+ const b = F.getBoundingClientRect();
60
+ e.setSize(b.width, b.height, !1);
60
61
  } else
61
- e.setSize(R.width, R.height, !1);
62
- o = null;
62
+ e.setSize(E.width, E.height, !1);
63
+ l = null;
63
64
  })) : (e.setSize(null, null, !1), e.reflow());
64
65
  };
65
- return window.addEventListener("resize", N), () => {
66
- o && cancelAnimationFrame(o), window.removeEventListener("resize", N);
66
+ return window.addEventListener("resize", h), () => {
67
+ l && cancelAnimationFrame(l), window.removeEventListener("resize", h);
67
68
  };
68
- }, [d]), /* @__PURE__ */ s(
69
- q.Provider,
69
+ }, [f]), /* @__PURE__ */ s(
70
+ H.Provider,
70
71
  {
71
72
  value: {
72
- isExpanded: d,
73
- toggleFullscreen: S,
74
- isLoading: n,
75
- containerRef: c,
76
- containerElement: m,
77
- chartComponentRef: i
73
+ isExpanded: f,
74
+ toggleFullscreen: v,
75
+ isLoading: i,
76
+ containerRef: a,
77
+ containerElement: g,
78
+ chartComponentRef: c
78
79
  },
79
80
  children: /* @__PURE__ */ s(
80
81
  "div",
81
82
  {
82
- ref: x,
83
+ ref: q,
83
84
  "data-component": "chart",
84
- className: h(
85
- r,
85
+ className: p(
86
+ n,
86
87
  "w-full relative bg-canvas-elevated transition-all duration-200 ease-in-out",
87
- d && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
88
- w && "overflow-hidden"
88
+ f && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
89
+ R && "overflow-hidden"
89
90
  ),
90
- ...a,
91
- children: l
91
+ ...o,
92
+ children: r
92
93
  }
93
94
  )
94
95
  }
95
96
  );
96
97
  }
97
98
  );
98
- I.displayName = "ChartContainer";
99
- const W = t.forwardRef(
100
- ({ className: r, children: l, ...n }, a) => /* @__PURE__ */ s("div", { ref: a, className: h("flex items-center justify-between mb-4", r), ...n, children: l })
99
+ B.displayName = "ChartContainer";
100
+ const ee = t.forwardRef(
101
+ ({ className: n, children: r, ...i }, o) => /* @__PURE__ */ s("div", { ref: o, className: p("flex items-center justify-between mb-4", n), ...i, children: r })
101
102
  );
102
- W.displayName = "ChartHeader";
103
- const J = t.forwardRef(
104
- ({ className: r, ...l }, n) => /* @__PURE__ */ s("h3", { ref: n, className: h("text-lg font-semibold leading-none tracking-tight", r), ...l })
103
+ ee.displayName = "ChartHeader";
104
+ const te = t.forwardRef(
105
+ ({ className: n, ...r }, i) => /* @__PURE__ */ s("h3", { ref: i, className: p("text-lg font-semibold leading-none tracking-tight", n), ...r })
105
106
  );
106
- J.displayName = "ChartTitle";
107
- const K = t.forwardRef(
108
- ({ className: r, ...l }, n) => /* @__PURE__ */ s("div", { ref: n, className: h("flex items-center gap-2", r), ...l })
107
+ te.displayName = "ChartTitle";
108
+ const ne = t.forwardRef(
109
+ ({ className: n, ...r }, i) => /* @__PURE__ */ s("div", { ref: i, className: p("flex items-center gap-2", n), ...r })
109
110
  );
110
- K.displayName = "ChartActions";
111
- const Q = t.forwardRef(
112
- ({ className: r, ...l }, n) => {
113
- const { t: a } = V(), { toggleFullscreen: u, isExpanded: c } = H(), i = a("aria.toggleFullscreen");
114
- return /* @__PURE__ */ z(
115
- T,
111
+ ne.displayName = "ChartActions";
112
+ const se = t.forwardRef(
113
+ ({ className: n, ...r }, i) => {
114
+ const { t: o } = $(), { toggleFullscreen: m, isExpanded: a } = W(), c = o("aria.toggleFullscreen");
115
+ return /* @__PURE__ */ A(
116
+ J,
116
117
  {
117
118
  variant: "ghost",
118
119
  size: "icon",
119
- onClick: u,
120
- ref: n,
121
- className: h("h-8 w-8", r),
122
- "aria-label": i,
123
- ...l,
120
+ onClick: m,
121
+ ref: i,
122
+ className: p("h-8 w-8", n),
123
+ "aria-label": c,
124
+ ...r,
124
125
  children: [
125
- c ? /* @__PURE__ */ s(B, { className: "h-4 w-4" }) : /* @__PURE__ */ s(P, { className: "h-4 w-4" }),
126
- /* @__PURE__ */ s("span", { className: "sr-only", children: i })
126
+ a ? /* @__PURE__ */ s(U, { className: "h-4 w-4" }) : /* @__PURE__ */ s(V, { className: "h-4 w-4" }),
127
+ /* @__PURE__ */ s("span", { className: "sr-only", children: c })
127
128
  ]
128
129
  }
129
130
  );
130
131
  }
131
132
  );
132
- Q.displayName = "ChartFullScreen";
133
- const j = t.forwardRef(
134
- ({ className: r, children: l, loader: n, ...a }, u) => {
135
- const { isLoading: c, chartComponentRef: i, isExpanded: m } = H();
136
- return c && n ? /* @__PURE__ */ s("div", { ref: u, className: h(r, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", m && "min-h-0"), ...a, children: n }) : /* @__PURE__ */ z("div", { ref: u, className: h(r, "w-full relative flex-1 min-h-[300px]", m && "min-h-0"), ...a, children: [
137
- c && /* @__PURE__ */ z("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
138
- /* @__PURE__ */ s(A, { className: "h-8 w-1/3" }),
139
- /* @__PURE__ */ s(A, { className: "flex-1 w-full" })
133
+ se.displayName = "ChartFullScreen";
134
+ const P = t.forwardRef(
135
+ ({ className: n, children: r, loader: i, ...o }, m) => {
136
+ const { isLoading: a, chartComponentRef: c, isExpanded: g } = W();
137
+ return a && i ? /* @__PURE__ */ s("div", { ref: m, className: p(n, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", g && "min-h-0"), ...o, children: i }) : /* @__PURE__ */ A("div", { ref: m, className: p(n, "w-full relative flex-1 min-h-[300px]", g && "min-h-0"), ...o, children: [
138
+ a && /* @__PURE__ */ A("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
139
+ /* @__PURE__ */ s(I, { className: "h-8 w-1/3" }),
140
+ /* @__PURE__ */ s(I, { className: "flex-1 w-full" })
140
141
  ] }),
141
- t.Children.map(l, (f) => t.isValidElement(f) ? t.cloneElement(f, { ref: i }) : f)
142
+ t.Children.map(r, (d) => t.isValidElement(d) ? t.cloneElement(d, { ref: c }) : d)
142
143
  ] });
143
144
  }
144
145
  );
145
- j.displayName = "ChartContent";
146
- const X = t.forwardRef(
147
- (r, l) => {
146
+ P.displayName = "ChartContent";
147
+ const re = t.forwardRef(
148
+ (n, r) => {
148
149
  const {
149
- height: n,
150
- width: a,
151
- className: u,
152
- isLoading: c,
153
- loader: i,
154
- title: m,
155
- noWrapper: f,
156
- gradient: d,
157
- children: E,
150
+ height: i,
151
+ width: o,
152
+ cellMinHeight: m,
153
+ cellMinWidth: a,
154
+ fillContainer: c,
155
+ className: g,
156
+ isLoading: d,
157
+ loader: f,
158
+ title: C,
159
+ noWrapper: R,
160
+ gradient: y,
161
+ children: q,
158
162
  is3D: w,
159
- type: p,
160
- series: x,
161
- ...F
162
- } = r, b = t.useContext(q), [S, e] = t.useState(null), o = t.useCallback((y) => {
163
- e(y);
164
- }, []), N = U({ is3D: w, type: p, series: x }), v = t.useMemo(() => {
165
- const y = D({ title: m, is3D: w, type: p, series: x, ...F });
163
+ type: x,
164
+ series: v,
165
+ ...e
166
+ } = n, l = Q({
167
+ type: x,
168
+ height: i,
169
+ width: o,
170
+ cellMinHeight: m,
171
+ cellMinWidth: a,
172
+ fillContainer: c,
173
+ xAxisCategories: e.xAxisCategories,
174
+ yAxisCategories: e.yAxisCategories,
175
+ options: e.options
176
+ }), h = l.height, u = l.width, E = typeof h == "number" ? h : null, F = typeof u == "number" ? u : null, b = t.useContext(H), [j, T] = t.useState(null), M = t.useCallback((N) => {
177
+ T(N);
178
+ }, []), O = _({ is3D: w, type: x, series: v }), D = t.useMemo(() => {
179
+ const N = X({ title: C, is3D: w, type: x, series: v, ...e });
166
180
  return {
167
- ...y,
181
+ ...N,
168
182
  chart: {
169
- ...y.chart,
170
- height: n ?? null,
171
- width: a ?? null
183
+ ...N.chart,
184
+ height: E,
185
+ width: F
172
186
  }
173
187
  };
174
- }, [m, n, a, w, p, x, F]), R = b?.containerElement ?? S ?? (typeof document > "u" ? null : document.documentElement), g = G(
175
- M(v, R),
176
- d
177
- ), C = {
178
- height: typeof n == "number" ? n : n ?? "100%",
179
- width: typeof a == "number" ? a : a ?? "100%"
188
+ }, [C, E, F, w, x, v, e]), G = b?.containerElement ?? j ?? (typeof document > "u" ? null : document.documentElement), S = Y(
189
+ Z(D, G),
190
+ y
191
+ ), L = {
192
+ height: typeof h == "number" ? h : h ?? "100%",
193
+ width: typeof u == "number" ? u : u ?? "100%",
194
+ ...l.minWidth !== void 0 ? { minWidth: l.minWidth } : {}
180
195
  };
181
- return f ? /* @__PURE__ */ s("div", { ref: o, className: "h-full w-full", children: /* @__PURE__ */ s(
182
- L,
196
+ return R ? /* @__PURE__ */ s("div", { ref: M, className: "h-full w-full", children: /* @__PURE__ */ s(
197
+ k,
183
198
  {
184
- highcharts: k,
185
- options: g,
186
- ref: l,
187
- containerProps: { style: C }
199
+ highcharts: z,
200
+ options: S,
201
+ ref: r,
202
+ containerProps: { style: L }
188
203
  }
189
204
  ) }) : b ? /* @__PURE__ */ s(
190
- L,
205
+ k,
191
206
  {
192
- highcharts: k,
193
- options: g,
194
- ref: l,
195
- containerProps: { style: C }
207
+ highcharts: z,
208
+ options: S,
209
+ ref: r,
210
+ containerProps: { style: L }
196
211
  }
197
212
  ) : /* @__PURE__ */ s(
198
- I,
213
+ B,
199
214
  {
200
- className: u,
201
- isLoading: c,
202
- "data-slot": N ? "chart-scatter3d" : void 0,
203
- children: /* @__PURE__ */ s(j, { loader: i, children: /* @__PURE__ */ s(
204
- L,
215
+ className: g,
216
+ isLoading: d,
217
+ "data-slot": O ? "chart-scatter3d" : void 0,
218
+ children: /* @__PURE__ */ s(P, { loader: f, children: /* @__PURE__ */ s(
219
+ k,
205
220
  {
206
- highcharts: k,
207
- options: g,
208
- ref: l,
209
- containerProps: { style: C }
221
+ highcharts: z,
222
+ options: S,
223
+ ref: r,
224
+ containerProps: { style: L }
210
225
  }
211
226
  ) })
212
227
  }
213
228
  );
214
229
  }
215
230
  );
216
- X.displayName = "Chart";
231
+ re.displayName = "Chart";
217
232
  export {
218
- X as Chart,
219
- K as ChartActions,
220
- I as ChartContainer,
221
- j as ChartContent,
222
- Q as ChartFullScreen,
223
- W as ChartHeader,
224
- J as ChartTitle
233
+ re as Chart,
234
+ ne as ChartActions,
235
+ B as ChartContainer,
236
+ P as ChartContent,
237
+ se as ChartFullScreen,
238
+ ee as ChartHeader,
239
+ te as ChartTitle
225
240
  };
@@ -33,6 +33,23 @@ export interface ChartProps {
33
33
  */
34
34
  gradient?: boolean | ChartGradientOptions;
35
35
  options?: Highcharts.Options;
36
+ /**
37
+ * Heatmap only. Fixed row height in px. Chart height becomes
38
+ * `rows * cellMinHeight + chrome` so appending rows does not shrink cells.
39
+ * Omit to keep stretch-to-`height` behavior.
40
+ */
41
+ cellMinHeight?: number;
42
+ /**
43
+ * Heatmap only. Minimum column width in px. Combine with `fillContainer`
44
+ * to grow columns when the host is wider than `columns * cellMinWidth`.
45
+ */
46
+ cellMinWidth?: number;
47
+ /**
48
+ * Heatmap only. Extra host width goes to columns (CSS `width: 100%` + `minWidth`).
49
+ * When omitted, `cellMinWidth` shrink-wraps the chart to the min width.
50
+ * Does not fetch or page data — overflow and `onEndReached` stay on the consumer.
51
+ */
52
+ fillContainer?: boolean;
36
53
  height?: number | string;
37
54
  width?: number | string;
38
55
  className?: string;
@@ -0,0 +1,9 @@
1
+ export declare function playHeatmapGridFill({ canvasElement, }: {
2
+ canvasElement: HTMLElement;
3
+ }): Promise<void>;
4
+ export declare function playHeatmapGridLarge({ canvasElement, }: {
5
+ canvasElement: HTMLElement;
6
+ }): Promise<void>;
7
+ export declare function playHeatmapGridComposition({ canvasElement, }: {
8
+ canvasElement: HTMLElement;
9
+ }): Promise<void>;
@@ -0,0 +1,32 @@
1
+ import { HeatmapGridCellPosition } from './heatmap-grid.types';
2
+ import * as React from "react";
3
+ export type { HeatmapGridCell, HeatmapGridCellPosition, HeatmapGridProps, HeatmapGridTone, HeatmapGridTooltipProps, HeatmapGridViewportProps, } from './heatmap-grid.types';
4
+ export { HeatmapGridTooltip } from './internals/heatmap-grid-tooltip';
5
+ export { HeatmapGridViewport } from './internals/heatmap-grid-viewport';
6
+ /**
7
+ * Windowed heatmap. Paints only visible rows × columns; small grids stretch to fill.
8
+ * Compose `HeatmapGridViewport` and `HeatmapGridTooltip` as children to customise layout.
9
+ */
10
+ declare const HeatmapGrid: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
11
+ rowCount: number;
12
+ columnCount: number;
13
+ getRowLabel: (rowIndex: number) => string;
14
+ getColumnLabel: (columnIndex: number) => string;
15
+ getCell: (rowIndex: number, columnIndex: number) => import('./heatmap-grid.types').HeatmapGridCell | undefined;
16
+ renderCell?: (cell: import('./heatmap-grid.types').HeatmapGridCell, position: HeatmapGridCellPosition) => React.ReactNode;
17
+ renderTooltip?: (position: HeatmapGridCellPosition) => React.ReactNode;
18
+ minRowSizePx?: number;
19
+ minColumnSizePx?: number;
20
+ rowHeaderWidthPx?: number;
21
+ columnHeaderHeightPx?: number;
22
+ hasMore?: boolean;
23
+ isFetchingMore?: boolean;
24
+ onEndReached?: () => void;
25
+ endReachedThreshold?: number;
26
+ activeCell?: HeatmapGridCellPosition;
27
+ defaultActiveCell?: HeatmapGridCellPosition;
28
+ onActiveCellChange?: (position: HeatmapGridCellPosition) => void;
29
+ rowHeaderLabel?: string;
30
+ children?: React.ReactNode;
31
+ } & React.RefAttributes<HTMLDivElement>>;
32
+ export { HeatmapGrid };
@@ -0,0 +1,93 @@
1
+ import { jsx as e, jsxs as N, Fragment as S } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { useControllableState as U } from "@radix-ui/react-use-controllable-state";
4
+ import { useImpactNovaI18n as x } from "../../../i18n/use-impact-nova-i18n.js";
5
+ import { useComposedRefs as F } from "../../../lib/compose-refs.js";
6
+ import { createComponent as O } from "../../../lib/primitives/create-component.js";
7
+ import { cn as w } from "../../../lib/utils.js";
8
+ import { HEATMAP_GRID_DEFAULT_COLUMN_HEADER_HEIGHT_PX as X, HEATMAP_GRID_DEFAULT_ROW_HEADER_WIDTH_PX as W, HEATMAP_GRID_DEFAULT_MIN_COLUMN_SIZE_PX as j, HEATMAP_GRID_DEFAULT_MIN_ROW_SIZE_PX as V } from "./heatmap-grid.layout.js";
9
+ import { heatmapGridRootVariants as Z } from "./heatmap-grid.variants.js";
10
+ import { createHeatmapGridHoverStore as k, HeatmapGridProvider as q } from "./internals/heatmap-grid-context.js";
11
+ import { HeatmapGridTooltip as y } from "./internals/heatmap-grid-tooltip.js";
12
+ import { HeatmapGridViewport as z } from "./internals/heatmap-grid-viewport.js";
13
+ const B = { rowIndex: 0, columnIndex: 0 }, ie = O(
14
+ "HeatmapGrid",
15
+ ({
16
+ className: m,
17
+ children: i,
18
+ rowCount: p,
19
+ columnCount: l,
20
+ getRowLabel: n,
21
+ getColumnLabel: d,
22
+ getCell: s,
23
+ renderCell: _,
24
+ renderTooltip: c,
25
+ minRowSizePx: f = V,
26
+ minColumnSizePx: H = j,
27
+ rowHeaderWidthPx: E = W,
28
+ columnHeaderHeightPx: G = X,
29
+ hasMore: I = !1,
30
+ isFetchingMore: R = !1,
31
+ onEndReached: A,
32
+ endReachedThreshold: L = 2,
33
+ activeCell: D,
34
+ defaultActiveCell: o = B,
35
+ onActiveCellChange: T,
36
+ rowHeaderLabel: h,
37
+ "aria-label": C,
38
+ ...M
39
+ }, P) => {
40
+ const { t: r } = x(), t = a.useRef(null), u = F(t, P), [v] = a.useState(k), [b, g] = U({
41
+ prop: D,
42
+ defaultProp: o,
43
+ onChange: T
44
+ });
45
+ return /* @__PURE__ */ e(
46
+ q,
47
+ {
48
+ value: {
49
+ rowCount: p,
50
+ columnCount: l,
51
+ getRowLabel: n,
52
+ getColumnLabel: d,
53
+ getCell: s,
54
+ renderCell: _,
55
+ renderTooltip: c,
56
+ minRowSizePx: f,
57
+ minColumnSizePx: H,
58
+ rowHeaderWidthPx: E,
59
+ columnHeaderHeightPx: G,
60
+ hasMore: I,
61
+ isFetchingMore: R,
62
+ onEndReached: A,
63
+ endReachedThreshold: L,
64
+ rowHeaderLabel: h ?? r("heatmapGrid.rowHeaderLabel"),
65
+ gridLabel: C ?? r("heatmapGrid.gridLabel"),
66
+ loadingMoreLabel: r("heatmapGrid.loadingMore"),
67
+ activeCell: b ?? o,
68
+ setActiveCell: g,
69
+ hoverStore: v,
70
+ rootRef: t
71
+ },
72
+ children: /* @__PURE__ */ e(
73
+ "div",
74
+ {
75
+ ref: u,
76
+ "data-component": "heatmap-grid",
77
+ className: w(Z(), m),
78
+ ...M,
79
+ children: i ?? /* @__PURE__ */ N(S, { children: [
80
+ /* @__PURE__ */ e(z, {}),
81
+ /* @__PURE__ */ e(y, {})
82
+ ] })
83
+ }
84
+ )
85
+ }
86
+ );
87
+ }
88
+ );
89
+ export {
90
+ ie as HeatmapGrid,
91
+ y as HeatmapGridTooltip,
92
+ z as HeatmapGridViewport
93
+ };
@@ -0,0 +1,46 @@
1
+ import { HeatmapGridCellPosition } from './heatmap-grid.types';
2
+ export declare const HEATMAP_GRID_DEFAULT_MIN_ROW_SIZE_PX = 36;
3
+ export declare const HEATMAP_GRID_DEFAULT_MIN_COLUMN_SIZE_PX = 72;
4
+ export declare const HEATMAP_GRID_DEFAULT_ROW_HEADER_WIDTH_PX = 152;
5
+ export declare const HEATMAP_GRID_DEFAULT_COLUMN_HEADER_HEIGHT_PX = 56;
6
+ /** Columns at least this wide show horizontal labels; narrower ones rotate. */
7
+ export declare const HEATMAP_GRID_HORIZONTAL_LABEL_MIN_COLUMN_PX = 112;
8
+ export type HeatmapGridLayout = {
9
+ rowSizePx: number;
10
+ columnSizePx: number;
11
+ contentWidthPx: number;
12
+ bodyHeightPx: number;
13
+ overflowsX: boolean;
14
+ overflowsY: boolean;
15
+ };
16
+ export declare function readHeatmapGridTrackSizePx(input: {
17
+ count: number;
18
+ viewportPx: number;
19
+ minSizePx: number;
20
+ }): number;
21
+ /** Fill-or-scroll: tracks stretch to the viewport, never below their floor. */
22
+ export declare function readHeatmapGridLayout(input: {
23
+ rowCount: number;
24
+ columnCount: number;
25
+ viewportWidthPx: number;
26
+ viewportHeightPx: number;
27
+ minRowSizePx: number;
28
+ minColumnSizePx: number;
29
+ rowHeaderWidthPx: number;
30
+ columnHeaderHeightPx: number;
31
+ isFetchingMore?: boolean;
32
+ }): HeatmapGridLayout;
33
+ /** Longest rotated (-45°) label that fits the column and header band. */
34
+ export declare function readHeatmapGridColumnLabelMaxWidthPx(input: {
35
+ columnSizePx: number;
36
+ columnHeaderHeightPx: number;
37
+ }): number;
38
+ export declare function readNextHeatmapGridFocusCell(input: {
39
+ current: HeatmapGridCellPosition;
40
+ rowCount: number;
41
+ columnCount: number;
42
+ key: string;
43
+ ctrlKey?: boolean;
44
+ }): HeatmapGridCellPosition | null;
45
+ export declare function readHeatmapGridCellKey(position: HeatmapGridCellPosition): string;
46
+ export declare function readHeatmapGridCellPosition(element: Element | null): HeatmapGridCellPosition | null;