impact-nova 2.1.0-alpha.7 → 2.1.0-alpha.8

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 (106) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +6 -0
  2. package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
  3. package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
  4. package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
  5. package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
  6. package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +78 -73
  7. package/dist/components/data/ag-grid-react/headers/custom-header.js +3 -1
  8. package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
  9. package/dist/components/data/ag-grid-react/index.d.ts +1 -1
  10. package/dist/components/data/ag-grid-react/index.js +109 -100
  11. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -2
  12. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +4 -3
  13. package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
  14. package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
  15. package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
  16. package/dist/components/data/ag-grid-react/theme.js +93 -21
  17. package/dist/components/data/data-table/column-indicator.d.ts +1 -1
  18. package/dist/components/data/data-table/column-indicator.js +15 -11
  19. package/dist/components/data/data-table/data-table-column-def-pin.d.ts +9 -4
  20. package/dist/components/data/data-table/data-table-column-def-pin.js +38 -38
  21. package/dist/components/data/data-table/data-table-saved-views.js +37 -37
  22. package/dist/components/data/data-table/data-table.js +78 -73
  23. package/dist/components/data/data-table/data-table.types.d.ts +7 -1
  24. package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
  25. package/dist/components/data/data-table/indicator-legend.js +20 -17
  26. package/dist/components/data/data-table/pin-switch.js +9 -9
  27. package/dist/components/data/data-table/use-data-table-column-list-sync.js +92 -89
  28. package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
  29. package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
  30. package/dist/components/data/nested-list/nested-list.js +107 -97
  31. package/dist/components/data-display/calendar/calendar.d.ts +1 -1
  32. package/dist/components/data-display/calendar/calendar.js +194 -189
  33. package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
  34. package/dist/components/data-display/chart/chart-palette.js +28 -0
  35. package/dist/components/data-display/chart/chart.js +121 -115
  36. package/dist/components/data-display/chart/chart.utils.js +9 -6
  37. package/dist/components/data-display/chart/index.d.ts +1 -0
  38. package/dist/components/data-display/chart/index.js +15 -9
  39. package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
  40. package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
  41. package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
  42. package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
  43. package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
  44. package/dist/components/data-display/statistics-card/statistics-card.js +127 -146
  45. package/dist/components/feedback/alert-dialog/alert-dialog.js +15 -15
  46. package/dist/components/feedback/dialog/dialog.js +3 -3
  47. package/dist/components/feedback/drawer/drawer.js +32 -32
  48. package/dist/components/feedback/sheet/sheet.js +8 -8
  49. package/dist/components/feedback/sheet/sheet.variants.js +1 -1
  50. package/dist/components/feedback/toast/toast.js +83 -92
  51. package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
  52. package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
  53. package/dist/components/flows/command-palette/command-palette.js +245 -258
  54. package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
  55. package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
  56. package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
  57. package/dist/components/flows/filter-panel/filter-panel.js +99 -104
  58. package/dist/components/flows/filter-strip/filter-summary.js +41 -41
  59. package/dist/components/flows/filter-strip/filter-tag-list.js +48 -48
  60. package/dist/components/flows/wizard/wizard.js +32 -32
  61. package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
  62. package/dist/components/forms/choice-card/choice-card.js +156 -166
  63. package/dist/components/forms/combobox/combobox.js +70 -70
  64. package/dist/components/forms/date-picker/date-picker.js +31 -30
  65. package/dist/components/forms/file-upload/file-upload.js +146 -168
  66. package/dist/components/forms/prompt/prompt.js +47 -48
  67. package/dist/components/forms/select/components/SelectAllRow.js +14 -14
  68. package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
  69. package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
  70. package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
  71. package/dist/components/forms/select/components/SelectMenuPanel.js +8 -8
  72. package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
  73. package/dist/components/forms/select/select.d.ts +5 -4
  74. package/dist/components/forms/select/select.js +123 -120
  75. package/dist/components/forms/select/select.types.d.ts +95 -204
  76. package/dist/components/forms/slider/slider.js +17 -17
  77. package/dist/components/forms/smart-input/smart-input.js +49 -49
  78. package/dist/components/forms/textarea/textarea.js +25 -25
  79. package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
  80. package/dist/components/layout/header/header.d.ts +5 -17
  81. package/dist/components/layout/header/header.js +113 -116
  82. package/dist/components/layout/header/header.types.d.ts +3 -0
  83. package/dist/components/layout/sidebar/sidebar.js +5 -5
  84. package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
  85. package/dist/components/primitives/accordion/accordion.js +38 -41
  86. package/dist/components/primitives/kbd/kbd.variants.js +1 -1
  87. package/dist/i18n/defaultMessages.d.ts +2 -0
  88. package/dist/i18n/defaultMessages.js +6 -4
  89. package/dist/i18n/locales/de.js +2 -0
  90. package/dist/i18n/locales/es.js +2 -0
  91. package/dist/i18n/locales/hi.js +2 -0
  92. package/dist/i18n/locales/kn.js +2 -0
  93. package/dist/impact-nova-base.scss +8 -5
  94. package/dist/impact-nova-components.css +2 -2
  95. package/dist/impact-nova-tokens.scss +346 -189
  96. package/dist/impact-nova.css +1 -1
  97. package/dist/index.js +505 -499
  98. package/dist/lib/resolve-design-token-color.d.ts +5 -0
  99. package/dist/lib/resolve-design-token-color.js +12 -0
  100. package/dist/llms/rules/ag-grid.js +1 -1
  101. package/dist/llms/rules/installation.js +1 -1
  102. package/dist/llms/rules/requirements.js +1 -1
  103. package/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
  104. package/dist/theme/tokens/chart-series-palette.json.js +7 -0
  105. package/package.json +22 -254
  106. package/tailwind.config.js +10 -229
