@mt-gloss/ui 0.1.149 → 0.1.151

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,17 +1,5 @@
1
- import { ReactNode } from 'react';
2
- /**
3
- * A single section of the QuickConfigPanel.
4
- * Consumers supply an opaque render function — the panel does not know what content renders.
5
- * D-02: generic shape; no reptime domain strings.
6
- */
7
- export interface QuickConfigSection {
8
- /** Unique identifier for the section; used as React key */
9
- id: string;
10
- /** Human-readable section heading rendered in the panel chrome */
11
- label: string;
12
- /** Returns the ReactNode to mount inside this section */
13
- render: () => ReactNode;
14
- }
1
+ import { QuickConfigSection } from '../../../types/quickConfig';
2
+ export type { QuickConfigSection } from '../../../types/quickConfig';
15
3
  /**
16
4
  * Props for QuickConfigPanel.
17
5
  * D-01: opaque — no reptime/entityType/metricInfo semantics.
@@ -3,6 +3,12 @@
3
3
  *
4
4
  * Constants consumed by both useEdgeHoverResize (spring commit) and the
5
5
  * DevTuningPanel (Plan 19-02) so the panel and the hook never drift.
6
+ *
7
+ * S5: the SPRING fields (stiffness/damping/mass) now derive from
8
+ * @mt-gloss/motion's RESIZE_COMMIT_SPRING (single source — shared with the
9
+ * SPRING_RESIZE_COMMIT `Transition` token; values unchanged: 500/22/1). The
10
+ * non-spring resize-interaction fields below stay local (resize domain, not
11
+ * motion vocabulary).
6
12
  */
