@mt-gloss/ui 0.1.73 → 0.1.75

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.
@@ -6,22 +6,20 @@ export { StackedGroupCard } from './StackedGroupCard';
6
6
  export { StatusModeCard } from './StatusModeCard';
7
7
  export { StatusSlotChipMenu } from './StatusSlotChipMenu';
8
8
  export type { StatusSlotChipMenuProps, ChipMenuAction } from './StatusSlotChipMenu';
9
- export { EdgeHoverHandle } from './EdgeHoverHandle';
10
9
  export { GhostPreview } from './GhostPreview';
11
- export { useEdgeHoverResize } from './useEdgeHoverResize';
12
10
  export { DEFAULT_RESIZE_PHYSICS } from './resizePhysics';
13
11
  export type { ResizePhysicsConfig } from './resizePhysics';
14
12
  export { VelocityBuffer } from './velocityBuffer';
15
13
  export type { VelocitySample } from './velocityBuffer';
16
14
  export { DEFAULT_GRID_INTERACTION_PHYSICS } from './gridInteractionPhysics';
17
15
  export type { GridInteractionPhysicsConfig } from './gridInteractionPhysics';
16
+ export * from '../ResizePill';
18
17
  export * from './flipAndStage';
19
18
  export * from './types';
20
19
  export type { CardBackProps } from './CardBack';
21
20
  export type { StackedGroupCardProps, StackedValueEntry, SlotActionStripConfig, SlotToActionStripConfig, } from './StackedGroupCard';
22
- export type { ResizeState, ResizeDirection, ResizeMode, ResizeCommit, UseEdgeHoverResizeArgs, UseEdgeHoverResizeReturn, } from './useEdgeHoverResize';
21
+ export type { ResizeCommit, ResizeDirection, ResizeMode } from './resizeTypes';
23
22
  export type { ChoreographyPhase, UseResizeChoreographyReturn } from './useResizeChoreography';
24
- export type { EdgeHoverHandleProps } from './EdgeHoverHandle';
25
23
  export type { GhostPreviewProps } from './GhostPreview';
26
24
  export { SparklineBg } from './visualizations/SparklineBg';
27
25
  export { BarsBg } from './visualizations/BarsBg';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * resizeTypes — Phase 11.3 cycle-4 Plan 01 Task 5.
3
+ *
4
+ * Lifted from useEdgeHoverResize.ts ahead of that file's deletion (Task 6,
5
+ * PILL-09). Plans 03/04/05 depend on the ResizeCommit / ResizeDirection /
6
+ * ResizeMode contract — useResizePillCommit (Plan 03) constructs the SAME
7
+ * ResizeCommit shape the predecessor's drag-handle gesture used so it can be
8
+ * routed through the existing E3 RESIZE_COMMIT path in useResizeHandlers
9
+ * without any consumer-side changes.
10
+ *
11
+ * Type-only file (no behavior). useEdgeHoverResize.ts re-imports from here
12
+ * during the Task 5 → Task 6 deletion window so the build stays green between
13
+ * the extraction commit and the deletion commit.
14
+ *
15
+ * Authority: .planning/phases/11.3-resize-pill/11.3-REMOVAL-MODE-ADDENDUM.md §3.
16
+ */
17
+ export type ResizeDirection = 'grow' | 'shrink';
18
+ export type ResizeMode = 'slot-fill' | 'sparkline-fidelity';
19
+ export interface ResizeCommit {
20
+ direction: ResizeDirection;
21
+ targetColSpan: 1 | 2 | 3;
22
+ mode: ResizeMode;
23
+ }
@@ -1,29 +1,37 @@
1
- import { UseEdgeHoverResizeReturn } from './useEdgeHoverResize';
2
1
  import { CellTintVariant } from '../CellTintOverlay';
2
+ /**
3
+ * Structural shape of the resize-gesture output the choreography hook
4
+ * subscribes to. Lifted from the retired useEdgeHoverResize.ts (Phase 11.3
5
+ * Plan 01 Task 6 / PILL-09) so the choreography hook keeps its input-agnostic
6
+ * contract. Plan 03's `useResizePillCommit` constructs the same shape from
7
+ * the click-based resize pill.
8
+ */
9
+ interface ResizeGestureOutput {
10
+ /** Lifecycle state string — choreography reads {idle, settling, cancelled}
11
+ * as null-output; {arming, dwelling, handle-visible, dragging, active}
12
+ * as channel-emitting. Pill adapter maps {trigger-hover, pill-visible,
13
+ * pre-commit, fading} → equivalent legacy strings. */
14
+ state: string;
15
+ /** Direction discriminator. */
16
+ direction: string;
17
+ /** Card's current colSpan (pre-resize baseline). */
18
+ currentColSpan: 1 | 2 | 3;
19
+ /** Live preview colSpan as a float OR integer. Required for ramp lerp;
20
+ * numbers between integers drive the ramp toward commit. */
21
+ previewColSpan: number;
22
+ /** Hysteresis-snapped target colSpan (D-07). Drives outline / tints / shrink. */
23
+ hysteresisTargetColSpan: 1 | 2 | 3;
24
+ }
3
25
  type Cell = {
4
26
  section: 0 | 1 | 2 | 3;
5
27
  col: 0 | 1 | 2;
6
28
  row: 0 | 1 | 2;
7
29
  };
