@hybridcore/ui 1.5.74 → 1.5.77
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 +170 -0
- package/dist/main.d.ts +26 -0
- package/dist/main.js +24 -22
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { TrendingUp as w, TrendingDown as v, Remove as S } from "@mui/icons-material";
|
|
3
|
+
import { useTheme as C, Card as z, Box as o, Stack as m, Typography as c, alpha as t } from "@mui/material";
|
|
4
|
+
const V = ({
|
|
5
|
+
label: g,
|
|
6
|
+
value: h,
|
|
7
|
+
change: d,
|
|
8
|
+
changeType: u = "percentage",
|
|
9
|
+
trend: l,
|
|
10
|
+
icon: n,
|
|
11
|
+
iconPosition: s = "right",
|
|
12
|
+
description: p,
|
|
13
|
+
variant: b = "default",
|
|
14
|
+
className: x
|
|
15
|
+
}) => {
|
|
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
|
+
color: e.palette.success.main,
|
|
18
|
+
bgcolor: t(e.palette.success.main, 0.1)
|
|
19
|
+
} : l === "down" ? {
|
|
20
|
+
color: e.palette.error.main,
|
|
21
|
+
bgcolor: t(e.palette.error.main, 0.1)
|
|
22
|
+
} : {
|
|
23
|
+
color: e.palette.text.secondary,
|
|
24
|
+
bgcolor: e.palette.action.hover
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ i(
|
|
27
|
+
z,
|
|
28
|
+
{
|
|
29
|
+
sx: { ...(() => {
|
|
30
|
+
const a = {
|
|
31
|
+
p: 3,
|
|
32
|
+
borderRadius: 2,
|
|
33
|
+
boxShadow: 1,
|
|
34
|
+
transition: "all 0.3s",
|
|
35
|
+
"&:hover": { boxShadow: 3 },
|
|
36
|
+
border: 1
|
|
37
|
+
};
|
|
38
|
+
switch (b) {
|
|
39
|
+
case "primary":
|
|
40
|
+
return {
|
|
41
|
+
...a,
|
|
42
|
+
bgcolor: t(e.palette.primary.main, 0.05),
|
|
43
|
+
borderColor: t(e.palette.primary.main, 0.2)
|
|
44
|
+
};
|
|
45
|
+
case "success":
|
|
46
|
+
return {
|
|
47
|
+
...a,
|
|
48
|
+
bgcolor: t(e.palette.success.main, 0.05),
|
|
49
|
+
borderColor: t(e.palette.success.main, 0.2)
|
|
50
|
+
};
|
|
51
|
+
case "warning":
|
|
52
|
+
return {
|
|
53
|
+
...a,
|
|
54
|
+
bgcolor: t(e.palette.warning.main, 0.05),
|
|
55
|
+
borderColor: t(e.palette.warning.main, 0.2)
|
|
56
|
+
};
|
|
57
|
+
case "danger":
|
|
58
|
+
return {
|
|
59
|
+
...a,
|
|
60
|
+
bgcolor: t(e.palette.error.main, 0.05),
|
|
61
|
+
borderColor: t(e.palette.error.main, 0.2)
|
|
62
|
+
};
|
|
63
|
+
default:
|
|
64
|
+
return {
|
|
65
|
+
...a,
|
|
66
|
+
bgcolor: "background.paper",
|
|
67
|
+
borderColor: "divider"
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
})(), position: "relative", overflow: "hidden" },
|
|
71
|
+
className: x,
|
|
72
|
+
children: [
|
|
73
|
+
n && s === "watermark" && /* @__PURE__ */ r(
|
|
74
|
+
o,
|
|
75
|
+
{
|
|
76
|
+
sx: {
|
|
77
|
+
position: "absolute",
|
|
78
|
+
right: -20,
|
|
79
|
+
bottom: -20,
|
|
80
|
+
opacity: 0.05,
|
|
81
|
+
transform: "rotate(-15deg)",
|
|
82
|
+
pointerEvents: "none"
|
|
83
|
+
},
|
|
84
|
+
children: /* @__PURE__ */ r(n, { sx: { fontSize: 120, color: "text.primary" } })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ i(
|
|
88
|
+
m,
|
|
89
|
+
{
|
|
90
|
+
direction: "row",
|
|
91
|
+
justifyContent: "space-between",
|
|
92
|
+
alignItems: "flex-start",
|
|
93
|
+
children: [
|
|
94
|
+
n && s === "left" && /* @__PURE__ */ r(o, { mr: 2, children: /* @__PURE__ */ r(
|
|
95
|
+
o,
|
|
96
|
+
{
|
|
97
|
+
sx: {
|
|
98
|
+
width: 48,
|
|
99
|
+
height: 48,
|
|
100
|
+
borderRadius: "50%",
|
|
101
|
+
bgcolor: "action.hover",
|
|
102
|
+
display: "flex",
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
justifyContent: "center"
|
|
105
|
+
},
|
|
106
|
+
children: /* @__PURE__ */ r(n, { sx: { fontSize: 24, color: "text.secondary" } })
|
|
107
|
+
}
|
|
108
|
+
) }),
|
|
109
|
+
/* @__PURE__ */ i(o, { flex: 1, children: [
|
|
110
|
+
/* @__PURE__ */ r(c, { variant: "subtitle2", color: "text.secondary", mb: 0.5, children: g }),
|
|
111
|
+
/* @__PURE__ */ r(
|
|
112
|
+
c,
|
|
113
|
+
{
|
|
114
|
+
variant: "h4",
|
|
115
|
+
fontWeight: "bold",
|
|
116
|
+
color: "text.primary",
|
|
117
|
+
mb: 1,
|
|
118
|
+
children: h
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
d !== void 0 && /* @__PURE__ */ i(m, { direction: "row", alignItems: "center", spacing: 1, children: [
|
|
122
|
+
/* @__PURE__ */ i(
|
|
123
|
+
o,
|
|
124
|
+
{
|
|
125
|
+
sx: {
|
|
126
|
+
display: "inline-flex",
|
|
127
|
+
alignItems: "center",
|
|
128
|
+
gap: 0.5,
|
|
129
|
+
px: 1,
|
|
130
|
+
py: 0.5,
|
|
131
|
+
borderRadius: 10,
|
|
132
|
+
typography: "caption",
|
|
133
|
+
fontWeight: "medium",
|
|
134
|
+
...y()
|
|
135
|
+
},
|
|
136
|
+
children: [
|
|
137
|
+
f(),
|
|
138
|
+
d,
|
|
139
|
+
u === "percentage" ? "%" : ""
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
p && /* @__PURE__ */ r(c, { variant: "caption", color: "text.secondary", children: p })
|
|
144
|
+
] })
|
|
145
|
+
] }),
|
|
146
|
+
n && s === "right" && /* @__PURE__ */ r(o, { ml: 2, children: /* @__PURE__ */ r(
|
|
147
|
+
o,
|
|
148
|
+
{
|
|
149
|
+
sx: {
|
|
150
|
+
width: 48,
|
|
151
|
+
height: 48,
|
|
152
|
+
borderRadius: "50%",
|
|
153
|
+
bgcolor: "action.hover",
|
|
154
|
+
display: "flex",
|
|
155
|
+
alignItems: "center",
|
|
156
|
+
justifyContent: "center"
|
|
157
|
+
},
|
|
158
|
+
children: /* @__PURE__ */ r(n, { sx: { fontSize: 24, color: "text.secondary" } })
|
|
159
|
+
}
|
|
160
|
+
) })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
};
|
|
168
|
+
export {
|
|
169
|
+
V as MetricCard
|
|
170
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -663,6 +663,32 @@ 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, className, }: MetricCardProps) => JSX_2.Element;
|
|
667
|
+
|
|
668
|
+
export declare interface MetricCardProps {
|
|
669
|
+
label: string;
|
|
670
|
+
value: string | number;
|
|
671
|
+
change?: number;
|
|
672
|
+
changeType?: MetricChangeType;
|
|
673
|
+
trend?: MetricTrend;
|
|
674
|
+
icon?: React.ElementType;
|
|
675
|
+
iconPosition?: "left" | "right" | "watermark";
|
|
676
|
+
description?: string;
|
|
677
|
+
variant?: MetricVariant;
|
|
678
|
+
className?: string;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export declare type MetricChangeType = "percentage" | "absolute";
|
|
682
|
+
|
|
683
|
+
export declare type MetricTrend = "up" | "down" | "neutral";
|
|
684
|
+
|
|
685
|
+
export declare type MetricVariant =
|
|
686
|
+
| "default"
|
|
687
|
+
| "primary"
|
|
688
|
+
| "success"
|
|
689
|
+
| "warning"
|
|
690
|
+
| "danger";
|
|
691
|
+
|
|
666
692
|
declare type MousePosition = {
|
|
667
693
|
top: number;
|
|
668
694
|
left: number;
|
package/dist/main.js
CHANGED
|
@@ -26,17 +26,18 @@ import { S as Oe } from "./utils-Bq0ye5vf.js";
|
|
|
26
26
|
import { LinearIndicator as Se } from "./components/linear-indicator/index.js";
|
|
27
27
|
import { Loading as He } from "./components/loading/index.js";
|
|
28
28
|
import { i as Be } from "./index-JrtqxUdI.js";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
29
|
+
import { MetricCard as Ie } from "./components/metric-card/index.js";
|
|
30
|
+
import { PaginatedList as je } from "./components/paginated-list/index.js";
|
|
31
|
+
import { PhoneInput as We } from "./components/phone-input/index.js";
|
|
32
|
+
import { SearchInput as Ue } from "./components/search-input/index.js";
|
|
33
|
+
import { Tabs as Ze } from "./components/tabs/index.js";
|
|
34
|
+
import { TemplateFilters as Je } from "./components/template-filters/index.js";
|
|
35
|
+
import { TemplateForm as _e } from "./components/template-form/index.js";
|
|
36
|
+
import { TemplatePropertyFilters as Ge } from "./components/template-property-filters/index.js";
|
|
37
|
+
import { Property as Qe } from "./components/template-property-filters/property.js";
|
|
38
|
+
import { TreeSelect as Xe } from "./components/tree-select/index.js";
|
|
39
|
+
import { TreeViewFilter as er } from "./components/treeview-filter/index.js";
|
|
40
|
+
import { Uploader as sr } from "./components/uploader/index.js";
|
|
40
41
|
import { a as dt } from "./objectWithoutPropertiesLoose-DJteAcBH.js";
|
|
41
42
|
import C from "dayjs";
|
|
42
43
|
import { h as U, j as z } from "./createTheme-DrgvKMA_.js";
|
|
@@ -418,19 +419,20 @@ export {
|
|
|
418
419
|
He as Loading,
|
|
419
420
|
Ct as LocalizationProvider,
|
|
420
421
|
Be as Map,
|
|
421
|
-
Ie as
|
|
422
|
-
je as
|
|
423
|
-
|
|
424
|
-
|
|
422
|
+
Ie as MetricCard,
|
|
423
|
+
je as PaginatedList,
|
|
424
|
+
We as PhoneInput,
|
|
425
|
+
Qe as PropertyFilterInput,
|
|
426
|
+
Ue as SearchInput,
|
|
425
427
|
ie as SecurityLevel,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
Ze as Tabs,
|
|
429
|
+
Je as TemplateFilters,
|
|
430
|
+
_e as TemplateForm,
|
|
431
|
+
Ge as TemplatePropertyFilters,
|
|
430
432
|
Ht as ThemeProvider,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
433
|
+
Xe as TreeSelect,
|
|
434
|
+
er as TreeViewFilter,
|
|
435
|
+
sr as Uploader,
|
|
434
436
|
Rt as alert,
|
|
435
437
|
Xt as confirm,
|
|
436
438
|
Ft as createTheme
|