@mt-gloss/ui 0.1.22 → 0.1.24

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.
@@ -20,6 +20,15 @@ export interface EdgeHoverHandleProps {
20
20
  edge?: 'right';
21
21
  /** D-16 — keyboard step handler (ArrowLeft → 'shrink', ArrowRight → 'grow'). */
22
22
  onKeyboardStep?: (direction: ResizeDirection) => void;
23
+ /**
24
+ * Quick 260422-gfr — fires when the browser implicitly releases pointer
25
+ * capture from the <button> (window blur / Alt-Tab / modal focus steal /
26
+ * touchcancel). Consumers wire this to the hook's `cancel()` so the gesture
27
+ * deterministically exits `'dragging'` on capture loss. Companion to the
28
+ * window-level blur / visibilitychange / pointercancel listeners installed
29
+ * inside useEdgeHoverResize. See .planning/debug/resize-state-leak-cross-card.md.
30
+ */
31
+ onLostPointerCapture?: (e: React.PointerEvent) => void;
23
32
  ariaLabel?: string;
24
33
  }
25
34
  /**
@@ -30,6 +30,8 @@ export { formatValue } from './utils/formatValue';
30
30
  export { formatTrend } from './utils/formatTrend';
31
31
  export { computeGutterAnchorX } from './utils/computeGutterAnchorX';
32
32
  export type { GutterAnchorInput } from './utils/computeGutterAnchorX';
33
+ export { evaluateTintCondition } from './tintCondition';
34
+ export type { TintCondition, HighlightColorName } from './tintCondition';
33
35
  export { allVariantFixtures } from './fixtures/allVariants';
34
36
  export { loadingFixture, errorFixture, emptyFixture, staleFixture, staleSparklineFixture, staleDonutFixture, allStateFixtures, } from './fixtures/states';
35
37
  export { sparklineFixture, sparklineUpFixture } from './fixtures/sparklineCard';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Rule-tint evaluator — Phase v3.0-01 Foundation (FOUND-CAT-07).
3
+ * Pure function, client-side only, called every render.
4
+ * Signature LOCKED — downstream phases (P3+) consume this API.
5
+ */
6
+ export type HighlightColorName = 'positive' | 'negative' | 'warning' | 'neutral';
7
+ export interface TintCondition {
8
+ operator: 'lt' | 'gt' | 'eq' | 'gte' | 'lte';
9
+ threshold: number;
10
+ result: HighlightColorName;
11
+ fallback?: HighlightColorName;
12
+ }
13
+ export declare function evaluateTintCondition(value: number | null | undefined, condition: TintCondition | undefined): HighlightColorName | undefined;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, CSSProperties, RefObject } from 'react';
2
+ import { TintCondition } from './tintCondition';
2
3
  /** Value formatting options. */
3
4
  export interface ValueFormat {
4
5
  prefix?: string;
@@ -71,7 +72,19 @@ export interface DonutVariant extends BaseMetricCardProps {
71
72
  }
72
73
  export interface HighlightVariant extends BaseMetricCardProps {
73
74
  variant: 'highlight';
75
+ /**
76
+ * Highlight tint. One of: 'positive' | 'negative' | 'warning' | 'neutral'
77
+ * (maps to HIGHLIGHT_COLORS in MetricCard.tsx + --highlight-* tokens).
78
+ * `'warning'` = the highlight-warn variant, completing the +/warn/− triad.
79
+ * Arbitrary hex is also accepted (legacy), but prefer the named values.
80
+ */
74
81
  highlightColor: string;
82
+ /**
83
+ * Optional rule-based tint. When set, overrides static `highlightColor`
84
+ * at render time via `evaluateTintCondition(value, tintCondition)`.
85
+ * Wired into MetricCard.tsx in Plan 01-04.
86
+ */
87
+ tintCondition?: TintCondition;
75
88
  }
76
89
  export interface ArrowVariant extends BaseMetricCardProps {
77
90
  variant: 'arrow';
@@ -25,6 +25,17 @@ export declare class VelocityBuffer {
25
25
  private readonly capacity;
26
26
  push(sample: VelocitySample): void;
27
27
  clear(): void;
28
+ /**
29
+ * Quick 260422-gfr — last-known-position accessor for the window-level
30
+ * terminateDrag fallback in useEdgeHoverResize. When pointer capture is
31
+ * silently lost (Alt-Tab / blur / visibilitychange hidden), the React
32
+ * onPointerUp does not fire, so the window-level fallback needs the last
33
+ * pointer x-coordinate to compute `dx` for commitSpring. The most recent
34
+ * sample is the authoritative answer (pointermove pushes on every event).
35
+ *
36
+ * Returns `null` when the buffer is empty (no drag ever started).
37
+ */
38
+ tail(): VelocitySample | null;
28
39
  /**
29
40
  * D-09 — weighted-average velocity (px/sec).
30
41
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"