@mt-gloss/ui 0.1.95 → 0.1.97
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/composites-panels.js +593 -189
- package/index.d.ts +6 -0
- package/index.js +1294 -1150
- package/lib/composites/dashboard/BellCutout/BellCutout.d.ts +11 -0
- package/lib/composites/dashboard/BellCutout/index.d.ts +2 -0
- package/lib/composites/dashboard/BellPopover/BellPopover.d.ts +12 -0
- package/lib/composites/dashboard/BellPopover/index.d.ts +2 -0
- package/lib/composites/dashboard/index.d.ts +2 -0
- package/lib/composites/index.d.ts +1 -0
- package/lib/composites/panels/coordinator/PANEL_IDS.d.ts +8 -0
- package/lib/composites/panels/index.d.ts +16 -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/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/portal/BodyPortal.d.ts +18 -0
- package/lib/composites/portal/index.d.ts +4 -0
- package/lib/composites/portal/usePortalAnchor.d.ts +17 -0
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export type BellCutoutMode = 'default' | 'lock' | 'unread-count';
|
|
3
|
+
export interface BellCutoutProps {
|
|
4
|
+
/** null → no chrome rendered. 'default' / 'lock' / 'unread-count' → chrome with corresponding data-mode. */
|
|
5
|
+
mode: BellCutoutMode | null;
|
|
6
|
+
/** When mode='unread-count', this drives the ::before count prefix via data-count. */
|
|
7
|
+
count?: number;
|
|
8
|
+
/** Anchor element to derive cutout circle center from. */
|
|
9
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
10
|
+
}
|
|
11
|
+
export declare function BellCutout(props: BellCutoutProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
export interface BellPopoverProps {
|
|
3
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onRequestClose: () => void;
|
|
6
|
+
/** Called when the cursor lands on the popover — used by host to cancel pending close. */
|
|
7
|
+
onPopoverEnter?: () => void;
|
|
8
|
+
/** Called when the cursor leaves the popover — used by host to reschedule close. */
|
|
9
|
+
onPopoverLeave?: () => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function BellPopover(props: BellPopoverProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -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';
|
|
@@ -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;
|
|
@@ -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[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { PortalPlacement } from './usePortalAnchor';
|
|
3
|
+
export interface BodyPortalProps {
|
|
4
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
5
|
+
placement: PortalPlacement;
|
|
6
|
+
gap?: number;
|
|
7
|
+
offset?: {
|
|
8
|
+
x?: number;
|
|
9
|
+
y?: number;
|
|
10
|
+
};
|
|
11
|
+
/** data-portal-host attribute value (UAT routing / DOM grep handle). */
|
|
12
|
+
dataHost: string;
|
|
13
|
+
/** Default true; pass false to detach without unmounting the host component. */
|
|
14
|
+
isOpen?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare function BodyPortal(props: BodyPortalProps): import('react').ReactPortal | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties, RefObject } from 'react';
|
|
2
|
+
export type PortalPlacement = 'above-right' | 'above-left' | 'below-right' | 'below-left';
|
|
3
|
+
export interface UsePortalAnchorArgs {
|
|
4
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
5
|
+
placement: PortalPlacement;
|
|
6
|
+
gap?: number;
|
|
7
|
+
offset?: {
|
|
8
|
+
x?: number;
|
|
9
|
+
y?: number;
|
|
10
|
+
};
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface AnchorStyle {
|
|
14
|
+
style: CSSProperties;
|
|
15
|
+
}
|
|
16
|
+
export declare function usePortalAnchor(args: UsePortalAnchorArgs): AnchorStyle;
|
|
17
|
+
export {};
|