7
13
  export declare const DEFAULT_RESIZE_PHYSICS: {
8
14
  readonly stiffness: 500;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { QuickConfigSection } from '../../../composites/dashboard/QuickConfigPanel/types';
2
+ import { QuickConfigSection } from '../../../types/quickConfig';
3
3
  /** Data for a single card slot in the grid. */
4
4
  export interface GridCardData {
5
5
  id: string;
@@ -27,9 +27,27 @@ export interface MetricCardGridProps {
27
27
  renderCard: (card: GridCardData) => ReactNode;
28
28
  renderEmptySlot?: (index: number) => ReactNode;
29
29
  /**
30
- * Sections passed through to QuickConfigPanel when config mode is active.
31
- * Required for panel to render meaningful content during flip-and-stage.
30
+ * Sections passed through to the config panel when config mode is active.
31
+ * Required for the panel to render meaningful content during flip-and-stage.
32
32
  * D-07: panel renders adjacent to active card slot.
33
33
  */
34
34
  configSections?: QuickConfigSection[];
35
+ /**
36
+ * Render-prop for the config panel shown adjacent to the active card during
37
+ * flip-and-stage (D-07). Inverts the former hard dependency on the
38
+ * QuickConfigPanel composite (S5 d1) — the CONSUMER injects the composite,
39
+ * matching the existing `renderCard` / `renderEmptySlot` pattern:
40
+ *
41
+ * renderConfigPanel={({ sections, onCommit, onCancel }) => (
42
+ * <QuickConfigPanel sections={sections} onCommit={onCommit} onCancel={onCancel} />
43
+ * )}
44
+ *
45
+ * When omitted, no config panel renders even if `configSections` are supplied.
46
+ * The grid still owns extrude-slot placement + the AnimatePresence wrapper.
47
+ */
48
+ renderConfigPanel?: (args: {
49
+ sections: QuickConfigSection[];
50
+ onCommit: () => void;
51
+ onCancel: () => void;
52
+ }) => ReactNode;
35
53
  }
@@ -21,14 +21,13 @@
21
21
  *
22
22
  * Structural precedent: libs/gloss-ui/src/lib/primitives/overlays/ActionStrip/motion.ts
23
23
  */
24
- /** MOTION-02 — Forward (digest) and reverse (undo) cascade physics. Asymmetric by design. */
25
- export declare const cascadePhysics: {
26
- readonly forwardStaggerMs: 50;
27
- readonly reverseStaggerMs: 30;
28
- readonly springStiffness: 380;
29
- readonly springDamping: 32;
30
- readonly reverseVelocityMultiplier: 1.4;
31
- };
24
+ /**
25
+ * MOTION-02 Forward (digest) and reverse (undo) cascade physics. Asymmetric by
26
+ * design. Moved DOWN to @mt-gloss/motion (S5); re-exported here so existing
27
+ * consumers (`import { cascadePhysics } from '@mt-gloss/ui'`, gloss-ui internals,
28
+ * reptime Grid v2) keep resolving the same object with identical values.
29
+ */
30
+ export { GRID_CASCADE_PHYSICS as cascadePhysics } from '@mt-gloss/motion';
32
31
  /** MOTION-03 — Swing-from-behind reveal (resize handle, [×] affordance, future hover-intent micro-affordances). */
33
32
  export declare const swingReveal: {
34
33
  readonly enterDurationMs: 220;
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * A single section of a quick-config surface.
4
+ *
5
+ * Domain-free shared vocabulary (D-02: generic shape; no reptime domain strings).
6
+ * Consumers supply an opaque `render` function — the panel does not know what
7
+ * content renders.
8
+ *
9
+ * Lives at the tier-independent `lib/types` layer (S5 d2): it is shared by the
10
+ * `MetricCardGrid` primitive (which forwards `configSections`) and the
11
+ * `QuickConfigPanel` composite (which renders them). Hosting it here removes the
12
+ * former primitive→composite upward type import.
13
+ */
14
+ export interface QuickConfigSection {
15
+ /** Unique identifier for the section; used as React key */
16
+ id: string;
17
+ /** Human-readable section heading rendered in the panel chrome */
18
+ label: string;
19
+ /** Returns the ReactNode to mount inside this section */
20
+ render: () => ReactNode;
21
+ }
@@ -1,27 +1,6 @@
1
- /**
2
- * Animation utilities and presets for Gloss UI components
3
- */
4
- /**
5
- * Standard animation durations
6
- */
7
- export declare const durations: {
8
- readonly instant: 0;
9
- readonly fast: 100;
10
- readonly normal: 200;
11
- readonly slow: 300;
12
- readonly slower: 400;
13
- };
1
+ import { durations, easings } from '@mt-gloss/tokens';
2
+ export { durations, easings };
14
3
  export type AnimationDuration = keyof typeof durations;
15
- /**
16
- * Standard easing functions
17
- */
18
- export declare const easings: {
19
- readonly linear: "linear";
20
- readonly easeIn: "cubic-bezier(0.4, 0, 1, 1)";
21
- readonly easeOut: "cubic-bezier(0, 0, 0.2, 1)";
22
- readonly easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)";
23
- readonly spring: "cubic-bezier(0.175, 0.885, 0.32, 1.275)";
24
- };
25
4
  export type AnimationEasing = keyof typeof easings;
26
5
  /**
27
6
  * Animation preset configurations
@@ -43,18 +22,4 @@ export interface AnimationPreset {
43
22
  */
44
23
  export declare const presets: Record<string, AnimationPreset>;
45
24
  export type AnimationPresetName = keyof typeof presets;
46
- /**
47
- * Get CSS transition string from animation config
48
- */
49
- export declare function getTransitionStyle(properties: string[], duration?: number, easing?: string): string;
50
- /**
51
- * Interpolate between two values based on progress (0-1)
52
- */
53
- export declare function interpolate(from: number, to: number, progress: number): number;
54
- /**
55
- * Parse a CSS value like "8px" to a number
56
- */
57
- export declare function parseNumericValue(value: string): {
58
- value: number;
59
- unit: string;
60
- };
25
+ export { getTransitionStyle, interpolate, parseNumericValue } from '@mt-gloss/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mt-gloss/ui",
3
- "version": "0.1.149",
3
+ "version": "0.1.151",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -72,6 +72,7 @@
72
72
  "@emotion/styled": "^11.0.0",
73
73
  "date-fns": "^3.0.0 || ^4.0.0",
74
74
  "@mt-gloss/utils": ">=0.0.1",
75
+ "@mt-gloss/tokens": ">=0.0.1",
75
76
  "@mt-gloss/motion": ">=0.0.1",
76
77
  "@floating-ui/react": ">=0.27.0",
77
78
  "motion": ">=12.0.0",