@mt-gloss/ui 0.1.136 → 0.1.138

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.
@@ -3,11 +3,16 @@
3
3
  * Called inside the SET_BUFFER_VALUE reducer case (coordinator.ts).
4
4
  * Unknown keys pass through unchanged (forward-compat).
5
5
  *
6
- * Post-M003-S002-CFG discriminated union (D-14):
7
- * timeframe → 30 (default), slots → []
6
+ * Fallback values per spike §6.1.4:
7
+ * threshold → 80, timeframe → 30, accent → null, slots → []
8
8
  *
9
- * @param key buffer-value key — 'timeframe' | 'slots' | any forward-compat string
10
- * @param value unknown
9
+ * Phase 17.2 additions:
10
+ * thresholdEnabled false, accentEnabled → false
11
+ *
12
+ * @param key buffer-value key (e.g. 'threshold', 'timeframe', 'accent',
13
+ * 'slots', 'thresholdEnabled', 'accentEnabled')
14
+ * @param value unknown — number (sliders), string (color hex), string[]
15
+ * (slots), or boolean (toggles)
11
16
  * @returns normalized value (clamped, parsed, or passthrough)
12
17
  */
13
18
  export declare function normalizeBufferValue(key: string, value: unknown): unknown;
@@ -10,8 +10,6 @@
10
10
  export { PanelProvider, usePanelContext, usePanelContextOptional } from './PanelProvider';
11
11
  export { useEditingCardId } from './hooks/useEditingCardId';
12
12
  export { SettingsShell } from './shells/SettingsShell';
13
- export { MetricInfoShell } from './shells/MetricInfoShell';
14
- export type { MetricInfoShellProps, MetricInfoBlock } from './shells/MetricInfoShell';
15
13
  export { NotificationCenterShell } from './shells/NotificationCenterShell';
16
14
  export { CatalogAddShell } from './shells/CatalogAddShell';
17
15
  export type { CatalogAddShellProps } from './shells/CatalogAddShell';
@@ -1,6 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  import { PanelShellProps } from '../PanelHost';
3
3
  import { SettingsDimension } from '../../../primitives/dashboard/SettingsTabStrip';
