@hybridcore/ui 1.5.87 → 1.5.89
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/README.md +65 -2
- package/dist/{FormControlLabel-DzNokgFD.js → FormControlLabel-BrdX4R71.js} +1 -1
- package/dist/{Input-B7ry6o4t.js → Input-CoIrGZAh.js} +1 -1
- package/dist/{InputLabel-rrSJo8M_.js → InputLabel-CBuAYyuT.js} +163 -162
- package/dist/{OutlinedInput-BDK6qOwW.js → OutlinedInput-B-iZoc9l.js} +1 -1
- package/dist/{Select-jjAc5JX1.js → Select-t3ewnSdf.js} +3 -3
- package/dist/{TextField-Bf46COnQ.js → TextField-BQ8a50fA.js} +4 -4
- package/dist/components/charts/candlestick/logic.js +6 -6
- package/dist/components/charts/candlestick/styled.js +1 -1
- package/dist/components/charts/highlighting-line-data/logic.js +1 -1
- package/dist/components/charts/highlighting-line-data/styled.js +1 -1
- package/dist/components/data-security-selectors/dissemination-list/index.js +652 -742
- package/dist/components/data-security-selectors/dissemination-list/logic.js +62 -0
- package/dist/components/data-security-selectors/dissemination-list/styled.js +88 -0
- package/dist/components/date-time-picker/index.js +57 -94
- package/dist/components/date-time-picker/logic.js +70 -0
- package/dist/components/date-time-picker/styled.js +83 -0
- package/dist/components/geometry-picker/index.js +45 -43
- package/dist/components/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/instance-form/components/variable/index.js +5 -5
- package/dist/components/instance-form/components/variables/index.js +1 -1
- package/dist/components/metric-card/MetricChart.js +210 -192
- package/dist/components/metric-card/index.js +101 -76
- package/dist/components/metric-card/logic.js +142 -65
- package/dist/components/metric-card/styled.js +69 -46
- package/dist/components/paginated-list/logic.js +13 -13
- package/dist/components/paginated-list/styled.js +12 -12
- package/dist/components/profile-card/logic.js +5 -5
- package/dist/components/profile-card/styled.js +4 -4
- package/dist/components/property-mapping/index.js +1 -1
- package/dist/components/range-selector/components/composite-list-range/index.js +1 -1
- package/dist/components/range-selector/components/date-range/index.js +1 -1
- package/dist/components/range-selector/components/number-range/index.js +38 -35
- package/dist/components/range-selector/components/string-range/index.js +15 -14
- package/dist/components/range-selector/index.js +1 -1
- package/dist/components/search-input/index.js +2 -2
- package/dist/components/template-form/components/property-list/index.js +1 -1
- package/dist/components/template-form/components/property-list/property-list-form.js +5 -5
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +3 -3
- package/dist/components/template-form/index.js +3 -3
- package/dist/components/template-property-filters/property.js +4 -4
- package/dist/components/tree-select/index.js +52 -50
- package/dist/components/widget/index.js +4 -0
- package/dist/components/widget/styled.js +38 -0
- package/dist/{index-MMaYBAn0.js → index-CGNxsLVm.js} +6 -6
- package/dist/{index-NNOChRJ7.js → index-SpeaLUQD.js} +2 -2
- package/dist/main.d.ts +397 -122
- package/dist/main.js +14 -12
- package/dist/{property-list-form-BvnaooEW.js → property-list-form-C5hcK2y2.js} +4 -4
- package/package.json +4 -1
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
2
|
+
import { useTheme as k, Stack as c, Skeleton as s } from "@mui/material";
|
|
3
|
+
import * as L from "react";
|
|
4
|
+
import { Widget as I } from "../widget/styled.js";
|
|
5
|
+
import { useMetricCardLogic as O } from "./logic.js";
|
|
5
6
|
import { MetricChart as V } from "./MetricChart.js";
|
|
6
|
-
import { MetricCardRoot as
|
|
7
|
-
const
|
|
8
|
-
(
|
|
7
|
+
import { MetricCardRoot as W, MetricCardCornerIconContainer as A, MetricCardIconContainer as S, MetricCardContent as D, MetricCardLabel as J, MetricCardValue as N, MetricCardTrendContainer as P, MetricCardDescription as q, MetricCardChartContainer as B } from "./styled.js";
|
|
8
|
+
const U = L.forwardRef(
|
|
9
|
+
(b, l) => {
|
|
9
10
|
const {
|
|
10
|
-
label:
|
|
11
|
-
value:
|
|
12
|
-
calculatedValue:
|
|
13
|
-
calculatedChange:
|
|
14
|
-
description:
|
|
15
|
-
variant:
|
|
11
|
+
label: h,
|
|
12
|
+
value: m,
|
|
13
|
+
calculatedValue: p,
|
|
14
|
+
calculatedChange: d,
|
|
15
|
+
description: C,
|
|
16
|
+
variant: o,
|
|
16
17
|
loading: T,
|
|
17
|
-
showChange:
|
|
18
|
-
showTrend:
|
|
18
|
+
showChange: f,
|
|
19
|
+
showTrend: x,
|
|
19
20
|
Icon: i,
|
|
20
|
-
iconPosition:
|
|
21
|
-
showChart:
|
|
22
|
-
chartType:
|
|
23
|
-
sx:
|
|
24
|
-
other:
|
|
21
|
+
iconPosition: g,
|
|
22
|
+
showChart: w,
|
|
23
|
+
chartType: u,
|
|
24
|
+
sx: M,
|
|
25
|
+
other: v,
|
|
25
26
|
ownerState: r,
|
|
26
27
|
TrendIcon: z,
|
|
27
|
-
showCornerIcon:
|
|
28
|
-
showSideIcon:
|
|
29
|
-
|
|
28
|
+
showCornerIcon: R,
|
|
29
|
+
showSideIcon: y,
|
|
30
|
+
asOf: j
|
|
31
|
+
} = O(b), n = k();
|
|
30
32
|
let a = n.palette.text.secondary;
|
|
31
|
-
return
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
/* @__PURE__ */ e(
|
|
34
|
-
/* @__PURE__ */ e(
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
return o === "primary" && (a = n.palette.primary.main), o === "success" && (a = n.palette.success.main), o === "warning" && (a = n.palette.warning.main), o === "danger" && (a = n.palette.error.main), T ? /* @__PURE__ */ e(W, { ref: l, ownerState: r, sx: M, ...v, children: /* @__PURE__ */ t(c, { spacing: 1, children: [
|
|
34
|
+
/* @__PURE__ */ e(s, { variant: "text", width: "60%" }),
|
|
35
|
+
/* @__PURE__ */ e(s, { variant: "rectangular", height: 40, width: "40%" }),
|
|
36
|
+
/* @__PURE__ */ e(s, { variant: "text", width: "80%" }),
|
|
37
|
+
w && /* @__PURE__ */ e(
|
|
38
|
+
s,
|
|
37
39
|
{
|
|
38
40
|
variant: "rectangular",
|
|
39
41
|
height: 40,
|
|
@@ -41,63 +43,86 @@ const N = k.forwardRef(
|
|
|
41
43
|
sx: { mt: 2 }
|
|
42
44
|
}
|
|
43
45
|
)
|
|
44
|
-
] }) }) : /* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
] }) }) : /* @__PURE__ */ e(
|
|
47
|
+
I.Root,
|
|
48
|
+
{
|
|
49
|
+
ref: l,
|
|
50
|
+
sx: M,
|
|
51
|
+
...v,
|
|
52
|
+
"data-snapshot": JSON.stringify({
|
|
53
|
+
metric: h,
|
|
54
|
+
value: p,
|
|
55
|
+
change: d,
|
|
56
|
+
asOf: j
|
|
57
|
+
}),
|
|
58
|
+
children: /* @__PURE__ */ t(
|
|
59
|
+
I.Content,
|
|
60
|
+
{
|
|
61
|
+
sx: {
|
|
62
|
+
py: { xs: 1, md: 1.5 },
|
|
63
|
+
px: { xs: 1, md: 2 }
|
|
64
|
+
},
|
|
65
|
+
children: [
|
|
66
|
+
R && i && /* @__PURE__ */ e(A, { ownerState: r, children: /* @__PURE__ */ e(i, { size: 24 }) }),
|
|
57
67
|
/* @__PURE__ */ t(
|
|
58
|
-
|
|
68
|
+
c,
|
|
59
69
|
{
|
|
60
70
|
direction: "row",
|
|
61
|
-
|
|
71
|
+
justifyContent: "space-between",
|
|
72
|
+
alignItems: "flex-start",
|
|
73
|
+
sx: { flex: 1 },
|
|
74
|
+
children: [
|
|
75
|
+
y && i && g === "left" && /* @__PURE__ */ e(S, { ownerState: r, children: /* @__PURE__ */ e(i, { sx: { fontSize: 24 } }) }),
|
|
76
|
+
/* @__PURE__ */ t(D, { ownerState: r, children: [
|
|
77
|
+
/* @__PURE__ */ e(J, { variant: "body2", ownerState: r, children: h }),
|
|
78
|
+
/* @__PURE__ */ t(
|
|
79
|
+
c,
|
|
80
|
+
{
|
|
81
|
+
direction: "row",
|
|
82
|
+
alignItems: "baseline",
|
|
83
|
+
spacing: 1,
|
|
84
|
+
flexWrap: "wrap",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ e(N, { variant: "h4", ownerState: r, children: p }),
|
|
87
|
+
(f || x) && d !== "—" && /* @__PURE__ */ t(P, { ownerState: r, children: [
|
|
88
|
+
x && /* @__PURE__ */ e(z, { size: 16 }),
|
|
89
|
+
f && d
|
|
90
|
+
] })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }),
|
|
95
|
+
y && i && g === "right" && /* @__PURE__ */ e(S, { ownerState: r, children: /* @__PURE__ */ e(i, { sx: { fontSize: 24 } }) })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ t(
|
|
100
|
+
c,
|
|
101
|
+
{
|
|
102
|
+
direction: { xs: "column-reverse", sm: "column" },
|
|
62
103
|
spacing: 1,
|
|
63
|
-
|
|
104
|
+
sx: { width: "100%", mt: 2 },
|
|
64
105
|
children: [
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
106
|
+
C && /* @__PURE__ */ e(
|
|
107
|
+
q,
|
|
108
|
+
{
|
|
109
|
+
variant: "caption",
|
|
110
|
+
ownerState: r,
|
|
111
|
+
sx: { textAlign: { xs: "center", sm: "left" } },
|
|
112
|
+
children: C
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
w && u && m.length >= 2 && /* @__PURE__ */ e(B, { ownerState: r, children: /* @__PURE__ */ e(V, { type: u, data: m, color: a }) })
|
|
70
116
|
]
|
|
71
117
|
}
|
|
72
118
|
)
|
|
73
|
-
]
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/* @__PURE__ */ t(
|
|
79
|
-
o,
|
|
80
|
-
{
|
|
81
|
-
direction: { xs: "column-reverse", sm: "column" },
|
|
82
|
-
spacing: 1,
|
|
83
|
-
sx: { width: "100%", mt: 2 },
|
|
84
|
-
children: [
|
|
85
|
-
m && /* @__PURE__ */ e(
|
|
86
|
-
B,
|
|
87
|
-
{
|
|
88
|
-
variant: "caption",
|
|
89
|
-
ownerState: r,
|
|
90
|
-
sx: { textAlign: { xs: "center", sm: "left" } },
|
|
91
|
-
children: m
|
|
92
|
-
}
|
|
93
|
-
),
|
|
94
|
-
x && g && d.length >= 2 && /* @__PURE__ */ e(E, { ownerState: r, children: /* @__PURE__ */ e(V, { type: g, data: d, color: a }) })
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] });
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
);
|
|
99
124
|
}
|
|
100
125
|
);
|
|
101
126
|
export {
|
|
102
|
-
|
|
127
|
+
U as MetricCard
|
|
103
128
|
};
|
|
@@ -1,91 +1,168 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useThemeProps as D } from "@mui/material";
|
|
2
|
+
import { forwardRef as R, createElement as y } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @license @tabler/icons-react v3.44.0 - MIT
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
var F = {
|
|
10
|
+
outline: {
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
width: 24,
|
|
13
|
+
height: 24,
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
fill: "none",
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
strokeWidth: 2,
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeLinejoin: "round"
|
|
20
|
+
},
|
|
21
|
+
filled: {
|
|
22
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
+
width: 24,
|
|
24
|
+
height: 24,
|
|
25
|
+
viewBox: "0 0 24 24",
|
|
26
|
+
fill: "currentColor",
|
|
27
|
+
stroke: "none"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @license @tabler/icons-react v3.44.0 - MIT
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the MIT license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/
|
|
36
|
+
const C = (w, g, m, e) => {
|
|
37
|
+
const h = R(
|
|
38
|
+
({ color: d = "currentColor", size: u = 24, stroke: p = 2, title: o, className: f, children: r, ...a }, i) => y(
|
|
39
|
+
"svg",
|
|
40
|
+
{
|
|
41
|
+
ref: i,
|
|
42
|
+
...F[w],
|
|
43
|
+
width: u,
|
|
44
|
+
height: u,
|
|
45
|
+
className: ["tabler-icon", `tabler-icon-${g}`, f].join(" "),
|
|
46
|
+
strokeWidth: p,
|
|
47
|
+
stroke: d,
|
|
48
|
+
...a
|
|
49
|
+
},
|
|
50
|
+
[
|
|
51
|
+
o && y("title", { key: "svg-title" }, o),
|
|
52
|
+
...e.map(([v, N]) => y(v, N)),
|
|
53
|
+
...Array.isArray(r) ? r : [r]
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
return h.displayName = `${m}`, h;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @license @tabler/icons-react v3.44.0 - MIT
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the MIT license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/
|
|
65
|
+
const L = [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M13 18l6 -6", key: "svg-1" }], ["path", { d: "M13 6l6 6", key: "svg-2" }]], S = C("outline", "arrow-right", "ArrowRight", L);
|
|
66
|
+
/**
|
|
67
|
+
* @license @tabler/icons-react v3.44.0 - MIT
|
|
68
|
+
*
|
|
69
|
+
* This source code is licensed under the MIT license.
|
|
70
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
+
*/
|
|
72
|
+
const U = [["path", { d: "M3 7l6 6l4 -4l8 8", key: "svg-0" }], ["path", { d: "M21 10l0 7l-7 0", key: "svg-1" }]], j = C("outline", "trending-down", "TrendingDown", U);
|
|
73
|
+
/**
|
|
74
|
+
* @license @tabler/icons-react v3.44.0 - MIT
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the MIT license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/
|
|
79
|
+
const B = [["path", { d: "M3 17l6 -6l4 4l8 -8", key: "svg-0" }], ["path", { d: "M14 7l7 0l0 7", key: "svg-1" }]], P = C("outline", "trending-up", "TrendingUp", B), H = (w) => {
|
|
80
|
+
const g = D({ props: w, name: "HCMetricCard" }), {
|
|
81
|
+
label: m,
|
|
6
82
|
value: e = [],
|
|
7
|
-
description:
|
|
8
|
-
variant:
|
|
9
|
-
loading:
|
|
83
|
+
description: h,
|
|
84
|
+
variant: d = "default",
|
|
85
|
+
loading: u = !1,
|
|
10
86
|
showChange: p = !1,
|
|
11
|
-
changeType:
|
|
12
|
-
showTrend:
|
|
13
|
-
showIcon:
|
|
14
|
-
icon:
|
|
87
|
+
changeType: o = "percentage",
|
|
88
|
+
showTrend: f = !1,
|
|
89
|
+
showIcon: r = !1,
|
|
90
|
+
icon: a,
|
|
15
91
|
iconPosition: i = "right",
|
|
16
|
-
showChart:
|
|
17
|
-
chartType:
|
|
92
|
+
showChart: v = !1,
|
|
93
|
+
chartType: N,
|
|
18
94
|
sx: I,
|
|
19
95
|
...x
|
|
20
|
-
} =
|
|
21
|
-
let
|
|
22
|
-
if (
|
|
23
|
-
const
|
|
24
|
-
isNaN(t) || (
|
|
96
|
+
} = g, M = e.length > 0;
|
|
97
|
+
let k = "—", T = "";
|
|
98
|
+
if (M) {
|
|
99
|
+
const n = e[e.length - 1], t = Number(n.v);
|
|
100
|
+
isNaN(t) || (k = new Intl.NumberFormat("en-US", {
|
|
25
101
|
maximumFractionDigits: 2
|
|
26
|
-
}).format(t));
|
|
102
|
+
}).format(t), T = n.t);
|
|
27
103
|
}
|
|
28
|
-
let
|
|
104
|
+
let l;
|
|
29
105
|
if (p)
|
|
30
106
|
if (e.length >= 2) {
|
|
31
|
-
const
|
|
32
|
-
if (isNaN(
|
|
33
|
-
|
|
34
|
-
else if (
|
|
35
|
-
|
|
107
|
+
const n = Number(e[e.length - 1].v), t = Number(e[e.length - 2].v);
|
|
108
|
+
if (isNaN(n) || isNaN(t))
|
|
109
|
+
l = "—";
|
|
110
|
+
else if (t === 0 && o === "percentage")
|
|
111
|
+
l = "—";
|
|
36
112
|
else {
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
)}${
|
|
113
|
+
let c = 0;
|
|
114
|
+
o === "absolute" ? c = n - t : c = (n - t) / t * 100, l = `${c > 0 ? "+" : c < 0 ? "−" : ""}${Math.abs(c).toFixed(
|
|
115
|
+
o === "percentage" ? 1 : 2
|
|
116
|
+
)}${o === "percentage" ? "%" : ""}`;
|
|
41
117
|
}
|
|
42
118
|
} else
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
!isNaN(
|
|
119
|
+
l = "—";
|
|
120
|
+
let s;
|
|
121
|
+
if (f && e.length >= 2) {
|
|
122
|
+
const n = Number(e[e.length - 1].v), t = Number(e[e.length - 2].v);
|
|
123
|
+
!isNaN(n) && !isNaN(t) && (n > t ? s = "up" : n < t ? s = "down" : s = "neutral");
|
|
48
124
|
}
|
|
49
|
-
const
|
|
50
|
-
...
|
|
51
|
-
calculatedValue:
|
|
52
|
-
calculatedChange:
|
|
53
|
-
calculatedTrend:
|
|
54
|
-
hasData:
|
|
55
|
-
changeType:
|
|
125
|
+
const $ = {
|
|
126
|
+
...g,
|
|
127
|
+
calculatedValue: k,
|
|
128
|
+
calculatedChange: l,
|
|
129
|
+
calculatedTrend: s,
|
|
130
|
+
hasData: M,
|
|
131
|
+
changeType: o,
|
|
56
132
|
iconPosition: i,
|
|
57
|
-
variant:
|
|
133
|
+
variant: d
|
|
58
134
|
};
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
135
|
+
let b = S;
|
|
136
|
+
s === "up" ? b = P : s === "down" && (b = j);
|
|
137
|
+
const _ = r && !!a && ["top-left", "top-right", "bottom-left", "bottom-right"].includes(
|
|
62
138
|
i || ""
|
|
63
|
-
),
|
|
139
|
+
), A = r && !!a && ["left", "right"].includes(i || "");
|
|
64
140
|
return {
|
|
65
|
-
label:
|
|
141
|
+
label: m,
|
|
66
142
|
value: e,
|
|
67
|
-
calculatedValue:
|
|
68
|
-
calculatedChange:
|
|
69
|
-
calculatedTrend:
|
|
70
|
-
description:
|
|
71
|
-
variant:
|
|
72
|
-
loading:
|
|
143
|
+
calculatedValue: k,
|
|
144
|
+
calculatedChange: l,
|
|
145
|
+
calculatedTrend: s,
|
|
146
|
+
description: h,
|
|
147
|
+
variant: d,
|
|
148
|
+
loading: u,
|
|
73
149
|
showChange: p,
|
|
74
|
-
changeType:
|
|
75
|
-
showTrend:
|
|
76
|
-
showIcon:
|
|
77
|
-
Icon:
|
|
150
|
+
changeType: o,
|
|
151
|
+
showTrend: f,
|
|
152
|
+
showIcon: r,
|
|
153
|
+
Icon: a,
|
|
78
154
|
iconPosition: i,
|
|
79
|
-
showChart:
|
|
80
|
-
chartType:
|
|
155
|
+
showChart: v,
|
|
156
|
+
chartType: N,
|
|
81
157
|
sx: I,
|
|
82
158
|
other: x,
|
|
83
|
-
ownerState:
|
|
84
|
-
TrendIcon:
|
|
85
|
-
showCornerIcon:
|
|
86
|
-
showSideIcon:
|
|
159
|
+
ownerState: $,
|
|
160
|
+
TrendIcon: b,
|
|
161
|
+
showCornerIcon: _,
|
|
162
|
+
showSideIcon: A,
|
|
163
|
+
asOf: T
|
|
87
164
|
};
|
|
88
165
|
};
|
|
89
166
|
export {
|
|
90
|
-
|
|
167
|
+
H as useMetricCardLogic
|
|
91
168
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const c =
|
|
3
|
-
name: "
|
|
1
|
+
import { styled as o, alpha as t, Stack as e, Typography as s } from "@mui/material";
|
|
2
|
+
const c = o("div", {
|
|
3
|
+
name: "HCMetricCard",
|
|
4
4
|
slot: "Root"
|
|
5
5
|
})(({ theme: a, ownerState: i }) => {
|
|
6
6
|
const r = {
|
|
7
7
|
position: "relative",
|
|
8
8
|
overflow: "hidden",
|
|
9
|
-
padding: a.spacing(2, 3),
|
|
10
9
|
borderRadius: a.shape.borderRadius * 2,
|
|
11
10
|
boxShadow: a.shadows[1],
|
|
12
11
|
transition: "all 0.3s",
|
|
@@ -15,32 +14,38 @@ const c = t("div", {
|
|
|
15
14
|
backgroundColor: a.palette.background.paper,
|
|
16
15
|
display: "flex",
|
|
17
16
|
flexDirection: "column",
|
|
18
|
-
minHeight: 120
|
|
17
|
+
minHeight: 120,
|
|
18
|
+
[a.breakpoints.down("md")]: {
|
|
19
|
+
padding: a.spacing(1.5, 1.5)
|
|
20
|
+
},
|
|
21
|
+
[a.breakpoints.up("md")]: {
|
|
22
|
+
padding: a.spacing(1.5, 2)
|
|
23
|
+
}
|
|
19
24
|
};
|
|
20
25
|
let n = {};
|
|
21
26
|
switch (i.variant) {
|
|
22
27
|
case "primary":
|
|
23
28
|
n = {
|
|
24
|
-
backgroundColor:
|
|
25
|
-
borderColor:
|
|
29
|
+
backgroundColor: t(a.palette.primary.main, 0.05),
|
|
30
|
+
borderColor: t(a.palette.primary.main, 0.2)
|
|
26
31
|
};
|
|
27
32
|
break;
|
|
28
33
|
case "success":
|
|
29
34
|
n = {
|
|
30
|
-
backgroundColor:
|
|
31
|
-
borderColor:
|
|
35
|
+
backgroundColor: t(a.palette.success.main, 0.05),
|
|
36
|
+
borderColor: t(a.palette.success.main, 0.2)
|
|
32
37
|
};
|
|
33
38
|
break;
|
|
34
39
|
case "warning":
|
|
35
40
|
n = {
|
|
36
|
-
backgroundColor:
|
|
37
|
-
borderColor:
|
|
41
|
+
backgroundColor: t(a.palette.warning.main, 0.05),
|
|
42
|
+
borderColor: t(a.palette.warning.main, 0.2)
|
|
38
43
|
};
|
|
39
44
|
break;
|
|
40
45
|
case "danger":
|
|
41
46
|
n = {
|
|
42
|
-
backgroundColor:
|
|
43
|
-
borderColor:
|
|
47
|
+
backgroundColor: t(a.palette.error.main, 0.05),
|
|
48
|
+
borderColor: t(a.palette.error.main, 0.2)
|
|
44
49
|
};
|
|
45
50
|
break;
|
|
46
51
|
default:
|
|
@@ -54,55 +59,68 @@ const c = t("div", {
|
|
|
54
59
|
...r,
|
|
55
60
|
...n
|
|
56
61
|
};
|
|
57
|
-
}),
|
|
58
|
-
name: "
|
|
62
|
+
}), d = o(e, {
|
|
63
|
+
name: "HCMetricCard",
|
|
59
64
|
slot: "Content"
|
|
60
65
|
})(({ theme: a }) => ({
|
|
61
66
|
flex: 1,
|
|
62
67
|
width: "100%",
|
|
63
68
|
zIndex: 1,
|
|
64
|
-
[a.breakpoints.down("
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
})), d = t(e, {
|
|
69
|
-
name: "MuiMetricCard",
|
|
69
|
+
[a.breakpoints.down("md")]: {}
|
|
70
|
+
})), p = o(s, {
|
|
71
|
+
name: "HCMetricCard",
|
|
70
72
|
slot: "Label"
|
|
71
73
|
})(({ theme: a }) => ({
|
|
72
74
|
color: a.palette.text.secondary,
|
|
73
75
|
marginBottom: a.spacing(0.5),
|
|
74
76
|
fontWeight: 500
|
|
75
|
-
})), g =
|
|
76
|
-
name: "
|
|
77
|
+
})), g = o(s, {
|
|
78
|
+
name: "HCMetricCard",
|
|
77
79
|
slot: "Value"
|
|
78
80
|
})(({ theme: a, ownerState: i }) => {
|
|
79
81
|
let r = a.palette.text.primary;
|
|
80
82
|
return i.variant === "primary" && (r = a.palette.primary.main), i.variant === "success" && (r = a.palette.success.main), i.variant === "warning" && (r = a.palette.warning.main), i.variant === "danger" && (r = a.palette.error.main), {
|
|
83
|
+
[a.breakpoints.down("md")]: {
|
|
84
|
+
fontSize: "1.35rem"
|
|
85
|
+
},
|
|
86
|
+
[a.breakpoints.up("md")]: {
|
|
87
|
+
fontSize: "2rem"
|
|
88
|
+
},
|
|
81
89
|
color: r,
|
|
82
|
-
fontWeight:
|
|
90
|
+
fontWeight: 500,
|
|
83
91
|
marginBottom: a.spacing(0.5)
|
|
84
92
|
};
|
|
85
|
-
}),
|
|
86
|
-
name: "
|
|
93
|
+
}), C = o("div", {
|
|
94
|
+
name: "HCMetricCard",
|
|
87
95
|
slot: "TrendContainer"
|
|
88
96
|
})(({ theme: a, ownerState: i }) => {
|
|
89
97
|
let r = a.palette.text.secondary;
|
|
90
98
|
return i.calculatedTrend === "up" ? r = a.palette.success.main : i.calculatedTrend === "down" ? r = a.palette.error.main : i.calculatedTrend === "neutral" && (r = a.palette.text.secondary), {
|
|
99
|
+
[a.breakpoints.down("md")]: {
|
|
100
|
+
fontSize: "0.7rem",
|
|
101
|
+
".MuiSvgIcon-root": {
|
|
102
|
+
display: "none"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
[a.breakpoints.up("md")]: {
|
|
106
|
+
fontSize: "0.875rem"
|
|
107
|
+
},
|
|
91
108
|
display: "inline-flex",
|
|
92
109
|
alignItems: "center",
|
|
93
110
|
gap: a.spacing(0.5),
|
|
94
|
-
fontSize: "0.875rem",
|
|
95
111
|
fontWeight: 500,
|
|
96
112
|
color: r
|
|
97
113
|
};
|
|
98
|
-
}),
|
|
99
|
-
name: "
|
|
114
|
+
}), f = o(s, {
|
|
115
|
+
name: "HCMetricCard",
|
|
100
116
|
slot: "Description"
|
|
101
117
|
})(({ theme: a }) => ({
|
|
102
118
|
color: a.palette.text.secondary,
|
|
103
|
-
display: "block"
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
display: "block",
|
|
120
|
+
position: "relative",
|
|
121
|
+
zIndex: 1
|
|
122
|
+
})), b = o("div", {
|
|
123
|
+
name: "HCMetricCard",
|
|
106
124
|
slot: "Icon"
|
|
107
125
|
})(({ theme: a, ownerState: i }) => {
|
|
108
126
|
let r = a.palette.text.secondary;
|
|
@@ -120,8 +138,8 @@ const c = t("div", {
|
|
|
120
138
|
margin: 0
|
|
121
139
|
}
|
|
122
140
|
};
|
|
123
|
-
}),
|
|
124
|
-
name: "
|
|
141
|
+
}), u = o("div", {
|
|
142
|
+
name: "HCMetricCard",
|
|
125
143
|
slot: "CornerIcon"
|
|
126
144
|
})(({ theme: a, ownerState: i }) => {
|
|
127
145
|
let r = a.palette.text.secondary;
|
|
@@ -133,23 +151,28 @@ const c = t("div", {
|
|
|
133
151
|
color: r,
|
|
134
152
|
zIndex: 2
|
|
135
153
|
};
|
|
136
|
-
}), y =
|
|
137
|
-
name: "
|
|
154
|
+
}), y = o("div", {
|
|
155
|
+
name: "HCMetricCard",
|
|
138
156
|
slot: "ChartContainer"
|
|
139
|
-
})(() => ({
|
|
140
|
-
|
|
141
|
-
|
|
157
|
+
})(({ theme: a }) => ({
|
|
158
|
+
position: "absolute",
|
|
159
|
+
right: 0,
|
|
160
|
+
bottom: 0,
|
|
161
|
+
left: 0,
|
|
162
|
+
height: "75%",
|
|
142
163
|
display: "flex",
|
|
143
|
-
alignItems: "flex-end"
|
|
164
|
+
alignItems: "flex-end",
|
|
165
|
+
overflow: "hidden",
|
|
166
|
+
borderRadius: a.shape.borderRadius
|
|
144
167
|
}));
|
|
145
168
|
export {
|
|
146
169
|
y as MetricCardChartContainer,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
170
|
+
d as MetricCardContent,
|
|
171
|
+
u as MetricCardCornerIconContainer,
|
|
172
|
+
f as MetricCardDescription,
|
|
173
|
+
b as MetricCardIconContainer,
|
|
174
|
+
p as MetricCardLabel,
|
|
152
175
|
c as MetricCardRoot,
|
|
153
|
-
|
|
176
|
+
C as MetricCardTrendContainer,
|
|
154
177
|
g as MetricCardValue
|
|
155
178
|
};
|