vizmatic 0.1.0
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/LICENSE +21 -0
- package/PROMPT.md +500 -0
- package/README.md +530 -0
- package/dist/chunk-ADU7JROD.js +627 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +303 -0
- package/dist/index.d.ts +1433 -0
- package/dist/index.js +4702 -0
- package/docs/PROMPT.md +500 -0
- package/docs/assets/examples/.gitkeep +1 -0
- package/docs/assets/examples/agent-pipeline_dark.png +0 -0
- package/docs/assets/examples/agent-pipeline_light.png +0 -0
- package/docs/assets/examples/animated-pipeline_dark.gif +0 -0
- package/docs/assets/examples/animated-pipeline_dark.png +0 -0
- package/docs/assets/examples/animated-pipeline_light.gif +0 -0
- package/docs/assets/examples/animated-pipeline_light.png +0 -0
- package/docs/assets/examples/attention-head_dark.png +0 -0
- package/docs/assets/examples/attention-head_light.png +0 -0
- package/docs/assets/examples/embedding-map_dark.png +0 -0
- package/docs/assets/examples/embedding-map_light.png +0 -0
- package/docs/assets/examples/eval-dashboard_dark.png +0 -0
- package/docs/assets/examples/eval-dashboard_light.png +0 -0
- package/docs/assets/examples/gif-manifest.json +12 -0
- package/docs/assets/examples/manifest.json +108 -0
- package/docs/assets/examples/model-router_dark.png +0 -0
- package/docs/assets/examples/model-router_light.png +0 -0
- package/docs/assets/examples/presentation-frame_dark.png +0 -0
- package/docs/assets/examples/presentation-frame_light.png +0 -0
- package/docs/assets/examples/rag-graph_dark.png +0 -0
- package/docs/assets/examples/rag-graph_light.png +0 -0
- package/docs/assets/examples/release-card_dark.png +0 -0
- package/docs/assets/examples/release-card_light.png +0 -0
- package/docs/assets/examples/research-landscape_dark.png +0 -0
- package/docs/assets/examples/research-landscape_light.png +0 -0
- package/docs/assets/examples/sources.json +93 -0
- package/docs/assets/examples/spec-anatomy_dark.png +0 -0
- package/docs/assets/examples/spec-anatomy_light.png +0 -0
- package/docs/assets/examples/theme-system_dark.png +0 -0
- package/docs/assets/examples/theme-system_light.png +0 -0
- package/docs/assets/examples/token-matrix_dark.png +0 -0
- package/docs/assets/examples/token-matrix_light.png +0 -0
- package/docs/assets/icon.svg +16 -0
- package/docs/assets/logo.svg +30 -0
- package/examples/agent-pipeline.tsx +27 -0
- package/examples/animated-pipeline.tsx +72 -0
- package/examples/attention-head.tsx +27 -0
- package/examples/embedding-map.tsx +34 -0
- package/examples/eval-dashboard.tsx +44 -0
- package/examples/model-router.tsx +35 -0
- package/examples/presentation-frame.tsx +32 -0
- package/examples/rag-graph.tsx +36 -0
- package/examples/release-card.tsx +39 -0
- package/examples/research-landscape.tsx +34 -0
- package/examples/spec-anatomy.tsx +44 -0
- package/examples/theme-system.tsx +30 -0
- package/examples/token-matrix.tsx +49 -0
- package/package.json +84 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1433 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Font } from 'satori';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Vizmatic — Theme
|
|
6
|
+
*
|
|
7
|
+
* Shared colors, typography, and styles for all illustrations.
|
|
8
|
+
* Supports both dark and light modes.
|
|
9
|
+
*/
|
|
10
|
+
type ThemeMode = 'dark' | 'light';
|
|
11
|
+
declare const darkColors: {
|
|
12
|
+
readonly bg: "#151620";
|
|
13
|
+
readonly bgCard: "#1a1b26";
|
|
14
|
+
readonly bgCardAlt: "#1e2030";
|
|
15
|
+
readonly bgHover: "#24253a";
|
|
16
|
+
readonly bgSubtle: "#151620";
|
|
17
|
+
readonly primary: "#7c3aed";
|
|
18
|
+
readonly primaryLight: "#a78bfa";
|
|
19
|
+
readonly primaryDark: "#6d28d9";
|
|
20
|
+
readonly secondary: "#2563eb";
|
|
21
|
+
readonly secondaryLight: "#60a5fa";
|
|
22
|
+
readonly secondaryDark: "#1d4ed8";
|
|
23
|
+
readonly positive: "#059669";
|
|
24
|
+
readonly positiveLight: "#34d399";
|
|
25
|
+
readonly positiveDark: "#047857";
|
|
26
|
+
readonly warning: "#d97706";
|
|
27
|
+
readonly warningLight: "#fbbf24";
|
|
28
|
+
readonly warningDark: "#b45309";
|
|
29
|
+
readonly critical: "#dc2626";
|
|
30
|
+
readonly criticalLight: "#f87171";
|
|
31
|
+
readonly criticalDark: "#b91c1c";
|
|
32
|
+
readonly info: "#06b6d4";
|
|
33
|
+
readonly infoLight: "#22d3ee";
|
|
34
|
+
readonly infoDark: "#0891b2";
|
|
35
|
+
readonly accent: "#f472b6";
|
|
36
|
+
readonly accentLight: "#f9a8d4";
|
|
37
|
+
readonly neutral: "#334155";
|
|
38
|
+
readonly neutralLight: "#475569";
|
|
39
|
+
readonly neutralDark: "#1e293b";
|
|
40
|
+
readonly textPrimary: "#f1f5f9";
|
|
41
|
+
readonly textSecondary: "#94a3b8";
|
|
42
|
+
readonly textMuted: "#64748b";
|
|
43
|
+
readonly textOnColor: "#ffffff";
|
|
44
|
+
readonly border: "#334155";
|
|
45
|
+
readonly borderSubtle: "#1e293b";
|
|
46
|
+
readonly borderLight: "#475569";
|
|
47
|
+
readonly shadow: "rgba(0, 0, 0, 0.24)";
|
|
48
|
+
};
|
|
49
|
+
type ThemeColors = {
|
|
50
|
+
[K in keyof typeof darkColors]: string;
|
|
51
|
+
};
|
|
52
|
+
declare function getThemeColors(mode: ThemeMode): ThemeColors;
|
|
53
|
+
/** Default for backward-compat: dark */
|
|
54
|
+
declare const colors: {
|
|
55
|
+
readonly bg: "#151620";
|
|
56
|
+
readonly bgCard: "#1a1b26";
|
|
57
|
+
readonly bgCardAlt: "#1e2030";
|
|
58
|
+
readonly bgHover: "#24253a";
|
|
59
|
+
readonly bgSubtle: "#151620";
|
|
60
|
+
readonly primary: "#7c3aed";
|
|
61
|
+
readonly primaryLight: "#a78bfa";
|
|
62
|
+
readonly primaryDark: "#6d28d9";
|
|
63
|
+
readonly secondary: "#2563eb";
|
|
64
|
+
readonly secondaryLight: "#60a5fa";
|
|
65
|
+
readonly secondaryDark: "#1d4ed8";
|
|
66
|
+
readonly positive: "#059669";
|
|
67
|
+
readonly positiveLight: "#34d399";
|
|
68
|
+
readonly positiveDark: "#047857";
|
|
69
|
+
readonly warning: "#d97706";
|
|
70
|
+
readonly warningLight: "#fbbf24";
|
|
71
|
+
readonly warningDark: "#b45309";
|
|
72
|
+
readonly critical: "#dc2626";
|
|
73
|
+
readonly criticalLight: "#f87171";
|
|
74
|
+
readonly criticalDark: "#b91c1c";
|
|
75
|
+
readonly info: "#06b6d4";
|
|
76
|
+
readonly infoLight: "#22d3ee";
|
|
77
|
+
readonly infoDark: "#0891b2";
|
|
78
|
+
readonly accent: "#f472b6";
|
|
79
|
+
readonly accentLight: "#f9a8d4";
|
|
80
|
+
readonly neutral: "#334155";
|
|
81
|
+
readonly neutralLight: "#475569";
|
|
82
|
+
readonly neutralDark: "#1e293b";
|
|
83
|
+
readonly textPrimary: "#f1f5f9";
|
|
84
|
+
readonly textSecondary: "#94a3b8";
|
|
85
|
+
readonly textMuted: "#64748b";
|
|
86
|
+
readonly textOnColor: "#ffffff";
|
|
87
|
+
readonly border: "#334155";
|
|
88
|
+
readonly borderSubtle: "#1e293b";
|
|
89
|
+
readonly borderLight: "#475569";
|
|
90
|
+
readonly shadow: "rgba(0, 0, 0, 0.24)";
|
|
91
|
+
};
|
|
92
|
+
declare const gradients: {
|
|
93
|
+
readonly purple: "linear-gradient(135deg, #7c3aed, #a855f7)";
|
|
94
|
+
readonly blue: "linear-gradient(135deg, #2563eb, #60a5fa)";
|
|
95
|
+
readonly green: "linear-gradient(135deg, #059669, #34d399)";
|
|
96
|
+
readonly warm: "linear-gradient(135deg, #f59e0b, #ef4444)";
|
|
97
|
+
readonly cyan: "linear-gradient(135deg, #06b6d4, #22d3ee)";
|
|
98
|
+
readonly pink: "linear-gradient(135deg, #ec4899, #f472b6)";
|
|
99
|
+
readonly sunset: "linear-gradient(135deg, #f97316, #db2777)";
|
|
100
|
+
readonly ocean: "linear-gradient(135deg, #0284c7, #7c3aed)";
|
|
101
|
+
readonly dark: "linear-gradient(180deg, #0f1117, #1a1b26)";
|
|
102
|
+
};
|
|
103
|
+
type ToneName = 'blue' | 'purple' | 'green' | 'warm' | 'cyan' | 'pink' | 'red' | 'critical' | 'neutral' | 'sunset' | 'ocean' | 'dark';
|
|
104
|
+
declare const toneGradients: Record<ToneName, string>;
|
|
105
|
+
declare function getToneGradient(tone: ToneName): string;
|
|
106
|
+
declare function getToneColor(tone: ToneName, c: ThemeColors): string;
|
|
107
|
+
declare const typography: {
|
|
108
|
+
readonly title: {
|
|
109
|
+
readonly fontSize: 28;
|
|
110
|
+
readonly fontWeight: 700;
|
|
111
|
+
readonly fontFamily: "Inter";
|
|
112
|
+
};
|
|
113
|
+
readonly subtitle: {
|
|
114
|
+
readonly fontSize: 20;
|
|
115
|
+
readonly fontWeight: 600;
|
|
116
|
+
readonly fontFamily: "Inter";
|
|
117
|
+
};
|
|
118
|
+
readonly label: {
|
|
119
|
+
readonly fontSize: 16;
|
|
120
|
+
readonly fontWeight: 600;
|
|
121
|
+
readonly fontFamily: "Inter";
|
|
122
|
+
};
|
|
123
|
+
readonly body: {
|
|
124
|
+
readonly fontSize: 14;
|
|
125
|
+
readonly fontWeight: 400;
|
|
126
|
+
readonly fontFamily: "Inter";
|
|
127
|
+
};
|
|
128
|
+
readonly small: {
|
|
129
|
+
readonly fontSize: 12;
|
|
130
|
+
readonly fontWeight: 500;
|
|
131
|
+
readonly fontFamily: "Inter";
|
|
132
|
+
};
|
|
133
|
+
readonly tiny: {
|
|
134
|
+
readonly fontSize: 10;
|
|
135
|
+
readonly fontWeight: 500;
|
|
136
|
+
readonly fontFamily: "Inter";
|
|
137
|
+
};
|
|
138
|
+
readonly code: {
|
|
139
|
+
readonly fontSize: 13;
|
|
140
|
+
readonly fontWeight: 400;
|
|
141
|
+
readonly fontFamily: "JetBrains Mono";
|
|
142
|
+
};
|
|
143
|
+
readonly annotation: {
|
|
144
|
+
readonly fontSize: 12;
|
|
145
|
+
readonly fontWeight: 500;
|
|
146
|
+
readonly fontFamily: "Inter";
|
|
147
|
+
readonly fontStyle: "italic";
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
declare const canvas: {
|
|
151
|
+
readonly standard: {
|
|
152
|
+
readonly width: 800;
|
|
153
|
+
readonly height: 500;
|
|
154
|
+
};
|
|
155
|
+
readonly wide: {
|
|
156
|
+
readonly width: 1000;
|
|
157
|
+
readonly height: 400;
|
|
158
|
+
};
|
|
159
|
+
readonly square: {
|
|
160
|
+
readonly width: 600;
|
|
161
|
+
readonly height: 600;
|
|
162
|
+
};
|
|
163
|
+
readonly tall: {
|
|
164
|
+
readonly width: 600;
|
|
165
|
+
readonly height: 800;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
/** Theme-aware style factories. Use these instead of hardcoded color values. */
|
|
169
|
+
declare function getStyles(c: ThemeColors): {
|
|
170
|
+
canvas: {
|
|
171
|
+
width: "100%";
|
|
172
|
+
height: "100%";
|
|
173
|
+
display: "flex";
|
|
174
|
+
flexDirection: "column";
|
|
175
|
+
backgroundColor: string;
|
|
176
|
+
fontFamily: string;
|
|
177
|
+
padding: number;
|
|
178
|
+
};
|
|
179
|
+
card: {
|
|
180
|
+
display: "flex";
|
|
181
|
+
flexDirection: "column";
|
|
182
|
+
backgroundColor: string;
|
|
183
|
+
borderRadius: number;
|
|
184
|
+
border: string;
|
|
185
|
+
padding: number;
|
|
186
|
+
};
|
|
187
|
+
pill: {
|
|
188
|
+
display: "flex";
|
|
189
|
+
alignItems: "center";
|
|
190
|
+
justifyContent: "center";
|
|
191
|
+
borderRadius: number;
|
|
192
|
+
padding: string;
|
|
193
|
+
fontSize: number;
|
|
194
|
+
fontWeight: number;
|
|
195
|
+
fontFamily: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
/** @deprecated Use getStyles(c) for theme-aware styles */
|
|
199
|
+
declare const styles: {
|
|
200
|
+
readonly canvas: {
|
|
201
|
+
readonly width: "100%";
|
|
202
|
+
readonly height: "100%";
|
|
203
|
+
readonly display: "flex";
|
|
204
|
+
readonly flexDirection: "column";
|
|
205
|
+
readonly backgroundColor: "#151620";
|
|
206
|
+
readonly fontFamily: "Inter";
|
|
207
|
+
readonly padding: 40;
|
|
208
|
+
};
|
|
209
|
+
readonly card: {
|
|
210
|
+
readonly display: "flex";
|
|
211
|
+
readonly flexDirection: "column";
|
|
212
|
+
readonly backgroundColor: "#1a1b26";
|
|
213
|
+
readonly borderRadius: 8;
|
|
214
|
+
readonly border: "1px solid #1e293b";
|
|
215
|
+
readonly padding: 20;
|
|
216
|
+
};
|
|
217
|
+
readonly pill: {
|
|
218
|
+
readonly display: "flex";
|
|
219
|
+
readonly alignItems: "center";
|
|
220
|
+
readonly justifyContent: "center";
|
|
221
|
+
readonly borderRadius: 999;
|
|
222
|
+
readonly padding: "6px 16px";
|
|
223
|
+
readonly fontSize: 13;
|
|
224
|
+
readonly fontWeight: 600;
|
|
225
|
+
readonly fontFamily: "Inter";
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
type ColorName = 'primary' | 'secondary' | 'positive' | 'warning' | 'critical' | 'info' | 'accent' | 'neutral';
|
|
229
|
+
/**
|
|
230
|
+
* Get a solid color by semantic name from a ThemeColors object.
|
|
231
|
+
* Falls back to dark theme if no ThemeColors provided (backward compat).
|
|
232
|
+
*/
|
|
233
|
+
declare function getColor(name: ColorName, c?: ThemeColors): string;
|
|
234
|
+
/**
|
|
235
|
+
* Get a gradient by semantic name.
|
|
236
|
+
* Gradients are the same for both themes (they sit on top of content
|
|
237
|
+
* and always use vibrant, high-contrast colors).
|
|
238
|
+
*/
|
|
239
|
+
declare function getGradient(name: ColorName): string;
|
|
240
|
+
/**
|
|
241
|
+
* Map a value 0..1 to a heat color (dark blue → cyan → green → yellow → red)
|
|
242
|
+
*/
|
|
243
|
+
declare function heatColor(value: number): string;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Vizmatic — Primitives
|
|
247
|
+
*
|
|
248
|
+
* High-level, THEME-AWARE building blocks for creating illustrations.
|
|
249
|
+
* All primitives accept a ThemeColors object so they render correctly
|
|
250
|
+
* in both dark and light modes.
|
|
251
|
+
*
|
|
252
|
+
* Design goals:
|
|
253
|
+
* - Simple API: minimal props, beautiful defaults
|
|
254
|
+
* - Theme-aware: all colors come from ThemeColors
|
|
255
|
+
* - Composable: nest freely, flexbox layout
|
|
256
|
+
* - AI-friendly: no coordinate math, just CSS
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
type IllustrationBuilder = (c: ThemeColors) => React.ReactElement;
|
|
260
|
+
/**
|
|
261
|
+
* Small export helper for embedded illustrations.
|
|
262
|
+
*
|
|
263
|
+
* Usage:
|
|
264
|
+
* const illustration = defineIllustration((c) => ...)
|
|
265
|
+
* export const create = illustration.create
|
|
266
|
+
* export default illustration.default
|
|
267
|
+
*/
|
|
268
|
+
declare function defineIllustration(build: IllustrationBuilder, defaultTheme?: ThemeMode): {
|
|
269
|
+
create(theme: ThemeMode): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
270
|
+
default: React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
271
|
+
};
|
|
272
|
+
interface CanvasProps {
|
|
273
|
+
children?: React.ReactNode;
|
|
274
|
+
c: ThemeColors;
|
|
275
|
+
padding?: number;
|
|
276
|
+
justify?: 'center' | 'flex-start' | 'space-between' | 'space-around';
|
|
277
|
+
background?: string;
|
|
278
|
+
}
|
|
279
|
+
declare function Canvas({ children, c, padding, justify, background }: CanvasProps): React.ReactElement;
|
|
280
|
+
interface TitleBarProps {
|
|
281
|
+
title: string;
|
|
282
|
+
subtitle?: string;
|
|
283
|
+
c: ThemeColors;
|
|
284
|
+
}
|
|
285
|
+
declare function TitleBar({ title, subtitle, c }: TitleBarProps): React.ReactElement;
|
|
286
|
+
|
|
287
|
+
type FlexAlign = 'start' | 'center' | 'end' | 'stretch';
|
|
288
|
+
type FlexJustify = 'start' | 'center' | 'end' | 'space-between' | 'space-around';
|
|
289
|
+
interface SceneProps {
|
|
290
|
+
c: ThemeColors;
|
|
291
|
+
children: React.ReactNode;
|
|
292
|
+
title?: string;
|
|
293
|
+
subtitle?: string;
|
|
294
|
+
padding?: number;
|
|
295
|
+
gap?: number;
|
|
296
|
+
justify?: CanvasProps['justify'];
|
|
297
|
+
align?: FlexAlign;
|
|
298
|
+
contentWidth?: number | string;
|
|
299
|
+
background?: string;
|
|
300
|
+
contentStyle?: React.CSSProperties;
|
|
301
|
+
}
|
|
302
|
+
declare function Scene({ c, children, title, subtitle, padding, gap, justify, align, contentWidth, background, contentStyle, }: SceneProps): React.ReactElement;
|
|
303
|
+
interface FlexBoxProps {
|
|
304
|
+
children: React.ReactNode;
|
|
305
|
+
gap?: number;
|
|
306
|
+
align?: FlexAlign;
|
|
307
|
+
justify?: FlexJustify;
|
|
308
|
+
wrap?: boolean;
|
|
309
|
+
width?: number | string;
|
|
310
|
+
height?: number | string;
|
|
311
|
+
style?: React.CSSProperties;
|
|
312
|
+
}
|
|
313
|
+
declare function Row(props: FlexBoxProps): React.ReactElement;
|
|
314
|
+
declare function Column(props: FlexBoxProps): React.ReactElement;
|
|
315
|
+
interface ToneStripProps {
|
|
316
|
+
tone: ToneName;
|
|
317
|
+
width?: number;
|
|
318
|
+
height?: number;
|
|
319
|
+
}
|
|
320
|
+
declare function ToneStrip({ tone, width, height }: ToneStripProps): React.ReactElement;
|
|
321
|
+
interface PanelProps {
|
|
322
|
+
title: React.ReactNode;
|
|
323
|
+
c: ThemeColors;
|
|
324
|
+
children?: React.ReactNode;
|
|
325
|
+
subtitle?: React.ReactNode;
|
|
326
|
+
tone?: ToneName;
|
|
327
|
+
footer?: React.ReactNode;
|
|
328
|
+
width?: number | string;
|
|
329
|
+
minWidth?: number | string;
|
|
330
|
+
height?: number | string;
|
|
331
|
+
minHeight?: number | string;
|
|
332
|
+
padding?: number | string;
|
|
333
|
+
radius?: number;
|
|
334
|
+
gap?: number;
|
|
335
|
+
align?: FlexAlign;
|
|
336
|
+
justify?: FlexJustify;
|
|
337
|
+
shadow?: boolean;
|
|
338
|
+
background?: string;
|
|
339
|
+
borderColor?: string;
|
|
340
|
+
titleFontSize?: number;
|
|
341
|
+
accentWidth?: number;
|
|
342
|
+
accentHeight?: number;
|
|
343
|
+
bodyStyle?: React.CSSProperties;
|
|
344
|
+
}
|
|
345
|
+
declare function Panel({ title, c, children, subtitle, tone, footer, width, minWidth, height, minHeight, padding, radius, gap, align, justify, shadow, background, borderColor, titleFontSize, accentWidth, accentHeight, bodyStyle, }: PanelProps): React.ReactElement;
|
|
346
|
+
declare function formatMathText(text: string): string;
|
|
347
|
+
interface MathTextProps {
|
|
348
|
+
text: string;
|
|
349
|
+
}
|
|
350
|
+
declare function MathText({ text }: MathTextProps): string;
|
|
351
|
+
interface TextLabelProps {
|
|
352
|
+
text: string;
|
|
353
|
+
c: ThemeColors;
|
|
354
|
+
variant?: keyof typeof typography;
|
|
355
|
+
color?: string;
|
|
356
|
+
fontSize?: number;
|
|
357
|
+
fontWeight?: number;
|
|
358
|
+
width?: number | string;
|
|
359
|
+
align?: 'left' | 'center' | 'right';
|
|
360
|
+
math?: boolean;
|
|
361
|
+
mono?: boolean;
|
|
362
|
+
}
|
|
363
|
+
declare function TextLabel({ text, c, variant, color, fontSize, fontWeight, width, align, math, mono, }: TextLabelProps): React.ReactElement;
|
|
364
|
+
interface SvgMathTextProps {
|
|
365
|
+
text: string;
|
|
366
|
+
x: number;
|
|
367
|
+
y: number;
|
|
368
|
+
fill: string;
|
|
369
|
+
fontSize?: number;
|
|
370
|
+
fontFamily?: string;
|
|
371
|
+
fontWeight?: number;
|
|
372
|
+
textAnchor?: 'start' | 'middle' | 'end';
|
|
373
|
+
dominantBaseline?: string;
|
|
374
|
+
opacity?: number;
|
|
375
|
+
}
|
|
376
|
+
declare function SvgMathText({ text, x, y, fill, fontSize, fontFamily, fontWeight, textAnchor, dominantBaseline, opacity, }: SvgMathTextProps): React.ReactElement;
|
|
377
|
+
interface BoxProps {
|
|
378
|
+
label: string;
|
|
379
|
+
c: ThemeColors;
|
|
380
|
+
color?: ColorName;
|
|
381
|
+
width?: number;
|
|
382
|
+
height?: number;
|
|
383
|
+
fontSize?: number;
|
|
384
|
+
/** Use gradient background instead of solid */
|
|
385
|
+
gradient?: boolean;
|
|
386
|
+
/** Optional sub-label below main label */
|
|
387
|
+
sublabel?: string;
|
|
388
|
+
/** Optional icon/emoji before label */
|
|
389
|
+
icon?: string;
|
|
390
|
+
/** Border radius */
|
|
391
|
+
radius?: number;
|
|
392
|
+
/** Outlined style instead of filled */
|
|
393
|
+
outlined?: boolean;
|
|
394
|
+
}
|
|
395
|
+
declare function Box({ label, c, color, width, height, fontSize, gradient, sublabel, icon, radius, outlined, }: BoxProps): React.ReactElement;
|
|
396
|
+
interface ArrowProps {
|
|
397
|
+
direction?: 'down' | 'right' | 'up' | 'left';
|
|
398
|
+
label?: string;
|
|
399
|
+
length?: number;
|
|
400
|
+
c: ThemeColors;
|
|
401
|
+
color?: string;
|
|
402
|
+
}
|
|
403
|
+
declare function Arrow({ direction, label, length, c, color, }: ArrowProps): React.ReactElement;
|
|
404
|
+
interface FlowArrowProps {
|
|
405
|
+
direction?: 'down' | 'right' | 'up' | 'left';
|
|
406
|
+
label?: string;
|
|
407
|
+
length?: number;
|
|
408
|
+
c: ThemeColors;
|
|
409
|
+
tone?: ToneName;
|
|
410
|
+
color?: string;
|
|
411
|
+
}
|
|
412
|
+
declare function FlowArrow({ direction, label, length, c, tone, color, }: FlowArrowProps): React.ReactElement;
|
|
413
|
+
declare function Connector(props: FlowArrowProps): React.ReactElement;
|
|
414
|
+
interface VectorArrowProps {
|
|
415
|
+
key?: React.Key;
|
|
416
|
+
x1: number;
|
|
417
|
+
y1: number;
|
|
418
|
+
x2: number;
|
|
419
|
+
y2: number;
|
|
420
|
+
color: string;
|
|
421
|
+
strokeWidth?: number;
|
|
422
|
+
arrowSize?: number;
|
|
423
|
+
opacity?: number;
|
|
424
|
+
}
|
|
425
|
+
declare function VectorArrow({ key, x1, y1, x2, y2, color, strokeWidth, arrowSize, opacity, }: VectorArrowProps): React.ReactElement;
|
|
426
|
+
interface VectorSegmentProps {
|
|
427
|
+
key?: React.Key;
|
|
428
|
+
x1: number;
|
|
429
|
+
y1: number;
|
|
430
|
+
x2: number;
|
|
431
|
+
y2: number;
|
|
432
|
+
color: string;
|
|
433
|
+
strokeWidth?: number;
|
|
434
|
+
opacity?: number;
|
|
435
|
+
showStartDot?: boolean;
|
|
436
|
+
showEndDot?: boolean;
|
|
437
|
+
dotRadius?: number;
|
|
438
|
+
}
|
|
439
|
+
declare function VectorSegment({ key, x1, y1, x2, y2, color, strokeWidth, opacity, showStartDot, showEndDot, dotRadius, }: VectorSegmentProps): React.ReactElement;
|
|
440
|
+
interface SvgFrameProps {
|
|
441
|
+
key?: React.Key;
|
|
442
|
+
x?: number;
|
|
443
|
+
y?: number;
|
|
444
|
+
width: number;
|
|
445
|
+
height: number;
|
|
446
|
+
c: ThemeColors;
|
|
447
|
+
rx?: number;
|
|
448
|
+
fill?: string;
|
|
449
|
+
stroke?: string;
|
|
450
|
+
strokeWidth?: number;
|
|
451
|
+
opacity?: number;
|
|
452
|
+
}
|
|
453
|
+
declare function SvgFrame({ key, x, y, width, height, c, rx, fill, stroke, strokeWidth, opacity, }: SvgFrameProps): React.ReactElement;
|
|
454
|
+
interface SvgPointProps {
|
|
455
|
+
key?: React.Key;
|
|
456
|
+
cx: number;
|
|
457
|
+
cy: number;
|
|
458
|
+
r?: number;
|
|
459
|
+
fill: string;
|
|
460
|
+
stroke?: string;
|
|
461
|
+
strokeWidth?: number;
|
|
462
|
+
opacity?: number;
|
|
463
|
+
}
|
|
464
|
+
declare function SvgPoint({ key, cx, cy, r, fill, stroke, strokeWidth, opacity, }: SvgPointProps): React.ReactElement;
|
|
465
|
+
interface ArrowMarkerDefProps {
|
|
466
|
+
id: string;
|
|
467
|
+
color: string;
|
|
468
|
+
size?: number;
|
|
469
|
+
}
|
|
470
|
+
declare function ArrowMarkerDef({ id, color, size }: ArrowMarkerDefProps): React.ReactElement;
|
|
471
|
+
interface StackProps {
|
|
472
|
+
direction?: 'vertical' | 'horizontal';
|
|
473
|
+
gap?: number;
|
|
474
|
+
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
475
|
+
wrap?: boolean;
|
|
476
|
+
children: React.ReactNode;
|
|
477
|
+
}
|
|
478
|
+
declare function Stack({ direction, gap, align, wrap, children, }: StackProps): React.ReactElement;
|
|
479
|
+
interface CardProps {
|
|
480
|
+
children?: React.ReactNode;
|
|
481
|
+
c: ThemeColors;
|
|
482
|
+
title?: React.ReactNode;
|
|
483
|
+
subtitle?: React.ReactNode;
|
|
484
|
+
tone?: ToneName;
|
|
485
|
+
footer?: React.ReactNode;
|
|
486
|
+
width?: number | string;
|
|
487
|
+
minWidth?: number | string;
|
|
488
|
+
height?: number | string;
|
|
489
|
+
minHeight?: number | string;
|
|
490
|
+
padding?: number | string;
|
|
491
|
+
radius?: number;
|
|
492
|
+
gap?: number;
|
|
493
|
+
align?: FlexAlign;
|
|
494
|
+
justify?: FlexJustify;
|
|
495
|
+
shadow?: boolean;
|
|
496
|
+
background?: string;
|
|
497
|
+
borderColor?: string;
|
|
498
|
+
bodyStyle?: React.CSSProperties;
|
|
499
|
+
}
|
|
500
|
+
declare function Card({ children, c, title, subtitle, tone, footer, width, minWidth, height, minHeight, padding, radius, gap, align, justify, shadow, background, borderColor, bodyStyle, }: CardProps): React.ReactElement;
|
|
501
|
+
interface ValuePillProps {
|
|
502
|
+
label: React.ReactNode;
|
|
503
|
+
value: React.ReactNode;
|
|
504
|
+
c: ThemeColors;
|
|
505
|
+
tone?: ToneName;
|
|
506
|
+
detail?: React.ReactNode;
|
|
507
|
+
width?: number | string;
|
|
508
|
+
math?: boolean;
|
|
509
|
+
}
|
|
510
|
+
declare function ValuePill({ label, value, c, tone, detail, width, math, }: ValuePillProps): React.ReactElement;
|
|
511
|
+
interface EquationCardProps {
|
|
512
|
+
title: React.ReactNode;
|
|
513
|
+
formula: React.ReactNode;
|
|
514
|
+
c: ThemeColors;
|
|
515
|
+
tone?: ToneName;
|
|
516
|
+
result?: React.ReactNode;
|
|
517
|
+
detail?: React.ReactNode;
|
|
518
|
+
width?: number | string;
|
|
519
|
+
height?: number | string;
|
|
520
|
+
math?: boolean;
|
|
521
|
+
align?: 'left' | 'center';
|
|
522
|
+
}
|
|
523
|
+
declare function EquationCard({ title, formula, c, tone, result, detail, width, height, math, align, }: EquationCardProps): React.ReactElement;
|
|
524
|
+
interface BadgePillProps {
|
|
525
|
+
text: React.ReactNode;
|
|
526
|
+
c: ThemeColors;
|
|
527
|
+
tone?: ToneName;
|
|
528
|
+
width?: number | string;
|
|
529
|
+
minWidth?: number | string;
|
|
530
|
+
height?: number | string;
|
|
531
|
+
padding?: number | string;
|
|
532
|
+
radius?: number;
|
|
533
|
+
fontSize?: number;
|
|
534
|
+
mono?: boolean;
|
|
535
|
+
filled?: boolean;
|
|
536
|
+
math?: boolean;
|
|
537
|
+
}
|
|
538
|
+
declare function BadgePill({ text, c, tone, width, minWidth, height, padding, radius, fontSize, mono, filled, math, }: BadgePillProps): React.ReactElement;
|
|
539
|
+
interface GradientChipProps {
|
|
540
|
+
title: React.ReactNode;
|
|
541
|
+
c: ThemeColors;
|
|
542
|
+
subtitle?: React.ReactNode;
|
|
543
|
+
tone?: ToneName;
|
|
544
|
+
gradient?: string;
|
|
545
|
+
width?: number | string;
|
|
546
|
+
minWidth?: number | string;
|
|
547
|
+
height?: number | string;
|
|
548
|
+
minHeight?: number | string;
|
|
549
|
+
padding?: number | string;
|
|
550
|
+
radius?: number;
|
|
551
|
+
shadow?: boolean;
|
|
552
|
+
align?: 'left' | 'center';
|
|
553
|
+
subtitleMono?: boolean;
|
|
554
|
+
math?: boolean;
|
|
555
|
+
}
|
|
556
|
+
declare function GradientChip({ title, c, subtitle, tone, gradient, width, minWidth, height, minHeight, padding, radius, shadow, align, subtitleMono, math, }: GradientChipProps): React.ReactElement;
|
|
557
|
+
interface StepCardProps {
|
|
558
|
+
title: React.ReactNode;
|
|
559
|
+
c: ThemeColors;
|
|
560
|
+
subtitle?: React.ReactNode;
|
|
561
|
+
eyebrow?: React.ReactNode;
|
|
562
|
+
tone?: ToneName;
|
|
563
|
+
width?: number | string;
|
|
564
|
+
minWidth?: number | string;
|
|
565
|
+
minHeight?: number | string;
|
|
566
|
+
padding?: number | string;
|
|
567
|
+
radius?: number;
|
|
568
|
+
shadow?: boolean;
|
|
569
|
+
align?: 'left' | 'center';
|
|
570
|
+
math?: boolean;
|
|
571
|
+
}
|
|
572
|
+
declare function StepCard({ title, c, subtitle, eyebrow, tone, width, minWidth, minHeight, padding, radius, shadow, align, math, }: StepCardProps): React.ReactElement;
|
|
573
|
+
interface MetricCardProps {
|
|
574
|
+
label: React.ReactNode;
|
|
575
|
+
value: React.ReactNode;
|
|
576
|
+
c: ThemeColors;
|
|
577
|
+
tone?: ToneName;
|
|
578
|
+
detail?: React.ReactNode;
|
|
579
|
+
width?: number | string;
|
|
580
|
+
minWidth?: number | string;
|
|
581
|
+
minHeight?: number | string;
|
|
582
|
+
padding?: number | string;
|
|
583
|
+
radius?: number;
|
|
584
|
+
shadow?: boolean;
|
|
585
|
+
align?: 'left' | 'center';
|
|
586
|
+
math?: boolean;
|
|
587
|
+
valueMono?: boolean;
|
|
588
|
+
valueFontSize?: number;
|
|
589
|
+
valueColor?: string;
|
|
590
|
+
}
|
|
591
|
+
declare function MetricCard({ label, value, c, tone, detail, width, minWidth, minHeight, padding, radius, shadow, align, math, valueMono, valueFontSize, valueColor, }: MetricCardProps): React.ReactElement;
|
|
592
|
+
interface ProgressRowSpec {
|
|
593
|
+
label: React.ReactNode;
|
|
594
|
+
value: number;
|
|
595
|
+
valueLabel?: React.ReactNode;
|
|
596
|
+
tone?: ToneName;
|
|
597
|
+
muted?: boolean;
|
|
598
|
+
}
|
|
599
|
+
interface ProgressRowProps extends ProgressRowSpec {
|
|
600
|
+
c: ThemeColors;
|
|
601
|
+
labelWidth?: number;
|
|
602
|
+
valueWidth?: number;
|
|
603
|
+
barHeight?: number;
|
|
604
|
+
fontSize?: number;
|
|
605
|
+
}
|
|
606
|
+
declare function ProgressRow({ label, value, valueLabel, tone, muted, c, labelWidth, valueWidth, barHeight, fontSize, }: ProgressRowProps): React.ReactElement;
|
|
607
|
+
interface ProgressListProps {
|
|
608
|
+
rows: ProgressRowSpec[];
|
|
609
|
+
c: ThemeColors;
|
|
610
|
+
gap?: number;
|
|
611
|
+
labelWidth?: number;
|
|
612
|
+
valueWidth?: number;
|
|
613
|
+
barHeight?: number;
|
|
614
|
+
fontSize?: number;
|
|
615
|
+
}
|
|
616
|
+
declare function ProgressList({ rows, c, gap, labelWidth, valueWidth, barHeight, fontSize, }: ProgressListProps): React.ReactElement;
|
|
617
|
+
interface MiniBarDatum {
|
|
618
|
+
label: React.ReactNode;
|
|
619
|
+
value: number;
|
|
620
|
+
tone?: ToneName;
|
|
621
|
+
color?: string;
|
|
622
|
+
valueLabel?: React.ReactNode;
|
|
623
|
+
opacity?: number;
|
|
624
|
+
}
|
|
625
|
+
interface MiniBarChartProps {
|
|
626
|
+
data: MiniBarDatum[];
|
|
627
|
+
c: ThemeColors;
|
|
628
|
+
max?: number;
|
|
629
|
+
minBarHeight?: number;
|
|
630
|
+
height?: number;
|
|
631
|
+
barWidth?: number;
|
|
632
|
+
gap?: number;
|
|
633
|
+
radius?: number;
|
|
634
|
+
fontSize?: number;
|
|
635
|
+
showValues?: boolean;
|
|
636
|
+
}
|
|
637
|
+
declare function MiniBarChart({ data, c, max, minBarHeight, height, barWidth, gap, radius, fontSize, showValues, }: MiniBarChartProps): React.ReactElement;
|
|
638
|
+
interface DetailListProps {
|
|
639
|
+
items: React.ReactNode[];
|
|
640
|
+
c: ThemeColors;
|
|
641
|
+
tone?: ToneName;
|
|
642
|
+
gap?: number;
|
|
643
|
+
padding?: number | string;
|
|
644
|
+
fontSize?: number;
|
|
645
|
+
mono?: boolean;
|
|
646
|
+
math?: boolean;
|
|
647
|
+
}
|
|
648
|
+
declare function DetailList({ items, c, tone, gap, padding, fontSize, mono, math, }: DetailListProps): React.ReactElement;
|
|
649
|
+
interface TileSpec {
|
|
650
|
+
title: React.ReactNode;
|
|
651
|
+
subtitle?: React.ReactNode;
|
|
652
|
+
eyebrow?: React.ReactNode;
|
|
653
|
+
icon?: React.ReactNode;
|
|
654
|
+
tone?: ToneName;
|
|
655
|
+
lines?: React.ReactNode[];
|
|
656
|
+
children?: React.ReactNode;
|
|
657
|
+
width?: number | string;
|
|
658
|
+
minHeight?: number | string;
|
|
659
|
+
}
|
|
660
|
+
interface TileProps extends TileSpec {
|
|
661
|
+
c: ThemeColors;
|
|
662
|
+
align?: 'left' | 'center';
|
|
663
|
+
padding?: number | string;
|
|
664
|
+
radius?: number;
|
|
665
|
+
shadow?: boolean;
|
|
666
|
+
math?: boolean;
|
|
667
|
+
}
|
|
668
|
+
declare function Tile({ title, subtitle, eyebrow, icon, tone, lines, children, width, minHeight, c, align, padding, radius, shadow, math, }: TileProps): React.ReactElement;
|
|
669
|
+
interface TileGridProps {
|
|
670
|
+
tiles: TileSpec[];
|
|
671
|
+
c: ThemeColors;
|
|
672
|
+
columns?: number;
|
|
673
|
+
gap?: number;
|
|
674
|
+
tileWidth?: number | string;
|
|
675
|
+
minHeight?: number | string;
|
|
676
|
+
align?: 'left' | 'center';
|
|
677
|
+
math?: boolean;
|
|
678
|
+
}
|
|
679
|
+
declare function TileGrid({ tiles, c, columns, gap, tileWidth, minHeight, align, math, }: TileGridProps): React.ReactElement;
|
|
680
|
+
interface CodeLineSpec {
|
|
681
|
+
text: React.ReactNode;
|
|
682
|
+
tone?: ToneName;
|
|
683
|
+
dim?: boolean;
|
|
684
|
+
prefix?: React.ReactNode;
|
|
685
|
+
}
|
|
686
|
+
interface CodeBlockProps {
|
|
687
|
+
lines: Array<React.ReactNode | CodeLineSpec>;
|
|
688
|
+
c: ThemeColors;
|
|
689
|
+
title?: React.ReactNode;
|
|
690
|
+
tone?: ToneName;
|
|
691
|
+
width?: number | string;
|
|
692
|
+
minWidth?: number | string;
|
|
693
|
+
fontSize?: number;
|
|
694
|
+
showLineNumbers?: boolean;
|
|
695
|
+
padding?: number | string;
|
|
696
|
+
radius?: number;
|
|
697
|
+
background?: string;
|
|
698
|
+
shadow?: boolean;
|
|
699
|
+
math?: boolean;
|
|
700
|
+
}
|
|
701
|
+
declare function CodeBlock({ lines, c, title, tone, width, minWidth, fontSize, showLineNumbers, padding, radius, background, shadow, math, }: CodeBlockProps): React.ReactElement;
|
|
702
|
+
interface ComparisonSideSpec {
|
|
703
|
+
title: React.ReactNode;
|
|
704
|
+
subtitle?: React.ReactNode;
|
|
705
|
+
eyebrow?: React.ReactNode;
|
|
706
|
+
tone?: ToneName;
|
|
707
|
+
lines?: React.ReactNode[];
|
|
708
|
+
children?: React.ReactNode;
|
|
709
|
+
footer?: React.ReactNode;
|
|
710
|
+
width?: number | string;
|
|
711
|
+
}
|
|
712
|
+
interface ComparisonProps {
|
|
713
|
+
sides: ComparisonSideSpec[];
|
|
714
|
+
c: ThemeColors;
|
|
715
|
+
divider?: React.ReactNode | boolean;
|
|
716
|
+
gap?: number;
|
|
717
|
+
sideWidth?: number | string;
|
|
718
|
+
minHeight?: number | string;
|
|
719
|
+
align?: FlexAlign;
|
|
720
|
+
math?: boolean;
|
|
721
|
+
}
|
|
722
|
+
declare function Comparison({ sides, c, divider, gap, sideWidth, minHeight, align, math, }: ComparisonProps): React.ReactElement;
|
|
723
|
+
interface KeyValueRow {
|
|
724
|
+
key: React.ReactNode;
|
|
725
|
+
value: React.ReactNode;
|
|
726
|
+
tone?: ToneName;
|
|
727
|
+
valueMono?: boolean;
|
|
728
|
+
}
|
|
729
|
+
interface KeyValueListProps {
|
|
730
|
+
rows: KeyValueRow[];
|
|
731
|
+
c: ThemeColors;
|
|
732
|
+
title?: React.ReactNode;
|
|
733
|
+
width?: number | string;
|
|
734
|
+
minWidth?: number | string;
|
|
735
|
+
keyWidth?: number | string;
|
|
736
|
+
gap?: number;
|
|
737
|
+
fontSize?: number;
|
|
738
|
+
divider?: boolean;
|
|
739
|
+
keyMono?: boolean;
|
|
740
|
+
math?: boolean;
|
|
741
|
+
}
|
|
742
|
+
declare function KeyValueList({ rows, c, title, width, minWidth, keyWidth, gap, fontSize, divider, keyMono, math, }: KeyValueListProps): React.ReactElement;
|
|
743
|
+
interface WindowFrameProps {
|
|
744
|
+
c: ThemeColors;
|
|
745
|
+
children?: React.ReactNode;
|
|
746
|
+
title?: React.ReactNode;
|
|
747
|
+
variant?: 'window' | 'browser' | 'terminal';
|
|
748
|
+
tone?: ToneName;
|
|
749
|
+
dots?: boolean;
|
|
750
|
+
width?: number | string;
|
|
751
|
+
minWidth?: number | string;
|
|
752
|
+
height?: number | string;
|
|
753
|
+
minHeight?: number | string;
|
|
754
|
+
padding?: number | string;
|
|
755
|
+
radius?: number;
|
|
756
|
+
shadow?: boolean;
|
|
757
|
+
background?: string;
|
|
758
|
+
bodyStyle?: React.CSSProperties;
|
|
759
|
+
}
|
|
760
|
+
declare function WindowFrame({ c, children, title, variant, tone, dots, width, minWidth, height, minHeight, padding, radius, shadow, background, bodyStyle, }: WindowFrameProps): React.ReactElement;
|
|
761
|
+
type StatusKind = 'check' | 'cross' | 'warn' | 'info' | 'pending' | 'dot';
|
|
762
|
+
interface StatusRowSpec {
|
|
763
|
+
label: React.ReactNode;
|
|
764
|
+
detail?: React.ReactNode;
|
|
765
|
+
status?: StatusKind;
|
|
766
|
+
tone?: ToneName;
|
|
767
|
+
}
|
|
768
|
+
interface StatusRowProps extends StatusRowSpec {
|
|
769
|
+
c: ThemeColors;
|
|
770
|
+
boxed?: boolean;
|
|
771
|
+
fontSize?: number;
|
|
772
|
+
width?: number | string;
|
|
773
|
+
math?: boolean;
|
|
774
|
+
}
|
|
775
|
+
declare function StatusRow({ label, detail, status, tone, c, boxed, fontSize, width, math, }: StatusRowProps): React.ReactElement;
|
|
776
|
+
interface StatusListProps {
|
|
777
|
+
rows: StatusRowSpec[];
|
|
778
|
+
c: ThemeColors;
|
|
779
|
+
gap?: number;
|
|
780
|
+
boxed?: boolean;
|
|
781
|
+
fontSize?: number;
|
|
782
|
+
width?: number | string;
|
|
783
|
+
math?: boolean;
|
|
784
|
+
}
|
|
785
|
+
declare function StatusList({ rows, c, gap, boxed, fontSize, width, math, }: StatusListProps): React.ReactElement;
|
|
786
|
+
interface FlowStageSpec {
|
|
787
|
+
title: React.ReactNode;
|
|
788
|
+
subtitle?: React.ReactNode;
|
|
789
|
+
eyebrow?: React.ReactNode;
|
|
790
|
+
tone?: ToneName;
|
|
791
|
+
lines?: React.ReactNode[];
|
|
792
|
+
children?: React.ReactNode;
|
|
793
|
+
width?: number | string;
|
|
794
|
+
minWidth?: number | string;
|
|
795
|
+
minHeight?: number | string;
|
|
796
|
+
padding?: number | string;
|
|
797
|
+
}
|
|
798
|
+
interface FlowProps {
|
|
799
|
+
stages: FlowStageSpec[];
|
|
800
|
+
c: ThemeColors;
|
|
801
|
+
direction?: 'horizontal' | 'vertical';
|
|
802
|
+
gap?: number;
|
|
803
|
+
connectorLength?: number;
|
|
804
|
+
connectorTone?: ToneName;
|
|
805
|
+
align?: FlexAlign;
|
|
806
|
+
math?: boolean;
|
|
807
|
+
}
|
|
808
|
+
declare function Flow({ stages, c, direction, gap, connectorLength, connectorTone, align, math, }: FlowProps): React.ReactElement;
|
|
809
|
+
interface LayeredNetworkLayer {
|
|
810
|
+
title: string;
|
|
811
|
+
nodes: string[];
|
|
812
|
+
tone?: ToneName;
|
|
813
|
+
}
|
|
814
|
+
interface LayeredNetworkProps {
|
|
815
|
+
c: ThemeColors;
|
|
816
|
+
layers: LayeredNetworkLayer[];
|
|
817
|
+
activePath?: number[];
|
|
818
|
+
annotations?: string[];
|
|
819
|
+
formula?: string;
|
|
820
|
+
legend?: string;
|
|
821
|
+
width?: number;
|
|
822
|
+
height?: number;
|
|
823
|
+
nodeSize?: number;
|
|
824
|
+
showFormula?: boolean;
|
|
825
|
+
}
|
|
826
|
+
declare function LayeredNetwork({ c, layers, activePath, annotations, formula, legend, width, height, nodeSize, showFormula, }: LayeredNetworkProps): React.ReactElement;
|
|
827
|
+
interface GraphDiagramNode {
|
|
828
|
+
id: string;
|
|
829
|
+
label: string;
|
|
830
|
+
detail?: string;
|
|
831
|
+
x: number;
|
|
832
|
+
y: number;
|
|
833
|
+
tone?: ToneName;
|
|
834
|
+
muted?: boolean;
|
|
835
|
+
width?: number;
|
|
836
|
+
height?: number;
|
|
837
|
+
}
|
|
838
|
+
interface GraphDiagramEdge {
|
|
839
|
+
from: string;
|
|
840
|
+
to: string;
|
|
841
|
+
tone?: ToneName;
|
|
842
|
+
muted?: boolean;
|
|
843
|
+
dashed?: boolean;
|
|
844
|
+
label?: string;
|
|
845
|
+
}
|
|
846
|
+
interface GraphDiagramProps {
|
|
847
|
+
nodes: GraphDiagramNode[];
|
|
848
|
+
edges: GraphDiagramEdge[];
|
|
849
|
+
c: ThemeColors;
|
|
850
|
+
width?: number;
|
|
851
|
+
height?: number;
|
|
852
|
+
nodeWidth?: number;
|
|
853
|
+
nodeHeight?: number;
|
|
854
|
+
padding?: number;
|
|
855
|
+
}
|
|
856
|
+
declare function GraphDiagram({ nodes, edges, c, width, height, nodeWidth, nodeHeight, padding, }: GraphDiagramProps): React.ReactElement;
|
|
857
|
+
interface CalloutCardProps {
|
|
858
|
+
c: ThemeColors;
|
|
859
|
+
children?: React.ReactNode;
|
|
860
|
+
title?: React.ReactNode;
|
|
861
|
+
detail?: React.ReactNode;
|
|
862
|
+
tone?: ToneName;
|
|
863
|
+
width?: number | string;
|
|
864
|
+
minHeight?: number | string;
|
|
865
|
+
padding?: number | string;
|
|
866
|
+
filled?: boolean;
|
|
867
|
+
align?: 'left' | 'center';
|
|
868
|
+
}
|
|
869
|
+
declare function CalloutCard({ c, children, title, detail, tone, width, minHeight, padding, filled, align, }: CalloutCardProps): React.ReactElement;
|
|
870
|
+
interface PipelineStage {
|
|
871
|
+
label: string;
|
|
872
|
+
sublabel?: string;
|
|
873
|
+
icon?: string;
|
|
874
|
+
color?: ColorName;
|
|
875
|
+
}
|
|
876
|
+
interface PipelineProps {
|
|
877
|
+
stages: PipelineStage[];
|
|
878
|
+
c: ThemeColors;
|
|
879
|
+
title?: string;
|
|
880
|
+
}
|
|
881
|
+
declare function Pipeline({ stages, c, title }: PipelineProps): React.ReactElement;
|
|
882
|
+
interface MatrixProps {
|
|
883
|
+
data: number[][];
|
|
884
|
+
c: ThemeColors;
|
|
885
|
+
rowLabels?: string[];
|
|
886
|
+
colLabels?: string[];
|
|
887
|
+
labels?: React.ReactNode[][];
|
|
888
|
+
title?: string;
|
|
889
|
+
cellSize?: number;
|
|
890
|
+
cellWidth?: number;
|
|
891
|
+
cellHeight?: number;
|
|
892
|
+
rowLabelWidth?: number;
|
|
893
|
+
format?: 'decimal' | 'percent' | 'integer';
|
|
894
|
+
colorize?: boolean;
|
|
895
|
+
colorScale?: 'heat' | 'strength';
|
|
896
|
+
}
|
|
897
|
+
declare function Matrix({ data, c, rowLabels, colLabels, labels, title, cellSize, cellWidth, cellHeight, rowLabelWidth, format, colorize, colorScale, }: MatrixProps): React.ReactElement;
|
|
898
|
+
interface HeatmapProps {
|
|
899
|
+
data: number[][];
|
|
900
|
+
xLabels: string[];
|
|
901
|
+
yLabels: string[];
|
|
902
|
+
c: ThemeColors;
|
|
903
|
+
labels?: React.ReactNode[][];
|
|
904
|
+
title?: string;
|
|
905
|
+
cellSize?: number;
|
|
906
|
+
cellWidth?: number;
|
|
907
|
+
cellHeight?: number;
|
|
908
|
+
rowLabelWidth?: number;
|
|
909
|
+
colorScale?: 'heat' | 'strength';
|
|
910
|
+
}
|
|
911
|
+
declare function Heatmap({ data, xLabels, yLabels, c, labels, title, cellSize, cellWidth, cellHeight, rowLabelWidth, colorScale, }: HeatmapProps): React.ReactElement;
|
|
912
|
+
interface TiledMatrixRegion {
|
|
913
|
+
rowStart: number;
|
|
914
|
+
rowEnd: number;
|
|
915
|
+
colStart: number;
|
|
916
|
+
colEnd: number;
|
|
917
|
+
tone?: ToneName;
|
|
918
|
+
}
|
|
919
|
+
interface TiledMatrixProps {
|
|
920
|
+
rows: number;
|
|
921
|
+
cols: number;
|
|
922
|
+
c: ThemeColors;
|
|
923
|
+
regions?: TiledMatrixRegion[];
|
|
924
|
+
title?: React.ReactNode;
|
|
925
|
+
subtitle?: React.ReactNode;
|
|
926
|
+
cellSize?: number;
|
|
927
|
+
gap?: number;
|
|
928
|
+
tone?: ToneName;
|
|
929
|
+
muted?: boolean;
|
|
930
|
+
crossedOut?: boolean;
|
|
931
|
+
}
|
|
932
|
+
declare function TiledMatrix({ rows, cols, c, regions, title, subtitle, cellSize, gap, tone, muted, crossedOut, }: TiledMatrixProps): React.ReactElement;
|
|
933
|
+
interface DataTableProps {
|
|
934
|
+
rows: React.ReactNode[][];
|
|
935
|
+
c: ThemeColors;
|
|
936
|
+
cellWidth?: number;
|
|
937
|
+
firstColWidth?: number;
|
|
938
|
+
cellHeight?: number;
|
|
939
|
+
gap?: number;
|
|
940
|
+
headerRows?: number;
|
|
941
|
+
headerCols?: number;
|
|
942
|
+
fontSize?: number;
|
|
943
|
+
math?: boolean;
|
|
944
|
+
}
|
|
945
|
+
declare function DataTable({ rows, c, cellWidth, firstColWidth, cellHeight, gap, headerRows, headerCols, fontSize, math, }: DataTableProps): React.ReactElement;
|
|
946
|
+
interface GridCell {
|
|
947
|
+
label?: React.ReactNode;
|
|
948
|
+
tone?: ToneName;
|
|
949
|
+
color?: string;
|
|
950
|
+
backgroundColor?: string;
|
|
951
|
+
borderColor?: string;
|
|
952
|
+
opacity?: number;
|
|
953
|
+
}
|
|
954
|
+
interface GridProps {
|
|
955
|
+
rows: Array<Array<React.ReactNode | GridCell>>;
|
|
956
|
+
c: ThemeColors;
|
|
957
|
+
cellWidth?: number;
|
|
958
|
+
cellHeight?: number;
|
|
959
|
+
gap?: number;
|
|
960
|
+
radius?: number;
|
|
961
|
+
fontSize?: number;
|
|
962
|
+
math?: boolean;
|
|
963
|
+
headerRows?: number;
|
|
964
|
+
headerCols?: number;
|
|
965
|
+
}
|
|
966
|
+
declare function Grid({ rows, c, cellWidth, cellHeight, gap, radius, fontSize, math, headerRows, headerCols, }: GridProps): React.ReactElement;
|
|
967
|
+
interface AxisPlotPoint {
|
|
968
|
+
x: number;
|
|
969
|
+
y: number;
|
|
970
|
+
fill?: string;
|
|
971
|
+
tone?: ToneName;
|
|
972
|
+
r?: number;
|
|
973
|
+
stroke?: string;
|
|
974
|
+
strokeWidth?: number;
|
|
975
|
+
opacity?: number;
|
|
976
|
+
}
|
|
977
|
+
interface AxisPlotVector {
|
|
978
|
+
x1: number;
|
|
979
|
+
y1: number;
|
|
980
|
+
x2: number;
|
|
981
|
+
y2: number;
|
|
982
|
+
color?: string;
|
|
983
|
+
tone?: ToneName;
|
|
984
|
+
strokeWidth?: number;
|
|
985
|
+
opacity?: number;
|
|
986
|
+
arrow?: boolean;
|
|
987
|
+
arrowSize?: number;
|
|
988
|
+
showStartDot?: boolean;
|
|
989
|
+
showEndDot?: boolean;
|
|
990
|
+
dotRadius?: number;
|
|
991
|
+
}
|
|
992
|
+
interface AxisPlotPath {
|
|
993
|
+
points: Array<{
|
|
994
|
+
x: number;
|
|
995
|
+
y: number;
|
|
996
|
+
}>;
|
|
997
|
+
color?: string;
|
|
998
|
+
tone?: ToneName;
|
|
999
|
+
strokeWidth?: number;
|
|
1000
|
+
opacity?: number;
|
|
1001
|
+
interpolation?: 'linear' | 'step-after';
|
|
1002
|
+
dashed?: boolean;
|
|
1003
|
+
}
|
|
1004
|
+
interface AxisPlotProps {
|
|
1005
|
+
c: ThemeColors;
|
|
1006
|
+
width: number;
|
|
1007
|
+
height: number;
|
|
1008
|
+
xMin?: number;
|
|
1009
|
+
xMax?: number;
|
|
1010
|
+
yMin?: number;
|
|
1011
|
+
yMax?: number;
|
|
1012
|
+
padding?: number;
|
|
1013
|
+
showFrame?: boolean;
|
|
1014
|
+
showAxes?: boolean;
|
|
1015
|
+
showGrid?: boolean;
|
|
1016
|
+
gridCount?: number;
|
|
1017
|
+
frameRx?: number;
|
|
1018
|
+
frameFill?: string;
|
|
1019
|
+
frameStroke?: string;
|
|
1020
|
+
axisColor?: string;
|
|
1021
|
+
points?: AxisPlotPoint[];
|
|
1022
|
+
vectors?: AxisPlotVector[];
|
|
1023
|
+
paths?: AxisPlotPath[];
|
|
1024
|
+
xAxisLabel?: string;
|
|
1025
|
+
yAxisLabel?: string;
|
|
1026
|
+
children?: React.ReactNode;
|
|
1027
|
+
}
|
|
1028
|
+
declare function AxisPlot({ c, width, height, xMin, xMax, yMin, yMax, padding, showFrame, showAxes, showGrid, gridCount, frameRx, frameFill, frameStroke, axisColor, points, vectors, paths, xAxisLabel, yAxisLabel, children, }: AxisPlotProps): React.ReactElement;
|
|
1029
|
+
type ChartValueFormat = 'decimal' | 'percent' | 'integer' | 'compact' | ((value: number) => string);
|
|
1030
|
+
interface ChartLegendItem {
|
|
1031
|
+
label: string;
|
|
1032
|
+
color: ColorName | string;
|
|
1033
|
+
}
|
|
1034
|
+
interface ChartMargins {
|
|
1035
|
+
top: number;
|
|
1036
|
+
right: number;
|
|
1037
|
+
bottom: number;
|
|
1038
|
+
left: number;
|
|
1039
|
+
}
|
|
1040
|
+
interface PlotArea {
|
|
1041
|
+
width: number;
|
|
1042
|
+
height: number;
|
|
1043
|
+
margin: ChartMargins;
|
|
1044
|
+
x: number;
|
|
1045
|
+
y: number;
|
|
1046
|
+
right: number;
|
|
1047
|
+
bottom: number;
|
|
1048
|
+
innerWidth: number;
|
|
1049
|
+
innerHeight: number;
|
|
1050
|
+
}
|
|
1051
|
+
interface ChartFrameProps {
|
|
1052
|
+
children: React.ReactNode;
|
|
1053
|
+
c: ThemeColors;
|
|
1054
|
+
title?: string;
|
|
1055
|
+
subtitle?: string;
|
|
1056
|
+
legend?: ChartLegendItem[];
|
|
1057
|
+
footer?: string;
|
|
1058
|
+
width?: number | string;
|
|
1059
|
+
height?: number | string;
|
|
1060
|
+
padding?: number;
|
|
1061
|
+
}
|
|
1062
|
+
declare function createPlotArea(width: number, height: number, margin: ChartMargins): PlotArea;
|
|
1063
|
+
declare function ChartFrame({ children, c, title, subtitle, legend, footer, width, height, padding, }: ChartFrameProps): React.ReactElement;
|
|
1064
|
+
interface BarChartDatum {
|
|
1065
|
+
label: string;
|
|
1066
|
+
value: number;
|
|
1067
|
+
color?: ColorName | string;
|
|
1068
|
+
valueLabel?: string;
|
|
1069
|
+
}
|
|
1070
|
+
interface StackedBarSegment {
|
|
1071
|
+
label: string;
|
|
1072
|
+
value: number;
|
|
1073
|
+
color?: ColorName | string;
|
|
1074
|
+
valueLabel?: string;
|
|
1075
|
+
}
|
|
1076
|
+
interface StackedBarProps {
|
|
1077
|
+
segments: StackedBarSegment[];
|
|
1078
|
+
c: ThemeColors;
|
|
1079
|
+
width?: number;
|
|
1080
|
+
height?: number;
|
|
1081
|
+
title?: string;
|
|
1082
|
+
subtitle?: string;
|
|
1083
|
+
showLegend?: boolean;
|
|
1084
|
+
}
|
|
1085
|
+
declare function StackedBar({ segments, c, width, height, title, subtitle, showLegend, }: StackedBarProps): React.ReactElement;
|
|
1086
|
+
interface BarChartProps {
|
|
1087
|
+
data: BarChartDatum[];
|
|
1088
|
+
c: ThemeColors;
|
|
1089
|
+
title?: string;
|
|
1090
|
+
subtitle?: string;
|
|
1091
|
+
width?: number;
|
|
1092
|
+
height?: number;
|
|
1093
|
+
min?: number;
|
|
1094
|
+
max?: number;
|
|
1095
|
+
format?: ChartValueFormat;
|
|
1096
|
+
showGrid?: boolean;
|
|
1097
|
+
showValues?: boolean;
|
|
1098
|
+
yAxisLabel?: string;
|
|
1099
|
+
footer?: string;
|
|
1100
|
+
}
|
|
1101
|
+
declare function BarChart({ data, c, title, subtitle, width, height, min, max, format, showGrid, showValues, yAxisLabel, footer, }: BarChartProps): React.ReactElement;
|
|
1102
|
+
interface LineChartSeries {
|
|
1103
|
+
name: string;
|
|
1104
|
+
points: number[];
|
|
1105
|
+
color?: ColorName | string;
|
|
1106
|
+
area?: boolean;
|
|
1107
|
+
}
|
|
1108
|
+
interface LineChartProps {
|
|
1109
|
+
series: LineChartSeries[];
|
|
1110
|
+
c: ThemeColors;
|
|
1111
|
+
title?: string;
|
|
1112
|
+
subtitle?: string;
|
|
1113
|
+
width?: number;
|
|
1114
|
+
height?: number;
|
|
1115
|
+
labels?: string[];
|
|
1116
|
+
min?: number;
|
|
1117
|
+
max?: number;
|
|
1118
|
+
format?: ChartValueFormat;
|
|
1119
|
+
showGrid?: boolean;
|
|
1120
|
+
showPoints?: boolean;
|
|
1121
|
+
yAxisLabel?: string;
|
|
1122
|
+
footer?: string;
|
|
1123
|
+
}
|
|
1124
|
+
declare function LineChart({ series, c, title, subtitle, width, height, labels, min, max, format, showGrid, showPoints, yAxisLabel, footer, }: LineChartProps): React.ReactElement;
|
|
1125
|
+
interface ScatterPoint {
|
|
1126
|
+
x: number;
|
|
1127
|
+
y: number;
|
|
1128
|
+
label?: string;
|
|
1129
|
+
color?: ColorName | string;
|
|
1130
|
+
size?: number;
|
|
1131
|
+
}
|
|
1132
|
+
interface ScatterPlotProps {
|
|
1133
|
+
points: ScatterPoint[];
|
|
1134
|
+
c: ThemeColors;
|
|
1135
|
+
title?: string;
|
|
1136
|
+
subtitle?: string;
|
|
1137
|
+
width?: number;
|
|
1138
|
+
height?: number;
|
|
1139
|
+
xMin?: number;
|
|
1140
|
+
xMax?: number;
|
|
1141
|
+
yMin?: number;
|
|
1142
|
+
yMax?: number;
|
|
1143
|
+
xAxisLabel?: string;
|
|
1144
|
+
yAxisLabel?: string;
|
|
1145
|
+
formatX?: ChartValueFormat;
|
|
1146
|
+
formatY?: ChartValueFormat;
|
|
1147
|
+
showGrid?: boolean;
|
|
1148
|
+
footer?: string;
|
|
1149
|
+
}
|
|
1150
|
+
declare function ScatterPlot({ points, c, title, subtitle, width, height, xMin, xMax, yMin, yMax, xAxisLabel, yAxisLabel, formatX, formatY, showGrid, footer, }: ScatterPlotProps): React.ReactElement;
|
|
1151
|
+
interface QuadrantRegion {
|
|
1152
|
+
label: string;
|
|
1153
|
+
detail?: string;
|
|
1154
|
+
color?: ColorName | string;
|
|
1155
|
+
}
|
|
1156
|
+
interface QuadrantChartProps {
|
|
1157
|
+
points: ScatterPoint[];
|
|
1158
|
+
regions: {
|
|
1159
|
+
topLeft: QuadrantRegion;
|
|
1160
|
+
topRight: QuadrantRegion;
|
|
1161
|
+
bottomLeft: QuadrantRegion;
|
|
1162
|
+
bottomRight: QuadrantRegion;
|
|
1163
|
+
};
|
|
1164
|
+
c: ThemeColors;
|
|
1165
|
+
title?: string;
|
|
1166
|
+
subtitle?: string;
|
|
1167
|
+
width?: number;
|
|
1168
|
+
height?: number;
|
|
1169
|
+
xAxisLabel?: string;
|
|
1170
|
+
yAxisLabel?: string;
|
|
1171
|
+
footer?: string;
|
|
1172
|
+
}
|
|
1173
|
+
declare function QuadrantChart({ points, regions, c, title, subtitle, width, height, xAxisLabel, yAxisLabel, footer, }: QuadrantChartProps): React.ReactElement;
|
|
1174
|
+
interface IntervalDatum {
|
|
1175
|
+
label: string;
|
|
1176
|
+
low: number;
|
|
1177
|
+
mid: number;
|
|
1178
|
+
high: number;
|
|
1179
|
+
color?: ColorName | string;
|
|
1180
|
+
lowLabel?: string;
|
|
1181
|
+
midLabel?: string;
|
|
1182
|
+
highLabel?: string;
|
|
1183
|
+
}
|
|
1184
|
+
interface IntervalPlotProps {
|
|
1185
|
+
data: IntervalDatum[];
|
|
1186
|
+
c: ThemeColors;
|
|
1187
|
+
title?: string;
|
|
1188
|
+
subtitle?: string;
|
|
1189
|
+
width?: number;
|
|
1190
|
+
height?: number;
|
|
1191
|
+
min?: number;
|
|
1192
|
+
max?: number;
|
|
1193
|
+
format?: ChartValueFormat;
|
|
1194
|
+
axisLabel?: string;
|
|
1195
|
+
footer?: string;
|
|
1196
|
+
}
|
|
1197
|
+
declare function IntervalPlot({ data, c, title, subtitle, width, height, min, max, format, axisLabel, footer, }: IntervalPlotProps): React.ReactElement;
|
|
1198
|
+
interface BadgeProps {
|
|
1199
|
+
label: string;
|
|
1200
|
+
c: ThemeColors;
|
|
1201
|
+
color?: ColorName;
|
|
1202
|
+
}
|
|
1203
|
+
declare function Badge({ label, c, color }: BadgeProps): React.ReactElement;
|
|
1204
|
+
interface DotPointProps {
|
|
1205
|
+
x: number;
|
|
1206
|
+
y: number;
|
|
1207
|
+
label: string;
|
|
1208
|
+
color: string;
|
|
1209
|
+
c: ThemeColors;
|
|
1210
|
+
size?: number;
|
|
1211
|
+
labelOffset?: {
|
|
1212
|
+
x?: number;
|
|
1213
|
+
y?: number;
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
declare function DotPoint({ x, y, label, color, size, labelOffset }: DotPointProps): React.ReactElement[];
|
|
1217
|
+
interface DashedLineProps {
|
|
1218
|
+
x1: number;
|
|
1219
|
+
y1: number;
|
|
1220
|
+
x2: number;
|
|
1221
|
+
y2: number;
|
|
1222
|
+
color: string;
|
|
1223
|
+
dotSpacing?: number;
|
|
1224
|
+
dotSize?: number;
|
|
1225
|
+
}
|
|
1226
|
+
declare function DashedLine({ x1, y1, x2, y2, color, dotSpacing, dotSize }: DashedLineProps): React.ReactElement[];
|
|
1227
|
+
interface LegendItem {
|
|
1228
|
+
label: string;
|
|
1229
|
+
color: string;
|
|
1230
|
+
style?: 'solid' | 'dashed';
|
|
1231
|
+
}
|
|
1232
|
+
interface LegendProps {
|
|
1233
|
+
items: LegendItem[];
|
|
1234
|
+
c: ThemeColors;
|
|
1235
|
+
title?: string;
|
|
1236
|
+
}
|
|
1237
|
+
declare function Legend({ items, c, title }: LegendProps): React.ReactElement;
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* Vizmatic — Brand
|
|
1241
|
+
*
|
|
1242
|
+
* Adds a small theme-aware watermark to rendered artifacts.
|
|
1243
|
+
*/
|
|
1244
|
+
|
|
1245
|
+
type WatermarkPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
1246
|
+
interface WatermarkImageOptions {
|
|
1247
|
+
src: string;
|
|
1248
|
+
width?: number;
|
|
1249
|
+
height?: number;
|
|
1250
|
+
alt?: string;
|
|
1251
|
+
}
|
|
1252
|
+
interface WatermarkOptions {
|
|
1253
|
+
text?: string | false;
|
|
1254
|
+
image?: string | WatermarkImageOptions;
|
|
1255
|
+
icon?: ReactNode | string | false;
|
|
1256
|
+
position?: WatermarkPosition;
|
|
1257
|
+
opacity?: number;
|
|
1258
|
+
color?: string;
|
|
1259
|
+
}
|
|
1260
|
+
type WatermarkInput = boolean | string | WatermarkOptions;
|
|
1261
|
+
declare function normalizeWatermark(watermark: WatermarkInput | undefined): WatermarkOptions | undefined;
|
|
1262
|
+
/**
|
|
1263
|
+
* Wrap an illustration element with a watermark overlay.
|
|
1264
|
+
*/
|
|
1265
|
+
declare function wrapWithWatermark(element: React.ReactNode, width: number, height: number, theme?: 'dark' | 'light', watermark?: WatermarkInput): React.ReactElement;
|
|
1266
|
+
declare function wrapWithBrand(element: React.ReactNode, width: number, height: number, theme?: 'dark' | 'light', label?: string): React.ReactElement;
|
|
1267
|
+
|
|
1268
|
+
/**
|
|
1269
|
+
* Vizmatic — Core Renderer
|
|
1270
|
+
*
|
|
1271
|
+
* Converts JSX elements to PNG images using Satori + Resvg.
|
|
1272
|
+
* This is the engine that powers all illustration generation.
|
|
1273
|
+
* Can apply an optional watermark without making branding part of
|
|
1274
|
+
* the illustration source.
|
|
1275
|
+
*
|
|
1276
|
+
* Auto-crop: Renders once to detect content bounds, then re-renders at
|
|
1277
|
+
* tighter dimensions so illustrations fill the frame with no wasted space.
|
|
1278
|
+
* The watermark is applied AFTER cropping so it's always positioned correctly.
|
|
1279
|
+
*/
|
|
1280
|
+
|
|
1281
|
+
interface FontData {
|
|
1282
|
+
name: string;
|
|
1283
|
+
data: ArrayBuffer;
|
|
1284
|
+
weight: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
1285
|
+
style: 'normal' | 'italic';
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Satori `loadAdditionalAsset` callback.
|
|
1289
|
+
* Called when a glyph is missing from configured fonts.
|
|
1290
|
+
* For emoji segments, returns a Twemoji SVG data URI.
|
|
1291
|
+
*/
|
|
1292
|
+
declare function loadAdditionalAsset(code: string, segment: string): Promise<string | Font[]>;
|
|
1293
|
+
declare function getFonts(): Promise<FontData[]>;
|
|
1294
|
+
interface RenderOptions {
|
|
1295
|
+
width: number;
|
|
1296
|
+
height: number;
|
|
1297
|
+
/** Output path for the PNG file */
|
|
1298
|
+
outputPath: string;
|
|
1299
|
+
/** Optional watermark. Use true for "Vizmatic", string for a custom label, or an object for text/icon/position. */
|
|
1300
|
+
watermark?: WatermarkInput;
|
|
1301
|
+
/** Backward-compatible alias for watermark. */
|
|
1302
|
+
brand?: boolean | string;
|
|
1303
|
+
/** Disable height autocrop for fixed-size frames. */
|
|
1304
|
+
crop?: boolean;
|
|
1305
|
+
/** Retina output scale. */
|
|
1306
|
+
scale?: number;
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Render a JSX element to a PNG file, with auto-crop and optional watermark.
|
|
1310
|
+
*
|
|
1311
|
+
* Pipeline:
|
|
1312
|
+
* 1. Render WITHOUT watermark at declared dimensions
|
|
1313
|
+
* 2. Detect content bounding box (scan pixels for non-background)
|
|
1314
|
+
* 3. If significant blank space detected, re-render at tighter dimensions
|
|
1315
|
+
* 4. Apply watermark to final render unless disabled
|
|
1316
|
+
* 5. Write PNG to disk
|
|
1317
|
+
*
|
|
1318
|
+
* @param element - React JSX element (must be pure, no hooks/state)
|
|
1319
|
+
* @param options - Width, height, and output path
|
|
1320
|
+
* @param createFn - Optional create(theme) function for themed re-rendering
|
|
1321
|
+
* @param theme - Theme mode for re-rendering (if createFn provided)
|
|
1322
|
+
*/
|
|
1323
|
+
declare function renderToPng(element: ReactNode, options: RenderOptions, createFn?: (theme: 'dark' | 'light') => ReactNode, theme?: 'dark' | 'light'): Promise<void>;
|
|
1324
|
+
/**
|
|
1325
|
+
* Render a JSX element to a PNG buffer (useful for testing).
|
|
1326
|
+
*/
|
|
1327
|
+
declare function renderToBuffer(element: ReactNode, width: number, height: number, options?: Pick<RenderOptions, 'brand' | 'watermark' | 'scale'>): Promise<Buffer>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Render a JSX element to SVG markup without rasterization.
|
|
1330
|
+
*/
|
|
1331
|
+
declare function renderToSvg(element: ReactNode, width: number, height: number, options?: Pick<RenderOptions, 'brand' | 'watermark'>): Promise<string>;
|
|
1332
|
+
|
|
1333
|
+
type TransitionType = 'none' | 'fade' | 'appear';
|
|
1334
|
+
interface AnimatedScene {
|
|
1335
|
+
element: ReactNode;
|
|
1336
|
+
duration: number;
|
|
1337
|
+
transition?: TransitionType;
|
|
1338
|
+
transitionDuration?: number;
|
|
1339
|
+
label?: string;
|
|
1340
|
+
}
|
|
1341
|
+
interface AnimationOptions {
|
|
1342
|
+
width: number;
|
|
1343
|
+
height: number;
|
|
1344
|
+
outputPath: string;
|
|
1345
|
+
loop?: number;
|
|
1346
|
+
scale?: number;
|
|
1347
|
+
watermark?: WatermarkInput;
|
|
1348
|
+
brand?: boolean | string;
|
|
1349
|
+
theme?: 'dark' | 'light';
|
|
1350
|
+
}
|
|
1351
|
+
declare function renderAnimatedGif(scenes: AnimatedScene[], options: AnimationOptions): Promise<void>;
|
|
1352
|
+
|
|
1353
|
+
/**
|
|
1354
|
+
* Vizmatic — Auto-Crop
|
|
1355
|
+
*
|
|
1356
|
+
* Detects the content bounding box in a rendered illustration
|
|
1357
|
+
* and returns the crop region needed to trim blank space.
|
|
1358
|
+
*
|
|
1359
|
+
* Works by scanning the raw RGBA pixel buffer from resvg to find
|
|
1360
|
+
* rows/columns that differ from the background color.
|
|
1361
|
+
*/
|
|
1362
|
+
interface CropRegion {
|
|
1363
|
+
/** Left edge of content (px from left, in source pixel space) */
|
|
1364
|
+
x: number;
|
|
1365
|
+
/** Top edge of content (px from top, in source pixel space) */
|
|
1366
|
+
y: number;
|
|
1367
|
+
/** Width of the content region */
|
|
1368
|
+
width: number;
|
|
1369
|
+
/** Height of the content region */
|
|
1370
|
+
height: number;
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Detect background color from top-left corner pixel.
|
|
1374
|
+
*
|
|
1375
|
+
* Transparent canvases still rely on alpha-based background detection, so the
|
|
1376
|
+
* exact RGB value is only relevant when the illustration paints an opaque root
|
|
1377
|
+
* background.
|
|
1378
|
+
*/
|
|
1379
|
+
declare function detectBackgroundColor(pixels: Uint8Array): string;
|
|
1380
|
+
/**
|
|
1381
|
+
* Detect the bounding box of non-background content in an RGBA pixel buffer.
|
|
1382
|
+
*
|
|
1383
|
+
* @param pixels - Raw RGBA pixel data (Uint8Array, 4 bytes per pixel)
|
|
1384
|
+
* @param width - Image width in pixels
|
|
1385
|
+
* @param height - Image height in pixels
|
|
1386
|
+
* @param bgColor - Background color as hex string (e.g., '#0f1117')
|
|
1387
|
+
* @param padding - Extra padding to add around the detected content
|
|
1388
|
+
* @returns CropRegion with the content bounding box (including padding)
|
|
1389
|
+
*/
|
|
1390
|
+
declare function detectContentBounds(pixels: Uint8Array, width: number, height: number, bgColor: string, padding?: number): CropRegion;
|
|
1391
|
+
/**
|
|
1392
|
+
* Crop an RGBA pixel buffer to a given region.
|
|
1393
|
+
*
|
|
1394
|
+
* @param pixels - Source RGBA pixel data
|
|
1395
|
+
* @param srcWidth - Source image width
|
|
1396
|
+
* @param region - Region to crop to
|
|
1397
|
+
* @returns New RGBA pixel buffer with just the cropped region
|
|
1398
|
+
*/
|
|
1399
|
+
declare function cropPixels(pixels: Uint8Array, srcWidth: number, region: CropRegion): Uint8Array;
|
|
1400
|
+
interface OverflowResult {
|
|
1401
|
+
/** True if content is likely being clipped by the canvas */
|
|
1402
|
+
overflows: boolean;
|
|
1403
|
+
/** Which edges have content touching them */
|
|
1404
|
+
edges: {
|
|
1405
|
+
top: boolean;
|
|
1406
|
+
right: boolean;
|
|
1407
|
+
bottom: boolean;
|
|
1408
|
+
left: boolean;
|
|
1409
|
+
};
|
|
1410
|
+
/** Human-readable description of the overflow */
|
|
1411
|
+
message: string;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Detect if illustration content overflows the canvas.
|
|
1415
|
+
*
|
|
1416
|
+
* Content that touches the very edge of the canvas (within `edgeTolerance` px)
|
|
1417
|
+
* likely extends beyond it and is being clipped. This function scans the edge
|
|
1418
|
+
* rows/columns for non-background pixels.
|
|
1419
|
+
*
|
|
1420
|
+
* To avoid false positives from decorative elements that intentionally touch
|
|
1421
|
+
* the border (e.g. full-width bars), we require at least `minDensity` % of
|
|
1422
|
+
* the edge to contain content pixels.
|
|
1423
|
+
*
|
|
1424
|
+
* @param pixels - Raw RGBA pixel data
|
|
1425
|
+
* @param width - Image width in pixels
|
|
1426
|
+
* @param height - Image height in pixels
|
|
1427
|
+
* @param bgColor - Background color as hex string
|
|
1428
|
+
* @param edgeTolerance - Number of pixels from the edge to check (default 3)
|
|
1429
|
+
* @param minDensity - Minimum fraction of edge with content to flag (default 0.05)
|
|
1430
|
+
*/
|
|
1431
|
+
declare function detectOverflow(pixels: Uint8Array, width: number, height: number, bgColor: string, edgeTolerance?: number, minDensity?: number, alphaThreshold?: number): OverflowResult;
|
|
1432
|
+
|
|
1433
|
+
export { type AnimatedScene, type AnimationOptions, Arrow, ArrowMarkerDef, AxisPlot, type AxisPlotPath, Badge, BadgePill, BarChart, type BarChartDatum, Box, CalloutCard, Canvas, Card, ChartFrame, type ChartLegendItem, type ChartMargins, type ChartValueFormat, CodeBlock, type CodeLineSpec, type ColorName, Column, Comparison, type ComparisonSideSpec, Connector, type CropRegion, DashedLine, DataTable, DetailList, DotPoint, EquationCard, Flow, FlowArrow, type FlowStageSpec, GradientChip, GraphDiagram, type GraphDiagramEdge, type GraphDiagramNode, Grid, Heatmap, type IllustrationBuilder, type IntervalDatum, IntervalPlot, KeyValueList, type KeyValueRow, LayeredNetwork, type LayeredNetworkLayer, Legend, LineChart, type LineChartSeries, MathText, Matrix, MetricCard, MiniBarChart, type MiniBarDatum, type OverflowResult, Panel, Pipeline, type PlotArea, ProgressList, ProgressRow, type ProgressRowSpec, QuadrantChart, type QuadrantRegion, type RenderOptions, Row, ScatterPlot, type ScatterPoint, Scene, Stack, StackedBar, type StackedBarSegment, type StatusKind, StatusList, StatusRow, type StatusRowSpec, StepCard, SvgFrame, SvgMathText, SvgPoint, TextLabel, type ThemeColors, type ThemeMode, Tile, TileGrid, type TileSpec, TiledMatrix, type TiledMatrixRegion, TitleBar, type ToneName, ToneStrip, type TransitionType, ValuePill, VectorArrow, VectorSegment, type WatermarkImageOptions, type WatermarkInput, type WatermarkOptions, type WatermarkPosition, WindowFrame, canvas, colors, createPlotArea, cropPixels, defineIllustration, detectBackgroundColor, detectContentBounds, detectOverflow, formatMathText, getColor, getFonts, getGradient, getStyles, getThemeColors, getToneColor, getToneGradient, gradients, heatColor, loadAdditionalAsset, normalizeWatermark, renderAnimatedGif, renderToBuffer, renderToPng, renderToSvg, styles, toneGradients, typography, wrapWithBrand, wrapWithWatermark };
|