@hybridcore/ui 1.6.6 → 1.6.8

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,25 +1,25 @@
1
- import { styled as a, alpha as C, Stack as g, Typography as s } from "@mui/material";
2
- import { Widget as f } from "../widget/styled.js";
3
- import { variantColor as d, resolvePaletteColor as p, trendColor as u } from "./helpers.js";
1
+ import { styled as i, alpha as g, Stack as C, Typography as c } from "@mui/material";
2
+ import { Widget as u } from "../widget/styled.js";
3
+ import { variantColor as l, resolvePaletteColor as d, trendColor as f } from "./helpers.js";
4
4
  const e = {
5
5
  shouldForwardProp: (o) => o !== "ownerState"
6
- }, v = a(f.Root, {
6
+ }, v = i(u.Root, {
7
7
  name: "HCMetricCard",
8
8
  slot: "Root",
9
9
  ...e
10
- })(({ theme: o, ownerState: i }) => {
11
- const n = d(o, i.variant), t = i.layout === "panel";
12
- let r;
13
- return n ? r = C(n, 0.05) : t && (r = o.palette.background.default), {
10
+ })(({ theme: o, ownerState: n }) => {
11
+ const a = l(o, n.variant), r = n.layout === "panel";
12
+ let t;
13
+ return a ? t = g(a, 0.05) : r && (t = o.palette.background.default), {
14
14
  position: "relative",
15
15
  overflow: "hidden",
16
16
  padding: o.spacing(1.5, 2),
17
- ...r && { backgroundColor: r },
17
+ ...t && { backgroundColor: t },
18
18
  [o.breakpoints.down("md")]: {
19
19
  padding: o.spacing(1.5)
20
20
  }
21
21
  };
22
- }), y = a(g, {
22
+ }), y = i(C, {
23
23
  name: "HCMetricCard",
24
24
  slot: "Content"
25
25
  })(() => ({
@@ -27,46 +27,64 @@ const e = {
27
27
  width: "100%",
28
28
  minWidth: 0,
29
29
  zIndex: 1
30
- })), m = a(s, {
30
+ })), k = i(c, {
31
31
  name: "HCMetricCard",
32
32
  slot: "Label"
33
33
  })(({ theme: o }) => ({
34
34
  color: o.palette.text.secondary,
35
35
  marginBottom: o.spacing(0.5),
36
36
  fontWeight: 500
37
- })), k = a(s, {
37
+ })), m = i(c, {
38
38
  name: "HCMetricCard",
39
39
  slot: "Value",
40
40
  ...e
41
- })(({ theme: o, ownerState: i }) => {
42
- const n = p(o, i.calculatedValueColor), t = p(o, i.calculatedValueBg);
41
+ })(({ theme: o, ownerState: n }) => {
42
+ const a = d(o, n.calculatedValueColor), r = d(o, n.calculatedValueBg);
43
43
  return {
44
- color: n ?? d(o, i.variant) ?? o.palette.text.primary,
44
+ color: a ?? l(o, n.variant) ?? o.palette.text.primary,
45
45
  fontWeight: 500,
46
46
  marginBottom: o.spacing(0.5),
47
47
  whiteSpace: "nowrap",
48
- ...t && {
49
- backgroundColor: t,
48
+ ...r && {
49
+ backgroundColor: r,
50
50
  borderRadius: o.shape.borderRadius,
51
51
  padding: o.spacing(0, 0.75)
52
52
  },
53
53
  [o.breakpoints.down("md")]: { fontSize: "1.35rem" },
54
54
  [o.breakpoints.up("md")]: { fontSize: "2rem" }
55
55
  };
56
- }), I = a("div", {
56
+ }), S = i(c, {
57
+ name: "HCMetricCard",
58
+ slot: "SecondValue",
59
+ ...e
60
+ })(({ theme: o, ownerState: n }) => {
61
+ const a = d(o, n.calculatedSecondValueColor), r = d(o, n.calculatedSecondValueBg);
62
+ return {
63
+ color: a ?? o.palette.text.secondary,
64
+ fontWeight: 400,
65
+ whiteSpace: "nowrap",
66
+ ...r && {
67
+ backgroundColor: r,
68
+ borderRadius: o.shape.borderRadius,
69
+ padding: o.spacing(0, 0.75)
70
+ },
71
+ [o.breakpoints.down("md")]: { fontSize: "0.95rem" },
72
+ [o.breakpoints.up("md")]: { fontSize: "1.25rem" }
73
+ };
74
+ }), H = i("div", {
57
75
  name: "HCMetricCard",
58
76
  slot: "TrendContainer",
59
77
  ...e
60
- })(({ theme: o, ownerState: i }) => {
61
- const n = u(o, i.calculatedTrend), t = i.layout === "panel";
78
+ })(({ theme: o, ownerState: n }) => {
79
+ const a = f(o, n.calculatedTrend), r = n.layout === "panel";
62
80
  return {
63
81
  display: "inline-flex",
64
82
  alignItems: "center",
65
83
  gap: o.spacing(0.5),
66
84
  fontWeight: 500,
67
- color: n,
68
- ...t ? {
69
- backgroundColor: C(n, 0.14),
85
+ color: a,
86
+ ...r ? {
87
+ backgroundColor: g(a, 0.14),
70
88
  borderRadius: 999,
71
89
  padding: o.spacing(0.25, 1),
72
90
  fontSize: "0.8125rem",
@@ -79,7 +97,7 @@ const e = {
79
97
  }
80
98
  }
81
99
  };
82
- }), H = a(s, {
100
+ }), I = i(c, {
83
101
  name: "HCMetricCard",
84
102
  slot: "Description"
85
103
  })(({ theme: o }) => ({
@@ -87,37 +105,37 @@ const e = {
87
105
  display: "block",
88
106
  position: "relative",
89
107
  zIndex: 1
90
- })), P = a("div", {
108
+ })), R = i("div", {
91
109
  name: "HCMetricCard",
92
110
  slot: "Icon",
93
111
  ...e
94
- })(({ theme: o, ownerState: i }) => ({
112
+ })(({ theme: o, ownerState: n }) => ({
95
113
  display: "flex",
96
114
  alignItems: "center",
97
115
  justifyContent: "center",
98
- color: d(o, i.variant) ?? o.palette.text.secondary,
99
- marginRight: i.iconPosition === "left" ? o.spacing(2) : 0,
100
- marginLeft: i.iconPosition === "right" ? o.spacing(2) : 0,
116
+ color: l(o, n.variant) ?? o.palette.text.secondary,
117
+ marginRight: n.iconPosition === "left" ? o.spacing(2) : 0,
118
+ marginLeft: n.iconPosition === "right" ? o.spacing(2) : 0,
101
119
  [o.breakpoints.down("sm")]: {
102
120
  position: "absolute",
103
121
  top: o.spacing(2),
104
122
  left: o.spacing(2),
105
123
  margin: 0
106
124
  }
107
- })), R = a("div", {
125
+ })), w = i("div", {
108
126
  name: "HCMetricCard",
109
127
  slot: "CornerIcon",
110
128
  ...e
111
- })(({ theme: o, ownerState: i }) => {
112
- var l, c;
113
- const n = {}, t = (l = i.iconPosition) != null && l.startsWith("top") ? "top" : "bottom", r = (c = i.iconPosition) != null && c.endsWith("left") ? "left" : "right";
114
- return n[t] = o.spacing(2), n[r] = o.spacing(2), {
129
+ })(({ theme: o, ownerState: n }) => {
130
+ var s, p;
131
+ const a = {}, r = (s = n.iconPosition) != null && s.startsWith("top") ? "top" : "bottom", t = (p = n.iconPosition) != null && p.endsWith("left") ? "left" : "right";
132
+ return a[r] = o.spacing(2), a[t] = o.spacing(2), {
115
133
  position: "absolute",
116
- ...n,
117
- color: d(o, i.variant) ?? o.palette.text.secondary,
134
+ ...a,
135
+ color: l(o, n.variant) ?? o.palette.text.secondary,
118
136
  zIndex: 2
119
137
  };
120
- }), w = a("div", {
138
+ }), z = i("div", {
121
139
  name: "HCMetricCard",
122
140
  slot: "Chart"
123
141
  })(({ theme: o }) => ({
@@ -130,7 +148,7 @@ const e = {
130
148
  alignItems: "flex-end",
131
149
  overflow: "hidden",
132
150
  borderRadius: o.shape.borderRadius
133
- })), z = a("div", {
151
+ })), P = i("div", {
134
152
  name: "HCMetricCard",
135
153
  slot: "Panel"
136
154
  })(({ theme: o }) => ({
@@ -147,7 +165,7 @@ const e = {
147
165
  backgroundColor: o.palette.background.paper,
148
166
  boxShadow: o.shadows[1],
149
167
  overflow: "hidden"
150
- })), S = a("div", {
168
+ })), W = i("div", {
151
169
  name: "HCMetricCard",
152
170
  slot: "SideChart"
153
171
  })(() => ({
@@ -160,15 +178,16 @@ const e = {
160
178
  alignItems: "flex-end"
161
179
  }));
162
180
  export {
163
- w as MetricCardChartContainer,
181
+ z as MetricCardChartContainer,
164
182
  y as MetricCardContent,
165
- R as MetricCardCornerIconContainer,
166
- H as MetricCardDescription,
167
- P as MetricCardIconContainer,
168
- m as MetricCardLabel,
169
- z as MetricCardPanel,
183
+ w as MetricCardCornerIconContainer,
184
+ I as MetricCardDescription,
185
+ R as MetricCardIconContainer,
186
+ k as MetricCardLabel,
187
+ P as MetricCardPanel,
170
188
  v as MetricCardRoot,
171
- S as MetricCardSideChart,
172
- I as MetricCardTrendContainer,
173
- k as MetricCardValue
189
+ S as MetricCardSecondValue,
190
+ W as MetricCardSideChart,
191
+ H as MetricCardTrendContainer,
192
+ m as MetricCardValue
174
193
  };
@@ -1,4 +1,4 @@
1
- import { jsxs as o, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
2
  import { Typography as i, Divider as f, TableContainer as I, Table as R, TableHead as j, TableRow as g, TableCell as r, TableBody as w, Box as D, IconButton as G } from "@mui/material";
3
3
  import { useSimplePivotTableLogic as J } from "./logic.js";
4
4
  import { SimplePivotTableRoot as M, SimplePivotTableHeader as O, SimplePivotTableContent as V, SimplePivotTableFooter as X, SimplePivotTableScrollHint as q } from "./styled.js";
@@ -19,7 +19,7 @@ const Z = (s) => {
19
19
  formatDimensionValue: y,
20
20
  formatCell: C,
21
21
  getCellStyle: F,
22
- ownerState: t,
22
+ ownerState: o,
23
23
  scrollRef: N,
24
24
  canScroll: k,
25
25
  scrollModifierLabel: P,
@@ -33,18 +33,18 @@ const Z = (s) => {
33
33
  data: h,
34
34
  summaries: v
35
35
  };
36
- return /* @__PURE__ */ o(
36
+ return /* @__PURE__ */ t(
37
37
  M,
38
38
  {
39
- ownerState: t,
39
+ ownerState: o,
40
40
  sx: H,
41
41
  "data-snapshot": JSON.stringify(W),
42
42
  ...L,
43
43
  children: [
44
- /* @__PURE__ */ e(O, { ownerState: t, children: /* @__PURE__ */ e(i, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
44
+ /* @__PURE__ */ e(O, { ownerState: o, children: /* @__PURE__ */ e(i, { sx: { paddingLeft: "0.5rem" }, variant: "h3", children: m }) }),
45
45
  /* @__PURE__ */ e(f, {}),
46
- /* @__PURE__ */ e(V, { ownerState: t, children: /* @__PURE__ */ e(I, { ref: N, children: /* @__PURE__ */ o(R, { size: "small", stickyHeader: !0, children: [
47
- /* @__PURE__ */ e(j, { children: /* @__PURE__ */ o(g, { children: [
46
+ /* @__PURE__ */ e(V, { ownerState: o, children: /* @__PURE__ */ e(I, { ref: N, children: /* @__PURE__ */ t(R, { size: "small", stickyHeader: !0, children: [
47
+ /* @__PURE__ */ e(j, { children: /* @__PURE__ */ t(g, { children: [
48
48
  n.map((l) => /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: x(l) }) }, l.value)),
49
49
  c.map((l) => /* @__PURE__ */ e(
50
50
  r,
@@ -62,7 +62,7 @@ const Z = (s) => {
62
62
  l.dataFieldName
63
63
  ))
64
64
  ] }) }),
65
- /* @__PURE__ */ e(w, { children: h.map((l, z) => /* @__PURE__ */ o(
65
+ /* @__PURE__ */ e(w, { children: h.map((l, z) => /* @__PURE__ */ t(
66
66
  g,
67
67
  {
68
68
  hover: !0,
@@ -90,7 +90,7 @@ const Z = (s) => {
90
90
  {
91
91
  variant: "body2",
92
92
  fontWeight: 500,
93
- color: u.color ?? "primary.main",
93
+ color: u.color ?? "text.primary",
94
94
  children: C(l[a.dataFieldName], a.format)
95
95
  }
96
96
  )
@@ -104,13 +104,13 @@ const Z = (s) => {
104
104
  )) })
105
105
  ] }) }) }),
106
106
  /* @__PURE__ */ e(f, {}),
107
- /* @__PURE__ */ o(X, { ownerState: t, children: [
108
- k && /* @__PURE__ */ e(q, { ownerState: t, children: /* @__PURE__ */ o(i, { variant: "caption", children: [
107
+ /* @__PURE__ */ t(X, { ownerState: o, children: [
108
+ k && /* @__PURE__ */ e(q, { ownerState: o, children: /* @__PURE__ */ t(i, { variant: "caption", children: [
109
109
  "Hold ",
110
110
  P,
111
111
  " to scroll"
112
112
  ] }) }),
113
- d ? /* @__PURE__ */ o(
113
+ d ? /* @__PURE__ */ t(
114
114
  D,
115
115
  {
116
116
  sx: {
@@ -122,7 +122,7 @@ const Z = (s) => {
122
122
  },
123
123
  children: [
124
124
  /* @__PURE__ */ e(i, { variant: "caption", fontWeight: 600, children: d.name }),
125
- d.items.map((l) => /* @__PURE__ */ o(i, { variant: "caption", color: "text.secondary", children: [
125
+ d.items.map((l) => /* @__PURE__ */ t(i, { variant: "caption", color: "text.secondary", children: [
126
126
  l.label,
127
127
  ": ",
128
128
  l.value
package/dist/main.d.ts CHANGED
@@ -260,6 +260,15 @@ export declare interface ChartProps {
260
260
  * a custom theme to override per-deployment.
261
261
  */
262
262
  colors?: readonly string[];
263
+ /**
264
+ * Controls whether a line series bridges gaps in the data. When `true` (the
265
+ * default) the line is drawn continuously across missing points. When `false`,
266
+ * the line breaks wherever data is missing — on a date axis a gap is detected
267
+ * when the spacing between adjacent points exceeds the base interval, so
268
+ * absent dates become visible breaks instead of a straight fill. Line-type
269
+ * charts only.
270
+ */
271
+ connectMissingData?: boolean;
263
272
  sx?: SxProps<Theme>;
264
273
  }
265
274
 
@@ -1191,6 +1200,12 @@ export declare interface MetricCardDataPoint {
1191
1200
  export declare interface MetricCardProps {
1192
1201
  label: string;
1193
1202
  value: MetricCardDataPoint[];
1203
+ // Optional denominator series rendered as a muted "value / secondValue" pair.
1204
+ // Like `value`, only the latest point is shown; it never picks up conditional
1205
+ // coloring. Formatted by `secondValueFormat` when set, else falls back to
1206
+ // `format` (so a "/ " separator can be carried as `secondValueFormat.prefix`).
1207
+ secondValue?: MetricCardDataPoint[];
1208
+ secondValueFormat?: ValueFormat;
1194
1209
  description?: string;
1195
1210
  variant?: MetricVariant;
1196
1211
  loading?: boolean;
@@ -1634,9 +1649,11 @@ export declare type RelativeDatePreset =
1634
1649
  export declare const removeNotification: (id: string) => void;
1635
1650
 
1636
1651
  /**
1637
- * Resolve the color/background contributed by the first matching conditional
1638
- * rule. Returns an empty object when the value is non-numeric or nothing
1639
- * matches, so callers can spread it safely.
1652
+ * Resolve a value's text/background color: the format's base `color`/
1653
+ * `backgroundColor` apply unconditionally, then the first matching conditional
1654
+ * rule overrides them per-field (a rule that only sets one color keeps the base
1655
+ * for the other). Returns an empty object when nothing is configured, so callers
1656
+ * can spread it safely.
1640
1657
  */
1641
1658
  export declare const resolveConditionalStyle: (value: unknown, format?: ValueFormat) => {
1642
1659
  color?: string;
@@ -2176,7 +2193,12 @@ export declare interface ValueFormat {
2176
2193
  suffix?: string;
2177
2194
  /** Fixed number of fraction digits; defaults to "up to 2" when unset. */
2178
2195
  decimals?: number;
2179
- /** First matching rule wins. */
2196
+ /** Base text color applied unconditionally (theme token path or CSS color). A
2197
+ * matching `conditionalRules` entry overrides it. */
2198
+ color?: string;
2199
+ /** Base background color applied unconditionally. A matching rule overrides it. */
2200
+ backgroundColor?: string;
2201
+ /** First matching rule wins; its colors override the base `color`/`backgroundColor`. */
2180
2202
  conditionalRules?: ConditionalRule[];
2181
2203
  }
2182
2204
 
@@ -3321,6 +3343,7 @@ declare module "@mui/material/styles" {
3321
3343
  | "content"
3322
3344
  | "label"
3323
3345
  | "value"
3346
+ | "secondValue"
3324
3347
  | "trendContainer"
3325
3348
  | "description"
3326
3349
  | "icon"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.6.6",
4
+ "version": "1.6.8",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",