@hybridcore/ui 1.6.6 → 1.6.7
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/charts/_common/format.js +29 -23
- package/dist/components/charts/chart-wrapper/helpers.js +46 -21
- package/dist/components/charts/chart-wrapper/logic.js +57 -40
- package/dist/components/charts/column-line-mix/logic.js +71 -70
- package/dist/components/charts/line/logic.js +201 -103
- package/dist/components/charts/multiple-value-axes/logic.js +77 -76
- package/dist/components/charts/stacked-area-radar/logic.js +58 -57
- package/dist/components/charts/stacked-column-chart/logic.js +45 -44
- package/dist/components/charts/xy-chart/logic.js +76 -70
- package/dist/components/metric-card/index.js +58 -54
- package/dist/components/metric-card/logic.js +62 -53
- package/dist/components/metric-card/styled.js +53 -43
- package/dist/components/simple-pivot-table/index.js +13 -13
- package/dist/main.d.ts +27 -4
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { styled as
|
|
1
|
+
import { styled as i, alpha as C, Stack as g, Typography as d } from "@mui/material";
|
|
2
2
|
import { Widget as f } from "../widget/styled.js";
|
|
3
|
-
import { variantColor as
|
|
3
|
+
import { variantColor as s, resolvePaletteColor as p, trendColor as u } from "./helpers.js";
|
|
4
4
|
const e = {
|
|
5
5
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
6
|
-
}, v =
|
|
6
|
+
}, v = i(f.Root, {
|
|
7
7
|
name: "HCMetricCard",
|
|
8
8
|
slot: "Root",
|
|
9
9
|
...e
|
|
10
|
-
})(({ theme: o, ownerState:
|
|
11
|
-
const
|
|
10
|
+
})(({ theme: o, ownerState: n }) => {
|
|
11
|
+
const t = s(o, n.variant), a = n.layout === "panel";
|
|
12
12
|
let r;
|
|
13
|
-
return
|
|
13
|
+
return t ? r = C(t, 0.05) : a && (r = o.palette.background.default), {
|
|
14
14
|
position: "relative",
|
|
15
15
|
overflow: "hidden",
|
|
16
16
|
padding: o.spacing(1.5, 2),
|
|
@@ -19,7 +19,7 @@ const e = {
|
|
|
19
19
|
padding: o.spacing(1.5)
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
}), y =
|
|
22
|
+
}), y = i(g, {
|
|
23
23
|
name: "HCMetricCard",
|
|
24
24
|
slot: "Content"
|
|
25
25
|
})(() => ({
|
|
@@ -27,46 +27,55 @@ const e = {
|
|
|
27
27
|
width: "100%",
|
|
28
28
|
minWidth: 0,
|
|
29
29
|
zIndex: 1
|
|
30
|
-
})), m =
|
|
30
|
+
})), m = i(d, {
|
|
31
31
|
name: "HCMetricCard",
|
|
32
32
|
slot: "Label"
|
|
33
33
|
})(({ theme: o }) => ({
|
|
34
34
|
color: o.palette.text.secondary,
|
|
35
35
|
marginBottom: o.spacing(0.5),
|
|
36
36
|
fontWeight: 500
|
|
37
|
-
})), k =
|
|
37
|
+
})), k = i(d, {
|
|
38
38
|
name: "HCMetricCard",
|
|
39
39
|
slot: "Value",
|
|
40
40
|
...e
|
|
41
|
-
})(({ theme: o, ownerState:
|
|
42
|
-
const
|
|
41
|
+
})(({ theme: o, ownerState: n }) => {
|
|
42
|
+
const t = p(o, n.calculatedValueColor), a = p(o, n.calculatedValueBg);
|
|
43
43
|
return {
|
|
44
|
-
color:
|
|
44
|
+
color: t ?? s(o, n.variant) ?? o.palette.text.primary,
|
|
45
45
|
fontWeight: 500,
|
|
46
46
|
marginBottom: o.spacing(0.5),
|
|
47
47
|
whiteSpace: "nowrap",
|
|
48
|
-
...
|
|
49
|
-
backgroundColor:
|
|
48
|
+
...a && {
|
|
49
|
+
backgroundColor: a,
|
|
50
50
|
borderRadius: o.shape.borderRadius,
|
|
51
51
|
padding: o.spacing(0, 0.75)
|
|
52
52
|
},
|
|
53
53
|
[o.breakpoints.down("md")]: { fontSize: "1.35rem" },
|
|
54
54
|
[o.breakpoints.up("md")]: { fontSize: "2rem" }
|
|
55
55
|
};
|
|
56
|
-
}),
|
|
56
|
+
}), w = i(d, {
|
|
57
|
+
name: "HCMetricCard",
|
|
58
|
+
slot: "SecondValue"
|
|
59
|
+
})(({ theme: o }) => ({
|
|
60
|
+
color: o.palette.text.secondary,
|
|
61
|
+
fontWeight: 400,
|
|
62
|
+
whiteSpace: "nowrap",
|
|
63
|
+
[o.breakpoints.down("md")]: { fontSize: "0.95rem" },
|
|
64
|
+
[o.breakpoints.up("md")]: { fontSize: "1.25rem" }
|
|
65
|
+
})), H = i("div", {
|
|
57
66
|
name: "HCMetricCard",
|
|
58
67
|
slot: "TrendContainer",
|
|
59
68
|
...e
|
|
60
|
-
})(({ theme: o, ownerState:
|
|
61
|
-
const
|
|
69
|
+
})(({ theme: o, ownerState: n }) => {
|
|
70
|
+
const t = u(o, n.calculatedTrend), a = n.layout === "panel";
|
|
62
71
|
return {
|
|
63
72
|
display: "inline-flex",
|
|
64
73
|
alignItems: "center",
|
|
65
74
|
gap: o.spacing(0.5),
|
|
66
75
|
fontWeight: 500,
|
|
67
|
-
color:
|
|
68
|
-
...
|
|
69
|
-
backgroundColor: C(
|
|
76
|
+
color: t,
|
|
77
|
+
...a ? {
|
|
78
|
+
backgroundColor: C(t, 0.14),
|
|
70
79
|
borderRadius: 999,
|
|
71
80
|
padding: o.spacing(0.25, 1),
|
|
72
81
|
fontSize: "0.8125rem",
|
|
@@ -79,7 +88,7 @@ const e = {
|
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
90
|
};
|
|
82
|
-
}),
|
|
91
|
+
}), I = i(d, {
|
|
83
92
|
name: "HCMetricCard",
|
|
84
93
|
slot: "Description"
|
|
85
94
|
})(({ theme: o }) => ({
|
|
@@ -87,37 +96,37 @@ const e = {
|
|
|
87
96
|
display: "block",
|
|
88
97
|
position: "relative",
|
|
89
98
|
zIndex: 1
|
|
90
|
-
})),
|
|
99
|
+
})), S = i("div", {
|
|
91
100
|
name: "HCMetricCard",
|
|
92
101
|
slot: "Icon",
|
|
93
102
|
...e
|
|
94
|
-
})(({ theme: o, ownerState:
|
|
103
|
+
})(({ theme: o, ownerState: n }) => ({
|
|
95
104
|
display: "flex",
|
|
96
105
|
alignItems: "center",
|
|
97
106
|
justifyContent: "center",
|
|
98
|
-
color:
|
|
99
|
-
marginRight:
|
|
100
|
-
marginLeft:
|
|
107
|
+
color: s(o, n.variant) ?? o.palette.text.secondary,
|
|
108
|
+
marginRight: n.iconPosition === "left" ? o.spacing(2) : 0,
|
|
109
|
+
marginLeft: n.iconPosition === "right" ? o.spacing(2) : 0,
|
|
101
110
|
[o.breakpoints.down("sm")]: {
|
|
102
111
|
position: "absolute",
|
|
103
112
|
top: o.spacing(2),
|
|
104
113
|
left: o.spacing(2),
|
|
105
114
|
margin: 0
|
|
106
115
|
}
|
|
107
|
-
})),
|
|
116
|
+
})), z = i("div", {
|
|
108
117
|
name: "HCMetricCard",
|
|
109
118
|
slot: "CornerIcon",
|
|
110
119
|
...e
|
|
111
|
-
})(({ theme: o, ownerState:
|
|
112
|
-
var
|
|
113
|
-
const
|
|
114
|
-
return
|
|
120
|
+
})(({ theme: o, ownerState: n }) => {
|
|
121
|
+
var c, l;
|
|
122
|
+
const t = {}, a = (c = n.iconPosition) != null && c.startsWith("top") ? "top" : "bottom", r = (l = n.iconPosition) != null && l.endsWith("left") ? "left" : "right";
|
|
123
|
+
return t[a] = o.spacing(2), t[r] = o.spacing(2), {
|
|
115
124
|
position: "absolute",
|
|
116
|
-
...
|
|
117
|
-
color:
|
|
125
|
+
...t,
|
|
126
|
+
color: s(o, n.variant) ?? o.palette.text.secondary,
|
|
118
127
|
zIndex: 2
|
|
119
128
|
};
|
|
120
|
-
}),
|
|
129
|
+
}), P = i("div", {
|
|
121
130
|
name: "HCMetricCard",
|
|
122
131
|
slot: "Chart"
|
|
123
132
|
})(({ theme: o }) => ({
|
|
@@ -130,7 +139,7 @@ const e = {
|
|
|
130
139
|
alignItems: "flex-end",
|
|
131
140
|
overflow: "hidden",
|
|
132
141
|
borderRadius: o.shape.borderRadius
|
|
133
|
-
})),
|
|
142
|
+
})), R = i("div", {
|
|
134
143
|
name: "HCMetricCard",
|
|
135
144
|
slot: "Panel"
|
|
136
145
|
})(({ theme: o }) => ({
|
|
@@ -147,7 +156,7 @@ const e = {
|
|
|
147
156
|
backgroundColor: o.palette.background.paper,
|
|
148
157
|
boxShadow: o.shadows[1],
|
|
149
158
|
overflow: "hidden"
|
|
150
|
-
})),
|
|
159
|
+
})), W = i("div", {
|
|
151
160
|
name: "HCMetricCard",
|
|
152
161
|
slot: "SideChart"
|
|
153
162
|
})(() => ({
|
|
@@ -160,15 +169,16 @@ const e = {
|
|
|
160
169
|
alignItems: "flex-end"
|
|
161
170
|
}));
|
|
162
171
|
export {
|
|
163
|
-
|
|
172
|
+
P as MetricCardChartContainer,
|
|
164
173
|
y as MetricCardContent,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
174
|
+
z as MetricCardCornerIconContainer,
|
|
175
|
+
I as MetricCardDescription,
|
|
176
|
+
S as MetricCardIconContainer,
|
|
168
177
|
m as MetricCardLabel,
|
|
169
|
-
|
|
178
|
+
R as MetricCardPanel,
|
|
170
179
|
v as MetricCardRoot,
|
|
171
|
-
|
|
172
|
-
|
|
180
|
+
w as MetricCardSecondValue,
|
|
181
|
+
W as MetricCardSideChart,
|
|
182
|
+
H as MetricCardTrendContainer,
|
|
173
183
|
k as MetricCardValue
|
|
174
184
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Typography as i, Divider as f, TableContainer as I, Table as R, TableHead as j, TableRow as g, TableCell as r, TableBody as w, Box as D, IconButton as G } from "@mui/material";
|
|
3
3
|
import { useSimplePivotTableLogic as J } from "./logic.js";
|
|
4
4
|
import { SimplePivotTableRoot as M, SimplePivotTableHeader as O, SimplePivotTableContent as V, SimplePivotTableFooter as X, SimplePivotTableScrollHint as q } from "./styled.js";
|
|
@@ -19,7 +19,7 @@ const Z = (s) => {
|
|
|
19
19
|
formatDimensionValue: y,
|
|
20
20
|
formatCell: C,
|
|
21
21
|
getCellStyle: F,
|
|
22
|
-
ownerState:
|
|
22
|
+
ownerState: o,
|
|
23
23
|
scrollRef: N,
|
|
24
24
|
canScroll: k,
|
|
25
25
|
scrollModifierLabel: P,
|
|
@@ -33,18 +33,18 @@ const Z = (s) => {
|
|
|
33
33
|
data: h,
|
|
34
34
|
summaries: v
|
|
35
35
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ t(
|
|
37
37
|
M,
|
|
38
38
|
{
|
|
39
|
-
ownerState:
|
|
39
|
+
ownerState: o,
|
|
40
40
|
sx: H,
|
|
41
41
|
"data-snapshot": JSON.stringify(W),
|
|
42
42
|
...L,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */ e(O, { ownerState:
|
|
44
|
+
/* @__PURE__ */ e(O, { ownerState: o, children: /* @__PURE__ */ e(i, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
|
|
45
45
|
/* @__PURE__ */ e(f, {}),
|
|
46
|
-
/* @__PURE__ */ e(V, { ownerState:
|
|
47
|
-
/* @__PURE__ */ e(j, { children: /* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ e(V, { ownerState: o, children: /* @__PURE__ */ e(I, { ref: N, children: /* @__PURE__ */ t(R, { size: "small", stickyHeader: !0, children: [
|
|
47
|
+
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ t(g, { children: [
|
|
48
48
|
n.map((l) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: x(l) }) }, l.value)),
|
|
49
49
|
c.map((l) => /* @__PURE__ */ e(
|
|
50
50
|
r,
|
|
@@ -62,7 +62,7 @@ const Z = (s) => {
|
|
|
62
62
|
l.dataFieldName
|
|
63
63
|
))
|
|
64
64
|
] }) }),
|
|
65
|
-
/* @__PURE__ */ e(w, { children: h.map((l, z) => /* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ e(w, { children: h.map((l, z) => /* @__PURE__ */ t(
|
|
66
66
|
g,
|
|
67
67
|
{
|
|
68
68
|
hover: !0,
|
|
@@ -90,7 +90,7 @@ const Z = (s) => {
|
|
|
90
90
|
{
|
|
91
91
|
variant: "body2",
|
|
92
92
|
fontWeight: 500,
|
|
93
|
-
color: u.color ?? "primary
|
|
93
|
+
color: u.color ?? "text.primary",
|
|
94
94
|
children: C(l[a.dataFieldName], a.format)
|
|
95
95
|
}
|
|
96
96
|
)
|
|
@@ -104,13 +104,13 @@ const Z = (s) => {
|
|
|
104
104
|
)) })
|
|
105
105
|
] }) }) }),
|
|
106
106
|
/* @__PURE__ */ e(f, {}),
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
k && /* @__PURE__ */ e(q, { ownerState:
|
|
107
|
+
/* @__PURE__ */ t(X, { ownerState: o, children: [
|
|
108
|
+
k && /* @__PURE__ */ e(q, { ownerState: o, children: /* @__PURE__ */ t(i, { variant: "caption", children: [
|
|
109
109
|
"Hold ",
|
|
110
110
|
P,
|
|
111
111
|
" to scroll"
|
|
112
112
|
] }) }),
|
|
113
|
-
d ? /* @__PURE__ */
|
|
113
|
+
d ? /* @__PURE__ */ t(
|
|
114
114
|
D,
|
|
115
115
|
{
|
|
116
116
|
sx: {
|
|
@@ -122,7 +122,7 @@ const Z = (s) => {
|
|
|
122
122
|
},
|
|
123
123
|
children: [
|
|
124
124
|
/* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: d.name }),
|
|
125
|
-
d.items.map((l) => /* @__PURE__ */
|
|
125
|
+
d.items.map((l) => /* @__PURE__ */ t(i, { variant: "caption", color: "text.secondary", children: [
|
|
126
126
|
l.label,
|
|
127
127
|
": ",
|
|
128
128
|
l.value
|
package/dist/main.d.ts
CHANGED
|
@@ -260,6 +260,15 @@ export declare interface ChartProps {
|
|
|
260
260
|
* a custom theme to override per-deployment.
|
|
261
261
|
*/
|
|
262
262
|
colors?: readonly string[];
|
|
263
|
+
/**
|
|
264
|
+
* Controls whether a line series bridges gaps in the data. When `true` (the
|
|
265
|
+
* default) the line is drawn continuously across missing points. When `false`,
|
|
266
|
+
* the line breaks wherever data is missing — on a date axis a gap is detected
|
|
267
|
+
* when the spacing between adjacent points exceeds the base interval, so
|
|
268
|
+
* absent dates become visible breaks instead of a straight fill. Line-type
|
|
269
|
+
* charts only.
|
|
270
|
+
*/
|
|
271
|
+
connectMissingData?: boolean;
|
|
263
272
|
sx?: SxProps<Theme>;
|
|
264
273
|
}
|
|
265
274
|
|
|
@@ -1191,6 +1200,12 @@ export declare interface MetricCardDataPoint {
|
|
|
1191
1200
|
export declare interface MetricCardProps {
|
|
1192
1201
|
label: string;
|
|
1193
1202
|
value: MetricCardDataPoint[];
|
|
1203
|
+
// Optional denominator series rendered as a muted "value / secondValue" pair.
|
|
1204
|
+
// Like `value`, only the latest point is shown; it never picks up conditional
|
|
1205
|
+
// coloring. Formatted by `secondValueFormat` when set, else falls back to
|
|
1206
|
+
// `format` (so a "/ " separator can be carried as `secondValueFormat.prefix`).
|
|
1207
|
+
secondValue?: MetricCardDataPoint[];
|
|
1208
|
+
secondValueFormat?: ValueFormat;
|
|
1194
1209
|
description?: string;
|
|
1195
1210
|
variant?: MetricVariant;
|
|
1196
1211
|
loading?: boolean;
|
|
@@ -1634,9 +1649,11 @@ export declare type RelativeDatePreset =
|
|
|
1634
1649
|
export declare const removeNotification: (id: string) => void;
|
|
1635
1650
|
|
|
1636
1651
|
/**
|
|
1637
|
-
* Resolve
|
|
1638
|
-
*
|
|
1639
|
-
*
|
|
1652
|
+
* Resolve a value's text/background color: the format's base `color`/
|
|
1653
|
+
* `backgroundColor` apply unconditionally, then the first matching conditional
|
|
1654
|
+
* rule overrides them per-field (a rule that only sets one color keeps the base
|
|
1655
|
+
* for the other). Returns an empty object when nothing is configured, so callers
|
|
1656
|
+
* can spread it safely.
|
|
1640
1657
|
*/
|
|
1641
1658
|
export declare const resolveConditionalStyle: (value: unknown, format?: ValueFormat) => {
|
|
1642
1659
|
color?: string;
|
|
@@ -2176,7 +2193,12 @@ export declare interface ValueFormat {
|
|
|
2176
2193
|
suffix?: string;
|
|
2177
2194
|
/** Fixed number of fraction digits; defaults to "up to 2" when unset. */
|
|
2178
2195
|
decimals?: number;
|
|
2179
|
-
/**
|
|
2196
|
+
/** Base text color applied unconditionally (theme token path or CSS color). A
|
|
2197
|
+
* matching `conditionalRules` entry overrides it. */
|
|
2198
|
+
color?: string;
|
|
2199
|
+
/** Base background color applied unconditionally. A matching rule overrides it. */
|
|
2200
|
+
backgroundColor?: string;
|
|
2201
|
+
/** First matching rule wins; its colors override the base `color`/`backgroundColor`. */
|
|
2180
2202
|
conditionalRules?: ConditionalRule[];
|
|
2181
2203
|
}
|
|
2182
2204
|
|
|
@@ -3321,6 +3343,7 @@ declare module "@mui/material/styles" {
|
|
|
3321
3343
|
| "content"
|
|
3322
3344
|
| "label"
|
|
3323
3345
|
| "value"
|
|
3346
|
+
| "secondValue"
|
|
3324
3347
|
| "trendContainer"
|
|
3325
3348
|
| "description"
|
|
3326
3349
|
| "icon"
|