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

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 (45) hide show
  1. package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.js +32 -31
  2. package/dist/components/data-display/chart/chart-heatmap-layout.d.ts +31 -0
  3. package/dist/components/data-display/chart/chart-heatmap-layout.js +72 -0
  4. package/dist/components/data-display/chart/chart.category-cluster-heatmap.stories-data.d.ts +1 -1
  5. package/dist/components/data-display/chart/chart.js +165 -150
  6. package/dist/components/data-display/chart/chart.types.d.ts +17 -0
  7. package/dist/components/data-display/heatmap-grid/heatmap-grid-play.d.ts +9 -0
  8. package/dist/components/data-display/heatmap-grid/heatmap-grid.d.ts +32 -0
  9. package/dist/components/data-display/heatmap-grid/heatmap-grid.js +93 -0
  10. package/dist/components/data-display/heatmap-grid/heatmap-grid.layout.d.ts +46 -0
  11. package/dist/components/data-display/heatmap-grid/heatmap-grid.layout.js +80 -0
  12. package/dist/components/data-display/heatmap-grid/heatmap-grid.types.d.ts +54 -0
  13. package/dist/components/data-display/heatmap-grid/heatmap-grid.variants.d.ts +18 -0
  14. package/dist/components/data-display/heatmap-grid/heatmap-grid.variants.js +80 -0
  15. package/dist/components/data-display/heatmap-grid/index.d.ts +3 -0
  16. package/dist/components/data-display/heatmap-grid/index.js +14 -0
  17. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-cell.d.ts +14 -0
  18. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-cell.js +39 -0
  19. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-context.d.ts +29 -0
  20. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-context.js +33 -0
  21. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-tooltip.d.ts +4 -0
  22. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-tooltip.js +49 -0
  23. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-viewport.d.ts +3 -0
  24. package/dist/components/data-display/heatmap-grid/internals/heatmap-grid-viewport.js +173 -0
  25. package/dist/components/data-display/heatmap-grid/internals/use-heatmap-grid-viewport.d.ts +12 -0
  26. package/dist/components/data-display/heatmap-grid/internals/use-heatmap-grid-viewport.js +161 -0
  27. package/dist/components/data-display/hex-tilemap/hex-tilemap.js +35 -33
  28. package/dist/components/data-display/hex-tilemap/hex-tilemap.types.d.ts +2 -0
  29. package/dist/components/data-display/hex-tilemap/internals/hex-camera.js +30 -28
  30. package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-context.d.ts +1 -0
  31. package/dist/components/data-display/hex-tilemap/internals/hex-tilemap-viewport.js +36 -34
  32. package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.d.ts +2 -1
  33. package/dist/components/data-display/hex-tilemap/internals/use-hex-camera.js +87 -84
  34. package/dist/components/flows/iris-chat/iris-chat-chrome.js +203 -185
  35. package/dist/i18n/defaultMessages.d.ts +6 -0
  36. package/dist/i18n/defaultMessages.js +16 -11
  37. package/dist/i18n/locales/de.js +5 -0
  38. package/dist/i18n/locales/es.js +5 -0
  39. package/dist/i18n/locales/hi.js +5 -0
  40. package/dist/i18n/locales/kn.js +5 -0
  41. package/dist/impact-nova.css +1 -1
  42. package/dist/lib/primitives/use-field-chrome.js +22 -22
  43. package/dist/llms/rules/installation.js +1 -1
  44. package/dist/llms/rules/requirements.js +1 -1
  45. package/package.json +5 -1
@@ -1,36 +1,36 @@
1
- import { jsxs as F, jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as k, useState as B, useRef as g, useImperativeHandle as H, useCallback as r } from "react";
1
+ import { jsxs as W, jsx as i } from "react/jsx-runtime";
2
+ import { forwardRef as k, useState as B, useRef as b, useImperativeHandle as H, useCallback as r } from "react";
3
3
  import { Select as L } from "../../../../forms/select/select.js";
4
4
  import { SelectAiInsightAffordance as P } from "../select-ai-insight-affordance.js";
