@mt-gloss/ui 0.1.104 → 0.1.106

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.
@@ -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,16 @@
1
+ /**
2
+ * useEditingCardId — derives the currently-editing card ID from coordinator state.
3
+ *
4
+ * Returns the cardId when activePanelId === 'settings' AND the trigger is a card-overflow.
5
+ * Returns null otherwise.
6
+ *
7
+ * Phase 16 D-05: pure derivation — zero new state slice. Supersedes PHASE-C editingCardId slice proposal.
8
+ *
9
+ * Consumers (Phase 16):
10
+ * - reptime MetricCardSlot — useSortable({ disabled: ... || !!editingCardId })
11
+ * - reptime MetricCardSlot — useDraggable({ disabled: ... || !!editingCardId })
12
+ * - reptime useEdgeHoverResize — enabled: !editingCardId
13
+ * - reptime EmptyCellPackAffordance.onClick — early-return + dispatch SET_LOCK_HINT
14
+ * - reptime toolbar `+` button — disabled attribute
15
+ */
16
+ export declare function useEditingCardId(): string | null;
@@ -8,6 +8,7 @@
8
8
  * `composites-panels.js` matching existing `internals` + `catalog` pattern.
9
9
  */
10
10
  export { PanelProvider, usePanelContext, usePanelContextOptional } from './PanelProvider';
11
+ export { useEditingCardId } from './hooks/useEditingCardId';
11
12
  export { SettingsShell } from './shells/SettingsShell';
12
13
  export { CatalogAddShell } from './shells/CatalogAddShell';
13
14
  export type { CatalogAddShellProps } from './shells/CatalogAddShell';
@@ -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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.104",
3
+ "version": "0.1.106",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "restricted"