@dashspec/renderer 0.0.0-stage → 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/CHANGELOG.md +81 -0
- package/LICENSE +21 -0
- package/README.md +317 -2
- package/dist/chunk-M4WXE3FW.js +254 -0
- package/dist/chunk-M4WXE3FW.js.map +1 -0
- package/dist/chunk-NLKXHTLO.js +178 -0
- package/dist/chunk-NLKXHTLO.js.map +1 -0
- package/dist/chunk-S4EW5IEA.js +3372 -0
- package/dist/chunk-S4EW5IEA.js.map +1 -0
- package/dist/core-C8ay_SoY.d.ts +7611 -0
- package/dist/core.d.ts +3 -0
- package/dist/core.js +167 -0
- package/dist/core.js.map +1 -0
- package/dist/index-CdW6ugMG.d.ts +27 -0
- package/dist/index.d.ts +1434 -0
- package/dist/index.js +7638 -0
- package/dist/index.js.map +1 -0
- package/dist/sandbox-WEMG76LE.js +10 -0
- package/dist/sandbox-WEMG76LE.js.map +1 -0
- package/dist/sandbox.d.ts +15 -0
- package/dist/sandbox.js +8 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/schema.json +3060 -0
- package/docs/README.md +25 -0
- package/docs/api.md +513 -0
- package/docs/data.md +582 -0
- package/docs/design-systems.md +227 -0
- package/docs/getting-started.md +242 -0
- package/docs/json-format.md +346 -0
- package/docs/security.md +141 -0
- package/docs/server-rendering.md +126 -0
- package/docs/state-and-events.md +551 -0
- package/docs/theming.md +244 -0
- package/docs/widgets.md +606 -0
- package/package.json +104 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1434 @@
|
|
|
1
|
+
import { A as AnyWidgetDefinition, T as TreeState, H as HttpClient, R as ResolvedRequest, a as TimeSettings, D as Dashboard, N as NetworkOptions, J as JsonValue, S as Scope, W as WidgetDefinition, b as SlotDefinition, c as SlotRenderOptions, d as WidgetMeta, e as WidgetProps } from './core-C8ay_SoY.js';
|
|
2
|
+
export { f as ACTION_KINDS, g as ACTION_SCHEMAS, h as API_VERSION, i as Action, j as ActionRef, k as Auth, B as BREAKPOINTS, l as BUILT_IN_DATASOURCE_TYPES, C as Callback, m as Connection, n as ConnectionSpec, o as DATE_PRESETS, p as DashboardInput, q as DataBinding, r as DataError, s as DataErrorCode, t as Datasource, u as DateRange, v as Display, w as Drill, x as Duration, E as Emit, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, K as Handler, L as HelperSettings, M as Helpers, O as HttpClientInternals, P as Id, Q as Layout, U as LayoutItem, V as LoadOptions, X as LoadResult, Y as Metadata, Z as MigrateResult, _ as MigrationError, $ as Modal, a0 as NamedAction, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a5 as PanelState, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, ac as SCHEMA_URL, ad as Severity, ae as Spec, af as Template, ag as TokenSource, ah as TransformError, ai as TransformOptions, aj as TransformStep, ak as Translations, al as VARIABLE_KINDS, am as ValidateOptions, an as ValidationResult, ao as Variable, ap as WidgetCheck, aq as WidgetMigrations, ar as WidgetStore, as as applyTransform, at as buildRequestUrl, au as buildUrl, av as builtInWidgetChecks, aw as collectReferences, ax as compile, ay as createHelpers, az as createHttpClient, aA as dashboardJsonSchema, aB as evaluate, aC as evaluateSafe, aD as expressionReferences, aE as graphqlData, aF as interpolate, aG as interpolateUrl, aH as isCallbackSource, aI as isSafeUrl, aJ as loadDocument, aK as mergeConnections, aL as migrateDocument, aM as parse, aN as parseDuration, aO as placeholders, aP as plantDate, aQ as plantDayStart, aR as resolve, aS as resolveBaseUrl, aT as resolveRequest, aU as safeLink, aV as satisfies, aW as scope, aX as templateReferences, aY as translator, aZ as validateDocument } from './core-C8ay_SoY.js';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { CSSProperties, ReactNode, ComponentType } from 'react';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import * as zod from 'zod';
|
|
7
|
+
import { ZodTypeAny, z } from 'zod';
|
|
8
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
9
|
+
import { C as CallbackApi, a as ScriptMode, S as ScriptRunner } from './index-CdW6ugMG.js';
|
|
10
|
+
export { o as offRunner, t as trustedRunner } from './index-CdW6ugMG.js';
|
|
11
|
+
|
|
12
|
+
/** Immutable get/set by dot path ("panels.kpi.selection" or ["panels", "kpi"]). */
|
|
13
|
+
type Path = string | readonly (string | number)[];
|
|
14
|
+
|
|
15
|
+
interface Option {
|
|
16
|
+
value: unknown;
|
|
17
|
+
label: string;
|
|
18
|
+
count?: number;
|
|
19
|
+
}
|
|
20
|
+
declare function SelectControl({ label, options, value, onChange, stepper, allLabel, size, block, plain, ariaLabel, }: {
|
|
21
|
+
label?: string | undefined;
|
|
22
|
+
options: Option[];
|
|
23
|
+
value: unknown;
|
|
24
|
+
onChange: (v: unknown) => void;
|
|
25
|
+
stepper?: boolean | undefined;
|
|
26
|
+
allLabel?: string;
|
|
27
|
+
/** "sm" for tables and panel headers. */
|
|
28
|
+
size?: "sm" | undefined;
|
|
29
|
+
/** Full width, like a form field. */
|
|
30
|
+
block?: boolean | undefined;
|
|
31
|
+
/** Value in normal text colour (forms) instead of blue (filters). */
|
|
32
|
+
plain?: boolean | undefined;
|
|
33
|
+
ariaLabel?: string | undefined;
|
|
34
|
+
}): react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare function MultiSelectControl({ label, options, value, onChange, emptyLabel, block, plain, ariaLabel, }: {
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
options: Option[];
|
|
38
|
+
value: unknown;
|
|
39
|
+
onChange: (v: unknown[]) => void;
|
|
40
|
+
/** Shown when nothing is chosen (default "All"). */
|
|
41
|
+
emptyLabel?: string;
|
|
42
|
+
block?: boolean;
|
|
43
|
+
plain?: boolean;
|
|
44
|
+
ariaLabel?: string;
|
|
45
|
+
}): react_jsx_runtime.JSX.Element;
|
|
46
|
+
interface DateRangeValue$1 {
|
|
47
|
+
from?: string;
|
|
48
|
+
to?: string;
|
|
49
|
+
preset?: string;
|
|
50
|
+
}
|
|
51
|
+
/** Presets on the left, a month calendar on the right; a custom range applies with a button. */
|
|
52
|
+
declare function DateRangeControl({ label, presets, presetLabel, presetRange, value, min, max, maxDays, locale, single, onChange, onReject, }: {
|
|
53
|
+
label?: string | undefined;
|
|
54
|
+
presets: string[];
|
|
55
|
+
presetLabel: (p: string) => string;
|
|
56
|
+
presetRange: (p: string) => {
|
|
57
|
+
from: string;
|
|
58
|
+
to: string;
|
|
59
|
+
};
|
|
60
|
+
value: DateRangeValue$1;
|
|
61
|
+
min?: string | undefined;
|
|
62
|
+
max?: string | undefined;
|
|
63
|
+
maxDays?: number | undefined;
|
|
64
|
+
locale?: string | undefined;
|
|
65
|
+
/** One date instead of a range. */
|
|
66
|
+
single?: boolean;
|
|
67
|
+
onChange: (v: DateRangeValue$1) => void;
|
|
68
|
+
onReject?: (message: string) => void;
|
|
69
|
+
}): react_jsx_runtime.JSX.Element;
|
|
70
|
+
declare function DateControl({ label, value, min, max, stepper, locale, onChange, }: {
|
|
71
|
+
label?: string | undefined;
|
|
72
|
+
value: string;
|
|
73
|
+
min?: string | undefined;
|
|
74
|
+
max?: string | undefined;
|
|
75
|
+
stepper?: boolean | undefined;
|
|
76
|
+
locale?: string | undefined;
|
|
77
|
+
onChange: (v: string) => void;
|
|
78
|
+
}): react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The DashSpec token contract. Widgets read only these tokens, through `--ds-*` CSS variables,
|
|
82
|
+
* never a UI library's theme. Colours change per mode; everything else is shared by both modes.
|
|
83
|
+
*/
|
|
84
|
+
type ThemeMode = "light" | "dark";
|
|
85
|
+
type StatusTone = "good" | "warn" | "bad" | "neutral" | "info";
|
|
86
|
+
interface StatusColors {
|
|
87
|
+
/** Text and icons on `bg`. */
|
|
88
|
+
fg: string;
|
|
89
|
+
bg: string;
|
|
90
|
+
border: string;
|
|
91
|
+
/** Solid colour for marks: dots, bars, gauge bands. */
|
|
92
|
+
solid: string;
|
|
93
|
+
}
|
|
94
|
+
interface ColorTokens {
|
|
95
|
+
surface: {
|
|
96
|
+
page: string;
|
|
97
|
+
card: string;
|
|
98
|
+
sunken: string;
|
|
99
|
+
overlay: string;
|
|
100
|
+
selection: string;
|
|
101
|
+
scrim: string;
|
|
102
|
+
/** A CSS background for the dashboard page (e.g. a soft gradient); defaults to `page`. */
|
|
103
|
+
backdrop?: string;
|
|
104
|
+
/** Table header rows. Defaults to `sunken`. */
|
|
105
|
+
tableHeader?: string;
|
|
106
|
+
};
|
|
107
|
+
text: {
|
|
108
|
+
primary: string;
|
|
109
|
+
secondary: string;
|
|
110
|
+
subtle: string;
|
|
111
|
+
disabled: string;
|
|
112
|
+
onFill: string;
|
|
113
|
+
};
|
|
114
|
+
border: {
|
|
115
|
+
default: string;
|
|
116
|
+
control: string;
|
|
117
|
+
focus: string;
|
|
118
|
+
};
|
|
119
|
+
action: {
|
|
120
|
+
primary: string;
|
|
121
|
+
primaryHover: string;
|
|
122
|
+
primaryActive: string;
|
|
123
|
+
onPrimary: string;
|
|
124
|
+
};
|
|
125
|
+
status: Record<StatusTone, StatusColors>;
|
|
126
|
+
chart: {
|
|
127
|
+
/** Categorical series colours, in order. */
|
|
128
|
+
series: string[];
|
|
129
|
+
/** Low → high, for heatmaps and matrix charts. */
|
|
130
|
+
sequential: string[];
|
|
131
|
+
axis: string;
|
|
132
|
+
grid: string;
|
|
133
|
+
tooltipBg: string;
|
|
134
|
+
tooltipText: string;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
interface TypeRole {
|
|
138
|
+
family: "heading" | "body" | "data";
|
|
139
|
+
size: number;
|
|
140
|
+
weight: number;
|
|
141
|
+
lineHeight: number;
|
|
142
|
+
letterSpacing?: string;
|
|
143
|
+
}
|
|
144
|
+
interface ScaleTokens {
|
|
145
|
+
font: {
|
|
146
|
+
heading: string;
|
|
147
|
+
body: string;
|
|
148
|
+
/** Numbers in KPIs, tables and axes; rendered with tabular figures. */
|
|
149
|
+
data: string;
|
|
150
|
+
roles: {
|
|
151
|
+
display: TypeRole;
|
|
152
|
+
title: TypeRole;
|
|
153
|
+
heading: TypeRole;
|
|
154
|
+
body: TypeRole;
|
|
155
|
+
label: TypeRole;
|
|
156
|
+
caption: TypeRole;
|
|
157
|
+
kpi: TypeRole;
|
|
158
|
+
data: TypeRole;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
/** px */
|
|
162
|
+
space: {
|
|
163
|
+
xxs: number;
|
|
164
|
+
xs: number;
|
|
165
|
+
sm: number;
|
|
166
|
+
md: number;
|
|
167
|
+
lg: number;
|
|
168
|
+
xl: number;
|
|
169
|
+
xxl: number;
|
|
170
|
+
};
|
|
171
|
+
/** px */
|
|
172
|
+
radius: {
|
|
173
|
+
control: number;
|
|
174
|
+
card: number;
|
|
175
|
+
sheet: number;
|
|
176
|
+
full: number;
|
|
177
|
+
};
|
|
178
|
+
shadow: {
|
|
179
|
+
raised: string;
|
|
180
|
+
overlay: string;
|
|
181
|
+
};
|
|
182
|
+
motion: {
|
|
183
|
+
fast: number;
|
|
184
|
+
normal: number;
|
|
185
|
+
slow: number;
|
|
186
|
+
easing: string;
|
|
187
|
+
enter: string;
|
|
188
|
+
exit: string;
|
|
189
|
+
};
|
|
190
|
+
z: {
|
|
191
|
+
raised: number;
|
|
192
|
+
sticky: number;
|
|
193
|
+
overlay: number;
|
|
194
|
+
tooltip: number;
|
|
195
|
+
};
|
|
196
|
+
/** Min widths, px. Match the grid breakpoints. */
|
|
197
|
+
breakpoints: {
|
|
198
|
+
sm: number;
|
|
199
|
+
md: number;
|
|
200
|
+
lg: number;
|
|
201
|
+
xl: number;
|
|
202
|
+
tv: number;
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* How tight the chrome is: scales every `--ds-space-*` (compact ×0.75, comfortable ×1, spacious ×1.25) and sets
|
|
206
|
+
* `--ds-control-height` (30, 36, 42 px) for filters, buttons and inputs.
|
|
207
|
+
*/
|
|
208
|
+
density: "compact" | "comfortable" | "spacious";
|
|
209
|
+
}
|
|
210
|
+
interface Theme {
|
|
211
|
+
name: string;
|
|
212
|
+
/** `auto` follows the viewer's system setting. */
|
|
213
|
+
mode: ThemeMode | "auto";
|
|
214
|
+
scale: ScaleTokens;
|
|
215
|
+
light: ColorTokens;
|
|
216
|
+
dark: ColorTokens;
|
|
217
|
+
}
|
|
218
|
+
type DeepPartial<T> = T extends readonly (infer _U)[] ? T : T extends object ? {
|
|
219
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
220
|
+
} : T;
|
|
221
|
+
|
|
222
|
+
/** The short form (colours, font, radius, density…), plus full per-mode token overrides. */
|
|
223
|
+
interface ThemeInput {
|
|
224
|
+
name?: string;
|
|
225
|
+
mode?: Theme["mode"];
|
|
226
|
+
/** Start from another theme instead of the default. */
|
|
227
|
+
extends?: Theme;
|
|
228
|
+
/** Shortcuts applied to both modes. */
|
|
229
|
+
colors?: {
|
|
230
|
+
primary?: string;
|
|
231
|
+
good?: string;
|
|
232
|
+
warn?: string;
|
|
233
|
+
bad?: string;
|
|
234
|
+
series?: string[];
|
|
235
|
+
};
|
|
236
|
+
font?: {
|
|
237
|
+
family?: string;
|
|
238
|
+
heading?: string;
|
|
239
|
+
data?: string;
|
|
240
|
+
};
|
|
241
|
+
/** Card corner radius in px; controls get half. */
|
|
242
|
+
radius?: number;
|
|
243
|
+
density?: ScaleTokens["density"];
|
|
244
|
+
scale?: DeepPartial<ScaleTokens>;
|
|
245
|
+
light?: DeepPartial<ColorTokens>;
|
|
246
|
+
dark?: DeepPartial<ColorTokens>;
|
|
247
|
+
}
|
|
248
|
+
/** Deep merge for plain objects; arrays and primitives replace. Never mutates. */
|
|
249
|
+
declare function mergeDeep<T>(base: T, patch: DeepPartial<NoInfer<T>> | undefined): T;
|
|
250
|
+
declare function createTheme(input?: ThemeInput): Theme;
|
|
251
|
+
declare function resolveMode(theme: Theme, prefersDark: boolean): ThemeMode;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Every token as a `--ds-*` CSS variable for one mode, e.g. `--ds-color-surface-card`,
|
|
255
|
+
* `--ds-space-md` (scaled by `density`), `--ds-control-height`, `--ds-type-kpi-size`, plus the short aliases
|
|
256
|
+
* (`--ds-primary`, `--ds-good`, `--ds-warn`, `--ds-bad`, `--ds-font`, `--ds-radius`, `--ds-series-N`).
|
|
257
|
+
*/
|
|
258
|
+
declare function themeCssVars(theme: Theme, mode: ThemeMode): Record<string, string>;
|
|
259
|
+
/**
|
|
260
|
+
* A stylesheet for non-React hosts: light on the selector, dark under `[data-ds-theme="dark"]`. Tokens whose name or
|
|
261
|
+
* value could break out of the declaration (a host theme built from user input) are left out.
|
|
262
|
+
*/
|
|
263
|
+
declare function themeStylesheet(theme: Theme, selector?: string): string;
|
|
264
|
+
|
|
265
|
+
/** DashSpec's neutral default. Brand themes made with `createTheme` start from it. */
|
|
266
|
+
declare const defaultTheme: Theme;
|
|
267
|
+
|
|
268
|
+
/** An ECharts theme object built from the same tokens, so charts match every other widget. */
|
|
269
|
+
declare function echartsTheme(theme: Theme, mode: ThemeMode): {
|
|
270
|
+
color: string[];
|
|
271
|
+
backgroundColor: string;
|
|
272
|
+
textStyle: {
|
|
273
|
+
fontFamily: string;
|
|
274
|
+
color: string;
|
|
275
|
+
};
|
|
276
|
+
title: {
|
|
277
|
+
textStyle: {
|
|
278
|
+
color: string;
|
|
279
|
+
fontFamily: string;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
legend: {
|
|
283
|
+
textStyle: {
|
|
284
|
+
color: string;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
tooltip: {
|
|
288
|
+
backgroundColor: string;
|
|
289
|
+
borderWidth: number;
|
|
290
|
+
padding: number[];
|
|
291
|
+
textStyle: {
|
|
292
|
+
color: string;
|
|
293
|
+
fontFamily: string;
|
|
294
|
+
fontSize: number;
|
|
295
|
+
};
|
|
296
|
+
extraCssText: string;
|
|
297
|
+
axisPointer: {
|
|
298
|
+
shadowStyle: {
|
|
299
|
+
color: string;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
categoryAxis: {
|
|
304
|
+
axisLine: {
|
|
305
|
+
show: boolean;
|
|
306
|
+
lineStyle: {
|
|
307
|
+
color: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
axisTick: {
|
|
311
|
+
show: boolean;
|
|
312
|
+
};
|
|
313
|
+
axisLabel: {
|
|
314
|
+
margin: number;
|
|
315
|
+
color: string;
|
|
316
|
+
fontFamily: string;
|
|
317
|
+
fontSize: number;
|
|
318
|
+
};
|
|
319
|
+
splitLine: {
|
|
320
|
+
show: boolean;
|
|
321
|
+
};
|
|
322
|
+
nameTextStyle: {
|
|
323
|
+
color: string;
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
valueAxis: {
|
|
327
|
+
axisLine: {
|
|
328
|
+
show: boolean;
|
|
329
|
+
};
|
|
330
|
+
axisTick: {
|
|
331
|
+
show: boolean;
|
|
332
|
+
};
|
|
333
|
+
axisLabel: {
|
|
334
|
+
color: string;
|
|
335
|
+
fontFamily: string;
|
|
336
|
+
fontSize: number;
|
|
337
|
+
};
|
|
338
|
+
splitLine: {
|
|
339
|
+
lineStyle: {
|
|
340
|
+
color: string;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
splitNumber: number;
|
|
344
|
+
nameTextStyle: {
|
|
345
|
+
color: string;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
timeAxis: {
|
|
349
|
+
axisLine: {
|
|
350
|
+
show: boolean;
|
|
351
|
+
lineStyle: {
|
|
352
|
+
color: string;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
axisTick: {
|
|
356
|
+
show: boolean;
|
|
357
|
+
};
|
|
358
|
+
axisLabel: {
|
|
359
|
+
margin: number;
|
|
360
|
+
color: string;
|
|
361
|
+
fontFamily: string;
|
|
362
|
+
fontSize: number;
|
|
363
|
+
};
|
|
364
|
+
splitLine: {
|
|
365
|
+
show: boolean;
|
|
366
|
+
};
|
|
367
|
+
nameTextStyle: {
|
|
368
|
+
color: string;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
logAxis: {
|
|
372
|
+
axisLine: {
|
|
373
|
+
show: boolean;
|
|
374
|
+
};
|
|
375
|
+
axisTick: {
|
|
376
|
+
show: boolean;
|
|
377
|
+
};
|
|
378
|
+
axisLabel: {
|
|
379
|
+
color: string;
|
|
380
|
+
fontFamily: string;
|
|
381
|
+
fontSize: number;
|
|
382
|
+
};
|
|
383
|
+
splitLine: {
|
|
384
|
+
lineStyle: {
|
|
385
|
+
color: string;
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
splitNumber: number;
|
|
389
|
+
nameTextStyle: {
|
|
390
|
+
color: string;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
visualMap: {
|
|
394
|
+
inRange: {
|
|
395
|
+
color: string[];
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
/** The theme and resolved mode, for widgets that need values rather than CSS variables (charts). */
|
|
401
|
+
declare const ThemeContext: react.Context<{
|
|
402
|
+
theme: Theme;
|
|
403
|
+
mode: ThemeMode;
|
|
404
|
+
} | null>;
|
|
405
|
+
declare const useThemeTokens: () => {
|
|
406
|
+
theme: Theme;
|
|
407
|
+
mode: ThemeMode;
|
|
408
|
+
} | null;
|
|
409
|
+
interface ThemeScopeProps {
|
|
410
|
+
theme: Theme;
|
|
411
|
+
/** Overrides `theme.mode`. */
|
|
412
|
+
mode?: ThemeMode | "auto";
|
|
413
|
+
className?: string;
|
|
414
|
+
style?: CSSProperties;
|
|
415
|
+
children?: ReactNode;
|
|
416
|
+
}
|
|
417
|
+
/** Sets the theme's `--ds-*` variables on one element; widgets inside read only those. Never touches `<html>`. */
|
|
418
|
+
declare function ThemeScope({ theme, mode, className, style, children }: ThemeScopeProps): react_jsx_runtime.JSX.Element;
|
|
419
|
+
|
|
420
|
+
/** Every control gets the filter's name (for forms and labels) and its label. */
|
|
421
|
+
interface Base {
|
|
422
|
+
name: string;
|
|
423
|
+
label?: string | undefined;
|
|
424
|
+
}
|
|
425
|
+
interface UISelectProps extends Base {
|
|
426
|
+
options: Option[];
|
|
427
|
+
value: unknown;
|
|
428
|
+
onChange: (value: unknown) => void;
|
|
429
|
+
/** Show ← → buttons for the previous and next option. */
|
|
430
|
+
stepper?: boolean;
|
|
431
|
+
}
|
|
432
|
+
interface UIMultiSelectProps extends Base {
|
|
433
|
+
options: Option[];
|
|
434
|
+
value: unknown[];
|
|
435
|
+
onChange: (value: unknown[]) => void;
|
|
436
|
+
}
|
|
437
|
+
interface UIDateProps extends Base {
|
|
438
|
+
/** YYYY-MM-DD */
|
|
439
|
+
value: string;
|
|
440
|
+
onChange: (value: string) => void;
|
|
441
|
+
min?: string | undefined;
|
|
442
|
+
max?: string | undefined;
|
|
443
|
+
stepper?: boolean;
|
|
444
|
+
}
|
|
445
|
+
interface UIDateRangeProps extends Base {
|
|
446
|
+
value: DateRangeValue$1;
|
|
447
|
+
onChange: (value: DateRangeValue$1) => void;
|
|
448
|
+
/** Named ranges (today, last7days…) with their labels and dates. */
|
|
449
|
+
presets: {
|
|
450
|
+
value: string;
|
|
451
|
+
label: string;
|
|
452
|
+
from: string;
|
|
453
|
+
to: string;
|
|
454
|
+
}[];
|
|
455
|
+
min?: string | undefined;
|
|
456
|
+
max?: string | undefined;
|
|
457
|
+
maxDays?: number | undefined;
|
|
458
|
+
}
|
|
459
|
+
interface UISearchProps extends Base {
|
|
460
|
+
value: string;
|
|
461
|
+
/** Debounced by DashSpec; call it on every keystroke. */
|
|
462
|
+
onChange: (value: string) => void;
|
|
463
|
+
placeholder?: string | undefined;
|
|
464
|
+
}
|
|
465
|
+
interface UIToggleProps extends Base {
|
|
466
|
+
value: boolean;
|
|
467
|
+
onChange: (value: boolean) => void;
|
|
468
|
+
}
|
|
469
|
+
interface UIChipsProps extends Base {
|
|
470
|
+
options: Option[];
|
|
471
|
+
value: unknown;
|
|
472
|
+
onChange: (value: unknown) => void;
|
|
473
|
+
multiple: boolean;
|
|
474
|
+
}
|
|
475
|
+
/** A filter of your own kind ("acme.ShiftPicker"): its whole definition from the JSON is in `config`. */
|
|
476
|
+
interface UICustomFilterProps extends Base {
|
|
477
|
+
value: unknown;
|
|
478
|
+
onChange: (value: unknown) => void;
|
|
479
|
+
config: Record<string, unknown>;
|
|
480
|
+
}
|
|
481
|
+
interface UIStateProps {
|
|
482
|
+
panel: string;
|
|
483
|
+
message?: string | undefined;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Controls DashSpec draws itself (filters, panel controls, empty / error / loading states). A design system can
|
|
487
|
+
* replace any of them; the rest stay DashSpec's own. Each receives the props above and nothing else.
|
|
488
|
+
*/
|
|
489
|
+
interface UIComponents {
|
|
490
|
+
Select?: ComponentType<UISelectProps>;
|
|
491
|
+
MultiSelect?: ComponentType<UIMultiSelectProps>;
|
|
492
|
+
Date?: ComponentType<UIDateProps>;
|
|
493
|
+
DateRange?: ComponentType<UIDateRangeProps>;
|
|
494
|
+
Search?: ComponentType<UISearchProps>;
|
|
495
|
+
Toggle?: ComponentType<UIToggleProps>;
|
|
496
|
+
Chips?: ComponentType<UIChipsProps>;
|
|
497
|
+
EmptyState?: ComponentType<UIStateProps>;
|
|
498
|
+
ErrorState?: ComponentType<UIStateProps>;
|
|
499
|
+
Loading?: ComponentType<UIStateProps>;
|
|
500
|
+
/** Controls for your own filter kinds, by namespaced kind: { "acme.ShiftPicker": ShiftPicker }. */
|
|
501
|
+
filters?: Record<string, ComponentType<UICustomFilterProps>>;
|
|
502
|
+
}
|
|
503
|
+
/** A design system packaged for DashSpec: any team's (MUI, Ant, Chakra, in-house…). */
|
|
504
|
+
interface DesignSystem {
|
|
505
|
+
/** Shown as the palette group of its widgets, e.g. "MUI", "Acme". */
|
|
506
|
+
name: string;
|
|
507
|
+
/** Its components as widgets (wrapComponent / defineWidget), kinds namespaced like "mui.DataGrid". */
|
|
508
|
+
widgets?: readonly AnyWidgetDefinition[];
|
|
509
|
+
/** Its controls for DashSpec's own UI. */
|
|
510
|
+
ui?: UIComponents;
|
|
511
|
+
/** Its look as DashSpec tokens (createTheme), used when the host passes no `theme`. */
|
|
512
|
+
theme?: Theme;
|
|
513
|
+
}
|
|
514
|
+
/** Declares a design system; widgets without a palette category are grouped under its name. */
|
|
515
|
+
declare function defineDesignSystem(ds: DesignSystem): DesignSystem;
|
|
516
|
+
/** Several design systems combined: all their widgets; for controls and theme, later ones win. */
|
|
517
|
+
declare function combineDesignSystems(list?: readonly DesignSystem[]): {
|
|
518
|
+
widgets: AnyWidgetDefinition[];
|
|
519
|
+
ui: UIComponents;
|
|
520
|
+
theme: Theme | undefined;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
type SourceStatus = "idle" | "loading" | "success" | "error";
|
|
524
|
+
/** One datasource's result. */
|
|
525
|
+
interface SourceState {
|
|
526
|
+
status: SourceStatus;
|
|
527
|
+
data?: unknown;
|
|
528
|
+
error?: {
|
|
529
|
+
code: string;
|
|
530
|
+
message: string;
|
|
531
|
+
status?: number;
|
|
532
|
+
datasource?: string;
|
|
533
|
+
};
|
|
534
|
+
/** Epoch ms of the last success. */
|
|
535
|
+
updatedAt?: number;
|
|
536
|
+
/** The resolved request the data belongs to. */
|
|
537
|
+
key?: string;
|
|
538
|
+
/** True while showing older data after a failed refresh (`onError: keepLast`). */
|
|
539
|
+
stale?: boolean;
|
|
540
|
+
/** Live sources: true while the stream is open. */
|
|
541
|
+
live?: boolean;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
type Obj$6 = Record<string, unknown>;
|
|
545
|
+
/** Everything expressions, actions and callbacks read. */
|
|
546
|
+
interface Tree extends TreeState {
|
|
547
|
+
datasources: Record<string, SourceState>;
|
|
548
|
+
context: Obj$6;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
type Obj$5 = Record<string, unknown>;
|
|
552
|
+
/** A datasource type registered with `defineDatasource`. */
|
|
553
|
+
interface DatasourceType {
|
|
554
|
+
type: string;
|
|
555
|
+
fetch?(ds: Obj$5, ctx: {
|
|
556
|
+
http: HttpClient;
|
|
557
|
+
request: (r: ResolvedRequest) => Promise<unknown>;
|
|
558
|
+
signal: AbortSignal;
|
|
559
|
+
tree: Tree;
|
|
560
|
+
}): Promise<unknown>;
|
|
561
|
+
subscribe?(ds: Obj$5, ctx: {
|
|
562
|
+
http: HttpClient;
|
|
563
|
+
push: (data: unknown) => void;
|
|
564
|
+
tree: Tree;
|
|
565
|
+
}): () => void;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
type Obj$4 = Record<string, unknown>;
|
|
569
|
+
/** What happened: the event object every handler receives. */
|
|
570
|
+
interface DashEvent {
|
|
571
|
+
type: string;
|
|
572
|
+
panel?: string;
|
|
573
|
+
part?: string;
|
|
574
|
+
datum?: unknown;
|
|
575
|
+
value?: unknown;
|
|
576
|
+
series?: string;
|
|
577
|
+
index?: number;
|
|
578
|
+
x?: unknown;
|
|
579
|
+
y?: unknown;
|
|
580
|
+
[k: string]: unknown;
|
|
581
|
+
}
|
|
582
|
+
/** Host hooks the runner calls out to. */
|
|
583
|
+
interface HostHooks {
|
|
584
|
+
navigate?: (to: string, opts: {
|
|
585
|
+
newTab?: boolean;
|
|
586
|
+
}) => void;
|
|
587
|
+
openDashboard?: (key: string, filters: Obj$4, opts: {
|
|
588
|
+
newTab?: boolean;
|
|
589
|
+
}) => void;
|
|
590
|
+
onEvent?: (name: string, payload: unknown) => void;
|
|
591
|
+
toast?: (message: string, tone?: string) => void;
|
|
592
|
+
functions?: Record<string, (args: unknown) => unknown>;
|
|
593
|
+
fullscreen?: (panel?: string) => void;
|
|
594
|
+
exportData?: (rows: unknown, opts: {
|
|
595
|
+
panel: string;
|
|
596
|
+
format: "csv" | "xlsx";
|
|
597
|
+
filename: string;
|
|
598
|
+
}) => void;
|
|
599
|
+
download?: (data: unknown, filename: string) => void;
|
|
600
|
+
onError?: (e: {
|
|
601
|
+
code: string;
|
|
602
|
+
message: string;
|
|
603
|
+
panel?: string;
|
|
604
|
+
}) => void;
|
|
605
|
+
/**
|
|
606
|
+
* The host's own actions, by namespaced name ("acme.notify"): `{ "do": "acme.notify", … }` runs it with the
|
|
607
|
+
* action's fields (templates filled) and the event, and can use the callback API (state, filters, run…).
|
|
608
|
+
*/
|
|
609
|
+
actions?: Record<string, (action: Obj$4, ctx: {
|
|
610
|
+
event: DashEvent | undefined;
|
|
611
|
+
api: CallbackApi;
|
|
612
|
+
}) => unknown>;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
interface DateRangeValue {
|
|
616
|
+
from: string;
|
|
617
|
+
to: string;
|
|
618
|
+
preset?: string;
|
|
619
|
+
}
|
|
620
|
+
/** A preset → plant dates, inclusive. */
|
|
621
|
+
declare function presetRange(preset: string, t: TimeSettings): DateRangeValue;
|
|
622
|
+
|
|
623
|
+
type Obj$3 = Record<string, unknown>;
|
|
624
|
+
interface RuntimeOptions {
|
|
625
|
+
/** The host's `context` prop: user, roles, permissions, tenant, locale. */
|
|
626
|
+
context?: Obj$3;
|
|
627
|
+
/** Data for `host` datasources, by key (the `data` prop). */
|
|
628
|
+
data?: Obj$3;
|
|
629
|
+
network?: NetworkOptions;
|
|
630
|
+
/** A runner, or a mode name. `sandbox` needs `sandboxRunner` (loaded on demand by the React layer). */
|
|
631
|
+
scripts?: ScriptMode | ScriptRunner;
|
|
632
|
+
sandboxRunner?: ScriptRunner;
|
|
633
|
+
hooks?: HostHooks;
|
|
634
|
+
datasourceTypes?: readonly DatasourceType[];
|
|
635
|
+
/** Restored from the URL: filter values and the view. */
|
|
636
|
+
initial?: {
|
|
637
|
+
filters?: Obj$3;
|
|
638
|
+
view?: string | null;
|
|
639
|
+
state?: Obj$3;
|
|
640
|
+
};
|
|
641
|
+
time?: Partial<TimeSettings>;
|
|
642
|
+
maxRows?: number;
|
|
643
|
+
/** Start loading at once (default). React hosts pass false and call start()/stop() from an effect. */
|
|
644
|
+
autoStart?: boolean;
|
|
645
|
+
/** Timer and page-visibility hooks; replaced in tests. */
|
|
646
|
+
scheduler?: {
|
|
647
|
+
setTimer?: (fn: () => void, ms: number) => unknown;
|
|
648
|
+
clearTimer?: (t: unknown) => void;
|
|
649
|
+
isPageHidden?: () => boolean;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* The dashboard's time settings: the document's `display` (the author's intent), with the host's `time` option
|
|
654
|
+
* winning only for the fields it gives. Helpers, filter defaults and dependent-filter resets all use this one object.
|
|
655
|
+
*/
|
|
656
|
+
declare function timeSettingsFor(doc: Dashboard, time?: Partial<TimeSettings>): TimeSettings;
|
|
657
|
+
/** The rows a panel shows, read from the tree the way PanelFrame binds `spec.data` (for `export`). */
|
|
658
|
+
declare function panelRows(doc: Dashboard, tree: Tree, panelId: string, datasourceIds: ReadonlySet<string>): unknown;
|
|
659
|
+
declare function createDashboardRuntime(doc: Dashboard, options?: RuntimeOptions): {
|
|
660
|
+
store: _reduxjs_toolkit.EnhancedStore<{
|
|
661
|
+
state: TreeState;
|
|
662
|
+
data: Record<string, SourceState>;
|
|
663
|
+
}, _reduxjs_toolkit.UnknownAction, _reduxjs_toolkit.Tuple<[_reduxjs_toolkit.StoreEnhancer<{
|
|
664
|
+
dispatch: _reduxjs_toolkit.ThunkDispatch<{
|
|
665
|
+
state: TreeState;
|
|
666
|
+
data: Record<string, SourceState>;
|
|
667
|
+
}, undefined, _reduxjs_toolkit.UnknownAction>;
|
|
668
|
+
}>, _reduxjs_toolkit.StoreEnhancer]>>;
|
|
669
|
+
doc: {
|
|
670
|
+
kind: "Dashboard";
|
|
671
|
+
spec: {
|
|
672
|
+
panels: Record<string, {
|
|
673
|
+
kind: string;
|
|
674
|
+
version: number;
|
|
675
|
+
spec: Record<string, unknown>;
|
|
676
|
+
drill?: {
|
|
677
|
+
levels: zod.objectOutputType<{
|
|
678
|
+
name: zod.ZodString;
|
|
679
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
680
|
+
x: zod.ZodOptional<zod.ZodString>;
|
|
681
|
+
query: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodType<JsonValue, zod.ZodTypeDef, JsonValue>>>;
|
|
682
|
+
source: zod.ZodOptional<zod.ZodString>;
|
|
683
|
+
do: zod.ZodOptional<zod.ZodString>;
|
|
684
|
+
}, zod.ZodTypeAny, "passthrough">[];
|
|
685
|
+
} | undefined;
|
|
686
|
+
on?: Record<string, string | any[] | {
|
|
687
|
+
run: string | any[];
|
|
688
|
+
mode: "latest" | "parallel" | "queue";
|
|
689
|
+
} | Record<string, string | any[] | {
|
|
690
|
+
run: string | any[];
|
|
691
|
+
mode: "latest" | "parallel" | "queue";
|
|
692
|
+
}>> | undefined;
|
|
693
|
+
description?: string | undefined;
|
|
694
|
+
visibleWhen?: string | undefined;
|
|
695
|
+
style?: {
|
|
696
|
+
tone?: "default" | "subtle" | "accent" | "plain" | undefined;
|
|
697
|
+
padding?: number | "compact" | "none" | "normal" | "roomy" | undefined;
|
|
698
|
+
hideHeader?: boolean | undefined;
|
|
699
|
+
minHeight?: number | undefined;
|
|
700
|
+
background?: string | undefined;
|
|
701
|
+
borderColor?: string | undefined;
|
|
702
|
+
borderWidth?: number | undefined;
|
|
703
|
+
radius?: number | undefined;
|
|
704
|
+
shadow?: "none" | "sm" | "md" | "lg" | undefined;
|
|
705
|
+
flex?: string | undefined;
|
|
706
|
+
minWidth?: string | number | undefined;
|
|
707
|
+
maxWidth?: string | number | undefined;
|
|
708
|
+
align?: "end" | "start" | "center" | "stretch" | undefined;
|
|
709
|
+
} | undefined;
|
|
710
|
+
watch?: {
|
|
711
|
+
path: string;
|
|
712
|
+
do: string | any[] | {
|
|
713
|
+
run: string | any[];
|
|
714
|
+
mode: "latest" | "parallel" | "queue";
|
|
715
|
+
} | Record<string, string | any[] | {
|
|
716
|
+
run: string | any[];
|
|
717
|
+
mode: "latest" | "parallel" | "queue";
|
|
718
|
+
}>;
|
|
719
|
+
}[] | undefined;
|
|
720
|
+
slots?: Record<string, string[]> | undefined;
|
|
721
|
+
controls?: Record<string, unknown>[] | undefined;
|
|
722
|
+
messages?: {
|
|
723
|
+
empty?: string | undefined;
|
|
724
|
+
error?: string | undefined;
|
|
725
|
+
loading?: string | undefined;
|
|
726
|
+
} | undefined;
|
|
727
|
+
}>;
|
|
728
|
+
display: {
|
|
729
|
+
timeZone?: string | undefined;
|
|
730
|
+
translations?: Record<string, Record<string, string>> | undefined;
|
|
731
|
+
filters?: "drawer" | "toolbar" | undefined;
|
|
732
|
+
description?: string | undefined;
|
|
733
|
+
tv?: {
|
|
734
|
+
every?: string | undefined;
|
|
735
|
+
rotateViews?: string[] | undefined;
|
|
736
|
+
hideToolbar?: boolean | undefined;
|
|
737
|
+
} | undefined;
|
|
738
|
+
title?: string | undefined;
|
|
739
|
+
theme?: string | undefined;
|
|
740
|
+
locale?: string | undefined;
|
|
741
|
+
dayStartsAt?: string | undefined;
|
|
742
|
+
filterBar?: {
|
|
743
|
+
show: boolean;
|
|
744
|
+
apply: "button" | "change";
|
|
745
|
+
reset: boolean;
|
|
746
|
+
icon: "filter" | "none" | "sliders" | "calendar" | "search";
|
|
747
|
+
look: "plain" | "card";
|
|
748
|
+
} | undefined;
|
|
749
|
+
syncedLabel?: string | undefined;
|
|
750
|
+
};
|
|
751
|
+
grid: {
|
|
752
|
+
columns: 60 | 12 | 24;
|
|
753
|
+
rowHeight: number;
|
|
754
|
+
gap: number;
|
|
755
|
+
};
|
|
756
|
+
layouts: {
|
|
757
|
+
breakpoint: "desktop" | "tablet" | "mobile" | "tv";
|
|
758
|
+
items?: {
|
|
759
|
+
h: number;
|
|
760
|
+
w: number;
|
|
761
|
+
panel: string;
|
|
762
|
+
x: number;
|
|
763
|
+
y: number;
|
|
764
|
+
minW?: number | undefined;
|
|
765
|
+
minH?: number | undefined;
|
|
766
|
+
}[] | undefined;
|
|
767
|
+
view?: string | undefined;
|
|
768
|
+
label?: string | undefined;
|
|
769
|
+
auto?: "stack" | "flow" | undefined;
|
|
770
|
+
}[];
|
|
771
|
+
datasources?: Record<string, Record<string, unknown>> | undefined;
|
|
772
|
+
state?: Record<string, JsonValue> | undefined;
|
|
773
|
+
on?: Record<string, string | any[] | {
|
|
774
|
+
run: string | any[];
|
|
775
|
+
mode: "latest" | "parallel" | "queue";
|
|
776
|
+
} | Record<string, string | any[] | {
|
|
777
|
+
run: string | any[];
|
|
778
|
+
mode: "latest" | "parallel" | "queue";
|
|
779
|
+
}>> | undefined;
|
|
780
|
+
variables?: Record<string, unknown>[] | undefined;
|
|
781
|
+
connections?: Record<string, {
|
|
782
|
+
headers?: Record<string, string> | undefined;
|
|
783
|
+
description?: string | undefined;
|
|
784
|
+
baseUrl?: string | Record<string, string> | undefined;
|
|
785
|
+
auth?: {
|
|
786
|
+
type: "none";
|
|
787
|
+
} | {
|
|
788
|
+
type: "cookie";
|
|
789
|
+
} | {
|
|
790
|
+
type: "bearer";
|
|
791
|
+
token: {
|
|
792
|
+
from: "host" | "localStorage" | "sessionStorage" | "cookie";
|
|
793
|
+
key?: string | undefined;
|
|
794
|
+
};
|
|
795
|
+
header: string;
|
|
796
|
+
scheme: string;
|
|
797
|
+
refresh?: {
|
|
798
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
799
|
+
url?: string | undefined;
|
|
800
|
+
path?: string | undefined;
|
|
801
|
+
body?: JsonValue | undefined;
|
|
802
|
+
headers?: Record<string, string> | undefined;
|
|
803
|
+
save?: Record<string, string> | undefined;
|
|
804
|
+
} | {
|
|
805
|
+
from: "host";
|
|
806
|
+
} | undefined;
|
|
807
|
+
} | {
|
|
808
|
+
name: string;
|
|
809
|
+
from: {
|
|
810
|
+
from: "host" | "localStorage" | "sessionStorage" | "cookie";
|
|
811
|
+
key?: string | undefined;
|
|
812
|
+
};
|
|
813
|
+
type: "apiKey";
|
|
814
|
+
in: "header" | "query";
|
|
815
|
+
} | {
|
|
816
|
+
type: "headers";
|
|
817
|
+
headers: Record<string, string>;
|
|
818
|
+
} | undefined;
|
|
819
|
+
timeout?: string | undefined;
|
|
820
|
+
retry?: false | {
|
|
821
|
+
times: number;
|
|
822
|
+
backoff: "fixed" | "exponential";
|
|
823
|
+
on?: number[] | undefined;
|
|
824
|
+
} | undefined;
|
|
825
|
+
}> | undefined;
|
|
826
|
+
actions?: Record<string, string | Record<string, unknown>> | undefined;
|
|
827
|
+
templates?: Record<string, {
|
|
828
|
+
root: string;
|
|
829
|
+
nodes: Record<string, {
|
|
830
|
+
kind: string;
|
|
831
|
+
version: number;
|
|
832
|
+
spec: Record<string, unknown>;
|
|
833
|
+
drill?: {
|
|
834
|
+
levels: zod.objectOutputType<{
|
|
835
|
+
name: zod.ZodString;
|
|
836
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
837
|
+
x: zod.ZodOptional<zod.ZodString>;
|
|
838
|
+
query: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodType<JsonValue, zod.ZodTypeDef, JsonValue>>>;
|
|
839
|
+
source: zod.ZodOptional<zod.ZodString>;
|
|
840
|
+
do: zod.ZodOptional<zod.ZodString>;
|
|
841
|
+
}, zod.ZodTypeAny, "passthrough">[];
|
|
842
|
+
} | undefined;
|
|
843
|
+
on?: Record<string, string | any[] | {
|
|
844
|
+
run: string | any[];
|
|
845
|
+
mode: "latest" | "parallel" | "queue";
|
|
846
|
+
} | Record<string, string | any[] | {
|
|
847
|
+
run: string | any[];
|
|
848
|
+
mode: "latest" | "parallel" | "queue";
|
|
849
|
+
}>> | undefined;
|
|
850
|
+
description?: string | undefined;
|
|
851
|
+
visibleWhen?: string | undefined;
|
|
852
|
+
style?: {
|
|
853
|
+
tone?: "default" | "subtle" | "accent" | "plain" | undefined;
|
|
854
|
+
padding?: number | "compact" | "none" | "normal" | "roomy" | undefined;
|
|
855
|
+
hideHeader?: boolean | undefined;
|
|
856
|
+
minHeight?: number | undefined;
|
|
857
|
+
background?: string | undefined;
|
|
858
|
+
borderColor?: string | undefined;
|
|
859
|
+
borderWidth?: number | undefined;
|
|
860
|
+
radius?: number | undefined;
|
|
861
|
+
shadow?: "none" | "sm" | "md" | "lg" | undefined;
|
|
862
|
+
flex?: string | undefined;
|
|
863
|
+
minWidth?: string | number | undefined;
|
|
864
|
+
maxWidth?: string | number | undefined;
|
|
865
|
+
align?: "end" | "start" | "center" | "stretch" | undefined;
|
|
866
|
+
} | undefined;
|
|
867
|
+
watch?: {
|
|
868
|
+
path: string;
|
|
869
|
+
do: string | any[] | {
|
|
870
|
+
run: string | any[];
|
|
871
|
+
mode: "latest" | "parallel" | "queue";
|
|
872
|
+
} | Record<string, string | any[] | {
|
|
873
|
+
run: string | any[];
|
|
874
|
+
mode: "latest" | "parallel" | "queue";
|
|
875
|
+
}>;
|
|
876
|
+
}[] | undefined;
|
|
877
|
+
slots?: Record<string, string[]> | undefined;
|
|
878
|
+
controls?: Record<string, unknown>[] | undefined;
|
|
879
|
+
messages?: {
|
|
880
|
+
empty?: string | undefined;
|
|
881
|
+
error?: string | undefined;
|
|
882
|
+
loading?: string | undefined;
|
|
883
|
+
} | undefined;
|
|
884
|
+
}>;
|
|
885
|
+
label?: string | undefined;
|
|
886
|
+
}> | undefined;
|
|
887
|
+
modals?: Record<string, {
|
|
888
|
+
panels: Record<string, {
|
|
889
|
+
kind: string;
|
|
890
|
+
version: number;
|
|
891
|
+
spec: Record<string, unknown>;
|
|
892
|
+
drill?: {
|
|
893
|
+
levels: zod.objectOutputType<{
|
|
894
|
+
name: zod.ZodString;
|
|
895
|
+
label: zod.ZodOptional<zod.ZodString>;
|
|
896
|
+
x: zod.ZodOptional<zod.ZodString>;
|
|
897
|
+
query: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodType<JsonValue, zod.ZodTypeDef, JsonValue>>>;
|
|
898
|
+
source: zod.ZodOptional<zod.ZodString>;
|
|
899
|
+
do: zod.ZodOptional<zod.ZodString>;
|
|
900
|
+
}, zod.ZodTypeAny, "passthrough">[];
|
|
901
|
+
} | undefined;
|
|
902
|
+
on?: Record<string, string | any[] | {
|
|
903
|
+
run: string | any[];
|
|
904
|
+
mode: "latest" | "parallel" | "queue";
|
|
905
|
+
} | Record<string, string | any[] | {
|
|
906
|
+
run: string | any[];
|
|
907
|
+
mode: "latest" | "parallel" | "queue";
|
|
908
|
+
}>> | undefined;
|
|
909
|
+
description?: string | undefined;
|
|
910
|
+
visibleWhen?: string | undefined;
|
|
911
|
+
style?: {
|
|
912
|
+
tone?: "default" | "subtle" | "accent" | "plain" | undefined;
|
|
913
|
+
padding?: number | "compact" | "none" | "normal" | "roomy" | undefined;
|
|
914
|
+
hideHeader?: boolean | undefined;
|
|
915
|
+
minHeight?: number | undefined;
|
|
916
|
+
background?: string | undefined;
|
|
917
|
+
borderColor?: string | undefined;
|
|
918
|
+
borderWidth?: number | undefined;
|
|
919
|
+
radius?: number | undefined;
|
|
920
|
+
shadow?: "none" | "sm" | "md" | "lg" | undefined;
|
|
921
|
+
flex?: string | undefined;
|
|
922
|
+
minWidth?: string | number | undefined;
|
|
923
|
+
maxWidth?: string | number | undefined;
|
|
924
|
+
align?: "end" | "start" | "center" | "stretch" | undefined;
|
|
925
|
+
} | undefined;
|
|
926
|
+
watch?: {
|
|
927
|
+
path: string;
|
|
928
|
+
do: string | any[] | {
|
|
929
|
+
run: string | any[];
|
|
930
|
+
mode: "latest" | "parallel" | "queue";
|
|
931
|
+
} | Record<string, string | any[] | {
|
|
932
|
+
run: string | any[];
|
|
933
|
+
mode: "latest" | "parallel" | "queue";
|
|
934
|
+
}>;
|
|
935
|
+
}[] | undefined;
|
|
936
|
+
slots?: Record<string, string[]> | undefined;
|
|
937
|
+
controls?: Record<string, unknown>[] | undefined;
|
|
938
|
+
messages?: {
|
|
939
|
+
empty?: string | undefined;
|
|
940
|
+
error?: string | undefined;
|
|
941
|
+
loading?: string | undefined;
|
|
942
|
+
} | undefined;
|
|
943
|
+
}>;
|
|
944
|
+
size: "full" | "sm" | "md" | "lg" | "xl";
|
|
945
|
+
presentation: "modal" | "drawer";
|
|
946
|
+
layout: {
|
|
947
|
+
h: number;
|
|
948
|
+
w: number;
|
|
949
|
+
panel: string;
|
|
950
|
+
x: number;
|
|
951
|
+
y: number;
|
|
952
|
+
minW?: number | undefined;
|
|
953
|
+
minH?: number | undefined;
|
|
954
|
+
}[];
|
|
955
|
+
datasources?: Record<string, Record<string, unknown>> | undefined;
|
|
956
|
+
on?: Record<string, string | any[] | {
|
|
957
|
+
run: string | any[];
|
|
958
|
+
mode: "latest" | "parallel" | "queue";
|
|
959
|
+
} | Record<string, string | any[] | {
|
|
960
|
+
run: string | any[];
|
|
961
|
+
mode: "latest" | "parallel" | "queue";
|
|
962
|
+
}>> | undefined;
|
|
963
|
+
title?: string | undefined;
|
|
964
|
+
open?: string | undefined;
|
|
965
|
+
}> | undefined;
|
|
966
|
+
tour?: {
|
|
967
|
+
text: string;
|
|
968
|
+
panel?: string | undefined;
|
|
969
|
+
title?: string | undefined;
|
|
970
|
+
}[] | undefined;
|
|
971
|
+
requires?: {
|
|
972
|
+
renderer?: string | undefined;
|
|
973
|
+
} | undefined;
|
|
974
|
+
};
|
|
975
|
+
apiVersion: "dashspec.dev/v2";
|
|
976
|
+
metadata: {
|
|
977
|
+
name: string;
|
|
978
|
+
key: string;
|
|
979
|
+
description?: string | undefined;
|
|
980
|
+
group?: string | undefined;
|
|
981
|
+
tags?: string[] | undefined;
|
|
982
|
+
generator?: {
|
|
983
|
+
name: string;
|
|
984
|
+
version?: string | undefined;
|
|
985
|
+
} | undefined;
|
|
986
|
+
};
|
|
987
|
+
$schema?: string | undefined;
|
|
988
|
+
};
|
|
989
|
+
helpers: {
|
|
990
|
+
has: (list: unknown, v: unknown) => boolean;
|
|
991
|
+
len: (v: unknown) => number;
|
|
992
|
+
round: (v: unknown, decimals?: number) => number;
|
|
993
|
+
min: (...v: unknown[]) => number;
|
|
994
|
+
max: (...v: unknown[]) => number;
|
|
995
|
+
sum: (list: unknown, key?: string) => number;
|
|
996
|
+
lookup: (list: unknown, key: string, value: unknown) => any;
|
|
997
|
+
join: (list: unknown, sep?: string) => string;
|
|
998
|
+
lower: (v: unknown) => string;
|
|
999
|
+
upper: (v: unknown) => string;
|
|
1000
|
+
now: () => number;
|
|
1001
|
+
ago: (d: string) => number;
|
|
1002
|
+
dayStart: () => number;
|
|
1003
|
+
today: () => string;
|
|
1004
|
+
includesToday: (r: unknown) => boolean;
|
|
1005
|
+
granularityFor: (r: unknown) => "year" | "month" | "day" | "heat" | "week";
|
|
1006
|
+
fmt: {
|
|
1007
|
+
number: (v: unknown, decimals?: number) => string;
|
|
1008
|
+
compact: (v: unknown) => string;
|
|
1009
|
+
percent: (v: unknown, decimals?: number) => string;
|
|
1010
|
+
duration: (seconds: unknown) => string;
|
|
1011
|
+
date: (v: unknown, style?: "date" | "datetime" | "time") => string;
|
|
1012
|
+
ago: (v: unknown) => string;
|
|
1013
|
+
};
|
|
1014
|
+
t: Record<string, string>;
|
|
1015
|
+
};
|
|
1016
|
+
/** Every datasource id, including the per-level drill ones. */
|
|
1017
|
+
datasourceIds: Set<string>;
|
|
1018
|
+
http: HttpClient;
|
|
1019
|
+
engine: {
|
|
1020
|
+
setVisible(ids: Iterable<string>): void;
|
|
1021
|
+
want(ids: Iterable<string>): void;
|
|
1022
|
+
fetch(id: string, params?: {
|
|
1023
|
+
[x: string]: unknown;
|
|
1024
|
+
}): Promise<unknown>;
|
|
1025
|
+
refresh(ids?: string[]): void;
|
|
1026
|
+
setHostData(data: {
|
|
1027
|
+
[x: string]: unknown;
|
|
1028
|
+
} | undefined): void;
|
|
1029
|
+
sync: () => void;
|
|
1030
|
+
start: () => void;
|
|
1031
|
+
stop: () => void;
|
|
1032
|
+
dispose: () => void;
|
|
1033
|
+
};
|
|
1034
|
+
getTree: () => Tree;
|
|
1035
|
+
/** A widget event (click, hover, rowClick…) with its panel and part. */
|
|
1036
|
+
emit: (event: DashEvent) => Promise<void>;
|
|
1037
|
+
runAction: (a: unknown, event?: DashEvent) => Promise<void>;
|
|
1038
|
+
scopeFor: (event: DashEvent | undefined) => Scope;
|
|
1039
|
+
scripts: ScriptRunner;
|
|
1040
|
+
/**
|
|
1041
|
+
* Replaces the data for `host` datasources (the host's `data` prop) without rebuilding the runtime. Documents
|
|
1042
|
+
* still only read it, through `datasources`.
|
|
1043
|
+
*/
|
|
1044
|
+
setHostData(data: Obj$3 | undefined): void;
|
|
1045
|
+
/**
|
|
1046
|
+
* Replaces the host's `context` (user, roles, tenant…) without rebuilding the runtime. Templates, `visibleWhen`
|
|
1047
|
+
* and requests that read `context` update; documents still can't write it.
|
|
1048
|
+
*/
|
|
1049
|
+
setContext(next: Obj$3 | undefined): void;
|
|
1050
|
+
/** Begins loading; safe to call again after stop. */
|
|
1051
|
+
start: () => void;
|
|
1052
|
+
/** Cancels requests, timers and streams; keeps loaded data. */
|
|
1053
|
+
stop: () => void;
|
|
1054
|
+
dispose: () => void;
|
|
1055
|
+
};
|
|
1056
|
+
type DashboardRuntime = ReturnType<typeof createDashboardRuntime>;
|
|
1057
|
+
|
|
1058
|
+
interface WidgetRegistry {
|
|
1059
|
+
byKind: Map<string, WidgetDefinition>;
|
|
1060
|
+
all: AnyWidgetDefinition[];
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Built-ins plus the host's widgets. Custom kinds are namespaced ("acme.X", "mui.DataGrid") and can't
|
|
1064
|
+
* take a built-in's name; `aliases` points a kind at another one ({ "Table": "acme.Table" }) so existing JSON
|
|
1065
|
+
* switches widget without changes. Both must implement the same role when they declare one.
|
|
1066
|
+
*/
|
|
1067
|
+
declare function createWidgetRegistry(builtIns: readonly AnyWidgetDefinition[], extra?: readonly AnyWidgetDefinition[], aliases?: Readonly<Record<string, string>>): WidgetRegistry;
|
|
1068
|
+
/** Problems in a widget definition (empty when it honours the contract). For hosts' tests and dev warnings. */
|
|
1069
|
+
declare function checkWidget(w: AnyWidgetDefinition): string[];
|
|
1070
|
+
/** What validation and migration need from widgets. */
|
|
1071
|
+
declare const widgetChecks: (r: WidgetRegistry) => {
|
|
1072
|
+
steps?: Record<number, (spec: Record<string, unknown>) => Record<string, unknown>> | undefined;
|
|
1073
|
+
openSlots?: boolean | undefined;
|
|
1074
|
+
small?: boolean | undefined;
|
|
1075
|
+
slots?: Record<string, SlotDefinition> | undefined;
|
|
1076
|
+
kind: string;
|
|
1077
|
+
version: number;
|
|
1078
|
+
schema: any;
|
|
1079
|
+
}[];
|
|
1080
|
+
|
|
1081
|
+
interface RenderOptions {
|
|
1082
|
+
mode: "view" | "preview" | "tv" | "edit";
|
|
1083
|
+
onEvent?: (e: DashEvent) => void;
|
|
1084
|
+
renderEmpty?: (panel: string) => React.ReactNode;
|
|
1085
|
+
renderError?: (error: {
|
|
1086
|
+
code: string;
|
|
1087
|
+
message: string;
|
|
1088
|
+
}, panel?: string) => React.ReactNode;
|
|
1089
|
+
/** `message` is the panel's `messages.loading`, filled, when it sets one. */
|
|
1090
|
+
renderLoading?: (panel: string, message?: string) => React.ReactNode;
|
|
1091
|
+
/** A design system's controls for filters and states. */
|
|
1092
|
+
ui?: UIComponents;
|
|
1093
|
+
/** Builder only. */
|
|
1094
|
+
selectedPanel?: string;
|
|
1095
|
+
/** Builder: a panel was clicked; `part` is the element inside it (title, tile, value, column:<key>…), if any. */
|
|
1096
|
+
onPanelSelect?: (panel: string, part?: string) => void;
|
|
1097
|
+
/** Builder drag and drop: may the current drag (a palette item, or `dragged`) land on this panel? */
|
|
1098
|
+
canDropOn?: (target: string, dragged?: string, slot?: string) => boolean;
|
|
1099
|
+
/** Builder: something was dropped on a panel; `index` is the position among a container's children. */
|
|
1100
|
+
onDropOnPanel?: (target: string, index: number | undefined, dragged?: string, slot?: string) => void;
|
|
1101
|
+
/** Builder: a panel inside a container or a header started being dragged. */
|
|
1102
|
+
onDragPanelStart?: (id: string) => void;
|
|
1103
|
+
/** Builder: a filter in the top filter bar was clicked. */
|
|
1104
|
+
onFilterSelect?: (name: string) => void;
|
|
1105
|
+
selectedFilter?: string;
|
|
1106
|
+
}
|
|
1107
|
+
interface DashboardContextValue {
|
|
1108
|
+
runtime: DashboardRuntime;
|
|
1109
|
+
registry: WidgetRegistry;
|
|
1110
|
+
options: RenderOptions;
|
|
1111
|
+
/**
|
|
1112
|
+
* Panels report the datasources they show while on screen (lazy loading, whenVisible polling). The key is one drawn
|
|
1113
|
+
* copy of a panel (a Repeater draws one per row), so copies don't overwrite each other.
|
|
1114
|
+
*/
|
|
1115
|
+
visibility: {
|
|
1116
|
+
set(panel: string, sources: string[] | null): void;
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
declare const DashboardContext: react.Context<DashboardContextValue | null>;
|
|
1120
|
+
declare function useDashboard(): DashboardContextValue;
|
|
1121
|
+
/** Subscribes to part of the tree; re-renders only when the selected value changes. */
|
|
1122
|
+
declare function useTree<T>(select: (tree: Tree) => T, isEqual?: (a: T, b: T) => boolean): T;
|
|
1123
|
+
|
|
1124
|
+
type Breakpoint = "desktop" | "tablet" | "mobile" | "tv";
|
|
1125
|
+
interface LayoutSpec {
|
|
1126
|
+
view?: string;
|
|
1127
|
+
breakpoint?: string;
|
|
1128
|
+
items?: {
|
|
1129
|
+
panel: string;
|
|
1130
|
+
x: number;
|
|
1131
|
+
y: number;
|
|
1132
|
+
w: number;
|
|
1133
|
+
h: number;
|
|
1134
|
+
minW?: number;
|
|
1135
|
+
minH?: number;
|
|
1136
|
+
}[];
|
|
1137
|
+
auto?: "stack" | "flow";
|
|
1138
|
+
}
|
|
1139
|
+
/** One placed item, as react-grid-layout takes it (kept local so the published types don't need its typings). */
|
|
1140
|
+
interface GridItem {
|
|
1141
|
+
i: string;
|
|
1142
|
+
x: number;
|
|
1143
|
+
y: number;
|
|
1144
|
+
w: number;
|
|
1145
|
+
h: number;
|
|
1146
|
+
minW?: number;
|
|
1147
|
+
minH?: number;
|
|
1148
|
+
static?: boolean;
|
|
1149
|
+
}
|
|
1150
|
+
interface GridChangeItem {
|
|
1151
|
+
panel: string;
|
|
1152
|
+
x: number;
|
|
1153
|
+
y: number;
|
|
1154
|
+
w: number;
|
|
1155
|
+
h: number;
|
|
1156
|
+
}
|
|
1157
|
+
/** Layouts for one view. Missing breakpoints fall back to desktop; `auto: "stack"` stacks in desktop order. */
|
|
1158
|
+
declare function layoutsForView(layouts: readonly LayoutSpec[], view: string | null, columns: number): {
|
|
1159
|
+
layouts: Partial<Record<Breakpoint, GridItem[]>>;
|
|
1160
|
+
cols: Record<Breakpoint, number>;
|
|
1161
|
+
panels: string[];
|
|
1162
|
+
modes: Record<Breakpoint, "flow" | "grid">;
|
|
1163
|
+
ordered: {
|
|
1164
|
+
panel: string;
|
|
1165
|
+
h: number;
|
|
1166
|
+
}[];
|
|
1167
|
+
};
|
|
1168
|
+
interface GridProps {
|
|
1169
|
+
layouts: readonly LayoutSpec[];
|
|
1170
|
+
view: string | null;
|
|
1171
|
+
columns: number;
|
|
1172
|
+
rowHeight: number;
|
|
1173
|
+
gap: number;
|
|
1174
|
+
children: (panel: string) => ReactNode;
|
|
1175
|
+
/** Builder only. */
|
|
1176
|
+
editable?: boolean;
|
|
1177
|
+
onLayoutChange?: (items: GridChangeItem[], breakpoint: Breakpoint) => void;
|
|
1178
|
+
/** Builder: show this breakpoint's layout whatever the width. */
|
|
1179
|
+
breakpoint?: Breakpoint;
|
|
1180
|
+
/** Builder: a palette item dropped on the grid. `dropSize` is the new panel's size while dragging. */
|
|
1181
|
+
onDrop?: (at: GridChangeItem, breakpoint: Breakpoint) => void;
|
|
1182
|
+
dropSize?: () => {
|
|
1183
|
+
w: number;
|
|
1184
|
+
h: number;
|
|
1185
|
+
} | undefined;
|
|
1186
|
+
/** Builder: a grid panel dragged onto another panel; return true when it was taken there (no layout change). */
|
|
1187
|
+
dragOnto?: (panel: string, x: number, y: number, el: HTMLElement, drop: boolean) => boolean;
|
|
1188
|
+
/** Flow layout: each panel's flex sizing (from its style). */
|
|
1189
|
+
/** Flow layout: each panel's sizing; `height` is its grid height in px (a minimum unless the style fixes it). */
|
|
1190
|
+
flowStyle?: (panel: string, height: number) => CSSProperties | undefined;
|
|
1191
|
+
/** Panels currently hidden (visibleWhen, hide action); left out so the rest close the gap. */
|
|
1192
|
+
hidden?: ReadonlySet<string>;
|
|
1193
|
+
}
|
|
1194
|
+
/** Same grid for viewers (locked) and the Builder (editable). */
|
|
1195
|
+
declare function Grid({ layouts, view, columns, rowHeight, gap, children, editable, onLayoutChange, hidden, onDrop, dropSize, breakpoint, flowStyle, dragOnto, }: GridProps): react_jsx_runtime.JSX.Element;
|
|
1196
|
+
|
|
1197
|
+
type Obj$2 = Record<string, unknown>;
|
|
1198
|
+
interface DashboardRendererProps extends NetworkOptions {
|
|
1199
|
+
/** The dashboard JSON. Older formats are migrated. */
|
|
1200
|
+
document: unknown;
|
|
1201
|
+
/** Names this dashboard for hooks and the URL prefix. */
|
|
1202
|
+
id?: string;
|
|
1203
|
+
context?: Obj$2;
|
|
1204
|
+
/** Data for `host` datasources, by key. */
|
|
1205
|
+
data?: Obj$2;
|
|
1206
|
+
/** Host functions for the `call` action and `api.call`. */
|
|
1207
|
+
functions?: Record<string, (args: unknown) => unknown>;
|
|
1208
|
+
widgets?: readonly AnyWidgetDefinition[];
|
|
1209
|
+
/** Your own actions by namespaced name, used in JSON as `{ "do": "acme.notify", … }`. */
|
|
1210
|
+
actions?: HostHooks["actions"];
|
|
1211
|
+
/** Design systems to use (any team's: MUI, Ant, in-house…): their widgets, controls and theme. */
|
|
1212
|
+
designSystems?: readonly DesignSystem[];
|
|
1213
|
+
/** Replace DashSpec's own controls (filters, empty / error / loading) one by one; wins over designSystems. */
|
|
1214
|
+
ui?: UIComponents;
|
|
1215
|
+
/** Points a kind at another widget, e.g. { "Table": "acme.Table" }: existing JSON switches widget unchanged. */
|
|
1216
|
+
aliases?: Readonly<Record<string, string>>;
|
|
1217
|
+
datasourceTypes?: readonly DatasourceType[];
|
|
1218
|
+
theme?: Theme;
|
|
1219
|
+
/**
|
|
1220
|
+
* Named themes a document can pick with `"display": { "theme": "<name>" }`. "light", "dark" and "auto" stay modes
|
|
1221
|
+
* of `theme`. Usually registered once on a `DashSpecProvider`.
|
|
1222
|
+
*/
|
|
1223
|
+
themes?: Readonly<Record<string, Theme>>;
|
|
1224
|
+
locale?: string;
|
|
1225
|
+
scripts?: ScriptMode;
|
|
1226
|
+
/** Controlled filter values and state (partial, merged when they change). */
|
|
1227
|
+
variables?: Obj$2;
|
|
1228
|
+
state?: Obj$2;
|
|
1229
|
+
mode?: "view" | "preview" | "tv";
|
|
1230
|
+
onEvent?: (e: DashEvent) => void;
|
|
1231
|
+
onStateChange?: (tree: Tree) => void;
|
|
1232
|
+
onVariableChange?: (name: string, value: unknown) => void;
|
|
1233
|
+
onSelectionChange?: (panel: string, selection: unknown) => void;
|
|
1234
|
+
onLoad?: () => void;
|
|
1235
|
+
onError?: (e: {
|
|
1236
|
+
code: string;
|
|
1237
|
+
message: string;
|
|
1238
|
+
panel?: string;
|
|
1239
|
+
datasource?: string;
|
|
1240
|
+
}) => void;
|
|
1241
|
+
onNavigate?: (to: string, opts: {
|
|
1242
|
+
newTab?: boolean;
|
|
1243
|
+
}) => void;
|
|
1244
|
+
onOpenDashboard?: (key: string, filters: Obj$2, opts: {
|
|
1245
|
+
newTab?: boolean;
|
|
1246
|
+
}) => void;
|
|
1247
|
+
onToast?: (message: string, tone?: string) => void;
|
|
1248
|
+
renderEmpty?: RenderOptions["renderEmpty"];
|
|
1249
|
+
renderError?: RenderOptions["renderError"];
|
|
1250
|
+
renderLoading?: RenderOptions["renderLoading"];
|
|
1251
|
+
/** Builder only. */
|
|
1252
|
+
editable?: boolean;
|
|
1253
|
+
view?: string | null;
|
|
1254
|
+
selectedPanel?: string;
|
|
1255
|
+
/** Builder: a panel was clicked; `part` is the element inside it (title, tile, value, column:<key>…), if any. */
|
|
1256
|
+
onPanelSelect?: (panel: string, part?: string) => void;
|
|
1257
|
+
/** Builder drag and drop onto panels: see RenderOptions. */
|
|
1258
|
+
canDropOn?: (target: string, dragged?: string, slot?: string) => boolean;
|
|
1259
|
+
onDropOnPanel?: (target: string, index: number | undefined, dragged?: string, slot?: string) => void;
|
|
1260
|
+
onDragPanelStart?: (id: string) => void;
|
|
1261
|
+
/** Builder: a filter in the top filter bar was clicked; it is outlined while `selectedFilter` names it. */
|
|
1262
|
+
onFilterSelect?: (name: string) => void;
|
|
1263
|
+
selectedFilter?: string;
|
|
1264
|
+
onLayoutChange?: (items: GridChangeItem[], breakpoint: Breakpoint, view: string | null) => void;
|
|
1265
|
+
/** Builder only: a palette item was dropped on the grid. */
|
|
1266
|
+
onDropWidget?: (at: GridChangeItem, breakpoint: Breakpoint, view: string | null) => void;
|
|
1267
|
+
dropSize?: () => {
|
|
1268
|
+
w: number;
|
|
1269
|
+
h: number;
|
|
1270
|
+
} | undefined;
|
|
1271
|
+
/** Builder only: edit this breakpoint's layout whatever the width. */
|
|
1272
|
+
breakpoint?: Breakpoint;
|
|
1273
|
+
/** Hide the dashboard's title row (the Builder shows its own). */
|
|
1274
|
+
hideHeader?: boolean;
|
|
1275
|
+
/** Keep filters in the URL (default true in view mode). */
|
|
1276
|
+
urlSync?: boolean;
|
|
1277
|
+
}
|
|
1278
|
+
interface DashboardHandle {
|
|
1279
|
+
getState(): Tree;
|
|
1280
|
+
setState(patch: Obj$2): void;
|
|
1281
|
+
setVariable(name: string, value: unknown): void;
|
|
1282
|
+
refresh(source?: string | string[]): void;
|
|
1283
|
+
reset(): void;
|
|
1284
|
+
run(action: unknown): Promise<void>;
|
|
1285
|
+
exportData(panel: string, format?: "csv" | "xlsx"): void;
|
|
1286
|
+
}
|
|
1287
|
+
/** Draws a dashboard from JSON. Only `document` is required. */
|
|
1288
|
+
declare const DashboardRenderer: react.ForwardRefExoticComponent<DashboardRendererProps & react.RefAttributes<DashboardHandle>>;
|
|
1289
|
+
|
|
1290
|
+
type Obj$1 = Record<string, unknown>;
|
|
1291
|
+
/** One filter or panel control, drawn as pill controls. */
|
|
1292
|
+
declare function ControlField({ def, value, onChange, compact, }: {
|
|
1293
|
+
def: Obj$1;
|
|
1294
|
+
value: unknown;
|
|
1295
|
+
onChange: (v: unknown) => void;
|
|
1296
|
+
compact?: boolean;
|
|
1297
|
+
}): string | number | true | Iterable<ReactNode> | react_jsx_runtime.JSX.Element | null;
|
|
1298
|
+
/** The dashboard's filters. With `apply: "button"` changes are drafts until Apply. */
|
|
1299
|
+
/** Builder: the name `onFilterSelect` gets when the bar itself is clicked. */
|
|
1300
|
+
declare const BAR = "__filterBar";
|
|
1301
|
+
declare const BAR_ICONS: Record<string, ReactNode>;
|
|
1302
|
+
declare function FilterBar(): react_jsx_runtime.JSX.Element | null;
|
|
1303
|
+
|
|
1304
|
+
/**
|
|
1305
|
+
* The open modal or drawer. Close (×, Escape, backdrop) fires the modal's `close` event.
|
|
1306
|
+
*
|
|
1307
|
+
* A modal can open two ways: `openModal` (state `modal`), or its own `open` expression. An expression that turns true
|
|
1308
|
+
* opens the modal through `openModal`, once, so from then on it is an ordinary open modal: ×, Escape and a
|
|
1309
|
+
* `closeModal` action close it, and it stays closed until the expression turns false and then true again.
|
|
1310
|
+
*/
|
|
1311
|
+
declare function ModalHost(): react_jsx_runtime.JSX.Element | null;
|
|
1312
|
+
|
|
1313
|
+
/** One panel inside its own error boundary: a panel that throws (or a host render hook in it) shows an error state. */
|
|
1314
|
+
declare function PanelFrame({ id, nested }: {
|
|
1315
|
+
id: string;
|
|
1316
|
+
nested?: boolean;
|
|
1317
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1318
|
+
|
|
1319
|
+
/** Settings that are the same for every dashboard in an app: set them once on a provider. */
|
|
1320
|
+
type DashSpecSettings = Partial<Pick<DashboardRendererProps, "designSystems" | "widgets" | "ui" | "aliases" | "actions" | "functions" | "datasourceTypes" | "themes" | "theme" | "locale" | "scripts" | "context" | "data" | "connections" | "connectionMap" | "getToken" | "refreshToken" | "trustedOrigins" | "transport" | "fetch" | "pageHost" | "storage" | "maxResponseBytes" | "onRequest" | "onResponse" | "onError" | "onEvent" | "onNavigate" | "onOpenDashboard" | "onToast" | "renderEmpty" | "renderError" | "renderLoading">>;
|
|
1321
|
+
/**
|
|
1322
|
+
* Registers your components, design systems, themes, actions and network settings once for the whole app; every
|
|
1323
|
+
* `DashboardRenderer` inside uses them, and a document refers to them by name (`"kind": "acme.Gauge"`,
|
|
1324
|
+
* `"do": "acme.notify"`, `"display": { "theme": "acme-dark" }`). A renderer's own props win. Providers nest: an
|
|
1325
|
+
* inner provider adds to and overrides the outer one the same way.
|
|
1326
|
+
*
|
|
1327
|
+
* Lists (`designSystems`, `widgets`, `datasourceTypes`, `trustedOrigins`) are combined, outer first. Maps (`ui`,
|
|
1328
|
+
* `aliases`, `actions`, `functions`, `themes`, `context`, `data`, `connections`, `connectionMap`) are merged by key.
|
|
1329
|
+
* Everything else is taken from the innermost place that sets it.
|
|
1330
|
+
*/
|
|
1331
|
+
declare function DashSpecProvider({ children, ...settings }: DashSpecSettings & {
|
|
1332
|
+
children?: ReactNode;
|
|
1333
|
+
}): react_jsx_runtime.JSX.Element;
|
|
1334
|
+
/** The provider's settings (empty without one). */
|
|
1335
|
+
declare function useDashSpecSettings(): DashSpecSettings;
|
|
1336
|
+
|
|
1337
|
+
/**
|
|
1338
|
+
* What a node passes down to the nodes in its slots: its id and data, and inside a Repeater the row
|
|
1339
|
+
* (`${item.*}`) and its position (`${index}`). A child without its own data reads `data`.
|
|
1340
|
+
*/
|
|
1341
|
+
interface NodeScope {
|
|
1342
|
+
parentId?: string;
|
|
1343
|
+
parentData?: unknown;
|
|
1344
|
+
data?: unknown;
|
|
1345
|
+
hasItem?: boolean;
|
|
1346
|
+
item?: unknown;
|
|
1347
|
+
index?: number;
|
|
1348
|
+
}
|
|
1349
|
+
declare const useNodeScope: () => NodeScope;
|
|
1350
|
+
/**
|
|
1351
|
+
* Draws the nodes in one of the current node's slots, in order. Widgets place it anywhere in their markup:
|
|
1352
|
+
* `<Slot name="footer" />`. While editing, an empty slot shows a drop zone.
|
|
1353
|
+
*/
|
|
1354
|
+
declare function Slot({ name, className, style, data, item, index, empty, }: {
|
|
1355
|
+
name: string;
|
|
1356
|
+
} & SlotRenderOptions & {
|
|
1357
|
+
className?: string;
|
|
1358
|
+
style?: CSSProperties;
|
|
1359
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
1360
|
+
|
|
1361
|
+
/** Reads part of a dashboard's state from anywhere in the host app. */
|
|
1362
|
+
declare function useDashboardState<T>(id: string, select: (tree: Tree) => T): T | undefined;
|
|
1363
|
+
/** Drives a dashboard from anywhere in the host app. */
|
|
1364
|
+
declare function useDashboardActions(id: string): {
|
|
1365
|
+
ready: boolean;
|
|
1366
|
+
setVariable: (name: string, value: unknown) => {
|
|
1367
|
+
payload: {
|
|
1368
|
+
name: string;
|
|
1369
|
+
value: unknown;
|
|
1370
|
+
};
|
|
1371
|
+
type: "state/setFilter";
|
|
1372
|
+
} | undefined;
|
|
1373
|
+
setState: (path: string, value: unknown) => {
|
|
1374
|
+
payload: {
|
|
1375
|
+
path: Path;
|
|
1376
|
+
value: unknown;
|
|
1377
|
+
merge?: boolean;
|
|
1378
|
+
};
|
|
1379
|
+
type: "state/set";
|
|
1380
|
+
} | undefined;
|
|
1381
|
+
setView: (view: string) => {
|
|
1382
|
+
payload: string | null;
|
|
1383
|
+
type: "state/setView";
|
|
1384
|
+
} | undefined;
|
|
1385
|
+
run: (action: unknown) => Promise<void> | undefined;
|
|
1386
|
+
refresh: (source?: string | string[]) => void | undefined;
|
|
1387
|
+
};
|
|
1388
|
+
|
|
1389
|
+
/** One stylesheet for the renderer's own chrome. Everything reads `--ds-*` tokens. */
|
|
1390
|
+
declare const RENDERER_CSS = "\n.ds-root { box-sizing: border-box; font-size: var(--ds-type-body-size); line-height: var(--ds-type-body-line-height); }\n.ds-root *, .ds-root *::before, .ds-root *::after { box-sizing: inherit; }\n.ds-header { display: flex; align-items: baseline; gap: var(--ds-space-md); flex-wrap: wrap; margin-bottom: var(--ds-space-md); }\n.ds-title { margin: 0; font-family: var(--ds-type-title-family); font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight); line-height: var(--ds-type-title-line-height); }\n.ds-desc { color: var(--ds-color-text-subtle); margin: 0; }\n.ds-synced { margin-left: auto; color: var(--ds-color-text-subtle); font-size: var(--ds-type-caption-size); }\n\n.ds-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ds-space-sm) var(--ds-space-md); margin-bottom: var(--ds-space-lg); }\n.ds-field { display: grid; gap: var(--ds-space-xxs); min-width: 140px; }\n.ds-field > span { font-size: var(--ds-type-label-size); font-weight: var(--ds-type-label-weight); letter-spacing: var(--ds-type-label-letter-spacing); color: var(--ds-color-text-subtle); }\n.ds-input, .ds-select, .ds-btn {\n font: inherit; color: var(--ds-color-text-primary); background: var(--ds-color-surface-card);\n border: 1px solid var(--ds-color-border-control); border-radius: var(--ds-radius-control);\n padding: var(--ds-space-xs) var(--ds-space-sm); min-height: calc(var(--ds-control-height, 36px) - 2px);\n}\n.ds-input:focus-visible, .ds-select:focus-visible, .ds-btn:focus-visible, .ds-chip:focus-visible, .ds-panel:focus-visible { outline: 2px solid var(--ds-color-border-focus); outline-offset: 1px; }\n.ds-btn { cursor: pointer; }\n.ds-btn-primary { background: var(--ds-color-action-primary); color: var(--ds-color-action-on-primary); border-color: transparent; }\n.ds-btn-primary:hover { background: var(--ds-color-action-primary-hover); }\n.ds-inline { display: flex; gap: var(--ds-space-xs); align-items: center; }\n.ds-chips { display: flex; gap: var(--ds-space-xs); flex-wrap: wrap; }\n.ds-chip {\n font: inherit; font-size: var(--ds-type-label-size); cursor: pointer; border-radius: var(--ds-radius-full);\n padding: var(--ds-space-xxs) var(--ds-space-sm); border: 1px solid var(--ds-color-border-default);\n background: var(--ds-color-surface-card); color: var(--ds-color-text-secondary);\n}\n.ds-chip[aria-pressed=\"true\"] { background: var(--ds-color-surface-selection); border-color: var(--ds-color-border-focus); color: var(--ds-color-text-primary); }\n.ds-chip-count { margin-left: var(--ds-space-xxs); color: var(--ds-color-text-subtle); }\n\n.ds-panel {\n height: 100%; display: flex; flex-direction: column; overflow: hidden;\n background: var(--ds-color-surface-card); border-radius: var(--ds-radius-card); box-shadow: var(--ds-shadow-raised);\n padding: var(--ds-space-md) var(--ds-space-lg);\n}\n.ds-panel[data-tone=\"plain\"] { background: transparent; box-shadow: none; padding: 0; }\n.ds-panel[data-tone=\"subtle\"] { background: var(--ds-color-surface-sunken); box-shadow: none; }\n.ds-panel[data-selected=\"true\"] { outline: 2px solid var(--ds-color-border-focus); }\n.ds-panel-head { display: flex; align-items: center; gap: var(--ds-space-sm); min-height: 24px; margin-bottom: var(--ds-space-sm); }\n.ds-panel-title { margin: 0; font-family: var(--ds-type-heading-family); font-size: var(--ds-type-heading-size); font-weight: var(--ds-type-heading-weight); line-height: var(--ds-type-heading-line-height); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.ds-panel-sub { color: var(--ds-color-text-subtle); font-size: var(--ds-type-caption-size); }\n.ds-panel-tools { margin-left: auto; display: flex; gap: var(--ds-space-xs); align-items: center; }\n.ds-panel-body { flex: 1; min-height: 0; position: relative; }\n.ds-badge { font-size: var(--ds-type-caption-size); border-radius: var(--ds-radius-full); padding: 0 var(--ds-space-xs); }\n.ds-badge-stale { background: var(--ds-color-status-warn-bg); color: var(--ds-color-status-warn-fg); }\n.ds-crumbs { display: flex; gap: var(--ds-space-xxs); font-size: var(--ds-type-caption-size); color: var(--ds-color-text-subtle); }\n.ds-crumbs button { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ds-color-action-primary); }\n.ds-state { height: 100%; display: grid; place-items: center; text-align: center; color: var(--ds-color-text-subtle); padding: var(--ds-space-sm); }\n.ds-state-error { color: var(--ds-color-status-bad-fg); }\n.ds-skeleton { height: 100%; border-radius: var(--ds-radius-control); background: linear-gradient(90deg, var(--ds-color-surface-sunken) 25%, var(--ds-color-surface-page) 50%, var(--ds-color-surface-sunken) 75%); background-size: 200% 100%; animation: ds-shimmer 1.4s infinite linear; opacity: .6; }\n.ds-loading { display: block; position: relative; height: 100%; }\n.ds-loading-text { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--ds-space-sm); color: var(--ds-color-text-secondary); font-size: var(--ds-type-label-size); }\n@keyframes ds-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }\n@media (prefers-reduced-motion: reduce) { .ds-skeleton { animation: none; } .ds-root .react-grid-item { transition: none !important; } }\n\n.ds-scrim { position: fixed; inset: 0; background: var(--ds-color-surface-scrim); z-index: var(--ds-z-overlay); display: flex; align-items: center; justify-content: center; padding: var(--ds-space-xl); }\n.ds-scrim[data-presentation=\"drawer\"] { justify-content: flex-end; padding: 0; }\n.ds-dialog { position: static; margin: 0; border: 0; inset: auto; background: var(--ds-color-surface-page); color: var(--ds-color-text-primary); border-radius: var(--ds-radius-sheet); box-shadow: var(--ds-shadow-overlay); width: min(100%, var(--ds-dialog-w)); max-height: 100%; overflow: auto; padding: var(--ds-space-lg); }\n.ds-scrim[data-presentation=\"drawer\"] .ds-dialog { height: 100%; border-radius: 0; }\n.ds-dialog-head { display: flex; align-items: center; gap: var(--ds-space-md); margin-bottom: var(--ds-space-md); }\n.ds-dialog-head h2 { margin: 0; font-family: var(--ds-type-title-family); font-size: var(--ds-type-title-size); font-weight: var(--ds-type-title-weight); }\n.ds-close { margin-left: auto; font-size: 20px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--ds-color-text-secondary); }\n\n.ds-invalid { border: 1px solid var(--ds-color-status-bad-border); background: var(--ds-color-status-bad-bg); color: var(--ds-color-status-bad-fg); border-radius: var(--ds-radius-card); padding: var(--ds-space-lg); }\n.ds-invalid ul { margin: var(--ds-space-sm) 0 0; padding-left: var(--ds-space-lg); }\n.ds-invalid code { font-size: 12px; }\n\n.ds-root .react-grid-layout { position: relative; }\n.ds-root .react-grid-item { transition: transform 200ms ease; }\n.ds-root .react-grid-item.react-grid-placeholder { background: var(--ds-color-surface-selection); border-radius: var(--ds-radius-card); opacity: .6; }\n.ds-root .react-grid-item > .react-resizable-handle { display: none; }\n.ds-grid-edit .react-grid-item > .react-resizable-handle { display: block; position: absolute; width: 14px; height: 14px; right: 2px; bottom: 2px; cursor: se-resize; }\n.ds-grid-edit .react-grid-item > .react-resizable-handle::after { content: \"\"; position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px; border-right: 2px solid var(--ds-color-border-control); border-bottom: 2px solid var(--ds-color-border-control); }\n\n/* widgets */\n.ds-plain, .ds-kpi, .ds-tile, .ds-status, .ds-card, .ds-meters button, .ds-legend button, .ds-stages button, .ds-marker, .ds-table th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: inherit; cursor: pointer; }\n.ds-kpi { display: flex; flex-direction: column; gap: var(--ds-space-xxs); width: 100%; height: 100%; justify-content: center; }\n.ds-kpi-value { font-family: var(--ds-type-kpi-family); font-size: var(--ds-type-kpi-size); font-weight: var(--ds-type-kpi-weight); line-height: var(--ds-type-kpi-line-height); font-variant-numeric: tabular-nums; }\n.ds-kpi-unit { font-size: .5em; margin-left: .25em; color: var(--ds-color-text-subtle); font-weight: 500; }\n.ds-kpi-delta { font-size: var(--ds-type-label-size); font-weight: 600; }\n.ds-kpi-sub { color: var(--ds-color-text-subtle); font-size: var(--ds-type-caption-size); font-weight: 400; }\n.ds-progress { display: block; height: 6px; border-radius: var(--ds-radius-full); background: var(--ds-color-surface-sunken); overflow: hidden; }\n.ds-progress > span { display: block; height: 100%; border-radius: inherit; }\n.ds-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: var(--ds-space-xs); flex: none; }\n.ds-pill { display: inline-flex; align-items: center; border: 1px solid; border-radius: var(--ds-radius-full); padding: 0 var(--ds-space-sm); font-size: var(--ds-type-label-size); font-weight: 600; line-height: 22px; white-space: nowrap; }\n.ds-tiles { display: grid; gap: var(--ds-space-sm); height: 100%; align-content: start; }\n.ds-tile { display: grid; gap: var(--ds-space-xxs); border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-control); padding: var(--ds-space-sm) var(--ds-space-md); background: var(--ds-color-surface-card); }\n.ds-tile[data-active] { box-shadow: inset 0 0 0 1px currentColor; }\n.ds-tile-label { display: flex; align-items: center; font-size: var(--ds-type-label-size); color: var(--ds-color-text-secondary); text-transform: capitalize; }\n.ds-tile-value { font-family: var(--ds-type-kpi-family); font-size: calc(var(--ds-type-kpi-size) * .8); font-weight: var(--ds-type-kpi-weight); font-variant-numeric: tabular-nums; }\n.ds-status { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ds-space-xs); }\n.ds-status-label { color: var(--ds-color-text-secondary); }\n.ds-content { overflow: auto; height: 100%; }\n.ds-md-p { margin: 0 0 var(--ds-space-sm); }\n.ds-md-h { margin: 0 0 var(--ds-space-xs); font-family: var(--ds-type-heading-family); }\n.ds-md-list { margin: 0 0 var(--ds-space-sm); padding-left: var(--ds-space-lg); }\n.ds-link { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ds-color-action-primary); text-decoration: underline; text-underline-offset: 2px; }\n.ds-meters { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ds-space-sm); overflow: auto; max-height: 100%; }\n.ds-meters button { display: grid; gap: var(--ds-space-xxs); width: 100%; }\n.ds-meter-head { display: flex; justify-content: space-between; gap: var(--ds-space-sm); }\n.ds-meter-value { font-variant-numeric: tabular-nums; font-weight: 600; }\n.ds-legend { list-style: none; margin: var(--ds-space-sm) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--ds-space-xs) var(--ds-space-md); font-size: var(--ds-type-label-size); }\n.ds-legend li, .ds-legend button { display: inline-flex; align-items: center; gap: var(--ds-space-xxs); }\n.ds-segbar { display: flex; height: 14px; border-radius: var(--ds-radius-full); overflow: hidden; gap: 2px; }\n.ds-segbar button { border: 0; padding: 0; cursor: pointer; min-width: 2px; }\n.ds-donut { display: flex; gap: var(--ds-space-md); align-items: center; height: 100%; }\n.ds-donut svg { height: 100%; max-height: 220px; aspect-ratio: 1; }\n.ds-donut .ds-legend { flex-direction: column; margin: 0; }\n.ds-cards { display: grid; gap: var(--ds-space-sm); overflow: auto; max-height: 100%; }\n.ds-card { display: grid; gap: var(--ds-space-sm); border: 1px solid var(--ds-color-border-default); border-top-width: 3px; border-radius: var(--ds-radius-control); padding: var(--ds-space-sm) var(--ds-space-md); background: var(--ds-color-surface-card); }\n.ds-card[data-active] { box-shadow: 0 0 0 2px var(--ds-color-border-focus); }\n.ds-card-head { display: flex; align-items: center; gap: var(--ds-space-xs); justify-content: space-between; }\n.ds-card-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-xxs) var(--ds-space-sm); margin: 0; }\n.ds-card-fields dt { font-size: var(--ds-type-caption-size); color: var(--ds-color-text-subtle); }\n.ds-card-fields dd { margin: 0; font-variant-numeric: tabular-nums; }\n.ds-timeline { display: grid; gap: var(--ds-space-xs); }\n.ds-timeline-lane { display: flex; align-items: center; gap: var(--ds-space-sm); }\n.ds-timeline-name { width: 80px; font-size: var(--ds-type-label-size); color: var(--ds-color-text-secondary); flex: none; }\n.ds-timeline-bar { position: relative; flex: 1; height: 24px; background: var(--ds-color-surface-sunken); border-radius: var(--ds-radius-control); overflow: hidden; }\n.ds-timeline-bar span { position: absolute; top: 0; bottom: 0; cursor: pointer; }\n.ds-timeline-axis { display: flex; justify-content: space-between; font-size: var(--ds-type-caption-size); color: var(--ds-color-text-subtle); }\n.ds-imagemap { position: relative; height: 100%; }\n.ds-imagemap img { width: 100%; height: 100%; object-fit: contain; }\n.ds-marker { position: absolute; transform: translate(-50%, -50%); border: 1px solid; border-radius: var(--ds-radius-control); padding: 1px var(--ds-space-xs); font-size: var(--ds-type-caption-size); white-space: nowrap; }\n.ds-stages { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--ds-space-xs); align-items: center; height: 100%; }\n.ds-stages li { flex: 1; }\n.ds-stages button { display: flex; align-items: center; gap: var(--ds-space-xs); width: 100%; padding: var(--ds-space-xs); border-radius: var(--ds-radius-control); color: var(--ds-color-text-subtle); }\n.ds-stages li[data-state=\"current\"] button { background: var(--ds-color-surface-selection); color: var(--ds-color-text-primary); font-weight: 600; }\n.ds-stages li[data-state=\"done\"] button { color: var(--ds-color-text-secondary); }\n.ds-stage-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ds-color-border-control); font-size: 11px; flex: none; }\n.ds-stages li[data-state=\"done\"] .ds-stage-dot { background: var(--ds-color-status-good-solid); border-color: transparent; color: var(--ds-color-text-on-fill); }\n.ds-stages li[data-state=\"current\"] .ds-stage-dot { background: var(--ds-color-action-primary); border-color: transparent; color: var(--ds-color-action-on-primary); }\n.ds-table-wrap { height: 100%; display: flex; flex-direction: column; }\n.ds-table-scroll { overflow: auto; flex: 1; }\n.ds-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }\n.ds-table th, .ds-table td { padding: var(--ds-space-xs) var(--ds-space-sm); border-bottom: 1px solid var(--ds-color-border-default); vertical-align: top; }\n.ds-table-wrap[data-density=\"compact\"] th, .ds-table-wrap[data-density=\"compact\"] td { padding: 2px var(--ds-space-xs); }\n.ds-table th { font-size: var(--ds-type-label-size); font-weight: var(--ds-type-label-weight); color: var(--ds-color-text-subtle); white-space: nowrap; background: var(--ds-color-surface-card); }\n.ds-table thead[data-sticky] th { position: sticky; top: 0; z-index: 1; }\n.ds-table tbody tr { cursor: pointer; }\n.ds-table tbody tr:hover, .ds-table tbody tr:focus-visible { background: var(--ds-color-surface-selection); outline: none; }\n.ds-table tfoot td { font-weight: 600; border-top: 2px solid var(--ds-color-border-default); }\n.ds-cell-list { display: grid; gap: 2px; }\n.ds-pager { display: flex; justify-content: flex-end; align-items: center; gap: var(--ds-space-sm); padding-top: var(--ds-space-xs); font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); }\n\n/* ---- Card anatomy ---- */\n.ds-panel { padding: var(--ds-space-lg); border: 0; }\n.ds-panel-head { margin-bottom: var(--ds-space-md); min-height: 20px; flex-wrap: wrap; row-gap: 2px; }\n.ds-panel-title { display: inline-flex; align-items: center; gap: var(--ds-space-xs); min-width: 0; max-width: 100%; }\n.ds-panel-meta { font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); white-space: nowrap; }\n.ds-live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); white-space: nowrap; }\n.ds-live > span { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-color-status-good-fg); }\n.ds-live[data-stale] > span { background: var(--ds-color-status-warn-fg); }\n.ds-info { position: relative; display: inline-flex; color: var(--ds-color-text-disabled); cursor: help; outline: none; background: none; border: 0; padding: 0; font: inherit; }\n.ds-info:hover, .ds-info:focus-visible { color: var(--ds-color-text-subtle); }\n.ds-info::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 260px; white-space: normal; padding: 8px 10px; border-radius: var(--ds-radius-control); background: var(--ds-color-chart-tooltip-bg); color: var(--ds-color-chart-tooltip-text); font: 400 12px/16px var(--ds-font-body); letter-spacing: 0; text-transform: none; opacity: 0; pointer-events: none; transition: opacity 120ms; z-index: var(--ds-z-tooltip); }\n.ds-info:hover::after, .ds-info:focus-visible::after { opacity: 1; }\n\n.ds-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 11px/1 var(--ds-font-body); white-space: nowrap; background: var(--ds-color-status-neutral-bg); color: var(--ds-color-status-neutral-fg); }\n.ds-chip[data-tone=\"good\"] { background: var(--ds-color-status-good-bg); color: var(--ds-color-status-good-fg); }\n.ds-chip[data-tone=\"bad\"] { background: var(--ds-color-status-bad-bg); color: var(--ds-color-status-bad-fg); }\n.ds-chip[data-tone=\"warn\"] { background: var(--ds-color-status-warn-bg); color: var(--ds-color-status-warn-fg); }\n.ds-chip[data-tone=\"info\"] { background: var(--ds-color-status-info-bg); color: var(--ds-color-status-info-fg); }\n\n.ds-kpi { display: flex; flex-direction: column; gap: var(--ds-space-xs); height: 100%; justify-content: flex-start; }\n.ds-kpi-label { display: flex; align-items: center; gap: var(--ds-space-xs); font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); }\n.ds-kpi-main { display: flex; align-items: baseline; gap: 8px; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; margin-top: 2px; }\n.ds-kpi-value { font-family: var(--ds-type-kpi-family); font-size: var(--ds-type-kpi-size); font-weight: var(--ds-type-kpi-weight); line-height: var(--ds-type-kpi-line-height); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }\n.ds-kpi[data-size=\"hero\"] .ds-kpi-value { font-size: calc(var(--ds-type-kpi-size) * 1.45); }\n.ds-kpi-unit { font-size: var(--ds-type-caption-size); margin-left: 0; color: var(--ds-color-text-subtle); font-weight: 400; }\n.ds-kpi-empty { font-size: var(--ds-type-body-size); color: var(--ds-color-text-subtle); padding: 6px 0; }\n.ds-kpi-delta { font-size: var(--ds-type-label-size); font-weight: 600; }\n.ds-kpi-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-sm); font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); min-height: 22px; }\n\n.ds-tiles { --ds-tiles-gap: var(--ds-space-md); gap: var(--ds-tiles-gap); grid-template-columns: repeat(auto-fit, minmax(max(var(--ds-tile-min, 128px), calc((100% - (var(--ds-tile-cols, 12) - 1) * var(--ds-tiles-gap)) / var(--ds-tile-cols, 12))), 1fr)); }\n.ds-tiles { overflow-y: auto; scrollbar-width: thin; grid-auto-rows: max-content; padding: 5px; margin: -5px; }\n.ds-tiles > .ds-tile { min-height: max-content; }\n.ds-flow .ds-tiles { height: auto; overflow-y: visible; }\n.ds-tiles[data-wrap=\"off\"] { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(var(--ds-tile-min, 128px), 1fr); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }\n.ds-tiles[data-wrap=\"off\"] > * { scroll-snap-align: start; }\n.ds-tile { min-width: 0; overflow-wrap: anywhere; }\n.ds-tile { display: flex; flex-direction: column; gap: 6px; padding: var(--ds-space-md) var(--ds-space-md) var(--ds-space-md); border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-control); background: var(--ds-color-surface-card); text-align: left; min-height: 0; transition: border-color 120ms, background 120ms; }\n.ds-tile:hover { border-color: var(--ds-color-action-primary); }\n.ds-tile[data-active] { border-color: var(--ds-color-action-primary); background: var(--ds-color-surface-selection); box-shadow: none; }\n.ds-tile[data-active] .ds-tile-label { color: var(--ds-color-text-primary); font-weight: 600; }\n.ds-tile-label { font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); text-transform: none; gap: 2px; }\n.ds-tile-value { font-family: var(--ds-type-kpi-family); font-size: 24px; line-height: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ds-color-text-primary); }\n.ds-tile-caption { font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); margin-top: auto; }\n\n.ds-chart { display: flex; flex-direction: column; height: 100%; }\n.ds-chart-legend { list-style: none; margin: -38px 0 14px auto; padding: 0; display: flex; gap: var(--ds-space-lg); font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); position: relative; z-index: 1; max-width: 70%; flex-wrap: wrap; justify-content: flex-end; }\n.ds-chart-legend li { display: inline-flex; align-items: center; gap: 6px; }\n.ds-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }\n.ds-swatch-line { width: 16px; border-top: 2px dashed var(--ds-color-text-subtle); display: inline-block; }\n\n.ds-table th, .ds-table td { padding: 12px var(--ds-space-lg); border-bottom: 1px solid color-mix(in srgb, var(--ds-color-border-default) 60%, transparent); }\n.ds-table th { background: var(--ds-color-surface-table-header); color: var(--ds-color-text-secondary); font-size: var(--ds-type-label-size); font-weight: 600; letter-spacing: 0; text-transform: none; border-bottom: 0; }\n.ds-table td { font-size: var(--ds-type-label-size); color: var(--ds-color-text-secondary); vertical-align: middle; }\n.ds-table tbody tr:hover, .ds-table tbody tr:focus-visible { background: var(--ds-color-surface-selection); }\n.ds-table tbody tr[data-muted] td { color: var(--ds-color-text-disabled); }\n.ds-cell-empty { color: var(--ds-color-text-disabled); }\n.ds-table th button { font-weight: 600; }\n\n.ds-header { margin-bottom: var(--ds-space-md); }\n.ds-filters { background: var(--ds-color-surface-card); border-radius: var(--ds-radius-card); padding: var(--ds-space-md) var(--ds-space-lg); align-items: center; gap: var(--ds-space-md); }\n.ds-filters .ds-field { min-width: 0; grid-auto-flow: column; align-items: center; gap: var(--ds-space-xs); }\n.ds-filters .ds-field > span { font-size: var(--ds-type-label-size); }\n.ds-filters .ds-select, .ds-filters .ds-input { color: var(--ds-color-action-primary); border-color: var(--ds-color-border-default); background: var(--ds-color-surface-card); min-height: calc(var(--ds-control-height, 36px) - 2px); }\n.ds-filters .ds-btn { border-color: transparent; background: var(--ds-color-surface-selection); color: var(--ds-color-action-primary); }\n.ds-filters-icon { display: inline-grid; place-items: center; width: calc(var(--ds-control-height, 36px) - 2px); height: calc(var(--ds-control-height, 36px) - 2px); border-radius: var(--ds-radius-control); border: 1px solid var(--ds-color-border-default); color: var(--ds-color-text-subtle); }\n.ds-meters .ds-progress, .ds-card .ds-progress { height: 8px; }\n.ds-badge-stale { border-radius: 6px; padding: 2px 8px; }\n\n/* ---- Motion (all off with prefers-reduced-motion) ---- */\n@keyframes ds-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }\n@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }\n@keyframes ds-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n@keyframes ds-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ds-color-status-good-fg) 55%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }\n@keyframes ds-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }\n@keyframes ds-slide-in { from { transform: translateX(100%); } to { transform: none; } }\n@keyframes ds-row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }\n\n.ds-panel { animation: ds-rise 520ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--ds-i, 0) * 45ms); transition: box-shadow 200ms ease, transform 200ms ease, outline-color 200ms ease; }\n.ds-panel-body > :not(.ds-skeleton):not(.ds-loading) { animation: ds-fade 360ms ease both; }\n.ds-filters, .ds-header { animation: ds-fade 400ms ease both; }\n.ds-tile { transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease; }\n.ds-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(21, 121, 190, .10); }\n.ds-tile:active { transform: translateY(0); }\n.ds-kpi-main { transition: opacity 160ms ease; }\n.ds-kpi-main:hover .ds-kpi-value { color: var(--ds-color-action-primary); transition: color 160ms ease; }\n.ds-chip { animation: ds-fade 300ms ease both; transition: background 200ms ease, color 200ms ease; }\n.ds-progress > span { transform-origin: left; animation: ds-grow-x 800ms cubic-bezier(.2,.7,.2,1) both; transition: width 500ms cubic-bezier(.2,.7,.2,1); }\n.ds-segbar button { transform-origin: left; animation: ds-grow-x 700ms cubic-bezier(.2,.7,.2,1) both; }\n.ds-timeline-bar span { transform-origin: left; animation: ds-grow-x 700ms cubic-bezier(.2,.7,.2,1) both; }\n.ds-live > span { animation: ds-pulse 2s ease-out infinite; }\n.ds-table tbody tr { animation: ds-row-in 320ms ease both; transition: background 140ms ease; }\n.ds-table tbody tr:nth-child(1) { animation-delay: 20ms; } .ds-table tbody tr:nth-child(2) { animation-delay: 40ms; }\n.ds-table tbody tr:nth-child(3) { animation-delay: 60ms; } .ds-table tbody tr:nth-child(4) { animation-delay: 80ms; }\n.ds-table tbody tr:nth-child(5) { animation-delay: 100ms; } .ds-table tbody tr:nth-child(6) { animation-delay: 120ms; }\n.ds-table tbody tr:nth-child(7) { animation-delay: 140ms; } .ds-table tbody tr:nth-child(8) { animation-delay: 160ms; }\n.ds-table tbody tr:nth-child(9) { animation-delay: 180ms; } .ds-table tbody tr:nth-child(n+10) { animation-delay: 200ms; }\n.ds-stages li[data-state=\"current\"] .ds-stage-dot { animation: ds-pulse 2s ease-out infinite; }\n.ds-scrim { animation: ds-fade 200ms ease both; }\n.ds-dialog { animation: ds-pop 260ms cubic-bezier(.2,.7,.2,1) both; }\n.ds-scrim[data-presentation=\"drawer\"] .ds-dialog { animation: ds-slide-in 300ms cubic-bezier(.2,.7,.2,1) both; }\n.ds-select, .ds-input, .ds-btn, .ds-chip, .ds-link { transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease; }\n.ds-select:hover, .ds-input:hover { border-color: var(--ds-color-action-primary); }\n.ds-info::after { transform: translateX(-50%) translateY(-2px); transition: opacity 140ms ease, transform 140ms ease; }\n.ds-info:hover::after, .ds-info:focus-visible::after { transform: translateX(-50%) translateY(0); }\n.ds-grid-edit .react-grid-item > .ds-panel { animation: none; }\n@media (prefers-reduced-motion: reduce) {\n .ds-root *, .ds-root *::before, .ds-root *::after { animation: none !important; transition: none !important; }\n}\n\n/* ---- Filter controls (pills with the value in blue, popovers) ---- */\n.ds-filters { gap: var(--ds-space-sm); padding: 12px var(--ds-space-lg); }\n.ds-dd { position: relative; display: inline-flex; }\n.ds-pill-btn { display: inline-flex; align-items: center; gap: 8px; height: var(--ds-control-height, 36px); padding: 0 12px; border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-control); background: var(--ds-color-surface-card); color: var(--ds-color-text-primary); font: 400 13px/1 var(--ds-font-body); cursor: pointer; white-space: nowrap; transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }\n.ds-pill-btn:hover { border-color: var(--ds-color-action-primary); }\n.ds-pill-btn[aria-expanded=\"true\"] { border-color: var(--ds-color-action-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-color-action-primary) 14%, transparent); }\n.ds-pill-btn > svg:first-child { color: var(--ds-color-text-subtle); }\n.ds-pill-value { color: var(--ds-color-action-primary); font-weight: 500; }\n.ds-pill-chev { color: var(--ds-color-text-subtle); margin-left: 2px; transition: transform 180ms ease; }\n.ds-pill-btn[aria-expanded=\"true\"] .ds-pill-chev { transform: rotate(180deg); color: var(--ds-color-action-primary); }\n\n.ds-pop { z-index: calc(var(--ds-z-overlay) + 10); max-width: min(92vw, 640px); background: var(--ds-color-surface-overlay); border: 1px solid color-mix(in srgb, var(--ds-color-border-default) 70%, transparent); border-radius: 12px; box-shadow: 0 14px 36px rgba(13,13,13,.16), 0 2px 6px rgba(13,13,13,.06); padding: 6px; animation: ds-pop-in 180ms cubic-bezier(.2,.7,.2,1) both; transform-origin: top left; }\n@keyframes ds-pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }\n.ds-menu { display: grid; gap: 2px; max-height: 300px; overflow: auto; outline: none; min-width: 200px; }\n.ds-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ds-color-text-primary); font: 400 13px/18px var(--ds-font-body); text-align: left; cursor: pointer; transition: background 120ms ease, color 120ms ease; }\n.ds-menu-item:hover, .ds-menu-item:focus-visible { background: color-mix(in srgb, var(--ds-color-action-primary) 8%, transparent); outline: none; }\n.ds-menu-item[aria-selected=\"true\"], .ds-menu-item[aria-pressed=\"true\"] { color: var(--ds-color-action-primary); font-weight: 600; background: var(--ds-color-surface-selection); }\n.ds-menu-label { flex: 1; }\n.ds-menu-count { color: var(--ds-color-text-subtle); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }\n.ds-menu-tick { color: var(--ds-color-action-primary); }\n.ds-menu-empty { padding: 10px; color: var(--ds-color-text-subtle); font-size: 12px; }\n.ds-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--ds-color-border-control); flex: none; display: grid; place-items: center; transition: background 120ms ease, border-color 120ms ease; }\n.ds-check[data-on] { background: var(--ds-color-action-primary); border-color: var(--ds-color-action-primary); }\n.ds-check[data-on]::after { content: \"\"; width: 8px; height: 4px; border: 2px solid var(--ds-color-action-on-primary); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }\n.ds-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 6px 2px; margin-top: 4px; border-top: 1px solid color-mix(in srgb, var(--ds-color-border-default) 60%, transparent); font-size: 12px; color: var(--ds-color-text-subtle); }\n\n.ds-pop-wide { min-width: 0; }\n.ds-range { display: flex; gap: 6px; }\n.ds-range-presets { display: grid; gap: 2px; align-content: start; min-width: 210px; padding-right: 6px; border-right: 1px solid color-mix(in srgb, var(--ds-color-border-default) 60%, transparent); }\n.ds-cal { padding: 4px 6px; width: 280px; }\n.ds-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }\n.ds-cal-head strong { font: 600 13px/1 var(--ds-font-heading); }\n.ds-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }\n.ds-cal-wd { text-align: center; font-size: 11px; color: var(--ds-color-text-subtle); padding: 4px 0; }\n.ds-cal-day { height: 34px; border: 0; background: transparent; color: var(--ds-color-text-primary); font: 400 13px/1 var(--ds-font-body); cursor: pointer; border-radius: 8px; transition: background 120ms ease, color 120ms ease; font-variant-numeric: tabular-nums; }\n.ds-cal-day:hover:not(:disabled) { background: color-mix(in srgb, var(--ds-color-action-primary) 10%, transparent); }\n.ds-cal-day:disabled { color: var(--ds-color-text-disabled); cursor: default; }\n.ds-cal-day[data-in] { background: var(--ds-color-surface-selection); border-radius: 0; }\n.ds-cal-day[data-start], .ds-cal-day[data-end] { background: var(--ds-color-action-primary); color: var(--ds-color-action-on-primary); font-weight: 600; }\n.ds-cal-error { color: var(--ds-color-status-bad-fg); }\n.ds-apply { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--ds-color-action-primary); color: var(--ds-color-action-on-primary); font: 600 12px/1 var(--ds-font-body); cursor: pointer; transition: background 140ms ease, opacity 140ms ease; }\n.ds-apply:hover:not(:disabled) { background: var(--ds-color-action-primary-hover); }\n.ds-apply:disabled { opacity: .4; cursor: default; }\n\n.ds-stepper { display: inline-flex; align-items: stretch; gap: 0; }\n.ds-stepper .ds-pill-btn { border-radius: 0; border-left: 0; border-right: 0; }\n.ds-step { display: inline-grid; place-items: center; width: var(--ds-control-height, 36px); height: var(--ds-control-height, 36px); border: 1px solid transparent; background: var(--ds-color-surface-selection); color: var(--ds-color-action-primary); cursor: pointer; transition: background 140ms ease, opacity 140ms ease; }\n.ds-stepper > .ds-step:first-child { border-radius: var(--ds-radius-control) 0 0 var(--ds-radius-control); }\n.ds-stepper > .ds-step:last-child { border-radius: 0 var(--ds-radius-control) var(--ds-radius-control) 0; }\n.ds-step:hover:not(:disabled) { background: color-mix(in srgb, var(--ds-color-action-primary) 18%, var(--ds-color-surface-card)); }\n.ds-step:disabled { opacity: .4; cursor: default; }\n.ds-cal-head .ds-step { width: 30px; height: 30px; border-radius: 8px; background: transparent; }\n.ds-cal-head .ds-step:hover:not(:disabled) { background: var(--ds-color-surface-selection); }\n\n.ds-search { display: inline-flex; align-items: center; gap: 8px; height: var(--ds-control-height, 36px); padding: 0 12px; border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-control); background: var(--ds-color-surface-card); color: var(--ds-color-text-subtle); transition: border-color 140ms ease, box-shadow 140ms ease; min-width: 200px; }\n.ds-search:focus-within { border-color: var(--ds-color-action-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-color-action-primary) 14%, transparent); }\n.ds-search input { border: 0; outline: none; background: transparent; font: 400 13px/1 var(--ds-font-body); color: var(--ds-color-text-primary); width: 100%; }\n.ds-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }\n.ds-switch input { position: absolute; opacity: 0; width: 0; height: 0; }\n.ds-switch span { width: 34px; height: 20px; border-radius: 999px; background: var(--ds-color-border-control); position: relative; transition: background 160ms ease; }\n.ds-switch span::after { content: \"\"; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform 180ms cubic-bezier(.2,.7,.2,1); }\n.ds-switch input:checked + span { background: var(--ds-color-action-primary); }\n.ds-switch input:checked + span::after { transform: translateX(14px); }\n.ds-switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-color-action-primary) 25%, transparent); }\n.ds-chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--ds-color-border-default); border-radius: 999px; background: var(--ds-color-surface-card); color: var(--ds-color-text-secondary); font: 400 13px/1 var(--ds-font-body); cursor: pointer; transition: all 140ms ease; }\n.ds-chip-btn:hover { border-color: var(--ds-color-action-primary); }\n.ds-chip-btn[aria-pressed=\"true\"] { background: var(--ds-color-surface-selection); border-color: var(--ds-color-action-primary); color: var(--ds-color-action-primary); font-weight: 600; }\n.ds-panel-tools .ds-pill-btn { height: 30px; font-size: 12px; }\n\n/* ---- Builder editing: resize from every corner and edge; widgets are inert so a click selects ---- */\n.ds-grid-edit .react-grid-item > .react-resizable-handle { display: block; position: absolute; z-index: 3; opacity: 0; transition: opacity 140ms ease; }\n.ds-grid-edit .react-grid-item:hover > .react-resizable-handle, .ds-grid-edit .react-grid-item:has(.ds-panel[data-selected=\"true\"]) > .react-resizable-handle { opacity: 1; }\n.ds-grid-edit .react-grid-item > .react-resizable-handle::after { content: \"\"; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px; border: 2px solid var(--ds-color-action-primary); background: var(--ds-color-surface-card); border-radius: 3px; box-shadow: 0 1px 3px rgba(13,13,13,.2); transform: none; right: auto; bottom: auto; }\n.ds-grid-edit .react-resizable-handle-se, .ds-grid-edit .react-resizable-handle-sw, .ds-grid-edit .react-resizable-handle-ne, .ds-grid-edit .react-resizable-handle-nw { width: 18px; height: 18px; }\n.ds-grid-edit .react-resizable-handle-se { right: -7px; bottom: -7px; cursor: nwse-resize; }\n.ds-grid-edit .react-resizable-handle-nw { left: -7px; top: -7px; cursor: nwse-resize; }\n.ds-grid-edit .react-resizable-handle-ne { right: -7px; top: -7px; cursor: nesw-resize; }\n.ds-grid-edit .react-resizable-handle-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }\n.ds-grid-edit .react-resizable-handle-e, .ds-grid-edit .react-resizable-handle-w { top: 50%; width: 14px; height: 28px; margin-top: -14px; cursor: ew-resize; }\n.ds-grid-edit .react-resizable-handle-e { right: -6px; } .ds-grid-edit .react-resizable-handle-w { left: -6px; }\n.ds-grid-edit .react-resizable-handle-n, .ds-grid-edit .react-resizable-handle-s { left: 50%; width: 28px; height: 14px; margin-left: -14px; cursor: ns-resize; }\n.ds-grid-edit .react-resizable-handle-n { top: -6px; } .ds-grid-edit .react-resizable-handle-s { bottom: -6px; }\n.ds-grid-edit .react-resizable-handle-e::after, .ds-grid-edit .react-resizable-handle-w::after { width: 6px; height: 20px; }\n.ds-grid-edit .react-resizable-handle-n::after, .ds-grid-edit .react-resizable-handle-s::after { width: 20px; height: 6px; }\n.ds-grid-edit .react-grid-item.resizing { z-index: 4; }\n.ds-grid-edit .ds-panel-body { user-select: none; }\n.ds-grid-edit .ds-panel [data-ds-part], .ds-grid-edit .ds-panel :is(.ds-panel-title, .ds-kpi-label, .ds-panel-meta, .ds-kpi-main, .ds-kpi-foot, .ds-kpi-sub, .ds-tile, .ds-meters > *, .ds-status, .ds-table-tools, .ds-pager) { cursor: pointer; border-radius: 6px; outline: 1.5px dashed transparent; outline-offset: 2px; transition: outline-color 120ms; }\n.ds-grid-edit .ds-panel[data-selected] :is([data-ds-part], .ds-panel-title, .ds-kpi-label, .ds-panel-meta, .ds-kpi-main, .ds-kpi-foot, .ds-kpi-sub, .ds-tile, .ds-meters > *, .ds-status, .ds-table-tools, .ds-pager):hover { outline-color: color-mix(in srgb, var(--ds-color-action-primary) 55%, transparent); }\n.ds-grid-edit .ds-part-selected, .ds-grid-edit .ds-panel .ds-part-selected { outline: 2px solid var(--ds-color-action-primary) !important; outline-offset: 2px; }\n.ds-grid-edit .ds-panel { user-select: none; }\n\n/* Narrow cards scale their type down instead of overflowing. */\n.ds-panel-body { container-type: inline-size; }\n@container (max-width: 190px) {\n .ds-kpi-value { font-size: calc(var(--ds-type-kpi-size) * .78); line-height: 1.15; }\n .ds-kpi-foot { flex-wrap: wrap; gap: 4px; }\n .ds-tile-value { font-size: 20px; line-height: 24px; }\n}\n@container (max-width: 140px) {\n .ds-kpi-value { font-size: calc(var(--ds-type-kpi-size) * .64); }\n .ds-kpi-unit { display: none; }\n}\n\n/* Dropdown variants */\n.ds-dd[data-block] { display: flex; width: 100%; }\n.ds-dd[data-block] .ds-pill-btn { width: 100%; justify-content: space-between; }\n.ds-dd[data-block] .ds-pill-btn > span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }\n.ds-dd[data-plain] .ds-pill-value { color: var(--ds-color-text-primary); font-weight: 400; }\n.ds-dd[data-size=\"sm\"] .ds-pill-btn { height: 30px; padding: 0 8px; font-size: 12px; gap: 4px; }\n\n/* Table tools, filters, pager */\n.ds-table-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }\n.ds-table-tools .ds-search { flex: 1; max-width: 320px; }\n.ds-table-count { margin-left: auto; font-size: 12px; color: var(--ds-color-text-subtle); }\n.ds-table-scroll { position: relative; }\n.ds-table-busy { position: sticky; top: 0; left: 0; height: 2px; margin-bottom: -2px; z-index: 3; overflow: hidden; background: color-mix(in srgb, var(--ds-color-action-primary) 15%, transparent); }\n.ds-table-busy::after { content: \"\"; position: absolute; inset: 0; width: 40%; background: var(--ds-color-action-primary); animation: ds-busy 1s ease-in-out infinite; }\n@keyframes ds-busy { from { transform: translateX(-100%); } to { transform: translateX(260%); } }\n.ds-table[aria-busy=\"true\"] tbody { opacity: .55; transition: opacity 160ms ease; }\n.ds-filter-row th { background: var(--ds-color-surface-card); padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--ds-color-border-default) 60%, transparent); }\n.ds-cell-filter { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--ds-color-border-default); border-radius: 6px; background: var(--ds-color-surface-card); font: 400 12px/1 var(--ds-font-body); color: var(--ds-color-text-primary); outline: none; transition: border-color 140ms ease, box-shadow 140ms ease; }\n.ds-cell-filter:focus { border-color: var(--ds-color-action-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-color-action-primary) 14%, transparent); }\n.ds-sort { display: inline-flex; flex-direction: column; gap: 1px; margin-left: 6px; vertical-align: middle; }\n.ds-sort::before, .ds-sort::after { content: \"\"; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; opacity: .3; transition: opacity 140ms ease; }\n.ds-sort::before { border-bottom: 4px solid currentColor; }\n.ds-sort::after { border-top: 4px solid currentColor; }\n.ds-sort[data-dir=\"asc\"]::before, .ds-sort[data-dir=\"desc\"]::after { opacity: 1; border-bottom-color: var(--ds-color-action-primary); border-top-color: var(--ds-color-action-primary); }\n.ds-table th button:hover .ds-sort::before, .ds-table th button:hover .ds-sort::after { opacity: .7; }\n.ds-pager { display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding-top: 10px; font-size: 12px; color: var(--ds-color-text-subtle); flex-wrap: wrap; }\n.ds-pager-size { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; }\n.ds-pages { display: inline-flex; align-items: center; gap: 2px; }\n.ds-pages button { min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--ds-color-text-secondary); font: 500 12px/1 var(--ds-font-body); cursor: pointer; transition: background 140ms ease, color 140ms ease; }\n.ds-pages button:hover:not(:disabled) { background: var(--ds-color-surface-selection); }\n.ds-pages button[aria-current=\"page\"] { background: var(--ds-color-action-primary); color: var(--ds-color-action-on-primary); }\n.ds-pages button:disabled { opacity: .35; cursor: default; }\n.ds-page-gap { padding: 0 4px; }\n\n/* Container: a flex layout of panels */\n.ds-container { height: 100%; min-height: 0; }\n.ds-container > .ds-panel { flex: var(--ds-child-flex, 1 1 160px); min-width: var(--ds-child-min, 0); height: auto; }\n.ds-container[data-direction=\"column\"] > .ds-panel { min-height: 0; }\n.ds-container-empty { display: grid; place-items: center; height: 100%; min-height: 80px; border: 1.5px dashed var(--ds-color-border-default); border-radius: var(--ds-radius-card); color: var(--ds-color-text-subtle); font-size: 12px; }\n.ds-panel:has(> .ds-panel-body > .ds-container) { overflow: visible; }\n.ds-grid-edit .ds-panel-body:has(> .ds-container) { pointer-events: auto; }\n.ds-grid-edit .ds-container > .ds-panel { cursor: pointer; }\n\n.ds-filters-spacer { flex: 1; }\n.ds-tour-btn { margin-left: auto; align-self: center; height: calc(var(--ds-control-height, 36px) - 6px); padding: 0 var(--ds-space-md); border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-full); background: var(--ds-color-surface-card); color: var(--ds-color-action-primary); font: 600 var(--ds-type-label-size)/1 var(--ds-font-body); cursor: pointer; }\n.ds-synced + .ds-tour-btn { margin-left: 0; }\n.ds-tour-btn:focus-visible, .ds-tour button:focus-visible, .ds-tour:focus-visible, .ds-filters-toggle:focus-visible, .ds-filter-panel button:focus-visible { outline: 2px solid var(--ds-color-border-focus); outline-offset: 1px; }\n.ds-root [data-tour-active] { outline: 3px solid var(--ds-color-border-focus); outline-offset: 3px; position: relative; z-index: var(--ds-z-raised); }\n.ds-tour { position: fixed; right: auto; bottom: auto; margin: 0; z-index: calc(var(--ds-z-overlay) + 5); width: min(92vw, 340px); background: var(--ds-color-surface-overlay); color: var(--ds-color-text-primary); border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-card); box-shadow: var(--ds-shadow-overlay); padding: var(--ds-space-md); animation: ds-pop-in 180ms cubic-bezier(.2,.7,.2,1) both; }\n.ds-tour-head { display: flex; align-items: baseline; gap: var(--ds-space-sm); }\n.ds-tour-title { margin: 0; font-family: var(--ds-type-heading-family); font-size: var(--ds-type-heading-size); font-weight: var(--ds-type-heading-weight); }\n.ds-tour-count { margin-left: auto; font-size: var(--ds-type-caption-size); color: var(--ds-color-text-subtle); font-variant-numeric: tabular-nums; }\n.ds-tour-text { margin: var(--ds-space-sm) 0 var(--ds-space-md); color: var(--ds-color-text-secondary); }\n.ds-tour-foot { display: flex; align-items: center; gap: var(--ds-space-xs); }\n.ds-tour-skip { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ds-color-text-subtle); text-decoration: underline; text-underline-offset: 2px; }\n.ds-filter-drawer { position: relative; display: flex; margin-bottom: var(--ds-space-lg); }\n.ds-filters-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 var(--ds-space-xs); border-radius: var(--ds-radius-full); background: var(--ds-color-action-primary); color: var(--ds-color-action-on-primary); font-size: var(--ds-type-caption-size); font-weight: 600; }\n.ds-filter-panel { position: absolute; top: calc(100% + var(--ds-space-xs)); left: 0; right: auto; margin: 0; color: var(--ds-color-text-primary); z-index: var(--ds-z-overlay); width: min(92vw, 420px); max-height: 70vh; overflow: auto; background: var(--ds-color-surface-overlay); border: 1px solid var(--ds-color-border-default); border-radius: var(--ds-radius-card); box-shadow: var(--ds-shadow-overlay); padding: var(--ds-space-md); animation: ds-pop-in 180ms cubic-bezier(.2,.7,.2,1) both; }\n.ds-filter-panel:focus-visible { outline: 2px solid var(--ds-color-border-focus); }\n.ds-filter-panel-head { display: flex; align-items: center; margin-bottom: var(--ds-space-sm); font-weight: var(--ds-type-heading-weight); }\n.ds-filter-panel .ds-filters { flex-direction: column; align-items: stretch; margin: 0; padding: 0; background: transparent; box-shadow: none; animation: none; }\n.ds-filter-panel .ds-filters-spacer { display: none; }\n.ds-filter-apply, .ds-filter-reset { height: var(--ds-control-height, 36px); padding: 0 16px; border-radius: var(--ds-radius-control); font: 600 13px/1 var(--ds-font-body); cursor: pointer; transition: background 140ms ease, color 140ms ease, opacity 140ms ease, border-color 140ms ease; }\n.ds-filter-apply { border: 0; background: var(--ds-color-action-primary); color: var(--ds-color-action-on-primary); }\n.ds-filter-apply:hover:not(:disabled) { background: var(--ds-color-action-primary-hover); }\n.ds-filter-reset { border: 1px solid var(--ds-color-border-default); background: var(--ds-color-surface-card); color: var(--ds-color-text-secondary); }\n.ds-filter-reset:hover:not(:disabled) { border-color: var(--ds-color-action-primary); color: var(--ds-color-action-primary); }\n.ds-filter-apply:disabled, .ds-filter-reset:disabled { opacity: .4; cursor: default; }\n/* Flow layout (phones by default): panels wrap like a flex container and grow to fit their content */\n.ds-flow { display: flex; flex-wrap: wrap; align-items: stretch; }\n.ds-flow-item { display: flex; flex-direction: column; min-width: 0; animation: ds-rise 420ms cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--ds-i, 0) * 35ms); }\n.ds-flow-item > * { flex: 1 1 auto !important; min-height: 0; min-width: 0 !important; max-width: none !important; align-self: stretch !important; }\n/* Filter widget: one filter on the canvas */\n.ds-filter-widget { display: flex; align-items: center; min-height: 100%; }\n.ds-filter-widget[data-fill] > * { flex: 1; }\n.ds-filter-widget[data-fill] .ds-dd, .ds-filter-widget[data-fill] .ds-dd > button { width: 100%; }\n.ds-filter-missing { display: grid; place-items: center; height: 100%; min-height: 36px; border: 1.5px dashed var(--ds-color-border-control); border-radius: var(--ds-radius-control); color: var(--ds-color-text-subtle); font-size: var(--ds-type-label-size); }\n.ds-container .ds-filter-widget { min-height: 0; }\n.ds-filter-pick { border-radius: var(--ds-radius-control); cursor: pointer; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 120ms; }\n.ds-filter-pick:hover { outline-color: color-mix(in srgb, var(--ds-color-action-primary) 45%, transparent); }\n.ds-filter-pick[data-selected] { outline-color: var(--ds-color-action-primary); }\n.ds-filter-pick * { pointer-events: none; }\n.ds-filters[data-look=\"plain\"] { background: transparent; padding-left: 0; padding-right: 0; box-shadow: none; }\n.ds-filters[data-editable] { cursor: pointer; outline: 1.5px dashed transparent; outline-offset: 2px; transition: outline-color 120ms; }\n.ds-filters[data-editable]:hover { outline-color: color-mix(in srgb, var(--ds-color-action-primary) 45%, transparent); }\n.ds-filters[data-picked] { outline: 2px solid var(--ds-color-action-primary) !important; }\n/* Small elements in a widget's header, and drag and drop in the Builder */\n.ds-panel-addons { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }\n.ds-panel-addons > .ds-panel { padding: 0; background: none; box-shadow: none; border: 0; min-height: 0; height: auto; }\n.ds-panel-addons > .ds-panel > .ds-panel-head { display: none; }\n.ds-panel-addons .ds-panel-body { container-type: normal; flex: none; }\n.ds-panel-addons .ds-status { padding: 0; }\n.ds-panel[data-nested][draggable=\"true\"] { cursor: grab; }\n.ds-panel[data-drop-over] { outline: 2px dashed var(--ds-color-action-primary) !important; outline-offset: 3px; background-color: color-mix(in srgb, var(--ds-color-action-primary) 6%, var(--ds-color-surface-card)); }\n.ds-panel[data-tone=\"plain\"] { min-height: 0; }\n/* Atoms: the pieces of a hand-built card */\n.ds-atom-text { display: block; line-height: 1.35; font-size: var(--ds-type-body-size); }\n.ds-atom-text[data-size=\"xs\"] { font-size: 11px; } .ds-atom-text[data-size=\"sm\"] { font-size: var(--ds-type-label-size); }\n.ds-atom-text[data-size=\"lg\"] { font-size: 18px; font-family: var(--ds-font-heading); } .ds-atom-text[data-size=\"xl\"] { font-size: 24px; font-family: var(--ds-font-heading); }\n.ds-atom-text[data-weight=\"medium\"] { font-weight: 500; } .ds-atom-text[data-weight=\"bold\"] { font-weight: 700; }\n.ds-atom-value { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--ds-font-heading); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ds-color-text-primary); }\n.ds-atom-value small { font-family: var(--ds-font-body); font-size: var(--ds-type-label-size); font-weight: 400; color: var(--ds-color-text-subtle); }\n.ds-atom-value[data-size=\"xs\"] { font-size: 14px; } .ds-atom-value[data-size=\"sm\"] { font-size: 18px; } .ds-atom-value[data-size=\"md\"] { font-size: 24px; } .ds-atom-value[data-size=\"lg\"] { font-size: 30px; } .ds-atom-value[data-size=\"xl\"] { font-size: 40px; }\n.ds-atom-progress { display: flex; align-items: center; gap: 8px; }\n.ds-atom-progress > span { flex: 1; border-radius: 999px; background: var(--ds-color-surface-sunken); overflow: hidden; }\n.ds-atom-progress > span > span { display: block; height: 100%; border-radius: inherit; transition: width 600ms cubic-bezier(.2,.7,.2,1); }\n.ds-atom-progress small { font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); font-variant-numeric: tabular-nums; }\n.ds-atom-icon { display: inline-grid; place-items: center; border-radius: 999px; }\n.ds-atom-divider { border: 0; border-top: 1px solid var(--ds-color-border-default); margin: 4px 0; width: 100%; }\n.ds-atom-divider[data-dashed] { border-top-style: dashed; }\n.ds-atom-divider[data-dir=\"vertical\"] { border-top: 0; border-left: 1px solid var(--ds-color-border-default); width: 0; height: 100%; margin: 0 4px; }\n.ds-container > .ds-panel[data-tone=\"plain\"] { padding: 0; }\n/* Card-less pieces (atoms, badges, filters) size to their content */\n.ds-panel[data-tone=\"plain\"] > .ds-panel-body { container-type: normal; }\n/* Slots: nodes inside nodes */\n.ds-slot { min-width: 0; }\n.ds-slot[data-slot=\"footer\"] { margin-top: var(--ds-space-sm); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }\n.ds-slot[data-empty] { display: grid; place-items: center; min-height: 44px; border: 1.5px dashed var(--ds-color-border-control); border-radius: var(--ds-radius-control); color: var(--ds-color-text-subtle); font-size: var(--ds-type-label-size); padding: 8px; }\n.ds-slot-hint { pointer-events: none; }\n.ds-panel[data-drop-over] [data-slot][data-empty] { border-color: var(--ds-color-action-primary); color: var(--ds-color-action-primary); background: color-mix(in srgb, var(--ds-color-action-primary) 6%, transparent); }\n.ds-card-body { min-height: 0; }\n.ds-card-body > .ds-panel { flex: none; }\n.ds-tabs { display: flex; flex-direction: column; gap: var(--ds-space-sm); height: 100%; }\n.ds-tabs-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--ds-color-border-default); }\n.ds-tabs-bar button { border: 0; background: none; padding: 8px 12px; font: inherit; font-size: var(--ds-type-label-size); color: var(--ds-color-text-subtle); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }\n.ds-tabs-bar button[aria-selected=\"true\"] { color: var(--ds-color-action-primary); border-bottom-color: var(--ds-color-action-primary); font-weight: 600; }\n.ds-tabs-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--ds-space-sm); overflow: auto; }\n.ds-repeater { height: 100%; overflow: auto; }\n.ds-repeater-item { display: flex; flex-direction: column; gap: 8px; }\n.ds-repeater-item > .ds-panel { height: auto; }\n";
|
|
1391
|
+
|
|
1392
|
+
/** Every built-in widget: data widgets, layout nodes, the canvas Filter and the atoms. */
|
|
1393
|
+
declare const builtInWidgets: WidgetDefinition[];
|
|
1394
|
+
|
|
1395
|
+
/** Declares a widget. Returns it unchanged, typed. */
|
|
1396
|
+
declare function defineWidget<S extends ZodTypeAny>(def: WidgetDefinition<S>): WidgetDefinition<S>;
|
|
1397
|
+
|
|
1398
|
+
type Obj = Record<string, unknown>;
|
|
1399
|
+
interface WrapOptions<S extends z.ZodTypeAny> {
|
|
1400
|
+
/** Namespaced kind, e.g. "acme.Table" or "mui.DataGrid". */
|
|
1401
|
+
kind: string;
|
|
1402
|
+
version?: number;
|
|
1403
|
+
meta: WidgetMeta;
|
|
1404
|
+
/** The JSON this widget takes (plain values only). Default: any object. */
|
|
1405
|
+
schema?: S;
|
|
1406
|
+
defaults?: Partial<z.input<S>>;
|
|
1407
|
+
/** The role it fills; widgets with the same role take the same JSON and can be swapped by `kind` or alias. */
|
|
1408
|
+
implements?: string;
|
|
1409
|
+
exposes?: Record<string, string>;
|
|
1410
|
+
/** The component's props from the JSON, the bound data and the dashboard (theme tokens, helpers…). */
|
|
1411
|
+
mapProps?: (ctx: WidgetProps<z.output<S>>) => Obj;
|
|
1412
|
+
/** Component callback → DashSpec event, e.g. { onRowActivate: "rowClick" }; the first argument becomes `value`. */
|
|
1413
|
+
events?: Record<string, string>;
|
|
1414
|
+
/** Component props that take React elements → slots, e.g. { children: "body", actions: "actions" }. */
|
|
1415
|
+
slots?: Record<string, string>;
|
|
1416
|
+
/** Component callback → global state, e.g. { onSelect: "selectedHeat" } (writes your own state). */
|
|
1417
|
+
writes?: Record<string, string>;
|
|
1418
|
+
frame?: "card" | "plain";
|
|
1419
|
+
small?: boolean;
|
|
1420
|
+
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Registers any React component (from any design system) as a DashSpec widget: JSON props, data, events,
|
|
1423
|
+
* slots and state writes are mapped declaratively, so the JSON only ever names `kind`.
|
|
1424
|
+
*/
|
|
1425
|
+
declare function wrapComponent<P extends object, S extends z.ZodTypeAny = z.ZodRecord<z.ZodString, z.ZodUnknown>>(Component: ComponentType<P>, o: WrapOptions<S>): WidgetDefinition<S>;
|
|
1426
|
+
/** A widget whose code (and its design system) downloads only when a dashboard uses it. */
|
|
1427
|
+
declare function lazyWidget<S extends z.ZodTypeAny>(def: Omit<WidgetDefinition<S>, "component"> & {
|
|
1428
|
+
load: () => Promise<{
|
|
1429
|
+
default: ComponentType<WidgetProps<z.output<S>>>;
|
|
1430
|
+
}>;
|
|
1431
|
+
fallback?: ReactNode;
|
|
1432
|
+
}): WidgetDefinition<S>;
|
|
1433
|
+
|
|
1434
|
+
export { AnyWidgetDefinition, BAR, BAR_ICONS, type Breakpoint, CallbackApi, type ColorTokens, ControlField, type DashEvent, DashSpecProvider, type DashSpecSettings, Dashboard, DashboardContext, type DashboardHandle, DashboardRenderer, type DashboardRendererProps, type DashboardRuntime, type DatasourceType, DateControl, DateRangeControl, type DeepPartial, type DesignSystem, FilterBar, Grid, type GridChangeItem, type HostHooks, HttpClient, JsonValue, type LayoutSpec, ModalHost, MultiSelectControl, NetworkOptions, type NodeScope, type Option, PanelFrame, RENDERER_CSS, ResolvedRequest, type RuntimeOptions, type ScaleTokens, Scope, ScriptMode, ScriptRunner, SelectControl, Slot, SlotDefinition, type SourceState, type StatusColors, type StatusTone, type Theme, ThemeContext, type ThemeInput, type ThemeMode, ThemeScope, type ThemeScopeProps, TimeSettings, type Tree, type TypeRole, type UIChipsProps, type UIComponents, type UICustomFilterProps, type UIDateProps, type UIDateRangeProps, type UIMultiSelectProps, type UISearchProps, type UISelectProps, type UIStateProps, type UIToggleProps, WidgetDefinition, WidgetMeta, WidgetProps, type WidgetRegistry, type WrapOptions, builtInWidgets, checkWidget, combineDesignSystems, createDashboardRuntime, createTheme, createWidgetRegistry, defaultTheme, defineDesignSystem, defineWidget, echartsTheme, layoutsForView, lazyWidget, mergeDeep, panelRows, presetRange, resolveMode, themeCssVars, themeStylesheet, timeSettingsFor, useDashSpecSettings, useDashboard, useDashboardActions, useDashboardState, useNodeScope, useThemeTokens, useTree, widgetChecks, wrapComponent };
|