@hybridcore/ui 1.6.5 → 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/IconX-C2wmVYSK.js +11 -0
- package/dist/components/charts/_common/format.js +55 -0
- package/dist/components/charts/_common/utils.js +12 -7
- 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 +87 -86
- package/dist/components/charts/donut-chart/logic.js +37 -36
- package/dist/components/charts/drill-down-treemap/logic.js +123 -123
- package/dist/components/charts/drill-down-voronoi-treemap/logic.js +253 -252
- package/dist/components/charts/heatmap/logic.js +73 -73
- package/dist/components/charts/line/logic.js +201 -103
- package/dist/components/charts/logaritmic-scale/logic.js +65 -65
- package/dist/components/charts/multiple-value-axes/logic.js +96 -94
- package/dist/components/charts/nested-pie/logic.js +43 -42
- package/dist/components/charts/packed-circles/logic.js +111 -110
- package/dist/components/charts/pie-chart/logic.js +40 -39
- package/dist/components/charts/stacked-area-radar/logic.js +68 -67
- package/dist/components/charts/stacked-column-chart/logic.js +71 -70
- package/dist/components/charts/xy-chart/logic.js +82 -76
- package/dist/components/color-picker/index.js +1645 -1602
- package/dist/components/color-picker/logic.js +21 -12
- package/dist/components/color-picker/styled.js +4 -2
- package/dist/components/date-range-picker/index.js +359 -365
- package/dist/components/metric-card/helpers.js +12 -5
- package/dist/components/metric-card/index.js +58 -54
- package/dist/components/metric-card/logic.js +78 -61
- package/dist/components/metric-card/styled.js +63 -45
- package/dist/components/simple-pivot-table/index.js +129 -54
- package/dist/components/simple-pivot-table/logic.js +111 -45
- package/dist/components/simple-pivot-table/styled.js +31 -11
- package/dist/main.d.ts +125 -8
- package/dist/main.js +145 -141
- package/dist/{styled-Db1RdcPA.js → styled-SoqbyrkW.js} +116 -89
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
switch (
|
|
1
|
+
const n = (r, t = "default") => {
|
|
2
|
+
switch (t) {
|
|
3
3
|
case "primary":
|
|
4
4
|
return r.palette.primary.main;
|
|
5
5
|
case "success":
|
|
@@ -11,8 +11,15 @@ const e = (r, a = "default") => {
|
|
|
11
11
|
default:
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, o = (r, t) => {
|
|
15
|
+
if (!t) return;
|
|
16
|
+
let e = r.palette;
|
|
17
|
+
for (const a of t.split("."))
|
|
18
|
+
e = e && typeof e == "object" ? e[a] : void 0;
|
|
19
|
+
return typeof e == "string" ? e : t;
|
|
20
|
+
}, s = (r, t) => t === "up" ? r.palette.success.main : t === "down" ? r.palette.error.main : r.palette.text.secondary;
|
|
15
21
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
o as resolvePaletteColor,
|
|
23
|
+
s as trendColor,
|
|
24
|
+
n as variantColor
|
|
18
25
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { MetricChart as
|
|
4
|
-
import { useMetricCardLogic as
|
|
5
|
-
import { MetricCardRoot as
|
|
6
|
-
const
|
|
7
|
-
const { state:
|
|
1
|
+
import { jsx as e, jsxs as n, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as r, Skeleton as c } from "@mui/material";
|
|
3
|
+
import { MetricChart as x } from "./MetricChart.js";
|
|
4
|
+
import { useMetricCardLogic as j } from "./logic.js";
|
|
5
|
+
import { MetricCardRoot as m, MetricCardValue as z, MetricCardSecondValue as V, MetricCardTrendContainer as k, MetricCardLabel as w, MetricCardPanel as P, MetricCardDescription as f, MetricCardSideChart as L, MetricCardCornerIconContainer as A, MetricCardIconContainer as v, MetricCardContent as D, MetricCardChartContainer as F } from "./styled.js";
|
|
6
|
+
const G = (t) => {
|
|
7
|
+
const { state: M } = j(t), {
|
|
8
8
|
ownerState: i,
|
|
9
9
|
layout: d,
|
|
10
|
-
calculatedValue:
|
|
10
|
+
calculatedValue: y,
|
|
11
|
+
calculatedSecondValue: l,
|
|
11
12
|
calculatedChange: h,
|
|
12
|
-
TrendIcon:
|
|
13
|
-
Icon:
|
|
13
|
+
TrendIcon: S,
|
|
14
|
+
Icon: a,
|
|
14
15
|
showCornerIcon: I,
|
|
15
|
-
showSideIcon:
|
|
16
|
-
iconPosition:
|
|
17
|
-
snapshotPayload:
|
|
18
|
-
} =
|
|
19
|
-
if (
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
16
|
+
showSideIcon: o,
|
|
17
|
+
iconPosition: s,
|
|
18
|
+
snapshotPayload: b
|
|
19
|
+
} = M, C = !!t.showChart && !!t.chartType && (t.value ?? []).length >= 2, T = (t.showChange || t.showTrend) && h !== "—";
|
|
20
|
+
if (t.loading)
|
|
21
|
+
return /* @__PURE__ */ e(m, { ownerState: i, sx: t.sx, children: /* @__PURE__ */ n(r, { spacing: 1, children: [
|
|
22
|
+
/* @__PURE__ */ e(c, { variant: "text", width: "60%" }),
|
|
23
|
+
/* @__PURE__ */ e(c, { variant: "rectangular", height: 40, width: "40%" }),
|
|
24
|
+
/* @__PURE__ */ e(c, { variant: "text", width: "80%" }),
|
|
25
|
+
t.showChart && /* @__PURE__ */ e(
|
|
25
26
|
c,
|
|
26
27
|
{
|
|
27
28
|
variant: "rectangular",
|
|
@@ -31,80 +32,83 @@ const B = (e) => {
|
|
|
31
32
|
}
|
|
32
33
|
)
|
|
33
34
|
] }) });
|
|
34
|
-
const
|
|
35
|
-
|
|
35
|
+
const g = /* @__PURE__ */ n(
|
|
36
|
+
r,
|
|
36
37
|
{
|
|
37
38
|
direction: "row",
|
|
38
39
|
alignItems: "center",
|
|
39
40
|
spacing: 1,
|
|
40
41
|
flexWrap: d === "panel" ? "nowrap" : "wrap",
|
|
41
42
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/* @__PURE__ */ n(r, { direction: "row", alignItems: "baseline", spacing: 0.5, children: [
|
|
44
|
+
/* @__PURE__ */ e(z, { variant: "h4", ownerState: i, children: y }),
|
|
45
|
+
l && /* @__PURE__ */ e(V, { variant: "h5", children: l })
|
|
46
|
+
] }),
|
|
47
|
+
T && /* @__PURE__ */ n(k, { ownerState: i, children: [
|
|
48
|
+
d === "overlay" && t.showTrend && /* @__PURE__ */ e(S, { size: 16 }),
|
|
49
|
+
t.showChange && h
|
|
46
50
|
] })
|
|
47
51
|
]
|
|
48
52
|
}
|
|
49
53
|
);
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
54
|
+
return /* @__PURE__ */ e(
|
|
55
|
+
m,
|
|
52
56
|
{
|
|
53
57
|
ownerState: i,
|
|
54
|
-
sx:
|
|
55
|
-
"data-snapshot":
|
|
56
|
-
children: d === "panel" ? /* @__PURE__ */ n(
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */ n(
|
|
59
|
-
/* @__PURE__ */ n(
|
|
60
|
-
C,
|
|
61
|
-
e.description && /* @__PURE__ */ t(w, { variant: "caption", children: e.description })
|
|
62
|
-
] }),
|
|
63
|
-
s && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(
|
|
58
|
+
sx: t.sx,
|
|
59
|
+
"data-snapshot": b,
|
|
60
|
+
children: d === "panel" ? /* @__PURE__ */ n(u, { children: [
|
|
61
|
+
/* @__PURE__ */ e(w, { variant: "body2", children: t.label }),
|
|
62
|
+
/* @__PURE__ */ n(P, { children: [
|
|
63
|
+
/* @__PURE__ */ n(r, { justifyContent: "center", spacing: 0.5, sx: { flexShrink: 0 }, children: [
|
|
64
64
|
g,
|
|
65
|
+
t.description && /* @__PURE__ */ e(f, { variant: "caption", children: t.description })
|
|
66
|
+
] }),
|
|
67
|
+
C && /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
|
|
68
|
+
x,
|
|
65
69
|
{
|
|
66
|
-
type:
|
|
67
|
-
data:
|
|
70
|
+
type: t.chartType,
|
|
71
|
+
data: t.value,
|
|
68
72
|
inset: !0,
|
|
69
73
|
gradient: !0
|
|
70
74
|
}
|
|
71
75
|
) })
|
|
72
76
|
] })
|
|
73
|
-
] }) : /* @__PURE__ */ n(
|
|
74
|
-
I &&
|
|
77
|
+
] }) : /* @__PURE__ */ n(u, { children: [
|
|
78
|
+
I && a && /* @__PURE__ */ e(A, { ownerState: i, children: /* @__PURE__ */ e(a, { size: 24 }) }),
|
|
75
79
|
/* @__PURE__ */ n(
|
|
76
|
-
|
|
80
|
+
r,
|
|
77
81
|
{
|
|
78
82
|
direction: "row",
|
|
79
83
|
justifyContent: "space-between",
|
|
80
84
|
alignItems: "flex-start",
|
|
81
85
|
sx: { flex: 1 },
|
|
82
86
|
children: [
|
|
83
|
-
|
|
84
|
-
/* @__PURE__ */ n(
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
+
o && a && s === "left" && /* @__PURE__ */ e(v, { ownerState: i, children: /* @__PURE__ */ e(a, { sx: { fontSize: 24 } }) }),
|
|
88
|
+
/* @__PURE__ */ n(D, { children: [
|
|
89
|
+
/* @__PURE__ */ e(w, { variant: "body2", children: t.label }),
|
|
90
|
+
g
|
|
87
91
|
] }),
|
|
88
|
-
|
|
92
|
+
o && a && s === "right" && /* @__PURE__ */ e(v, { ownerState: i, children: /* @__PURE__ */ e(a, { sx: { fontSize: 24 } }) })
|
|
89
93
|
]
|
|
90
94
|
}
|
|
91
95
|
),
|
|
92
96
|
/* @__PURE__ */ n(
|
|
93
|
-
|
|
97
|
+
r,
|
|
94
98
|
{
|
|
95
99
|
direction: { xs: "column-reverse", sm: "column" },
|
|
96
100
|
spacing: 1,
|
|
97
101
|
sx: { width: "100%", mt: 2 },
|
|
98
102
|
children: [
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
t.description && /* @__PURE__ */ e(
|
|
104
|
+
f,
|
|
101
105
|
{
|
|
102
106
|
variant: "caption",
|
|
103
107
|
sx: { textAlign: { xs: "center", sm: "left" } },
|
|
104
|
-
children:
|
|
108
|
+
children: t.description
|
|
105
109
|
}
|
|
106
110
|
),
|
|
107
|
-
|
|
111
|
+
C && /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(x, { type: t.chartType, data: t.value }) })
|
|
108
112
|
]
|
|
109
113
|
}
|
|
110
114
|
)
|
|
@@ -113,5 +117,5 @@ const B = (e) => {
|
|
|
113
117
|
);
|
|
114
118
|
};
|
|
115
119
|
export {
|
|
116
|
-
|
|
120
|
+
G as MetricCard
|
|
117
121
|
};
|
|
@@ -1,95 +1,112 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import {
|
|
1
|
+
import { useThemeProps as q } from "@mui/material";
|
|
2
|
+
import { formatValue as V, resolveConditionalStyle as z } from "../charts/_common/format.js";
|
|
3
|
+
import { c as N } from "../../createReactComponent-C7L-DMHj.js";
|
|
3
4
|
/**
|
|
4
5
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
5
6
|
*
|
|
6
7
|
* This source code is licensed under the MIT license.
|
|
7
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
8
9
|
*/
|
|
9
|
-
const
|
|
10
|
+
const E = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]], G = N("outline", "arrow-right", "ArrowRight", E);
|
|
10
11
|
/**
|
|
11
12
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
12
13
|
*
|
|
13
14
|
* This source code is licensed under the MIT license.
|
|
14
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
16
|
*/
|
|
16
|
-
const
|
|
17
|
+
const K = [["path", { d: "M3 7l6 6l4 -4l8 8", key: "svg-0" }], ["path", { d: "M21 10l0 7l-7 0", key: "svg-1" }]], Q = N("outline", "trending-down", "TrendingDown", K);
|
|
17
18
|
/**
|
|
18
19
|
* @license @tabler/icons-react v3.44.0 - MIT
|
|
19
20
|
*
|
|
20
21
|
* This source code is licensed under the MIT license.
|
|
21
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
22
23
|
*/
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
value:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
24
|
+
const W = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "M14 7l7 0l0 7", key: "svg-1" }]], X = N("outline", "trending-up", "TrendingUp", W), ne = (_) => {
|
|
25
|
+
const i = q({ props: _, name: "HCMetricCard" }), {
|
|
26
|
+
value: l = [],
|
|
27
|
+
secondValue: y = [],
|
|
28
|
+
secondValueFormat: R,
|
|
29
|
+
variant: $ = "default",
|
|
30
|
+
layout: w = "overlay",
|
|
31
|
+
valuePrefix: D,
|
|
32
|
+
valueSuffix: P,
|
|
33
|
+
format: e,
|
|
34
|
+
showChange: B = !1,
|
|
35
|
+
changeType: c = "percentage",
|
|
36
|
+
showTrend: F = !1,
|
|
37
|
+
showIcon: C = !1,
|
|
38
|
+
icon: r,
|
|
39
|
+
iconPosition: d = "right"
|
|
40
|
+
} = i, A = l.length > 0, u = l[l.length - 1], b = l[l.length - 2], o = u ? Number(u.v) : NaN, n = b ? Number(b.v) : NaN, k = !isNaN(o) && !isNaN(n), g = {
|
|
41
|
+
prefix: (e == null ? void 0 : e.prefix) ?? D,
|
|
42
|
+
suffix: (e == null ? void 0 : e.suffix) ?? P,
|
|
43
|
+
decimals: e == null ? void 0 : e.decimals,
|
|
44
|
+
color: e == null ? void 0 : e.color,
|
|
45
|
+
backgroundColor: e == null ? void 0 : e.backgroundColor,
|
|
46
|
+
conditionalRules: e == null ? void 0 : e.conditionalRules
|
|
47
|
+
};
|
|
48
|
+
let a = "—", m = "", M, I;
|
|
49
|
+
if (!isNaN(o)) {
|
|
50
|
+
a = V(o, g), m = u.t;
|
|
51
|
+
const f = z(o, g);
|
|
52
|
+
M = f.color, I = f.backgroundColor;
|
|
43
53
|
}
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
let p;
|
|
55
|
+
const T = y[y.length - 1], x = T ? Number(T.v) : NaN;
|
|
56
|
+
isNaN(x) || (p = V(x, R ?? g));
|
|
57
|
+
let s;
|
|
58
|
+
if (B)
|
|
59
|
+
if (k && !(n === 0 && c === "percentage")) {
|
|
60
|
+
const v = c === "absolute" ? o - n : (o - n) / n * 100, J = v > 0 ? "+" : v < 0 ? "−" : "", L = c === "percentage" ? 1 : 2, j = c === "percentage" ? "%" : "";
|
|
61
|
+
s = `${J}${Math.abs(v).toFixed(L)}${j}`;
|
|
49
62
|
} else
|
|
50
|
-
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
const
|
|
63
|
+
s = "—";
|
|
64
|
+
let t;
|
|
65
|
+
F && k && (o > n ? t = "up" : o < n ? t = "down" : t = "neutral");
|
|
66
|
+
let h = G;
|
|
67
|
+
t === "up" ? h = X : t === "down" && (h = Q);
|
|
68
|
+
const S = [
|
|
56
69
|
"top-left",
|
|
57
70
|
"top-right",
|
|
58
71
|
"bottom-left",
|
|
59
72
|
"bottom-right"
|
|
60
|
-
].includes(
|
|
61
|
-
metric:
|
|
62
|
-
value:
|
|
63
|
-
change:
|
|
64
|
-
asOf:
|
|
65
|
-
}),
|
|
66
|
-
...
|
|
67
|
-
variant:
|
|
68
|
-
layout:
|
|
69
|
-
changeType:
|
|
70
|
-
iconPosition:
|
|
71
|
-
calculatedValue:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
].includes(d), O = C && !!r && S, U = C && !!r && !S, Z = JSON.stringify({
|
|
74
|
+
metric: i.label,
|
|
75
|
+
value: a,
|
|
76
|
+
change: s,
|
|
77
|
+
asOf: m
|
|
78
|
+
}), H = {
|
|
79
|
+
...i,
|
|
80
|
+
variant: $,
|
|
81
|
+
layout: w,
|
|
82
|
+
changeType: c,
|
|
83
|
+
iconPosition: d,
|
|
84
|
+
calculatedValue: a,
|
|
85
|
+
calculatedSecondValue: p,
|
|
86
|
+
calculatedChange: s,
|
|
87
|
+
calculatedTrend: t,
|
|
88
|
+
calculatedValueColor: M,
|
|
89
|
+
calculatedValueBg: I,
|
|
90
|
+
hasData: A
|
|
75
91
|
};
|
|
76
92
|
return {
|
|
77
93
|
refs: {},
|
|
78
94
|
state: {
|
|
79
|
-
ownerState:
|
|
80
|
-
layout:
|
|
81
|
-
calculatedValue:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
ownerState: H,
|
|
96
|
+
layout: w,
|
|
97
|
+
calculatedValue: a,
|
|
98
|
+
calculatedSecondValue: p,
|
|
99
|
+
calculatedChange: s,
|
|
100
|
+
TrendIcon: h,
|
|
101
|
+
Icon: r,
|
|
102
|
+
showCornerIcon: O,
|
|
103
|
+
showSideIcon: U,
|
|
104
|
+
iconPosition: d,
|
|
105
|
+
snapshotPayload: Z
|
|
89
106
|
},
|
|
90
107
|
actions: {}
|
|
91
108
|
};
|
|
92
109
|
};
|
|
93
110
|
export {
|
|
94
|
-
|
|
111
|
+
ne as useMetricCardLogic
|
|
95
112
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { styled as i, alpha as
|
|
2
|
-
import { Widget as
|
|
3
|
-
import { variantColor as s, trendColor as
|
|
1
|
+
import { styled as i, alpha as C, Stack as g, Typography as d } from "@mui/material";
|
|
2
|
+
import { Widget as f } from "../widget/styled.js";
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
22
|
+
}), y = i(g, {
|
|
23
23
|
name: "HCMetricCard",
|
|
24
24
|
slot: "Content"
|
|
25
25
|
})(() => ({
|
|
@@ -27,38 +27,55 @@ const e = {
|
|
|
27
27
|
width: "100%",
|
|
28
28
|
minWidth: 0,
|
|
29
29
|
zIndex: 1
|
|
30
|
-
})),
|
|
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
|
-
})),
|
|
37
|
+
})), k = i(d, {
|
|
38
38
|
name: "HCMetricCard",
|
|
39
39
|
slot: "Value",
|
|
40
40
|
...e
|
|
41
|
-
})(({ theme: o, ownerState:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
})(({ theme: o, ownerState: n }) => {
|
|
42
|
+
const t = p(o, n.calculatedValueColor), a = p(o, n.calculatedValueBg);
|
|
43
|
+
return {
|
|
44
|
+
color: t ?? s(o, n.variant) ?? o.palette.text.primary,
|
|
45
|
+
fontWeight: 500,
|
|
46
|
+
marginBottom: o.spacing(0.5),
|
|
47
|
+
whiteSpace: "nowrap",
|
|
48
|
+
...a && {
|
|
49
|
+
backgroundColor: a,
|
|
50
|
+
borderRadius: o.shape.borderRadius,
|
|
51
|
+
padding: o.spacing(0, 0.75)
|
|
52
|
+
},
|
|
53
|
+
[o.breakpoints.down("md")]: { fontSize: "1.35rem" },
|
|
54
|
+
[o.breakpoints.up("md")]: { fontSize: "2rem" }
|
|
55
|
+
};
|
|
56
|
+
}), w = i(d, {
|
|
57
|
+
name: "HCMetricCard",
|
|
58
|
+
slot: "SecondValue"
|
|
59
|
+
})(({ theme: o }) => ({
|
|
60
|
+
color: o.palette.text.secondary,
|
|
61
|
+
fontWeight: 400,
|
|
45
62
|
whiteSpace: "nowrap",
|
|
46
|
-
[o.breakpoints.down("md")]: { fontSize: "
|
|
47
|
-
[o.breakpoints.up("md")]: { fontSize: "
|
|
48
|
-
})),
|
|
63
|
+
[o.breakpoints.down("md")]: { fontSize: "0.95rem" },
|
|
64
|
+
[o.breakpoints.up("md")]: { fontSize: "1.25rem" }
|
|
65
|
+
})), H = i("div", {
|
|
49
66
|
name: "HCMetricCard",
|
|
50
67
|
slot: "TrendContainer",
|
|
51
68
|
...e
|
|
52
|
-
})(({ theme: o, ownerState:
|
|
53
|
-
const
|
|
69
|
+
})(({ theme: o, ownerState: n }) => {
|
|
70
|
+
const t = u(o, n.calculatedTrend), a = n.layout === "panel";
|
|
54
71
|
return {
|
|
55
72
|
display: "inline-flex",
|
|
56
73
|
alignItems: "center",
|
|
57
74
|
gap: o.spacing(0.5),
|
|
58
75
|
fontWeight: 500,
|
|
59
|
-
color:
|
|
76
|
+
color: t,
|
|
60
77
|
...a ? {
|
|
61
|
-
backgroundColor:
|
|
78
|
+
backgroundColor: C(t, 0.14),
|
|
62
79
|
borderRadius: 999,
|
|
63
80
|
padding: o.spacing(0.25, 1),
|
|
64
81
|
fontSize: "0.8125rem",
|
|
@@ -71,7 +88,7 @@ const e = {
|
|
|
71
88
|
}
|
|
72
89
|
}
|
|
73
90
|
};
|
|
74
|
-
}),
|
|
91
|
+
}), I = i(d, {
|
|
75
92
|
name: "HCMetricCard",
|
|
76
93
|
slot: "Description"
|
|
77
94
|
})(({ theme: o }) => ({
|
|
@@ -79,34 +96,34 @@ const e = {
|
|
|
79
96
|
display: "block",
|
|
80
97
|
position: "relative",
|
|
81
98
|
zIndex: 1
|
|
82
|
-
})),
|
|
99
|
+
})), S = i("div", {
|
|
83
100
|
name: "HCMetricCard",
|
|
84
101
|
slot: "Icon",
|
|
85
102
|
...e
|
|
86
|
-
})(({ theme: o, ownerState:
|
|
103
|
+
})(({ theme: o, ownerState: n }) => ({
|
|
87
104
|
display: "flex",
|
|
88
105
|
alignItems: "center",
|
|
89
106
|
justifyContent: "center",
|
|
90
|
-
color: s(o,
|
|
91
|
-
marginRight:
|
|
92
|
-
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,
|
|
93
110
|
[o.breakpoints.down("sm")]: {
|
|
94
111
|
position: "absolute",
|
|
95
112
|
top: o.spacing(2),
|
|
96
113
|
left: o.spacing(2),
|
|
97
114
|
margin: 0
|
|
98
115
|
}
|
|
99
|
-
})),
|
|
116
|
+
})), z = i("div", {
|
|
100
117
|
name: "HCMetricCard",
|
|
101
118
|
slot: "CornerIcon",
|
|
102
119
|
...e
|
|
103
|
-
})(({ theme: o, ownerState:
|
|
120
|
+
})(({ theme: o, ownerState: n }) => {
|
|
104
121
|
var c, l;
|
|
105
|
-
const
|
|
106
|
-
return
|
|
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), {
|
|
107
124
|
position: "absolute",
|
|
108
|
-
...
|
|
109
|
-
color: s(o,
|
|
125
|
+
...t,
|
|
126
|
+
color: s(o, n.variant) ?? o.palette.text.secondary,
|
|
110
127
|
zIndex: 2
|
|
111
128
|
};
|
|
112
129
|
}), P = i("div", {
|
|
@@ -122,7 +139,7 @@ const e = {
|
|
|
122
139
|
alignItems: "flex-end",
|
|
123
140
|
overflow: "hidden",
|
|
124
141
|
borderRadius: o.shape.borderRadius
|
|
125
|
-
})),
|
|
142
|
+
})), R = i("div", {
|
|
126
143
|
name: "HCMetricCard",
|
|
127
144
|
slot: "Panel"
|
|
128
145
|
})(({ theme: o }) => ({
|
|
@@ -139,7 +156,7 @@ const e = {
|
|
|
139
156
|
backgroundColor: o.palette.background.paper,
|
|
140
157
|
boxShadow: o.shadows[1],
|
|
141
158
|
overflow: "hidden"
|
|
142
|
-
})),
|
|
159
|
+
})), W = i("div", {
|
|
143
160
|
name: "HCMetricCard",
|
|
144
161
|
slot: "SideChart"
|
|
145
162
|
})(() => ({
|
|
@@ -153,14 +170,15 @@ const e = {
|
|
|
153
170
|
}));
|
|
154
171
|
export {
|
|
155
172
|
P as MetricCardChartContainer,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
y as MetricCardContent,
|
|
174
|
+
z as MetricCardCornerIconContainer,
|
|
175
|
+
I as MetricCardDescription,
|
|
176
|
+
S as MetricCardIconContainer,
|
|
177
|
+
m as MetricCardLabel,
|
|
178
|
+
R as MetricCardPanel,
|
|
179
|
+
v as MetricCardRoot,
|
|
180
|
+
w as MetricCardSecondValue,
|
|
181
|
+
W as MetricCardSideChart,
|
|
182
|
+
H as MetricCardTrendContainer,
|
|
183
|
+
k as MetricCardValue
|
|
166
184
|
};
|