8
30
  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
- };
31
+ /** Pass-through resize-gesture output bag — never mutated. D-03.
32
+ * Structural shape lifted from retired useEdgeHoverResize (PILL-09);
33
+ * Plan 03's useResizePillCommit produces the same bag. */
34
+ edgeHover: ResizeGestureOutput;
27
35
  sourceCell: Cell;
28
36
  activeSection: 0 | 1 | 2 | 3;
29
37
  /** Cascade result for current preview colSpan — passed in from reptime reducer
@@ -0,0 +1,82 @@
1
+ import { ResizePillPhysicsConfig } from './resizePillPhysics';
2
+ import { PillButton, PillPhase, PillTarget } from './useResizePill';
3
+ export type { PillButton, PillPhase, PillTarget };
4
+ export interface ResizePillProps {
5
+ mode: 'directional' | 'sized';
6
+ currentTarget: PillTarget;
7
+ availableTargets: PillTarget[];
8
+ onCommit: (target: PillTarget) => void;
9
+ anchorLeftPx: number;
10
+ anchorTopPx: number | string;
11
+ hostWidth: number;
12
+ resolveTargetWidth: (target: PillTarget) => number;
13
+ /** Default false; Plan 04 (chart) sets true (D-10). */
14
+ showSizeTooltip?: boolean;
15
+ /** Default 'vertical'; Plan 04 sets 'horizontal' (D-11). */
16
+ orientation?: 'vertical' | 'horizontal';
17
+ onPhaseChange?: (phase: PillPhase) => void;
18
+ /** Mutex / global affordance gate. */
19
+ forceIdle?: boolean;
20
+ /** Gloss-side enable flag (Option B per PATTERNS §7). */
21
+ resizePillEnabled?: boolean;
22
+ phase: PillPhase;
23
+ pillVisible: boolean;
24
+ buttonHover: PillButton | null;
25
+ /** Trigger-zone + pill hover handlers from useResizePill.handlers. */
26
+ onTriggerEnter?: () => void;
27
+ onTriggerLeave?: () => void;
28
+ onPillEnter?: () => void;
29
+ onPillLeave?: () => void;
30
+ onButtonEnter?: (target: PillTarget) => void;
31
+ onButtonLeave?: () => void;
32
+ /** Optional override of physics tokens (test/dev tuning). */
33
+ physics?: Partial<ResizePillPhysicsConfig>;
34
+ /**
35
+ * Resolved preview target for the hovered button. Host computes from
36
+ * useResizePill.previewTarget. When null OR equal to currentTarget, the
37
+ * preview overlays do not render.
38
+ */
39
+ previewTarget?: PillTarget | null;
40
+ /**
41
+ * Direction of the resize for the chain stagger order. Host derives from
42
+ * (previewTarget vs currentTarget) — 'grow' when previewTarget > currentTarget,
43
+ * 'shrink' otherwise. Optional; defaults to 'grow'.
44
+ */
45
+ chainDirection?: 'grow' | 'shrink';
46
+ /**
47
+ * Pill edge px (chain start anchor). Host computes from anchorLeftPx +
48
+ * pill width. Optional; chain falls back to 0 when omitted (in which
49
+ * case the chain still renders but anchored at host origin).
50
+ */
51
+ chainStartX?: number;
52
+ /**
53
+ * Ghost edge px (chain end anchor). Host computes from anchorLeftPx +
54
+ * targetWidth. Optional; chain falls back to hostWidth when omitted.
55
+ */
56
+ chainEndX?: number;
57
+ }
58
+ /**
59
+ * Plan 02 contract — preview overlay (ghost + arrow chain + dot-matrix
60
+ * tooltip). Locked here so Plan 02 inputs are guaranteed to compose with
61
+ * Plan 01 outputs.
62
+ */
63
+ export interface ResizePillPreviewProps {
64
+ buttonHover: PillButton | null;
65
+ previewTarget: PillTarget | null;
66
+ hostWidth: number;
67
+ /** resolveTargetWidth(previewTarget); host computes once per render. */
68
+ targetWidth: number;
69
+ pillClearancePx: number;
70
+ ghostClearancePx: number;
71
+ showSizeTooltip: boolean;
72
+ }
73
+ /**
74
+ * ResizePill — controlled primitive shell.
75
+ *
76
+ * Per ADR-grid-hook-comms §3.2: this primitive owns NO useState for
77
+ * `phase` / `pillSpan` / `pillVisible`. They come from props (host runs
78
+ * useResizePill). Internal useState is permitted ONLY for trigger-zone hover
79
+ * and pill-button-hover (which Plan 02's preview overlay also reads from
80
+ * useResizePill). Negative grep test (style-audit) enforces this.
81
+ */
82
+ export declare const ResizePill: import('react').ForwardRefExoticComponent<ResizePillProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,22 @@
1
+ export interface ResizePillArrowChainProps {
2
+ visible: boolean;
3
+ /** Chevron direction + stagger order. */
4
+ direction: 'grow' | 'shrink';
5
+ /** From DEFAULT_RESIZE_PILL_PHYSICS.pillClearancePx. */
6
+ pillClearancePx: number;
7
+ /** From DEFAULT_RESIZE_PILL_PHYSICS.ghostClearancePx. */
8
+ ghostClearancePx: number;
9
+ /** Pill edge px (host-computed; chain anchors here + pillClearancePx). */
10
+ startX: number;
11
+ /** Ghost edge px (host-computed; chain anchors here - ghostClearancePx). */
12
+ endX: number;
13
+ /** chainPulseMs from physics. */
14
+ pulseMs: number;
15
+ /** chainStaggerMs from physics. */
16
+ staggerMs: number;
17
+ }
18
+ export declare function ResizePillArrowChain(props: ResizePillArrowChainProps): import("react/jsx-runtime").JSX.Element | null;
19
+ export declare namespace ResizePillArrowChain {
20
+ var displayName: string;
21
+ }
22
+ export declare const _CHEVRON_COUNT_LOCK = 5;
@@ -0,0 +1,25 @@
1
+ import { PillTarget } from './useResizePill';
2
+ export interface ResizePillGhostProps {
3
+ visible: boolean;
4
+ currentTarget: PillTarget;
5
+ previewTarget: PillTarget;
6
+ /** Host card / chart frame current width (px). */
7
+ hostWidth: number;
8
+ /** Host card / chart frame target width (px) — host computes from currentTarget→previewTarget. */
9
+ targetWidth: number;
10
+ /** From DEFAULT_RESIZE_PILL_PHYSICS.ghostClearancePx. */
11
+ ghostClearancePx: number;
12
+ orientation: 'vertical' | 'horizontal';
13
+ }
14
+ /**
15
+ * Renders a dashed-outline overlay at `targetWidth` px. Width is driven by
16
+ * a `motion/react` MotionValue (no CSS `transition: width`); opacity-only
17
+ * enter/exit transition (matches GhostPreview.tsx pattern).
18
+ *
19
+ * Returns null when the ghost would be a no-op (not visible OR target equals
20
+ * current — there is nothing to preview).
21
+ */
22
+ export declare function ResizePillGhost(props: ResizePillGhostProps): import("react/jsx-runtime").JSX.Element | null;
23
+ export declare namespace ResizePillGhost {
24
+ var displayName: string;
25
+ }
@@ -0,0 +1,21 @@
1
+ import { PillTarget } from './useResizePill';
2
+ export interface ResizePillSizeTooltipProps {
3
+ visible: boolean;
4
+ currentTarget: PillTarget;
5
+ previewTarget: PillTarget;
6
+ /** Card variant uses 'directional'; chart variant uses 'sized'. */
7
+ mode: 'directional' | 'sized';
8
+ /**
9
+ * Whether the parent has opted into rendering this tooltip (D-10).
10
+ * Plumbed through for completeness; the gating is performed by the parent
11
+ * deciding to mount this component, but accepting the prop here lets unit
12
+ * tests assert on the showSizeTooltip contract without an extra wrapper.
13
+ * Not all callers pass this — defaults to true (component is mounted, so
14
+ * the caller has implicitly opted in).
15
+ */
16
+ showSizeTooltip?: boolean;
17
+ }
18
+ export declare function ResizePillSizeTooltip(props: ResizePillSizeTooltipProps): import("react/jsx-runtime").JSX.Element | null;
19
+ export declare namespace ResizePillSizeTooltip {
20
+ var displayName: string;
21
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ResizePill barrel — public surface for Plan 02 importability gate.
3
+ *
4
+ * Plan 02 Task 5 greps for the 9 symbols below in the @mt-gloss/ui d.ts.
5
+ * If any symbol is missing, the gate fails before Plans 03/04 begin wiring.
6
+ * (cycle-3 gemini HIGH fix.)
7
+ */
8
+ export { ResizePill } from './ResizePill';
9
+ export { useResizePill } from './useResizePill';
10
+ export { DEFAULT_RESIZE_PILL_PHYSICS } from './resizePillPhysics';
11
+ export type { ResizePillProps, ResizePillPreviewProps, } from './ResizePill';
12
+ export type { UseResizePillArgs, UseResizePillReturn, PillPhase, PillTarget, PillButton, } from './useResizePill';
13
+ export type { ResizePillPhysicsConfig } from './resizePillPhysics';
@@ -0,0 +1,33 @@
1
+ /**
2
+ * resizePillPhysics — Phase 11.3 config tokens (D-08, D-06).
3
+ *
4
+ * STRICT SEPARATION from gridInteractionPhysics.ts (D-27 analog):
5
+ * cascade + envelope + spring constants stay in their existing modules
6
+ * (gridInteractionPhysics.ts owns Phase 23 cascade timings; resizePhysics.ts
7
+ * owns spring + hysteresis + cardWidthSpring). This module owns ONLY
8
+ * pill-specific geometry + timings.
9
+ *
10
+ * DO NOT add cardWidthSpring here — lives in resizePhysics.ts (D-27 invariant
11
+ * verified by negative test in __tests__/resizePillPhysics.test.ts).
12
+ *
13
+ * Source spec: .planning/imports/resize/resize-pill-design.md §Configuration
14
+ * tokens. D-06 = fadeGraceMs:180 (bounce-back grace). D-08 = pillOverhangPx:12
15
+ * (lands in 15px section gap at 3×1).
16
+ */
17
+ export declare const DEFAULT_RESIZE_PILL_PHYSICS: {
18
+ readonly pillOverhangPx: 12;
19
+ readonly pillClearancePx: 14;
20
+ readonly ghostClearancePx: 10;
21
+ readonly pillButtonWidth: 30;
22
+ readonly pillButtonHeight: 26;
23
+ readonly triggerZoneWidth: 36;
24
+ readonly pillRevealMs: 180;
25
+ readonly pillDismissMs: 140;
26
+ readonly hoverHideGraceMs: 120;
27
+ readonly fadeGraceMs: 180;
28
+ readonly chevronExitMs: 160;
29
+ readonly checkEnterMs: 180;
30
+ readonly chainPulseMs: 1200;
31
+ readonly chainStaggerMs: 120;
32
+ };
33
+ export type ResizePillPhysicsConfig = typeof DEFAULT_RESIZE_PILL_PHYSICS;
@@ -0,0 +1,37 @@
1
+ import { ResizePillPhysicsConfig } from './resizePillPhysics';
2
+ export type PillTarget = number | 'compact' | 'medium' | 'full';
3
+ export type PillButton = 'shrink' | 'grow' | 'compact' | 'medium' | 'full';
4
+ export type PillPhase = 'idle' | 'trigger-hover' | 'pill-visible' | 'pre-commit' | 'committing' | 'fading';
5
+ export interface UseResizePillArgs {
6
+ currentTarget: PillTarget;
7
+ availableTargets: PillTarget[];
8
+ onCommit: (target: PillTarget) => void;
9
+ /** Mutex / global affordance gate. When true, all transitions to non-idle blocked. */
10
+ forceIdle?: boolean;
11
+ /** Phase observer (Plan 05 mutex consumes). */
12
+ onPhaseChange?: (phase: PillPhase) => void;
13
+ /** Optional override of the locked physics tokens (test/dev tuning panel). */
14
+ physics?: Partial<ResizePillPhysicsConfig>;
15
+ }
16
+ export interface UseResizePillReturn {
17
+ phase: PillPhase;
18
+ pillVisible: boolean;
19
+ /** D-05 — frozen during fade; resyncs to currentTarget only inside showPill. */
20
+ pillSpan: PillTarget;
21
+ /** Which button cursor is over — Plan 02 preview overlay gate. */
22
+ buttonHover: PillButton | null;
23
+ /** Resolved hover target; null when buttonHover is null OR equals currentTarget. */
24
+ previewTarget: PillTarget | null;
25
+ handlers: {
26
+ onTriggerEnter: () => void;
27
+ onTriggerLeave: () => void;
28
+ onPillEnter: () => void;
29
+ onPillLeave: () => void;
30
+ onButtonEnter: (target: PillTarget) => void;
31
+ onButtonLeave: () => void;
32
+ onButtonClick: (target: PillTarget) => void;
33
+ };
34
+ /** Direct programmatic commit — used by tests + ChartSlot direct teleport. */
35
+ commit: (target: PillTarget) => void;
36
+ }
37
+ export declare function useResizePill(args: UseResizePillArgs): UseResizePillReturn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.73",
3
+ "version": "0.1.75",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"