@mt-gloss/ui 0.0.23 → 0.0.24
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/{Expandable-BYdvJg3S.js → Expandable-GaZcfHDZ.js} +2202 -2237
- package/catalog.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +960 -837
- package/lib/facade/data-display.d.ts +1 -1
- package/lib/primitives/dashboard/MetricCard/flipAndStage/types.d.ts +20 -0
- package/lib/primitives/dashboard/ReconfigBacksideButtons/ReconfigBacksideButtons.d.ts +13 -0
- package/lib/primitives/dashboard/ReconfigBacksideButtons/__tests__/fixtures/nyquist-10-matrix.d.ts +19 -0
- package/lib/primitives/dashboard/ReconfigBacksideButtons/index.d.ts +5 -0
- package/lib/primitives/dashboard/ReconfigBacksideButtons/types.d.ts +47 -0
- package/lib/primitives/dashboard/index.d.ts +1 -0
- package/lib/primitives/overlays/ActionStrip/__tests__/fixtures/nyquist-09-parity-matrix.d.ts +18 -0
- package/lib/primitives/overlays/ActionStrip/index.d.ts +1 -1
- package/lib/primitives/overlays/ActionStrip/types.d.ts +9 -11
- package/package.json +1 -1
- package/ui.css +1 -1
|
@@ -14,7 +14,7 @@ export type { MetricCardProps, CardShellProps } from '../primitives/dashboard/Me
|
|
|
14
14
|
export type { StackedGroupCardProps, StackedValueEntry } from '../primitives/dashboard/MetricCard/StackedGroupCard';
|
|
15
15
|
export type { CardBackProps } from '../primitives/dashboard/MetricCard/CardBack';
|
|
16
16
|
export { ActionStrip, buildDefaultOverflow } from '../primitives/overlays/ActionStrip';
|
|
17
|
-
export type { ActionStripProps, PrimaryAction, OverflowAction, ActionStripContext,
|
|
17
|
+
export type { ActionStripProps, PrimaryAction, OverflowAction, ActionStripContext, ActionStripMenuDirection, DefaultHandlers, } from '../primitives/overlays/ActionStrip';
|
|
18
18
|
export { SparklineBg } from '../primitives/dashboard/MetricCard';
|
|
19
19
|
export { BarsBg } from '../primitives/dashboard/MetricCard';
|
|
20
20
|
export { DonutChart } from '../primitives/dashboard/MetricCard';
|
|
@@ -36,6 +36,13 @@ export interface FlipAndStageInternalState {
|
|
|
36
36
|
activeCardId: string | null;
|
|
37
37
|
activeDimensionId: string | null;
|
|
38
38
|
dirtyState: Record<string, unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* Phase 17: which dimension section the overlay should render.
|
|
41
|
+
* `null` means no section is open. Independent of `state` — the overlay
|
|
42
|
+
* is only shown after an explicit setOpenSection() call; `cancelConfig()`
|
|
43
|
+
* and `commitConfig()` MUST null this out (per 17-UI-SPEC §Sequencing).
|
|
44
|
+
*/
|
|
45
|
+
openSection: string | null;
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
41
48
|
* The full value exposed by useFlipAndStage and FlipAndStageContext.
|
|
@@ -48,6 +55,8 @@ export interface FlipAndStageInternalState {
|
|
|
48
55
|
* - `commitConfig` — persist edits and return to idle; optional patch merged into dirty
|
|
49
56
|
* - `cancelConfig` — discard edits and return to idle
|
|
50
57
|
* - `setDirty` — merge additional edits into dirtyState
|
|
58
|
+
* - `openSection` — (Phase 17) which dimension section the overlay should render
|
|
59
|
+
* - `setOpenSection` — (Phase 17) mutate openSection; cancel/commit auto-null it
|
|
51
60
|
*/
|
|
52
61
|
export interface FlipAndStageValue {
|
|
53
62
|
activeCardId: string | null;
|
|
@@ -70,6 +79,17 @@ export interface FlipAndStageValue {
|
|
|
70
79
|
cancelConfig: () => void;
|
|
71
80
|
/** Merge additional dirty fields. Successive calls accumulate (not replace). */
|
|
72
81
|
setDirty: (patch: Record<string, unknown>) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Phase 17: which dimension section the overlay should render.
|
|
84
|
+
* `null` = no section open. Independent of `state` — the overlay is only
|
|
85
|
+
* rendered once a consumer explicitly calls `setOpenSection(id)`.
|
|
86
|
+
*/
|
|
87
|
+
openSection: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* Phase 17: mutate openSection. `cancelConfig()` and `commitConfig()` MUST
|
|
90
|
+
* null this out as part of their state reset (per 17-UI-SPEC §Sequencing).
|
|
91
|
+
*/
|
|
92
|
+
setOpenSection: (id: string | null) => void;
|
|
73
93
|
}
|
|
74
94
|
/**
|
|
75
95
|
* Options for useFlipAndStage.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ReconfigBacksideButtonsProps, ReconfigDimension } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Verbatim button labels per 17-UI-SPEC §Copywriting Contract.
|
|
5
|
+
* Exported as a const to make future localization extraction a single edit.
|
|
6
|
+
*/
|
|
7
|
+
declare const LABELS: Record<ReconfigDimension, string>;
|
|
8
|
+
/**
|
|
9
|
+
* ReconfigBacksideButtons — renders the type-picker button strip on a
|
|
10
|
+
* metric-card backside. See module doc for parent wiring contract.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ReconfigBacksideButtons: React.FC<ReconfigBacksideButtonsProps>;
|
|
13
|
+
export { LABELS as RECONFIG_BACKSIDE_LABELS };
|
package/lib/primitives/dashboard/ReconfigBacksideButtons/__tests__/fixtures/nyquist-10-matrix.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReconfigDimension } from '../../types';
|
|
2
|
+
export type Nyquist10Archetype = 'standard' | 'stacked-group' | 'order-status-stack';
|
|
3
|
+
export interface Nyquist10MatrixRow {
|
|
4
|
+
/** cardType the matrix row describes. */
|
|
5
|
+
cardType: Nyquist10Archetype;
|
|
6
|
+
/** Dimension under test (the backside button to click). */
|
|
7
|
+
dimension: ReconfigDimension;
|
|
8
|
+
/** All dimensions expected on the backside for this cardType. */
|
|
9
|
+
expectedBacksideDimensions: ReadonlyArray<ReconfigDimension>;
|
|
10
|
+
/** data-section-id that MUST be the sole rendered section post-click. */
|
|
11
|
+
expectedOverlaySectionId: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const NYQUIST_10_MATRIX: ReadonlyArray<Nyquist10MatrixRow>;
|
|
14
|
+
/** Row count pin consumed by the contract runner. */
|
|
15
|
+
export declare const NYQUIST_10_ROW_COUNT: number;
|
|
16
|
+
/** The 3 archetypes enumerated (stable order, useful for grouped describes). */
|
|
17
|
+
export declare const NYQUIST_10_ARCHETYPES: ReadonlyArray<Nyquist10Archetype>;
|
|
18
|
+
/** Matrix lookup — parity check against reptime's CARD_TYPE_DIMENSION_MATRIX. */
|
|
19
|
+
export declare const NYQUIST_10_DIMENSIONS_BY_CARD_TYPE: Readonly<Record<Nyquist10Archetype, ReadonlyArray<ReconfigDimension>>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 17, Plan 01: ReconfigBacksideButtons primitive — public type contracts.
|
|
3
|
+
*
|
|
4
|
+
* Renders the card-back type-picker strip (one button per configurable
|
|
5
|
+
* dimension). Buttons only — NO dropdowns, NO popovers. See 17-UI-SPEC
|
|
6
|
+
* §Backside type-picker button labels for the full spec.
|
|
7
|
+
*
|
|
8
|
+
* @module primitives/dashboard/ReconfigBacksideButtons/types
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The six configurable dimensions exposable on any metric card backside.
|
|
12
|
+
* Per-card-type matrix lives downstream in reptime (`CARD_TYPE_DIMENSION_MATRIX`).
|
|
13
|
+
*/
|
|
14
|
+
export type ReconfigDimension = 'timeframe' | 'threshold' | 'slots' | 'size' | 'color' | 'pinned';
|
|
15
|
+
/**
|
|
16
|
+
* Public props for ReconfigBacksideButtons.
|
|
17
|
+
*
|
|
18
|
+
* Minimal by design — no optional prop beyond these four. Parent wires
|
|
19
|
+
* onDimensionSelect to `flipAndStage.setOpenSection(dim)` + `flipToFace()`.
|
|
20
|
+
*/
|
|
21
|
+
export interface ReconfigBacksideButtonsProps {
|
|
22
|
+
/**
|
|
23
|
+
* Dimensions to render (order is preserved; empty array → component
|
|
24
|
+
* returns null — parent should avoid rendering at all for excluded types).
|
|
25
|
+
*/
|
|
26
|
+
dimensions: ReadonlyArray<ReconfigDimension>;
|
|
27
|
+
/**
|
|
28
|
+
* Fired on button click. Parent wires:
|
|
29
|
+
* flipAndStage.setOpenSection(dimension)
|
|
30
|
+
* flipAndStage.flipToFace()
|
|
31
|
+
* in that order.
|
|
32
|
+
*/
|
|
33
|
+
onDimensionSelect: (dimension: ReconfigDimension) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Highlights the active dimension with aria-current="true" + persisted
|
|
36
|
+
* hover tint. Used when re-entering the backside with a previously-
|
|
37
|
+
* launched overlay still in memory.
|
|
38
|
+
*/
|
|
39
|
+
activeDimension?: ReconfigDimension | null;
|
|
40
|
+
/**
|
|
41
|
+
* Screen-reader label substitution — rendered as
|
|
42
|
+
* `aria-label="Configure {ariaCardTypeLabel}: choose a dimension"` on root.
|
|
43
|
+
*/
|
|
44
|
+
ariaCardTypeLabel?: string;
|
|
45
|
+
/** Optional consumer-provided class appended to the BEM root class. */
|
|
46
|
+
className?: string;
|
|
47
|
+
}
|
|
@@ -7,6 +7,7 @@ export * from './UnifiedBreakdownTable';
|
|
|
7
7
|
export * from './ChartControlBar';
|
|
8
8
|
export * from './UnifiedContextMenu';
|
|
9
9
|
export * from './TimeFrame';
|
|
10
|
+
export * from './ReconfigBacksideButtons';
|
|
10
11
|
export * from './MetricCardGrid';
|
|
11
12
|
export * from './TabbedDataView';
|
|
12
13
|
export * from './MetricGroupContainer';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type FlipDir = 'up' | 'down';
|
|
2
|
+
export type Variant = 'default' | 'config';
|
|
3
|
+
export interface ParityHarness {
|
|
4
|
+
row: ParityRow;
|
|
5
|
+
}
|
|
6
|
+
export interface ParityRow {
|
|
7
|
+
behaviorId: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
8
|
+
behaviorLabel: string;
|
|
9
|
+
flip: FlipDir;
|
|
10
|
+
variant: Variant;
|
|
11
|
+
/** Skip reason (row still emits as `test.skip` so it is visible in vitest output). */
|
|
12
|
+
skip?: string;
|
|
13
|
+
/** Concrete assertion executed by `it.each` runner. */
|
|
14
|
+
assert: (harness: ParityHarness) => Promise<void> | void;
|
|
15
|
+
}
|
|
16
|
+
export declare const PARITY_MATRIX: ParityRow[];
|
|
17
|
+
/** Row count = 9 × 2 × 2 = 36. Exposed for assertion convenience in the runner. */
|
|
18
|
+
export declare const MATRIX_ROW_COUNT: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ActionStrip } from './ActionStrip';
|
|
2
|
-
export type { PrimaryAction, OverflowAction, ActionStripProps, ActionStripContext,
|
|
2
|
+
export type { PrimaryAction, OverflowAction, ActionStripProps, ActionStripContext, ActionStripMenuDirection, } from './types';
|
|
3
3
|
export { subscribe, getActive, setActive, resetForTests, } from './overflowMenuRegistry';
|
|
4
4
|
export { useSlideOutReveal } from './useSlideOutReveal';
|
|
5
5
|
export type { SlideOutRevealConfig, SlideOutRevealReturn, SlideOutRevealStyle, } from './useSlideOutReveal';
|
|
@@ -71,12 +71,16 @@ export interface OverflowAction {
|
|
|
71
71
|
visibleWhen?: (ctx: ActionStripContext) => boolean;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
74
|
+
* Menu-flip direction. Omit to let floating-ui's flip() middleware decide.
|
|
75
|
+
*
|
|
76
|
+
* AP-13 — the reconfig-surface pass-through variant was retired in Phase 17
|
|
77
|
+
* (plan 17-04): its type alias and Save / Cancel pass-through props were
|
|
78
|
+
* removed along with the render branch. Cancel / close now live in the
|
|
79
|
+
* Phase 17 overlay header, not inside ActionStrip. Only lingering references
|
|
80
|
+
* allowed in source: skip-marker strings in NYQUIST-09 parity-matrix fixtures
|
|
81
|
+
* under `__tests__/fixtures/`. Any resurrection in source is a regression and
|
|
82
|
+
* is blocked by `nyquist-10-ap-guards.test.ts` (AP-13 source-grep).
|
|
77
83
|
*/
|
|
78
|
-
export type ActionStripVariant = 'default' | 'config';
|
|
79
|
-
/** Menu-flip direction. Omit to let floating-ui's flip() middleware decide. */
|
|
80
84
|
export type ActionStripMenuDirection = 'up' | 'down';
|
|
81
85
|
/**
|
|
82
86
|
* Public ActionStrip prop contract. Stable across Phase 16 plans 16-01..05.
|
|
@@ -92,8 +96,6 @@ export interface ActionStripProps {
|
|
|
92
96
|
expanded: boolean;
|
|
93
97
|
/** Called to toggle `expanded`. */
|
|
94
98
|
onExpandedChange: (open: boolean) => void;
|
|
95
|
-
/** Defaults to 'default'. Phase 17 retires 'config'. */
|
|
96
|
-
variant?: ActionStripVariant;
|
|
97
99
|
/** CardBack collapse-to-Undo. Preserved behavior #5. */
|
|
98
100
|
isFlipped?: boolean;
|
|
99
101
|
/** Called when the Undo button is clicked while isFlipped. */
|
|
@@ -110,8 +112,4 @@ export interface ActionStripProps {
|
|
|
110
112
|
graphLabel?: string;
|
|
111
113
|
/** Consumer-overridable tooltip for the Details pinned button. */
|
|
112
114
|
detailsLabel?: string;
|
|
113
|
-
/** Config variant Save handler. Retired in Phase 17 — pass-through only this phase. */
|
|
114
|
-
onConfigSave?: () => void;
|
|
115
|
-
/** Config variant Cancel handler. Retired in Phase 17 — pass-through only this phase. */
|
|
116
|
-
onConfigCancel?: () => void;
|
|
117
115
|
}
|