@mt-gloss/ui 0.1.103 → 0.1.105

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/index.js CHANGED
@@ -5,11 +5,11 @@ import * as B from "react";
5
5
  import F, { useRef as P, useEffect as A, useState as I, useCallback as N, useId as Je, forwardRef as et, useMemo as re, useLayoutEffect as Ie, createContext as tt, useContext as at } from "react";
6
6
  import { motion as G, useMotionValue as nt, AnimatePresence as rt, useDragControls as st } from "framer-motion";
7
7
  import { createPortal as Ee } from "react-dom";
8
- import { u as it } from "./COMMITS-Dm8qIHaq.js";
9
- import { C as Jo, c as el, b as tl, P as al, e as nl, i as rl, r as sl, a as il, d as ol } from "./COMMITS-Dm8qIHaq.js";
8
+ import { u as it } from "./COMMITS-kaUvc5jL.js";
9
+ import { C as Jo, c as el, b as tl, P as al, S as nl, e as rl, i as sl, r as il, a as ol, d as ll } from "./COMMITS-kaUvc5jL.js";
10
10
  import { B as ot, a as X, b as ce, U as fe } from "./UIContext-DP6JGCto.js";
11
- import { c as cl, u as dl } from "./UIContext-DP6JGCto.js";
12
- import { DEFAULT_MARKET_PRESETS as ml, DEFAULT_PINNED as pl, PERIOD_OPTIONS as gl, ROLLING_OPTIONS as hl, TODAY_PRESET as fl, findPreset as bl, formatDateRange as vl, formatMarketDates as yl, formatTrend as wl, formatValue as _l, generateMarketId as Cl, getAllPresets as Nl, getDateRangeForPreset as Sl, getPresetLabel as kl, isInRange as Dl, isMarketActive as xl, isSameDay as Rl, normalizePresetId as Tl, toUppercasePresetId as Ml } from "@mt-gloss/utils";
11
+ import { c as dl, u as ul } from "./UIContext-DP6JGCto.js";
12
+ import { DEFAULT_MARKET_PRESETS as pl, DEFAULT_PINNED as gl, PERIOD_OPTIONS as hl, ROLLING_OPTIONS as fl, TODAY_PRESET as bl, findPreset as vl, formatDateRange as yl, formatMarketDates as wl, formatTrend as _l, formatValue as Cl, generateMarketId as Nl, getAllPresets as Sl, getDateRangeForPreset as kl, getPresetLabel as Dl, isInRange as xl, isMarketActive as Rl, isSameDay as Tl, normalizePresetId as Ml, toUppercasePresetId as Pl } from "@mt-gloss/utils";
13
13
  import lt from "@mui/icons-material/AccessTime";
14
14
  import ct from "@mui/icons-material/Tune";
15
15
  import dt from "@mui/icons-material/ViewColumn";
