@hybridcore/ui 1.6.19 → 1.6.21
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/geometry-picker/index.js +95 -81
- package/dist/components/geometry-picker/logic.js +58 -41
- package/dist/components/geometry-picker/map/logic.js +446 -448
- package/dist/components/geometry-picker/styled.js +62 -40
- package/dist/components/metric-card/index.js +68 -58
- package/dist/components/metric-card/styled.js +79 -60
- package/dist/components/status-indicator/index.js +25 -25
- package/dist/components/status-indicator/styled.js +77 -41
- package/dist/main.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { styled as o, Box as n, FormLabel as
|
|
2
|
-
const
|
|
1
|
+
import { styled as o, Box as n, FormLabel as a, Button as r, FormControl as c, InputLabel as m, Input as l, OutlinedInput as s, FilledInput as d, InputAdornment as p, IconButton as y, Dialog as k, DialogTitle as g, DialogContent as u } from "@mui/material";
|
|
2
|
+
const i = (e) => e !== "ownerState", G = o(n, {
|
|
3
3
|
name: "HCGeometryPicker",
|
|
4
4
|
slot: "root"
|
|
5
|
-
})({}), C = o(
|
|
5
|
+
})({}), C = o(a, {
|
|
6
6
|
name: "HCGeometryPicker",
|
|
7
7
|
slot: "topLabel"
|
|
8
8
|
})(({ theme: e }) => ({
|
|
@@ -10,25 +10,46 @@ const G = (e) => e !== "ownerState", g = o(n, {
|
|
|
10
10
|
marginBottom: e.spacing(0.5)
|
|
11
11
|
})), b = o(n, {
|
|
12
12
|
name: "HCGeometryPicker",
|
|
13
|
-
slot: "
|
|
13
|
+
slot: "header"
|
|
14
14
|
})(({ theme: e }) => ({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
display: "flex",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
justifyContent: "space-between",
|
|
18
|
+
gap: e.spacing(1),
|
|
19
|
+
marginBottom: e.spacing(0.5),
|
|
20
|
+
minHeight: 28,
|
|
21
|
+
"& > .MuiFormLabel-root": {
|
|
22
|
+
marginBottom: 0
|
|
23
|
+
}
|
|
18
24
|
})), H = o(n, {
|
|
25
|
+
name: "HCGeometryPicker",
|
|
26
|
+
slot: "container",
|
|
27
|
+
shouldForwardProp: i
|
|
28
|
+
})(({ ownerState: e, theme: t }) => ({
|
|
29
|
+
position: "relative",
|
|
30
|
+
width: "100%",
|
|
31
|
+
paddingTop: e.labelPosition === "top" ? 0 : t.spacing(1)
|
|
32
|
+
})), f = o(n, {
|
|
19
33
|
name: "HCGeometryPicker",
|
|
20
34
|
slot: "actions",
|
|
21
|
-
shouldForwardProp:
|
|
35
|
+
shouldForwardProp: i
|
|
22
36
|
})(({ ownerState: e, theme: t }) => ({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
display: "flex",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
...e.labelPosition === "top" ? {
|
|
40
|
+
flexWrap: "wrap",
|
|
41
|
+
justifyContent: "flex-end"
|
|
42
|
+
} : {
|
|
43
|
+
position: "absolute",
|
|
44
|
+
top: 0,
|
|
45
|
+
right: 0,
|
|
46
|
+
zIndex: 9,
|
|
47
|
+
...e.variant === "outlined" && {
|
|
48
|
+
padding: t.spacing(0.25),
|
|
49
|
+
top: t.spacing(-0.75),
|
|
50
|
+
right: t.spacing(1),
|
|
51
|
+
background: t.palette.background.default
|
|
52
|
+
}
|
|
32
53
|
}
|
|
33
54
|
})), I = o(r, {
|
|
34
55
|
name: "HCGeometryPicker",
|
|
@@ -53,31 +74,31 @@ const G = (e) => e !== "ownerState", g = o(n, {
|
|
|
53
74
|
boxShadow: e.shadows[1]
|
|
54
75
|
}
|
|
55
76
|
}
|
|
56
|
-
})),
|
|
77
|
+
})), x = o(c, {
|
|
57
78
|
name: "HCGeometryPicker",
|
|
58
79
|
slot: "formControl"
|
|
59
|
-
})({}),
|
|
80
|
+
})({}), B = o(m, {
|
|
60
81
|
name: "HCGeometryPicker",
|
|
61
82
|
slot: "inputLabel"
|
|
62
|
-
})({}),
|
|
83
|
+
})({}), h = o(l, {
|
|
63
84
|
name: "HCGeometryPicker",
|
|
64
85
|
slot: "input"
|
|
65
|
-
})({}),
|
|
86
|
+
})({}), w = o(s, {
|
|
66
87
|
name: "HCGeometryPicker",
|
|
67
88
|
slot: "input"
|
|
68
|
-
})({}),
|
|
89
|
+
})({}), L = o(d, {
|
|
69
90
|
name: "HCGeometryPicker",
|
|
70
91
|
slot: "input"
|
|
71
|
-
})({}),
|
|
92
|
+
})({}), T = o(p, {
|
|
72
93
|
name: "HCGeometryPicker",
|
|
73
94
|
slot: "endAdornment"
|
|
74
|
-
})({}),
|
|
95
|
+
})({}), A = o(y, {
|
|
75
96
|
name: "HCGeometryPicker",
|
|
76
97
|
slot: "endAdornmentButton"
|
|
77
|
-
})({}),
|
|
98
|
+
})({}), F = o(k, {
|
|
78
99
|
name: "HCGeometryPicker",
|
|
79
100
|
slot: "dialog"
|
|
80
|
-
})({}),
|
|
101
|
+
})({}), S = o(g, {
|
|
81
102
|
name: "HCGeometryPicker",
|
|
82
103
|
slot: "dialogTitle"
|
|
83
104
|
})({}), v = o(u, {
|
|
@@ -89,7 +110,7 @@ const G = (e) => e !== "ownerState", g = o(n, {
|
|
|
89
110
|
})(({ theme: e }) => ({
|
|
90
111
|
textTransform: "none",
|
|
91
112
|
marginTop: e.spacing(1)
|
|
92
|
-
})),
|
|
113
|
+
})), M = o(n, {
|
|
93
114
|
name: "HCGeometryPicker",
|
|
94
115
|
slot: "geometryMapOverlay"
|
|
95
116
|
})(({ theme: e }) => ({
|
|
@@ -97,20 +118,21 @@ const G = (e) => e !== "ownerState", g = o(n, {
|
|
|
97
118
|
}));
|
|
98
119
|
export {
|
|
99
120
|
I as GeometryPickerActionButton,
|
|
100
|
-
|
|
101
|
-
|
|
121
|
+
f as GeometryPickerActions,
|
|
122
|
+
H as GeometryPickerContainer,
|
|
102
123
|
D as GeometryPickerCoordinateSubmit,
|
|
103
|
-
|
|
124
|
+
F as GeometryPickerDialog,
|
|
104
125
|
v as GeometryPickerDialogContent,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
126
|
+
S as GeometryPickerDialogTitle,
|
|
127
|
+
T as GeometryPickerEndAdornment,
|
|
128
|
+
A as GeometryPickerEndAdornmentButton,
|
|
129
|
+
x as GeometryPickerFormControl,
|
|
130
|
+
M as GeometryPickerGeometryMapOverlay,
|
|
131
|
+
b as GeometryPickerHeader,
|
|
132
|
+
L as GeometryPickerInputFilled,
|
|
133
|
+
B as GeometryPickerInputLabel,
|
|
134
|
+
w as GeometryPickerInputOutlined,
|
|
135
|
+
h as GeometryPickerInputStandard,
|
|
136
|
+
G as GeometryPickerRoot,
|
|
115
137
|
C as GeometryPickerTopLabel
|
|
116
138
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { Stack as
|
|
3
|
-
import { MetricChart as
|
|
4
|
-
import { useMetricCardLogic as
|
|
5
|
-
import { MetricCardRoot as
|
|
6
|
-
const
|
|
7
|
-
const { state:
|
|
8
|
-
ownerState:
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as a, Skeleton as l, Tooltip as c } from "@mui/material";
|
|
3
|
+
import { MetricChart as w } from "./MetricChart.js";
|
|
4
|
+
import { useMetricCardLogic as z } from "./logic.js";
|
|
5
|
+
import { MetricCardRoot as f, MetricCardValue as V, MetricCardSecondValue as k, MetricCardTrendContainer as P, MetricCardLabel as v, MetricCardPanel as W, MetricCardDescription as M, MetricCardSideChart as L, MetricCardCornerIconContainer as A, MetricCardIconContainer as y, MetricCardContent as D, MetricCardChartContainer as F } from "./styled.js";
|
|
6
|
+
const H = (t) => {
|
|
7
|
+
const { state: S } = z(t), {
|
|
8
|
+
ownerState: n,
|
|
9
9
|
layout: d,
|
|
10
|
-
calculatedValue:
|
|
11
|
-
calculatedSecondValue:
|
|
12
|
-
calculatedChange:
|
|
13
|
-
TrendIcon:
|
|
14
|
-
Icon:
|
|
10
|
+
calculatedValue: o,
|
|
11
|
+
calculatedSecondValue: h,
|
|
12
|
+
calculatedChange: s,
|
|
13
|
+
TrendIcon: b,
|
|
14
|
+
Icon: r,
|
|
15
15
|
showCornerIcon: I,
|
|
16
|
-
showSideIcon:
|
|
17
|
-
iconPosition:
|
|
18
|
-
snapshotPayload:
|
|
19
|
-
} =
|
|
16
|
+
showSideIcon: C,
|
|
17
|
+
iconPosition: x,
|
|
18
|
+
snapshotPayload: T
|
|
19
|
+
} = S, g = !!t.showChart && !!t.chartType && (t.value ?? []).length >= 2, j = (t.showChange || t.showTrend) && s !== "—";
|
|
20
20
|
if (t.loading)
|
|
21
|
-
return /* @__PURE__ */ e(
|
|
22
|
-
/* @__PURE__ */ e(
|
|
23
|
-
/* @__PURE__ */ e(
|
|
24
|
-
/* @__PURE__ */ e(
|
|
21
|
+
return /* @__PURE__ */ e(f, { ownerState: n, sx: t.sx, children: /* @__PURE__ */ i(a, { spacing: 1, children: [
|
|
22
|
+
/* @__PURE__ */ e(l, { variant: "text", width: "60%" }),
|
|
23
|
+
/* @__PURE__ */ e(l, { variant: "rectangular", height: 40, width: "40%" }),
|
|
24
|
+
/* @__PURE__ */ e(l, { variant: "text", width: "80%" }),
|
|
25
25
|
t.showChart && /* @__PURE__ */ e(
|
|
26
|
-
|
|
26
|
+
l,
|
|
27
27
|
{
|
|
28
28
|
variant: "rectangular",
|
|
29
29
|
height: 40,
|
|
@@ -32,40 +32,50 @@ const G = (t) => {
|
|
|
32
32
|
}
|
|
33
33
|
)
|
|
34
34
|
] }) });
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const u = /* @__PURE__ */ i(
|
|
36
|
+
a,
|
|
37
37
|
{
|
|
38
38
|
direction: "row",
|
|
39
39
|
alignItems: "center",
|
|
40
40
|
spacing: 1,
|
|
41
41
|
flexWrap: d === "panel" ? "nowrap" : "wrap",
|
|
42
|
+
sx: { minWidth: 0 },
|
|
42
43
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
/* @__PURE__ */ i(
|
|
45
|
+
a,
|
|
46
|
+
{
|
|
47
|
+
direction: "row",
|
|
48
|
+
alignItems: "baseline",
|
|
49
|
+
spacing: 0.5,
|
|
50
|
+
sx: { minWidth: 0 },
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ e(c, { title: o, children: /* @__PURE__ */ e(V, { variant: "h4", ownerState: n, children: o }) }),
|
|
53
|
+
h && /* @__PURE__ */ e(c, { title: h, children: /* @__PURE__ */ e(k, { variant: "h5", ownerState: n, children: h }) })
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
j && /* @__PURE__ */ i(P, { ownerState: n, children: [
|
|
58
|
+
d === "overlay" && t.showTrend && /* @__PURE__ */ e(b, { size: 16 }),
|
|
59
|
+
t.showChange && s
|
|
50
60
|
] })
|
|
51
61
|
]
|
|
52
62
|
}
|
|
53
63
|
);
|
|
54
64
|
return /* @__PURE__ */ e(
|
|
55
|
-
|
|
65
|
+
f,
|
|
56
66
|
{
|
|
57
|
-
ownerState:
|
|
67
|
+
ownerState: n,
|
|
58
68
|
sx: t.sx,
|
|
59
|
-
"data-snapshot":
|
|
60
|
-
children: d === "panel" ? /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */ e(
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
t.description && /* @__PURE__ */ e(
|
|
69
|
+
"data-snapshot": T,
|
|
70
|
+
children: d === "panel" ? /* @__PURE__ */ i(m, { children: [
|
|
71
|
+
/* @__PURE__ */ e(c, { title: t.label, children: /* @__PURE__ */ e(v, { variant: "body2", children: t.label }) }),
|
|
72
|
+
/* @__PURE__ */ i(W, { children: [
|
|
73
|
+
/* @__PURE__ */ i(a, { justifyContent: "center", spacing: 0.5, sx: { flexShrink: 0 }, children: [
|
|
74
|
+
u,
|
|
75
|
+
t.description && /* @__PURE__ */ e(c, { title: t.description, children: /* @__PURE__ */ e(M, { variant: "caption", children: t.description }) })
|
|
66
76
|
] }),
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
g && /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(
|
|
78
|
+
w,
|
|
69
79
|
{
|
|
70
80
|
type: t.chartType,
|
|
71
81
|
data: t.value,
|
|
@@ -74,41 +84,41 @@ const G = (t) => {
|
|
|
74
84
|
}
|
|
75
85
|
) })
|
|
76
86
|
] })
|
|
77
|
-
] }) : /* @__PURE__ */
|
|
78
|
-
I &&
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
87
|
+
] }) : /* @__PURE__ */ i(m, { children: [
|
|
88
|
+
I && r && /* @__PURE__ */ e(A, { ownerState: n, children: /* @__PURE__ */ e(r, { size: 24 }) }),
|
|
89
|
+
/* @__PURE__ */ i(
|
|
90
|
+
a,
|
|
81
91
|
{
|
|
82
92
|
direction: "row",
|
|
83
93
|
justifyContent: "space-between",
|
|
84
94
|
alignItems: "flex-start",
|
|
85
95
|
sx: { flex: 1 },
|
|
86
96
|
children: [
|
|
87
|
-
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */ e(
|
|
90
|
-
|
|
97
|
+
C && r && x === "left" && /* @__PURE__ */ e(y, { ownerState: n, children: /* @__PURE__ */ e(r, { sx: { fontSize: 24 } }) }),
|
|
98
|
+
/* @__PURE__ */ i(D, { children: [
|
|
99
|
+
/* @__PURE__ */ e(c, { title: t.label, children: /* @__PURE__ */ e(v, { variant: "body2", children: t.label }) }),
|
|
100
|
+
u
|
|
91
101
|
] }),
|
|
92
|
-
|
|
102
|
+
C && r && x === "right" && /* @__PURE__ */ e(y, { ownerState: n, children: /* @__PURE__ */ e(r, { sx: { fontSize: 24 } }) })
|
|
93
103
|
]
|
|
94
104
|
}
|
|
95
105
|
),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
|
|
106
|
+
/* @__PURE__ */ i(
|
|
107
|
+
a,
|
|
98
108
|
{
|
|
99
109
|
direction: { xs: "column-reverse", sm: "column" },
|
|
100
110
|
spacing: 1,
|
|
101
111
|
sx: { width: "100%", mt: 2 },
|
|
102
112
|
children: [
|
|
103
|
-
t.description && /* @__PURE__ */ e(
|
|
104
|
-
|
|
113
|
+
t.description && /* @__PURE__ */ e(c, { title: t.description, children: /* @__PURE__ */ e(
|
|
114
|
+
M,
|
|
105
115
|
{
|
|
106
116
|
variant: "caption",
|
|
107
117
|
sx: { textAlign: { xs: "center", sm: "left" } },
|
|
108
118
|
children: t.description
|
|
109
119
|
}
|
|
110
|
-
),
|
|
111
|
-
|
|
120
|
+
) }),
|
|
121
|
+
g && /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(w, { type: t.chartType, data: t.value }) })
|
|
112
122
|
]
|
|
113
123
|
}
|
|
114
124
|
)
|
|
@@ -117,5 +127,5 @@ const G = (t) => {
|
|
|
117
127
|
);
|
|
118
128
|
};
|
|
119
129
|
export {
|
|
120
|
-
|
|
130
|
+
H as MetricCard
|
|
121
131
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { Widget as
|
|
3
|
-
import { variantColor as
|
|
1
|
+
import { styled as t, alpha as g, Stack as C, Typography as l } from "@mui/material";
|
|
2
|
+
import { Widget as f } from "../widget/styled.js";
|
|
3
|
+
import { variantColor as s, resolvePaletteColor as d, trendColor as u } from "./helpers.js";
|
|
4
4
|
const e = {
|
|
5
5
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
6
|
-
},
|
|
6
|
+
}, M = t(f.Root, {
|
|
7
7
|
name: "HCMetricCard",
|
|
8
8
|
slot: "Root",
|
|
9
9
|
...e
|
|
10
|
-
})(({ theme: o, ownerState:
|
|
11
|
-
const
|
|
12
|
-
let
|
|
13
|
-
return
|
|
10
|
+
})(({ theme: o, ownerState: i }) => {
|
|
11
|
+
const n = s(o, i.variant), a = i.layout === "panel";
|
|
12
|
+
let r;
|
|
13
|
+
return n ? r = g(n, 0.05) : a && (r = o.palette.background.default), {
|
|
14
14
|
position: "relative",
|
|
15
15
|
overflow: "hidden",
|
|
16
16
|
padding: o.spacing(1.5, 2),
|
|
17
|
-
...
|
|
17
|
+
...r && { backgroundColor: r },
|
|
18
18
|
[o.breakpoints.down("md")]: {
|
|
19
19
|
padding: o.spacing(1.5)
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
}),
|
|
22
|
+
}), w = t(C, {
|
|
23
23
|
name: "HCMetricCard",
|
|
24
24
|
slot: "Content"
|
|
25
25
|
})(() => ({
|
|
@@ -27,64 +27,79 @@ const e = {
|
|
|
27
27
|
width: "100%",
|
|
28
28
|
minWidth: 0,
|
|
29
29
|
zIndex: 1
|
|
30
|
-
})),
|
|
30
|
+
})), m = t(l, {
|
|
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
|
-
fontWeight: 500
|
|
37
|
-
|
|
36
|
+
fontWeight: 500,
|
|
37
|
+
// Widgets live in a resizable grid with no character limit — clip to one line
|
|
38
|
+
// so a long label never wraps into a messy multi-row block. Full text on hover.
|
|
39
|
+
whiteSpace: "nowrap",
|
|
40
|
+
overflow: "hidden",
|
|
41
|
+
textOverflow: "ellipsis",
|
|
42
|
+
maxWidth: "100%",
|
|
43
|
+
minWidth: 0
|
|
44
|
+
})), y = t(l, {
|
|
38
45
|
name: "HCMetricCard",
|
|
39
46
|
slot: "Value",
|
|
40
47
|
...e
|
|
41
|
-
})(({ theme: o, ownerState:
|
|
42
|
-
const
|
|
48
|
+
})(({ theme: o, ownerState: i }) => {
|
|
49
|
+
const n = d(o, i.calculatedValueColor), a = d(o, i.calculatedValueBg);
|
|
43
50
|
return {
|
|
44
|
-
color:
|
|
51
|
+
color: n ?? s(o, i.variant) ?? o.palette.text.primary,
|
|
45
52
|
fontWeight: 500,
|
|
46
53
|
marginBottom: o.spacing(0.5),
|
|
47
54
|
whiteSpace: "nowrap",
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
textOverflow: "ellipsis",
|
|
57
|
+
maxWidth: "100%",
|
|
58
|
+
minWidth: 0,
|
|
59
|
+
...a && {
|
|
60
|
+
backgroundColor: a,
|
|
50
61
|
borderRadius: o.shape.borderRadius,
|
|
51
62
|
padding: o.spacing(0, 0.75)
|
|
52
63
|
},
|
|
53
64
|
[o.breakpoints.down("md")]: { fontSize: "1.35rem" },
|
|
54
65
|
[o.breakpoints.up("md")]: { fontSize: "2rem" }
|
|
55
66
|
};
|
|
56
|
-
}),
|
|
67
|
+
}), W = t(l, {
|
|
57
68
|
name: "HCMetricCard",
|
|
58
69
|
slot: "SecondValue",
|
|
59
70
|
...e
|
|
60
|
-
})(({ theme: o, ownerState:
|
|
61
|
-
const
|
|
71
|
+
})(({ theme: o, ownerState: i }) => {
|
|
72
|
+
const n = d(o, i.calculatedSecondValueColor), a = d(o, i.calculatedSecondValueBg);
|
|
62
73
|
return {
|
|
63
|
-
color:
|
|
74
|
+
color: n ?? o.palette.text.secondary,
|
|
64
75
|
fontWeight: 400,
|
|
65
76
|
whiteSpace: "nowrap",
|
|
66
|
-
|
|
67
|
-
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
textOverflow: "ellipsis",
|
|
79
|
+
maxWidth: "100%",
|
|
80
|
+
minWidth: 0,
|
|
81
|
+
...a && {
|
|
82
|
+
backgroundColor: a,
|
|
68
83
|
borderRadius: o.shape.borderRadius,
|
|
69
84
|
padding: o.spacing(0, 0.75)
|
|
70
85
|
},
|
|
71
86
|
[o.breakpoints.down("md")]: { fontSize: "0.95rem" },
|
|
72
87
|
[o.breakpoints.up("md")]: { fontSize: "1.25rem" }
|
|
73
88
|
};
|
|
74
|
-
}),
|
|
89
|
+
}), S = t("div", {
|
|
75
90
|
name: "HCMetricCard",
|
|
76
91
|
slot: "TrendContainer",
|
|
77
92
|
...e
|
|
78
|
-
})(({ theme: o, ownerState:
|
|
79
|
-
const
|
|
93
|
+
})(({ theme: o, ownerState: i }) => {
|
|
94
|
+
const n = u(o, i.calculatedTrend), a = i.layout === "panel";
|
|
80
95
|
return {
|
|
81
96
|
display: "inline-flex",
|
|
82
97
|
alignItems: "center",
|
|
83
98
|
gap: o.spacing(0.5),
|
|
84
99
|
fontWeight: 500,
|
|
85
|
-
color:
|
|
86
|
-
...
|
|
87
|
-
backgroundColor: g(
|
|
100
|
+
color: n,
|
|
101
|
+
...a ? {
|
|
102
|
+
backgroundColor: g(n, 0.14),
|
|
88
103
|
borderRadius: 999,
|
|
89
104
|
padding: o.spacing(0.25, 1),
|
|
90
105
|
fontSize: "0.8125rem",
|
|
@@ -97,45 +112,49 @@ const e = {
|
|
|
97
112
|
}
|
|
98
113
|
}
|
|
99
114
|
};
|
|
100
|
-
}),
|
|
115
|
+
}), h = t(l, {
|
|
101
116
|
name: "HCMetricCard",
|
|
102
117
|
slot: "Description"
|
|
103
118
|
})(({ theme: o }) => ({
|
|
104
119
|
color: o.palette.text.secondary,
|
|
105
|
-
display: "block",
|
|
106
120
|
position: "relative",
|
|
107
|
-
zIndex: 1
|
|
108
|
-
|
|
121
|
+
zIndex: 1,
|
|
122
|
+
whiteSpace: "nowrap",
|
|
123
|
+
overflow: "hidden",
|
|
124
|
+
textOverflow: "ellipsis",
|
|
125
|
+
maxWidth: "100%",
|
|
126
|
+
minWidth: 0
|
|
127
|
+
})), k = t("div", {
|
|
109
128
|
name: "HCMetricCard",
|
|
110
129
|
slot: "Icon",
|
|
111
130
|
...e
|
|
112
|
-
})(({ theme: o, ownerState:
|
|
131
|
+
})(({ theme: o, ownerState: i }) => ({
|
|
113
132
|
display: "flex",
|
|
114
133
|
alignItems: "center",
|
|
115
134
|
justifyContent: "center",
|
|
116
|
-
color:
|
|
117
|
-
marginRight:
|
|
118
|
-
marginLeft:
|
|
135
|
+
color: s(o, i.variant) ?? o.palette.text.secondary,
|
|
136
|
+
marginRight: i.iconPosition === "left" ? o.spacing(2) : 0,
|
|
137
|
+
marginLeft: i.iconPosition === "right" ? o.spacing(2) : 0,
|
|
119
138
|
[o.breakpoints.down("sm")]: {
|
|
120
139
|
position: "absolute",
|
|
121
140
|
top: o.spacing(2),
|
|
122
141
|
left: o.spacing(2),
|
|
123
142
|
margin: 0
|
|
124
143
|
}
|
|
125
|
-
})),
|
|
144
|
+
})), H = t("div", {
|
|
126
145
|
name: "HCMetricCard",
|
|
127
146
|
slot: "CornerIcon",
|
|
128
147
|
...e
|
|
129
|
-
})(({ theme: o, ownerState:
|
|
130
|
-
var
|
|
131
|
-
const
|
|
132
|
-
return a
|
|
148
|
+
})(({ theme: o, ownerState: i }) => {
|
|
149
|
+
var c, p;
|
|
150
|
+
const n = {}, a = (c = i.iconPosition) != null && c.startsWith("top") ? "top" : "bottom", r = (p = i.iconPosition) != null && p.endsWith("left") ? "left" : "right";
|
|
151
|
+
return n[a] = o.spacing(2), n[r] = o.spacing(2), {
|
|
133
152
|
position: "absolute",
|
|
134
|
-
...
|
|
135
|
-
color:
|
|
153
|
+
...n,
|
|
154
|
+
color: s(o, i.variant) ?? o.palette.text.secondary,
|
|
136
155
|
zIndex: 2
|
|
137
156
|
};
|
|
138
|
-
}),
|
|
157
|
+
}), I = t("div", {
|
|
139
158
|
name: "HCMetricCard",
|
|
140
159
|
slot: "Chart"
|
|
141
160
|
})(({ theme: o }) => ({
|
|
@@ -148,7 +167,7 @@ const e = {
|
|
|
148
167
|
alignItems: "flex-end",
|
|
149
168
|
overflow: "hidden",
|
|
150
169
|
borderRadius: o.shape.borderRadius
|
|
151
|
-
})),
|
|
170
|
+
})), R = t("div", {
|
|
152
171
|
name: "HCMetricCard",
|
|
153
172
|
slot: "Panel"
|
|
154
173
|
})(({ theme: o }) => ({
|
|
@@ -165,7 +184,7 @@ const e = {
|
|
|
165
184
|
backgroundColor: o.palette.background.paper,
|
|
166
185
|
boxShadow: o.shadows[1],
|
|
167
186
|
overflow: "hidden"
|
|
168
|
-
})),
|
|
187
|
+
})), z = t("div", {
|
|
169
188
|
name: "HCMetricCard",
|
|
170
189
|
slot: "SideChart"
|
|
171
190
|
})(() => ({
|
|
@@ -178,16 +197,16 @@ const e = {
|
|
|
178
197
|
alignItems: "flex-end"
|
|
179
198
|
}));
|
|
180
199
|
export {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
200
|
+
I as MetricCardChartContainer,
|
|
201
|
+
w as MetricCardContent,
|
|
202
|
+
H as MetricCardCornerIconContainer,
|
|
203
|
+
h as MetricCardDescription,
|
|
204
|
+
k as MetricCardIconContainer,
|
|
205
|
+
m as MetricCardLabel,
|
|
206
|
+
R as MetricCardPanel,
|
|
207
|
+
M as MetricCardRoot,
|
|
208
|
+
W as MetricCardSecondValue,
|
|
209
|
+
z as MetricCardSideChart,
|
|
210
|
+
S as MetricCardTrendContainer,
|
|
211
|
+
y as MetricCardValue
|
|
193
212
|
};
|