@mt-gloss/ui 0.1.139 → 0.2.0
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/{BaseAsyncButton-CJlY7Uik.js → BaseAsyncButton-Cq_l7clO.js} +29 -30
- package/COMMITS-Dm8qIHaq.js +444 -0
- package/Expandable-BcmIxWR8.js +13807 -0
- package/UIContext-DP6JGCto.js +1731 -0
- package/catalog.js +120 -122
- package/composites-panels.js +581 -1404
- package/index.d.ts +4 -2
- package/index.js +2368 -2029
- package/internals.js +80 -81
- package/lib/base/BaseAccordion/BaseAccordion.d.ts +4 -24
- package/lib/base/BaseCard/BaseCard.d.ts +8 -48
- package/lib/base/BaseCheckbox/BaseCheckbox.d.ts +1 -6
- package/lib/base/BaseInput/BaseInput.d.ts +1 -6
- package/lib/base/BaseMaskedInput/BaseMaskedInput.d.ts +1 -6
- package/lib/base/BaseMenu/BaseMenu.d.ts +2 -12
- package/lib/base/BaseRadio/BaseRadio.d.ts +1 -6
- package/lib/base/BaseRating/BaseRating.d.ts +1 -6
- package/lib/base/BaseSegmentedControl/BaseSegmentedControl.d.ts +1 -6
- package/lib/base/BaseSelect/BaseSelect.d.ts +2 -12
- package/lib/base/BaseTextarea/BaseTextarea.d.ts +1 -6
- package/lib/base/BaseToggle/BaseToggle.d.ts +1 -6
- package/lib/base/BaseTooltip/BaseTooltip.d.ts +1 -6
- package/lib/composites/dashboard/BellPopover/BellPopover.d.ts +0 -12
- package/lib/composites/forms/PasswordInput.d.ts +1 -6
- package/lib/composites/forms/PhoneInput.d.ts +1 -6
- package/lib/composites/forms/SearchInput.d.ts +1 -6
- package/lib/composites/forms/TagInput.d.ts +1 -6
- package/lib/composites/inputs/FilterChip.d.ts +1 -6
- package/lib/composites/overlay/SplitButton/SplitButton.d.ts +1 -6
- package/lib/composites/panels/PanelChrome.d.ts +1 -23
- package/lib/composites/panels/PanelSlot.d.ts +3 -14
- package/lib/composites/panels/coordinator/types.d.ts +1 -12
- package/lib/composites/panels/index.d.ts +4 -7
- package/lib/composites/panels/shells/CatalogAddShell.d.ts +8 -21
- package/lib/composites/panels/shells/CatalogReplaceShell.d.ts +4 -9
- package/lib/composites/panels/shells/PageMgmtShell.d.ts +3 -28
- package/lib/composites/panels/shells/SettingsShell.d.ts +3 -57
- package/lib/composites/panels/shells/index.d.ts +2 -4
- package/lib/composites/panels/shells/internals/CatalogLensPicker.d.ts +1 -14
- package/lib/composites/panels/shells/internals/CatalogTileGrid.d.ts +1 -18
- package/lib/composites/panels/shells/internals/PageMgmtFooter.d.ts +0 -11
- package/lib/composites/panels/shells/internals/PageMgmtRow.d.ts +1 -6
- package/lib/composites/panels/shells/internals/catalog-mocks.d.ts +8 -145
- package/lib/composites/panels/stage3d/CloneStage.d.ts +1 -11
- package/lib/containers/ContainerDialog/ContainerDialog.d.ts +3 -18
- package/lib/containers/ContainerFormSection/ContainerFormSection.d.ts +1 -6
- package/lib/containers/ContainerPanel/ContainerPanel.d.ts +1 -6
- package/lib/containers/ContainerTable/ContainerTable.d.ts +1 -6
- package/lib/containers/ContainerToolbar/ContainerToolbar.d.ts +1 -6
- package/lib/presets/PresetAccordion/PresetAccordion.d.ts +4 -24
- package/lib/presets/PresetBadge/PresetBadge.d.ts +1 -6
- package/lib/presets/PresetCard/PresetCard.d.ts +8 -48
- package/lib/presets/PresetCheckbox/PresetCheckbox.d.ts +1 -6
- package/lib/presets/PresetChip/PresetChip.d.ts +1 -6
- package/lib/presets/PresetColorPicker/PresetColorPicker.d.ts +1 -6
- package/lib/presets/PresetDatePicker/PresetDatePicker.d.ts +1 -6
- package/lib/presets/PresetDateRangePicker/PresetDateRangePicker.d.ts +1 -6
- package/lib/presets/PresetFileUpload/PresetFileUpload.d.ts +1 -6
- package/lib/presets/PresetInput/PresetInput.d.ts +1 -6
- package/lib/presets/PresetLink/PresetLink.d.ts +1 -6
- package/lib/presets/PresetMaskedInput/PresetMaskedInput.d.ts +1 -6
- package/lib/presets/PresetMenu/PresetMenu.d.ts +2 -12
- package/lib/presets/PresetNumberInput/PresetNumberInput.d.ts +1 -6
- package/lib/presets/PresetRadio/PresetRadio.d.ts +1 -6
- package/lib/presets/PresetRangeSlider/PresetRangeSlider.d.ts +1 -6
- package/lib/presets/PresetRating/PresetRating.d.ts +1 -6
- package/lib/presets/PresetTextarea/PresetTextarea.d.ts +1 -6
- package/lib/presets/PresetTimePicker/PresetTimePicker.d.ts +1 -6
- package/lib/presets/PresetToggle/PresetToggle.d.ts +1 -6
- package/lib/primitives/dashboard/ResizePill/ResizePill.d.ts +1 -7
- package/lib/primitives/dashboard/index.d.ts +0 -1
- package/lib/wrappers/Actionable/Actionable.d.ts +1 -6
- package/lib/wrappers/AsyncLoader/AsyncLoader.d.ts +1 -6
- package/lib/wrappers/ButtonGroup/ButtonGroup.d.ts +1 -6
- package/lib/wrappers/CheckboxGroup/CheckboxGroup.d.ts +1 -6
- package/lib/wrappers/Dismissible/Dismissible.d.ts +1 -6
- package/lib/wrappers/Expandable/Expandable.d.ts +1 -6
- package/lib/wrappers/InputGroup/InputGroup.d.ts +2 -12
- package/lib/wrappers/RadioGroup/RadioGroup.d.ts +1 -6
- package/lib/wrappers/Selectable/Selectable.d.ts +1 -6
- package/lib/wrappers/Sortable/Sortable.d.ts +1 -6
- package/package.json +1 -1
- package/ui.css +1 -1
- package/BaseText-Dxbk1JJa.js +0 -66
- package/COMMITS-DEdHYT0E.js +0 -963
- package/Expandable-DA4NFzCR.js +0 -13243
- package/MetricCard-DOPtBpek.js +0 -698
- package/UIContext-CGQI_KJk.js +0 -1808
- package/lib/composites/panels/chrome-v2/PanelBody.d.ts +0 -5
- package/lib/composites/panels/chrome-v2/PanelChromeV2.d.ts +0 -18
- package/lib/composites/panels/chrome-v2/PanelFooter.d.ts +0 -6
- package/lib/composites/panels/chrome-v2/PanelFooterMessage.d.ts +0 -6
- package/lib/composites/panels/chrome-v2/PanelHeader.d.ts +0 -10
- package/lib/composites/panels/chrome-v2/PanelNavigation.d.ts +0 -5
- package/lib/composites/panels/chrome-v2/PanelStage.d.ts +0 -5
- package/lib/composites/panels/chrome-v2/index.d.ts +0 -23
- package/lib/composites/panels/coordinator/settingsBufferSchemas.d.ts +0 -13
- package/lib/composites/panels/hooks/useEditingCardId.d.ts +0 -16
- package/lib/composites/panels/shells/MetricInfoShell.d.ts +0 -29
- package/lib/composites/panels/shells/NotificationCenterShell.d.ts +0 -2
- package/lib/composites/panels/shells/settings/GhostSlotPill.d.ts +0 -7
- package/lib/composites/panels/shells/settings/SlotsControls.d.ts +0 -11
- package/lib/composites/panels/shells/settings/TimeframeControls.d.ts +0 -6
- package/lib/composites/panels/shells/settings/index.d.ts +0 -14
- package/lib/primitives/dashboard/SettingsTabStrip/SettingsTabStrip.d.ts +0 -17
- package/lib/primitives/dashboard/SettingsTabStrip/index.d.ts +0 -6
- package/lib/primitives/dashboard/SettingsTabStrip/types.d.ts +0 -12
package/MetricCard-DOPtBpek.js
DELETED
|
@@ -1,698 +0,0 @@
|
|
|
1
|
-
import { jsxs as u, jsx as t, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { useId as de, useMemo as N, useState as he, useRef as R, useCallback as A, useEffect as ue } from "react";
|
|
3
|
-
import { formatTrend as fe, isStatusModeEnabled as ge, pickMetricTier as me, getValueFontSize as F, formatValue as E } from "@mt-gloss/utils";
|
|
4
|
-
import { B as z, a as $, b as pe } from "./BaseText-Dxbk1JJa.js";
|
|
5
|
-
const V = {
|
|
6
|
-
up: { color: "#10b981", bg: "rgba(16,185,129,0.07)" },
|
|
7
|
-
down: { color: "#ef4444", bg: "rgba(239,68,68,0.07)" },
|
|
8
|
-
flat: { color: "#6b7280", bg: "rgba(107,114,128,0.07)" }
|
|
9
|
-
}, P = {
|
|
10
|
-
up: "▲",
|
|
11
|
-
down: "▼",
|
|
12
|
-
flat: "▶"
|
|
13
|
-
}, D = function({ value: o, direction: e }) {
|
|
14
|
-
if (o == null) return null;
|
|
15
|
-
const { text: c, direction: d } = fe(o), i = e || d, { color: r, bg: s } = V[i] || V.flat, l = P[i] || P.flat;
|
|
16
|
-
return /* @__PURE__ */ u(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
style: {
|
|
20
|
-
display: "inline-flex",
|
|
21
|
-
alignItems: "center",
|
|
22
|
-
gap: 2,
|
|
23
|
-
padding: "2px 6px",
|
|
24
|
-
borderRadius: 4,
|
|
25
|
-
fontSize: 11,
|
|
26
|
-
fontWeight: 600,
|
|
27
|
-
lineHeight: 1,
|
|
28
|
-
color: r,
|
|
29
|
-
backgroundColor: s,
|
|
30
|
-
whiteSpace: "nowrap"
|
|
31
|
-
},
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 8, lineHeight: 1 }, children: l }),
|
|
34
|
-
c
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
D.displayName = "TrendIndicator";
|
|
40
|
-
const L = ({ data: n, color: o, isStale: e }) => {
|
|
41
|
-
const d = "sparkbg-" + de().replace(/:/g, ""), i = o || "#4f46e5", r = N(() => {
|
|
42
|
-
if (!n || n.length < 2) return null;
|
|
43
|
-
const s = 300, l = 55, h = 2, a = Math.min(...n), g = Math.max(...n) - a || 1, x = n.map((p, k) => ({
|
|
44
|
-
x: k / (n.length - 1) * s,
|
|
45
|
-
y: h + (1 - (p - a) / g) * (l - h * 2)
|
|
46
|
-
})).map((p, k) => `${k === 0 ? "M" : "L"}${p.x},${p.y}`).join(" "), v = `${x} L${s},${l} L0,${l}Z`;
|
|
47
|
-
return { line: x, area: v, w: s, h: l };
|
|
48
|
-
}, [n]);
|
|
49
|
-
return r ? /* @__PURE__ */ u(
|
|
50
|
-
"svg",
|
|
51
|
-
{
|
|
52
|
-
height: 55,
|
|
53
|
-
viewBox: `0 0 ${r.w} ${r.h}`,
|
|
54
|
-
preserveAspectRatio: "none",
|
|
55
|
-
style: {
|
|
56
|
-
position: "absolute",
|
|
57
|
-
// quick-260418-k7k-fix-4: "bleed" means REACH the card edges — NOT
|
|
58
|
-
// extend past them. CardShell's FRONT BaseBox has `inset: 0` inside
|
|
59
|
-
// CardShell root, so its padding-box (= containing block for abs
|
|
60
|
-
// descendants) is the FULL card size. width:100% + left:0 + right:0
|
|
61
|
-
// + bottom:0 lands the SVG exactly inside the card border. Earlier
|
|
62
|
-
// fix-3 added `calc(100% + 24px)` to overshoot each side by 12px,
|
|
63
|
-
// which user rejected ("Why on earth would I want the sparklines
|
|
64
|
-
// to go beyond the edge of the cards?"). StackedGroupCard hoists
|
|
65
|
-
// SparklineBg to Fragment-root so its containing block matches the
|
|
66
|
-
// 1×1 MetricCard path (FRONT BaseBox padding-box = full card).
|
|
67
|
-
bottom: 0,
|
|
68
|
-
left: 0,
|
|
69
|
-
right: 0,
|
|
70
|
-
width: "100%",
|
|
71
|
-
zIndex: 1,
|
|
72
|
-
display: "block",
|
|
73
|
-
pointerEvents: "none",
|
|
74
|
-
transform: e ? "scaleY(0.05)" : "scaleY(1)",
|
|
75
|
-
transformOrigin: "bottom",
|
|
76
|
-
transition: e ? "transform 400ms ease-out" : "transform 500ms ease-in-out"
|
|
77
|
-
},
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ u("linearGradient", { id: d, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
80
|
-
/* @__PURE__ */ t("stop", { offset: "0%", stopColor: i, stopOpacity: "0.09" }),
|
|
81
|
-
/* @__PURE__ */ t("stop", { offset: "100%", stopColor: i, stopOpacity: "0.01" })
|
|
82
|
-
] }) }),
|
|
83
|
-
/* @__PURE__ */ t("path", { d: r.area, fill: `url(#${d})` }),
|
|
84
|
-
/* @__PURE__ */ t(
|
|
85
|
-
"path",
|
|
86
|
-
{
|
|
87
|
-
d: r.line,
|
|
88
|
-
fill: "none",
|
|
89
|
-
stroke: i,
|
|
90
|
-
strokeOpacity: "0.22",
|
|
91
|
-
strokeWidth: "1.5",
|
|
92
|
-
strokeLinecap: "round",
|
|
93
|
-
strokeLinejoin: "round"
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
) : null;
|
|
99
|
-
};
|
|
100
|
-
L.displayName = "SparklineBg";
|
|
101
|
-
const G = ({ data: n, color: o, isStale: e }) => {
|
|
102
|
-
const c = o || "#4f46e5", d = N(() => {
|
|
103
|
-
if (!n || n.length < 1) return null;
|
|
104
|
-
const i = 300, r = 50, s = r * 0.82, l = n.length, h = i / (l * 4), a = h * 3, g = Math.max(...n) || 1;
|
|
105
|
-
return n.map((b, x) => {
|
|
106
|
-
const v = b / g, p = Math.max(v * s, 2);
|
|
107
|
-
return {
|
|
108
|
-
x: x * (a + h),
|
|
109
|
-
y: r - p,
|
|
110
|
-
width: a,
|
|
111
|
-
height: p,
|
|
112
|
-
isLast: x === l - 1
|
|
113
|
-
};
|
|
114
|
-
});
|
|
115
|
-
}, [n]);
|
|
116
|
-
return d ? /* @__PURE__ */ t(
|
|
117
|
-
"svg",
|
|
118
|
-
{
|
|
119
|
-
width: "100%",
|
|
120
|
-
height: 50,
|
|
121
|
-
viewBox: "0 0 300 50",
|
|
122
|
-
preserveAspectRatio: "none",
|
|
123
|
-
style: {
|
|
124
|
-
position: "absolute",
|
|
125
|
-
bottom: 0,
|
|
126
|
-
left: 0,
|
|
127
|
-
right: 0,
|
|
128
|
-
zIndex: 1,
|
|
129
|
-
display: "block",
|
|
130
|
-
pointerEvents: "none",
|
|
131
|
-
transform: e ? "scaleY(0.05)" : "scaleY(1)",
|
|
132
|
-
transformOrigin: "bottom",
|
|
133
|
-
transition: e ? "transform 400ms ease-out" : "transform 500ms ease-in-out"
|
|
134
|
-
},
|
|
135
|
-
children: d.map((i, r) => /* @__PURE__ */ t(
|
|
136
|
-
"rect",
|
|
137
|
-
{
|
|
138
|
-
x: i.x,
|
|
139
|
-
y: i.y,
|
|
140
|
-
width: i.width,
|
|
141
|
-
height: i.height,
|
|
142
|
-
fill: c,
|
|
143
|
-
fillOpacity: i.isLast ? 0.14 : 0.06,
|
|
144
|
-
rx: "2.5"
|
|
145
|
-
},
|
|
146
|
-
r
|
|
147
|
-
))
|
|
148
|
-
}
|
|
149
|
-
) : null;
|
|
150
|
-
};
|
|
151
|
-
G.displayName = "BarsBg";
|
|
152
|
-
const U = ({ value: n = 0, max: o = 100, color: e = "#4f46e5", colSpan: c = 1, isStale: d }) => {
|
|
153
|
-
const i = c >= 2 ? 40 : 34, r = 3.5, s = (i - r) / 2, l = 2 * Math.PI * s, h = d ? 0 : Math.min(Math.max(n / (o || 1), 0), 1), a = l * (1 - h);
|
|
154
|
-
return /* @__PURE__ */ u(
|
|
155
|
-
"svg",
|
|
156
|
-
{
|
|
157
|
-
width: i,
|
|
158
|
-
height: i,
|
|
159
|
-
viewBox: `0 0 ${i} ${i}`,
|
|
160
|
-
style: { flexShrink: 0, marginRight: 8, display: "block" },
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ t(
|
|
163
|
-
"circle",
|
|
164
|
-
{
|
|
165
|
-
cx: i / 2,
|
|
166
|
-
cy: i / 2,
|
|
167
|
-
r: s,
|
|
168
|
-
fill: "none",
|
|
169
|
-
stroke: e,
|
|
170
|
-
strokeOpacity: "0.06",
|
|
171
|
-
strokeWidth: r
|
|
172
|
-
}
|
|
173
|
-
),
|
|
174
|
-
/* @__PURE__ */ t(
|
|
175
|
-
"circle",
|
|
176
|
-
{
|
|
177
|
-
cx: i / 2,
|
|
178
|
-
cy: i / 2,
|
|
179
|
-
r: s,
|
|
180
|
-
fill: "none",
|
|
181
|
-
stroke: e,
|
|
182
|
-
strokeWidth: r,
|
|
183
|
-
strokeDasharray: l,
|
|
184
|
-
strokeDashoffset: a,
|
|
185
|
-
strokeLinecap: "round",
|
|
186
|
-
transform: `rotate(-90 ${i / 2} ${i / 2})`,
|
|
187
|
-
style: { transition: "stroke-dashoffset 0.4s ease" }
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
]
|
|
191
|
-
}
|
|
192
|
-
);
|
|
193
|
-
};
|
|
194
|
-
U.displayName = "DonutChart";
|
|
195
|
-
const Z = ({ value: n = 0, max: o = 100, trendValue: e = 0, color: c = "#6b7280", colSpan: d = 1, isStale: i }) => {
|
|
196
|
-
const r = d >= 2 ? 44 : 36, s = 3.5, l = (r - s) / 2, h = 2 * Math.PI * l, a = i ? 0 : Math.min(Math.max(n / (o || 1), 0), 1), f = h * (1 - a), g = d >= 2 ? 11 : 9, b = `${Math.round(Math.abs(e))}%`;
|
|
197
|
-
return /* @__PURE__ */ u(
|
|
198
|
-
"div",
|
|
199
|
-
{
|
|
200
|
-
style: {
|
|
201
|
-
position: "relative",
|
|
202
|
-
display: "inline-flex",
|
|
203
|
-
alignItems: "center",
|
|
204
|
-
justifyContent: "center",
|
|
205
|
-
width: r,
|
|
206
|
-
height: r,
|
|
207
|
-
flexShrink: 0,
|
|
208
|
-
marginRight: 8
|
|
209
|
-
},
|
|
210
|
-
children: [
|
|
211
|
-
/* @__PURE__ */ u(
|
|
212
|
-
"svg",
|
|
213
|
-
{
|
|
214
|
-
width: r,
|
|
215
|
-
height: r,
|
|
216
|
-
viewBox: `0 0 ${r} ${r}`,
|
|
217
|
-
style: { display: "block" },
|
|
218
|
-
children: [
|
|
219
|
-
/* @__PURE__ */ t(
|
|
220
|
-
"circle",
|
|
221
|
-
{
|
|
222
|
-
cx: r / 2,
|
|
223
|
-
cy: r / 2,
|
|
224
|
-
r: l,
|
|
225
|
-
fill: "none",
|
|
226
|
-
stroke: c,
|
|
227
|
-
strokeOpacity: "0.06",
|
|
228
|
-
strokeWidth: s
|
|
229
|
-
}
|
|
230
|
-
),
|
|
231
|
-
/* @__PURE__ */ t(
|
|
232
|
-
"circle",
|
|
233
|
-
{
|
|
234
|
-
cx: r / 2,
|
|
235
|
-
cy: r / 2,
|
|
236
|
-
r: l,
|
|
237
|
-
fill: "none",
|
|
238
|
-
stroke: c,
|
|
239
|
-
strokeWidth: s,
|
|
240
|
-
strokeDasharray: h,
|
|
241
|
-
strokeDashoffset: f,
|
|
242
|
-
strokeLinecap: "round",
|
|
243
|
-
transform: `rotate(-90 ${r / 2} ${r / 2})`,
|
|
244
|
-
style: { transition: "stroke-dashoffset 0.4s ease" }
|
|
245
|
-
}
|
|
246
|
-
)
|
|
247
|
-
]
|
|
248
|
-
}
|
|
249
|
-
),
|
|
250
|
-
/* @__PURE__ */ t(
|
|
251
|
-
"div",
|
|
252
|
-
{
|
|
253
|
-
style: {
|
|
254
|
-
position: "absolute",
|
|
255
|
-
inset: 0,
|
|
256
|
-
display: "flex",
|
|
257
|
-
alignItems: "center",
|
|
258
|
-
justifyContent: "center",
|
|
259
|
-
fontSize: g,
|
|
260
|
-
fontWeight: 700,
|
|
261
|
-
color: c,
|
|
262
|
-
lineHeight: 1,
|
|
263
|
-
pointerEvents: "none"
|
|
264
|
-
},
|
|
265
|
-
children: b
|
|
266
|
-
}
|
|
267
|
-
)
|
|
268
|
-
]
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
};
|
|
272
|
-
Z.displayName = "ObjectArrow";
|
|
273
|
-
const be = { slot3: 200, slot5: 380 };
|
|
274
|
-
function xe(n, o) {
|
|
275
|
-
const e = be, c = 150, [d, i] = he(1), r = R(null), s = R(null), l = A(() => {
|
|
276
|
-
const a = r.current;
|
|
277
|
-
if (a == null) return;
|
|
278
|
-
const f = a < e.slot3 ? 1 : a < e.slot5 ? 3 : 5;
|
|
279
|
-
i((g) => g === f ? g : f), r.current = null, s.current && (clearTimeout(s.current), s.current = null);
|
|
280
|
-
}, [e.slot3, e.slot5]);
|
|
281
|
-
ue(() => {
|
|
282
|
-
const a = n.current;
|
|
283
|
-
if (!a || typeof ResizeObserver > "u") return;
|
|
284
|
-
const f = new ResizeObserver((g) => {
|
|
285
|
-
const b = g[0]?.contentRect.width ?? 0;
|
|
286
|
-
r.current = b, s.current && clearTimeout(s.current), s.current = setTimeout(l, c);
|
|
287
|
-
});
|
|
288
|
-
return f.observe(a), () => {
|
|
289
|
-
f.disconnect(), s.current && clearTimeout(s.current);
|
|
290
|
-
};
|
|
291
|
-
}, [n, l, c]);
|
|
292
|
-
const h = A(() => {
|
|
293
|
-
l();
|
|
294
|
-
}, [l]);
|
|
295
|
-
return { capacity: d, onPointerUp: h };
|
|
296
|
-
}
|
|
297
|
-
function q(n) {
|
|
298
|
-
const { onStatusSlotClick: o } = n, e = R(null), c = ge(), { capacity: d, onPointerUp: i } = xe(e), r = n.maxSlots ?? d, s = n.statuses.slice(0, r);
|
|
299
|
-
if (!c) {
|
|
300
|
-
const l = n.statuses[0];
|
|
301
|
-
return /* @__PURE__ */ u(
|
|
302
|
-
z,
|
|
303
|
-
{
|
|
304
|
-
definition: { display: "flex", direction: "column" },
|
|
305
|
-
className: "gloss-status-card gloss-status-card--flag-off",
|
|
306
|
-
children: [
|
|
307
|
-
/* @__PURE__ */ t($, { className: "gloss-metric-card__label", children: n.label }),
|
|
308
|
-
l != null ? /* @__PURE__ */ t($, { children: String(l.value) }) : null
|
|
309
|
-
]
|
|
310
|
-
}
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
return /* @__PURE__ */ u(
|
|
314
|
-
"div",
|
|
315
|
-
{
|
|
316
|
-
ref: e,
|
|
317
|
-
className: "gloss-status-card",
|
|
318
|
-
"data-status-mode": "on",
|
|
319
|
-
"data-status-capacity": r,
|
|
320
|
-
onPointerUp: i,
|
|
321
|
-
children: [
|
|
322
|
-
/* @__PURE__ */ t($, { className: "gloss-metric-card__label", children: n.label }),
|
|
323
|
-
/* @__PURE__ */ t("div", { className: "gloss-status-slots", "data-status-slot-count": s.length, children: s.map((l, h) => {
|
|
324
|
-
const a = n.sparklinePerStatus?.[l.id], f = l.id === n.activeStatusId;
|
|
325
|
-
return /* @__PURE__ */ u(
|
|
326
|
-
"div",
|
|
327
|
-
{
|
|
328
|
-
className: `gloss-status-slots__slot${f ? " gloss-status-slots__slot--active" : ""}`,
|
|
329
|
-
"data-status-slot-id": l.id,
|
|
330
|
-
"data-status-slot-index": h,
|
|
331
|
-
onClick: o ? (g) => o(l.id, g.currentTarget) : void 0,
|
|
332
|
-
style: o ? { cursor: "pointer" } : void 0,
|
|
333
|
-
children: [
|
|
334
|
-
/* @__PURE__ */ t("span", { className: "gloss-metric-card__label", children: l.label }),
|
|
335
|
-
/* @__PURE__ */ t("span", { children: String(l.value) }),
|
|
336
|
-
a != null && a.length > 0 ? /* @__PURE__ */ t(L, { data: [...a], color: l.accentColor }) : null
|
|
337
|
-
]
|
|
338
|
-
},
|
|
339
|
-
l.id
|
|
340
|
-
);
|
|
341
|
-
}) })
|
|
342
|
-
]
|
|
343
|
-
}
|
|
344
|
-
);
|
|
345
|
-
}
|
|
346
|
-
q.displayName = "StatusModeCard";
|
|
347
|
-
function ye(n, o) {
|
|
348
|
-
if (!o) return;
|
|
349
|
-
if (n == null) return o.fallback;
|
|
350
|
-
const { operator: e, threshold: c, result: d, fallback: i } = o;
|
|
351
|
-
return (e === "lt" ? n < c : e === "gt" ? n > c : e === "eq" ? Math.abs(n - c) < 1e-9 : e === "gte" ? n >= c : e === "lte" ? n <= c : !1) ? d : i;
|
|
352
|
-
}
|
|
353
|
-
function Y(n, o) {
|
|
354
|
-
const e = n.replace("#", "");
|
|
355
|
-
if (!/^[0-9a-fA-F]{6}$/.test(e))
|
|
356
|
-
return `rgba(0,0,0,${o})`;
|
|
357
|
-
const c = parseInt(e.substring(0, 2), 16), d = parseInt(e.substring(2, 4), 16), i = parseInt(e.substring(4, 6), 16);
|
|
358
|
-
return `rgba(${c},${d},${i},${o})`;
|
|
359
|
-
}
|
|
360
|
-
const O = {
|
|
361
|
-
up: "var(--color-positive)",
|
|
362
|
-
down: "var(--color-negative)",
|
|
363
|
-
flat: "var(--color-text-secondary)"
|
|
364
|
-
}, ve = {
|
|
365
|
-
positive: "#10b981",
|
|
366
|
-
// Used with hexToRgba() for tinted overlays -- must stay hex
|
|
367
|
-
negative: "#ef4444",
|
|
368
|
-
// Used with hexToRgba() for tinted overlays -- must stay hex
|
|
369
|
-
warning: "#f59e0b",
|
|
370
|
-
// Used with hexToRgba() for tinted overlays -- must stay hex
|
|
371
|
-
neutral: "#6b7280"
|
|
372
|
-
// Used with hexToRgba() for tinted overlays -- must stay hex
|
|
373
|
-
}, ke = () => /* @__PURE__ */ u(
|
|
374
|
-
"svg",
|
|
375
|
-
{
|
|
376
|
-
"aria-label": "Warning threshold breached",
|
|
377
|
-
role: "img",
|
|
378
|
-
width: "14",
|
|
379
|
-
height: "14",
|
|
380
|
-
viewBox: "0 0 14 14",
|
|
381
|
-
fill: "none",
|
|
382
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
383
|
-
children: [
|
|
384
|
-
/* @__PURE__ */ t(
|
|
385
|
-
"path",
|
|
386
|
-
{
|
|
387
|
-
d: "M7 1.5L13 12.5H1L7 1.5Z",
|
|
388
|
-
fill: "currentColor",
|
|
389
|
-
fillOpacity: "0.15",
|
|
390
|
-
stroke: "currentColor",
|
|
391
|
-
strokeWidth: "1.2",
|
|
392
|
-
strokeLinejoin: "round"
|
|
393
|
-
}
|
|
394
|
-
),
|
|
395
|
-
/* @__PURE__ */ t("line", { x1: "7", y1: "5.5", x2: "7", y2: "8.5", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" }),
|
|
396
|
-
/* @__PURE__ */ t("circle", { cx: "7", cy: "10.5", r: "0.7", fill: "currentColor" })
|
|
397
|
-
]
|
|
398
|
-
}
|
|
399
|
-
), we = () => /* @__PURE__ */ u(
|
|
400
|
-
"svg",
|
|
401
|
-
{
|
|
402
|
-
"aria-label": "Critical threshold breached",
|
|
403
|
-
role: "img",
|
|
404
|
-
width: "14",
|
|
405
|
-
height: "14",
|
|
406
|
-
viewBox: "0 0 14 14",
|
|
407
|
-
fill: "none",
|
|
408
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
409
|
-
children: [
|
|
410
|
-
/* @__PURE__ */ t("circle", { cx: "7", cy: "7", r: "6", fill: "currentColor", fillOpacity: "0.15", stroke: "currentColor", strokeWidth: "1.2" }),
|
|
411
|
-
/* @__PURE__ */ t("line", { x1: "7", y1: "4", x2: "7", y2: "8", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" }),
|
|
412
|
-
/* @__PURE__ */ t("circle", { cx: "7", cy: "10", r: "0.7", fill: "currentColor" })
|
|
413
|
-
]
|
|
414
|
-
}
|
|
415
|
-
), Se = function(o) {
|
|
416
|
-
const {
|
|
417
|
-
variant: e = "standard",
|
|
418
|
-
label: c,
|
|
419
|
-
labelAdornment: d,
|
|
420
|
-
value: i,
|
|
421
|
-
valueFormat: r,
|
|
422
|
-
trend: s,
|
|
423
|
-
subtitle: l,
|
|
424
|
-
colSpan: h = 1,
|
|
425
|
-
isStale: a,
|
|
426
|
-
thresholdBreach: f = "none"
|
|
427
|
-
} = o, g = e === "sparkline" || e === "bars" || e === "donut" ? o.accentColor ?? "#4f46e5" : "#4f46e5", b = e === "highlight" ? o.highlightColor : void 0, x = e === "sparkline" ? o.sparklineData : void 0, v = e === "bars" ? o.barData : void 0, p = e === "donut" ? o.donutValue : 0, k = e === "donut" ? o.donutMax ?? 100 : 100, J = e === "object-arrow" ? o.objectArrowValue : 0, K = e === "object-arrow" ? o.objectArrowMax : 100, Q = e === "arrow" ? o.arrowDirection : void 0, w = e === "versus" ? o.versusData : void 0, C = e === "segmented" ? o.segments : void 0, M = (e === "highlight" && o.tintCondition ? ye(
|
|
428
|
-
typeof o.value == "number" ? o.value : null,
|
|
429
|
-
o.tintCondition
|
|
430
|
-
) : void 0) ?? b, I = (M ? ve[M] : void 0) || M, { formatted: B, tier: X, length: ee } = N(
|
|
431
|
-
() => e === "status-mode" ? { formatted: "", tier: 0, length: 0 } : me(i, {
|
|
432
|
-
prefix: r?.prefix || "",
|
|
433
|
-
suffix: r?.suffix || "",
|
|
434
|
-
abbreviated: r?.abbreviated
|
|
435
|
-
}, h),
|
|
436
|
-
[e, i, r?.prefix, r?.suffix, r?.abbreviated, h]
|
|
437
|
-
);
|
|
438
|
-
if (o.variant === "status-mode")
|
|
439
|
-
return /* @__PURE__ */ t(q, { ...o });
|
|
440
|
-
const S = { display: B, full: B, length: ee }, te = F(S.length, h), re = s?.direction && O[s.direction] || O.flat, T = a ? "gloss-metric-data-stale" : "gloss-metric-data-fresh", W = {
|
|
441
|
-
fontWeight: 700,
|
|
442
|
-
letterSpacing: "-0.03em",
|
|
443
|
-
color: e === "highlight" ? I : "rgba(0,0,0,0.87)",
|
|
444
|
-
fontSize: te,
|
|
445
|
-
lineHeight: 1.1,
|
|
446
|
-
whiteSpace: "nowrap",
|
|
447
|
-
overflow: "hidden"
|
|
448
|
-
}, _ = {
|
|
449
|
-
fontSize: 10.5,
|
|
450
|
-
color: "rgba(0,0,0,0.35)",
|
|
451
|
-
overflow: "hidden",
|
|
452
|
-
textOverflow: "ellipsis",
|
|
453
|
-
whiteSpace: "nowrap",
|
|
454
|
-
flex: 1,
|
|
455
|
-
minWidth: 0
|
|
456
|
-
}, j = e === "sparkline" || e === "bars", ne = j && l ? {
|
|
457
|
-
..._,
|
|
458
|
-
backgroundColor: "rgba(255,255,255,0.78)",
|
|
459
|
-
backdropFilter: "blur(4px)",
|
|
460
|
-
WebkitBackdropFilter: "blur(4px)",
|
|
461
|
-
padding: "1px 6px",
|
|
462
|
-
borderRadius: 4,
|
|
463
|
-
color: "rgba(0,0,0,0.5)",
|
|
464
|
-
flex: "none",
|
|
465
|
-
minWidth: void 0
|
|
466
|
-
} : _, oe = () => {
|
|
467
|
-
const m = Q === "down" ? "▼" : "▲";
|
|
468
|
-
return /* @__PURE__ */ t(
|
|
469
|
-
"div",
|
|
470
|
-
{
|
|
471
|
-
style: {
|
|
472
|
-
width: 22,
|
|
473
|
-
height: 22,
|
|
474
|
-
borderRadius: 5,
|
|
475
|
-
backgroundColor: `${g}14`,
|
|
476
|
-
// ~8% opacity
|
|
477
|
-
display: "flex",
|
|
478
|
-
alignItems: "center",
|
|
479
|
-
justifyContent: "center",
|
|
480
|
-
flexShrink: 0,
|
|
481
|
-
marginRight: 6
|
|
482
|
-
},
|
|
483
|
-
children: /* @__PURE__ */ t("span", { style: { fontSize: 10, color: g, lineHeight: 1 }, children: m })
|
|
484
|
-
}
|
|
485
|
-
);
|
|
486
|
-
}, ie = () => {
|
|
487
|
-
if (!w) return null;
|
|
488
|
-
const m = E(w.current, {
|
|
489
|
-
prefix: r?.prefix || "",
|
|
490
|
-
suffix: r?.suffix || "",
|
|
491
|
-
abbreviated: r?.abbreviated
|
|
492
|
-
}), y = E(w.prior, {
|
|
493
|
-
prefix: r?.prefix || "",
|
|
494
|
-
suffix: r?.suffix || "",
|
|
495
|
-
abbreviated: r?.abbreviated
|
|
496
|
-
}), H = F(m.length, h), ae = Math.max(H - 4, 14);
|
|
497
|
-
return /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 12, flex: 1 }, children: [
|
|
498
|
-
/* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
499
|
-
/* @__PURE__ */ t(
|
|
500
|
-
"span",
|
|
501
|
-
{
|
|
502
|
-
style: {
|
|
503
|
-
fontWeight: 700,
|
|
504
|
-
fontSize: H,
|
|
505
|
-
letterSpacing: "-0.03em",
|
|
506
|
-
color: "rgba(0,0,0,0.87)",
|
|
507
|
-
lineHeight: 1.1
|
|
508
|
-
},
|
|
509
|
-
title: m.full,
|
|
510
|
-
children: m.display
|
|
511
|
-
}
|
|
512
|
-
),
|
|
513
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 10, color: "rgba(0,0,0,0.35)", marginTop: 2 }, children: w.currentLabel })
|
|
514
|
-
] }),
|
|
515
|
-
/* @__PURE__ */ t(
|
|
516
|
-
pe,
|
|
517
|
-
{
|
|
518
|
-
definition: { orientation: "vertical", color: "rgba(0,0,0,0.08)" },
|
|
519
|
-
style: { flexShrink: 0 }
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
/* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
523
|
-
/* @__PURE__ */ t(
|
|
524
|
-
"span",
|
|
525
|
-
{
|
|
526
|
-
style: {
|
|
527
|
-
fontWeight: 700,
|
|
528
|
-
fontSize: ae,
|
|
529
|
-
letterSpacing: "-0.03em",
|
|
530
|
-
color: "rgba(0,0,0,0.5)",
|
|
531
|
-
lineHeight: 1.1
|
|
532
|
-
},
|
|
533
|
-
title: y.full,
|
|
534
|
-
children: y.display
|
|
535
|
-
}
|
|
536
|
-
),
|
|
537
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 10, color: "rgba(0,0,0,0.35)", marginTop: 2 }, children: w.priorLabel })
|
|
538
|
-
] })
|
|
539
|
-
] });
|
|
540
|
-
}, se = () => !C || C.length === 0 ? null : /* @__PURE__ */ u("div", { style: { zIndex: 2, position: "relative" }, children: [
|
|
541
|
-
/* @__PURE__ */ t(
|
|
542
|
-
"div",
|
|
543
|
-
{
|
|
544
|
-
style: {
|
|
545
|
-
height: 5,
|
|
546
|
-
borderRadius: 3,
|
|
547
|
-
display: "flex",
|
|
548
|
-
gap: 1,
|
|
549
|
-
overflow: "hidden"
|
|
550
|
-
},
|
|
551
|
-
children: C.map((m, y) => /* @__PURE__ */ t(
|
|
552
|
-
"div",
|
|
553
|
-
{
|
|
554
|
-
style: {
|
|
555
|
-
flex: m.value,
|
|
556
|
-
backgroundColor: m.color,
|
|
557
|
-
minWidth: 2
|
|
558
|
-
}
|
|
559
|
-
},
|
|
560
|
-
y
|
|
561
|
-
))
|
|
562
|
-
}
|
|
563
|
-
),
|
|
564
|
-
/* @__PURE__ */ t(
|
|
565
|
-
"div",
|
|
566
|
-
{
|
|
567
|
-
style: {
|
|
568
|
-
display: "flex",
|
|
569
|
-
gap: 8,
|
|
570
|
-
flexWrap: "wrap",
|
|
571
|
-
marginTop: 4
|
|
572
|
-
},
|
|
573
|
-
children: C.map((m, y) => /* @__PURE__ */ u(
|
|
574
|
-
"div",
|
|
575
|
-
{
|
|
576
|
-
style: {
|
|
577
|
-
display: "flex",
|
|
578
|
-
alignItems: "center",
|
|
579
|
-
gap: 3
|
|
580
|
-
},
|
|
581
|
-
children: [
|
|
582
|
-
/* @__PURE__ */ t(
|
|
583
|
-
"div",
|
|
584
|
-
{
|
|
585
|
-
style: {
|
|
586
|
-
width: 6,
|
|
587
|
-
height: 6,
|
|
588
|
-
borderRadius: "50%",
|
|
589
|
-
backgroundColor: m.color,
|
|
590
|
-
flexShrink: 0
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
),
|
|
594
|
-
/* @__PURE__ */ t("span", { style: { fontSize: 10, color: "rgba(0,0,0,0.5)" }, children: m.label })
|
|
595
|
-
]
|
|
596
|
-
},
|
|
597
|
-
y
|
|
598
|
-
))
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
] }), le = [
|
|
602
|
-
"gloss-threshold-overlay",
|
|
603
|
-
f === "warn" ? "gloss-threshold-warn" : "",
|
|
604
|
-
f === "critical" ? "gloss-threshold-critical" : "",
|
|
605
|
-
f === "critical" ? "gloss-threshold-pulse" : ""
|
|
606
|
-
].filter(Boolean).join(" ");
|
|
607
|
-
return /* @__PURE__ */ u(ce, { children: [
|
|
608
|
-
f !== "none" && /* @__PURE__ */ t("div", { className: le }),
|
|
609
|
-
f === "warn" && /* @__PURE__ */ t("span", { className: "gloss-threshold-icon gloss-threshold-icon--warn", children: /* @__PURE__ */ t(ke, {}) }),
|
|
610
|
-
f === "critical" && /* @__PURE__ */ t("span", { className: "gloss-threshold-icon gloss-threshold-icon--critical", children: /* @__PURE__ */ t(we, {}) }),
|
|
611
|
-
e === "highlight" && I && /* @__PURE__ */ t(
|
|
612
|
-
"div",
|
|
613
|
-
{
|
|
614
|
-
style: {
|
|
615
|
-
position: "absolute",
|
|
616
|
-
inset: 0,
|
|
617
|
-
borderRadius: 10,
|
|
618
|
-
backgroundColor: Y(I, 0.06),
|
|
619
|
-
border: `1px solid ${Y(I, 0.15)}`,
|
|
620
|
-
zIndex: 0,
|
|
621
|
-
pointerEvents: "none"
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
),
|
|
625
|
-
e === "sparkline" && /* @__PURE__ */ t(L, { data: x, color: g, isStale: a }),
|
|
626
|
-
e === "bars" && /* @__PURE__ */ t(G, { data: v, color: g, isStale: a }),
|
|
627
|
-
/* @__PURE__ */ u(
|
|
628
|
-
z,
|
|
629
|
-
{
|
|
630
|
-
className: "gloss-metric-card__zone-a",
|
|
631
|
-
"data-tier": X,
|
|
632
|
-
style: { height: 28, flexShrink: 0, zIndex: 2, position: "relative", display: "flex", alignItems: "center" },
|
|
633
|
-
children: [
|
|
634
|
-
/* @__PURE__ */ t($, { className: "gloss-metric-card__label", children: c }),
|
|
635
|
-
d
|
|
636
|
-
]
|
|
637
|
-
}
|
|
638
|
-
),
|
|
639
|
-
/* @__PURE__ */ u(
|
|
640
|
-
z,
|
|
641
|
-
{
|
|
642
|
-
definition: { display: "flex", align: "center" },
|
|
643
|
-
className: `gloss-metric-card__zone-b ${T}`,
|
|
644
|
-
style: { flex: 1, zIndex: 2, position: "relative", minHeight: 0 },
|
|
645
|
-
children: [
|
|
646
|
-
e === "donut" && /* @__PURE__ */ t(U, { value: p, max: k, color: g, colSpan: h, isStale: a }),
|
|
647
|
-
e === "object-arrow" && /* @__PURE__ */ t(
|
|
648
|
-
Z,
|
|
649
|
-
{
|
|
650
|
-
value: J,
|
|
651
|
-
max: K,
|
|
652
|
-
trendValue: s?.value,
|
|
653
|
-
color: re,
|
|
654
|
-
colSpan: h,
|
|
655
|
-
isStale: a
|
|
656
|
-
}
|
|
657
|
-
),
|
|
658
|
-
e === "arrow" && oe(),
|
|
659
|
-
e !== "versus" && e !== "segmented" && /* @__PURE__ */ t("span", { style: W, title: S.full, children: S.display }),
|
|
660
|
-
e === "versus" && ie(),
|
|
661
|
-
e === "segmented" && /* @__PURE__ */ t("span", { style: W, title: S.full, children: S.display })
|
|
662
|
-
]
|
|
663
|
-
}
|
|
664
|
-
),
|
|
665
|
-
/* @__PURE__ */ u(
|
|
666
|
-
z,
|
|
667
|
-
{
|
|
668
|
-
definition: { display: "flex", justify: "between", align: "center" },
|
|
669
|
-
className: `gloss-metric-card__zone-c ${T}`,
|
|
670
|
-
style: { minHeight: 18, flexShrink: 0, zIndex: 2, position: "relative" },
|
|
671
|
-
children: [
|
|
672
|
-
/* @__PURE__ */ t("span", { style: ne, children: l }),
|
|
673
|
-
j && s?.value != null ? /* @__PURE__ */ t("span", { style: {
|
|
674
|
-
backgroundColor: "rgba(255,255,255,0.78)",
|
|
675
|
-
backdropFilter: "blur(4px)",
|
|
676
|
-
WebkitBackdropFilter: "blur(4px)",
|
|
677
|
-
borderRadius: 4,
|
|
678
|
-
display: "inline-flex",
|
|
679
|
-
flexShrink: 0
|
|
680
|
-
}, children: /* @__PURE__ */ t(D, { value: s?.value, direction: s?.direction }) }) : /* @__PURE__ */ t(D, { value: s?.value, direction: s?.direction })
|
|
681
|
-
]
|
|
682
|
-
}
|
|
683
|
-
),
|
|
684
|
-
e === "segmented" && se()
|
|
685
|
-
] });
|
|
686
|
-
};
|
|
687
|
-
Se.displayName = "MetricCard";
|
|
688
|
-
export {
|
|
689
|
-
G as B,
|
|
690
|
-
U as D,
|
|
691
|
-
Se as M,
|
|
692
|
-
Z as O,
|
|
693
|
-
q as S,
|
|
694
|
-
D as T,
|
|
695
|
-
L as a,
|
|
696
|
-
ye as e,
|
|
697
|
-
xe as u
|
|
698
|
-
};
|