@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,15 +1,15 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { Stack as x, Skeleton as d } from "@mui/material";
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as x, Skeleton as d, Tooltip as e } from "@mui/material";
|
|
3
3
|
import { useStatusIndicatorLogic as v } from "./logic.js";
|
|
4
|
-
import { StatusIndicatorRoot as o, StatusIndicatorCaption as
|
|
5
|
-
const
|
|
6
|
-
const { state:
|
|
4
|
+
import { StatusIndicatorRoot as o, StatusIndicatorCaption as g, StatusIndicatorDescription as f, StatusIndicatorIconContainer as u, StatusIndicatorContent as w, StatusIndicatorLabel as I, StatusIndicatorValue as S, StatusIndicatorBadge as L, StatusIndicatorBadgeLabel as y } from "./styled.js";
|
|
5
|
+
const B = (i) => {
|
|
6
|
+
const { state: b } = v(i), { ownerState: n, variant: l, activeLabel: a, Icon: c } = b;
|
|
7
7
|
if (i.loading)
|
|
8
|
-
return /* @__PURE__ */ t(o, { ownerState: n, sx: i.sx, children: /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ t(o, { ownerState: n, sx: i.sx, children: /* @__PURE__ */ r(
|
|
9
9
|
x,
|
|
10
10
|
{
|
|
11
11
|
spacing: 1,
|
|
12
|
-
alignItems:
|
|
12
|
+
alignItems: l === "prominent" ? "center" : "flex-start",
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ t(d, { variant: "text", width: "50%" }),
|
|
15
15
|
/* @__PURE__ */ t(d, { variant: "circular", width: 40, height: 40 }),
|
|
@@ -17,28 +17,28 @@ const j = (i) => {
|
|
|
17
17
|
]
|
|
18
18
|
}
|
|
19
19
|
) });
|
|
20
|
-
const
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
i.label && /* @__PURE__ */ t(
|
|
25
|
-
/* @__PURE__ */ t(
|
|
26
|
-
|
|
20
|
+
const h = i.caption && /* @__PURE__ */ t(e, { title: i.caption, children: /* @__PURE__ */ t(g, { variant: "caption", children: i.caption }) }), s = i.description && /* @__PURE__ */ t(e, { title: i.description, children: /* @__PURE__ */ t(f, { variant: "body2", children: i.description }) });
|
|
21
|
+
return l === "split" ? /* @__PURE__ */ r(o, { ownerState: n, sx: i.sx, children: [
|
|
22
|
+
c && /* @__PURE__ */ t(u, { ownerState: n, children: /* @__PURE__ */ t(c, { size: 28 }) }),
|
|
23
|
+
/* @__PURE__ */ r(w, { children: [
|
|
24
|
+
i.label && /* @__PURE__ */ t(e, { title: i.label, children: /* @__PURE__ */ t(I, { variant: "body2", children: i.label }) }),
|
|
25
|
+
/* @__PURE__ */ t(e, { title: a, children: /* @__PURE__ */ t(S, { variant: "h5", ownerState: n, children: a }) }),
|
|
26
|
+
h,
|
|
27
27
|
s
|
|
28
28
|
] })
|
|
29
|
-
] }) : /* @__PURE__ */
|
|
30
|
-
i.label && /* @__PURE__ */ t(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */ t(
|
|
34
|
-
] }) : /* @__PURE__ */ e(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
] }),
|
|
38
|
-
|
|
29
|
+
] }) : /* @__PURE__ */ r(o, { ownerState: n, sx: i.sx, children: [
|
|
30
|
+
i.label && /* @__PURE__ */ t(e, { title: i.label, children: /* @__PURE__ */ t(I, { variant: "body2", children: i.label }) }),
|
|
31
|
+
l === "prominent" ? /* @__PURE__ */ r(m, { children: [
|
|
32
|
+
c && /* @__PURE__ */ t(u, { ownerState: n, children: /* @__PURE__ */ t(c, { size: 48 }) }),
|
|
33
|
+
/* @__PURE__ */ t(e, { title: a, children: /* @__PURE__ */ t(S, { variant: "h4", ownerState: n, children: a }) })
|
|
34
|
+
] }) : /* @__PURE__ */ t(e, { title: a, children: /* @__PURE__ */ r(L, { ownerState: n, children: [
|
|
35
|
+
c && /* @__PURE__ */ t(c, { size: 18 }),
|
|
36
|
+
/* @__PURE__ */ t(y, { children: a })
|
|
37
|
+
] }) }),
|
|
38
|
+
h,
|
|
39
39
|
s
|
|
40
40
|
] });
|
|
41
41
|
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
B as StatusIndicator
|
|
44
44
|
};
|
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
import { resolvePaletteColor as
|
|
3
|
-
import { Widget as
|
|
4
|
-
const
|
|
1
|
+
import { styled as n, Typography as r, alpha as s } from "@mui/material";
|
|
2
|
+
import { resolvePaletteColor as a } from "../metric-card/helpers.js";
|
|
3
|
+
import { Widget as c } from "../widget/styled.js";
|
|
4
|
+
const l = {
|
|
5
5
|
shouldForwardProp: (t) => t !== "ownerState"
|
|
6
|
-
},
|
|
6
|
+
}, g = n(c.Root, {
|
|
7
7
|
name: "HCStatusIndicator",
|
|
8
8
|
slot: "Root",
|
|
9
|
-
...
|
|
9
|
+
...l
|
|
10
10
|
})(({ theme: t, ownerState: o }) => {
|
|
11
|
-
const
|
|
11
|
+
const e = {
|
|
12
12
|
padding: t.spacing(2),
|
|
13
13
|
display: "flex",
|
|
14
14
|
gap: t.spacing(0.5)
|
|
15
15
|
};
|
|
16
16
|
return o.variant === "prominent" ? {
|
|
17
|
-
...
|
|
17
|
+
...e,
|
|
18
18
|
flexDirection: "column",
|
|
19
19
|
alignItems: "center",
|
|
20
20
|
justifyContent: "center",
|
|
21
21
|
textAlign: "center"
|
|
22
22
|
} : o.variant === "split" ? {
|
|
23
|
-
...
|
|
23
|
+
...e,
|
|
24
24
|
flexDirection: "row",
|
|
25
25
|
alignItems: "center",
|
|
26
26
|
gap: t.spacing(2)
|
|
27
27
|
} : {
|
|
28
|
-
...
|
|
28
|
+
...e,
|
|
29
29
|
flexDirection: "column",
|
|
30
30
|
alignItems: "flex-start",
|
|
31
31
|
justifyContent: "center"
|
|
32
32
|
};
|
|
33
|
-
}),
|
|
33
|
+
}), x = n(r, {
|
|
34
34
|
name: "HCStatusIndicator",
|
|
35
35
|
slot: "Label"
|
|
36
36
|
})(({ theme: t }) => ({
|
|
37
37
|
color: t.palette.text.secondary,
|
|
38
|
-
fontWeight: 500
|
|
39
|
-
|
|
38
|
+
fontWeight: 500,
|
|
39
|
+
// Widgets live in a resizable grid with no character limit — clip to one line
|
|
40
|
+
// so long text never overflows or wraps into a messy block. Full text on hover.
|
|
41
|
+
whiteSpace: "nowrap",
|
|
42
|
+
overflow: "hidden",
|
|
43
|
+
textOverflow: "ellipsis",
|
|
44
|
+
maxWidth: "100%",
|
|
45
|
+
minWidth: 0
|
|
46
|
+
})), m = n("div", {
|
|
40
47
|
name: "HCStatusIndicator",
|
|
41
48
|
slot: "IconContainer",
|
|
42
|
-
...
|
|
49
|
+
...l
|
|
43
50
|
})(({ theme: t, ownerState: o }) => {
|
|
44
|
-
const
|
|
51
|
+
const e = a(t, o.resolvedColor) ?? t.palette.text.primary, i = {
|
|
45
52
|
display: "flex",
|
|
46
53
|
alignItems: "center",
|
|
47
54
|
justifyContent: "center",
|
|
48
|
-
color:
|
|
55
|
+
color: e
|
|
49
56
|
};
|
|
50
57
|
if (o.variant === "split") {
|
|
51
|
-
const
|
|
58
|
+
const d = a(t, o.resolvedBackgroundColor) ?? s(e, 0.12);
|
|
52
59
|
return {
|
|
53
|
-
...
|
|
60
|
+
...i,
|
|
54
61
|
flexShrink: 0,
|
|
55
62
|
width: 56,
|
|
56
63
|
height: 56,
|
|
57
64
|
borderRadius: t.shape.borderRadius * 2,
|
|
58
|
-
backgroundColor:
|
|
65
|
+
backgroundColor: d
|
|
59
66
|
};
|
|
60
67
|
}
|
|
61
|
-
return
|
|
62
|
-
}),
|
|
68
|
+
return i;
|
|
69
|
+
}), C = n("div", {
|
|
63
70
|
name: "HCStatusIndicator",
|
|
64
71
|
slot: "Content"
|
|
65
72
|
})(() => ({
|
|
@@ -67,48 +74,77 @@ const s = {
|
|
|
67
74
|
flexDirection: "column",
|
|
68
75
|
minWidth: 0,
|
|
69
76
|
flex: 1
|
|
70
|
-
})),
|
|
77
|
+
})), h = n(r, {
|
|
71
78
|
name: "HCStatusIndicator",
|
|
72
79
|
slot: "Value",
|
|
73
|
-
...
|
|
80
|
+
...l
|
|
74
81
|
})(({ theme: t, ownerState: o }) => ({
|
|
75
82
|
fontWeight: 600,
|
|
76
83
|
lineHeight: 1.2,
|
|
77
|
-
color:
|
|
78
|
-
|
|
84
|
+
color: a(t, o.resolvedColor) ?? t.palette.text.primary,
|
|
85
|
+
whiteSpace: "nowrap",
|
|
86
|
+
overflow: "hidden",
|
|
87
|
+
textOverflow: "ellipsis",
|
|
88
|
+
maxWidth: "100%",
|
|
89
|
+
minWidth: 0
|
|
90
|
+
})), I = n("div", {
|
|
79
91
|
name: "HCStatusIndicator",
|
|
80
92
|
slot: "Badge",
|
|
81
|
-
...
|
|
93
|
+
...l
|
|
82
94
|
})(({ theme: t, ownerState: o }) => {
|
|
83
|
-
const
|
|
95
|
+
const e = a(t, o.resolvedColor) ?? t.palette.text.primary, i = a(t, o.resolvedBackgroundColor) ?? s(e, 0.12);
|
|
84
96
|
return {
|
|
85
97
|
display: "inline-flex",
|
|
86
98
|
alignItems: "center",
|
|
87
99
|
gap: t.spacing(0.75),
|
|
88
100
|
padding: t.spacing(0.5, 1.25),
|
|
89
101
|
borderRadius: 999,
|
|
90
|
-
backgroundColor:
|
|
91
|
-
color:
|
|
92
|
-
fontWeight: 600
|
|
102
|
+
backgroundColor: i,
|
|
103
|
+
color: e,
|
|
104
|
+
fontWeight: 600,
|
|
105
|
+
maxWidth: "100%",
|
|
106
|
+
overflow: "hidden",
|
|
107
|
+
// The icon must never shrink; only the label text ellipsizes.
|
|
108
|
+
"& > svg": { flexShrink: 0 }
|
|
93
109
|
};
|
|
94
|
-
}),
|
|
110
|
+
}), v = n("span", {
|
|
111
|
+
name: "HCStatusIndicator",
|
|
112
|
+
slot: "BadgeLabel"
|
|
113
|
+
})(() => ({
|
|
114
|
+
flex: "0 1 auto",
|
|
115
|
+
minWidth: 0,
|
|
116
|
+
overflow: "hidden",
|
|
117
|
+
textOverflow: "ellipsis",
|
|
118
|
+
whiteSpace: "nowrap"
|
|
119
|
+
})), S = n(r, {
|
|
95
120
|
name: "HCStatusIndicator",
|
|
96
121
|
slot: "Caption"
|
|
97
122
|
})(({ theme: t }) => ({
|
|
98
|
-
color: t.palette.text.secondary
|
|
99
|
-
|
|
123
|
+
color: t.palette.text.secondary,
|
|
124
|
+
whiteSpace: "nowrap",
|
|
125
|
+
overflow: "hidden",
|
|
126
|
+
textOverflow: "ellipsis",
|
|
127
|
+
maxWidth: "100%",
|
|
128
|
+
minWidth: 0
|
|
129
|
+
})), w = n(r, {
|
|
100
130
|
name: "HCStatusIndicator",
|
|
101
131
|
slot: "Description"
|
|
102
132
|
})(({ theme: t }) => ({
|
|
103
|
-
color: t.palette.text.secondary
|
|
133
|
+
color: t.palette.text.secondary,
|
|
134
|
+
whiteSpace: "nowrap",
|
|
135
|
+
overflow: "hidden",
|
|
136
|
+
textOverflow: "ellipsis",
|
|
137
|
+
maxWidth: "100%",
|
|
138
|
+
minWidth: 0
|
|
104
139
|
}));
|
|
105
140
|
export {
|
|
106
|
-
|
|
141
|
+
I as StatusIndicatorBadge,
|
|
142
|
+
v as StatusIndicatorBadgeLabel,
|
|
107
143
|
S as StatusIndicatorCaption,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
144
|
+
C as StatusIndicatorContent,
|
|
145
|
+
w as StatusIndicatorDescription,
|
|
146
|
+
m as StatusIndicatorIconContainer,
|
|
147
|
+
x as StatusIndicatorLabel,
|
|
148
|
+
g as StatusIndicatorRoot,
|
|
149
|
+
h as StatusIndicatorValue
|
|
114
150
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -3294,6 +3294,7 @@ declare module "@mui/material/styles" {
|
|
|
3294
3294
|
HCGeometryPicker:
|
|
3295
3295
|
| "root"
|
|
3296
3296
|
| "topLabel"
|
|
3297
|
+
| "header"
|
|
3297
3298
|
| "container"
|
|
3298
3299
|
| "actions"
|
|
3299
3300
|
| "actionButton"
|
|
@@ -3648,6 +3649,7 @@ declare module "@mui/material/styles" {
|
|
|
3648
3649
|
| "content"
|
|
3649
3650
|
| "value"
|
|
3650
3651
|
| "badge"
|
|
3652
|
+
| "badgeLabel"
|
|
3651
3653
|
| "caption"
|
|
3652
3654
|
| "description";
|
|
3653
3655
|
}
|