@dashspec/renderer 0.1.24 → 0.1.25

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.
@@ -7553,7 +7553,7 @@ declare class TransformError extends Error {
7553
7553
  declare function applyTransform(data: unknown, steps: readonly Step[], root: Scope, opts?: TransformOptions): unknown;
7554
7554
 
7555
7555
  /** This package's version. A test keeps it equal to package.json's; bump both together. */
7556
- declare const RENDERER_VERSION = "0.1.24";
7556
+ declare const RENDERER_VERSION = "0.1.25";
7557
7557
  /**
7558
7558
  * Whether `version` satisfies `range`. Supports what documents need: "1.2.3" (that or newer within the major, like
7559
7559
  * "^"), ">=1.2", ">1.2.3", "<2", "<=2.1", "^1.2", "~1.2.3", and several of them separated by spaces (all must hold).
package/dist/core.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- 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, D as Dashboard, 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, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, a$ as Grid, K as Handler, L as HelperSettings, M as Helpers, H as HttpClient, O as HttpClientInternals, P as Id, J as JsonValue, 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, N as NetworkOptions, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, R as ResolvedRequest, ac as SCHEMA_URL, S as Scope, ad as Severity, ae as Spec, b0 as StatusTone, af as Template, a as TimeSettings, 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, 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 stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-CoD8E3Nf.js';
1
+ 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, D as Dashboard, 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, y as EventHandler, z as EventMap, F as Expression, G as ExpressionError, I as FnProp, a$ as Grid, K as Handler, L as HelperSettings, M as Helpers, H as HttpClient, O as HttpClientInternals, P as Id, J as JsonValue, 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, N as NetworkOptions, a1 as Node, a2 as Panel, a3 as PanelControl, a4 as PanelMigration, a6 as Problem, a7 as RENDERER_VERSION, a8 as RESERVED_STATE_KEYS, a9 as RefRoot, aa as Reference, ab as Requires, R as ResolvedRequest, ac as SCHEMA_URL, S as Scope, ad as Severity, ae as Spec, b0 as StatusTone, af as Template, a as TimeSettings, 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, 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 stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-CckPNnHH.js';
2
2
  import 'zod';
3
3
  import 'react';
package/dist/core.js CHANGED
@@ -81,7 +81,7 @@ import {
81
81
  templateReferences,
82
82
  translator,
83
83
  validateDocument
84
- } from "./chunk-2MDF5QTY.js";
84
+ } from "./chunk-CAQDGXIF.js";
85
85
  export {
86
86
  ACTION_KINDS,
87
87
  ACTION_SCHEMAS,
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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-CoD8E3Nf.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 stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-CoD8E3Nf.js';
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-CckPNnHH.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 stripStrings, aY as templateReferences, aZ as translator, a_ as validateDocument } from './core-CckPNnHH.js';
3
3
  import * as react from 'react';
4
4
  import { CSSProperties, ReactNode, ComponentType } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
package/dist/index.js CHANGED
@@ -116,7 +116,7 @@ import {
116
116
  translator,
117
117
  validateDocument,
118
118
  widgetChecks
119
- } from "./chunk-2MDF5QTY.js";
119
+ } from "./chunk-CAQDGXIF.js";
120
120
  import {
121
121
  createStateProxy,
122
122
  getPath,
@@ -0,0 +1,42 @@
1
+ # Styling hooks: CSS classes and attributes
2
+
3
+ `theme.widgets["Kind"]` and `theme.widgets["Kind:variant"]` take a `css` string where `&` is the panel
4
+ (see [theming.md](theming.md)). These are the class names and attributes inside a panel you can target.
5
+ They are part of the public contract: a name listed here is not renamed or removed within a major version
6
+ (`test/css-hooks.test.ts` fails if one disappears from the source). Anything not listed is internal.
7
+
8
+ ## Attributes on every panel
9
+
10
+ | Attribute | Value |
11
+ |---|---|
12
+ | `data-panel` | the panel id |
13
+ | `data-kind` | the widget kind, e.g. `Kpi` |
14
+ | `data-variant` | the panel's `style.variant` |
15
+ | `data-nested` | set on a panel drawn inside a slot |
16
+
17
+ Prefer `theme.widgets` (scoped by kind/variant) over global selectors on these.
18
+
19
+ ## Classes by widget
20
+
21
+ | Widget | Classes |
22
+ |---|---|
23
+ | Breakdown | `.ds-donut`, `.ds-dot`, `.ds-kpi-sub`, `.ds-legend`, `.ds-meter-head`, `.ds-meter-value`, `.ds-meters`, `.ds-progress`, `.ds-segbar` |
24
+ | CardGrid | `.ds-card`, `.ds-card-fields`, `.ds-card-head`, `.ds-cards`, `.ds-chip-count`, `.ds-pill`, `.ds-progress` |
25
+ | Container | `.ds-container`, `.ds-slot-hint` |
26
+ | Content | `.ds-content` |
27
+ | Filter | `.ds-filter-missing`, `.ds-filter-widget` |
28
+ | Image | `.ds-plain`, `.ds-state` |
29
+ | ImageMap | `.ds-imagemap`, `.ds-marker` |
30
+ | Kpi | `.ds-chip`, `.ds-kpi`, `.ds-kpi-delta`, `.ds-kpi-empty`, `.ds-kpi-foot`, `.ds-kpi-label`, `.ds-kpi-main`, `.ds-kpi-sub`, `.ds-kpi-unit`, `.ds-kpi-value`, `.ds-progress` |
31
+ | StageTracker | `.ds-stage-dot`, `.ds-stages` |
32
+ | StateTimeline | `.ds-dot`, `.ds-legend`, `.ds-timeline`, `.ds-timeline-axis`, `.ds-timeline-bar`, `.ds-timeline-lane`, `.ds-timeline-name` |
33
+ | Status | `.ds-dot`, `.ds-pill`, `.ds-status`, `.ds-status-label` |
34
+ | Table | `.ds-button`, `.ds-cell`, `.ds-cell-empty`, `.ds-cell-filter`, `.ds-cell-list`, `.ds-cell-sub`, `.ds-cell-value`, `.ds-chip`, `.ds-filter-row`, `.ds-inline`, `.ds-link`, `.ds-page-gap`, `.ds-pager`, `.ds-pager-of`, `.ds-pager-range`, `.ds-pager-size`, `.ds-pages`, `.ds-progress`, `.ds-row-detail`, `.ds-search`, `.ds-sort`, `.ds-spacer`, `.ds-table`, `.ds-table-busy`, `.ds-table-count`, `.ds-table-scroll`, `.ds-table-tools`, `.ds-table-wrap` |
35
+ | Tiles | `.ds-chip-count`, `.ds-dot`, `.ds-kpi-unit`, `.ds-tile`, `.ds-tile-caption`, `.ds-tile-label`, `.ds-tile-main`, `.ds-tile-value`, `.ds-tiles` |
36
+ | Atoms (Text, Value, Progress, Icon, Divider, Button) | `.ds-atom-divider`, `.ds-atom-icon`, `.ds-atom-progress`, `.ds-atom-text`, `.ds-atom-value`, `.ds-button` |
37
+ | BarChart, LineChart, PieChart, Scatter, Gauge | `.ds-chart`, `.ds-chart-legend`, `.ds-swatch`, `.ds-swatch-line` |
38
+ | Card, Tabs, Repeater | `.ds-card-body`, `.ds-repeater`, `.ds-repeater-item`, `.ds-slot-hint`, `.ds-state`, `.ds-tabs`, `.ds-tabs-bar`, `.ds-tabs-panel` |
39
+ | Every panel (frame) | `.ds-badge`, `.ds-crumbs`, `.ds-live`, `.ds-loading`, `.ds-loading-text`, `.ds-panel`, `.ds-panel-addons`, `.ds-panel-body`, `.ds-panel-foot`, `.ds-panel-head`, `.ds-panel-meta`, `.ds-panel-title`, `.ds-panel-toolbar`, `.ds-panel-tools`, `.ds-part-selected`, `.ds-skeleton`, `.ds-state` |
40
+
41
+ The dashboard root is `ds-root` (`data-ds-theme="light|dark"`). Colours, fonts and sizes are better changed
42
+ through tokens (`--ds-*` variables) than through these classes; use classes for layout and details tokens don't cover.
package/docs/theming.md CHANGED
@@ -114,7 +114,7 @@ const theme = createTheme({
114
114
  widgets: {
115
115
  Kpi: {
116
116
  vars: { "--ds-type-kpi-size": "32px" }, // any --ds-* token, or your own variables
117
- css: "& .ds-kpi-label { text-transform: uppercase; }", // & is the panel
117
+ css: "& .ds-kpi-label { text-transform: uppercase; }", // & is the panel; classes: docs/styling-hooks.md
118
118
  },
119
119
  "acme.Gauge": { settings: { ring: "thick" } }, // read by your widget
120
120
  },
@@ -267,3 +267,6 @@ is merged last:
267
267
  `echartsTheme(theme, mode)` returns the ECharts theme object built from the tokens, if
268
268
  you draw your own ECharts charts and want them to match. Inside a widget,
269
269
  `useThemeTokens()` gives you `{ theme, mode }`.
270
+
271
+
272
+ The class names and attributes you can target in `css` are listed in [styling-hooks.md](styling-hooks.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashspec/renderer",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Draws a dashboard from DashSpec JSON: widgets, data, events, state.",
5
5
  "keywords": [
6
6
  "dashboard",