@hybridcore/ui 1.6.28 → 1.6.30

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,56 +1,93 @@
1
- import { useThemeProps as _ } from "@mui/material";
2
- import { useState as u } from "react";
3
- const q = (h) => {
4
- const P = _({ props: h, name: "HCPaginatedList" }), {
5
- title: w,
6
- data: d = [],
7
- payload: t,
1
+ import { useThemeProps as Y } from "@mui/material";
2
+ import { useState as w } from "react";
3
+ import Z from "../../hooks/useInfinitePaging.js";
4
+ const ae = (I) => {
5
+ const h = Y({ props: I, name: "HCPaginatedList" }), {
6
+ title: R,
7
+ data: r = [],
8
+ payload: s,
8
9
  totalCount: x,
9
- onChange: s,
10
- onItemClick: a,
11
- selectionMode: g = !1,
12
- selected: r = [],
13
- onSelectionChange: l,
14
- sx: L,
15
- ...b
16
- } = P, [m, f] = u(0), [v, C] = u(10), [N, R] = u([]), i = (t == null ? void 0 : t.pageNumber) !== void 0 ? t.pageNumber : m, c = (t == null ? void 0 : t.rows) !== void 0 ? t.rows : v, I = (e, o) => {
17
- f(o), s && s({ ...t, pageNumber: o, rows: c });
18
- }, T = (e) => {
19
- const o = parseInt(e.target.value, 10);
20
- C(o), f(0), s && s({ ...t, pageNumber: 0, rows: o });
21
- }, E = (e) => {
22
- const n = r.indexOf(e.id) === -1 ? [...r, e.id] : r.filter((p) => p !== e.id);
23
- l == null || l(n, e);
24
- }, S = (e) => () => {
25
- if (g) {
26
- E(e);
10
+ variant: l = "list",
11
+ itemIcon: b,
12
+ metaSeparator: v = "•",
13
+ maxCards: C = 4,
14
+ cardsLayout: g = "rail",
15
+ infinite: D = !1,
16
+ resetKey: M,
17
+ loadingMore: N = !1,
18
+ rowsPerPage: S = 10,
19
+ onViewAll: T,
20
+ onChange: a,
21
+ onItemClick: i,
22
+ selectionMode: p = !1,
23
+ selected: c = [],
24
+ onSelectionChange: f,
25
+ sx: y,
26
+ ...E
27
+ } = h, [G, m] = w(0), [A, H] = w(S), [K, O] = w([]), d = (s == null ? void 0 : s.pageNumber) !== void 0 ? s.pageNumber : G, o = (s == null ? void 0 : s.rows) !== void 0 ? s.rows : A, V = (e, t) => {
28
+ m(t), a && a({ ...s, pageNumber: t, rows: o });
29
+ }, _ = (e) => {
30
+ const t = parseInt(e.target.value, 10);
31
+ H(t), m(0), a && a({ ...s, pageNumber: 0, rows: t });
32
+ }, j = (e) => {
33
+ const n = c.indexOf(e.id) === -1 ? [...c, e.id] : c.filter((u) => u !== e.id);
34
+ f == null || f(n, e);
35
+ }, k = (e) => () => {
36
+ if (p) {
37
+ j(e);
27
38
  return;
28
39
  }
29
- a == null || a(e);
30
- }, D = (e) => (o) => {
31
- g || (o.stopPropagation(), R(
32
- (n) => n.includes(e.id) ? n.filter((p) => p !== e.id) : [...n, e.id]
40
+ i == null || i(e);
41
+ }, q = (e) => (t) => {
42
+ p || (t.stopPropagation(), O(
43
+ (n) => n.includes(e.id) ? n.filter((u) => u !== e.id) : [...n, e.id]
33
44
  ));
34
- }, H = s ? x || 0 : d.length, M = s ? d : d.slice(i * c, (i + 1) * c), O = { ...P };
45
+ }, z = a ? x || 0 : r.length, P = l === "cards" && g === "grid" && D, {
46
+ displayData: B,
47
+ hasMore: F,
48
+ isLoadingMore: J,
49
+ scrollRef: Q,
50
+ sentinelRef: U
51
+ } = Z({
52
+ data: r,
53
+ totalCount: x,
54
+ page: d,
55
+ rowsPerPage: o,
56
+ payload: s,
57
+ onChange: a,
58
+ resetKey: M,
59
+ loadingMore: N,
60
+ enabled: P
61
+ }), W = a ? r : r.slice(d * o, (d + 1) * o), L = P ? B : W, X = { ...h };
35
62
  return {
36
- title: w,
37
- displayData: M,
38
- count: H,
39
- page: i,
40
- rowsPerPage: c,
41
- expanded: N,
42
- selectionMode: g,
43
- selected: r,
44
- handleChangePage: I,
45
- handleChangeRowsPerPage: T,
46
- handleItemClick: S,
47
- handleExpandToggle: D,
48
- onItemClick: a,
49
- ownerState: O,
50
- sx: L,
51
- other: b
63
+ title: R,
64
+ variant: l,
65
+ itemIcon: b,
66
+ metaSeparator: v,
67
+ onViewAll: T,
68
+ cardsLayout: g,
69
+ isInfinite: P,
70
+ hasMore: F,
71
+ isLoadingMore: J,
72
+ refs: { scrollRef: Q, sentinelRef: U },
73
+ // The rail is a preview and caps itself; the grid is the whole page and does not.
74
+ displayData: l === "cards" && g === "rail" ? L.slice(0, C) : L,
75
+ count: z,
76
+ page: d,
77
+ rowsPerPage: o,
78
+ expanded: K,
79
+ selectionMode: p,
80
+ selected: c,
81
+ handleChangePage: V,
82
+ handleChangeRowsPerPage: _,
83
+ handleItemClick: k,
84
+ handleExpandToggle: q,
85
+ onItemClick: i,
86
+ ownerState: X,
87
+ sx: y,
88
+ other: E
52
89
  };
53
90
  };
54
91
  export {
55
- q as usePaginatedListLogic
92
+ ae as usePaginatedListLogic
56
93
  };
@@ -1,18 +1,24 @@
1
- import { styled as t, Paper as n, Box as a, List as o } from "@mui/material";
2
- const s = t(n, {
1
+ import { styled as a, Paper as o, Box as e, List as s, Button as d, Typography as i } from "@mui/material";
2
+ const g = a(o, {
3
3
  name: "HCPaginatedList",
4
4
  slot: "Root"
5
5
  })(() => ({
6
6
  display: "flex",
7
7
  flexDirection: "column",
8
8
  height: "100%"
9
- })), d = t(a, {
9
+ })), c = a(e, {
10
10
  name: "HCPaginatedList",
11
11
  slot: "Header"
12
- })(({ theme: i }) => ({
12
+ })(({ theme: t }) => ({
13
13
  flex: "0 0 auto",
14
- padding: i.spacing(1.25, 2)
15
- })), l = t(a, {
14
+ padding: t.spacing(1.25, 2),
15
+ // The `cards` variant hangs "View all" off the right of the title line; the
16
+ // list variant has a title and nothing else, so the row is harmless there.
17
+ display: "flex",
18
+ alignItems: "center",
19
+ justifyContent: "space-between",
20
+ gap: t.spacing(1)
21
+ })), p = a(e, {
16
22
  name: "HCPaginatedList",
17
23
  slot: "Content"
18
24
  })(() => ({
@@ -22,32 +28,163 @@ const s = t(n, {
22
28
  flex: "1 1 auto",
23
29
  minHeight: 0,
24
30
  overflow: "hidden"
25
- })), g = t(o, {
31
+ })), C = a(s, {
26
32
  name: "HCPaginatedList",
27
33
  slot: "List"
28
34
  })(() => ({
29
35
  flex: 1,
30
36
  overflowY: "auto"
31
- })), r = t("div", {
37
+ })), f = a("div", {
32
38
  name: "HCPaginatedList",
33
39
  slot: "Pagination"
34
- })(({ theme: i }) => ({
35
- borderTop: `1px solid ${i.palette.divider}`,
40
+ })(({ theme: t }) => ({
41
+ borderTop: `1px solid ${t.palette.divider}`,
36
42
  ".MuiToolbar-root": {
37
43
  minHeight: 24,
38
- paddingLeft: i.spacing(1)
44
+ paddingLeft: t.spacing(1)
39
45
  },
40
46
  ".MuiTablePagination-actions .MuiButtonBase-root": {
41
- padding: i.spacing(0.5)
47
+ padding: t.spacing(0.5)
42
48
  },
43
49
  ".MuiTablePagination-displayedRows": {
44
50
  lineHeight: 1
45
51
  }
52
+ })), x = a(d, {
53
+ name: "HCPaginatedList",
54
+ slot: "ViewAll"
55
+ })(() => ({
56
+ textTransform: "none",
57
+ flex: "0 0 auto"
58
+ })), l = 320, L = a(e, {
59
+ name: "HCPaginatedList",
60
+ slot: "CardRail",
61
+ shouldForwardProp: (t) => t !== "grid"
62
+ })(({ theme: t, grid: n }) => ({
63
+ minHeight: 0,
64
+ display: "flex",
65
+ alignItems: "stretch",
66
+ gap: t.spacing(2),
67
+ ...n ? {
68
+ // Wraps and lets the *page* scroll. No `overflow` here on purpose: the rail
69
+ // has no bounded height, so `auto` would produce no scrollbar and leave the
70
+ // sentinel permanently in view, pulling page after page.
71
+ flex: "1 1 auto",
72
+ flexWrap: "wrap",
73
+ alignContent: "flex-start"
74
+ } : {
75
+ flex: "0 0 auto",
76
+ overflow: "hidden"
77
+ }
78
+ })), P = a(e, {
79
+ name: "HCPaginatedList",
80
+ slot: "Card"
81
+ })(({ theme: t }) => ({
82
+ // Equal shares of the row: the rail does not scroll, so cards divide the width
83
+ // rather than spilling out of it. `flex-basis: 0` stops a long title widening its
84
+ // card; the grid overrides the basis so cards wrap instead of shrinking to slivers.
85
+ flex: "1 1 0",
86
+ minWidth: 0,
87
+ // Height follows the content, capped so one long summary cannot make a card
88
+ // twice its neighbours.
89
+ maxHeight: l,
90
+ display: "flex",
91
+ flexDirection: "column",
92
+ gap: t.spacing(1),
93
+ padding: t.spacing(2),
94
+ borderRadius: t.shape.borderRadius,
95
+ backgroundColor: t.palette.background.paper,
96
+ overflow: "hidden"
97
+ })), m = a(e, {
98
+ name: "HCPaginatedList",
99
+ slot: "CardHeader"
100
+ })(({ theme: t }) => ({
101
+ display: "flex",
102
+ alignItems: "flex-start",
103
+ gap: t.spacing(1)
104
+ })), H = a(e, {
105
+ name: "HCPaginatedList",
106
+ slot: "CardIcon"
107
+ })(() => ({
108
+ flex: "0 0 auto",
109
+ display: "flex",
110
+ alignItems: "center",
111
+ justifyContent: "center"
112
+ })), u = a(i, {
113
+ name: "HCPaginatedList",
114
+ slot: "CardTitle"
115
+ })(() => ({
116
+ // Clamped, not truncated: a one-line ellipsis loses too much of a headline.
117
+ display: "-webkit-box",
118
+ WebkitBoxOrient: "vertical",
119
+ WebkitLineClamp: 3,
120
+ overflow: "hidden"
121
+ })), y = a(i, {
122
+ name: "HCPaginatedList",
123
+ slot: "CardDescription"
124
+ })(({ theme: t }) => ({
125
+ // `0 1 auto`, not `1`: a short summary ends under itself instead of pushing the
126
+ // footer to the cap. Growing it also stopped the clamp from biting.
127
+ flex: "0 1 auto",
128
+ minHeight: 0,
129
+ color: t.palette.text.secondary,
130
+ display: "-webkit-box",
131
+ WebkitBoxOrient: "vertical",
132
+ WebkitLineClamp: 5,
133
+ overflow: "hidden",
134
+ // `-webkit-box-orient` is non-standard and some prefixers drop it, leaving the
135
+ // clamp inert; the height cap makes the cut deterministic either way.
136
+ maxHeight: "calc(5 * 1.5em)"
137
+ })), b = a(e, {
138
+ name: "HCPaginatedList",
139
+ slot: "CardFooter"
140
+ })(() => ({
141
+ flex: "0 0 auto",
142
+ // Pushed to the card's foot so the date and the arrow sit on one line across
143
+ // the whole rail, whatever each summary's length.
144
+ marginTop: "auto",
145
+ paddingTop: 8,
146
+ display: "flex",
147
+ alignItems: "center",
148
+ justifyContent: "space-between",
149
+ gap: 8
150
+ })), w = a(i, {
151
+ name: "HCPaginatedList",
152
+ slot: "CardMeta"
153
+ })(({ theme: t }) => ({
154
+ color: t.palette.text.secondary,
155
+ whiteSpace: "nowrap"
156
+ })), h = a(e, {
157
+ name: "HCPaginatedList",
158
+ slot: "CardAction"
159
+ })(({ theme: t }) => ({
160
+ display: "flex",
161
+ alignItems: "center",
162
+ color: t.palette.text.secondary
163
+ })), v = a(e, {
164
+ name: "HCPaginatedList",
165
+ slot: "LoadMore"
166
+ })(({ theme: t }) => ({
167
+ flex: "1 0 100%",
168
+ display: "flex",
169
+ alignItems: "center",
170
+ justifyContent: "center",
171
+ minHeight: t.spacing(5)
46
172
  }));
47
173
  export {
48
- l as PaginatedListContent,
49
- d as PaginatedListHeader,
50
- g as PaginatedListList,
51
- r as PaginatedListPagination,
52
- s as PaginatedListRoot
174
+ P as PaginatedListCard,
175
+ h as PaginatedListCardAction,
176
+ y as PaginatedListCardDescription,
177
+ b as PaginatedListCardFooter,
178
+ m as PaginatedListCardHeader,
179
+ H as PaginatedListCardIcon,
180
+ w as PaginatedListCardMeta,
181
+ L as PaginatedListCardRail,
182
+ u as PaginatedListCardTitle,
183
+ p as PaginatedListContent,
184
+ c as PaginatedListHeader,
185
+ C as PaginatedListList,
186
+ v as PaginatedListLoadMore,
187
+ f as PaginatedListPagination,
188
+ g as PaginatedListRoot,
189
+ x as PaginatedListViewAll
53
190
  };
@@ -0,0 +1,51 @@
1
+ import { useRef as o, useState as $, useMemo as k, useCallback as j, useEffect as E } from "react";
2
+ const q = "120px", F = ({
3
+ data: r,
4
+ totalCount: L,
5
+ page: s,
6
+ rowsPerPage: u,
7
+ payload: v,
8
+ onChange: l,
9
+ resetKey: N,
10
+ loading: O = !1,
11
+ loadingMore: B = !1,
12
+ enabled: t = !0
13
+ }) => {
14
+ const I = o(null), p = o(null), e = !!l, [x, y] = $(u), f = o(/* @__PURE__ */ new Map()), M = o(null), R = `${N ?? ""}`, A = o(R), c = o(null);
15
+ A.current !== R && (A.current = R, f.current.clear(), c.current = null, M.current = null), t && e && r !== M.current && (M.current = r, s === 0 && f.current.clear(), f.current.set(s, r), c.current === s && (c.current = null));
16
+ const D = k(() => !t || !e ? r : Array.from(f.current.keys()).sort((n, i) => n - i).flatMap((n) => f.current.get(n) ?? []), [t, e, r, s]), G = e ? L ?? 0 : r.length, S = k(() => t ? e ? D : r.slice(0, x) : r, [t, e, D, r, x]), m = t && S.length < G, _ = j(() => {
17
+ if (!e) {
18
+ y((i) => i + u);
19
+ return;
20
+ }
21
+ const n = s + 1;
22
+ c.current === null && (c.current = n, l == null || l({
23
+ ...v,
24
+ pageNumber: n,
25
+ rows: u
26
+ }));
27
+ }, [e, u, s, l, v]);
28
+ return E(() => {
29
+ if (!t || !m || O) return;
30
+ const n = p.current;
31
+ if (!n || typeof IntersectionObserver > "u") return;
32
+ const i = new IntersectionObserver(
33
+ (T) => {
34
+ T.some((V) => V.isIntersecting) && _();
35
+ },
36
+ { root: I.current, rootMargin: q }
37
+ );
38
+ return i.observe(n), () => i.disconnect();
39
+ }, [t, m, O, _]), E(() => {
40
+ t && !e && y(u);
41
+ }, [t, e, u, R, r.length]), {
42
+ displayData: S,
43
+ hasMore: m,
44
+ isLoadingMore: B || c.current !== null,
45
+ scrollRef: I,
46
+ sentinelRef: p
47
+ };
48
+ };
49
+ export {
50
+ F as default
51
+ };
package/dist/main.d.ts CHANGED
@@ -286,6 +286,24 @@ export declare interface ChartProps {
286
286
  * timeline. Date-dimension charts only.
287
287
  */
288
288
  skipEmptyDates?: boolean;
289
+ /**
290
+ * Fill the band between the line and the axis, fading from the series' own
291
+ * color down to transparent. Off by default: without it the chart draws a
292
+ * stroke only, which is the look every consumer had before this prop existed.
293
+ *
294
+ * Applies to **single-series** line charts only. A gradient under every line of
295
+ * a multi-series chart buries the lines beneath it, so the fill is skipped there
296
+ * even when this is on — which lets a deployment turn it on theme-wide without
297
+ * having to exempt its multi-series panels one by one.
298
+ *
299
+ * Line-type charts only.
300
+ */
301
+ areaFill?: boolean;
302
+ /**
303
+ * Dash pattern for the line stroke as am5 `[dash, gap]` pixel lengths, e.g.
304
+ * `[6, 4]`. Unset draws a solid line. Line-type charts only.
305
+ */
306
+ strokeDasharray?: number[];
289
307
  sx?: SxProps<Theme>;
290
308
  }
291
309
 
@@ -837,7 +855,31 @@ export declare type DonutChartComponentOverride<Theme = unknown> = {
837
855
  styleOverrides?: ComponentsOverrides_2<Theme>["HCDonutChart"];
838
856
  };
839
857
 
840
- export declare type DonutChartProps = ChartProps;
858
+ export declare interface DonutChartProps extends ChartProps {
859
+ /**
860
+ * Show the row's dimension value (e.g. which record the breakdown belongs to)
861
+ * as a caption under the legend. Only takes effect when more than one value is
862
+ * configured — each value then becomes a slice and the dimension labels
863
+ * nothing on the chart. Defaults to `false`.
864
+ */
865
+ showDimensionLabel?: boolean;
866
+ /**
867
+ * Append the raw value to each slice's label and tooltip, after the
868
+ * percentage — "Up: 62.00% (0.62)". Turn it off for a percentage-only
869
+ * "Up: 62.00%", e.g. when the value and the percentage say the same thing.
870
+ * Defaults to `true`.
871
+ */
872
+ showValueText?: boolean;
873
+ /**
874
+ * Decimal places for the percentage on slice labels and tooltips. Independent
875
+ * of a value's own `format.decimals`, which describes the measure's scale
876
+ * rather than its share of the total. Defaults to `2`.
877
+ *
878
+ * A share too small to survive this rounding is not reported as "0" — it
879
+ * escalates precision until a digit shows (see `formatPercent`).
880
+ */
881
+ percentDecimals?: number;
882
+ }
841
883
 
842
884
  export declare const DrillDownTreemap: (inProps: DrillDownTreemapProps) => JSX_2.Element;
843
885
 
@@ -1534,7 +1576,7 @@ export { Map_2 as Map }
1534
1576
  export declare const MetricCard: (props: MetricCardProps) => JSX_2.Element;
1535
1577
 
1536
1578
  export declare type MetricCardComponentOverride<Theme = unknown> = {
1537
- defaultProps?: MetricCardProps;
1579
+ defaultProps?: Partial<MetricCardProps>;
1538
1580
  styleOverrides?: ComponentsOverrides_2<Theme>["HCMetricCard"];
1539
1581
  };
1540
1582
 
@@ -1583,11 +1625,27 @@ export declare interface MetricCardProps {
1583
1625
  showChart?: boolean;
1584
1626
  chartType?: MetricChartType;
1585
1627
 
1628
+ // Color of the sparkline — line stroke, column fill and the gradient stops all
1629
+ // derive from it. Defaults to `theme.palette.divider`, the muted look the card
1630
+ // shipped with. Set it per deployment through
1631
+ // `components.HCMetricCard.defaultProps` to brand the chart.
1632
+ chartColor?: string;
1633
+
1634
+ // How the area under a line sparkline is filled:
1635
+ // "gradient" — fades from the series colour down to transparent
1636
+ // "solid" — a flat translucent wash
1637
+ // "none" — stroke only
1638
+ // Defaults to "gradient" for the `panel` layout and "solid" for `overlay`, the look
1639
+ // each layout already had.
1640
+ chartFill?: MetricChartFill;
1641
+
1586
1642
  sx?: SxProps<Theme>;
1587
1643
  }
1588
1644
 
1589
1645
  export declare type MetricChangeType = "percentage" | "absolute";
1590
1646
 
1647
+ declare type MetricChartFill = "none" | "solid" | "gradient";
1648
+
1591
1649
  export declare interface MetricChartSnapshot {
1592
1650
  metric: string;
1593
1651
  value: number;
@@ -1754,6 +1812,9 @@ export declare type PackedCirclesProps = ChartProps;
1754
1812
 
1755
1813
  export declare const PaginatedList: (inProps: PaginatedListProps) => JSX_2.Element;
1756
1814
 
1815
+ /** How the `cards` variant arranges itself — see `PaginatedListProps.cardsLayout`. */
1816
+ declare type PaginatedListCardsLayout = "rail" | "grid";
1817
+
1757
1818
  export declare type PaginatedListComponentOverride<Theme = unknown> = {
1758
1819
  defaultProps?: Partial<PaginatedListProps>;
1759
1820
  styleOverrides?: ComponentsOverrides_2<Theme>["HCPaginatedList"];
@@ -1764,11 +1825,63 @@ export declare interface PaginatedListItem {
1764
1825
  title: string;
1765
1826
  description: string;
1766
1827
  icon?: React.ReactNode;
1828
+ /**
1829
+ * Footnote line under the card — a date, a source, an author. Empty segments drop
1830
+ * out so a missing field leaves no dangling separator. Same contract as
1831
+ * `DataListItem.meta`, so a list moved between the two keeps its mapping.
1832
+ * `cards` variant only.
1833
+ */
1834
+ meta?: (string | number | null | undefined)[];
1767
1835
  }
1768
1836
 
1769
1837
  export declare interface PaginatedListProps {
1770
1838
  title?: string;
1771
1839
  data: PaginatedListItem[];
1840
+ variant?: PaginatedListVariant;
1841
+ /**
1842
+ * Mark for cards carrying no `icon` of their own — a widget's mapping has no field
1843
+ * for one, so the deployment names it. A component, not an element, so a theme file
1844
+ * needs no JSX; sized and tinted by the `cardIcon` slot. `cards` variant only.
1845
+ */
1846
+ itemIcon?: React.ElementType;
1847
+ /** Joins `item.meta` segments. Matches `DataListProps.metaSeparator`. */
1848
+ metaSeparator?: string;
1849
+ /**
1850
+ * How many cards the rail draws; the rest is reached through `onViewAll` rather
1851
+ * than a sideways scroll. Ignored under `cardsLayout: "grid"`.
1852
+ */
1853
+ maxCards?: number;
1854
+ /**
1855
+ * How the cards are arranged. `rail` (default) is one capped row with no pager — a
1856
+ * preview. `grid` wraps every card onto as many rows as it takes and brings the
1857
+ * pager back. One setting rather than separate wrap/cap/pager flags: the three
1858
+ * always move together.
1859
+ */
1860
+ cardsLayout?: PaginatedListCardsLayout;
1861
+ /**
1862
+ * Reveal rows as the grid is scrolled instead of drawing a pager. `grid` layout
1863
+ * only — a rail shows one screenful by design and has nothing to scroll into.
1864
+ */
1865
+ infinite?: boolean;
1866
+ /**
1867
+ * Server-side infinite scroll accumulates the pages it receives. Change this
1868
+ * whenever the query behind `data` changes — a new filter, sort or search — and
1869
+ * the accumulated rows are dropped so the grid restarts at the first page.
1870
+ */
1871
+ resetKey?: string | number;
1872
+ /** Set while a page request is in flight, to draw the footer spinner. */
1873
+ loadingMore?: boolean;
1874
+ /**
1875
+ * Rows per page when the payload does not say. A grid needs more than a column to
1876
+ * fill a screen, and an unfilled screen leaves the sentinel in view — which fetches
1877
+ * the next page before the reader moves. Matches `DataListProps.rowsPerPage`.
1878
+ */
1879
+ rowsPerPage?: number;
1880
+ /**
1881
+ * Renders the header's "View all" affordance. Omitted, the affordance is not
1882
+ * drawn at all — the rail simply shows its page. `cards` variant only.
1883
+ */
1884
+ onViewAll?: () => void;
1772
1885
  totalCount?: number;
1773
1886
  payload?: Partial<FV.SearchDTO>;
1774
1887
  onChange?: (params: Partial<FV.SearchDTO>) => void;
@@ -1791,6 +1904,13 @@ export declare interface PaginatedListSnapshot {
1791
1904
  data: PaginatedListItem[];
1792
1905
  }
1793
1906
 
1907
+ /**
1908
+ * How the list presents its items. `list` (default) is the paginated column the
1909
+ * widget shipped with; `cards` is a row of cards that hands the rest to `onViewAll`.
1910
+ * Chosen through `HCPaginatedList.defaultProps`, so call sites stay brand-agnostic.
1911
+ */
1912
+ declare type PaginatedListVariant = "list" | "cards";
1913
+
1794
1914
  export declare const PhoneInput: (props: PhoneInputProps) => JSX_2.Element;
1795
1915
 
1796
1916
  export declare type PhoneInputComponentOverride<Theme = unknown> = {
@@ -1813,7 +1933,31 @@ export declare type PieChartComponentOverride<Theme = unknown> = {
1813
1933
  styleOverrides?: ComponentsOverrides_2<Theme>["HCPieChart"];
1814
1934
  };
1815
1935
 
1816
- export declare type PieChartProps = ChartProps;
1936
+ export declare interface PieChartProps extends ChartProps {
1937
+ /**
1938
+ * Show the row's dimension value (e.g. which record the breakdown belongs to)
1939
+ * as a caption under the legend. Only takes effect when more than one value is
1940
+ * configured — each value then becomes a slice and the dimension labels
1941
+ * nothing on the chart. Defaults to `false`.
1942
+ */
1943
+ showDimensionLabel?: boolean;
1944
+ /**
1945
+ * Append the raw value to each slice's label and tooltip, after the
1946
+ * percentage — "Up: 62.00% (0.62)". Turn it off for a percentage-only
1947
+ * "Up: 62.00%", e.g. when the value and the percentage say the same thing.
1948
+ * Defaults to `true`.
1949
+ */
1950
+ showValueText?: boolean;
1951
+ /**
1952
+ * Decimal places for the percentage on slice labels and tooltips. Independent
1953
+ * of a value's own `format.decimals`, which describes the measure's scale
1954
+ * rather than its share of the total. Defaults to `2`.
1955
+ *
1956
+ * A share too small to survive this rounding is not reported as "0" — it
1957
+ * escalates precision until a digit shows (see `formatPercent`).
1958
+ */
1959
+ percentDecimals?: number;
1960
+ }
1817
1961
 
1818
1962
  export declare const Placeholder: (props: PlaceholderProps) => JSX_2.Element;
1819
1963
 
@@ -3305,7 +3449,7 @@ declare module "@mui/material/styles" {
3305
3449
  }
3306
3450
 
3307
3451
  interface ComponentsPropsList {
3308
- HCMetricCard: MetricCardProps;
3452
+ HCMetricCard: Partial<MetricCardProps>;
3309
3453
  }
3310
3454
 
3311
3455
  interface Components<Theme = unknown> {
@@ -3885,7 +4029,23 @@ declare module "@mui/material/styles" {
3885
4029
 
3886
4030
  declare module "@mui/material/styles" {
3887
4031
  interface ComponentNameToClassKey {
3888
- HCPaginatedList: "root" | "header" | "content" | "list" | "pagination";
4032
+ HCPaginatedList:
4033
+ | "root"
4034
+ | "header"
4035
+ | "content"
4036
+ | "list"
4037
+ | "pagination"
4038
+ | "viewAll"
4039
+ | "cardRail"
4040
+ | "card"
4041
+ | "cardHeader"
4042
+ | "cardIcon"
4043
+ | "cardTitle"
4044
+ | "cardDescription"
4045
+ | "cardFooter"
4046
+ | "cardMeta"
4047
+ | "cardAction"
4048
+ | "loadMore";
3889
4049
  }
3890
4050
 
3891
4051
  interface ComponentsPropsList {
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.28",
4
+ "version": "1.6.30",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",