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,7 +1,7 @@
1
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
- import { __require as r } from "../node_modules/extend/index.js";
3
- var t = r();
4
- const a = /* @__PURE__ */ e(t);
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as o } from "../node_modules/style-to-js/cjs/index.js";
3
+ var t = o();
4
+ const a = /* @__PURE__ */ r(t);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
- import { __require as o } from "../node_modules/style-to-js/cjs/index.js";
3
- var t = o();
4
- const a = /* @__PURE__ */ r(t);
1
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
2
+ import { __require as r } from "../node_modules/extend/index.js";
3
+ var t = r();
4
+ const a = /* @__PURE__ */ e(t);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -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>";