@@ -4837,9 +4837,9 @@ export {
4837
4837
  Ss as CreditCardForm,
4838
4838
  ks as DEFAULT_FOOTER_IDS,
4839
4839
  U as DEFAULT_GRID_INTERACTION_PHYSICS,
4840
- ml as DEFAULT_MARKET_PRESETS,
4840
+ pl as DEFAULT_MARKET_PRESETS,
4841
4841
  Ds as DEFAULT_OVERFLOW_IDS,
4842
- pl as DEFAULT_PINNED,
4842
+ gl as DEFAULT_PINNED,
4843
4843
  Nt as DEFAULT_RESIZE_PHYSICS,
4844
4844
  Ae as DEFAULT_RESIZE_PILL_PHYSICS,
4845
4845
  xs as DataTable,
@@ -4912,7 +4912,7 @@ export {
4912
4912
  Ci as ObjectArrow,
4913
4913
  Ni as OrderFilterBar,
4914
4914
  Jo as PANEL_COMMITS,
4915
- gl as PERIOD_OPTIONS,
4915
+ hl as PERIOD_OPTIONS,
4916
4916
  gr as PaceCard,
4917
4917
  hr as PaceTilePreview,
4918
4918
  Ft as PageChip,
@@ -4930,7 +4930,7 @@ export {
4930
4930
  Mi as ProgressCard,
4931
4931
  Pi as QuickConfigPanel,
4932
4932
  Gt as RECONFIG_BACKSIDE_LABELS,
4933
- hl as ROLLING_OPTIONS,
4933
+ fl as ROLLING_OPTIONS,
4934
4934
  Ii as Radio,
4935
4935
  Ei as RadioGroup,
4936
4936
  Ai as RangeSlider,
@@ -4958,6 +4958,7 @@ export {
4958
4958
  Ki as SegmentedControl,
4959
4959
  Gi as Select,
4960
4960
  Hi as Selectable,
4961
+ nl as SettingsTabStrip,
4961
4962
  te as SeverityDot,
4962
4963
  Wi as SimpleMetricCard,
4963
4964
  Vi as SimpleSelector,
@@ -4979,7 +4980,7 @@ export {
4979
4980
  _t as StatusSlotChipMenu,
4980
4981
  ao as Stepper,
4981
4982
  De as SwingReveal,
4982
- fl as TODAY_PRESET,
4983
+ bl as TODAY_PRESET,
4983
4984
  V as TUNING_DEFAULTS,
4984
4985
  Ge as TUNING_STORAGE_KEY,
4985
4986
  no as TabGroup,
@@ -4997,7 +4998,7 @@ export {
4997
4998
  po as TransitionGroup,
4998
4999
  go as TrendCard,
4999
5000
  ho as TrendIndicator,
5000
- cl as UIContext,
5001
+ dl as UIContext,
5001
5002
  fe as UIContextProvider,
5002
5003
  fo as UnifiedBreakdownTable,
5003
5004
  bo as UnifiedContextMenu,
@@ -5034,26 +5035,26 @@ export {
5034
5035
  Mt as errorFixture,
5035
5036
  Ro as evaluateTintCondition,
5036
5037
  On as filteredState,
5037
- bl as findPreset,
5038
- vl as formatDateRange,
5039
- yl as formatMarketDates,
5040
- wl as formatTrend,
5041
- _l as formatValue,
5038
+ vl as findPreset,
5039
+ yl as formatDateRange,
5040
+ wl as formatMarketDates,
5041
+ _l as formatTrend,
5042
+ Cl as formatValue,
5042
5043
  qn as fullLayout,
5043
- Cl as generateMarketId,
5044
+ Nl as generateMarketId,
5044
5045
  To as generateTabId,
5045
- Nl as getAllPresets,
5046
- Sl as getDateRangeForPreset,
5046
+ Sl as getAllPresets,
5047
+ kl as getDateRangeForPreset,
5047
5048
  Mo as getMenuActions,
5048
5049
  He as getMotionMode,
5049
- kl as getPresetLabel,
5050
+ Dl as getPresetLabel,
5050
5051
  Po as getTransitionStyle,
5051
5052
  Un as gridCards,
5052
5053
  fr as gridChannels,
5053
5054
  Io as interpolate,
5054
- Dl as isInRange,
5055
- xl as isMarketActive,
5056
- Rl as isSameDay,
5055
+ xl as isInRange,
5056
+ Rl as isMarketActive,
5057
+ Tl as isSameDay,
5057
5058
  Fn as itemColumns,
5058
5059
  En as itemRows,
5059
5060
  Tt as loadingFixture,
@@ -5065,7 +5066,7 @@ export {
5065
5066
  Oo as mergeRefs,
5066
5067
  pn as metricTabGroup,
5067
5068
  Xn as mixedTabs,
5068
- Tl as normalizePresetId,
5069
+ Ml as normalizePresetId,
5069
5070
  Kt as numericActions,
5070
5071
  An as orderColumns,
5071
5072
  Bt as orderIdActions,
@@ -5073,9 +5074,9 @@ export {
5073
5074
  Qn as ordersTabs,
5074
5075
  Me as paletteHex,
5075
5076
  j as paletteVars,
5076
- nl as panelsDeriveSurfaceState,
5077
- rl as panelsInitialState,
5078
- sl as panelsReducer,
5077
+ rl as panelsDeriveSurfaceState,
5078
+ sl as panelsInitialState,
5079
+ il as panelsReducer,
5079
5080
  Lo as parseNumericValue,
5080
5081
  $o as paymentFormMetadata,
5081
5082
  zo as paymentSchema,
@@ -5108,7 +5109,7 @@ export {
5108
5109
  wn as tableSamples,
5109
5110
  bn as textSamples,
5110
5111
  hn as timeFrameTabGroup,
5111
- Ml as toUppercasePresetId,
5112
+ Pl as toUppercasePresetId,
5112
5113
  Qe as useAffordanceVisibility,
5113
5114
  un as useArrowNavigation,
5114
5115
  Ho as useCheckboxGroupContext,
@@ -5120,14 +5121,14 @@ export {
5120
5121
  Yo as useFocusTrap,
5121
5122
  Zo as useFormContext,
5122
5123
  qo as useGestureState,
5123
- il as usePanelContext,
5124
+ ol as usePanelContext,
5124
5125
  it as usePanelContextOptional,
5125
- ol as usePanelCoordinator,
5126
+ ll as usePanelCoordinator,
5126
5127
  Ia as usePortalAnchor,
5127
5128
  Qo as useRadioGroupContext,
5128
5129
  Dr as useResizeChoreography,
5129
5130
  Nn as useResizePill,
5130
5131
  qt as useResizeTuning,
5131
5132
  Ba as useSortableZones,
5132
- dl as useUIContext
5133
+ ul as useUIContext
5133
5134
  };
@@ -1,7 +1,18 @@
1
- import { ComponentType } from 'react';
1
+ import { ComponentType, ReactNode } from 'react';
2
2
  import { PanelId } from './coordinator/types';
3
3
  import { PanelShellProps } from './PanelHost';
4
4
  export interface PanelSlotProps {
5
- panelComponents: Partial<Record<PanelId, ComponentType<PanelShellProps>>>;
5
+ /**
6
+ * Production usage: per-panelId component map. Resolved against state.activePanelId
7
+ * to pick the shell.
8
+ */
9
+ panelComponents?: Partial<Record<PanelId, ComponentType<PanelShellProps>>>;
10
+ /**
11
+ * Phase 16 P4 — test-friendly children fallback. When `panelComponents` is omitted,
12
+ * PanelSlot renders `children` inside the standard PanelChrome wrap so unit tests
13
+ * can render a specific shell (e.g. SettingsShell) directly without registering a
14
+ * full per-panelId map. Production callers continue to pass `panelComponents`.
15
+ */
16
+ children?: ReactNode;
6
17
  }
7
- export declare function PanelSlot({ panelComponents }: PanelSlotProps): import("react/jsx-runtime").JSX.Element | null;
18
+ export declare function PanelSlot({ panelComponents, children }: PanelSlotProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Normalizes a buffer value for a given key before writing to bufferByCard.
3
+ * Called inside the SET_BUFFER_VALUE reducer case (coordinator.ts).
4
+ * Unknown keys pass through unchanged (forward-compat).
5
+ *
6
+ * Fallback values per spike §6.1.4:
7
+ * threshold → 80, timeframe → 30, accent → null
8
+ *
9
+ * @param key buffer-value key (e.g. 'threshold', 'timeframe', 'accent', 'slots')
10
+ * @param value unknown — usually number (sliders) or string (color hex)
11
+ * @returns normalized value (clamped, parsed, or passthrough)
12
+ */
13
+ export declare function normalizeBufferValue(key: string, value: unknown): unknown;
@@ -43,6 +43,11 @@ export type TriggerContext = {
43
43
  kind: 'manage-pages-action';
44
44
  global: true;
45
45
  align: 'left';
46
+ } | {
47
+ kind: 'layout-action-blocked';
48
+ action: 'drag' | 'resize' | 'add' | 'pack';
49
+ blockedCardId: string;
50
+ activeCardId: string;
46
51
  };
47
52
  export interface CloseLogEntry {
48
53
  panelId: PanelId;
@@ -96,6 +101,7 @@ export interface PanelState {
96
101
  activeTrigger: TriggerContext | null;
97
102
  bellCutoutOpen: boolean;
98
103
  isDirty: boolean;
104
+ dirtySessionCount: number;
99
105
  lockHint: LockHint | null;
100
106
  bufferByCard: Record<string, BufferDelta>;
101
107
  lastClose: {
@@ -1,4 +1,5 @@
1
1
  import { PanelShellProps } from '../PanelHost';
2
+ import { SettingsDimension } from '../../../primitives/dashboard/SettingsTabStrip';
2
3
  export interface SettingsShellProps extends PanelShellProps {
3
4
  /** Span of the source card (1|2|3). Plumbed by V2FeedbackSurface HOF. */
4
5
  cardSpan?: 1 | 2 | 3;
@@ -6,5 +7,9 @@ export interface SettingsShellProps extends PanelShellProps {
6
7
  cardLabel?: string;
7
8
  /** Visible value on the clone card. Defaults to '—'. */
8
9
  cardValue?: string;
10
+ /** Phase 16 D-02: dimensions to render as tabs. Reptime computes via useCardDimensions(cardType, colSpan). */
11
+ dimensions?: ReadonlyArray<SettingsDimension>;
12
+ /** Phase 16: initial active tab. Defaults to dimensions[0]. */
13
+ initialTab?: SettingsDimension;
9
14
  }
10
- export declare function SettingsShell({ isOpen, cardSpan, cardLabel, cardValue, }: SettingsShellProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function SettingsShell({ isOpen, cardSpan, cardLabel, cardValue, dimensions, initialTab, }: SettingsShellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
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
+ }
8
+ export declare function ColorControls({ value, onSelect }: ColorControlsProps): React.ReactElement;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare function SlotsControls(): React.ReactElement;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface ThresholdControlsProps {
3
+ value: number;
4
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
5
+ }
6
+ export declare function ThresholdControls({ value, onChange }: ThresholdControlsProps): React.ReactElement;
@@ -0,0 +1,6 @@
1
+ import { default as React } from 'react';
2
+ export interface TimeframeControlsProps {
3
+ value: number;
4
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
5
+ }
6
+ export declare function TimeframeControls({ value, onChange }: TimeframeControlsProps): React.ReactElement;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SettingsShell tab-body components. Each renders inside SettingsShell's role=tabpanel via React
3
+ * conditional render (CC-15/16). Phase 16 D-08 keeps these co-located with SettingsShell — they are
4
+ * not standalone primitives.
5
+ */
6
+ export { ThresholdControls } from './ThresholdControls';
7
+ export type { ThresholdControlsProps } from './ThresholdControls';
8
+ export { TimeframeControls } from './TimeframeControls';
9
+ export type { TimeframeControlsProps } from './TimeframeControls';
10
+ export { SlotsControls } from './SlotsControls';
11
+ export { ColorControls } from './ColorControls';
12
+ export type { ColorControlsProps, AccentSwatch } from './ColorControls';
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { SettingsTabStripProps } from './types';
3
+ /**
4
+ * SettingsTabStrip — WAI-ARIA Tabs pattern primitive for the Settings panel dimension strip.
5
+ *
6
+ * - Roles: container role='tablist'; each button role='tab'; activeTab has aria-selected='true' + tabIndex=0
7
+ * - Keyboard: ArrowLeft/Right (wrap), Home, End — automatic activation (focus = select)
8
+ * - Active indicator: motion.span with layoutId='settings-active-tab-indicator'; gated by useReducedMotionPanel
9
+ *
10
+ * Returns null when dimensions.length < 2 (single-dimension panels skip the strip).
11
+ *
12
+ * Phase 16 D-09. Avoids collision with existing presets/PresetSegmentedControl (role=radiogroup).
13
+ */
14
+ export declare function SettingsTabStrip({ dimensions, activeTab, onSelect, reduced: reducedProp, labels, ariaLabel, }: SettingsTabStripProps): React.ReactElement | null;
15
+ export declare namespace SettingsTabStrip {
16
+ var displayName: string;
17
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SettingsTabStrip barrel — WAI-ARIA Tabs pattern primitive for Settings panel dimension strip.
3
+ * Phase 16 D-09. Use INSIDE SettingsShell to render the 3-or-4 tab navigation.
4
+ */
5
+ export { SettingsTabStrip } from './SettingsTabStrip';
6
+ export type { SettingsTabStripProps, SettingsDimension } from './types';
@@ -0,0 +1,12 @@
1
+ export type SettingsDimension = 'timeframe' | 'threshold' | 'slots' | 'color';
2
+ export interface SettingsTabStripProps {
3
+ dimensions: ReadonlyArray<SettingsDimension>;
4
+ activeTab: SettingsDimension;
5
+ onSelect: (next: SettingsDimension) => void;
6
+ /** Override; when omitted, the component reads useReducedMotionPanel(). */
7
+ reduced?: boolean;
8
+ /** Optional label overrides; defaults to DIM_LABELS. */
9
+ labels?: Partial<Record<SettingsDimension, string>>;
10
+ /** Defaults to 'Settings dimensions'. */
11
+ ariaLabel?: string;
12
+ }
@@ -44,4 +44,5 @@ export * from './TrackingOutline';
44
44
  export * from './CellTintOverlay';
45
45
  export * from './RefusePulse';
46
46
  export { ResizeTrackingOutline, type ResizeTrackingOutlineProps, } from './ResizeTrackingOutline';
47
+ export * from './SettingsTabStrip';
47
48
  export { useResizeChoreography, type UseResizeChoreographyArgs, type UseResizeChoreographyReturn, } from './MetricCard/useResizeChoreography';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.103",
3
+ "version": "0.1.105",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"