@mt-gloss/ui 0.1.48 → 0.1.50

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.
@@ -18,7 +18,10 @@
18
18
  */
19
19
  export interface SectionDotsProps {
20
20
  count: number;
21
- currentIndex: number;
21
+ /**
22
+ * @deprecated Phase 12 D-09 — prefer `currentSection`. Kept optional for v2.0 back-compat callers.
23
+ */
24
+ currentIndex?: number;
22
25
  onSelect: (index: number) => void;
23
26
  'aria-label'?: string;
24
27
  /** Phase 4 D-09 — index of the unconfirmed ("provisional") section, if any. */
@@ -32,5 +35,4 @@ export interface SectionDotsProps {
32
35
  /** Phase 12 D-09 — how many sections fit in viewport at once. Default 1 (preserves v2.0 model). */
33
36
  sectionsPerView?: number;
34
37
  }
35
- export declare function SectionDots({ count, currentIndex, onSelect, 'aria-label': ariaLabel, provisionalIndex, pulseIndex, pulseNonce, currentSection, // D-08 back-compat shim
36
- sectionsPerView, }: SectionDotsProps): import("react/jsx-runtime").JSX.Element | null;
38
+ export declare function SectionDots({ count, currentIndex, onSelect, 'aria-label': ariaLabel, provisionalIndex, pulseIndex, pulseNonce, currentSection, sectionsPerView, }: SectionDotsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -16,6 +16,20 @@ export interface CascadePreviewItem {
16
16
  /** Static layout in CSS px. NOT MotionValue — Phase 10 does not animate dimensions (Track C/Phase 11). Consumer formula: width = (cell.colSpan ?? 1) * colWidth, height = (cell.rowSpan ?? 1) * rowHeight. */
17
17
  width: number;
18
18
  height: number;
19
+ /**
20
+ * Static base position of the card's anchor cell in the grid, in CSS px.
21
+ * Applied as `left`/`top` on the `position: absolute` wrapper so that the
22
+ * MotionValue `x`/`y` carry only the displacement delta (not an absolute
23
+ * coordinate). Formula: left = cell.col * (colWidth + gap), top = cell.row *
24
+ * (rowHeight + gap).
25
+ *
26
+ * Bug fix (drag-insert-ghost-clone-row1): without a base position the
27
+ * motion.div anchors at (0,0) — the top-left of the grid — and the delta MV
28
+ * translates it by only one column width, making the displaced card appear in
29
+ * row 1 regardless of its real row.
30
+ */
31
+ left: number;
32
+ top: number;
19
33
  }
20
34
  export interface CascadePreviewProps {
21
35
  items: CascadePreviewItem[];
@@ -46,6 +60,8 @@ export interface CascadePreviewProps {
46
60
  * - `key={item.cardId}` — React reconciliation stability (DRAG-09)
47
61
  * - `data-card-id={item.cardId}` — test hook + attribute-selector targeting
48
62
  * - `style.x = item.x`, `style.y = item.y` — framer-motion reads MVs directly
63
+ * - `style.left = item.left`, `style.top = item.top` — static base position
64
+ * of the card's anchor cell; the MotionValue x/y carry displacement delta only
49
65
  * - `aria-hidden="true"` — displaced cards are visually cloned during preview;
50
66
  * the semantic source card retains focus/aria surface
51
67
  * - `pointer-events: none` + `will-change: transform` via SCSS
@@ -0,0 +1,57 @@
1
+ import { UseEdgeHoverResizeReturn } from './useEdgeHoverResize';
2
+ import { CellTintVariant } from '../CellTintOverlay';
3
+ type Cell = {
4
+ section: 0 | 1 | 2 | 3;
5
+ col: 0 | 1 | 2;
6
+ row: 0 | 1 | 2;
7
+ };
8
+ export interface UseResizeChoreographyArgs {
9
+ /** Pass-through of useEdgeHoverResize return — never mutated. D-03. */
10
+ edgeHover: UseEdgeHoverResizeReturn & {
11
+ /** D-04 — locked lifecycle states. The base hook today exposes the legacy
12
+ * ResizeState union; consumer-side adapters can also pass the canonical
13
+ * 4-state lifecycle. The hook treats {idle, settling, cancelled} as
14
+ * null-output and {arming, dwelling, handle-visible, dragging, active}
15
+ * as channel-emitting states. */
16
+ state: string;
17
+ /** Live preview colSpan as a float OR integer. Required for ramp lerp;
18
+ * numbers between integers drive the ramp toward commit. */
19
+ previewColSpan: number;
20
+ /** Hysteresis-snapped target colSpan (D-07). Drives outline / tints / shrink. */
21
+ hysteresisTargetColSpan: 1 | 2 | 3;
22
+ /** Card's current colSpan (pre-resize baseline). */
23
+ currentColSpan: 1 | 2 | 3;
24
+ /** Direction discriminator. */
25
+ direction: string;
26
+ };
27
+ sourceCell: Cell;
28
+ activeSection: 0 | 1 | 2 | 3;
29
+ /** Cascade result for current preview colSpan — passed in from reptime reducer
30
+ * state. Hook is reducer-agnostic per D-03 + RESEARCH §Open Question 2. */
31
+ cascadeResult: {
32
+ result: 'ok' | 'rejected';
33
+ reason?: 'spans-sections' | 'section-full' | 'spillover-blocked' | 'occupied-target' | string;
34
+ } | null;
35
+ colWidth: number;
36
+ rowHeight: number;
37
+ gap: number;
38
+ }
39
+ export interface UseResizeChoreographyReturn {
40
+ trackingOutline: {
41
+ cell: Cell;
42
+ colSpan: 1 | 2 | 3;
43
+ pattern: 'solid' | 'dashed-retreated';
44
+ } | null;
45
+ cellTints: Array<{
46
+ cell: Cell;
47
+ variant: CellTintVariant;
48
+ rampColor?: string;
49
+ }>;
50
+ refusePulse: {
51
+ cell: Cell;
52
+ fireKey: number;
53
+ } | null;
54
+ shrinkFreedCells: Cell[];
55
+ }
56
+ export declare function useResizeChoreography(args: UseResizeChoreographyArgs): UseResizeChoreographyReturn;
57
+ export {};
@@ -44,3 +44,4 @@ export * from './TrackingOutline';
44
44
  export * from './CellTintOverlay';
45
45
  export * from './RefusePulse';
46
46
  export { ResizeTrackingOutline, type ResizeTrackingOutlineProps, } from './ResizeTrackingOutline';
47
+ export { useResizeChoreography, type UseResizeChoreographyArgs, type UseResizeChoreographyReturn, } from './MetricCard/useResizeChoreography';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"