@@ -1,38 +1,41 @@
1
- import { jsx as r, jsxs as F } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as b } from "react/jsx-runtime";
2
2
  import * as t from "react";
3
- import x from "highcharts-react-official";
4
- import { cn as h } from "../../../lib/utils.js";
5
- import { Skeleton as k } from "../skeleton/skeleton.js";
6
- import { Collapse as A, Expand as I } from "impact-nova-icons";
7
- import { Button as H } from "../../primitives/button/button.js";
8
- import { getInitializedHighcharts as j } from "./initializeHighcharts.js";
9
- import { getBaseChartOptions as B } from "./chart.utils.js";
10
- import { useImpactNovaI18n as P } from "../../../i18n/use-impact-nova-i18n.js";
11
- const v = j(), E = t.createContext(null), z = () => {
12
- const n = t.useContext(E);
3
+ import N from "highcharts-react-official";
4
+ import { cn as f } from "../../../lib/utils.js";
5
+ import { Skeleton as q } from "../skeleton/skeleton.js";
6
+ import { Collapse as j, Expand as B } from "impact-nova-icons";
7
+ import { Button as P } from "../../primitives/button/button.js";
8
+ import { getInitializedHighcharts as T } from "./initializeHighcharts.js";
9
+ import { getBaseChartOptions as O } from "./chart.utils.js";
10
+ import { resolveHighchartsOptions as M } from "./resolve-highcharts-options.js";
11
+ import { useImpactNovaI18n as V } from "../../../i18n/use-impact-nova-i18n.js";
12
+ const R = T(), S = t.createContext(null), A = () => {
13
+ const n = t.useContext(S);
13
14
  if (!n)
14
15
  throw new Error("Chart components must be used within a ChartContainer");
15
16
  return n;
16
- }, S = t.forwardRef(
17
- ({ className: n, children: s, isLoading: l = !1, ...i }, m) => {
18
- const a = t.useRef(null), o = t.useRef(null), [c, u] = t.useState(!1), [R, d] = t.useState(!1);
19
- t.useImperativeHandle(m, () => a.current);
20
- const w = () => {
17
+ }, H = t.forwardRef(
18
+ ({ className: n, children: r, isLoading: l = !1, ...c }, u) => {
19
+ const a = t.useRef(null), o = t.useRef(null), [m, h] = t.useState(null), [d, p] = t.useState(!1), [g, C] = t.useState(!1), w = t.useCallback((e) => {
20
+ a.current = e, h(e);
21
+ }, []);
22
+ t.useImperativeHandle(u, () => a.current);
23
+ const x = () => {
21
24
  const e = a.current;
22
- e && (d(!0), e.classList.add("fullscreen-animating"), setTimeout(() => {
23
- e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(), u(!0), e.classList.remove("fullscreen-animating");
25
+ e && (C(!0), e.classList.add("fullscreen-animating"), setTimeout(() => {
26
+ e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(), p(!0), e.classList.remove("fullscreen-animating");
24
27
  }, 200));
25
- }, g = () => {
28
+ }, v = () => {
26
29
  const e = a.current;
27
- e && (d(!0), e.classList.add("fullscreen-animating-out"), setTimeout(() => {
28
- document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), u(!1), e.classList.remove("fullscreen-animating-out");
30
+ e && (C(!0), e.classList.add("fullscreen-animating-out"), setTimeout(() => {
31
+ document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(), p(!1), e.classList.remove("fullscreen-animating-out");
29
32
  }, 200));
30
- }, p = () => {
31
- c ? g() : w();
33
+ }, E = () => {
34
+ d ? v() : x();
32
35
  };
33
36
  return t.useEffect(() => {
34
37
  const e = () => {
35
- document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || u(!1);
38
+ document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || p(!1);
36
39
  };
37
40
  return document.addEventListener("fullscreenchange", e), document.addEventListener("webkitfullscreenchange", e), () => {
38
41
  document.removeEventListener("fullscreenchange", e), document.removeEventListener(
@@ -43,157 +46,160 @@ const v = j(), E = t.createContext(null), z = () => {
43
46
  }, []), t.useEffect(() => {
44
47
  if (!o?.current?.chart) return;
45
48
  const e = o.current.chart;
46
- let f = null;
47
- const N = () => {
48
- c && a.current ? (f && cancelAnimationFrame(f), f = requestAnimationFrame(() => {
49
- const C = a.current;
50
- if (!C) return;
51
- const b = C.getBoundingClientRect(), y = C.querySelector('[class*="ChartContent"]');
52
- if (y) {
53
- const L = y.getBoundingClientRect();
54
- e.setSize(L.width, L.height, !1);
49
+ let i = null;
50
+ const L = () => {
51
+ d && a.current ? (i && cancelAnimationFrame(i), i = requestAnimationFrame(() => {
52
+ const F = a.current;
53
+ if (!F) return;
54
+ const y = F.getBoundingClientRect(), k = F.querySelector('[class*="ChartContent"]');
55
+ if (k) {
56
+ const z = k.getBoundingClientRect();
57
+ e.setSize(z.width, z.height, !1);
55
58
  } else
56
- e.setSize(b.width, b.height, !1);
57
- f = null;
59
+ e.setSize(y.width, y.height, !1);
60
+ i = null;
58
61
  })) : (e.setSize(null, null, !1), e.reflow());
59
62
  };
60
- return window.addEventListener("resize", N), () => {
61
- f && cancelAnimationFrame(f), window.removeEventListener("resize", N);
63
+ return window.addEventListener("resize", L), () => {
64
+ i && cancelAnimationFrame(i), window.removeEventListener("resize", L);
62
65
  };
63
- }, [c]), /* @__PURE__ */ r(
64
- E.Provider,
66
+ }, [d]), /* @__PURE__ */ s(
67
+ S.Provider,
65
68
  {
66
69
  value: {
67
- isExpanded: c,
68
- toggleFullscreen: p,
70
+ isExpanded: d,
71
+ toggleFullscreen: E,
69
72
  isLoading: l,
70
73
  containerRef: a,
74
+ containerElement: m,
71
75
  chartComponentRef: o
72
76
  },
73
- children: /* @__PURE__ */ r(
77
+ children: /* @__PURE__ */ s(
74
78
  "div",
75
79
  {
76
- ref: a,
80
+ ref: w,
77
81
  "data-component": "chart",
78
- className: h(
82
+ className: f(
79
83
  n,
80
84
  "w-full relative bg-canvas-elevated transition-all duration-200 ease-in-out",
81
- c && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
82
- R && "overflow-hidden"
85
+ d && "fixed inset-0 z-50 h-screen w-screen p-4 bg-canvas flex flex-col",
86
+ g && "overflow-hidden"
83
87
  ),
84
- ...i,
85
- children: s
88
+ ...c,
89
+ children: r
86
90
  }
87
91
  )
88
92
  }
89
93
  );
90
94
  }
91
95
  );
92
- S.displayName = "ChartContainer";
93
- const T = t.forwardRef(
94
- ({ className: n, children: s, ...l }, i) => /* @__PURE__ */ r("div", { ref: i, className: h("flex items-center justify-between mb-4", n), ...l, children: s })
96
+ H.displayName = "ChartContainer";
97
+ const W = t.forwardRef(
98
+ ({ className: n, children: r, ...l }, c) => /* @__PURE__ */ s("div", { ref: c, className: f("flex items-center justify-between mb-4", n), ...l, children: r })
95
99
  );
96
- T.displayName = "ChartHeader";
97
- const M = t.forwardRef(
98
- ({ className: n, ...s }, l) => /* @__PURE__ */ r("h3", { ref: l, className: h("text-lg font-semibold leading-none tracking-tight", n), ...s })
100
+ W.displayName = "ChartHeader";
101
+ const D = t.forwardRef(
102
+ ({ className: n, ...r }, l) => /* @__PURE__ */ s("h3", { ref: l, className: f("text-lg font-semibold leading-none tracking-tight", n), ...r })
99
103
  );
100
- M.displayName = "ChartTitle";
101
- const O = t.forwardRef(
102
- ({ className: n, ...s }, l) => /* @__PURE__ */ r("div", { ref: l, className: h("flex items-center gap-2", n), ...s })
104
+ D.displayName = "ChartTitle";
105
+ const G = t.forwardRef(
106
+ ({ className: n, ...r }, l) => /* @__PURE__ */ s("div", { ref: l, className: f("flex items-center gap-2", n), ...r })
103
107
  );
104
- O.displayName = "ChartActions";
105
- const V = t.forwardRef(
106
- ({ className: n, ...s }, l) => {
107
- const { t: i } = P(), { toggleFullscreen: m, isExpanded: a } = z(), o = i("aria.toggleFullscreen");
108
- return /* @__PURE__ */ F(
109
- H,
108
+ G.displayName = "ChartActions";
109
+ const J = t.forwardRef(
110
+ ({ className: n, ...r }, l) => {
111
+ const { t: c } = V(), { toggleFullscreen: u, isExpanded: a } = A(), o = c("aria.toggleFullscreen");
112
+ return /* @__PURE__ */ b(
113
+ P,
110
114
  {
111
115
  variant: "ghost",
112
116
  size: "icon",
113
- onClick: m,
117
+ onClick: u,
114
118
  ref: l,
115
- className: h("h-8 w-8", n),
119
+ className: f("h-8 w-8", n),
116
120
  "aria-label": o,
117
- ...s,
121
+ ...r,
118
122
  children: [
119
- a ? /* @__PURE__ */ r(A, { className: "h-4 w-4" }) : /* @__PURE__ */ r(I, { className: "h-4 w-4" }),
120
- /* @__PURE__ */ r("span", { className: "sr-only", children: o })
123
+ a ? /* @__PURE__ */ s(j, { className: "h-4 w-4" }) : /* @__PURE__ */ s(B, { className: "h-4 w-4" }),
124
+ /* @__PURE__ */ s("span", { className: "sr-only", children: o })
121
125
  ]
122
126
  }
123
127
  );
124
128
  }
125
129
  );
126
- V.displayName = "ChartFullScreen";
127
- const q = t.forwardRef(
128
- ({ className: n, children: s, loader: l, ...i }, m) => {
129
- const { isLoading: a, chartComponentRef: o, isExpanded: c } = z();
130
- return a && l ? /* @__PURE__ */ r("div", { ref: m, className: h(n, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", c && "min-h-0"), ...i, children: l }) : /* @__PURE__ */ F("div", { ref: m, className: h(n, "w-full relative flex-1 min-h-[300px]", c && "min-h-0"), ...i, children: [
131
- a && /* @__PURE__ */ F("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
132
- /* @__PURE__ */ r(k, { className: "h-8 w-1/3" }),
133
- /* @__PURE__ */ r(k, { className: "flex-1 w-full" })
130
+ J.displayName = "ChartFullScreen";
131
+ const I = t.forwardRef(
132
+ ({ className: n, children: r, loader: l, ...c }, u) => {
133
+ const { isLoading: a, chartComponentRef: o, isExpanded: m } = A();
134
+ return a && l ? /* @__PURE__ */ s("div", { ref: u, className: f(n, "w-full relative flex items-center justify-center flex-1 min-h-[300px]", m && "min-h-0"), ...c, children: l }) : /* @__PURE__ */ b("div", { ref: u, className: f(n, "w-full relative flex-1 min-h-[300px]", m && "min-h-0"), ...c, children: [
135
+ a && /* @__PURE__ */ b("div", { className: "absolute inset-0 z-10 bg-canvas/50 flex flex-col gap-2 p-4", children: [
136
+ /* @__PURE__ */ s(q, { className: "h-8 w-1/3" }),
137
+ /* @__PURE__ */ s(q, { className: "flex-1 w-full" })
134
138
  ] }),
135
- t.Children.map(s, (u) => t.isValidElement(u) ? t.cloneElement(u, { ref: o }) : u)
139
+ t.Children.map(r, (h) => t.isValidElement(h) ? t.cloneElement(h, { ref: o }) : h)
136
140
  ] });
137
141
  }
138
142
  );
139
- q.displayName = "ChartContent";
140
- const W = t.forwardRef(
141
- (n, s) => {
143
+ I.displayName = "ChartContent";
144
+ const K = t.forwardRef(
145
+ (n, r) => {
142
146
  const {
143
147
  height: l,
144
- width: i,
145
- className: m,
148
+ width: c,
149
+ className: u,
146
150
  isLoading: a,
147
151
  loader: o,
148
- title: c,
149
- noWrapper: u,
150
- children: R,
151
- ...d
152
- } = n, w = t.useContext(E), g = t.useMemo(() => {
153
- const p = B({ title: c, ...d });
152
+ title: m,
153
+ noWrapper: h,
154
+ children: d,
155
+ ...p
156
+ } = n, g = t.useContext(S), [C, w] = t.useState(null), x = t.useCallback((i) => {
157
+ w(i);
158
+ }, []), v = t.useMemo(() => {
159
+ const i = O({ title: m, ...p });
154
160
  return {
155
- ...p,
161
+ ...i,
156
162
  chart: {
157
- ...p.chart,
163
+ ...i.chart,
158
164
  height: l ?? null,
159
- width: i ?? null
165
+ width: c ?? null
160
166
  }
161
167
  };
162
- }, [c, l, i, d]);
163
- return u ? /* @__PURE__ */ r(
164
- x,
168
+ }, [m, l, c, p]), E = g?.containerElement ?? C, e = M(v, E);
169
+ return h ? /* @__PURE__ */ s("div", { ref: x, className: "h-full w-full", children: /* @__PURE__ */ s(
170
+ N,
165
171
  {
166
- highcharts: v,
167
- options: g,
168
- ref: s,
172
+ highcharts: R,
173
+ options: e,
174
+ ref: r,
169
175
  containerProps: { style: { height: "100%", width: "100%" } }
170
176
  }
171
- ) : w ? /* @__PURE__ */ r(
172
- x,
177
+ ) }) : g ? /* @__PURE__ */ s(
178
+ N,
173
179
  {
174
- highcharts: v,
175
- options: g,
176
- ref: s,
180
+ highcharts: R,
181
+ options: e,
182
+ ref: r,
177
183
  containerProps: { style: { height: "100%", width: "100%" } }
178
184
  }
179
- ) : /* @__PURE__ */ r(S, { className: m, isLoading: a, children: /* @__PURE__ */ r(q, { loader: o, children: /* @__PURE__ */ r(
180
- x,
185
+ ) : /* @__PURE__ */ s(H, { className: u, isLoading: a, children: /* @__PURE__ */ s(I, { loader: o, children: /* @__PURE__ */ s(
186
+ N,
181
187
  {
182
- highcharts: v,
183
- options: g,
184
- ref: s,
188
+ highcharts: R,
189
+ options: e,
190
+ ref: r,
185
191
  containerProps: { style: { height: "100%", width: "100%" } }
186
192
  }
187
193
  ) }) });
188
194
  }
189
195
  );
190
- W.displayName = "Chart";
196
+ K.displayName = "Chart";
191
197
  export {
192
- W as Chart,
193
- O as ChartActions,
194
- S as ChartContainer,
195
- q as ChartContent,
196
- V as ChartFullScreen,
197
- T as ChartHeader,
198
- M as ChartTitle
198
+ K as Chart,
199
+ G as ChartActions,
200
+ H as ChartContainer,
201
+ I as ChartContent,
202
+ J as ChartFullScreen,
203
+ W as ChartHeader,
204
+ D as ChartTitle
199
205
  };
@@ -1,9 +1,10 @@
1
- const g = (i) => {
1
+ import { CHART_PALETTE_CSS_VARS as g } from "./chart-palette.js";
2
+ const u = (i) => {
2
3
  const {
3
4
  type: l = "column",
4
5
  title: a,
5
- subtitle: n,
6
- xAxisCategories: s,
6
+ subtitle: s,
7
+ xAxisCategories: n,
7
8
  xAxisTitle: e,
8
9
  yAxisTitle: d,
9
10
  series: c,
@@ -37,7 +38,7 @@ const g = (i) => {
37
38
  }
38
39
  },
39
40
  subtitle: {
40
- text: n,
41
+ text: s,
41
42
  align: "left"
42
43
  },
43
44
  credits: {
@@ -53,7 +54,7 @@ const g = (i) => {
53
54
  }
54
55
  },
55
56
  xAxis: {
56
- categories: s,
57
+ categories: n,
57
58
  title: e ? {
58
59
  text: e,
59
60
  style: {
@@ -125,6 +126,7 @@ const g = (i) => {
125
126
  },
126
127
  shadow: !0
127
128
  },
129
+ colors: [...g],
128
130
  plotOptions: {
129
131
  column: {
130
132
  borderRadius: 4,
@@ -156,6 +158,7 @@ const g = (i) => {
156
158
  return {
157
159
  ...r,
158
160
  ...o,
161
+ colors: o?.colors ?? r.colors,
159
162
  chart: {
160
163
  ...r.chart,
161
164
  ...o?.chart
@@ -194,5 +197,5 @@ const g = (i) => {
194
197
  };
195
198
  };
196
199
  export {
197
- g as getBaseChartOptions
200
+ u as getBaseChartOptions
198
201
  };
@@ -1,3 +1,4 @@
1
1
  export * from './chart';
2
2
  export * from './chart.types';
3
3
  export * from './chart.utils';
4
+ export * from './chart-palette';
@@ -1,12 +1,18 @@
1
- import { Chart as a, ChartActions as e, ChartContainer as C, ChartContent as h, ChartFullScreen as o, ChartHeader as n, ChartTitle as i } from "./chart.js";
2
- import { getBaseChartOptions as p } from "./chart.utils.js";
1
+ import { Chart as C, ChartActions as e, ChartContainer as a, ChartContent as o, ChartFullScreen as h, ChartHeader as A, ChartTitle as S } from "./chart.js";
2
+ import { getBaseChartOptions as _ } from "./chart.utils.js";
3
+ import { CHART_CANONICAL_CSS_VARS as l, CHART_PALETTE_CSS_VARS as s, CHART_PALETTE_SIZE as E, chartPaletteCssVar as R, resolveChartPalette as i } from "./chart-palette.js";
3
4
  export {
4
- a as Chart,
5
+ l as CHART_CANONICAL_CSS_VARS,
6
+ s as CHART_PALETTE_CSS_VARS,
7
+ E as CHART_PALETTE_SIZE,
8
+ C as Chart,
5
9
  e as ChartActions,
6
- C as ChartContainer,
7
- h as ChartContent,
8
- o as ChartFullScreen,
9
- n as ChartHeader,
10
- i as ChartTitle,
11
- p as getBaseChartOptions
10
+ a as ChartContainer,
11
+ o as ChartContent,
12
+ h as ChartFullScreen,
13
+ A as ChartHeader,
14
+ S as ChartTitle,
15
+ R as chartPaletteCssVar,
16
+ _ as getBaseChartOptions,
17
+ i as resolveChartPalette
12
18
  };
@@ -0,0 +1,3 @@
1
+ import { default as Highcharts } from 'highcharts';
2
+ /** Deep-resolve design-token color strings before passing options to Highcharts. */
3
+ export declare function resolveHighchartsOptions<T extends Highcharts.Options>(options: T, scope?: HTMLElement | null): T;
@@ -0,0 +1,35 @@
1
+ import { resolveDesignTokenColor as l } from "../../../lib/resolve-design-token-color.js";
2
+ const s = /* @__PURE__ */ new Set([
3
+ "color",
4
+ "fillColor",
5
+ "lineColor",
6
+ "borderColor",
7
+ "backgroundColor",
8
+ "upColor",
9
+ "upLineColor",
10
+ "minColor",
11
+ "maxColor",
12
+ "negativeColor",
13
+ "medianColor"
14
+ ]);
15
+ function C(o) {
16
+ return o === "colors" || o !== void 0 && s.has(o);
17
+ }
18
+ function t(o, r, i) {
19
+ if (typeof o == "string")
20
+ return C(i) ? l(o, r) : o;
21
+ if (Array.isArray(o))
22
+ return o.map((n) => t(n, r, i));
23
+ if (!o || typeof o != "object")
24
+ return o;
25
+ const e = {};
26
+ for (const [n, f] of Object.entries(o))
27
+ e[n] = t(f, r, n);
28
+ return e;
29
+ }
30
+ function d(o, r) {
31
+ return typeof document > "u" || !r ? o : t(o, r);
32
+ }
33
+ export {
34
+ d as resolveHighchartsOptions
35
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Fade a slice fill without shifting hue.
3
+ * Hex: legacy rgba(…, opacity) — unchanged visual for existing consumers.
4
+ * var(--color-*): color-mix — same apparent 40% wash on chart background.
5
+ */
6
+ export declare function fadeSliceColor(color: string, opacity?: number): string;
@@ -0,0 +1,19 @@
1
+ function c(a, n = 0.4) {
2
+ const t = a.trim();
3
+ if (t.startsWith("var(")) {
4
+ const r = Math.round(n * 100);
5
+ return `color-mix(in srgb, ${t} ${r}%, transparent)`;
6
+ }
7
+ if (t.startsWith("#")) {
8
+ let r = t.slice(1);
9
+ if (r.length === 3 && (r = r.split("").map((e) => e + e).join("")), r.length === 6) {
10
+ const e = Number.parseInt(r.slice(0, 2), 16), s = Number.parseInt(r.slice(2, 4), 16), i = Number.parseInt(r.slice(4, 6), 16);
11
+ if (!Number.isNaN(e) && !Number.isNaN(s) && !Number.isNaN(i))
12
+ return `rgba(${e}, ${s}, ${i}, ${n})`;
13
+ }
14
+ }
15
+ return t;
16
+ }
17
+ export {
18
+ c as fadeSliceColor
19
+ };
@@ -1,35 +1,37 @@
1
- import * as n from "react";
2
- import { statisticsTooltipFormatter as i, createStatisticsSliceClickHandler as d } from "./statistics-card.highcharts.js";
3
- const C = (t) => {
4
- const r = n.useMemo(
5
- () => t.reduce((o, a) => o + a.value, 0),
6
- [t]
7
- ), e = n.useMemo(
8
- () => t.reduce((o, a) => o + (a.checked ? a.value : 0), 0),
9
- [t]
10
- ), s = t.some((o) => o.checked);
11
- return { total: r, checkedTotal: e, hasChecked: s };
12
- }, b = (t, r = 0.4) => {
13
- const e = t.replace("#", ""), s = parseInt(e.substring(0, 2), 16), o = parseInt(e.substring(2, 4), 16), a = parseInt(e.substring(4, 6), 16);
14
- return `rgba(${s}, ${o}, ${a}, ${r})`;
15
- }, M = (t, r) => n.useMemo(
1
+ import * as a from "react";
2
+ import { fadeSliceColor as u } from "./statistics-card.color.js";
3
+ import { resolveDesignTokenColor as d } from "../../../lib/resolve-design-token-color.js";
4
+ import { statisticsTooltipFormatter as b, createStatisticsSliceClickHandler as p } from "./statistics-card.highcharts.js";
5
+ const k = (o) => {
6
+ const s = a.useMemo(
7
+ () => o.reduce((t, n) => t + n.value, 0),
8
+ [o]
9
+ ), e = a.useMemo(
10
+ () => o.reduce((t, n) => t + (n.checked ? n.value : 0), 0),
11
+ [o]
12
+ ), r = o.some((t) => t.checked);
13
+ return { total: s, checkedTotal: e, hasChecked: r };
14
+ }, v = (o, s) => a.useMemo(
16
15
  () => [
17
16
  {
18
17
  type: "pie",
19
18
  name: "Statistics",
20
19
  innerSize: "72%",
21
- data: t.map((e) => ({
22
- name: e.label,
23
- y: e.value,
24
- color: r ? e.checked ? e.borderColor : b(e.borderColor, 0.4) : e.borderColor
25
- }))
20
+ data: o.map((e) => {
21
+ const r = s ? e.checked ? e.borderColor : u(e.borderColor, 0.4) : e.borderColor, t = typeof document < "u" ? d(r) : r;
22
+ return {
23
+ name: e.label,
24
+ y: e.value,
25
+ color: t
26
+ };
27
+ })
26
28
  }
27
29
  ],
28
- [t, r]
29
- ), k = (t, r, e, s) => n.useMemo(
30
- () => t ?? String(r ? e : s),
31
- [t, r, e, s]
32
- ), p = () => n.useMemo(
30
+ [o, s]
31
+ ), M = (o, s, e, r) => a.useMemo(
32
+ () => o ?? String(s ? e : r),
33
+ [o, s, e, r]
34
+ ), S = () => a.useMemo(
33
35
  () => ({
34
36
  enabled: !0,
35
37
  useHTML: !0,
@@ -42,20 +44,20 @@ const C = (t) => {
42
44
  fontFamily: "Manrope, sans-serif",
43
45
  fontSize: "12px"
44
46
  },
45
- formatter: i
47
+ formatter: b
46
48
  }),
47
49
  []
48
- ), S = (t, r, e) => {
49
- const s = e?.borderWidth ?? 2, o = e?.borderColor ?? "var(--color-disabled-surface)", a = e?.borderRadius ?? 4, c = e?.enableHover ?? !0, l = e?.enableClick ?? !0, u = n.useMemo(
50
- () => d(t, r, l),
51
- [t, r, l]
50
+ ), C = (o, s, e) => {
51
+ const r = e?.borderWidth ?? 2, t = e?.borderColor ?? "var(--color-disabled-surface)", n = e?.borderRadius ?? 4, c = e?.enableHover ?? !0, l = e?.enableClick ?? !0, i = a.useMemo(
52
+ () => p(o, s, l),
53
+ [o, s, l]
52
54
  );
53
- return n.useMemo(
55
+ return a.useMemo(
54
56
  () => ({
55
57
  pie: {
56
- borderWidth: s,
57
- borderColor: o,
58
- borderRadius: a,
58
+ borderWidth: r,
59
+ borderColor: t,
60
+ borderRadius: n,
59
61
  dataLabels: { enabled: !1 },
60
62
  showInLegend: !1,
61
63
  allowPointSelect: !1,
@@ -63,32 +65,32 @@ const C = (t) => {
63
65
  states: { hover: { enabled: c, brightness: 0.05 } },
64
66
  point: {
65
67
  events: {
66
- click: u
68
+ click: i
67
69
  }
68
70
  }
69
71
  }
70
72
  }),
71
- [u, s, o, a, c]
73
+ [i, r, t, n, c]
72
74
  );
73
- }, v = (t, r, e) => {
74
- const s = p(), o = S(t, r, e);
75
- return n.useMemo(
75
+ }, y = (o, s, e) => {
76
+ const r = S(), t = C(o, s, e);
77
+ return a.useMemo(
76
78
  () => ({
77
79
  chart: {
78
80
  margin: [0, 0, 0, 0],
79
81
  spacing: [0, 0, 0, 0]
80
82
  },
81
- tooltip: s,
82
- plotOptions: o
83
+ tooltip: r,
84
+ plotOptions: t
83
85
  }),
84
- [s, o]
86
+ [r, t]
85
87
  );
86
88
  };
87
89
  export {
88
- C as useStatisticsChartData,
89
- k as useStatisticsChartLabel,
90
- v as useStatisticsChartOptions,
91
- S as useStatisticsChartPlotOptions,
92
- M as useStatisticsChartSeries,
93
- p as useStatisticsChartTooltip
90
+ k as useStatisticsChartData,
91
+ M as useStatisticsChartLabel,
92
+ y as useStatisticsChartOptions,
93
+ C as useStatisticsChartPlotOptions,
94
+ v as useStatisticsChartSeries,
95
+ S as useStatisticsChartTooltip
94
96
  };