5
- const q = k((b, v) => {
5
+ const q = k((u, v) => {
6
6
  const {
7
7
  value: l,
8
8
  options: S = [],
9
9
  placeholder: C = "Select...",
10
- isSearchable: w = !0,
11
- isClearable: x = !0,
12
- stopEditing: u,
13
- onValueChange: d,
10
+ isSearchable: x = !0,
11
+ isClearable: M = !0,
12
+ stopEditing: d,
13
+ onValueChange: f,
14
14
  data: n,
15
- showAiInsight: M,
15
+ showAiInsight: w,
16
16
  aiInsightField: V,
17
17
  confidenceScore: R,
18
18
  confidenceScoreField: j,
19
- confidenceReason: D,
19
+ confidenceReason: A,
20
20
  confidenceReasonField: E,
21
21
  confidenceLabel: I
22
- } = b, o = l && typeof l == "object" && "value" in l, s = o ? l.cellMetadata : void 0, t = o ? l.value : l, f = S.map((e) => ({
22
+ } = u, o = l && typeof l == "object" && "value" in l, s = o ? l.cellMetadata : void 0, t = o ? l.value : l, p = S.map((e) => ({
23
23
  value: e.value,
24
24
  label: e.label,
25
25
  isDisabled: e.isDisabled
26
- })), [N, p] = B(
26
+ })), [N, m] = B(
27
27
  t != null ? String(t) : null
28
- ), m = g(
28
+ ), h = b(
29
29
  t != null ? String(t) : null
30
- ), h = g(!1);
30
+ ), g = b(!1);
31
31
  H(v, () => ({
32
32
  getValue() {
33
- const e = m.current;
33
+ const e = h.current;
34
34
  return o ? {
35
35
  value: e,
36
36
  ...s !== void 0 && { cellMetadata: s }
@@ -46,33 +46,34 @@ const q = k((b, v) => {
46
46
  return !0;
47
47
  }
48
48
  }));
49
- const A = f.find((e) => e.value === N) ?? null, a = r(() => {
50
- h.current || (h.current = !0, u());
51
- }, [u]), O = r(
49
+ const y = p.find((e) => e.value === N) ?? null, a = r(() => {
50
+ g.current || (g.current = !0, d());
51
+ }, [d]), D = r(
52
52
  (e) => {
53
53
  const c = e ? e.value : null;
54
- m.current = c, p(c), d?.(c), a();
54
+ h.current = c, m(c), f?.(c), a();
55
55
  },
56
- [a, d, p]
57
- ), y = r(() => {
56
+ [a, f, m]
57
+ ), O = r(() => {
58
58
  a();
59
- }, [a]);
60
- return /* @__PURE__ */ F(
59
+ }, [a]), F = n && typeof n == "object" ? n : null;
60
+ return /* @__PURE__ */ W(
61
61
  "div",
62
62
  {
63
63
  className: "box-border flex h-full w-full min-w-0 items-center gap-2 ps-2 pe-2.5 ag-editable-cell-highlight",
64
64
  "data-component": "select-cell-editor",
65
+ style: { minWidth: u.column?.getActualWidth() },
65
66
  children: [
66
67
  /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ i(
67
68
  L,
68
69
  {
69
- options: f,
70
- value: A,
71
- onChange: O,
72
- onMenuClose: y,
70
+ options: p,
71
+ value: y,
72
+ onChange: D,
73
+ onMenuClose: O,
73
74
  placeholder: C,
74
- isSearchable: w,
75
- isClearable: x,
75
+ isSearchable: x,
76
+ isClearable: M,
76
77
  isMulti: !1,
77
78
  defaultMenuIsOpen: !0,
78
79
  className: "!border-none !shadow-none !ring-0 !h-7 !rounded-[8px] !px-1.5",
@@ -82,14 +83,14 @@ const q = k((b, v) => {
82
83
  /* @__PURE__ */ i(
83
84
  P,
84
85
  {
85
- showAiInsight: M,
86
+ showAiInsight: w,
86
87
  aiInsightField: V,
87
88
  confidenceScore: R,
88
89
  confidenceScoreField: j,
89
- confidenceReason: D,
90
+ confidenceReason: A,
90
91
  confidenceReasonField: E,
91
92
  confidenceLabel: I,
92
- data: n && typeof n == "object" ? n : null,
93
+ data: F,
93
94
  cellMetadata: s
94
95
  }
95
96
  )
@@ -0,0 +1,31 @@
1
+ import { ChartProps } from './chart.types';
2
+ import type * as Highcharts from "highcharts";
3
+ /** Recommended heatmap row height when a consumer wants fixed cells. */
4
+ export declare const HEATMAP_CELL_MIN_HEIGHT_PX = 36;
5
+ /** Recommended heatmap column width floor when a consumer wants fixed cells. */
6
+ export declare const HEATMAP_CELL_MIN_WIDTH_PX = 72;
7
+ export type HeatmapChartBoxSize = {
8
+ height: number | string | undefined;
9
+ width: number | string | undefined;
10
+ minWidth?: number;
11
+ };
12
+ export type HeatmapChartBoxSizeInput = {
13
+ type?: ChartProps["type"];
14
+ height?: ChartProps["height"];
15
+ width?: ChartProps["width"];
16
+ cellMinHeight?: number;
17
+ cellMinWidth?: number;
18
+ fillContainer?: boolean;
19
+ rowCount: number;
20
+ columnCount: number;
21
+ verticalChrome?: number;
22
+ horizontalChrome?: number;
23
+ availableWidth?: number;
24
+ };
25
+ /** Margin + spacing around the heatmap plot band. */
26
+ export declare function readHeatmapChartChrome(options: Highcharts.Options | undefined): {
27
+ vertical: number;
28
+ horizontal: number;
29
+ };
30
+ export declare function readHeatmapChartBoxSize(input: HeatmapChartBoxSizeInput): HeatmapChartBoxSize;
31
+ export declare function readHeatmapChartBoxSizeFromProps(props: Pick<ChartProps, "type" | "height" | "width" | "cellMinHeight" | "cellMinWidth" | "fillContainer" | "xAxisCategories" | "yAxisCategories" | "options">): HeatmapChartBoxSize;
@@ -0,0 +1,72 @@
1
+ function f(t) {
2
+ return Math.max(t, 1);
3
+ }
4
+ function i(t, e) {
5
+ return typeof t == "number" && Number.isFinite(t) ? t : e;
6
+ }
7
+ function C(t) {
8
+ return typeof t == "number" ? [t, t, t, t] : Array.isArray(t) && t.length >= 4 ? [
9
+ i(t[0], 10),
10
+ i(t[1], 10),
11
+ i(t[2], 15),
12
+ i(t[3], 10)
13
+ ] : [10, 10, 15, 10];
14
+ }
15
+ function s(t) {
16
+ const e = t?.chart;
17
+ if (e === void 0 || Array.isArray(e))
18
+ return { vertical: 25, horizontal: 20 };
19
+ const [l, c, d, m] = C(
20
+ e.spacing
21
+ ), n = i(e.marginTop, 0), a = i(e.marginRight, 0), o = i(e.marginBottom, 0), r = i(e.marginLeft, 0);
22
+ return {
23
+ vertical: n + l + o + d,
24
+ horizontal: r + m + a + c
25
+ };
26
+ }
27
+ function v(t) {
28
+ return t.availableWidth !== void 0 && t.availableWidth > 0 ? t.availableWidth : typeof t.width == "number" ? t.width : 0;
29
+ }
30
+ function u(t) {
31
+ if (!(t.type === "heatmap" && (t.cellMinHeight !== void 0 || t.cellMinWidth !== void 0 || t.fillContainer === !0)))
32
+ return { height: t.height, width: t.width };
33
+ const l = f(t.rowCount), c = f(t.columnCount), d = t.verticalChrome ?? 0, m = t.horizontalChrome ?? 0, n = t.cellMinHeight, a = t.cellMinWidth, o = n === void 0 ? void 0 : l * n + d, r = o === void 0 ? t.height : typeof t.height == "number" ? Math.max(o, t.height) : o, h = a === void 0 ? void 0 : c * a + m;
34
+ if (h === void 0)
35
+ return {
36
+ height: r,
37
+ width: t.width
38
+ };
39
+ if (t.fillContainer === !0) {
40
+ const g = v(t);
41
+ return {
42
+ height: r,
43
+ width: g > 0 ? Math.max(h, g) : t.width ?? "100%",
44
+ minWidth: h
45
+ };
46
+ }
47
+ return {
48
+ height: r,
49
+ width: h,
50
+ minWidth: h
51
+ };
52
+ }
53
+ function w(t) {
54
+ const e = s(t.options);
55
+ return u({
56
+ type: t.type,
57
+ height: t.height,
58
+ width: t.width,
59
+ cellMinHeight: t.cellMinHeight,
60
+ cellMinWidth: t.cellMinWidth,
61
+ fillContainer: t.fillContainer,
62
+ rowCount: t.yAxisCategories?.length ?? 0,
63
+ columnCount: t.xAxisCategories?.length ?? 0,
64
+ verticalChrome: e.vertical,
65
+ horizontalChrome: e.horizontal
66
+ });
67
+ }
68
+ export {
69
+ u as readHeatmapChartBoxSize,
70
+ w as readHeatmapChartBoxSizeFromProps,
71
+ s as readHeatmapChartChrome
72
+ };
@@ -19,4 +19,4 @@ export declare function buildCategoryClusterHeatmapPoints(): CategoryClusterHeat
19
19
  export declare function formatCategoryClusterHeatmapTooltip(formatterContext: object): string;
20
20
  export declare const CATEGORY_CLUSTER_HEATMAP_SERIES: Highcharts.SeriesHeatmapOptions;
21
21
  export declare const CATEGORY_CLUSTER_HEATMAP_OPTIONS: Highcharts.Options;
22
- export declare const CATEGORY_CLUSTER_HEATMAP_SOURCE = "import {\n Chart,\n ChartContainer,\n ChartHeader,\n ChartTitle,\n ChartContent,\n} from 'impact-nova/chart';\nimport { Card } from 'impact-nova/card';\nimport { IrisMenu } from 'impact-nova/iris';\n\n<Card className=\"w-[880px] max-w-full rounded-lg p-3 shadow-elevation-card\">\n <ChartContainer>\n <ChartHeader>\n <ChartTitle>Category \u00D7 Cluster \u2014 ST%</ChartTitle>\n </ChartHeader>\n <IrisMenu appearance=\"status\">\n Cells are colour-coded against the 69% plan...\n </IrisMenu>\n <ChartContent>\n <Chart\n type=\"heatmap\"\n xAxisCategories={['A', 'B', 'C', 'D', 'E']}\n yAxisCategories={['Knitwear', 'Outerwear', 'Tops', 'Bottoms', 'Accessories', 'Denim']}\n showLegend={false}\n series={[{ type: 'heatmap', data, dataLabels: { enabled: true, format: '{point.value}%' } }]}\n options={{ yAxis: { reversed: true }, plotOptions: { heatmap: { borderRadius: 8, borderWidth: 4 } } }}\n />\n </ChartContent>\n </ChartContainer>\n</Card>";
22
+ export declare const CATEGORY_CLUSTER_HEATMAP_SOURCE = "import {\n Chart,\n ChartContainer,\n ChartHeader,\n ChartTitle,\n ChartContent,\n} from 'impact-nova/chart';\nimport { Card } from 'impact-nova/card';\nimport { IrisMenu } from 'impact-nova/iris';\n\n<Card className=\"w-[880px] max-w-full rounded-lg p-3 shadow-elevation-card\">\n <ChartContainer>\n <ChartHeader>\n <ChartTitle>Category \u00D7 Cluster \u2014 ST%</ChartTitle>\n </ChartHeader>\n <IrisMenu appearance=\"status\">\n Cells are colour-coded against the 69% plan...\n </IrisMenu>\n <ChartContent className=\"h-[352px] overflow-auto\">\n <Chart\n type=\"heatmap\"\n cellMinHeight={36}\n cellMinWidth={72}\n fillContainer\n xAxisCategories={['A', 'B', 'C', 'D', 'E']}\n yAxisCategories={['Knitwear', 'Outerwear', 'Tops', 'Bottoms', 'Accessories', 'Denim']}\n showLegend={false}\n series={[{ type: 'heatmap', data, dataLabels: { enabled: true, format: '{point.value}%' } }]}\n options={{ yAxis: { reversed: true }, plotOptions: { heatmap: { borderRadius: 8, borderWidth: 4 } } }}\n />\n </ChartContent>\n </ChartContainer>\n</Card>";
@@ -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;