@mt-gloss/ui 0.1.109 → 0.1.111

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,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { PanelShellProps } from '../PanelHost';
3
- import { CatalogLensMeta, CatalogLensTiles } from './internals/catalog-mocks';
3
+ import { CatalogTile, CatalogLensMeta, CatalogLensTiles } from './internals/catalog-mocks';
4
4
  export interface CatalogAddShellProps extends PanelShellProps {
5
5
  /** Available lenses; defaults to MOCK_LENSES (spike §6.2.5). */
6
6
  lenses?: readonly string[];
@@ -17,5 +17,7 @@ export interface CatalogAddShellProps extends PanelShellProps {
17
17
  * Standalone tests (no PanelSlot) leave undefined → no footer.
18
18
  */
19
19
  footerSlot?: ReactNode;
20
+ /** PHASE 17.1 D-08 — forwarded to inner CatalogTileGrid (both primary + secondary instances). */
21
+ renderTile?: (tile: CatalogTile) => ReactNode;
20
22
  }
21
- export declare function CatalogAddShell({ isOpen, lenses, defaultLens, tilesByLens, lensMeta, footerSlot, }: CatalogAddShellProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function CatalogAddShell({ isOpen, lenses, defaultLens, tilesByLens, lensMeta, footerSlot, renderTile, }: CatalogAddShellProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { PanelShellProps } from '../PanelHost';
3
- import { CatalogLensTiles } from './internals/catalog-mocks';
3
+ import { CatalogLensTiles, CatalogTile } from './internals/catalog-mocks';
4
4
  export interface CatalogReplaceShellProps extends PanelShellProps {
5
5
  /** Label of the card being replaced; rendered as 'replacing {label}' subtitle. */
6
6
  replacingLabel?: string;
@@ -9,5 +9,7 @@ export interface CatalogReplaceShellProps extends PanelShellProps {
9
9
  tilesByLens?: Readonly<Record<string, CatalogLensTiles>>;
10
10
  /** See CatalogAddShellProps.footerSlot — sibling slot inside Provider. */
11
11
  footerSlot?: ReactNode;
12
+ /** PHASE 17.1 D-08 — forwarded to inner CatalogTileGrid. */
13
+ renderTile?: (tile: CatalogTile) => ReactNode;
12
14
  }
13
- export declare function CatalogReplaceShell({ isOpen, replacingLabel, lenses, defaultLens, tilesByLens, footerSlot, }: CatalogReplaceShellProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function CatalogReplaceShell({ isOpen, replacingLabel, lenses, defaultLens, tilesByLens, footerSlot, renderTile, }: CatalogReplaceShellProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,22 @@
1
+ import { ReactNode } from 'react';
1
2
  import { CatalogTile } from './catalog-mocks';
2
3
  export interface CatalogTileGridProps {
3
4
  tiles: readonly CatalogTile[];
4
5
  selectedTileId: string | null;
5
6
  onSelectTile: (id: string, desc: string) => void;
7
+ /**
8
+ * PHASE 17.1 D-06 — host-supplied tile body renderer. When provided,
9
+ * its output replaces the inline 2-variant <MetricCard> dev fallback
10
+ * inside `.cat-tile-primitive-wrapper`. When OMITTED, the existing
11
+ * Phase 17 dev fallback continues to render (D-07 back-compat contract)
12
+ * so gloss-isolated W2 + Phase 17 RED-gate vitest suites stay GREEN.
13
+ *
14
+ * The renderer-provided wrapper carries `data-col-span={getCatalogColSpan(tile)}`
15
+ * per 17.1-D04-COLSPAN-DECISION.md Option B (button stays "1"; inner
16
+ * wrapper carries dynamic value). Plan 17.1-05 authors the HOF that
17
+ * supplies this renderer in reptime.
18
+ */
19
+ renderTile?: (tile: CatalogTile) => ReactNode;
6
20
  }
7
21
  /**
8
22
  * §6.2.8 — stack-tile value renderer. Splits a "LABEL N · LABEL N · LABEL N"
@@ -17,4 +31,4 @@ export interface CatalogTileGridProps {
17
31
  * GAP-06 — new tiles prefer `subStats` (structured) over `·`-split strings.
18
32
  */
19
33
  export declare function renderStackValue(val: string): import("react/jsx-runtime").JSX.Element[];
20
- export declare function CatalogTileGrid({ tiles, selectedTileId, onSelectTile }: CatalogTileGridProps): import("react/jsx-runtime").JSX.Element;
34
+ export declare function CatalogTileGrid({ tiles, selectedTileId, onSelectTile, renderTile }: CatalogTileGridProps): import("react/jsx-runtime").JSX.Element;
@@ -51,6 +51,84 @@ export interface CatalogTile {
51
51
  donut?: boolean;
52
52
  /** Accent HEX for donut/sparkline tiles. */
53
53
  accent?: string;
54
+ /** Drives the MetricCard router. Standard/sparkline/bars/donut/highlight/arrow/object-arrow/versus/segmented/compact/comparison/progress/channel/action/list/name/ratio/leaderboard/exception-list/pace/stacked-group/order-status-stack. */
55
+ cardType?: string;
56
+ /** standard/highlight — prefix string for the formatted value (e.g., "$"). */
57
+ prefix?: string;
58
+ /** standard/highlight — suffix string for the formatted value (e.g., "%"). */
59
+ suffix?: string;
60
+ /** standard/sparkline/bars — directional trend with magnitude. */
61
+ trend?: {
62
+ value: number;
63
+ direction: 'up' | 'down' | 'flat';
64
+ };
65
+ /** standard/sparkline — small label beneath the value (e.g., "vs last week"). */
66
+ subtext?: string;
67
+ /** sparkline — 10-30 datapoints rendered as the trend mini-chart. */
68
+ sparklineData?: number[];
69
+ /** donut — fractional value (0..1) independent of legacy `donut: boolean`. */
70
+ donutValue?: number;
71
+ /** donut — denominator/max for non-fractional donut representations. */
72
+ donutMax?: number;
73
+ /** bars — datapoints rendered as vertical bar chart. */
74
+ barData?: number[];
75
+ /** versus — TY vs LY comparison with labels. */
76
+ versusData?: {
77
+ current: number;
78
+ prior: number;
79
+ currentLabel?: string;
80
+ priorLabel?: string;
81
+ };
82
+ /** comparison — side-by-side string/number values with labels. */
83
+ comparison?: {
84
+ current: {
85
+ value: number | string;
86
+ label?: string;
87
+ };
88
+ prior: {
89
+ value: number | string;
90
+ label?: string;
91
+ };
92
+ };
93
+ /** segmented — segmented bar with labeled colored slices. */
94
+ segments?: Array<{
95
+ label: string;
96
+ value: number;
97
+ color: string;
98
+ }>;
99
+ /** segmented — alternate inventory for the catalog view (vs runtime `segments`). */
100
+ catalogSegments?: Array<{
101
+ label: string;
102
+ value: number;
103
+ color: string;
104
+ }>;
105
+ /** color override — secondary to legacy `accent`; reads via `tile.accent ?? tile.accentColor ?? tile.highlightColor`. */
106
+ accentColor?: string;
107
+ /** highlight — warn/info-tinted background HEX. */
108
+ highlightColor?: string;
109
+ /** ratio — top half of the ratio (e.g., 47 of 60). */
110
+ numerator?: number;
111
+ /** ratio — bottom half of the ratio. */
112
+ denominator?: number;
113
+ /** standard — detail line beneath value. */
114
+ detail?: string;
115
+ /** catalog-only — alternate detail string for the catalog preview. */
116
+ catalogDetail?: string;
117
+ /** catalog-only — alternate display value for the catalog preview. */
118
+ catalogValue?: string | number;
119
+ /** order-status-stack — numeric status snapshot values per column. */
120
+ catalogStatusValues?: number[];
121
+ /** order-status-stack — column key + label definitions. */
122
+ statusColumns?: Array<{
123
+ key: string;
124
+ label: string;
125
+ }>;
126
+ /** stacked-group — timeframe segment ids (e.g., ['MTD','QTD','YTD']). */
127
+ stackedTimeframes?: string[];
128
+ /** sizing — default colSpan when first dropped into the grid. */
129
+ defaultColSpan?: number;
130
+ /** sizing — catalog tile colSpan (1, 2, or 3). */
131
+ _catalogTileColSpan?: 1 | 2 | 3;
54
132
  }
55
133
  export interface CatalogLensMeta {
56
134
  /** H2 question shown beneath the pill row when this lens is active. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.109",
3
+ "version": "0.1.111",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"