@mt-gloss/ui 0.0.43 → 0.0.45
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/index.js +1253 -1233
- package/lib/primitives/dashboard/MetricCard/GhostPreview.d.ts +21 -7
- package/lib/primitives/dashboard/MetricCard/__tests__/fixtures/nyquist-09-parity-matrix.d.ts +76 -0
- package/lib/primitives/dashboard/MetricCard/useEdgeHoverResize.d.ts +24 -3
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -4,8 +4,15 @@ export interface GhostPreviewProps {
|
|
|
4
4
|
visible: boolean;
|
|
5
5
|
/** The target column span being previewed. */
|
|
6
6
|
targetColSpan: 1 | 2 | 3;
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* D-07 rework 260419-v2 — MotionValue driving the ghost's WIDTH (px).
|
|
9
|
+
* The ghost is left-anchored at the slot origin; the ghost RIGHT edge
|
|
10
|
+
* follows the cursor via direct width animation (no translateX). Zero
|
|
11
|
+
* React re-renders per pointermove. Framer-motion animates width via rAF
|
|
12
|
+
* + direct style writes, so there is no CSS-engine transition on width
|
|
13
|
+
* (AP-19 companion — `transition-property` in edge-hover.scss is opacity-only).
|
|
14
|
+
*/
|
|
15
|
+
ghostWidth: MotionValue<number>;
|
|
9
16
|
/** AN-06 enter duration in ms. Default: 180ms */
|
|
10
17
|
enterMs?: number;
|
|
11
18
|
/** AN-06 exit duration in ms. Default: 120ms */
|
|
@@ -14,14 +21,21 @@ export interface GhostPreviewProps {
|
|
|
14
21
|
/**
|
|
15
22
|
* GhostPreview — Dashed outline overlay rendered during an active resize drag.
|
|
16
23
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
24
|
+
* Rework 260419-v2: ghost is LEFT-ANCHORED WIDTH (no translateX). The left
|
|
25
|
+
* edge stays pinned at the slot origin; the right edge follows the cursor
|
|
26
|
+
* via framer-motion MotionValue → `style={{ width }}`. Supersedes the prior
|
|
27
|
+
* translateX (D-07) rendering, which caused the ghost to slide horizontally
|
|
28
|
+
* across the page when compounded with the pre-Phase-19 wrapper (see debug
|
|
29
|
+
* session 260419-ghost-slides-across-page).
|
|
30
|
+
*
|
|
31
|
+
* D-24's "translateX over scaleX" rationale (corner distortion under scaleX)
|
|
32
|
+
* does NOT apply to direct `width` animation — the border/corners draw at
|
|
33
|
+
* every frame at the current width with no geometric scaling.
|
|
20
34
|
*
|
|
21
35
|
* Hidden via aria-hidden — purely decorative visual feedback.
|
|
22
|
-
* Motion contract (AN-06): enter 180ms, exit 120ms.
|
|
36
|
+
* Motion contract (AN-06): enter 180ms, exit 120ms (opacity only).
|
|
23
37
|
*/
|
|
24
|
-
export declare function GhostPreview({ visible, targetColSpan,
|
|
38
|
+
export declare function GhostPreview({ visible, targetColSpan, ghostWidth, enterMs, exitMs, }: GhostPreviewProps): import("react/jsx-runtime").JSX.Element;
|
|
25
39
|
export declare namespace GhostPreview {
|
|
26
40
|
var displayName: string;
|
|
27
41
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NYQUIST-09 Parity Matrix — Phase 19 plan 19-05.
|
|
3
|
+
*
|
|
4
|
+
* Typed array of 144 rows enumerating the 7-axis resize parity space:
|
|
5
|
+
*
|
|
6
|
+
* spring — 3 presets: default (S500D35M1), gentle (S300D30M1), stiff (S700D40M1)
|
|
7
|
+
* viewport — round-robin across [1280, 1920, 2560] (all 3 appear in asserted set)
|
|
8
|
+
* reducedMotion — {false, true}
|
|
9
|
+
* pointerType — {'mouse', 'touch'}
|
|
10
|
+
* cardMode — {'slot-fill', 'sparkline-fidelity'}
|
|
11
|
+
* cancelPath — {'commit', 'escape', 'out-of-range'}
|
|
12
|
+
* dndKitActive — {false, true}
|
|
13
|
+
*
|
|
14
|
+
* Arithmetic (per 19-RESEARCH §NYQUIST-09 Fixture Matrix):
|
|
15
|
+
* 3 × 2 × 2 × 2 × 3 × 2 = 144 logical rows.
|
|
16
|
+
* Viewport axis is DERIVED per-row (round-robin) so every asserted row still
|
|
17
|
+
* represents one of the 3 canonical viewports without multiplying the base
|
|
18
|
+
* by a 4th full axis — this matches the RESEARCH-stated 144 count exactly.
|
|
19
|
+
*
|
|
20
|
+
* SkipFor taxonomy (~84 rows tagged; first-match wins):
|
|
21
|
+
*
|
|
22
|
+
* Rule 1 — reducedMotion && spring === 'stiff':
|
|
23
|
+
* Reduced motion bypasses spring; stiffer preset collapses to same
|
|
24
|
+
* instant-jump code path as default. (default spring + gentle preset
|
|
25
|
+
* still carry the rm=true assertion to exercise the branch.)
|
|
26
|
+
*
|
|
27
|
+
* Rule 2 — pointerType === 'touch' && cancelPath === 'escape':
|
|
28
|
+
* Touch devices lack Escape key; covered by separate touch-pointercancel
|
|
29
|
+
* fixture (useEdgeHoverResize.touch.test.tsx).
|
|
30
|
+
*
|
|
31
|
+
* Rule 3 — cardMode === 'sparkline-fidelity' && dndKitActive:
|
|
32
|
+
* Non-stackable cards are not sortable; dnd-kit active state is
|
|
33
|
+
* impossible (invariant from PagesContext.tsx stack rules).
|
|
34
|
+
*
|
|
35
|
+
* Rule 4 — cancelPath === 'out-of-range' && !dndKitActive && spring !== default:
|
|
36
|
+
* Out-of-range clamp is independent of spring variant; default-spring row
|
|
37
|
+
* carries the clamp assertion. Non-default springs on the clamp path are
|
|
38
|
+
* redundant (physics variant does not affect Math.min(3, …) behavior).
|
|
39
|
+
*
|
|
40
|
+
* Asserted target: 60 ± 5 rows (plan acceptance criterion).
|
|
41
|
+
* Actual asserted: 63 / 144 (skipped 81). Viewport distribution across
|
|
42
|
+
* asserted rows: 1280 → 25, 1920 → 18, 2560 → 20 (all 3 represented).
|
|
43
|
+
*
|
|
44
|
+
* @see .planning/phases/19-resize-interaction-rework/19-RESEARCH.md §NYQUIST-09 Fixture Matrix
|
|
45
|
+
* @see .planning/phases/19-resize-interaction-rework/19-PATTERNS.md §S10 NYQUIST matrix authoring
|
|
46
|
+
* @see .planning/phases/19-resize-interaction-rework/19-05-PLAN.md Task 1
|
|
47
|
+
*/
|
|
48
|
+
export interface Nyquist09Row {
|
|
49
|
+
/**
|
|
50
|
+
* Stable row id, e.g. 'S500D35M1-vw1280-rm_off-mouse-stack-commit-dndk_on'.
|
|
51
|
+
* Shape: `S{stiffness}D{damping}M{mass}-vw{viewport}-rm_{on|off}-{pointer}-{stack|spark}-{cancelPath}-dndk_{on|off}`.
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
spring: {
|
|
55
|
+
stiffness: number;
|
|
56
|
+
damping: number;
|
|
57
|
+
mass: number;
|
|
58
|
+
};
|
|
59
|
+
viewport: 1280 | 1920 | 2560;
|
|
60
|
+
reducedMotion: boolean;
|
|
61
|
+
pointerType: 'mouse' | 'touch';
|
|
62
|
+
cardMode: 'slot-fill' | 'sparkline-fidelity';
|
|
63
|
+
cancelPath: 'commit' | 'escape' | 'out-of-range';
|
|
64
|
+
dndKitActive: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* If set, row is test.skip with this reason string. Acceptance criterion:
|
|
67
|
+
* skipped ≤ 84, asserted ≥ 55 (see PLAN threat-model T-19-16).
|
|
68
|
+
*/
|
|
69
|
+
skipFor?: string;
|
|
70
|
+
}
|
|
71
|
+
/** Canonical 144-row NYQUIST-09 parity matrix — enumerated explicitly for diff-ability. */
|
|
72
|
+
export declare const NYQUIST_09_MATRIX: readonly Nyquist09Row[];
|
|
73
|
+
/** Convenience: number of rows that actually run (skipFor === undefined). Exported for CI sanity check. */
|
|
74
|
+
export declare const NYQUIST_09_ASSERTED_COUNT: number;
|
|
75
|
+
/** Convenience: number of rows tagged skipFor. Exported for CI sanity check. */
|
|
76
|
+
export declare const NYQUIST_09_SKIPPED_COUNT: number;
|
|
@@ -15,6 +15,13 @@ export interface UseEdgeHoverResizeArgs {
|
|
|
15
15
|
onCancel?: () => void;
|
|
16
16
|
/** D-14 — colWidth snapshot passed per-render; captured at pointerdown. Default: 180px (1280px viewport). */
|
|
17
17
|
step?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Grid gap (px) between adjacent columns. Used to compute the ghost's
|
|
20
|
+
* left-anchored width as `colSpan * step + (colSpan - 1) * gap`. Default: 0
|
|
21
|
+
* (single-column grids). Rework 260419-v2 — ghost is width-driven, not
|
|
22
|
+
* translateX-driven; this is the companion scalar.
|
|
23
|
+
*/
|
|
24
|
+
gap?: number;
|
|
18
25
|
/** D-03 panel override; falls back to DEFAULT_RESIZE_PHYSICS. */
|
|
19
26
|
tuning?: Partial<ResizePhysicsConfig>;
|
|
20
27
|
/** Hover dwell time before handle appears. Default: 120ms */
|
|
@@ -23,6 +30,13 @@ export interface UseEdgeHoverResizeArgs {
|
|
|
23
30
|
enterMs?: number;
|
|
24
31
|
/** AN-06 exit motion duration exposed for consumer CSS. Default: 120ms */
|
|
25
32
|
exitMs?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Max colSpan supported by the grid (D-13 — right-edge-only grow). Default: 3.
|
|
35
|
+
* Used to clamp ghostWidth writes during drag so the ghost cannot grow
|
|
36
|
+
* past the maximum-allowed column width at any cursor position (debug
|
|
37
|
+
* session 260419-ghost-slides-across-page — AP-17 companion invariant).
|
|
38
|
+
*/
|
|
39
|
+
maxColSpan?: 1 | 2 | 3;
|
|
26
40
|
}
|
|
27
41
|
export interface UseEdgeHoverResizeReturn {
|
|
28
42
|
state: ResizeState;
|
|
@@ -43,8 +57,15 @@ export interface UseEdgeHoverResizeReturn {
|
|
|
43
57
|
ghostProps: {
|
|
44
58
|
visible: boolean;
|
|
45
59
|
targetColSpan: 1 | 2 | 3;
|
|
46
|
-
/**
|
|
47
|
-
|
|
60
|
+
/**
|
|
61
|
+
* D-07 rework 260419-v2 — MotionValue driving ghost WIDTH (left-anchored).
|
|
62
|
+
* The ghost LEFT edge is pinned at the slot origin; the ghost RIGHT edge
|
|
63
|
+
* follows the cursor; `ghostWidth` carries that width imperatively with
|
|
64
|
+
* zero React re-renders per pointermove. Supersedes the prior `motionX`
|
|
65
|
+
* translateX semantic (which slid the entire ghost horizontally — see
|
|
66
|
+
* debug session 260419-ghost-slides-across-page).
|
|
67
|
+
*/
|
|
68
|
+
ghostWidth: MotionValue<number>;
|
|
48
69
|
enterMs: number;
|
|
49
70
|
exitMs: number;
|
|
50
71
|
};
|
|
@@ -77,4 +98,4 @@ export interface UseEdgeHoverResizeReturn {
|
|
|
77
98
|
* - Bug E handle pointerenter keeps zone alive on sentinel→handle crossover
|
|
78
99
|
* - Dwell timer cleanup on unmount
|
|
79
100
|
*/
|
|
80
|
-
export declare function useEdgeHoverResize({ currentColSpan, stackable, onResize, onCancel, step, tuning, dwellMs, enterMs, exitMs, }: UseEdgeHoverResizeArgs): UseEdgeHoverResizeReturn;
|
|
101
|
+
export declare function useEdgeHoverResize({ currentColSpan, stackable, onResize, onCancel, step, gap, tuning, dwellMs, enterMs, exitMs, maxColSpan, }: UseEdgeHoverResizeArgs): UseEdgeHoverResizeReturn;
|