@mt-gloss/ui 0.1.149 → 0.1.151

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.
@@ -1,24 +1,24 @@
1
- import { jsxs as u, jsx as e, Fragment as K } from "react/jsx-runtime";
2
- import { useId as me, useMemo as W, useState as ge, useRef as B, useCallback as C, useEffect as pe } from "react";
3
- import { formatTrend as xe, isStatusModeEnabled as ye, pickMetricTier as be, getValueFontSize as Y, formatValue as q, getDateRangeForPreset as ve, formatDateRangeSmart as ke, ROLLING_OPTIONS as we, PERIOD_OPTIONS as Se } from "@mt-gloss/utils";
1
+ import { jsxs as h, jsx as e, Fragment as K } from "react/jsx-runtime";
2
+ import { useId as me, useMemo as O, useState as ge, useRef as W, useCallback as C, useEffect as pe } from "react";
3
+ import { formatTrend as xe, isStatusModeEnabled as ye, pickMetricTier as be, getValueFontSize as Y, hexToRgba as q, formatValue as Q, getDateRangeForPreset as ve, formatDateRangeSmart as ke, ROLLING_OPTIONS as we, PERIOD_OPTIONS as Se } from "@mt-gloss/utils";
4
4
  import { B as N, a as D, b as Ce } from "./BaseText-Dxbk1JJa.js";