4
+ import { AccentSwatch } from './settings';
4
5
  export interface SettingsShellProps extends PanelShellProps {
5
6
  /** Span of the source card (1|2|3). Plumbed by V2FeedbackSurface HOF. */
6
7
  cardSpan?: 1 | 2 | 3;
@@ -36,29 +37,26 @@ export interface SettingsShellProps extends PanelShellProps {
36
37
  * - Re-opening the panel after Apply shows the saved value (not React default).
37
38
  * - Reset (CLEAR_BUFFER) reverts to the saved value (CC-19 semantics with persistence).
38
39
  *
39
- * Post-M003-S002-CFG display precedence per dimension:
40
+ * Display precedence per dimension:
40
41
  * 1. live buffer (`state.bufferByCard[cardId].changes[dim]`) — user mid-edit
41
42
  * 2. `initialValues[dim]` — last-applied baseline from localStorage
42
- * 3. React-default per spike §6.1.4 (timeframe=30, slots=['Orders','Quota','Unassigned'])
43
+ * 3. React-default per spike §6.1.4 (threshold=80, timeframe=30, accent=null, slots=['Orders','Quota','Unassigned'])
43
44
  *
44
- * Spike §6.1 documents the prototype's defaults; production persists
45
- * via D-10 COMMIT_BUFFER → usePreferences('metricConfig').
45
+ * Spike §6.1 documents the prototype's defaults (30/80). Production persists
46
+ * via D-10 COMMIT_BUFFER → usePreferences('metricConfig'); the seed-on-open
47
+ * round-trip closes the loop — without it the Apply'd value vanishes from the
48
+ * UI even though localStorage holds it.
46
49
  */
47
50
  initialValues?: Partial<{
51
+ threshold: number;
48
52
  timeframe: number;
53
+ accent: AccentSwatch;
49
54
  /** GAP-03 (sprint 2026-05-15): persisted slot order. Max 3, empty array valid. */
50
55
  slots: ReadonlyArray<string>;
56
+ /** Phase 17.2 Fix #2 — opt-in toggle for threshold overlay. Default false. */
57
+ thresholdEnabled: boolean;
58
+ /** Phase 17.2 Fix #2 — opt-in toggle for accent override. Default false. */
59
+ accentEnabled: boolean;
51
60
  }>;
52
- /**
53
- * M003-S005-SLT D-08 — Card's natural slot identifier list (registry data,
54
- * NOT user-persisted). SlotsControls renders ghost pills for naturalSlots
55
- * \ value so the user can re-add removed slots without Reset. Threaded by
56
- * reptime MetricSettingsPanel (cardNaturalSlots derivation at ~L222-237).
57
- *
58
- * Kept as a top-level prop rather than nested under initialValues because
59
- * `initialValues` is the *persisted-baseline* axis; naturalSlots is the
60
- * *registry-data* axis — different semantics (RESEARCH Finding 5).
61
- */
62
- naturalSlots?: ReadonlyArray<string>;
63
61
  }
64
- export declare function SettingsShell({ isOpen, cardSpan, cardLabel, cardValue, previewSlot, dimensions, initialTab, initialValues, naturalSlots, }: SettingsShellProps): import("react/jsx-runtime").JSX.Element;
62
+ export declare function SettingsShell({ isOpen, cardSpan, cardLabel, cardValue, previewSlot, dimensions, initialTab, initialValues, }: SettingsShellProps): import("react/jsx-runtime").JSX.Element;
@@ -3,8 +3,6 @@
3
3
  */
4
4
  export { SettingsShell } from './SettingsShell';
5
5
  export type { SettingsShellProps } from './SettingsShell';
6
- export { MetricInfoShell } from './MetricInfoShell';
7
- export type { MetricInfoShellProps, MetricInfoBlock } from './MetricInfoShell';
8
6
  export { CatalogAddShell } from './CatalogAddShell';
9
7
  export type { CatalogAddShellProps } from './CatalogAddShell';
10
8
  export { CatalogReplaceShell } from './CatalogReplaceShell';
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ declare const SWATCHES: readonly ["#1d6fd8", "#10b981", "#f59e0b", "#ef4444", "#8b5cf6"];
3
+ export type AccentSwatch = typeof SWATCHES[number];
4
+ export interface ColorControlsProps {
5
+ value: AccentSwatch | null;
6
+ onSelect: (hex: AccentSwatch) => void;
7
+ /** Phase 17.2 Fix #2 — opt-in toggle. Defaults false. */
8
+ enabled?: boolean;
9
+ /** Phase 17.2 Fix #2 — toggle dispatch (parent wires SET_BUFFER_VALUE 'accentEnabled'). */
10
+ onToggleEnabled?: (next: boolean) => void;
11
+ }
12
+ export declare function ColorControls({ value, onSelect, enabled, onToggleEnabled, }: ColorControlsProps): React.ReactElement;
13
+ export {};
@@ -2,10 +2,5 @@ import { default as React } from 'react';
2
2
  export interface SlotsControlsProps {
3
3
  value: ReadonlyArray<string>;
4
4
  onChange: (next: ReadonlyArray<string>) => void;
5
- /**
6
- * M003-S005-SLT D-08 — natural slot list from the card registry. Ghosts =
7
- * naturalSlots filtered to !value.includes. Default [].
8
- */
9
- naturalSlots?: ReadonlyArray<string>;
10
5
  }
11
- export declare function SlotsControls({ value, onChange, naturalSlots, }: SlotsControlsProps): React.ReactElement;
6
+ export declare function SlotsControls({ value, onChange }: SlotsControlsProps): React.ReactElement;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface ThresholdControlsProps {
3
+ value: number;
4
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
5
+ /** Phase 17.2 Fix #2 — opt-in toggle. Defaults false. */
6
+ enabled?: boolean;
7
+ /** Phase 17.2 Fix #2 — toggle dispatch (parent wires SET_BUFFER_VALUE 'thresholdEnabled'). */
8
+ onToggleEnabled?: (next: boolean) => void;
9
+ }
10
+ export declare function ThresholdControls({ value, onChange, enabled, onToggleEnabled, }: ThresholdControlsProps): React.ReactElement;
@@ -2,13 +2,11 @@
2
2
  * SettingsShell tab-body components. Each renders inside SettingsShell's role=tabpanel via React
3
3
  * conditional render (CC-15/16). Phase 16 D-08 keeps these co-located with SettingsShell — they are
4
4
  * not standalone primitives.
5
- *
6
- * M003-S002-CFG (2026-05-26): ThresholdControls + ColorControls removed per D-10 (per-metric-type
7
- * threshold + color deferred to later product conversation).
8
5
  */
6
+ export { ThresholdControls } from './ThresholdControls';
7
+ export type { ThresholdControlsProps } from './ThresholdControls';
9
8
  export { TimeframeControls } from './TimeframeControls';
10
9
  export type { TimeframeControlsProps } from './TimeframeControls';
11
10
  export { SlotsControls } from './SlotsControls';
12
- export type { SlotsControlsProps } from './SlotsControls';
13
- export { GhostSlotPill } from './GhostSlotPill';
14
- export type { GhostSlotPillProps } from './GhostSlotPill';
11
+ export { ColorControls } from './ColorControls';
12
+ export type { ColorControlsProps, AccentSwatch } from './ColorControls';
@@ -1,5 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface CloneStageProps {
3
3
  children: ReactNode;
4
+ /** D-06 — incrementing counter. Every change fires one spin via motion/react animate(). */
5
+ spinTrigger?: number;
6
+ /** D-07 — fires from animate().then() / .finished, NOT animationend DOM event. */
7
+ onSpinComplete?: () => void;
8
+ /** D-03 — total spin duration (ms). Default 500. */
9
+ spinDuration?: number;
10
+ /** D-02 — number of 360° rotations. Default 1. */
11
+ spinRotations?: number;
12
+ /** D-05 — CSS color for the transient theme accent overlay. */
13
+ accentColor?: string;
4
14
  }
5
- export declare function CloneStage({ children }: CloneStageProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function CloneStage({ children, spinTrigger, onSpinComplete, spinDuration, spinRotations, accentColor, }: CloneStageProps): import("react/jsx-runtime").JSX.Element;
@@ -8,8 +8,6 @@ export * from './typography';
8
8
  export * from './inputs';
9
9
  export * from './display';
10
10
  export * from './overlay';
11
- export * from './layout';
12
- export * from './feedback';
13
11
  export * from './data-display';
14
12
  export * from './composites';
15
13
  export * from './compositions';
@@ -30,6 +30,7 @@ export interface PresetMenuItemProps {
30
30
  as?: React.ElementType;
31
31
  icon?: React.ReactNode;
32
32
  children: React.ReactNode;
33
+ href?: string;
33
34
  }
34
35
  export declare const PresetMenuItem: {
35
36
  ({ ref, disabled, active, as, icon, children, ...rest }: PresetMenuItemProps & Omit<React.HTMLAttributes<HTMLElement>, "className" | "style"> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.136",
3
+ "version": "0.1.138",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"