@mithrl/design-system 0.3.0 → 0.4.1
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/dist/components/approval-card/ApprovalCard.d.ts +61 -0
- package/dist/components/code-block/CodeBlock.d.ts +64 -0
- package/dist/components/command-search/CommandSearch.d.ts +121 -0
- package/dist/components/context-cards/ContextCards.d.ts +53 -0
- package/dist/components/disclosure/Disclosure.d.ts +38 -0
- package/dist/components/dot-field/DotField.d.ts +102 -0
- package/dist/components/field-message/FieldMessage.d.ts +12 -0
- package/dist/components/filter-table/FilterTable.d.ts +61 -0
- package/dist/components/flap-text/FlapText.d.ts +68 -0
- package/dist/components/flowchart/Flowchart.d.ts +250 -0
- package/dist/components/flowchart/graphLayout.d.ts +35 -0
- package/dist/components/global-app-bar/GlobalAppBar.d.ts +14 -4
- package/dist/components/icon-swap/IconSwap.d.ts +30 -0
- package/dist/components/insight-cards/InsightCards.d.ts +97 -0
- package/dist/components/number-flow/NumberFlow.d.ts +93 -0
- package/dist/components/pixel-loader/PixelLoader.d.ts +94 -0
- package/dist/components/progress-indicator/ProgressIndicator.d.ts +9 -1
- package/dist/components/prompt-bar/PromptBar.d.ts +103 -0
- package/dist/components/recommendation-card/RecommendationCard.d.ts +77 -0
- package/dist/components/records-table/RecordsTable.d.ts +87 -0
- package/dist/components/resizable-panels/ResizablePanels.d.ts +22 -0
- package/dist/components/selection-actions/SelectionActions.d.ts +72 -0
- package/dist/components/skeleton-reveal/SkeletonReveal.d.ts +33 -0
- package/dist/components/status-orb/StatusOrb.d.ts +51 -0
- package/dist/components/streaming-text/StreamingText.d.ts +85 -0
- package/dist/components/task-rows/TaskRows.d.ts +77 -0
- package/dist/components/text-reveal/TextReveal.d.ts +62 -0
- package/dist/components/upload-queue/UploadQueue.d.ts +10 -0
- package/dist/index.d.ts +49 -1
- package/dist/index.js +5959 -1863
- package/dist/internal/useStaggerBatch.d.ts +22 -0
- package/dist/patterns/notifications/Notifications.d.ts +159 -0
- package/dist/patterns/workspace-app-shell/WorkspaceAppShell.d.ts +50 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type IconGlyphComponent } from "../icon/Icon";
|
|
3
|
+
import { type FlowchartGraphEdge, type FlowchartGraphNodeKind } from "./graphLayout";
|
|
4
|
+
|
|
5
|
+
export type FlowchartCanvasProps = HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
/** Flow nodes and connectors, composed top to bottom. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** Hides the dotted grid when the flow sits inside an already-textured surface. */
|
|
9
|
+
grid?: boolean;
|
|
10
|
+
/** Horizontal alignment of the node column. @default "center" */
|
|
11
|
+
align?: "center" | "start";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A static presentation surface for a vertically-connected workflow.
|
|
15
|
+
* Flowchart never owns drag, drop, or node editing: it renders an already
|
|
16
|
+
* decided pipeline so a reader can follow it top to bottom.
|
|
17
|
+
*/
|
|
18
|
+
export declare const FlowchartCanvas: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & {
|
|
19
|
+
/** Flow nodes and connectors, composed top to bottom. */
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
/** Hides the dotted grid when the flow sits inside an already-textured surface. */
|
|
22
|
+
grid?: boolean;
|
|
23
|
+
/** Horizontal alignment of the node column. @default "center" */
|
|
24
|
+
align?: "center" | "start";
|
|
25
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export type FlowchartConnectorVariant = "line" | "elbow-left" | "elbow-right";
|
|
27
|
+
export type FlowchartConnectorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
28
|
+
/** Straight run, or an elbow that steps the flow into a branch column. */
|
|
29
|
+
variant?: FlowchartConnectorVariant;
|
|
30
|
+
/** Short branch caption such as `Yes`, `No`, or `On failure`. */
|
|
31
|
+
label?: string;
|
|
32
|
+
/** Draws the run dashed to signal a conditional or deferred path. */
|
|
33
|
+
dashed?: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The visual run between two flow nodes. Decorative by default; the label,
|
|
37
|
+
* when present, is the only readable content and is exposed to assistive tech.
|
|
38
|
+
*/
|
|
39
|
+
export declare const FlowchartConnector: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
40
|
+
/** Straight run, or an elbow that steps the flow into a branch column. */
|
|
41
|
+
variant?: FlowchartConnectorVariant;
|
|
42
|
+
/** Short branch caption such as `Yes`, `No`, or `On failure`. */
|
|
43
|
+
label?: string;
|
|
44
|
+
/** Draws the run dashed to signal a conditional or deferred path. */
|
|
45
|
+
dashed?: boolean;
|
|
46
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
+
export type FlowchartTriggerProps = Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> & {
|
|
48
|
+
/** Approved Lucide glyph naming the event source. */
|
|
49
|
+
icon?: IconGlyphComponent;
|
|
50
|
+
/** What starts the flow, phrased as an event. */
|
|
51
|
+
title: ReactNode;
|
|
52
|
+
/** One sentence of supporting detail about the event. */
|
|
53
|
+
description?: ReactNode;
|
|
54
|
+
/** Overrides the default `Trigger` eyebrow. */
|
|
55
|
+
eyebrow?: string;
|
|
56
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
57
|
+
trailing?: ReactNode;
|
|
58
|
+
/**
|
|
59
|
+
* Drag grip rendered at the card's leading edge. It repositions the card on
|
|
60
|
+
* the canvas; it does not reorder the flow, which stays owned by the edges.
|
|
61
|
+
*/
|
|
62
|
+
handle?: ReactNode;
|
|
63
|
+
};
|
|
64
|
+
/** The entry node of a flow. Carries an accent left treatment. */
|
|
65
|
+
export declare const FlowchartTrigger: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "title"> & {
|
|
66
|
+
/** Approved Lucide glyph naming the event source. */
|
|
67
|
+
icon?: IconGlyphComponent;
|
|
68
|
+
/** What starts the flow, phrased as an event. */
|
|
69
|
+
title: ReactNode;
|
|
70
|
+
/** One sentence of supporting detail about the event. */
|
|
71
|
+
description?: ReactNode;
|
|
72
|
+
/** Overrides the default `Trigger` eyebrow. */
|
|
73
|
+
eyebrow?: string;
|
|
74
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
75
|
+
trailing?: ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* Drag grip rendered at the card's leading edge. It repositions the card on
|
|
78
|
+
* the canvas; it does not reorder the flow, which stays owned by the edges.
|
|
79
|
+
*/
|
|
80
|
+
handle?: ReactNode;
|
|
81
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
82
|
+
export type FlowchartActionProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
83
|
+
icon?: IconGlyphComponent;
|
|
84
|
+
/** What the step does. */
|
|
85
|
+
title: ReactNode;
|
|
86
|
+
description?: ReactNode;
|
|
87
|
+
/** Overrides the default `Action` eyebrow, e.g. `Step 2`. */
|
|
88
|
+
eyebrow?: string;
|
|
89
|
+
/** Optional metadata slot, typically a `Tag` or a duration. */
|
|
90
|
+
trailing?: ReactNode;
|
|
91
|
+
/** Extra detail rendered beneath the header. */
|
|
92
|
+
children?: ReactNode;
|
|
93
|
+
/**
|
|
94
|
+
* Drag grip rendered at the card's leading edge. It repositions the card on
|
|
95
|
+
* the canvas; it does not reorder the flow, which stays owned by the edges.
|
|
96
|
+
*/
|
|
97
|
+
handle?: ReactNode;
|
|
98
|
+
};
|
|
99
|
+
/** A generic executed step in the flow. */
|
|
100
|
+
export declare const FlowchartAction: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
101
|
+
icon?: IconGlyphComponent;
|
|
102
|
+
/** What the step does. */
|
|
103
|
+
title: ReactNode;
|
|
104
|
+
description?: ReactNode;
|
|
105
|
+
/** Overrides the default `Action` eyebrow, e.g. `Step 2`. */
|
|
106
|
+
eyebrow?: string;
|
|
107
|
+
/** Optional metadata slot, typically a `Tag` or a duration. */
|
|
108
|
+
trailing?: ReactNode;
|
|
109
|
+
/** Extra detail rendered beneath the header. */
|
|
110
|
+
children?: ReactNode;
|
|
111
|
+
/**
|
|
112
|
+
* Drag grip rendered at the card's leading edge. It repositions the card on
|
|
113
|
+
* the canvas; it does not reorder the flow, which stays owned by the edges.
|
|
114
|
+
*/
|
|
115
|
+
handle?: ReactNode;
|
|
116
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
117
|
+
export type FlowchartClauseJoin = "and" | "or";
|
|
118
|
+
export type FlowchartConditionClause = {
|
|
119
|
+
/** The measured entity, e.g. `run QC score`. */
|
|
120
|
+
entity: string;
|
|
121
|
+
/** The comparison, e.g. `is below`. */
|
|
122
|
+
operator: string;
|
|
123
|
+
/** The compared value, e.g. `0.8`. */
|
|
124
|
+
value: string;
|
|
125
|
+
/**
|
|
126
|
+
* How this clause joins the previous one. Ignored on the first clause.
|
|
127
|
+
* @default "and"
|
|
128
|
+
*/
|
|
129
|
+
join?: FlowchartClauseJoin;
|
|
130
|
+
};
|
|
131
|
+
export type FlowchartConditionProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
132
|
+
icon?: IconGlyphComponent;
|
|
133
|
+
/** Short name for the decision, e.g. `Route low-quality runs`. */
|
|
134
|
+
title: ReactNode;
|
|
135
|
+
/** The clauses evaluated together, rendered as entity / operator / value chips. */
|
|
136
|
+
clauses: readonly FlowchartConditionClause[];
|
|
137
|
+
/** Overrides the default `If / Else` eyebrow. */
|
|
138
|
+
eyebrow?: string;
|
|
139
|
+
/** Caption for the true outcome. */
|
|
140
|
+
thenLabel?: string;
|
|
141
|
+
/** Caption for the false outcome. Omit for an if-only condition. */
|
|
142
|
+
elseLabel?: string;
|
|
143
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
144
|
+
trailing?: ReactNode;
|
|
145
|
+
/**
|
|
146
|
+
* Drag grip rendered at the card's leading edge. It repositions the card on
|
|
147
|
+
* the canvas; it does not reorder the flow, which stays owned by the edges.
|
|
148
|
+
*/
|
|
149
|
+
handle?: ReactNode;
|
|
150
|
+
};
|
|
151
|
+
/** A branching If/Else node whose clauses read as inline chips. */
|
|
152
|
+
export declare const FlowchartCondition: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
153
|
+
icon?: IconGlyphComponent;
|
|
154
|
+
/** Short name for the decision, e.g. `Route low-quality runs`. */
|
|
155
|
+
title: ReactNode;
|
|
156
|
+
/** The clauses evaluated together, rendered as entity / operator / value chips. */
|
|
157
|
+
clauses: readonly FlowchartConditionClause[];
|
|
158
|
+
/** Overrides the default `If / Else` eyebrow. */
|
|
159
|
+
eyebrow?: string;
|
|
160
|
+
/** Caption for the true outcome. */
|
|
161
|
+
thenLabel?: string;
|
|
162
|
+
/** Caption for the false outcome. Omit for an if-only condition. */
|
|
163
|
+
elseLabel?: string;
|
|
164
|
+
/** Optional metadata slot, typically a `Tag`. */
|
|
165
|
+
trailing?: ReactNode;
|
|
166
|
+
/**
|
|
167
|
+
* Drag grip rendered at the card's leading edge. It repositions the card on
|
|
168
|
+
* the canvas; it does not reorder the flow, which stays owned by the edges.
|
|
169
|
+
*/
|
|
170
|
+
handle?: ReactNode;
|
|
171
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
172
|
+
type FlowchartGraphNodeBase = {
|
|
173
|
+
id: string;
|
|
174
|
+
title: ReactNode;
|
|
175
|
+
description?: ReactNode;
|
|
176
|
+
eyebrow?: string;
|
|
177
|
+
icon?: IconGlyphComponent;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* A node in a graph-laid-out flowchart.
|
|
181
|
+
*
|
|
182
|
+
* Discriminated on `kind` so that `clauses` is *required* for a condition and
|
|
183
|
+
* unavailable on the other kinds. `FlowchartCondition` throws without at least
|
|
184
|
+
* one clause, so a condition that omits them has no valid rendering — this
|
|
185
|
+
* turns that into a compile error instead of silently drawing the branch as an
|
|
186
|
+
* ordinary action step.
|
|
187
|
+
*/
|
|
188
|
+
export type FlowchartGraphNode = (FlowchartGraphNodeBase & {
|
|
189
|
+
kind: Exclude<FlowchartGraphNodeKind, "condition">;
|
|
190
|
+
clauses?: never;
|
|
191
|
+
}) | (FlowchartGraphNodeBase & {
|
|
192
|
+
kind: "condition";
|
|
193
|
+
clauses: readonly FlowchartConditionClause[];
|
|
194
|
+
});
|
|
195
|
+
export type FlowchartGraphProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
196
|
+
nodes: readonly FlowchartGraphNode[];
|
|
197
|
+
edges: readonly FlowchartGraphEdge[];
|
|
198
|
+
/** Hides the dotted grid when the flow sits inside an already-textured surface. */
|
|
199
|
+
grid?: boolean;
|
|
200
|
+
/** Widest layer the layout will accept. @default 3 */
|
|
201
|
+
maxLanes?: number;
|
|
202
|
+
/** Largest graph the layout will accept. @default 12 */
|
|
203
|
+
maxNodes?: number;
|
|
204
|
+
/** Rendered when the graph is outside the supported layout bound. */
|
|
205
|
+
fallback?: ReactNode;
|
|
206
|
+
/**
|
|
207
|
+
* Gives every card the reorder grip and lets a reader move it around the
|
|
208
|
+
* canvas. The grip is a real button, so pointer drag has a full keyboard
|
|
209
|
+
* equivalent: arrow keys nudge by 8px, `Shift` + arrow by 32px, and `Escape`
|
|
210
|
+
* returns the card to its laid-out position — cancelling an in-flight pointer
|
|
211
|
+
* drag as well as undoing keyboard nudges. Positions are ephemeral: they live
|
|
212
|
+
* for the life of the mount and are never persisted, because the graph itself
|
|
213
|
+
* is still the source of truth.
|
|
214
|
+
*/
|
|
215
|
+
interactive?: boolean;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* A bounded directed-acyclic flow: parallel branches sit side by side as lanes
|
|
219
|
+
* in the same layer, and lanes rejoin wherever a node has more than one
|
|
220
|
+
* incoming edge. Layout is automatic and presentation-only — the graph is
|
|
221
|
+
* already decided, `FlowchartGraph` only draws it.
|
|
222
|
+
*
|
|
223
|
+
* Supports at most `FLOWCHART_GRAPH_MAX_NODES` (12) nodes and
|
|
224
|
+
* `FLOWCHART_GRAPH_MAX_LANES` (3) parallel lanes per layer. Outside that
|
|
225
|
+
* bound it renders `fallback` (or nothing), so a consumer can present the flow
|
|
226
|
+
* some other way rather than show an unreadable tangle.
|
|
227
|
+
*/
|
|
228
|
+
export declare const FlowchartGraph: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
229
|
+
nodes: readonly FlowchartGraphNode[];
|
|
230
|
+
edges: readonly FlowchartGraphEdge[];
|
|
231
|
+
/** Hides the dotted grid when the flow sits inside an already-textured surface. */
|
|
232
|
+
grid?: boolean;
|
|
233
|
+
/** Widest layer the layout will accept. @default 3 */
|
|
234
|
+
maxLanes?: number;
|
|
235
|
+
/** Largest graph the layout will accept. @default 12 */
|
|
236
|
+
maxNodes?: number;
|
|
237
|
+
/** Rendered when the graph is outside the supported layout bound. */
|
|
238
|
+
fallback?: ReactNode;
|
|
239
|
+
/**
|
|
240
|
+
* Gives every card the reorder grip and lets a reader move it around the
|
|
241
|
+
* canvas. The grip is a real button, so pointer drag has a full keyboard
|
|
242
|
+
* equivalent: arrow keys nudge by 8px, `Shift` + arrow by 32px, and `Escape`
|
|
243
|
+
* returns the card to its laid-out position — cancelling an in-flight pointer
|
|
244
|
+
* drag as well as undoing keyboard nudges. Positions are ephemeral: they live
|
|
245
|
+
* for the life of the mount and are never persisted, because the graph itself
|
|
246
|
+
* is still the source of truth.
|
|
247
|
+
*/
|
|
248
|
+
interactive?: boolean;
|
|
249
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
250
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layered layout for the small directed acyclic graphs `FlowchartGraph`
|
|
3
|
+
* renders. The layout is deliberately bounded: past these limits a readable
|
|
4
|
+
* automatic layout stops being possible in a reading surface, and consumers
|
|
5
|
+
* are expected to fall back to their own presentation.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FLOWCHART_GRAPH_MAX_NODES = 12;
|
|
8
|
+
export declare const FLOWCHART_GRAPH_MAX_LANES = 3;
|
|
9
|
+
export type FlowchartGraphNodeKind = "trigger" | "action" | "condition";
|
|
10
|
+
export type FlowchartGraphEdge = {
|
|
11
|
+
from: string;
|
|
12
|
+
to: string;
|
|
13
|
+
/** Short caption drawn on the run, e.g. `Yes` or `on failure`. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Draws the run dashed to signal a conditional or indirect path. */
|
|
16
|
+
dashed?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type FlowchartGraphLayout = {
|
|
19
|
+
/** Node ids grouped into layers, first layer first. */
|
|
20
|
+
layers: readonly (readonly string[])[];
|
|
21
|
+
};
|
|
22
|
+
type LayoutInput = {
|
|
23
|
+
ids: readonly string[];
|
|
24
|
+
edges: readonly FlowchartGraphEdge[];
|
|
25
|
+
maxNodes?: number;
|
|
26
|
+
maxLanes?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Assigns every node to a layer using longest-path layering, so an edge always
|
|
30
|
+
* runs from a lower layer to a higher one and merges land on a shared layer.
|
|
31
|
+
* Returns `null` when the graph is outside the supported bound: unknown edge
|
|
32
|
+
* endpoints, a cycle, too many nodes, or a layer wider than the lane limit.
|
|
33
|
+
*/
|
|
34
|
+
export declare function layoutFlowchartGraph({ ids, edges, maxNodes, maxLanes, }: LayoutInput): FlowchartGraphLayout | null;
|
|
35
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type MouseEventHandler, type ReactElement } from "react";
|
|
1
|
+
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes, type MouseEventHandler, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import { type AccountMenuProps } from "../account-menu/AccountMenu";
|
|
3
3
|
import { type DropdownMenuProps } from "../dropdown-menu/DropdownMenu";
|
|
4
4
|
import { type ThemeMode } from "../switch/Switch";
|
|
@@ -59,6 +59,11 @@ export type GlobalAppBarProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
59
59
|
onAccountMenuOpenChange?: DropdownMenuProps["onOpenChange"];
|
|
60
60
|
/** Additional native attributes for the account-menu button. */
|
|
61
61
|
accountButtonProps?: AccountButtonProps;
|
|
62
|
+
/**
|
|
63
|
+
* Product-wide utility controls rendered before Theme Switch. Use for
|
|
64
|
+
* persistent utilities such as Notifications, never page-specific actions.
|
|
65
|
+
*/
|
|
66
|
+
utilityActions?: ReactNode;
|
|
62
67
|
/**
|
|
63
68
|
* Workspace-only App Shell controls. Each control keeps its own semantics;
|
|
64
69
|
* Global App Bar owns only their approved order and alignment.
|
|
@@ -70,9 +75,9 @@ export type GlobalAppBarProps = Omit<HTMLAttributes<HTMLElement>, "children"> &
|
|
|
70
75
|
};
|
|
71
76
|
};
|
|
72
77
|
/**
|
|
73
|
-
* Persistent application anchor. Home keeps
|
|
74
|
-
* account
|
|
75
|
-
* context without introducing a second App Bar component.
|
|
78
|
+
* Persistent application anchor. Home keeps brand, optional product-wide
|
|
79
|
+
* utilities, theme, and account; Workspace adds structural panel controls and
|
|
80
|
+
* project context without introducing a second App Bar component.
|
|
76
81
|
*/
|
|
77
82
|
export declare const GlobalAppBar: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
78
83
|
/** Home destination used by the official Mithrl brand action. */
|
|
@@ -105,6 +110,11 @@ export declare const GlobalAppBar: import("react").ForwardRefExoticComponent<Omi
|
|
|
105
110
|
onAccountMenuOpenChange?: DropdownMenuProps["onOpenChange"];
|
|
106
111
|
/** Additional native attributes for the account-menu button. */
|
|
107
112
|
accountButtonProps?: AccountButtonProps;
|
|
113
|
+
/**
|
|
114
|
+
* Product-wide utility controls rendered before Theme Switch. Use for
|
|
115
|
+
* persistent utilities such as Notifications, never page-specific actions.
|
|
116
|
+
*/
|
|
117
|
+
utilityActions?: ReactNode;
|
|
108
118
|
/**
|
|
109
119
|
* Workspace-only App Shell controls. Each control keeps its own semantics;
|
|
110
120
|
* Global App Bar owns only their approved order and alignment.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type HTMLAttributes } from "react";
|
|
2
|
+
import { type IconGlyphComponent, type IconSize } from "../icon/Icon";
|
|
3
|
+
|
|
4
|
+
export type IconSwapProps = Omit<HTMLAttributes<HTMLSpanElement>, "aria-label" | "aria-hidden" | "children" | "role"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Approved glyph to display. Changing the component identity swaps the
|
|
7
|
+
* glyph in place; the caller never manages two children.
|
|
8
|
+
*/
|
|
9
|
+
icon: IconGlyphComponent;
|
|
10
|
+
/** Icon Foundation size token. Matches the `Icon` contract exactly. */
|
|
11
|
+
size?: IconSize;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Cross-fades two glyphs through one slot.
|
|
15
|
+
*
|
|
16
|
+
* IconSwap is a single-slot component: pass one `icon`, and whenever that
|
|
17
|
+
* component identity changes the outgoing glyph fades out while the incoming
|
|
18
|
+
* glyph fades in over it. Both share one grid cell so the slot never reflows.
|
|
19
|
+
*
|
|
20
|
+
* Motion — `--motion-duration-standard` on `--motion-easing-standard`, with
|
|
21
|
+
* the incoming glyph rising from `--motion-scale-enter` and
|
|
22
|
+
* `--motion-blur-soft` to rest. Under `prefers-reduced-motion: reduce` the
|
|
23
|
+
* scale and blur are dropped and the two glyphs cross-fade on opacity alone at
|
|
24
|
+
* `--motion-duration-fast`.
|
|
25
|
+
*
|
|
26
|
+
* Boundary — the swap is decorative. IconSwap announces nothing: the root and
|
|
27
|
+
* every glyph are hidden from assistive technology, exactly as a bare `Icon`
|
|
28
|
+
* without a `label` is. The accessible name belongs to the owning control.
|
|
29
|
+
*/
|
|
30
|
+
export declare function IconSwap({ icon, size, className, ...props }: IconSwapProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
/** Direction of a change, mapped to semantic color. */
|
|
4
|
+
export type InsightTone = "neutral" | "success" | "danger";
|
|
5
|
+
/**
|
|
6
|
+
* One run of an insight sentence. `text` reads as prose, `entity` names a
|
|
7
|
+
* cohort, gene, batch, or assay, and `metric` carries a figure or delta.
|
|
8
|
+
*/
|
|
9
|
+
export type InsightSegment = {
|
|
10
|
+
kind: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "entity";
|
|
14
|
+
text: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "metric";
|
|
17
|
+
text: string;
|
|
18
|
+
tone?: InsightTone;
|
|
19
|
+
};
|
|
20
|
+
/** A compact before/after row rendered beneath the sentence. */
|
|
21
|
+
export type InsightComparison = {
|
|
22
|
+
/** What is being compared, e.g. `Median TPM, responders`. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Signed relative change, already formatted, e.g. `+18.4%`. */
|
|
25
|
+
delta: string;
|
|
26
|
+
/** Absolute value, already formatted, e.g. `412.6 TPM`. */
|
|
27
|
+
value: string;
|
|
28
|
+
/** Semantic direction. @default "neutral" */
|
|
29
|
+
tone?: InsightTone;
|
|
30
|
+
};
|
|
31
|
+
/** A single plotted observation for the embedded mini chart. */
|
|
32
|
+
export type InsightChartPoint = {
|
|
33
|
+
/** Axis label for the scrub readout, e.g. `Day 14`. */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Plotted magnitude in the series' own units. */
|
|
36
|
+
value: number;
|
|
37
|
+
};
|
|
38
|
+
export type InsightChart = {
|
|
39
|
+
points: readonly InsightChartPoint[];
|
|
40
|
+
/** Unit suffix shown in the scrub readout, e.g. `TPM`. */
|
|
41
|
+
unit?: string;
|
|
42
|
+
/** Accessible summary of the series. Required — the SVG carries no text. */
|
|
43
|
+
ariaLabel: string;
|
|
44
|
+
};
|
|
45
|
+
export type InsightFollowUp = {
|
|
46
|
+
/** The suggested next question, phrased as the agent would ask it. */
|
|
47
|
+
label: string;
|
|
48
|
+
/** Stable identifier handed back to `onFollowUpSelect`. */
|
|
49
|
+
id?: string;
|
|
50
|
+
};
|
|
51
|
+
export type Insight = {
|
|
52
|
+
/** Stable identity for the page. */
|
|
53
|
+
id: string;
|
|
54
|
+
/** Short headline for the insight. */
|
|
55
|
+
title: string;
|
|
56
|
+
/** The insight itself, composed of prose, entity, and metric runs. */
|
|
57
|
+
sentence: readonly InsightSegment[];
|
|
58
|
+
/** Optional comparison rows. */
|
|
59
|
+
comparisons?: readonly InsightComparison[];
|
|
60
|
+
/** Optional embedded trend chart. */
|
|
61
|
+
chart?: InsightChart;
|
|
62
|
+
/** Optional suggested follow-up rendered in the footer. */
|
|
63
|
+
followUp?: InsightFollowUp;
|
|
64
|
+
};
|
|
65
|
+
export type InsightCardsProps = Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & {
|
|
66
|
+
/** The pages, in reading order. At least one is required. */
|
|
67
|
+
insights: readonly Insight[];
|
|
68
|
+
/** Header title. @default "Insights" */
|
|
69
|
+
heading?: ReactNode;
|
|
70
|
+
/** Controlled page index. */
|
|
71
|
+
page?: number;
|
|
72
|
+
/** Initial page index for uncontrolled use. @default 0 */
|
|
73
|
+
defaultPage?: number;
|
|
74
|
+
/** Called with the next index whenever the page changes. */
|
|
75
|
+
onPageChange?: (page: number) => void;
|
|
76
|
+
/** Called when the footer follow-up chip is activated. */
|
|
77
|
+
onFollowUpSelect?: (followUp: InsightFollowUp, insight: Insight) => void;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* A paged carousel of agent-authored insights. Each page states one finding
|
|
81
|
+
* in a sentence built from entity and metric chips, supports it with
|
|
82
|
+
* comparison rows and a mini trend chart, and offers one follow-up question.
|
|
83
|
+
*/
|
|
84
|
+
export declare const InsightCards: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLElement>, "children" | "onSelect"> & {
|
|
85
|
+
/** The pages, in reading order. At least one is required. */
|
|
86
|
+
insights: readonly Insight[];
|
|
87
|
+
/** Header title. @default "Insights" */
|
|
88
|
+
heading?: ReactNode;
|
|
89
|
+
/** Controlled page index. */
|
|
90
|
+
page?: number;
|
|
91
|
+
/** Initial page index for uncontrolled use. @default 0 */
|
|
92
|
+
defaultPage?: number;
|
|
93
|
+
/** Called with the next index whenever the page changes. */
|
|
94
|
+
onPageChange?: (page: number) => void;
|
|
95
|
+
/** Called when the footer follow-up chip is activated. */
|
|
96
|
+
onFollowUpSelect?: (followUp: InsightFollowUp, insight: Insight) => void;
|
|
97
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Milliseconds one digit spends rolling. Mirrors `--motion-duration-moderate`;
|
|
5
|
+
* the CSS reads the token directly and only falls back to this number when the
|
|
6
|
+
* caller overrides `rollDuration`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NUMBER_FLOW_DEFAULT_DURATION_MS = 220;
|
|
9
|
+
/** Milliseconds each successive cell waits before it starts rolling. */
|
|
10
|
+
export declare const NUMBER_FLOW_DEFAULT_STAGGER_MS = 18;
|
|
11
|
+
export type NumberFlowElement = "span" | "div" | "p" | "strong" | "em";
|
|
12
|
+
export type NumberFlowSize = "small" | "medium" | "large";
|
|
13
|
+
export interface NumberFlowProps {
|
|
14
|
+
/** The number to display. Changing it rolls the digits that differ. */
|
|
15
|
+
value: number;
|
|
16
|
+
/** `Intl.NumberFormat` options. Changing them reformats and animates. */
|
|
17
|
+
format?: Intl.NumberFormatOptions;
|
|
18
|
+
/** BCP 47 locale(s) for formatting. Defaults to the runtime locale. */
|
|
19
|
+
locale?: string | string[];
|
|
20
|
+
/**
|
|
21
|
+
* Height of the clipped roll window, as a multiple of the inherited line box.
|
|
22
|
+
* This is the only size NumberFlow owns — it never sets a font property.
|
|
23
|
+
* @default "medium"
|
|
24
|
+
*/
|
|
25
|
+
size?: NumberFlowSize;
|
|
26
|
+
/** Host element. @default "span" */
|
|
27
|
+
as?: NumberFlowElement;
|
|
28
|
+
/** Per-digit delay, in milliseconds. @default 18 */
|
|
29
|
+
stagger?: number;
|
|
30
|
+
/** Roll duration, in milliseconds. @default `--motion-duration-moderate` */
|
|
31
|
+
rollDuration?: number;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
}
|
|
35
|
+
export type NumberFlowDirection = "up" | "down";
|
|
36
|
+
export type NumberFlowCell = {
|
|
37
|
+
/** Glyph shown once the cell settles. */
|
|
38
|
+
char: string;
|
|
39
|
+
/** Glyph leaving the window, or `null` when the cell is new or unchanged. */
|
|
40
|
+
previous: string | null;
|
|
41
|
+
/** Digit-to-digit change: a clipped vertical roll. */
|
|
42
|
+
roll: boolean;
|
|
43
|
+
/** Any other change (separator, sign, or a brand new place): a crossfade. */
|
|
44
|
+
fade: boolean;
|
|
45
|
+
/** Roll direction, taken from the sign of the value delta. */
|
|
46
|
+
direction: NumberFlowDirection;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Cells are aligned from the RIGHT, not the left: in a number the units column
|
|
50
|
+
* is the fixed point, so 99 -> 100 must roll the two nines against the new
|
|
51
|
+
* tens and units rather than sliding every place one column over.
|
|
52
|
+
*
|
|
53
|
+
* Only cells whose glyph actually changed move — the same rule FlapText
|
|
54
|
+
* applies to characters. A digit replacing a digit rolls; anything else
|
|
55
|
+
* (a separator appearing, a sign flipping, a brand new leading place) is a
|
|
56
|
+
* quiet crossfade, because rolling a comma into a digit reads as noise.
|
|
57
|
+
*/
|
|
58
|
+
export declare function numberFlowCells(previous: string, next: string, direction?: NumberFlowDirection): NumberFlowCell[];
|
|
59
|
+
/**
|
|
60
|
+
* A number that resolves instead of blinking.
|
|
61
|
+
*
|
|
62
|
+
* Each character of the formatted value is its own cell. When `value` changes,
|
|
63
|
+
* only the cells whose glyph differs move: a digit rolls vertically through a
|
|
64
|
+
* clipped window — the outgoing glyph leaves through one edge as the incoming
|
|
65
|
+
* one arrives from the other, softened by `--motion-blur-soft` — while
|
|
66
|
+
* separators and new leading places simply crossfade. Cells are staggered left
|
|
67
|
+
* to right so the least significant digit is the last to settle.
|
|
68
|
+
*
|
|
69
|
+
* This is a short roll, not a slot machine. The spinning-counter recipe's
|
|
70
|
+
* multi-revolution 0-9 strip, its directional SVG blur filter and its masked
|
|
71
|
+
* window edges are all deliberately absent: a scientific workspace wants a
|
|
72
|
+
* number that has clearly *changed*, not one that celebrates.
|
|
73
|
+
*
|
|
74
|
+
* Sharpness: settled cells carry `transform: none` exactly — never an identity
|
|
75
|
+
* matrix — `will-change` is present only while a cell is in flight, no scale is
|
|
76
|
+
* ever applied, and the component sets no font property, so text metrics are
|
|
77
|
+
* the caller's. `font-variant-numeric: tabular-nums` keeps the box from
|
|
78
|
+
* wobbling as digits change width.
|
|
79
|
+
*
|
|
80
|
+
* Accessibility: cells are `aria-hidden`, the host carries the formatted value
|
|
81
|
+
* as `aria-label`, and a visually hidden polite live region announces one clean
|
|
82
|
+
* string.
|
|
83
|
+
*
|
|
84
|
+
* Reduced motion: no roll and no blur — the value swaps instantly behind a
|
|
85
|
+
* `--motion-duration-fast` opacity crossfade.
|
|
86
|
+
*/
|
|
87
|
+
export declare function NumberFlow({ value, format, locale, size, as, stagger, rollDuration, className, style, }: NumberFlowProps): import("react").DetailedReactHTMLElement<{
|
|
88
|
+
className: string;
|
|
89
|
+
style: CSSProperties | undefined;
|
|
90
|
+
"aria-label": string;
|
|
91
|
+
"data-size": NumberFlowSize;
|
|
92
|
+
"data-animating": string;
|
|
93
|
+
}, HTMLElement>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The pixel grid is always square. Five columns is the smallest grid that still
|
|
5
|
+
* reads as a *pattern* rather than a row of dots at 16px, and stays crisp at 50.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PIXEL_LOADER_GRID = 5;
|
|
8
|
+
/**
|
|
9
|
+
* Motion patterns. Each is a distinct reading of the same grid, not a speed
|
|
10
|
+
* variation of one loop:
|
|
11
|
+
*
|
|
12
|
+
* - `dots` — cells pulse in a scattered, non-repeating rhythm.
|
|
13
|
+
* - `orbit` — a lit cluster travels around the perimeter; the core stays dim.
|
|
14
|
+
* - `drive` — a column sweeps left to right, like a plate reader head.
|
|
15
|
+
* - `surfer` — a diagonal wavefront crosses the grid corner to corner.
|
|
16
|
+
*/
|
|
17
|
+
export declare const pixelLoaderVariants: readonly ["dots", "orbit", "drive", "surfer"];
|
|
18
|
+
export type PixelLoaderVariant = (typeof pixelLoaderVariants)[number];
|
|
19
|
+
/**
|
|
20
|
+
* DS size scale, deliberately identical to `StatusOrbSize` so a running-state
|
|
21
|
+
* indicator can be swapped between the two without touching layout.
|
|
22
|
+
*/
|
|
23
|
+
export type PixelLoaderSize = "small" | "default" | "medium" | "large";
|
|
24
|
+
/**
|
|
25
|
+
* Where one cell sits in the loop, as a fraction of the cycle in `[0, 1)`.
|
|
26
|
+
* `null` means the cell never lights for this variant and stays at rest — the
|
|
27
|
+
* dim core of `orbit`, for instance.
|
|
28
|
+
*
|
|
29
|
+
* Exported so the phase table can be asserted directly rather than inferred
|
|
30
|
+
* from rendered CSS.
|
|
31
|
+
*/
|
|
32
|
+
export declare function pixelLoaderCellPhase(variant: PixelLoaderVariant, x: number, y: number, grid?: number): number | null;
|
|
33
|
+
/**
|
|
34
|
+
* Accessible name used when the caller supplies none, or supplies one that is
|
|
35
|
+
* blank once trimmed. `role="img"` must always resolve to a name.
|
|
36
|
+
*/
|
|
37
|
+
export declare const PIXEL_LOADER_DEFAULT_LABEL = "Loading";
|
|
38
|
+
/**
|
|
39
|
+
* A cell's `animation-delay`, as a multiple of the cycle. Mirrors the `calc()`
|
|
40
|
+
* in `pixel-loader.css` exactly, and is asserted against that stylesheet in the
|
|
41
|
+
* tests so the two cannot drift.
|
|
42
|
+
*
|
|
43
|
+
* Always negative, so the loop is in flight on the first painted frame. The
|
|
44
|
+
* shape is `phase - 1`, not `-phase`: a negative delay advances the playhead by
|
|
45
|
+
* its own magnitude, so `-phase` would light the *highest* phase first and run
|
|
46
|
+
* every pattern backwards.
|
|
47
|
+
*/
|
|
48
|
+
export declare function pixelLoaderCellDelay(phase: number): number;
|
|
49
|
+
/**
|
|
50
|
+
* Which cells are at peak brightness at wall-clock time `t`, expressed as a
|
|
51
|
+
* fraction of one cycle.
|
|
52
|
+
*
|
|
53
|
+
* This resolves the same delay/duration arithmetic the browser does — playhead
|
|
54
|
+
* `= t - delay`, brightest when the playhead sits on the keyframe's peak — so
|
|
55
|
+
* the *rendered travel direction* can be asserted directly rather than inferred
|
|
56
|
+
* from the phase table. Returned in row-major cell-index order.
|
|
57
|
+
*/
|
|
58
|
+
export declare function pixelLoaderLitCellsAt(variant: PixelLoaderVariant, t: number, grid?: number): number[];
|
|
59
|
+
export interface PixelLoaderProps {
|
|
60
|
+
/** Which pattern the grid animates. @default "dots" */
|
|
61
|
+
variant?: PixelLoaderVariant;
|
|
62
|
+
/** DS size scale. @default "medium" (30px) */
|
|
63
|
+
size?: PixelLoaderSize;
|
|
64
|
+
/** One full pass of the pattern, in milliseconds. @default `--motion-duration-ambient` */
|
|
65
|
+
cycle?: number;
|
|
66
|
+
/** Sweep a soft highlight across the grid on top of the pattern. @default false */
|
|
67
|
+
shimmer?: boolean;
|
|
68
|
+
/** Freeze the pattern on its resting frame. @default false */
|
|
69
|
+
paused?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Accessible name. Trimmed; a blank or whitespace-only value falls back to
|
|
72
|
+
* the default rather than leaving `role="img"` unnamed. @default "Loading"
|
|
73
|
+
*/
|
|
74
|
+
"aria-label"?: string;
|
|
75
|
+
className?: string;
|
|
76
|
+
style?: CSSProperties;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Pixel-grid loading indicator.
|
|
80
|
+
*
|
|
81
|
+
* A 5×5 grid of cells lights in a variant-specific rhythm. Every cell carries a
|
|
82
|
+
* phase offset computed once at render; the animation itself is a single CSS
|
|
83
|
+
* keyframe on the compositor (opacity and transform only), so a page full of
|
|
84
|
+
* these costs no JavaScript per frame.
|
|
85
|
+
*
|
|
86
|
+
* Colour comes entirely from the brand ramp, mixed against `transparent`, so
|
|
87
|
+
* both themes are correct without a theme prop.
|
|
88
|
+
*
|
|
89
|
+
* Reduced motion: no travel. Cells settle into a static readout of their phase
|
|
90
|
+
* and the whole grid breathes on a slow, low-amplitude opacity pulse.
|
|
91
|
+
*
|
|
92
|
+
* This component never displays elapsed time.
|
|
93
|
+
*/
|
|
94
|
+
export declare function PixelLoader({ variant, size, cycle, shimmer, paused, "aria-label": ariaLabel, className, style, }: PixelLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,8 +7,16 @@ export declare const progressIndicatorVariants: (props?: ({
|
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export type ProgressIndicatorSize = NonNullable<VariantProps<typeof progressIndicatorVariants>["size"]>;
|
|
9
9
|
export type ProgressIndicatorTone = NonNullable<VariantProps<typeof progressIndicatorVariants>["tone"]>;
|
|
10
|
+
/**
|
|
11
|
+
* Loading is the default so every existing usage keeps its current behavior.
|
|
12
|
+
* Done resolves the same indicator into a drawn completion check.
|
|
13
|
+
*/
|
|
14
|
+
export type ProgressIndicatorState = "loading" | "done";
|
|
10
15
|
type RestrictedProgressIndicatorAttribute = "aria-atomic" | "aria-busy" | "aria-hidden" | "aria-label" | "aria-live" | "children" | "onClick" | "onDoubleClick" | "onKeyDown" | "onKeyUp" | "role" | "tabIndex";
|
|
11
|
-
type ProgressIndicatorBaseProps = Omit<HTMLAttributes<HTMLSpanElement>, RestrictedProgressIndicatorAttribute> & VariantProps<typeof progressIndicatorVariants
|
|
16
|
+
type ProgressIndicatorBaseProps = Omit<HTMLAttributes<HTMLSpanElement>, RestrictedProgressIndicatorAttribute> & VariantProps<typeof progressIndicatorVariants> & {
|
|
17
|
+
/** Completion state. Defaults to `"loading"`. */
|
|
18
|
+
state?: ProgressIndicatorState;
|
|
19
|
+
};
|
|
12
20
|
type InformativeProgressIndicatorProps = {
|
|
13
21
|
/** Concise accessible name announced through the status live region. */
|
|
14
22
|
label: string;
|