@mt-gloss/ui 0.1.80 → 0.1.82
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/{BaseAsyncButton-Cq_l7clO.js → BaseAsyncButton-BE4m1Eff.js} +25 -25
- package/COMMITS-BcbOliuF.js +223 -0
- package/{Expandable-Deyl6mWK.js → Expandable-8IsJX0iR.js} +174 -174
- package/{UIContext-DP6JGCto.js → UIContext-C7m-9sGv.js} +69 -69
- package/catalog.js +53 -53
- package/composites-panels.d.ts +12 -0
- package/composites-panels.js +13 -0
- package/index.d.ts +2 -0
- package/index.js +445 -432
- package/internals.js +3 -3
- package/lib/composites/dashboard/BottomToolbar/SectionDots.d.ts +14 -1
- package/lib/composites/panels/PanelChrome.d.ts +7 -0
- package/lib/composites/panels/PanelHost.d.ts +19 -0
- package/lib/composites/panels/PanelProvider.d.ts +6 -0
- package/lib/composites/panels/coordinator/COMMITS.d.ts +2 -0
- package/lib/composites/panels/coordinator/coordinator.d.ts +3 -0
- package/lib/composites/panels/coordinator/deriveSurfaceState.d.ts +2 -0
- package/lib/composites/panels/coordinator/types.d.ts +84 -0
- package/lib/composites/panels/hooks/usePanelContext.d.ts +4 -0
- package/lib/composites/panels/hooks/usePanelCoordinator.d.ts +8 -0
- package/lib/composites/panels/index.d.ts +21 -0
- package/package.json +12 -1
- package/ui.css +1 -1
- package/lib/primitives/dashboard/MetricCard/__tests__/_testSupport/gridHoverListeners.d.ts +0 -29
package/internals.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { B } from "./UIContext-C7m-9sGv.js";
|
|
2
|
+
import { z as A, F as I, A as H, D as M, ac as $, ae as R, a as E, f as F, r as O, y as U, t as z, u as W, s as L, v as j, x as G, w as V, i as X, af as Z, a3 as q, a6 as J, a5 as K, a4 as Q, a7 as Y, N as aa, P as sa, Q as ea, O as oa, X as ta, Y as la, c as ra, a0 as ia, a2 as da, a1 as na, e as ca, g as Ba, ag as ga, $ as ba, G as ma, J as ua, H as pa, I as ya, _ as ha, ab as _a, ad as fa, j as va, a8 as Ca, L as ka, M as Da, l as Ta, n as wa, p as xa, o as Sa, m as Na, q as Pa, b as Aa, a9 as Ia, h as Ha, U as Ma, W as $a, V as Ra, aa as Ea, k as Fa, K as Oa, d as Ua, C as za, E as Wa, R as La, S as ja, T as Ga, ah as Va, ai as Xa, Z as Za, aj as qa } from "./UIContext-C7m-9sGv.js";
|
|
3
3
|
import { jsx as d, jsxs as g, Fragment as b } from "react/jsx-runtime";
|
|
4
|
-
import { c as Ka, e as Qa, d as Ya, B as as, b as ss, a as es } from "./BaseAsyncButton-
|
|
4
|
+
import { c as Ka, e as Qa, d as Ya, B as as, b as ss, a as es } from "./BaseAsyncButton-BE4m1Eff.js";
|
|
5
5
|
const T = {
|
|
6
6
|
DurationFast: "var(--gloss-motion-duration-fast)",
|
|
7
7
|
DurationNormal: "var(--gloss-motion-duration-normal)",
|
|
@@ -34,5 +34,18 @@ export interface SectionDotsProps {
|
|
|
34
34
|
currentSection?: number;
|
|
35
35
|
/** Phase 12 D-09 — how many sections fit in viewport at once. Default 1 (preserves v2.0 model). */
|
|
36
36
|
sectionsPerView?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Quick task 260510-nav T4 (D5 = fade_only). Additive opt-in: when `true`,
|
|
39
|
+
* the primitive skips its auto-hide early-return at lines 67-69 and renders
|
|
40
|
+
* with `data-hiding="true"` on the tablist root. SCSS animates opacity to
|
|
41
|
+
* 0 over 200ms. The CONSUMER drives mount/unmount lifecycle via the
|
|
42
|
+
* `useDelayedUnmount(shouldHide, 200)` hook in reptime — when shouldHide
|
|
43
|
+
* flips true → consumer sets isHiding=true immediately; 200ms later the
|
|
44
|
+
* consumer unmounts SectionDots entirely (this prop becomes irrelevant).
|
|
45
|
+
* Omitting this prop preserves the Phase 12 NAV-02/03 instant-hide
|
|
46
|
+
* behavior exactly (back-compat parity contract).
|
|
47
|
+
*/
|
|
48
|
+
isHiding?: boolean;
|
|
37
49
|
}
|
|
38
|
-
export declare function SectionDots({ count, currentIndex, onSelect, 'aria-label': ariaLabel, provisionalIndex, pulseIndex, pulseNonce, currentSection, sectionsPerView,
|
|
50
|
+
export declare function SectionDots({ count, currentIndex, onSelect, 'aria-label': ariaLabel, provisionalIndex, pulseIndex, pulseNonce, currentSection, sectionsPerView, // D-09 default
|
|
51
|
+
isHiding, }: SectionDotsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PanelChromeProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
isOpen?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function PanelChrome({ children, onClose, isOpen }: PanelChromeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { PanelId } from './coordinator/types';
|
|
3
|
+
/**
|
|
4
|
+
* Shape contract for panel shell components (F10).
|
|
5
|
+
* Receives `isOpen` so future plans may always-mount panels and rely on this
|
|
6
|
+
* prop for animation gating; P1 mounts only the active panel.
|
|
7
|
+
*/
|
|
8
|
+
export interface PanelShellProps {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface PanelHostProps {
|
|
12
|
+
/**
|
|
13
|
+
* Map of PanelId → shell component. Only the active panel mounts in P1.
|
|
14
|
+
* F8 — callers SHOULD declare this at module scope as a `const` for
|
|
15
|
+
* referential stability.
|
|
16
|
+
*/
|
|
17
|
+
panelComponents: Partial<Record<PanelId, ComponentType<PanelShellProps>>>;
|
|
18
|
+
}
|
|
19
|
+
export declare function PanelHost({ panelComponents }: PanelHostProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface PanelProviderProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function PanelProvider({ children }: PanelProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { usePanelContext, usePanelContextOptional } from './hooks/usePanelContext';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Panel system — type contract.
|
|
3
|
+
*
|
|
4
|
+
* Authority: `.planning/spikes/toolbar/panels/SPIKE-DELIVERABLES.md` §1.2 (PanelId),
|
|
5
|
+
* §1.3 (SurfaceState), §1.10/§1.15 (CloseReason taxonomy), §1.17 (TriggerContext).
|
|
6
|
+
*
|
|
7
|
+
* P1 reach: reducer only OPENs/CLOSEs `'notification-center'`; other PanelIds are
|
|
8
|
+
* present in the union but emit INVALID_DISPATCH per F15 branch 3. Surface-state
|
|
9
|
+
* derivation in P1 reaches `'idle'` + `'notif-center'` only; other branches return
|
|
10
|
+
* `'idle'` with a TODO until P2 extends the reducer to full 7-state.
|
|
11
|
+
*
|
|
12
|
+
* Plan refs:
|
|
13
|
+
* F1 — exhaustive types ship Day 1
|
|
14
|
+
* F4 — `lastClose` carries `{ panelId, reason }` so closeLog pump can append
|
|
15
|
+
* F6 — `SCHEDULE_TIMER` is a SideEffect, NOT a PanelAction (external callers
|
|
16
|
+
* cannot dispatch it). Only `OPEN_PANEL | CLOSE_PANEL | DRAIN_SIDE_EFFECTS`
|
|
17
|
+
* are dispatchable.
|
|
18
|
+
* F9 + F21 — `NAV_ESCAPE_HATCH` carries dual P1 meaning: backdrop-click AND
|
|
19
|
+
* page-nav escape; spike enum has no `BACKDROP_CLICK` literal.
|
|
20
|
+
*/
|
|
21
|
+
export type PanelId = 'settings' | 'catalog-add' | 'catalog-replace' | 'page-management' | 'notification-center';
|
|
22
|
+
export type CloseReason = 'cancel-button' | 'apply-button' | 'header-x' | 'escape-key' | 'page-nav' | 'mutex-handoff' | 'ghost-anchor' | 'viewport-collapse' | 'unmount' | 'nav-escape-hatch';
|
|
23
|
+
export type SurfaceState = 'idle' | 'bell-cutout-only' | 'panel-clean' | 'panel-dirty' | 'panel-clean+cutout' | 'panel-dirty+cutout' | 'notif-center';
|
|
24
|
+
export type TriggerContext = {
|
|
25
|
+
kind: 'bell';
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'card-overflow';
|
|
28
|
+
cardId: string;
|
|
29
|
+
sectionIndex: number;
|
|
30
|
+
action: 'configure' | 'replace';
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'empty-cell';
|
|
33
|
+
sectionIndex: number;
|
|
34
|
+
cellPosition: {
|
|
35
|
+
row: number;
|
|
36
|
+
col: number;
|
|
37
|
+
};
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'manage-pages-action';
|
|
40
|
+
global: true;
|
|
41
|
+
align: 'left';
|
|
42
|
+
};
|
|
43
|
+
export interface CloseLogEntry {
|
|
44
|
+
panelId: PanelId;
|
|
45
|
+
reason: CloseReason;
|
|
46
|
+
at: number;
|
|
47
|
+
/**
|
|
48
|
+
* F21 — When `reason === 'nav-escape-hatch'`, the same enum literal fires for
|
|
49
|
+
* both backdrop-click AND page-nav escape. Future analytics MUST inspect this
|
|
50
|
+
* note before attributing UX intent.
|
|
51
|
+
*/
|
|
52
|
+
note?: string;
|
|
53
|
+
}
|
|
54
|
+
export type SideEffect = {
|
|
55
|
+
type: 'SCHEDULE_TIMER';
|
|
56
|
+
ms: number;
|
|
57
|
+
action: PanelAction;
|
|
58
|
+
} | {
|
|
59
|
+
type: 'INVALID_DISPATCH';
|
|
60
|
+
reason: string;
|
|
61
|
+
};
|
|
62
|
+
export interface PanelState {
|
|
63
|
+
activePanelId: PanelId | null;
|
|
64
|
+
lastClose: {
|
|
65
|
+
panelId: PanelId;
|
|
66
|
+
reason: CloseReason;
|
|
67
|
+
} | null;
|
|
68
|
+
pendingSideEffects: SideEffect[];
|
|
69
|
+
}
|
|
70
|
+
export type PanelAction = {
|
|
71
|
+
type: 'OPEN_PANEL';
|
|
72
|
+
panelId: PanelId;
|
|
73
|
+
trigger: TriggerContext;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'CLOSE_PANEL';
|
|
76
|
+
reason: CloseReason;
|
|
77
|
+
} | {
|
|
78
|
+
type: 'DRAIN_SIDE_EFFECTS';
|
|
79
|
+
};
|
|
80
|
+
export interface LockHint {
|
|
81
|
+
blockedTrigger: TriggerContext;
|
|
82
|
+
activeCardId: string | null;
|
|
83
|
+
expiresAt: number;
|
|
84
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UsePanelCoordinatorReturn } from './usePanelCoordinator';
|
|
2
|
+
export declare const PanelContext: import('react').Context<UsePanelCoordinatorReturn | null>;
|
|
3
|
+
export declare function usePanelContext(): UsePanelCoordinatorReturn;
|
|
4
|
+
export declare function usePanelContextOptional(): UsePanelCoordinatorReturn | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CloseLogEntry, PanelAction, PanelState, SurfaceState } from '../coordinator/types';
|
|
2
|
+
export interface UsePanelCoordinatorReturn {
|
|
3
|
+
state: PanelState;
|
|
4
|
+
surfaceState: SurfaceState;
|
|
5
|
+
dispatch: React.Dispatch<PanelAction>;
|
|
6
|
+
getCloseLog: () => CloseLogEntry[];
|
|
7
|
+
}
|
|
8
|
+
export declare function usePanelCoordinator(): UsePanelCoordinatorReturn;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mt-gloss/ui/composites/panels — panel-system foundation.
|
|
3
|
+
*
|
|
4
|
+
* Consumers (reptime-cloud P1) import:
|
|
5
|
+
* import { PanelProvider, PanelHost } from '@mt-gloss/ui/composites/panels';
|
|
6
|
+
*
|
|
7
|
+
* Subpath export wired in package.json (F12); flat package-root artifact
|
|
8
|
+
* `composites-panels.js` matching existing `internals` + `catalog` pattern.
|
|
9
|
+
*/
|
|
10
|
+
export { PanelProvider, usePanelContext, usePanelContextOptional } from './PanelProvider';
|
|
11
|
+
export { PanelHost } from './PanelHost';
|
|
12
|
+
export { PanelChrome } from './PanelChrome';
|
|
13
|
+
export type { PanelHostProps, PanelShellProps } from './PanelHost';
|
|
14
|
+
export type { PanelProviderProps } from './PanelProvider';
|
|
15
|
+
export type { PanelChromeProps } from './PanelChrome';
|
|
16
|
+
export { usePanelCoordinator } from './hooks/usePanelCoordinator';
|
|
17
|
+
export type { UsePanelCoordinatorReturn } from './hooks/usePanelCoordinator';
|
|
18
|
+
export { reducer, initialState } from './coordinator/coordinator';
|
|
19
|
+
export { deriveSurfaceState } from './coordinator/deriveSurfaceState';
|
|
20
|
+
export { COMMITS } from './coordinator/COMMITS';
|
|
21
|
+
export type { PanelId, PanelState, PanelAction, CloseReason, SurfaceState, TriggerContext, SideEffect, CloseLogEntry, LockHint, } from './coordinator/types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mt-gloss/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.82",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
@@ -38,6 +38,17 @@
|
|
|
38
38
|
},
|
|
39
39
|
"default": "./catalog.js"
|
|
40
40
|
},
|
|
41
|
+
"./composites/panels": {
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./composites-panels.d.ts",
|
|
44
|
+
"default": "./composites-panels.js"
|
|
45
|
+
},
|
|
46
|
+
"require": {
|
|
47
|
+
"types": "./composites-panels.d.ts",
|
|
48
|
+
"default": "./composites-panels.js"
|
|
49
|
+
},
|
|
50
|
+
"default": "./composites-panels.js"
|
|
51
|
+
},
|
|
41
52
|
"./styles.css": "./ui.css"
|
|
42
53
|
},
|
|
43
54
|
"files": [
|