@mt-gloss/ui 0.1.94 → 0.1.96
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/{COMMITS-DAem0P4s.js → COMMITS-By42AA8m.js} +93 -77
- package/composites-panels.js +659 -82
- package/index.js +1 -1
- package/lib/composites/panels/asserter/domWalkAsserter.d.ts +17 -0
- package/lib/composites/panels/coordinator/PANEL_IDS.d.ts +8 -0
- package/lib/composites/panels/hooks/useTransitionToPanel.d.ts +2 -0
- package/lib/composites/panels/index.d.ts +25 -0
- package/lib/composites/panels/orchestrator/transitionToPanel.d.ts +21 -0
- package/lib/composites/panels/shells/CatalogAddShell.d.ts +19 -0
- package/lib/composites/panels/shells/CatalogReplaceShell.d.ts +13 -0
- package/lib/composites/panels/shells/PageMgmtShell.d.ts +10 -0
- package/lib/composites/panels/shells/SettingsShell.d.ts +9 -1
- package/lib/composites/panels/shells/index.d.ts +15 -0
- package/lib/composites/panels/shells/internals/CatalogFooter.d.ts +18 -0
- package/lib/composites/panels/shells/internals/CatalogLensPicker.d.ts +6 -0
- package/lib/composites/panels/shells/internals/CatalogTileGrid.d.ts +17 -0
- package/lib/composites/panels/shells/internals/PageMgmtFooter.d.ts +16 -0
- package/lib/composites/panels/shells/internals/PageMgmtRow.d.ts +8 -0
- package/lib/composites/panels/shells/internals/catalog-mocks.d.ts +20 -0
- package/lib/composites/panels/shells/internals/page-mgmt-mocks.d.ts +12 -0
- package/lib/composites/panels/stage3d/CloneCard.d.ts +7 -0
- package/lib/composites/panels/stage3d/CloneStage.d.ts +5 -0
- package/package.json +1 -1
- package/ui.css +1 -1
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import F, { useRef as P, useEffect as A, useState as E, useCallback as C, useId
|
|
|
6
6
|
import { motion as G, useMotionValue as tt, AnimatePresence as at, useDragControls as nt } from "framer-motion";
|
|
7
7
|
import { B as rt, a as X, b as ce, U as fe } from "./UIContext-DP6JGCto.js";
|
|
8
8
|
import { c as Wo, u as Vo } from "./UIContext-DP6JGCto.js";
|
|
9
|
-
import { C as Uo, c as Yo, b as Zo, P as qo, e as Qo, i as Xo, r as Jo, u as el, a as tl, d as al } from "./COMMITS-
|
|
9
|
+
import { C as Uo, c as Yo, b as Zo, P as qo, e as Qo, i as Xo, r as Jo, u as el, a as tl, d as al } from "./COMMITS-By42AA8m.js";
|
|
10
10
|
import { createPortal as st } from "react-dom";
|
|
11
11
|
import { DEFAULT_MARKET_PRESETS as rl, DEFAULT_PINNED as sl, PERIOD_OPTIONS as il, ROLLING_OPTIONS as ol, TODAY_PRESET as ll, findPreset as cl, formatDateRange as dl, formatMarketDates as ul, formatTrend as ml, formatValue as gl, generateMarketId as pl, getAllPresets as hl, getDateRangeForPreset as fl, getPresetLabel as bl, isInRange as vl, isMarketActive as yl, isSameDay as wl, normalizePresetId as _l, toUppercasePresetId as Cl } from "@mt-gloss/utils";
|
|
12
12
|
import it from "@mui/icons-material/AccessTime";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AssertReport } from '../orchestrator/transitionToPanel';
|
|
2
|
+
export type { AssertReport };
|
|
3
|
+
/**
|
|
4
|
+
* Pure DOM-walk — exported separately for tests + external callers that want a
|
|
5
|
+
* one-shot probe without flipping the global flag.
|
|
6
|
+
*/
|
|
7
|
+
export declare function assertPanelDomShape(): AssertReport;
|
|
8
|
+
/**
|
|
9
|
+
* Enable the Q12-12 asserter. First call assigns `window.__panelsAsserter`
|
|
10
|
+
* (only on first enable — avoids repeated reassignment per Rule 29).
|
|
11
|
+
*/
|
|
12
|
+
export declare function enablePanelAsserter(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Disable the asserter. Keeps `lastReport` accessible (test 8 invariant) and
|
|
15
|
+
* keeps the window surface attached so future enable() calls don't reassign.
|
|
16
|
+
*/
|
|
17
|
+
export declare function disablePanelAsserter(): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PANEL_IDS: {
|
|
2
|
+
readonly SETTINGS: "settings";
|
|
3
|
+
readonly CATALOG_ADD: "catalog-add";
|
|
4
|
+
readonly CATALOG_REPLACE: "catalog-replace";
|
|
5
|
+
readonly PAGE_MGMT: "page-management";
|
|
6
|
+
readonly NOTIFICATION_CENTER: "notification-center";
|
|
7
|
+
};
|
|
8
|
+
export type PanelIdKey = keyof typeof PANEL_IDS;
|
|
@@ -9,6 +9,22 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export { PanelProvider, usePanelContext, usePanelContextOptional } from './PanelProvider';
|
|
11
11
|
export { SettingsShell } from './shells/SettingsShell';
|
|
12
|
+
export { CatalogAddShell } from './shells/CatalogAddShell';
|
|
13
|
+
export type { CatalogAddShellProps } from './shells/CatalogAddShell';
|
|
14
|
+
export { CatalogReplaceShell } from './shells/CatalogReplaceShell';
|
|
15
|
+
export type { CatalogReplaceShellProps } from './shells/CatalogReplaceShell';
|
|
16
|
+
export { PageMgmtShell } from './shells/PageMgmtShell';
|
|
17
|
+
export type { PageMgmtShellProps } from './shells/PageMgmtShell';
|
|
18
|
+
export { CatalogFooter, CatalogStateContext, useCatalogState, } from './shells/internals/CatalogFooter';
|
|
19
|
+
export type { CatalogFooterMode, CatalogState, CatalogFooterProps, } from './shells/internals/CatalogFooter';
|
|
20
|
+
export { PageMgmtFooter, PageMgmtStateContext, usePageMgmtState, } from './shells/internals/PageMgmtFooter';
|
|
21
|
+
export type { PageMgmtState, PageMgmtFooterProps, } from './shells/internals/PageMgmtFooter';
|
|
22
|
+
export type { CatalogTile } from './shells/internals/catalog-mocks';
|
|
23
|
+
export { MOCK_LENSES, MOCK_DEFAULT_LENS, MOCK_TILES_BY_LENS, } from './shells/internals/catalog-mocks';
|
|
24
|
+
export type { PageEntry } from './shells/internals/page-mgmt-mocks';
|
|
25
|
+
export { MOCK_PAGES } from './shells/internals/page-mgmt-mocks';
|
|
26
|
+
export { PANEL_IDS } from './coordinator/PANEL_IDS';
|
|
27
|
+
export type { PanelIdKey } from './coordinator/PANEL_IDS';
|
|
12
28
|
export { PanelHost } from './PanelHost';
|
|
13
29
|
export { PanelHostShell } from './PanelHostShell';
|
|
14
30
|
export { PanelSlot } from './PanelSlot';
|
|
@@ -21,6 +37,15 @@ export { positionKey } from './utils/positionKey';
|
|
|
21
37
|
export { useReducedMotionPanel } from './hooks/useReducedMotionPanel';
|
|
22
38
|
export { PanelMount } from './PanelMount';
|
|
23
39
|
export type { PanelMountProps } from './PanelMount';
|
|
40
|
+
export { transitionToPanel } from './orchestrator/transitionToPanel';
|
|
41
|
+
export type { TransitionToPanelArgs, AssertReport } from './orchestrator/transitionToPanel';
|
|
42
|
+
export { useTransitionToPanel } from './hooks/useTransitionToPanel';
|
|
43
|
+
export { CloneStage } from './stage3d/CloneStage';
|
|
44
|
+
export type { CloneStageProps } from './stage3d/CloneStage';
|
|
45
|
+
export { CloneCard } from './stage3d/CloneCard';
|
|
46
|
+
export type { CloneCardProps } from './stage3d/CloneCard';
|
|
47
|
+
export { enablePanelAsserter, disablePanelAsserter, assertPanelDomShape, } from './asserter/domWalkAsserter';
|
|
48
|
+
export type { SettingsShellProps } from './shells/SettingsShell';
|
|
24
49
|
export { usePanelCoordinator } from './hooks/usePanelCoordinator';
|
|
25
50
|
export type { UsePanelCoordinatorReturn } from './hooks/usePanelCoordinator';
|
|
26
51
|
export { reducer, initialState } from './coordinator/coordinator';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PanelAction, PanelId, PanelState, TriggerContext } from '../coordinator/types';
|
|
2
|
+
export interface AssertReport {
|
|
3
|
+
valid?: boolean;
|
|
4
|
+
mount?: 'present' | 'absent';
|
|
5
|
+
chrome?: 'present' | 'absent';
|
|
6
|
+
frozen?: 'cleaned' | 'lingering';
|
|
7
|
+
orphans?: string[];
|
|
8
|
+
branch?: string;
|
|
9
|
+
timestamp?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface TransitionToPanelArgs {
|
|
12
|
+
panelId: PanelId;
|
|
13
|
+
trigger: TriggerContext;
|
|
14
|
+
state: PanelState;
|
|
15
|
+
dispatch: (action: PanelAction) => void;
|
|
16
|
+
mountEl: HTMLElement | null;
|
|
17
|
+
chromeEl: HTMLElement | null;
|
|
18
|
+
reducedMotion: boolean;
|
|
19
|
+
onAssert?: (report: AssertReport) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function transitionToPanel(args: TransitionToPanelArgs): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PanelShellProps } from '../PanelHost';
|
|
3
|
+
import { CatalogTile } from './internals/catalog-mocks';
|
|
4
|
+
export interface CatalogAddShellProps extends PanelShellProps {
|
|
5
|
+
/** Available lenses; defaults to MOCK_LENSES (spike §6.2.5). */
|
|
6
|
+
lenses?: readonly string[];
|
|
7
|
+
/** Initial active lens; defaults to MOCK_DEFAULT_LENS ('Order flow'). */
|
|
8
|
+
defaultLens?: string;
|
|
9
|
+
/** Tile catalog keyed by lens; defaults to MOCK_TILES_BY_LENS. */
|
|
10
|
+
tilesByLens?: Readonly<Record<string, readonly CatalogTile[]>>;
|
|
11
|
+
/**
|
|
12
|
+
* Optional footer slot rendered as a SIBLING of the body, INSIDE the shell's
|
|
13
|
+
* CatalogStateContext.Provider. PanelSlot passes <CatalogFooter/> here so it
|
|
14
|
+
* can read live selectedTileId/description from this shell instance.
|
|
15
|
+
* Standalone tests (no PanelSlot) leave undefined → no footer.
|
|
16
|
+
*/
|
|
17
|
+
footerSlot?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function CatalogAddShell({ isOpen, lenses, defaultLens, tilesByLens, footerSlot, }: CatalogAddShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PanelShellProps } from '../PanelHost';
|
|
3
|
+
import { CatalogTile } from './internals/catalog-mocks';
|
|
4
|
+
export interface CatalogReplaceShellProps extends PanelShellProps {
|
|
5
|
+
/** Label of the card being replaced; rendered as 'replacing {label}' subtitle. */
|
|
6
|
+
replacingLabel?: string;
|
|
7
|
+
lenses?: readonly string[];
|
|
8
|
+
defaultLens?: string;
|
|
9
|
+
tilesByLens?: Readonly<Record<string, readonly CatalogTile[]>>;
|
|
10
|
+
/** See CatalogAddShellProps.footerSlot — sibling slot inside Provider. */
|
|
11
|
+
footerSlot?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function CatalogReplaceShell({ isOpen, replacingLabel, lenses, defaultLens, tilesByLens, footerSlot, }: CatalogReplaceShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PanelShellProps } from '../PanelHost';
|
|
3
|
+
import { PageEntry } from './internals/page-mgmt-mocks';
|
|
4
|
+
export interface PageMgmtShellProps extends PanelShellProps {
|
|
5
|
+
/** Initial page list; defaults to MOCK_PAGES (§6.4.3 verbatim). */
|
|
6
|
+
pages?: readonly PageEntry[];
|
|
7
|
+
/** See CatalogAddShellProps.footerSlot — sibling slot inside Provider. */
|
|
8
|
+
footerSlot?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function PageMgmtShell({ isOpen, pages: initialPages, footerSlot, }: PageMgmtShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { PanelShellProps } from '../PanelHost';
|
|
2
|
-
export
|
|
2
|
+
export interface SettingsShellProps extends PanelShellProps {
|
|
3
|
+
/** Span of the source card (1|2|3). Plumbed by V2FeedbackSurface HOF. */
|
|
4
|
+
cardSpan?: 1 | 2 | 3;
|
|
5
|
+
/** Visible label on the clone card. Defaults to 'Metric'. */
|
|
6
|
+
cardLabel?: string;
|
|
7
|
+
/** Visible value on the clone card. Defaults to '—'. */
|
|
8
|
+
cardValue?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function SettingsShell({ isOpen, cardSpan, cardLabel, cardValue, }: SettingsShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,3 +2,18 @@
|
|
|
2
2
|
* Panel shells barrel — all shells available from '@mt-gloss/ui/composites/panels'.
|
|
3
3
|
*/
|
|
4
4
|
export { SettingsShell } from './SettingsShell';
|
|
5
|
+
export type { SettingsShellProps } from './SettingsShell';
|
|
6
|
+
export { CatalogAddShell } from './CatalogAddShell';
|
|
7
|
+
export type { CatalogAddShellProps } from './CatalogAddShell';
|
|
8
|
+
export { CatalogReplaceShell } from './CatalogReplaceShell';
|
|
9
|
+
export type { CatalogReplaceShellProps } from './CatalogReplaceShell';
|
|
10
|
+
export { PageMgmtShell } from './PageMgmtShell';
|
|
11
|
+
export type { PageMgmtShellProps } from './PageMgmtShell';
|
|
12
|
+
export { PageMgmtFooter, PageMgmtStateContext, usePageMgmtState } from './internals/PageMgmtFooter';
|
|
13
|
+
export type { PageMgmtState, PageMgmtFooterProps } from './internals/PageMgmtFooter';
|
|
14
|
+
export { MOCK_PAGES } from './internals/page-mgmt-mocks';
|
|
15
|
+
export type { PageEntry } from './internals/page-mgmt-mocks';
|
|
16
|
+
export { CatalogFooter, CatalogStateContext, useCatalogState } from './internals/CatalogFooter';
|
|
17
|
+
export type { CatalogFooterMode, CatalogState, CatalogFooterProps } from './internals/CatalogFooter';
|
|
18
|
+
export type { CatalogTile } from './internals/catalog-mocks';
|
|
19
|
+
export { MOCK_LENSES, MOCK_DEFAULT_LENS, MOCK_TILES_BY_LENS } from './internals/catalog-mocks';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PanelAction } from '../../coordinator/types';
|
|
2
|
+
export type CatalogFooterMode = 'add' | 'replace';
|
|
3
|
+
export interface CatalogState {
|
|
4
|
+
mode: CatalogFooterMode;
|
|
5
|
+
selectedTileId: string | null;
|
|
6
|
+
description: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const CatalogStateContext: import('react').Context<CatalogState | null>;
|
|
9
|
+
export declare function useCatalogState(): CatalogState | null;
|
|
10
|
+
export interface CatalogFooterProps {
|
|
11
|
+
/**
|
|
12
|
+
* Override mode if needed (rare — usually the context's `mode` wins). PanelSlot
|
|
13
|
+
* passes mode explicitly for safety when no context Provider is mounted.
|
|
14
|
+
*/
|
|
15
|
+
mode?: CatalogFooterMode;
|
|
16
|
+
dispatch: (action: PanelAction) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function CatalogFooter({ mode, dispatch }: CatalogFooterProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CatalogLensPickerProps {
|
|
2
|
+
lenses: readonly string[];
|
|
3
|
+
activeLens: string;
|
|
4
|
+
onLensChange: (lens: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function CatalogLensPicker({ lenses, activeLens, onLensChange }: CatalogLensPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CatalogTile } from './catalog-mocks';
|
|
2
|
+
export interface CatalogTileGridProps {
|
|
3
|
+
tiles: readonly CatalogTile[];
|
|
4
|
+
selectedTileId: string | null;
|
|
5
|
+
onSelectTile: (id: string, desc: string) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* §6.2.8 — stack-tile value renderer. Splits a "LABEL N · LABEL N · LABEL N"
|
|
9
|
+
* (or "N today · N MTD · …") value string into per-segment React nodes.
|
|
10
|
+
* Each segment becomes `<span><strong>{num}</strong><small>{lbl}</small></span>`
|
|
11
|
+
* with the numeric token first (W2-G6 enforces strong+small+split present).
|
|
12
|
+
*
|
|
13
|
+
* The regex captures the leading numeric/currency/percent token; the remainder
|
|
14
|
+
* is the label. If the segment has no number, the whole text falls into <small>.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderStackValue(val: string): import("react/jsx-runtime").JSX.Element[];
|
|
17
|
+
export declare function CatalogTileGrid({ tiles, selectedTileId, onSelectTile }: CatalogTileGridProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PageEntry } from './page-mgmt-mocks';
|
|
2
|
+
export interface PageMgmtState {
|
|
3
|
+
pages: PageEntry[];
|
|
4
|
+
setPages: (updater: (prev: PageEntry[]) => PageEntry[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const PageMgmtStateContext: import('react').Context<PageMgmtState | null>;
|
|
7
|
+
export declare function usePageMgmtState(): PageMgmtState | null;
|
|
8
|
+
export interface PageMgmtFooterProps {
|
|
9
|
+
/**
|
|
10
|
+
* Optional dispatch — unused by footer per §6.4.6 (live-commit; no CLOSE_PANEL).
|
|
11
|
+
* Kept on the prop signature so PanelSlot can pass it uniformly with other
|
|
12
|
+
* footers without TS errors.
|
|
13
|
+
*/
|
|
14
|
+
dispatch?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare function PageMgmtFooter(_?: PageMgmtFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PageEntry } from './page-mgmt-mocks';
|
|
2
|
+
export interface PageMgmtRowProps {
|
|
3
|
+
page: PageEntry;
|
|
4
|
+
onRename?: (id: string) => void;
|
|
5
|
+
onKebab?: (id: string) => void;
|
|
6
|
+
onDragStart?: (id: string) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function PageMgmtRow({ page, onRename, onKebab, onDragStart }: PageMgmtRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog panel mock data — Phase 11.5 P4 W2.
|
|
3
|
+
*
|
|
4
|
+
* Module-level constants; no fetch, no PII. Spike-verbatim §6.2.5 lens list +
|
|
5
|
+
* §6.2.7 tile model. Tiles per lens are illustrative (≥4 each; ≥1 stack under
|
|
6
|
+
* 'Order flow' to exercise `.span-2` + renderStackValue per §6.2.8).
|
|
7
|
+
*
|
|
8
|
+
* Real BFF binding will replace this seam in a future plan (P-N).
|
|
9
|
+
*/
|
|
10
|
+
export interface CatalogTile {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
stack?: boolean;
|
|
15
|
+
desc: string;
|
|
16
|
+
variants?: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare const MOCK_LENSES: readonly string[];
|
|
19
|
+
export declare const MOCK_DEFAULT_LENS = "Order flow";
|
|
20
|
+
export declare const MOCK_TILES_BY_LENS: Readonly<Record<string, readonly CatalogTile[]>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Page Mgmt mock data — Phase 11.5 P4 W4.
|
|
3
|
+
*
|
|
4
|
+
* Spike §6.4.3 verbatim: 4 entries with My Pipeline as the active page.
|
|
5
|
+
* Real BFF binding will replace this seam in a future plan (P-N).
|
|
6
|
+
*/
|
|
7
|
+
export interface PageEntry {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
active: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const MOCK_PAGES: readonly PageEntry[];
|