@mt-gloss/ui 0.0.20 → 0.0.21
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.
- package/{Expandable-hoPnf93I.js → Expandable-yVIypRqF.js} +4827 -4747
- package/catalog.js +2 -2
- package/index.js +614 -608
- package/lib/composites/controls/ThresholdRamp/ThresholdRamp.d.ts +10 -1
- package/lib/primitives/dashboard/MetricCard/GutterActions.d.ts +24 -1
- package/lib/primitives/dashboard/MetricCard/StackedGroupCard.d.ts +20 -1
- package/lib/primitives/dashboard/MetricCard/overflowMenuRegistry.d.ts +25 -0
- package/package.json +1 -1
|
@@ -11,6 +11,15 @@ export interface ThresholdRampProps {
|
|
|
11
11
|
onChange: (stops: ThresholdStop[]) => void;
|
|
12
12
|
min?: number;
|
|
13
13
|
max?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Snap granularity for both drag and keyboard interactions. Values are
|
|
16
|
+
* rounded to `Math.round(raw / step) * step`. Default `0.01` matches the
|
|
17
|
+
* historical 2-decimal behavior. Pass `1` for integer snap, `0.0001` for
|
|
18
|
+
* 4-decimal snap, etc. Matches the `step` prop on `<Slider>` / `<RangeSlider>`.
|
|
19
|
+
* Must be a positive finite number; invalid values fall back to 0.01 with
|
|
20
|
+
* a dev-mode warning.
|
|
21
|
+
*/
|
|
22
|
+
step?: number;
|
|
14
23
|
disabled?: boolean;
|
|
15
24
|
}
|
|
16
25
|
/**
|
|
@@ -18,7 +27,7 @@ export interface ThresholdRampProps {
|
|
|
18
27
|
* Renders a token-driven gradient strip with draggable stop handles.
|
|
19
28
|
* Generic — no reptime domain strings. D-01, D-10, D-11 compliant.
|
|
20
29
|
*/
|
|
21
|
-
export declare function ThresholdRamp({ stops, onChange, min, max, disabled, }: ThresholdRampProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function ThresholdRamp({ stops, onChange, min, max, step, disabled, }: ThresholdRampProps): import("react/jsx-runtime").JSX.Element;
|
|
22
31
|
export declare namespace ThresholdRamp {
|
|
23
32
|
var displayName: string;
|
|
24
33
|
}
|
|
@@ -38,6 +38,29 @@ export interface GutterActionsProps {
|
|
|
38
38
|
onConfigSave?: () => void;
|
|
39
39
|
/** Called when Cancel pill is clicked in config variant. */
|
|
40
40
|
onConfigCancel?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Cluster C (quick-260417-ago) — Singleton overflow-menu identifier.
|
|
43
|
+
*
|
|
44
|
+
* When provided, this GutterActions instance cooperates with
|
|
45
|
+
* `overflowMenuRegistry` so only one overflow menu across the whole
|
|
46
|
+
* dashboard may be open at a time. Opening menu N sets the registry's
|
|
47
|
+
* activeId to N; any OTHER instance sees active !== its own id and closes
|
|
48
|
+
* its menu automatically via onMenuToggle(false).
|
|
49
|
+
*
|
|
50
|
+
* If omitted, a useId() fallback is used so each instance still gets a
|
|
51
|
+
* unique registry key — the singleton behavior still works across cards.
|
|
52
|
+
*/
|
|
53
|
+
menuId?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Cluster D (quick-260417-ago) — Horizontal anchor offset in px from the
|
|
56
|
+
* card's left edge. When provided, overrides the pill's default
|
|
57
|
+
* `left: 50%` centered position; drives the per-slot gutter-slide
|
|
58
|
+
* choreography (180ms ease-out) for stack cards whose hovered slot moves
|
|
59
|
+
* horizontally.
|
|
60
|
+
*
|
|
61
|
+
* Undefined (default) preserves the pre-existing centered layout.
|
|
62
|
+
*/
|
|
63
|
+
anchorX?: number;
|
|
41
64
|
}
|
|
42
65
|
/**
|
|
43
66
|
* GutterActions - Pill + overflow menu interaction system.
|
|
@@ -61,6 +84,6 @@ export interface GutterActionsProps {
|
|
|
61
84
|
* ```
|
|
62
85
|
*/
|
|
63
86
|
export declare const GutterActions: {
|
|
64
|
-
({ visible, menuOpen, onMenuToggle, onGraph, onDetails, onCustomize, onRemove, onWhatsThis, onExpand, onShrink, onMove, onReplace, onNavigate, onRetry, onRefresh, onQuickSettings, onFlipBack, isFlipped, onViewAsStack, onUnstack, canExpand, isGraphCard, colSpan, isGraphActive, isTableActive, graphLabel, detailsLabel, variant, onConfigSave, onConfigCancel, }: GutterActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
({ visible, menuOpen, onMenuToggle, onGraph, onDetails, onCustomize, onRemove, onWhatsThis, onExpand, onShrink, onMove, onReplace, onNavigate, onRetry, onRefresh, onQuickSettings, onFlipBack, isFlipped, onViewAsStack, onUnstack, canExpand, isGraphCard, colSpan, isGraphActive, isTableActive, graphLabel, detailsLabel, variant, onConfigSave, onConfigCancel, menuId, anchorX, }: GutterActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
65
88
|
displayName: string;
|
|
66
89
|
};
|
|
@@ -25,6 +25,25 @@ export interface StackedGroupCardProps {
|
|
|
25
25
|
* Default: undefined (fall back to measured capacity; backward compatible).
|
|
26
26
|
*/
|
|
27
27
|
colSpan?: 1 | 2 | 3;
|
|
28
|
+
/**
|
|
29
|
+
* Cluster D (quick-260417-ago, item 3) — fired when the pointer enters
|
|
30
|
+
* slot `idx` with its `timeframe`. Consumer uses this to drive the
|
|
31
|
+
* gutter-actions horizontal anchor (anchorX) and inject metric-scoped
|
|
32
|
+
* action handlers (e.g. Transmitted → open transmitted-orders tab).
|
|
33
|
+
* Optional; no-op if omitted (back-compat).
|
|
34
|
+
*/
|
|
35
|
+
onSlotHoverStart?: (idx: number, timeframe: string) => void;
|
|
36
|
+
/** Cluster D — fired when the pointer leaves the currently hovered slot. */
|
|
37
|
+
onSlotHoverEnd?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Cluster D (item 15) — sparkline edge behavior.
|
|
40
|
+
* 'padded' (default, back-compat): current behavior; SparklineBg sits
|
|
41
|
+
* within the CardShell's inner padding.
|
|
42
|
+
* 'bleed': SparklineBg is wrapped in a negative-margin container so it
|
|
43
|
+
* extends to the card's LEFT, TOP, and BOTTOM edges. Right edge keeps
|
|
44
|
+
* padding so trend text on the right does not collide with the stroke.
|
|
45
|
+
*/
|
|
46
|
+
sparklineInset?: 'padded' | 'bleed';
|
|
28
47
|
}
|
|
29
48
|
/**
|
|
30
49
|
* StackedGroupCard -- Renders 3 mini metric values horizontally within a 2-col card.
|
|
@@ -47,6 +66,6 @@ export interface StackedGroupCardProps {
|
|
|
47
66
|
* ```
|
|
48
67
|
*/
|
|
49
68
|
export declare const StackedGroupCard: {
|
|
50
|
-
({ title, prefix, suffix, values, timeframes, sparklineData, accentColor, pinnedTimeframe, onPinTimeframe, isStale, colSpan, }: StackedGroupCardProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
({ title, prefix, suffix, values, timeframes, sparklineData, accentColor, pinnedTimeframe, onPinTimeframe, isStale, colSpan, onSlotHoverStart, onSlotHoverEnd, sparklineInset, }: StackedGroupCardProps): import("react/jsx-runtime").JSX.Element;
|
|
51
70
|
displayName: string;
|
|
52
71
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* overflowMenuRegistry — Module-scoped singleton tracker for MetricCard overflow menus.
|
|
3
|
+
*
|
|
4
|
+
* quick-260417-ago Cluster C (item 14): only one overflow menu may be open at a time.
|
|
5
|
+
* When menu B opens, menu A receives a notification via its useSyncExternalStore
|
|
6
|
+
* subscription and closes itself.
|
|
7
|
+
*
|
|
8
|
+
* Uses a plain module-level `activeId` + Set<listener> — no new dep (Zustand is
|
|
9
|
+
* over-engineering for one state field; Context would require hoisting the
|
|
10
|
+
* provider higher than the card tree, which complicates flag-off paths).
|
|
11
|
+
*
|
|
12
|
+
* React 19's useSyncExternalStore consumes `subscribe` / `getSnapshot` and keeps
|
|
13
|
+
* components in sync without triggering tearing under concurrent rendering.
|
|
14
|
+
*
|
|
15
|
+
* Exports:
|
|
16
|
+
* - subscribe(fn): listen to activeId changes; returns unsubscribe
|
|
17
|
+
* - getActive(): current activeId (or null)
|
|
18
|
+
* - setActive(id | null): declare which menu is open; notifies all subscribers
|
|
19
|
+
* - resetForTests(): clears state between vitest runs
|
|
20
|
+
*/
|
|
21
|
+
export declare function subscribe(listener: () => void): () => void;
|
|
22
|
+
export declare function getActive(): string | null;
|
|
23
|
+
export declare function setActive(next: string | null): void;
|
|
24
|
+
/** Test-only: resets internal state. Not exported from the public barrel. */
|
|
25
|
+
export declare function resetForTests(): void;
|