@mt-gloss/ui 0.1.143 → 0.1.145

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.
@@ -3,7 +3,7 @@ import * as ca from "react";
3
3
  import _e, { useId as Ve, useState as O, useCallback as x, createContext as Yt, useContext as Ut, useRef as ue, useEffect as se, useMemo as Q, useSyncExternalStore as Kn, useReducer as Yn, forwardRef as Un, useImperativeHandle as Xn } from "react";
4
4
  import { S as X, E as qe, C as P, e as qn, R as Ce, h as Zn, i as Jn, j as Qn, af as es, M as ts, p as as, a9 as rs, ag as ye, N as ns, O as Lr, P as Hr, Q as ss, V as ls, W as is, X as os, Y as cs, _ as ds, a1 as us, a2 as ms, a3 as ps, a8 as gs, a4 as fs, a5 as hs, L as bs, K as ys, f as vs, g as _s, $ as Ns, a0 as xs, k as Ss, q as Cs, v as ks, r as ws, U as xt, w as Ds, x as Is, s as Ts, y as Es, t as Ps, ad as Bs, ae as Ms, z as As, A as Rs, D as zs, F as Fs, G as $s, H as Os, I as Ls, J as Hs, c as Tt, d as Ze, Z as Gr, B as Gs, ab as Vs, b as Vr, T as Me, aa as Ws, ac as mr } from "./UIContext-CGQI_KJk.js";
5
5
  import { B as be, b as js, a as Ks } from "./BaseText-Dxbk1JJa.js";
6
- import { u as Ys, a as Us, b as Xs, M as dt } from "./TimeframeQuickBar-BhKzqcZC.js";
6
+ import { u as Ys, a as Us, b as Xs, M as dt } from "./TimeframeQuickBar-BexFJUgk.js";
7
7
  import { formatValue as qs, isInRange as Zs, isSameDay as ea, formatMarketDates as Js, DEFAULT_MARKET_PRESETS as ta, isMarketActive as kt, getDateRangeForPreset as Xe, detectPreset as aa, getDateRangeDisplayInfo as Ot, formatDateRangeSmart as yt, toUppercasePresetId as ra, generateMarketId as Qs, ROLLING_OPTIONS as pr, PERIOD_OPTIONS as gr } from "@mt-gloss/utils";
8
8
  import { useGridApiRef as el, DataGridPro as tl } from "@mui/x-data-grid-pro";
9
9
  import { Chip as Ha, Tooltip as Nt, MenuItem as da, Menu as al, Box as de, IconButton as et, Select as fr, Typography as De, Button as st, Collapse as rl, Popover as nl, Dialog as sl, DialogTitle as ll, DialogContent as il, TextField as na, DialogActions as ol, Tabs as cl, Tab as dl } from "@mui/material";
@@ -1,8 +1,8 @@
1
1
  import { jsxs as u, jsx as e, Fragment as K } from "react/jsx-runtime";
2
- import { useId as me, useMemo as B, useState as ge, useRef as $, useCallback as C, useEffect as pe } from "react";
2
+ import { useId as me, useMemo as W, useState as ge, useRef as B, useCallback as C, useEffect as pe } from "react";
3
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";
4
- import { B as D, a as N, b as Ce } from "./BaseText-Dxbk1JJa.js";
5
- import { Box as E, Chip as X, Popper as Ie, Paper as ze, MenuList as Me, MenuItem as Re, ListItemText as Le, IconButton as Te, Tooltip as De, Divider as Ne } from "@mui/material";
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
6
  import $e from "@mui/icons-material/ExpandMore";
7
7
  import Be from "@mui/icons-material/Star";
8
8
  import We from "@mui/icons-material/StarBorder";
@@ -43,7 +43,7 @@ const Q = {
43
43
  };
44
44
  j.displayName = "TrendIndicator";
