impact-nova 2.1.0-alpha.7 → 2.1.0-alpha.9
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.
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +6 -0
- package/dist/components/data/ag-grid-react/build-ag-grid-theme.d.ts +3 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/input-cell-editor.js +58 -58
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.d.ts +9 -0
- package/dist/components/data/ag-grid-react/column-indicator-sync-bus.js +15 -0
- package/dist/components/data/ag-grid-react/headers/column-menu/column-settings-menu.js +78 -73
- package/dist/components/data/ag-grid-react/headers/custom-header.js +3 -1
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +87 -91
- package/dist/components/data/ag-grid-react/index.d.ts +1 -1
- package/dist/components/data/ag-grid-react/index.js +109 -100
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +3 -2
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +4 -3
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.d.ts +3 -0
- package/dist/components/data/ag-grid-react/sync-ag-grid-theme-mode.js +10 -0
- package/dist/components/data/ag-grid-react/theme.d.ts +1 -0
- package/dist/components/data/ag-grid-react/theme.js +93 -21
- package/dist/components/data/data-table/column-indicator.d.ts +1 -1
- package/dist/components/data/data-table/column-indicator.js +15 -11
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +9 -4
- package/dist/components/data/data-table/data-table-column-def-pin.js +38 -38
- package/dist/components/data/data-table/data-table-saved-views.js +37 -37
- package/dist/components/data/data-table/data-table.js +78 -73
- package/dist/components/data/data-table/data-table.types.d.ts +7 -1
- package/dist/components/data/data-table/indicator-legend.d.ts +13 -2
- package/dist/components/data/data-table/indicator-legend.js +20 -17
- package/dist/components/data/data-table/pin-switch.js +9 -9
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +92 -89
- package/dist/components/data/nested-list/nested-list-change-detection.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-change-detection.js +13 -0
- package/dist/components/data/nested-list/nested-list.js +107 -97
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +194 -189
- package/dist/components/data-display/chart/chart-palette.d.ts +16 -0
- package/dist/components/data-display/chart/chart-palette.js +28 -0
- package/dist/components/data-display/chart/chart.js +121 -115
- package/dist/components/data-display/chart/chart.utils.js +9 -6
- package/dist/components/data-display/chart/index.d.ts +1 -0
- package/dist/components/data-display/chart/index.js +15 -9
- package/dist/components/data-display/chart/resolve-highcharts-options.d.ts +3 -0
- package/dist/components/data-display/chart/resolve-highcharts-options.js +35 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.d.ts +6 -0
- package/dist/components/data-display/statistics-card/statistics-card.color.js +19 -0
- package/dist/components/data-display/statistics-card/statistics-card.hooks.js +50 -48
- package/dist/components/data-display/statistics-card/statistics-card.js +127 -146
- package/dist/components/feedback/alert-dialog/alert-dialog.js +15 -15
- package/dist/components/feedback/dialog/dialog.js +3 -3
- package/dist/components/feedback/drawer/drawer.js +32 -32
- package/dist/components/feedback/sheet/sheet.js +8 -8
- package/dist/components/feedback/sheet/sheet.variants.js +1 -1
- package/dist/components/feedback/toast/toast.js +83 -92
- package/dist/components/flows/command-palette/command-palette-context.types.d.ts +5 -0
- package/dist/components/flows/command-palette/command-palette.d.ts +4 -16
- package/dist/components/flows/command-palette/command-palette.js +245 -258
- package/dist/components/flows/command-palette/command-palette.types.d.ts +9 -0
- package/dist/components/flows/command-palette/shortcut-overlay.js +6 -6
- package/dist/components/flows/filter-panel/filter-panel.d.ts +3 -2
- package/dist/components/flows/filter-panel/filter-panel.js +99 -104
- package/dist/components/flows/filter-strip/filter-summary.js +41 -41
- package/dist/components/flows/filter-strip/filter-tag-list.js +48 -48
- package/dist/components/flows/wizard/wizard.js +32 -32
- package/dist/components/forms/choice-card/choice-card.d.ts +2 -2
- package/dist/components/forms/choice-card/choice-card.js +156 -166
- package/dist/components/forms/combobox/combobox.js +70 -70
- package/dist/components/forms/date-picker/date-picker.js +31 -30
- package/dist/components/forms/file-upload/file-upload.js +146 -168
- package/dist/components/forms/prompt/prompt.js +47 -48
- package/dist/components/forms/select/components/SelectAllRow.js +14 -14
- package/dist/components/forms/select/components/SelectMenuFooter.js +12 -12
- package/dist/components/forms/select/components/SelectMenuHeader.js +44 -44
- package/dist/components/forms/select/components/SelectMenuListBody.js +22 -22
- package/dist/components/forms/select/components/SelectMenuPanel.js +8 -8
- package/dist/components/forms/select/components/SelectOptionRow.js +62 -62
- package/dist/components/forms/select/select.d.ts +5 -4
- package/dist/components/forms/select/select.js +123 -120
- package/dist/components/forms/select/select.types.d.ts +95 -204
- package/dist/components/forms/slider/slider.js +17 -17
- package/dist/components/forms/smart-input/smart-input.js +49 -49
- package/dist/components/forms/textarea/textarea.js +25 -25
- package/dist/components/layout/breadcrumb/breadcrumb.js +112 -118
- package/dist/components/layout/header/header.d.ts +5 -17
- package/dist/components/layout/header/header.js +113 -116
- package/dist/components/layout/header/header.types.d.ts +3 -0
- package/dist/components/layout/sidebar/sidebar.js +5 -5
- package/dist/components/layout/sidebar/sidebar.variants.js +1 -1
- package/dist/components/primitives/accordion/accordion.js +38 -41
- package/dist/components/primitives/kbd/kbd.variants.js +1 -1
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +6 -4
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova-base.scss +8 -5
- package/dist/impact-nova-components.css +2 -2
- package/dist/impact-nova-tokens.scss +346 -189
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +505 -499
- package/dist/lib/resolve-design-token-color.d.ts +5 -0
- package/dist/lib/resolve-design-token-color.js +12 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/tailwind.config.js +297 -0
- package/dist/theme/tailwind-colors.js +199 -0
- package/dist/theme/tokens/chart-series-palette.json.d.ts +53 -0
- package/dist/theme/tokens/chart-series-palette.json.js +7 -0
- package/package.json +32 -259
- package/tailwind.config.js +0 -335
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Skeleton as
|
|
6
|
-
import { Collapse as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { getInitializedHighcharts as
|
|
9
|
-
import { getBaseChartOptions as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
},
|
|
17
|
-
({ className: n, children:
|
|
18
|
-
const a = t.useRef(null), o = t.useRef(null), [
|
|
19
|
-
|
|
20
|
-
|
|
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 && (
|
|
23
|
-
e.requestFullscreen ? e.requestFullscreen() : "webkitRequestFullscreen" in e ? e.webkitRequestFullscreen() : "msRequestFullscreen" in e && e.msRequestFullscreen(),
|
|
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
|
-
},
|
|
28
|
+
}, v = () => {
|
|
26
29
|
const e = a.current;
|
|
27
|
-
e && (
|
|
28
|
-
document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen(),
|
|
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
|
-
},
|
|
31
|
-
|
|
33
|
+
}, E = () => {
|
|
34
|
+
d ? v() : x();
|
|
32
35
|
};
|
|
33
36
|
return t.useEffect(() => {
|
|
34
37
|
const e = () => {
|
|
35
|
-
document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement ||
|
|
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
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
if (!
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
e.setSize(
|
|
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(
|
|
57
|
-
|
|
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",
|
|
61
|
-
|
|
63
|
+
return window.addEventListener("resize", L), () => {
|
|
64
|
+
i && cancelAnimationFrame(i), window.removeEventListener("resize", L);
|
|
62
65
|
};
|
|
63
|
-
}, [
|
|
64
|
-
|
|
66
|
+
}, [d]), /* @__PURE__ */ s(
|
|
67
|
+
S.Provider,
|
|
65
68
|
{
|
|
66
69
|
value: {
|
|
67
|
-
isExpanded:
|
|
68
|
-
toggleFullscreen:
|
|
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__ */
|
|
77
|
+
children: /* @__PURE__ */ s(
|
|
74
78
|
"div",
|
|
75
79
|
{
|
|
76
|
-
ref:
|
|
80
|
+
ref: w,
|
|
77
81
|
"data-component": "chart",
|
|
78
|
-
className:
|
|
82
|
+
className: f(
|
|
79
83
|
n,
|
|
80
84
|
"w-full relative bg-canvas-elevated transition-all duration-200 ease-in-out",
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
...
|
|
85
|
-
children:
|
|
88
|
+
...c,
|
|
89
|
+
children: r
|
|
86
90
|
}
|
|
87
91
|
)
|
|
88
92
|
}
|
|
89
93
|
);
|
|
90
94
|
}
|
|
91
95
|
);
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
({ className: n, children:
|
|
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
|
-
|
|
97
|
-
const
|
|
98
|
-
({ className: n, ...
|
|
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
|
-
|
|
101
|
-
const
|
|
102
|
-
({ className: n, ...
|
|
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
|
-
|
|
105
|
-
const
|
|
106
|
-
({ className: n, ...
|
|
107
|
-
const { t:
|
|
108
|
-
return /* @__PURE__ */
|
|
109
|
-
|
|
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:
|
|
117
|
+
onClick: u,
|
|
114
118
|
ref: l,
|
|
115
|
-
className:
|
|
119
|
+
className: f("h-8 w-8", n),
|
|
116
120
|
"aria-label": o,
|
|
117
|
-
...
|
|
121
|
+
...r,
|
|
118
122
|
children: [
|
|
119
|
-
a ? /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
127
|
-
const
|
|
128
|
-
({ className: n, children:
|
|
129
|
-
const { isLoading: a, chartComponentRef: o, isExpanded:
|
|
130
|
-
return a && l ? /* @__PURE__ */
|
|
131
|
-
a && /* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
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(
|
|
139
|
+
t.Children.map(r, (h) => t.isValidElement(h) ? t.cloneElement(h, { ref: o }) : h)
|
|
136
140
|
] });
|
|
137
141
|
}
|
|
138
142
|
);
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
(n,
|
|
143
|
+
I.displayName = "ChartContent";
|
|
144
|
+
const K = t.forwardRef(
|
|
145
|
+
(n, r) => {
|
|
142
146
|
const {
|
|
143
147
|
height: l,
|
|
144
|
-
width:
|
|
145
|
-
className:
|
|
148
|
+
width: c,
|
|
149
|
+
className: u,
|
|
146
150
|
isLoading: a,
|
|
147
151
|
loader: o,
|
|
148
|
-
title:
|
|
149
|
-
noWrapper:
|
|
150
|
-
children:
|
|
151
|
-
...
|
|
152
|
-
} = n,
|
|
153
|
-
|
|
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
|
-
...
|
|
161
|
+
...i,
|
|
156
162
|
chart: {
|
|
157
|
-
...
|
|
163
|
+
...i.chart,
|
|
158
164
|
height: l ?? null,
|
|
159
|
-
width:
|
|
165
|
+
width: c ?? null
|
|
160
166
|
}
|
|
161
167
|
};
|
|
162
|
-
}, [
|
|
163
|
-
return
|
|
164
|
-
|
|
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:
|
|
167
|
-
options:
|
|
168
|
-
ref:
|
|
172
|
+
highcharts: R,
|
|
173
|
+
options: e,
|
|
174
|
+
ref: r,
|
|
169
175
|
containerProps: { style: { height: "100%", width: "100%" } }
|
|
170
176
|
}
|
|
171
|
-
) :
|
|
172
|
-
|
|
177
|
+
) }) : g ? /* @__PURE__ */ s(
|
|
178
|
+
N,
|
|
173
179
|
{
|
|
174
|
-
highcharts:
|
|
175
|
-
options:
|
|
176
|
-
ref:
|
|
180
|
+
highcharts: R,
|
|
181
|
+
options: e,
|
|
182
|
+
ref: r,
|
|
177
183
|
containerProps: { style: { height: "100%", width: "100%" } }
|
|
178
184
|
}
|
|
179
|
-
) : /* @__PURE__ */
|
|
180
|
-
|
|
185
|
+
) : /* @__PURE__ */ s(H, { className: u, isLoading: a, children: /* @__PURE__ */ s(I, { loader: o, children: /* @__PURE__ */ s(
|
|
186
|
+
N,
|
|
181
187
|
{
|
|
182
|
-
highcharts:
|
|
183
|
-
options:
|
|
184
|
-
ref:
|
|
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
|
-
|
|
196
|
+
K.displayName = "Chart";
|
|
191
197
|
export {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
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:
|
|
6
|
-
xAxisCategories:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
200
|
+
u as getBaseChartOptions
|
|
198
201
|
};
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { Chart as
|
|
2
|
-
import { getBaseChartOptions as
|
|
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
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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,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
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
[
|
|
29
|
-
),
|
|
30
|
-
() =>
|
|
31
|
-
[
|
|
32
|
-
),
|
|
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:
|
|
47
|
+
formatter: b
|
|
46
48
|
}),
|
|
47
49
|
[]
|
|
48
|
-
),
|
|
49
|
-
const
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
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
|
|
55
|
+
return a.useMemo(
|
|
54
56
|
() => ({
|
|
55
57
|
pie: {
|
|
56
|
-
borderWidth:
|
|
57
|
-
borderColor:
|
|
58
|
-
borderRadius:
|
|
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:
|
|
68
|
+
click: i
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
}),
|
|
71
|
-
[
|
|
73
|
+
[i, r, t, n, c]
|
|
72
74
|
);
|
|
73
|
-
},
|
|
74
|
-
const
|
|
75
|
-
return
|
|
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:
|
|
82
|
-
plotOptions:
|
|
83
|
+
tooltip: r,
|
|
84
|
+
plotOptions: t
|
|
83
85
|
}),
|
|
84
|
-
[
|
|
86
|
+
[r, t]
|
|
85
87
|
);
|
|
86
88
|
};
|
|
87
89
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
};
|