5
- import { Box as $, Chip as X, Popper as Ie, Paper as ze, MenuList as Me, MenuItem as Re, ListItemText as Te, IconButton as Le, Tooltip as Ne, Divider as De } from "@mui/material";
6
- import $e from "@mui/icons-material/ExpandMore";
7
- import Be from "@mui/icons-material/Star";
8
- import We from "@mui/icons-material/StarBorder";
9
- import Oe from "@mui/icons-material/Check";
10
- const Q = {
5
+ import { Box as B, Chip as X, Popper as Ie, Paper as ze, MenuList as Me, MenuItem as Re, ListItemText as Te, IconButton as Le, Tooltip as Ne, Divider as De } from "@mui/material";
6
+ import Be from "@mui/icons-material/ExpandMore";
7
+ import We from "@mui/icons-material/Star";
8
+ import Oe from "@mui/icons-material/StarBorder";
9
+ import _e from "@mui/icons-material/Check";
10
+ const Z = {
11
11
  up: { color: "#10b981", bg: "rgba(16,185,129,0.07)" },
12
12
  down: { color: "#ef4444", bg: "rgba(239,68,68,0.07)" },
13
13
  flat: { color: "#6b7280", bg: "rgba(107,114,128,0.07)" }
14
- }, Z = {
14
+ }, J = {
15
15
  up: "▲",
16
16
  down: "▼",
17
17
  flat: "▶"
18
- }, j = function({ value: n, direction: t }) {
19
- if (n == null) return null;
20
- const { text: a, direction: f } = xe(n), s = t || f, { color: r, bg: l } = Q[s] || Q.flat, o = Z[s] || Z.flat;
21
- return /* @__PURE__ */ u(
18
+ }, j = function({ value: o, direction: t }) {
19
+ if (o == null) return null;
20
+ const { text: d, direction: f } = xe(o), l = t || f, { color: r, bg: s } = Z[l] || Z.flat, n = J[l] || J.flat;
21
+ return /* @__PURE__ */ h(
22
22
  "span",
23
23
  {
24
24
  style: {
@@ -31,27 +31,27 @@ const Q = {
31
31
  fontWeight: 600,
32
32
  lineHeight: 1,
33
33
  color: r,
34
- backgroundColor: l,
34
+ backgroundColor: s,
35
35
  whiteSpace: "nowrap"
36
36
  },
37
37
  children: [
38
- /* @__PURE__ */ e("span", { style: { fontSize: 8, lineHeight: 1 }, children: o }),
39
- a
38
+ /* @__PURE__ */ e("span", { style: { fontSize: 8, lineHeight: 1 }, children: n }),
39
+ d
40
40
  ]
41
41
  }
42
42
  );
43
43
  };
44
44
  j.displayName = "TrendIndicator";
45
- const H = ({ data: i, color: n, isStale: t }) => {
46
- const f = "sparkbg-" + me().replace(/:/g, ""), s = n || "#4f46e5", r = W(() => {
45
+ const A = ({ data: i, color: o, isStale: t }) => {
46
+ const f = "sparkbg-" + me().replace(/:/g, ""), l = o || "#4f46e5", r = O(() => {
47
47
  if (!i || i.length < 2) return null;
48
- const l = 300, o = 55, c = 2, d = Math.min(...i), m = Math.max(...i) - d || 1, p = i.map((y, S) => ({
49
- x: S / (i.length - 1) * l,
50
- y: c + (1 - (y - d) / m) * (o - c * 2)
51
- })).map((y, S) => `${S === 0 ? "M" : "L"}${y.x},${y.y}`).join(" "), w = `${p} L${l},${o} L0,${o}Z`;
52
- return { line: p, area: w, w: l, h: o };
48
+ const s = 300, n = 55, a = 2, c = Math.min(...i), m = Math.max(...i) - c || 1, p = i.map((y, S) => ({
49
+ x: S / (i.length - 1) * s,
50
+ y: a + (1 - (y - c) / m) * (n - a * 2)
51
+ })).map((y, S) => `${S === 0 ? "M" : "L"}${y.x},${y.y}`).join(" "), w = `${p} L${s},${n} L0,${n}Z`;
52
+ return { line: p, area: w, w: s, h: n };
53
53
  }, [i]);
54
- return r ? /* @__PURE__ */ u(
54
+ return r ? /* @__PURE__ */ h(
55
55
  "svg",
56
56
  {
57
57
  height: 55,
@@ -81,9 +81,9 @@ const H = ({ data: i, color: n, isStale: t }) => {
81
81
  transition: t ? "transform 400ms ease-out" : "transform 500ms ease-in-out"
82
82
  },
83
83
  children: [
84
- /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ u("linearGradient", { id: f, x1: "0", y1: "0", x2: "0", y2: "1", children: [
85
- /* @__PURE__ */ e("stop", { offset: "0%", stopColor: s, stopOpacity: "0.09" }),
86
- /* @__PURE__ */ e("stop", { offset: "100%", stopColor: s, stopOpacity: "0.01" })
84
+ /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ h("linearGradient", { id: f, x1: "0", y1: "0", x2: "0", y2: "1", children: [
85
+ /* @__PURE__ */ e("stop", { offset: "0%", stopColor: l, stopOpacity: "0.09" }),
86
+ /* @__PURE__ */ e("stop", { offset: "100%", stopColor: l, stopOpacity: "0.01" })
87
87
  ] }) }),
88
88
  /* @__PURE__ */ e("path", { d: r.area, fill: `url(#${f})` }),
89
89
  /* @__PURE__ */ e(
@@ -91,7 +91,7 @@ const H = ({ data: i, color: n, isStale: t }) => {
91
91
  {
92
92
  d: r.line,
93
93
  fill: "none",
94
- stroke: s,
94
+ stroke: l,
95
95
  strokeOpacity: "0.22",
96
96
  strokeWidth: "1.5",
97
97
  strokeLinecap: "round",
@@ -102,19 +102,19 @@ const H = ({ data: i, color: n, isStale: t }) => {
102
102
  }
103
103
  ) : null;
104
104
  };
105
- H.displayName = "SparklineBg";
106
- const ee = ({ data: i, color: n, isStale: t }) => {
107
- const a = n || "#4f46e5", f = W(() => {
105
+ A.displayName = "SparklineBg";
106
+ const ee = ({ data: i, color: o, isStale: t }) => {
107
+ const d = o || "#4f46e5", f = O(() => {
108
108
  if (!i || i.length < 1) return null;
109
- const s = 300, r = 50, l = r * 0.82, o = i.length, c = s / (o * 4), d = c * 3, m = Math.max(...i) || 1;
109
+ const l = 300, r = 50, s = r * 0.82, n = i.length, a = l / (n * 4), c = a * 3, m = Math.max(...i) || 1;
110
110
  return i.map((x, p) => {
111
- const w = x / m, y = Math.max(w * l, 2);
111
+ const w = x / m, y = Math.max(w * s, 2);
112
112
  return {
113
- x: p * (d + c),
113
+ x: p * (c + a),
114
114
  y: r - y,
115
- width: d,
115
+ width: c,
116
116
  height: y,
117
- isLast: p === o - 1
117
+ isLast: p === n - 1
118
118
  };
119
119
  });
120
120
  }, [i]);
@@ -137,15 +137,15 @@ const ee = ({ data: i, color: n, isStale: t }) => {
137
137
  transformOrigin: "bottom",
138
138
  transition: t ? "transform 400ms ease-out" : "transform 500ms ease-in-out"
139
139
  },
140
- children: f.map((s, r) => /* @__PURE__ */ e(
140
+ children: f.map((l, r) => /* @__PURE__ */ e(
141
141
  "rect",
142
142
  {
143
- x: s.x,
144
- y: s.y,
145
- width: s.width,
146
- height: s.height,
147
- fill: a,
148
- fillOpacity: s.isLast ? 0.14 : 0.06,
143
+ x: l.x,
144
+ y: l.y,
145
+ width: l.width,
146
+ height: l.height,
147
+ fill: d,
148
+ fillOpacity: l.isLast ? 0.14 : 0.06,
149
149
  rx: "2.5"
150
150
  },
151
151
  r
@@ -154,22 +154,22 @@ const ee = ({ data: i, color: n, isStale: t }) => {
154
154
  ) : null;
155
155
  };
156
156
  ee.displayName = "BarsBg";
157
- const te = ({ value: i = 0, max: n = 100, color: t = "#4f46e5", colSpan: a = 1, isStale: f }) => {
158
- const s = a >= 2 ? 40 : 34, r = 3.5, l = (s - r) / 2, o = 2 * Math.PI * l, c = f ? 0 : Math.min(Math.max(i / (n || 1), 0), 1), d = o * (1 - c);
159
- return /* @__PURE__ */ u(
157
+ const te = ({ value: i = 0, max: o = 100, color: t = "#4f46e5", colSpan: d = 1, isStale: f }) => {
158
+ const l = d >= 2 ? 40 : 34, r = 3.5, s = (l - r) / 2, n = 2 * Math.PI * s, a = f ? 0 : Math.min(Math.max(i / (o || 1), 0), 1), c = n * (1 - a);
159
+ return /* @__PURE__ */ h(
160
160
  "svg",
161
161
  {
162
- width: s,
163
- height: s,
164
- viewBox: `0 0 ${s} ${s}`,
162
+ width: l,
163
+ height: l,
164
+ viewBox: `0 0 ${l} ${l}`,
165
165
  style: { flexShrink: 0, marginRight: 8, display: "block" },
166
166
  children: [
167
167
  /* @__PURE__ */ e(
168
168
  "circle",
169
169
  {
170
- cx: s / 2,
171
- cy: s / 2,
172
- r: l,
170
+ cx: l / 2,
171
+ cy: l / 2,
172
+ r: s,
173
173
  fill: "none",
174
174
  stroke: t,
175
175
  strokeOpacity: "0.06",
@@ -179,16 +179,16 @@ const te = ({ value: i = 0, max: n = 100, color: t = "#4f46e5", colSpan: a = 1,
179
179
  /* @__PURE__ */ e(
180
180
  "circle",
181
181
  {
182
- cx: s / 2,
183
- cy: s / 2,
184
- r: l,
182
+ cx: l / 2,
183
+ cy: l / 2,
184
+ r: s,
185
185
  fill: "none",
186
186
  stroke: t,
187
187
  strokeWidth: r,
188
- strokeDasharray: o,
189
- strokeDashoffset: d,
188
+ strokeDasharray: n,
189
+ strokeDashoffset: c,
190
190
  strokeLinecap: "round",
191
- transform: `rotate(-90 ${s / 2} ${s / 2})`,
191
+ transform: `rotate(-90 ${l / 2} ${l / 2})`,
192
192
  style: { transition: "stroke-dashoffset 0.4s ease" }
193
193
  }
194
194
  )
@@ -197,9 +197,9 @@ const te = ({ value: i = 0, max: n = 100, color: t = "#4f46e5", colSpan: a = 1,
197
197
  );
198
198
  };
199
199
  te.displayName = "DonutChart";
200
- const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280", colSpan: f = 1, isStale: s }) => {
201
- const r = f >= 2 ? 44 : 36, l = 3.5, o = (r - l) / 2, c = 2 * Math.PI * o, d = s ? 0 : Math.min(Math.max(i / (n || 1), 0), 1), h = c * (1 - d), m = f >= 2 ? 11 : 9, x = `${Math.round(Math.abs(t))}%`;
202
- return /* @__PURE__ */ u(
200
+ const re = ({ value: i = 0, max: o = 100, trendValue: t = 0, color: d = "#6b7280", colSpan: f = 1, isStale: l }) => {
201
+ const r = f >= 2 ? 44 : 36, s = 3.5, n = (r - s) / 2, a = 2 * Math.PI * n, c = l ? 0 : Math.min(Math.max(i / (o || 1), 0), 1), u = a * (1 - c), m = f >= 2 ? 11 : 9, x = `${Math.round(Math.abs(t))}%`;
202
+ return /* @__PURE__ */ h(
203
203
  "div",
204
204
  {
205
205
  style: {
@@ -213,7 +213,7 @@ const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280
213
213
  marginRight: 8
214
214
  },
215
215
  children: [
216
- /* @__PURE__ */ u(
216
+ /* @__PURE__ */ h(
217
217
  "svg",
218
218
  {
219
219
  width: r,
@@ -226,11 +226,11 @@ const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280
226
226
  {
227
227
  cx: r / 2,
228
228
  cy: r / 2,
229
- r: o,
229
+ r: n,
230
230
  fill: "none",
231
- stroke: a,
231
+ stroke: d,
232
232
  strokeOpacity: "0.06",
233
- strokeWidth: l
233
+ strokeWidth: s
234
234
  }
235
235
  ),
236
236
  /* @__PURE__ */ e(
@@ -238,12 +238,12 @@ const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280
238
238
  {
239
239
  cx: r / 2,
240
240
  cy: r / 2,
241
- r: o,
241
+ r: n,
242
242
  fill: "none",
243
- stroke: a,
244
- strokeWidth: l,
245
- strokeDasharray: c,
246
- strokeDashoffset: h,
243
+ stroke: d,
244
+ strokeWidth: s,
245
+ strokeDasharray: a,
246
+ strokeDashoffset: u,
247
247
  strokeLinecap: "round",
248
248
  transform: `rotate(-90 ${r / 2} ${r / 2})`,
249
249
  style: { transition: "stroke-dashoffset 0.4s ease" }
@@ -263,7 +263,7 @@ const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280
263
263
  justifyContent: "center",
264
264
  fontSize: m,
265
265
  fontWeight: 700,
266
- color: a,
266
+ color: d,
267
267
  lineHeight: 1,
268
268
  pointerEvents: "none"
269
269
  },
@@ -275,73 +275,73 @@ const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280
275
275
  );
276
276
  };
277
277
  re.displayName = "ObjectArrow";
278
- const _e = { slot3: 200, slot5: 380 };
279
- function Ee(i, n) {
280
- const t = _e, a = 150, [f, s] = ge(1), r = B(null), l = B(null), o = C(() => {
281
- const d = r.current;
282
- if (d == null) return;
283
- const h = d < t.slot3 ? 1 : d < t.slot5 ? 3 : 5;
284
- s((m) => m === h ? m : h), r.current = null, l.current && (clearTimeout(l.current), l.current = null);
278
+ const $e = { slot3: 200, slot5: 380 };
279
+ function Ee(i, o) {
280
+ const t = $e, d = 150, [f, l] = ge(1), r = W(null), s = W(null), n = C(() => {
281
+ const c = r.current;
282
+ if (c == null) return;
283
+ const u = c < t.slot3 ? 1 : c < t.slot5 ? 3 : 5;
284
+ l((m) => m === u ? m : u), r.current = null, s.current && (clearTimeout(s.current), s.current = null);
285
285
  }, [t.slot3, t.slot5]);
286
286
  pe(() => {
287
- const d = i.current;
288
- if (!d || typeof ResizeObserver > "u") return;
289
- const h = new ResizeObserver((m) => {
287
+ const c = i.current;
288
+ if (!c || typeof ResizeObserver > "u") return;
289
+ const u = new ResizeObserver((m) => {
290
290
  const x = m[0]?.contentRect.width ?? 0;
291
- r.current = x, l.current && clearTimeout(l.current), l.current = setTimeout(o, a);
291
+ r.current = x, s.current && clearTimeout(s.current), s.current = setTimeout(n, d);
292
292
  });
293
- return h.observe(d), () => {
294
- h.disconnect(), l.current && clearTimeout(l.current);
293
+ return u.observe(c), () => {
294
+ u.disconnect(), s.current && clearTimeout(s.current);
295
295
  };
296
- }, [i, o, a]);
297
- const c = C(() => {
298
- o();
299
- }, [o]);
300
- return { capacity: f, onPointerUp: c };
296
+ }, [i, n, d]);
297
+ const a = C(() => {
298
+ n();
299
+ }, [n]);
300
+ return { capacity: f, onPointerUp: a };
301
301
  }
302
302
  function ie(i) {
303
- const { onStatusSlotClick: n } = i, t = B(null), a = ye(), { capacity: f, onPointerUp: s } = Ee(t), r = i.maxSlots ?? f, l = i.statuses.slice(0, r);
304
- if (!a) {
305
- const o = i.statuses[0];
306
- return /* @__PURE__ */ u(
303
+ const { onStatusSlotClick: o } = i, t = W(null), d = ye(), { capacity: f, onPointerUp: l } = Ee(t), r = i.maxSlots ?? f, s = i.statuses.slice(0, r);
304
+ if (!d) {
305
+ const n = i.statuses[0];
306
+ return /* @__PURE__ */ h(
307
307
  N,
308
308
  {
309
309
  definition: { display: "flex", direction: "column" },
310
310
  className: "gloss-status-card gloss-status-card--flag-off",
311
311
  children: [
312
312
  /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: i.label }),
313
- o != null ? /* @__PURE__ */ e(D, { children: String(o.value) }) : null
313
+ n != null ? /* @__PURE__ */ e(D, { children: String(n.value) }) : null
314
314
  ]
315
315
  }
316
316
  );
317
317
  }
318
- return /* @__PURE__ */ u(
318
+ return /* @__PURE__ */ h(
319
319
  "div",
320
320
  {
321
321
  ref: t,
322
322
  className: "gloss-status-card",
323
323
  "data-status-mode": "on",
324
324
  "data-status-capacity": r,
325
- onPointerUp: s,
325
+ onPointerUp: l,
326
326
  children: [
327
327
  /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: i.label }),
328
- /* @__PURE__ */ e("div", { className: "gloss-status-slots", "data-status-slot-count": l.length, children: l.map((o, c) => {
329
- const d = i.sparklinePerStatus?.[o.id], h = o.id === i.activeStatusId;
330
- return /* @__PURE__ */ u(
328
+ /* @__PURE__ */ e("div", { className: "gloss-status-slots", "data-status-slot-count": s.length, children: s.map((n, a) => {
329
+ const c = i.sparklinePerStatus?.[n.id], u = n.id === i.activeStatusId;
330
+ return /* @__PURE__ */ h(
331
331
  "div",
332
332
  {
333
- className: `gloss-status-slots__slot${h ? " gloss-status-slots__slot--active" : ""}`,
334
- "data-status-slot-id": o.id,
335
- "data-status-slot-index": c,
336
- onClick: n ? (m) => n(o.id, m.currentTarget) : void 0,
337
- style: n ? { cursor: "pointer" } : void 0,
333
+ className: `gloss-status-slots__slot${u ? " gloss-status-slots__slot--active" : ""}`,
334
+ "data-status-slot-id": n.id,
335
+ "data-status-slot-index": a,
336
+ onClick: o ? (m) => o(n.id, m.currentTarget) : void 0,
337
+ style: o ? { cursor: "pointer" } : void 0,
338
338
  children: [
339
- /* @__PURE__ */ e("span", { className: "gloss-metric-card__label", children: o.label }),
340
- /* @__PURE__ */ e("span", { children: String(o.value) }),
341
- d != null && d.length > 0 ? /* @__PURE__ */ e(H, { data: [...d], color: o.accentColor }) : null
339
+ /* @__PURE__ */ e("span", { className: "gloss-metric-card__label", children: n.label }),
340
+ /* @__PURE__ */ e("span", { children: String(n.value) }),
341
+ c != null && c.length > 0 ? /* @__PURE__ */ e(A, { data: [...c], color: n.accentColor }) : null
342
342
  ]
343
343
  },
344
- o.id
344
+ n.id
345
345
  );
346
346
  }) })
347
347
  ]
@@ -349,24 +349,17 @@ function ie(i) {
349
349
  );
350
350
  }
351
351
  ie.displayName = "StatusModeCard";
352
- function je(i, n) {
353
- if (!n) return;
354
- if (i == null) return n.fallback;
355
- const { operator: t, threshold: a, result: f, fallback: s } = n;
356
- return (t === "lt" ? i < a : t === "gt" ? i > a : t === "eq" ? Math.abs(i - a) < 1e-9 : t === "gte" ? i >= a : t === "lte" ? i <= a : !1) ? f : s;
357
- }
358
- function J(i, n) {
359
- const t = i.replace("#", "");
360
- if (!/^[0-9a-fA-F]{6}$/.test(t))
361
- return `rgba(0,0,0,${n})`;
362
- const a = parseInt(t.substring(0, 2), 16), f = parseInt(t.substring(2, 4), 16), s = parseInt(t.substring(4, 6), 16);
363
- return `rgba(${a},${f},${s},${n})`;
352
+ function je(i, o) {
353
+ if (!o) return;
354
+ if (i == null) return o.fallback;
355
+ const { operator: t, threshold: d, result: f, fallback: l } = o;
356
+ return (t === "lt" ? i < d : t === "gt" ? i > d : t === "eq" ? Math.abs(i - d) < 1e-9 : t === "gte" ? i >= d : t === "lte" ? i <= d : !1) ? f : l;
364
357
  }
365
358
  const E = {
366
359
  up: "var(--color-positive)",
367
360
  down: "var(--color-negative)",
368
361
  flat: "var(--color-text-secondary)"
369
- }, Ae = {
362
+ }, He = {
370
363
  positive: "#10b981",
371
364
  // Used with hexToRgba() for tinted overlays -- must stay hex
372
365
  negative: "#ef4444",
@@ -375,7 +368,7 @@ const E = {
375
368
  // Used with hexToRgba() for tinted overlays -- must stay hex
376
369
  neutral: "#6b7280"
377
370
  // Used with hexToRgba() for tinted overlays -- must stay hex
378
- }, He = () => /* @__PURE__ */ u(
371
+ }, Ae = () => /* @__PURE__ */ h(
379
372
  "svg",
380
373
  {
381
374
  "aria-label": "Warning threshold breached",
@@ -401,7 +394,7 @@ const E = {
401
394
  /* @__PURE__ */ e("circle", { cx: "7", cy: "10.5", r: "0.7", fill: "currentColor" })
402
395
  ]
403
396
  }
404
- ), Fe = () => /* @__PURE__ */ u(
397
+ ), Fe = () => /* @__PURE__ */ h(
405
398
  "svg",
406
399
  {
407
400
  "aria-label": "Critical threshold breached",
@@ -417,36 +410,36 @@ const E = {
417
410
  /* @__PURE__ */ e("circle", { cx: "7", cy: "10", r: "0.7", fill: "currentColor" })
418
411
  ]
419
412
  }
420
- ), Pe = function(n) {
413
+ ), Pe = function(o) {
421
414
  const {
422
415
  variant: t = "standard",
423
- label: a,
416
+ label: d,
424
417
  labelAdornment: f,
425
- value: s,
418
+ value: l,
426
419
  valueFormat: r,
427
- trend: l,
428
- subtitle: o,
429
- colSpan: c = 1,
430
- isStale: d,
431
- thresholdBreach: h = "none"
432
- } = n, m = t === "sparkline" || t === "bars" || t === "donut" ? n.accentColor ?? "#4f46e5" : "#4f46e5", x = t === "highlight" ? n.highlightColor : void 0, p = t === "sparkline" ? n.sparklineData : void 0, w = t === "bars" ? n.barData : void 0, y = t === "donut" ? n.donutValue : 0, S = t === "donut" ? n.donutMax ?? 100 : 100, T = t === "object-arrow" ? n.objectArrowValue : 0, O = t === "object-arrow" ? n.objectArrowMax : 100, _ = t === "arrow" ? n.arrowDirection : void 0, I = t === "versus" ? n.versusData : void 0, z = t === "segmented" ? n.segments : void 0, b = (t === "highlight" && n.tintCondition ? je(
433
- typeof n.value == "number" ? n.value : null,
434
- n.tintCondition
435
- ) : void 0) ?? x, k = (b ? Ae[b] : void 0) || b, { formatted: L, tier: ne, length: oe } = W(
436
- () => t === "status-mode" ? { formatted: "", tier: 0, length: 0 } : be(s, {
420
+ trend: s,
421
+ subtitle: n,
422
+ colSpan: a = 1,
423
+ isStale: c,
424
+ thresholdBreach: u = "none"
425
+ } = o, m = t === "sparkline" || t === "bars" || t === "donut" ? o.accentColor ?? "#4f46e5" : "#4f46e5", x = t === "highlight" ? o.highlightColor : void 0, p = t === "sparkline" ? o.sparklineData : void 0, w = t === "bars" ? o.barData : void 0, y = t === "donut" ? o.donutValue : 0, S = t === "donut" ? o.donutMax ?? 100 : 100, T = t === "object-arrow" ? o.objectArrowValue : 0, _ = t === "object-arrow" ? o.objectArrowMax : 100, $ = t === "arrow" ? o.arrowDirection : void 0, I = t === "versus" ? o.versusData : void 0, z = t === "segmented" ? o.segments : void 0, b = (t === "highlight" && o.tintCondition ? je(
426
+ typeof o.value == "number" ? o.value : null,
427
+ o.tintCondition
428
+ ) : void 0) ?? x, k = (b ? He[b] : void 0) || b, { formatted: L, tier: ne, length: oe } = O(
429
+ () => t === "status-mode" ? { formatted: "", tier: 0, length: 0 } : be(l, {
437
430
  prefix: r?.prefix || "",
438
431
  suffix: r?.suffix || "",
439
432
  abbreviated: r?.abbreviated
440
- }, c),
441
- [t, s, r?.prefix, r?.suffix, r?.abbreviated, c]
433
+ }, a),
434
+ [t, l, r?.prefix, r?.suffix, r?.abbreviated, a]
442
435
  );
443
- if (n.variant === "status-mode")
444
- return /* @__PURE__ */ e(ie, { ...n });
445
- const R = { display: L, full: L, length: oe }, se = Y(R.length, c), le = l?.direction && E[l.direction] || E.flat, F = d ? "gloss-metric-data-stale" : "gloss-metric-data-fresh", P = {
436
+ if (o.variant === "status-mode")
437
+ return /* @__PURE__ */ e(ie, { ...o });
438
+ const R = { display: L, full: L, length: oe }, le = Y(R.length, a), se = s?.direction && E[s.direction] || E.flat, F = c ? "gloss-metric-data-stale" : "gloss-metric-data-fresh", P = {
446
439
  fontWeight: 700,
447
440
  letterSpacing: "-0.03em",
448
441
  color: t === "highlight" ? k : "rgba(0,0,0,0.87)",
449
- fontSize: se,
442
+ fontSize: le,
450
443
  lineHeight: 1.1,
451
444
  whiteSpace: "nowrap",
452
445
  overflow: "hidden"
@@ -458,7 +451,7 @@ const E = {
458
451
  whiteSpace: "nowrap",
459
452
  flex: 1,
460
453
  minWidth: 0
461
- }, G = t === "sparkline" || t === "bars", ae = G && o ? {
454
+ }, G = t === "sparkline" || t === "bars", ae = G && n ? {
462
455
  ...V,
463
456
  backgroundColor: "rgba(255,255,255,0.78)",
464
457
  backdropFilter: "blur(4px)",
@@ -469,7 +462,7 @@ const E = {
469
462
  flex: "none",
470
463
  minWidth: void 0
471
464
  } : V, ce = () => {
472
- const v = _ === "down" ? "▼" : "▲";
465
+ const v = $ === "down" ? "▼" : "▲";
473
466
  return /* @__PURE__ */ e(
474
467
  "div",
475
468
  {
@@ -490,17 +483,17 @@ const E = {
490
483
  );
491
484
  }, de = () => {
492
485
  if (!I) return null;
493
- const v = q(I.current, {
486
+ const v = Q(I.current, {
494
487
  prefix: r?.prefix || "",
495
488
  suffix: r?.suffix || "",
496
489
  abbreviated: r?.abbreviated
497
- }), M = q(I.prior, {
490
+ }), M = Q(I.prior, {
498
491
  prefix: r?.prefix || "",
499
492
  suffix: r?.suffix || "",
500
493
  abbreviated: r?.abbreviated
501
- }), U = Y(v.length, c), he = Math.max(U - 4, 14);
502
- return /* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: 12, flex: 1 }, children: [
503
- /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column" }, children: [
494
+ }), U = Y(v.length, a), ue = Math.max(U - 4, 14);
495
+ return /* @__PURE__ */ h("div", { style: { display: "flex", alignItems: "center", gap: 12, flex: 1 }, children: [
496
+ /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column" }, children: [
504
497
  /* @__PURE__ */ e(
505
498
  "span",
506
499
  {
@@ -524,13 +517,13 @@ const E = {
524
517
  style: { flexShrink: 0 }
525
518
  }
526
519
  ),
527
- /* @__PURE__ */ u("div", { style: { display: "flex", flexDirection: "column" }, children: [
520
+ /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column" }, children: [
528
521
  /* @__PURE__ */ e(
529
522
  "span",
530
523
  {
531
524
  style: {
532
525
  fontWeight: 700,
533
- fontSize: he,
526
+ fontSize: ue,
534
527
  letterSpacing: "-0.03em",
535
528
  color: "rgba(0,0,0,0.5)",
536
529
  lineHeight: 1.1
@@ -542,7 +535,7 @@ const E = {
542
535
  /* @__PURE__ */ e("span", { style: { fontSize: 10, color: "rgba(0,0,0,0.35)", marginTop: 2 }, children: I.priorLabel })
543
536
  ] })
544
537
  ] });
545
- }, fe = () => !z || z.length === 0 ? null : /* @__PURE__ */ u("div", { style: { zIndex: 2, position: "relative" }, children: [
538
+ }, fe = () => !z || z.length === 0 ? null : /* @__PURE__ */ h("div", { style: { zIndex: 2, position: "relative" }, children: [
546
539
  /* @__PURE__ */ e(
547
540
  "div",
548
541
  {
@@ -575,7 +568,7 @@ const E = {
575
568
  flexWrap: "wrap",
576
569
  marginTop: 4
577
570
  },
578
- children: z.map((v, M) => /* @__PURE__ */ u(
571
+ children: z.map((v, M) => /* @__PURE__ */ h(
579
572
  "div",
580
573
  {
581
574
  style: {
@@ -603,16 +596,16 @@ const E = {
603
596
  ))
604
597
  }
605
598
  )
606
- ] }), ue = [
599
+ ] }), he = [
607
600
  "gloss-threshold-overlay",
608
- h === "warn" ? "gloss-threshold-warn" : "",
609
- h === "critical" ? "gloss-threshold-critical" : "",
610
- h === "critical" ? "gloss-threshold-pulse" : ""
601
+ u === "warn" ? "gloss-threshold-warn" : "",
602
+ u === "critical" ? "gloss-threshold-critical" : "",
603
+ u === "critical" ? "gloss-threshold-pulse" : ""
611
604
  ].filter(Boolean).join(" ");
612
- return /* @__PURE__ */ u(K, { children: [
613
- h !== "none" && /* @__PURE__ */ e("div", { className: ue }),
614
- h === "warn" && /* @__PURE__ */ e("span", { className: "gloss-threshold-icon gloss-threshold-icon--warn", children: /* @__PURE__ */ e(He, {}) }),
615
- h === "critical" && /* @__PURE__ */ e("span", { className: "gloss-threshold-icon gloss-threshold-icon--critical", children: /* @__PURE__ */ e(Fe, {}) }),
605
+ return /* @__PURE__ */ h(K, { children: [
606
+ u !== "none" && /* @__PURE__ */ e("div", { className: he }),
607
+ u === "warn" && /* @__PURE__ */ e("span", { className: "gloss-threshold-icon gloss-threshold-icon--warn", children: /* @__PURE__ */ e(Ae, {}) }),
608
+ u === "critical" && /* @__PURE__ */ e("span", { className: "gloss-threshold-icon gloss-threshold-icon--critical", children: /* @__PURE__ */ e(Fe, {}) }),
616
609
  t === "highlight" && k && /* @__PURE__ */ e(
617
610
  "div",
618
611
  {
@@ -620,44 +613,44 @@ const E = {
620
613
  position: "absolute",
621
614
  inset: 0,
622
615
  borderRadius: 10,
623
- backgroundColor: J(k, 0.06),
624
- border: `1px solid ${J(k, 0.15)}`,
616
+ backgroundColor: q(k, 0.06),
617
+ border: `1px solid ${q(k, 0.15)}`,
625
618
  zIndex: 0,
626
619
  pointerEvents: "none"
627
620
  }
628
621
  }
629
622
  ),
630
- t === "sparkline" && /* @__PURE__ */ e(H, { data: p, color: m, isStale: d }),
631
- t === "bars" && /* @__PURE__ */ e(ee, { data: w, color: m, isStale: d }),
632
- /* @__PURE__ */ u(
623
+ t === "sparkline" && /* @__PURE__ */ e(A, { data: p, color: m, isStale: c }),
624
+ t === "bars" && /* @__PURE__ */ e(ee, { data: w, color: m, isStale: c }),
625
+ /* @__PURE__ */ h(
633
626
  N,
634
627
  {
635
628
  className: "gloss-metric-card__zone-a",
636
629
  "data-tier": ne,
637
630
  style: { height: 28, flexShrink: 0, zIndex: 2, position: "relative", display: "flex", alignItems: "center" },
638
631
  children: [
639
- /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: a }),
632
+ /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: d }),
640
633
  f
641
634
  ]
642
635
  }
643
636
  ),
644
- /* @__PURE__ */ u(
637
+ /* @__PURE__ */ h(
645
638
  N,
646
639
  {
647
640
  definition: { display: "flex", align: "center" },
648
641
  className: `gloss-metric-card__zone-b ${F}`,
649
642
  style: { flex: 1, zIndex: 2, position: "relative", minHeight: 0 },
650
643
  children: [
651
- t === "donut" && /* @__PURE__ */ e(te, { value: y, max: S, color: m, colSpan: c, isStale: d }),
644
+ t === "donut" && /* @__PURE__ */ e(te, { value: y, max: S, color: m, colSpan: a, isStale: c }),
652
645
  t === "object-arrow" && /* @__PURE__ */ e(
653
646
  re,
654
647
  {
655
648
  value: T,
656
- max: O,
657
- trendValue: l?.value,
658
- color: le,
659
- colSpan: c,
660
- isStale: d
649
+ max: _,
650
+ trendValue: s?.value,
651
+ color: se,
652
+ colSpan: a,
653
+ isStale: c
661
654
  }
662
655
  ),
663
656
  t === "arrow" && ce(),
@@ -667,22 +660,22 @@ const E = {
667
660
  ]
668
661
  }
669
662
  ),
670
- /* @__PURE__ */ u(
663
+ /* @__PURE__ */ h(
671
664
  N,
672
665
  {
673
666
  definition: { display: "flex", justify: "between", align: "center" },
674
667
  className: `gloss-metric-card__zone-c ${F}`,
675
668
  style: { minHeight: 18, flexShrink: 0, zIndex: 2, position: "relative" },
676
669
  children: [
677
- /* @__PURE__ */ e("span", { style: ae, children: o }),
678
- G && l?.value != null ? /* @__PURE__ */ e("span", { style: {
670
+ /* @__PURE__ */ e("span", { style: ae, children: n }),
671
+ G && s?.value != null ? /* @__PURE__ */ e("span", { style: {
679
672
  backgroundColor: "rgba(255,255,255,0.78)",
680
673
  backdropFilter: "blur(4px)",
681
674
  WebkitBackdropFilter: "blur(4px)",
682
675
  borderRadius: 4,
683
676
  display: "inline-flex",
684
677
  flexShrink: 0
685
- }, children: /* @__PURE__ */ e(j, { value: l?.value, direction: l?.direction }) }) : /* @__PURE__ */ e(j, { value: l?.value, direction: l?.direction })
678
+ }, children: /* @__PURE__ */ e(j, { value: s?.value, direction: s?.direction }) }) : /* @__PURE__ */ e(j, { value: s?.value, direction: s?.direction })
686
679
  ]
687
680
  }
688
681
  ),
@@ -690,39 +683,39 @@ const E = {
690
683
  ] });
691
684
  };
692
685
  Pe.displayName = "MetricCard";
693
- const A = ({
686
+ const H = ({
694
687
  groupId: i,
695
- options: n,
688
+ options: o,
696
689
  selectedId: t,
697
- defaultId: a,
690
+ defaultId: d,
698
691
  onSelect: f,
699
- pinnedId: s,
692
+ pinnedId: l,
700
693
  onPin: r,
701
- isOpen: l = !1,
702
- onOpenChange: o,
703
- disableHover: c = !1
694
+ isOpen: s = !1,
695
+ onOpenChange: n,
696
+ disableHover: a = !1
704
697
  }) => {
705
- const d = B(null), h = l, m = n.find((g) => g.id === t), x = !!m, p = m || n.find((g) => g.id === s) || n.find((g) => g.id === a) || n[0], w = W(() => {
698
+ const c = W(null), u = s, m = o.find((g) => g.id === t), x = !!m, p = m || o.find((g) => g.id === l) || o.find((g) => g.id === d) || o[0], w = O(() => {
706
699
  if (!p || !["7d", "30d", "60d", "90d", "mtd", "qtd", "ytd", "lytd"].includes(p.id))
707
700
  return "";
708
701
  const { start: b, end: k } = ve(p.id);
709
702
  return ke(b, k, /* @__PURE__ */ new Date());
710
703
  }, [p]), y = C(() => {
711
- c || o && o(i, !0);
712
- }, [i, o, c]), S = C(() => {
713
- c || o && o(i, !1);
714
- }, [i, o, c]), T = C(() => {
715
- o && o(i, !1);
716
- }, [i, o]), O = C(() => {
717
- o && o(i, !h);
718
- }, [i, h, o]), _ = C((g) => {
704
+ a || n && n(i, !0);
705
+ }, [i, n, a]), S = C(() => {
706
+ a || n && n(i, !1);
707
+ }, [i, n, a]), T = C(() => {
708
+ n && n(i, !1);
709
+ }, [i, n]), _ = C(() => {
710
+ n && n(i, !u);
711
+ }, [i, u, n]), $ = C((g) => {
719
712
  f(g), T();
720
713
  }, [f, T]), I = C((g, b) => {
721
714
  g.stopPropagation(), r && r(b);
722
- }, [r]), z = /* @__PURE__ */ u(
723
- $,
715
+ }, [r]), z = /* @__PURE__ */ h(
716
+ B,
724
717
  {
725
- ref: d,
718
+ ref: c,
726
719
  onMouseEnter: y,
727
720
  onMouseLeave: S,
728
721
  sx: { position: "relative", display: "inline-flex" },
@@ -730,21 +723,21 @@ const A = ({
730
723
  /* @__PURE__ */ e(
731
724
  X,
732
725
  {
733
- label: /* @__PURE__ */ u($, { sx: { display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
726
+ label: /* @__PURE__ */ h(B, { sx: { display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
734
727
  p?.label,
735
728
  /* @__PURE__ */ e(
736
- $e,
729
+ Be,
737
730
  {
738
731
  sx: {
739
732
  fontSize: 16,
740
733
  color: x ? "primary.main" : "action.active",
741
- transform: h ? "rotate(180deg)" : "none",
734
+ transform: u ? "rotate(180deg)" : "none",
742
735
  transition: "transform 200ms"
743
736
  }
744
737
  }
745
738
  )
746
739
  ] }),
747
- onClick: O,
740
+ onClick: _,
748
741
  variant: "outlined",
749
742
  color: x ? "primary" : "default",
750
743
  size: "small",
@@ -760,8 +753,8 @@ const A = ({
760
753
  /* @__PURE__ */ e(
761
754
  Ie,
762
755
  {
763
- open: h,
764
- anchorEl: d.current,
756
+ open: u,
757
+ anchorEl: c.current,
765
758
  placement: "bottom-start",
766
759
  sx: { zIndex: 1300 },
767
760
  children: /* @__PURE__ */ e(
@@ -775,12 +768,12 @@ const A = ({
775
768
  mt: 0.5,
776
769
  py: 0.5
777
770
  },
778
- children: /* @__PURE__ */ e(Me, { dense: !0, children: n.map((g) => {
779
- const b = t === g.id, k = s === g.id;
780
- return /* @__PURE__ */ u(
771
+ children: /* @__PURE__ */ e(Me, { dense: !0, children: o.map((g) => {
772
+ const b = t === g.id, k = l === g.id;
773
+ return /* @__PURE__ */ h(
781
774
  Re,
782
775
  {
783
- onClick: () => _(g.id),
776
+ onClick: () => $(g.id),
784
777
  selected: b,
785
778
  sx: {
786
779
  display: "flex",
@@ -791,8 +784,8 @@ const A = ({
791
784
  minHeight: 36
792
785
  },
793
786
  children: [
794
- /* @__PURE__ */ u($, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
795
- b && /* @__PURE__ */ e(Oe, { fontSize: "small", color: "primary", sx: { fontSize: 14 } }),
787
+ /* @__PURE__ */ h(B, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
788
+ b && /* @__PURE__ */ e(_e, { fontSize: "small", color: "primary", sx: { fontSize: 14 } }),
796
789
  /* @__PURE__ */ e(
797
790
  Te,
798
791
  {
@@ -819,7 +812,7 @@ const A = ({
819
812
  }
820
813
  },
821
814
  title: k ? "Unpin as default" : "Set as default",
822
- children: k ? /* @__PURE__ */ e(Be, { fontSize: "small", color: "warning", sx: { fontSize: 14 } }) : /* @__PURE__ */ e(We, { fontSize: "small", sx: { fontSize: 14 } })
815
+ children: k ? /* @__PURE__ */ e(We, { fontSize: "small", color: "warning", sx: { fontSize: 14 } }) : /* @__PURE__ */ e(Oe, { fontSize: "small", sx: { fontSize: 14 } })
823
816
  }
824
817
  )
825
818
  ]
@@ -848,67 +841,67 @@ const A = ({
848
841
  }
849
842
  ) : z;
850
843
  };
851
- A.displayName = "ExpandableChip";
844
+ H.displayName = "ExpandableChip";
852
845
  function Ve({
853
846
  selectedPreset: i,
854
- onSelect: n,
847
+ onSelect: o,
855
848
  pinnedPreset: t = "30d",
856
- onPin: a,
849
+ onPin: d,
857
850
  openGroup: f,
858
- onOpenChange: s,
851
+ onOpenChange: l,
859
852
  disableHover: r = !1,
860
- showCalendarEntry: l = !0,
861
- calendarEntry: o
853
+ showCalendarEntry: s = !0,
854
+ calendarEntry: n
862
855
  }) {
863
- const c = i === "today";
864
- return /* @__PURE__ */ u($, { className: "hybrid-date-picker__quick-bar", children: [
856
+ const a = i === "today";
857
+ return /* @__PURE__ */ h(B, { className: "hybrid-date-picker__quick-bar", children: [
865
858
  /* @__PURE__ */ e(
866
859
  X,
867
860
  {
868
861
  label: "Today",
869
862
  size: "small",
870
- variant: c ? "filled" : "outlined",
871
- color: c ? "primary" : "default",
872
- onClick: () => n("today"),
863
+ variant: a ? "filled" : "outlined",
864
+ color: a ? "primary" : "default",
865
+ onClick: () => o("today"),
873
866
  sx: {
874
- fontWeight: c ? 600 : 400,
867
+ fontWeight: a ? 600 : 400,
875
868
  cursor: "pointer"
876
869
  }
877
870
  }
878
871
  ),
879
872
  /* @__PURE__ */ e(
880
- A,
873
+ H,
881
874
  {
882
875
  groupId: "rolling",
883
876
  options: we,
884
877
  selectedId: i,
885
878
  defaultId: t,
886
- onSelect: n,
879
+ onSelect: o,
887
880
  pinnedId: t,
888
- onPin: a,
881
+ onPin: d,
889
882
  isOpen: f === "rolling",
890
- onOpenChange: s,
883
+ onOpenChange: l,
891
884
  disableHover: r
892
885
  }
893
886
  ),
894
887
  /* @__PURE__ */ e(
895
- A,
888
+ H,
896
889
  {
897
890
  groupId: "period",
898
891
  options: Se,
899
892
  selectedId: i,
900
893
  defaultId: t,
901
- onSelect: n,
894
+ onSelect: o,
902
895
  pinnedId: t,
903
- onPin: a,
896
+ onPin: d,
904
897
  isOpen: f === "period",
905
- onOpenChange: s,
898
+ onOpenChange: l,
906
899
  disableHover: r
907
900
  }
908
901
  ),
909
- l && /* @__PURE__ */ u(K, { children: [
902
+ s && /* @__PURE__ */ h(K, { children: [
910
903
  /* @__PURE__ */ e(De, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
911
- o
904
+ n
912
905
  ] })
913
906
  ] });
914
907
  }
@@ -916,12 +909,12 @@ Ve.displayName = "TimeframeQuickBar";
916
909
  export {
917
910
  ee as B,
918
911
  te as D,
919
- A as E,
912
+ H as E,
920
913
  Pe as M,
921
914
  re as O,
922
915
  ie as S,
923
916
  j as T,
924
- H as a,
917
+ A as a,
925
918
  Ve as b,
926
919
  je as e,
927
920
  Ee as u