45
45
  const H = ({ data: i, color: n, isStale: t }) => {
46
- const f = "sparkbg-" + me().replace(/:/g, ""), s = n || "#4f46e5", r = B(() => {
46
+ const f = "sparkbg-" + me().replace(/:/g, ""), s = n || "#4f46e5", r = W(() => {
47
47
  if (!i || i.length < 2) return null;
48
48
  const l = 300, o = 55, c = 2, d = Math.min(...i), m = Math.max(...i) - d || 1, p = i.map((y, S) => ({
49
49
  x: S / (i.length - 1) * l,
@@ -104,7 +104,7 @@ const H = ({ data: i, color: n, isStale: t }) => {
104
104
  };
105
105
  H.displayName = "SparklineBg";
106
106
  const ee = ({ data: i, color: n, isStale: t }) => {
107
- const a = n || "#4f46e5", f = B(() => {
107
+ const a = n || "#4f46e5", f = W(() => {
108
108
  if (!i || i.length < 1) return null;
109
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;
110
110
  return i.map((x, p) => {
@@ -277,7 +277,7 @@ const re = ({ value: i = 0, max: n = 100, trendValue: t = 0, color: a = "#6b7280
277
277
  re.displayName = "ObjectArrow";
278
278
  const _e = { slot3: 200, slot5: 380 };
279
279
  function Ee(i, n) {
280
- const t = _e, a = 150, [f, s] = ge(1), r = $(null), l = $(null), o = C(() => {
280
+ const t = _e, a = 150, [f, s] = ge(1), r = B(null), l = B(null), o = C(() => {
281
281
  const d = r.current;
282
282
  if (d == null) return;
283
283
  const h = d < t.slot3 ? 1 : d < t.slot5 ? 3 : 5;
@@ -300,17 +300,17 @@ function Ee(i, n) {
300
300
  return { capacity: f, onPointerUp: c };
301
301
  }
302
302
  function ie(i) {
303
- const { onStatusSlotClick: n } = i, t = $(null), a = ye(), { capacity: f, onPointerUp: s } = Ee(t), r = i.maxSlots ?? f, l = i.statuses.slice(0, r);
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
304
  if (!a) {
305
305
  const o = i.statuses[0];
306
306
  return /* @__PURE__ */ u(
307
- D,
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
- /* @__PURE__ */ e(N, { className: "gloss-metric-card__label", children: i.label }),
313
- o != null ? /* @__PURE__ */ e(N, { children: String(o.value) }) : null
312
+ /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: i.label }),
313
+ o != null ? /* @__PURE__ */ e(D, { children: String(o.value) }) : null
314
314
  ]
315
315
  }
316
316
  );
@@ -324,7 +324,7 @@ function ie(i) {
324
324
  "data-status-capacity": r,
325
325
  onPointerUp: s,
326
326
  children: [
327
- /* @__PURE__ */ e(N, { className: "gloss-metric-card__label", children: i.label }),
327
+ /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: i.label }),
328
328
  /* @__PURE__ */ e("div", { className: "gloss-status-slots", "data-status-slot-count": l.length, children: l.map((o, c) => {
329
329
  const d = i.sparklinePerStatus?.[o.id], h = o.id === i.activeStatusId;
330
330
  return /* @__PURE__ */ u(
@@ -362,7 +362,7 @@ function J(i, n) {
362
362
  const a = parseInt(t.substring(0, 2), 16), f = parseInt(t.substring(2, 4), 16), s = parseInt(t.substring(4, 6), 16);
363
363
  return `rgba(${a},${f},${s},${n})`;
364
364
  }
365
- const _ = {
365
+ const E = {
366
366
  up: "var(--color-positive)",
367
367
  down: "var(--color-negative)",
368
368
  flat: "var(--color-text-secondary)"
@@ -429,10 +429,10 @@ const _ = {
429
429
  colSpan: c = 1,
430
430
  isStale: d,
431
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, L = t === "object-arrow" ? n.objectArrowValue : 0, W = t === "object-arrow" ? n.objectArrowMax : 100, O = 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(
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
433
  typeof n.value == "number" ? n.value : null,
434
434
  n.tintCondition
435
- ) : void 0) ?? x, k = (b ? Ae[b] : void 0) || b, { formatted: T, tier: ne, length: oe } = B(
435
+ ) : void 0) ?? x, k = (b ? Ae[b] : void 0) || b, { formatted: L, tier: ne, length: oe } = W(
436
436
  () => t === "status-mode" ? { formatted: "", tier: 0, length: 0 } : be(s, {
437
437
  prefix: r?.prefix || "",
438
438
  suffix: r?.suffix || "",
@@ -442,7 +442,7 @@ const _ = {
442
442
  );
443
443
  if (n.variant === "status-mode")
444
444
  return /* @__PURE__ */ e(ie, { ...n });
445
- const R = { display: T, full: T, length: oe }, se = Y(R.length, c), le = l?.direction && _[l.direction] || _.flat, F = d ? "gloss-metric-data-stale" : "gloss-metric-data-fresh", P = {
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 = {
446
446
  fontWeight: 700,
447
447
  letterSpacing: "-0.03em",
448
448
  color: t === "highlight" ? k : "rgba(0,0,0,0.87)",
@@ -469,7 +469,7 @@ const _ = {
469
469
  flex: "none",
470
470
  minWidth: void 0
471
471
  } : V, ce = () => {
472
- const v = O === "down" ? "▼" : "▲";
472
+ const v = _ === "down" ? "▼" : "▲";
473
473
  return /* @__PURE__ */ e(
474
474
  "div",
475
475
  {
@@ -630,19 +630,19 @@ const _ = {
630
630
  t === "sparkline" && /* @__PURE__ */ e(H, { data: p, color: m, isStale: d }),
631
631
  t === "bars" && /* @__PURE__ */ e(ee, { data: w, color: m, isStale: d }),
632
632
  /* @__PURE__ */ u(
633
- D,
633
+ N,
634
634
  {
635
635
  className: "gloss-metric-card__zone-a",
636
636
  "data-tier": ne,
637
637
  style: { height: 28, flexShrink: 0, zIndex: 2, position: "relative", display: "flex", alignItems: "center" },
638
638
  children: [
639
- /* @__PURE__ */ e(N, { className: "gloss-metric-card__label", children: a }),
639
+ /* @__PURE__ */ e(D, { className: "gloss-metric-card__label", children: a }),
640
640
  f
641
641
  ]
642
642
  }
643
643
  ),
644
644
  /* @__PURE__ */ u(
645
- D,
645
+ N,
646
646
  {
647
647
  definition: { display: "flex", align: "center" },
648
648
  className: `gloss-metric-card__zone-b ${F}`,
@@ -652,8 +652,8 @@ const _ = {
652
652
  t === "object-arrow" && /* @__PURE__ */ e(
653
653
  re,
654
654
  {
655
- value: L,
656
- max: W,
655
+ value: T,
656
+ max: O,
657
657
  trendValue: l?.value,
658
658
  color: le,
659
659
  colSpan: c,
@@ -668,7 +668,7 @@ const _ = {
668
668
  }
669
669
  ),
670
670
  /* @__PURE__ */ u(
671
- D,
671
+ N,
672
672
  {
673
673
  definition: { display: "flex", justify: "between", align: "center" },
674
674
  className: `gloss-metric-card__zone-c ${F}`,
@@ -702,7 +702,7 @@ const A = ({
702
702
  onOpenChange: o,
703
703
  disableHover: c = !1
704
704
  }) => {
705
- const d = $(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 = B(() => {
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(() => {
706
706
  if (!p || !["7d", "30d", "60d", "90d", "mtd", "qtd", "ytd", "lytd"].includes(p.id))
707
707
  return "";
708
708
  const { start: b, end: k } = ve(p.id);
@@ -711,16 +711,16 @@ const A = ({
711
711
  c || o && o(i, !0);
712
712
  }, [i, o, c]), S = C(() => {
713
713
  c || o && o(i, !1);
714
- }, [i, o, c]), L = C(() => {
714
+ }, [i, o, c]), T = C(() => {
715
715
  o && o(i, !1);
716
- }, [i, o]), W = C(() => {
716
+ }, [i, o]), O = C(() => {
717
717
  o && o(i, !h);
718
- }, [i, h, o]), O = C((g) => {
719
- f(g), L();
720
- }, [f, L]), I = C((g, b) => {
718
+ }, [i, h, o]), _ = C((g) => {
719
+ f(g), T();
720
+ }, [f, T]), I = C((g, b) => {
721
721
  g.stopPropagation(), r && r(b);
722
722
  }, [r]), z = /* @__PURE__ */ u(
723
- E,
723
+ $,
724
724
  {
725
725
  ref: d,
726
726
  onMouseEnter: y,
@@ -730,31 +730,27 @@ const A = ({
730
730
  /* @__PURE__ */ e(
731
731
  X,
732
732
  {
733
- label: p?.label,
734
- onClick: W,
735
- deleteIcon: /* @__PURE__ */ e(
736
- $e,
737
- {
738
- sx: {
739
- transform: h ? "rotate(180deg)" : "none",
740
- transition: "transform 200ms"
733
+ label: /* @__PURE__ */ u($, { sx: { display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
734
+ p?.label,
735
+ /* @__PURE__ */ e(
736
+ $e,
737
+ {
738
+ sx: {
739
+ fontSize: 16,
740
+ color: x ? "primary.main" : "action.active",
741
+ transform: h ? "rotate(180deg)" : "none",
742
+ transition: "transform 200ms"
743
+ }
741
744
  }
742
- }
743
- ),
744
- onDelete: () => {
745
- },
745
+ )
746
+ ] }),
747
+ onClick: O,
746
748
  variant: "outlined",
747
749
  color: x ? "primary" : "default",
748
750
  size: "small",
749
751
  sx: {
750
752
  cursor: "pointer",
751
753
  fontWeight: x ? 600 : 400,
752
- "& .MuiChip-deleteIcon": {
753
- fontSize: "16px",
754
- marginLeft: "-4px",
755
- marginRight: "4px",
756
- color: x ? "primary.main" : "action.active"
757
- },
758
754
  "&:hover": {
759
755
  borderColor: "primary.main"
760
756
  }
@@ -767,7 +763,6 @@ const A = ({
767
763
  open: h,
768
764
  anchorEl: d.current,
769
765
  placement: "bottom-start",
770
- disablePortal: !0,
771
766
  sx: { zIndex: 1300 },
772
767
  children: /* @__PURE__ */ e(
773
768
  ze,
@@ -785,7 +780,7 @@ const A = ({
785
780
  return /* @__PURE__ */ u(
786
781
  Re,
787
782
  {
788
- onClick: () => O(g.id),
783
+ onClick: () => _(g.id),
789
784
  selected: b,
790
785
  sx: {
791
786
  display: "flex",
@@ -796,10 +791,10 @@ const A = ({
796
791
  minHeight: 36
797
792
  },
798
793
  children: [
799
- /* @__PURE__ */ u(E, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
794
+ /* @__PURE__ */ u($, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
800
795
  b && /* @__PURE__ */ e(Oe, { fontSize: "small", color: "primary", sx: { fontSize: 14 } }),
801
796
  /* @__PURE__ */ e(
802
- Le,
797
+ Te,
803
798
  {
804
799
  primary: g.label,
805
800
  primaryTypographyProps: {
@@ -811,10 +806,10 @@ const A = ({
811
806
  )
812
807
  ] }),
813
808
  /* @__PURE__ */ e(
814
- Te,
809
+ Le,
815
810
  {
816
811
  size: "small",
817
- onClick: (T) => I(T, g.id),
812
+ onClick: (L) => I(L, g.id),
818
813
  sx: {
819
814
  p: 0.25,
820
815
  opacity: k ? 1 : 0,
@@ -840,7 +835,7 @@ const A = ({
840
835
  }
841
836
  );
842
837
  return w ? /* @__PURE__ */ e(
843
- De,
838
+ Ne,
844
839
  {
845
840
  title: w,
846
841
  placement: "top-start",
@@ -866,7 +861,7 @@ function Ve({
866
861
  calendarEntry: o
867
862
  }) {
868
863
  const c = i === "today";
869
- return /* @__PURE__ */ u(E, { className: "hybrid-date-picker__quick-bar", children: [
864
+ return /* @__PURE__ */ u($, { className: "hybrid-date-picker__quick-bar", children: [
870
865
  /* @__PURE__ */ e(
871
866
  X,
872
867
  {
@@ -912,7 +907,7 @@ function Ve({
912
907
  }
913
908
  ),
914
909
  l && /* @__PURE__ */ u(K, { children: [
915
- /* @__PURE__ */ e(Ne, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
910
+ /* @__PURE__ */ e(De, { orientation: "vertical", flexItem: !0, sx: { mx: 0.5 } }),
916
911
  o
917
912
  ] })
918
913
  ] });
package/catalog.js CHANGED
@@ -1,10 +1,10 @@
1
- import { A as I, Q as N, E as B, J as x, L as D, D as F, F as A, H as M, K as v, T as R, U as H, V as W, b1 as _, W as k, b2 as L, b3 as z, b4 as E, X as G, Y as O, Z as $ } from "./Expandable-BcXSzdgU.js";
2
- import { a5 as Be, b8 as xe, aB as De, aj as Fe, $ as Ae, ap as Me, bM as ve, N as Re, aa as He, P as We, B as _e, bi as ke, C as Le, bq as ze, b as Ee, c as Ge, O as Oe, q as $e, af as we, aP as Ve, aE as Xe, as as je, m as Ue, o as Ze, aH as qe, ad as Je, ba as Ke, ab as Qe, _ as Ye, ar as ea, aS as aa, bc as sa, p as ta, ao as ra, a2 as oa, at as ia, a4 as na, ac as la, bC as da, aV as ca, t as ga, I as ma, i as pa, ay as ua, M as ba, y as fa, au as ha, bH as ya, aq as Ta, w as Sa, aU as Pa, b5 as Ca, al as Ia, aM as Na, ai as Ba, an as xa, aw as Da, bO as Fa, aT as Aa, bN as Ma, ae as va, e as Ra, R as Ha, l as Wa, r as _a, aJ as ka, ak as La, ag as za, j as Ea, z as Ga, b9 as Oa, ah as $a, be as wa, bh as Va, bf as Xa, bg as ja, k as Ua, bb as Za, S as qa, bj as Ja, ax as Ka, bd as Qa, bI as Ya, am as es, bL as as, v as ss, bD as ts, n as rs, h as os, s as is, a0 as ns, a9 as ls, bp as ds, bw as cs, aD as gs, a8 as ms, aR as ps, aG as us, aA as bs, aO as fs, aL as hs, a3 as ys } from "./Expandable-BcXSzdgU.js";
1
+ import { A as I, Q as N, E as B, J as x, L as D, D as F, F as A, H as M, K as v, T as R, U as H, V as W, b1 as _, W as k, b2 as L, b3 as z, b4 as E, X as G, Y as O, Z as $ } from "./Expandable-D-GbTjIp.js";
2
+ import { a5 as Be, b8 as xe, aB as De, aj as Fe, $ as Ae, ap as Me, bM as ve, N as Re, aa as He, P as We, B as _e, bi as ke, C as Le, bq as ze, b as Ee, c as Ge, O as Oe, q as $e, af as we, aP as Ve, aE as Xe, as as je, m as Ue, o as Ze, aH as qe, ad as Je, ba as Ke, ab as Qe, _ as Ye, ar as ea, aS as aa, bc as sa, p as ta, ao as ra, a2 as oa, at as ia, a4 as na, ac as la, bC as da, aV as ca, t as ga, I as ma, i as pa, ay as ua, M as ba, y as fa, au as ha, bH as ya, aq as Ta, w as Sa, aU as Pa, b5 as Ca, al as Ia, aM as Na, ai as Ba, an as xa, aw as Da, bO as Fa, aT as Aa, bN as Ma, ae as va, e as Ra, R as Ha, l as Wa, r as _a, aJ as ka, ak as La, ag as za, j as Ea, z as Ga, b9 as Oa, ah as $a, be as wa, bh as Va, bf as Xa, bg as ja, k as Ua, bb as Za, S as qa, bj as Ja, ax as Ka, bd as Qa, bI as Ya, am as es, bL as as, v as ss, bD as ts, n as rs, h as os, s as is, a0 as ns, a9 as ls, bp as ds, bw as cs, aD as gs, a8 as ms, aR as ps, aG as us, aA as bs, aO as fs, aL as hs, a3 as ys } from "./Expandable-D-GbTjIp.js";
3
3
  import { jsx as c, jsxs as S } from "react/jsx-runtime";
4
4
  import { C as e, T as a, aa as w, S as s, E as u, R as m, Z as V } from "./UIContext-CGQI_KJk.js";
5
5
  import { B as X, a as j, e as U, c as Z, d as q, b as J } from "./BaseAsyncButton-CJlY7Uik.js";
6
6
  import { b as K } from "./BaseText-Dxbk1JJa.js";
7
- import { B as Ss, D as Ps, M as Cs, O as Is, a as Ns, T as Bs } from "./TimeframeQuickBar-BhKzqcZC.js";
7
+ import { B as Ss, D as Ps, M as Cs, O as Is, a as Ns, T as Bs } from "./TimeframeQuickBar-BexFJUgk.js";
8
8
  import { formatDateRange as Ds, resolveEvent as Fs, resolvePreset as As, smartDateFormat as Ms } from "@mt-gloss/utils/dateInterpretation";
9
9
  const Q = {
10
10
  page: {