@mt-gloss/ui 0.1.47 → 0.1.48

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.
@@ -0,0 +1,34 @@
1
+ import * as React from 'react';
2
+ export type CellTintVariant = 'eligibility' | 'commit' | 'rejection' | 'ramp';
3
+ export interface CellTintOverlayProps {
4
+ /** Section-relative col convention. Mirror SnapOutline/TrackingOutline contract:
5
+ * cell.col is 0..2 (within section); absCol = cell.section * 3 + cell.col. */
6
+ cell: {
7
+ section: 0 | 1 | 2 | 3;
8
+ col: 0 | 1 | 2;
9
+ row: 0 | 1 | 2;
10
+ };
11
+ variant: CellTintVariant;
12
+ /** Required when variant='ramp'; lerped CSS color (eligibilityFill→commitFill).
13
+ * When omitted on ramp, falls back to eligibilityFill var. */
14
+ rampColor?: string;
15
+ colWidth: number;
16
+ rowHeight: number;
17
+ gap: number;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Phase 11 Plan 11-02 D-04 — Per-cell absolute-positioned tint overlay primitive.
22
+ *
23
+ * Four variants drive eligibility / commit / rejection / ramp visualizations.
24
+ * Section-relative col math mirrors SnapOutline / TrackingOutline (Pattern A).
25
+ *
26
+ * Variant → fill mapping:
27
+ * eligibility → paletteVars.eligibilityFill (#6F87D2)
28
+ * commit → paletteVars.commitFill (#4664C0)
29
+ * rejection → paletteVars.rejectionFill (#F0BAC1) + dashed rejectionStroke border
30
+ * ramp → rampColor literal (consumer-supplied; rAF-driven lerp)
31
+ *
32
+ * z-index: 4 (below TrackingOutline z-index: 5).
33
+ */
34
+ export declare function CellTintOverlay({ cell, variant, rampColor, colWidth, rowHeight, gap, className, }: CellTintOverlayProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { CellTintOverlay } from './CellTintOverlay';
2
+ export type { CellTintOverlayProps, CellTintVariant } from './CellTintOverlay';
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ export interface RefusePulseProps {
3
+ cell: {
4
+ section: 0 | 1 | 2 | 3;
5
+ col: 0 | 1 | 2;
6
+ row: 0 | 1 | 2;
7
+ };
8
+ /** Monotonically increasing key. Incrementing remounts the primitive,
9
+ * replaying the single 360ms expand+fade animation (D-09 fire-once). */
10
+ fireKey: number;
11
+ colWidth: number;
12
+ rowHeight: number;
13
+ gap: number;
14
+ className?: string;
15
+ }
16
+ /**
17
+ * Phase 11 Plan 11-02 RSZ-05 — 3-ring expand-fade pulse primitive.
18
+ *
19
+ * Fires ONCE per gesture per UI-SPEC + D-09. The consumer increments `fireKey`
20
+ * to remount the primitive and replay the 360ms expand+fade. Re-rendering with
21
+ * the same fireKey is a no-op (React reconciliation reuses the same DOM nodes
22
+ * and the CSS animation does not restart).
23
+ *
24
+ * Origin: cx = absCol*(colWidth+gap) + colWidth/2; cy = row*(rowHeight+gap) + rowHeight/2.
25
+ * Color: var(--gloss-g02-rejection-stroke).
26
+ *
27
+ * Reduced-motion (D-08): single 48×48 round flash element with `data-testid=
28
+ * gloss-refuse-pulse-flash`, no rings — preserves fire-once semantics under PRM.
29
+ */
30
+ export declare function RefusePulse({ cell, fireKey, colWidth, rowHeight, gap, className, }: RefusePulseProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { RefusePulse } from './RefusePulse';
2
+ export type { RefusePulseProps } from './RefusePulse';
@@ -0,0 +1,7 @@
1
+ import { TrackingOutlineProps } from '../TrackingOutline/TrackingOutline';
2
+ import * as React from 'react';
3
+ export type ResizeTrackingOutlineProps = Omit<TrackingOutlineProps, 'gesture'>;
4
+ /** Phase 11 D-01 — Thin alias over `<TrackingOutline gesture='resize' />`.
5
+ * Resize callers should import { ResizeTrackingOutline } from '@mt-gloss/ui'.
6
+ * Pattern (`'solid' | 'dashed-retreated'`) is the resize-side knob. */
7
+ export declare function ResizeTrackingOutline(props: ResizeTrackingOutlineProps): React.JSX.Element;
@@ -1,52 +1,18 @@
1
+ import { TrackingOutlineProps } from '../TrackingOutline/TrackingOutline';
1
2
  import * as React from 'react';
2
- export interface SnapOutlineProps {
3
- cell: {
4
- section: 0 | 1 | 2 | 3;
5
- col: 0 | 1 | 2;
6
- row: 0 | 1 | 2;
7
- };
8
- colSpan: 1 | 2 | 3;
9
- rowSpan: 1;
10
- colWidth: number;
11
- gap: number;
12
- rowHeight: number;
13
- /** DRAG-06 default 120ms cubic-bezier(0.4, 0, 0.2, 1) on transform. */
14
- transitionMs?: number;
15
- className?: string;
16
- }
3
+ export type SnapOutlineProps = Omit<TrackingOutlineProps, 'gesture' | 'pattern'>;
17
4
  /**
18
- * Phase 3 DRAG-06single 2px snap outline, 120ms cubic-bezier transition on transform.
5
+ * Phase 11 Plan 11-02 D-01 Thin alias over `<TrackingOutline gesture='drag' pattern='solid' />`.
19
6
  *
20
- * Renders a `position: absolute` 2px solid border rectangle, translated to the
21
- * target cell via `translate({left}px, {top}px)` where:
22
- * - `absCol = cell.section * 3 + cell.col` (section offset applied)
23
- * - `left = absCol * (colWidth + gap)`
24
- * - `top = cell.row * (rowHeight + gap)`
25
- * - `width = colSpan * colWidth + (colSpan - 1) * gap`
26
- * - `height = rowHeight`
7
+ * Drag callers keep importing { SnapOutline } from '@mt-gloss/ui'. D-15 #4
8
+ * asserts pixel-identical render against the post-Plan-11-01 baseline
9
+ * (`live_uat_screenshots/13-cleanup-after.png`) chrome MCP scenario 12.
27
10
  *
28
- * COORDINATE CONTRACT: `cell.col` is SECTION-RELATIVE (0..2). The absolute grid
29
- * column is computed here by adding `cell.section * 3`. Producers (useDragFeedback)
30
- * emit section-relative col so predictCascade + snap outline share the same type.
31
- * Prior to the `large-card-drop-positioning` debug fix (2026-04-22), this
32
- * component treated `cell.col` as absolute, causing the outline to stick to
33
- * section 1 regardless of cursor section — and to straddle the section boundary
34
- * when a wide card hovered near the right of section 1.
11
+ * The base primitive emits `data-testid="gloss-snap-outline"` and the legacy
12
+ * `.gloss-drag-feedback-snap-outline` class on the drag branch, so existing
13
+ * unit tests + reptime SCSS selectors continue to match unchanged.
35
14
  *
36
- * Transitions the transform at `${transitionMs ?? 120}ms cubic-bezier(0.4, 0, 0.2, 1)`.
37
- * Under `prefers-reduced-motion: reduce`, `transition: none !important` strips
38
- * the slide (SCSS-level override; see snap-outline.scss).
39
- *
40
- * Rendering-layer invariants (Plan 05 MUST honor):
41
- * - `position: absolute` consumer — parent is the grid container with `position: relative`.
42
- * - `pointer-events: none` (aria-hidden); does NOT intercept drag events.
43
- * - 2px solid border using `var(--gloss-g02-tracking-outline)` (Phase 9 D-14 G-02
44
- * trackingOutline channel; pre-rewire used `var(--gloss-valid-stroke)`. SCSS-default
45
- * matches pre-rewire `#3b82f6` for D-17 zero-visual-diff. G-02 spec hex `#2541A1`
46
- * + 2.5px width bump deferred to Track C / Phase 11).
47
- * - Rendered INSIDE the grid container, NOT inside `<DragOverlay>`; DragOverlay
48
- * hosts the DragGhost only (see Plan 02). The `dropAnimation={null}` invariant
49
- * on DragOverlay (Plan 00 spike + Plan 01 header) does not apply here — SnapOutline
50
- * is not a DragOverlay child.
15
+ * See SnapOutline-pre-11-02 for the prior coordinate-contract JSDoc; the same
16
+ * contract is preserved verbatim in TrackingOutline.tsx.
51
17
  */
52
- export declare function SnapOutline({ cell, colSpan, colWidth, gap, rowHeight, transitionMs, className, }: SnapOutlineProps): React.JSX.Element;
18
+ export declare function SnapOutline(props: SnapOutlineProps): React.JSX.Element;
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ export interface TrackingOutlineProps {
3
+ /** D-01 — gesture discriminator. drag stays 2px solid (D-15 #4 parity); resize gets 2.5px + dashed-retreated pattern support. */
4
+ gesture: 'drag' | 'resize';
5
+ cell: {
6
+ section: 0 | 1 | 2 | 3;
7
+ col: 0 | 1 | 2;
8
+ row: 0 | 1 | 2;
9
+ };
10
+ colSpan: 1 | 2 | 3;
11
+ rowSpan: 1;
12
+ colWidth: number;
13
+ gap: number;
14
+ rowHeight: number;
15
+ /** UI-SPEC §Tracking outline — solid for valid commit, 'dashed-retreated' (visual only; color never red — Principle 1) when handle past divider. */
16
+ pattern?: 'solid' | 'dashed-retreated';
17
+ /** DRAG-06 default 120ms cubic-bezier(0.4, 0, 0.2, 1) on transform. */
18
+ transitionMs?: number;
19
+ className?: string;
20
+ }
21
+ /**
22
+ * Phase 11 D-01 — Shared tracking-outline base for drag + resize gestures.
23
+ *
24
+ * Renders a `position: absolute` border rectangle, translated to the target cell
25
+ * via `translate({left}px, {top}px)` where:
26
+ * - `absCol = cell.section * 3 + cell.col` (section offset applied)
27
+ * - `left = absCol * (colWidth + gap)`
28
+ * - `top = cell.row * (rowHeight + gap)`
29
+ * - `width = colSpan * colWidth + (colSpan - 1) * gap`
30
+ * - `height = rowHeight`
31
+ *
32
+ * COORDINATE CONTRACT: `cell.col` is SECTION-RELATIVE (0..2). The absolute grid
33
+ * column is computed here by adding `cell.section * 3`. Producers (useDragFeedback,
34
+ * useResizeChoreography) emit section-relative col so predictCascade + tracking
35
+ * outline share the same type. Prior to the `large-card-drop-positioning` debug
36
+ * fix (2026-04-22), SnapOutline (predecessor) treated `cell.col` as absolute,
37
+ * causing the outline to stick to section 1 regardless of cursor section — and
38
+ * to straddle the section boundary when a wide card hovered near the right of
39
+ * section 1. Carried verbatim into TrackingOutline.
40
+ *
41
+ * D-15 #4 PARITY GATE: When `gesture === 'drag'`, render must be pixel-identical
42
+ * to the pre-Plan-11-02 SnapOutline render — same testid `gloss-snap-outline`,
43
+ * same 2px borderWidth, same color, same transition. The drag-parity chrome MCP
44
+ * scenario 12 (Task 4) asserts this empirically against the Plan 11-01 baseline
45
+ * `live_uat_screenshots/13-cleanup-after.png`.
46
+ *
47
+ * Resize variant (`gesture === 'resize'`) bumps borderWidth to 2.5px (G-02 spec
48
+ * UI-SPEC §Tracking outline) and unlocks `pattern='dashed-retreated'` for the
49
+ * post-boundary retreated state (Principle 1: color never changes; pattern signals
50
+ * the channel).
51
+ *
52
+ * Rendering-layer invariants (callers MUST honor):
53
+ * - `position: absolute` consumer — parent is the grid container with `position: relative`.
54
+ * - `pointer-events: none` (aria-hidden); does NOT intercept drag/resize events.
55
+ * - 2px (drag) or 2.5px (resize) border using `var(--gloss-g02-tracking-outline)`.
56
+ * - Rendered INSIDE the grid container, NOT inside `<DragOverlay>`.
57
+ */
58
+ export declare function TrackingOutline({ gesture, cell, colSpan, colWidth, gap, rowHeight, pattern, transitionMs, className, }: TrackingOutlineProps): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { TrackingOutline } from './TrackingOutline';
2
+ export type { TrackingOutlineProps } from './TrackingOutline';
@@ -40,3 +40,7 @@ export * from './StackedGroupTilePreview';
40
40
  export * from './gridMotionPrimitives';
41
41
  export * from './gridChannels';
42
42
  export * from './gridInteractivePalette';
43
+ export * from './TrackingOutline';
44
+ export * from './CellTintOverlay';
45
+ export * from './RefusePulse';
46
+ export { ResizeTrackingOutline, type ResizeTrackingOutlineProps, } from './ResizeTrackingOutline';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.47",
3
+ "version": "0.1.48",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"