@hybridcore/ui 1.5.77 → 1.5.78
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/metric-card/index.js +48 -44
- package/dist/main.d.ts +2 -2
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ const V = ({
|
|
|
11
11
|
iconPosition: s = "right",
|
|
12
12
|
description: p,
|
|
13
13
|
variant: b = "default",
|
|
14
|
-
|
|
14
|
+
sx: x
|
|
15
15
|
}) => {
|
|
16
16
|
const e = C(), f = () => l === "up" ? /* @__PURE__ */ r(w, { sx: { fontSize: 16 } }) : l === "down" ? /* @__PURE__ */ r(v, { sx: { fontSize: 16 } }) : /* @__PURE__ */ r(S, { sx: { fontSize: 16 } }), y = () => l === "up" ? {
|
|
17
17
|
color: e.palette.success.main,
|
|
@@ -26,49 +26,53 @@ const V = ({
|
|
|
26
26
|
return /* @__PURE__ */ i(
|
|
27
27
|
z,
|
|
28
28
|
{
|
|
29
|
-
sx: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
29
|
+
sx: {
|
|
30
|
+
...(() => {
|
|
31
|
+
const a = {
|
|
32
|
+
p: 3,
|
|
33
|
+
borderRadius: 2,
|
|
34
|
+
boxShadow: 1,
|
|
35
|
+
transition: "all 0.3s",
|
|
36
|
+
"&:hover": { boxShadow: 3 },
|
|
37
|
+
border: 1
|
|
38
|
+
};
|
|
39
|
+
switch (b) {
|
|
40
|
+
case "primary":
|
|
41
|
+
return {
|
|
42
|
+
...a,
|
|
43
|
+
bgcolor: t(e.palette.primary.main, 0.05),
|
|
44
|
+
borderColor: t(e.palette.primary.main, 0.2)
|
|
45
|
+
};
|
|
46
|
+
case "success":
|
|
47
|
+
return {
|
|
48
|
+
...a,
|
|
49
|
+
bgcolor: t(e.palette.success.main, 0.05),
|
|
50
|
+
borderColor: t(e.palette.success.main, 0.2)
|
|
51
|
+
};
|
|
52
|
+
case "warning":
|
|
53
|
+
return {
|
|
54
|
+
...a,
|
|
55
|
+
bgcolor: t(e.palette.warning.main, 0.05),
|
|
56
|
+
borderColor: t(e.palette.warning.main, 0.2)
|
|
57
|
+
};
|
|
58
|
+
case "danger":
|
|
59
|
+
return {
|
|
60
|
+
...a,
|
|
61
|
+
bgcolor: t(e.palette.error.main, 0.05),
|
|
62
|
+
borderColor: t(e.palette.error.main, 0.2)
|
|
63
|
+
};
|
|
64
|
+
default:
|
|
65
|
+
return {
|
|
66
|
+
...a,
|
|
67
|
+
bgcolor: "background.paper",
|
|
68
|
+
borderColor: "divider"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
})(),
|
|
72
|
+
position: "relative",
|
|
73
|
+
overflow: "hidden",
|
|
74
|
+
...x
|
|
75
|
+
},
|
|
72
76
|
children: [
|
|
73
77
|
n && s === "watermark" && /* @__PURE__ */ r(
|
|
74
78
|
o,
|
package/dist/main.d.ts
CHANGED
|
@@ -663,7 +663,7 @@ export declare namespace Map_2 {
|
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
|
|
666
|
-
export declare const MetricCard: ({ label, value, change, changeType, trend, icon: Icon, iconPosition, description, variant,
|
|
666
|
+
export declare const MetricCard: ({ label, value, change, changeType, trend, icon: Icon, iconPosition, description, variant, sx, }: MetricCardProps) => JSX_2.Element;
|
|
667
667
|
|
|
668
668
|
export declare interface MetricCardProps {
|
|
669
669
|
label: string;
|
|
@@ -675,7 +675,7 @@ export declare interface MetricCardProps {
|
|
|
675
675
|
iconPosition?: "left" | "right" | "watermark";
|
|
676
676
|
description?: string;
|
|
677
677
|
variant?: MetricVariant;
|
|
678
|
-
|
|
678
|
+
sx?: SxProps<Theme_2>;
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
export declare type MetricChangeType = "percentage" | "absolute";
|