@dashspec/renderer 0.1.23 → 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.
- package/CHANGELOG.md +19 -0
- package/dist/{chunk-ILYFOW36.js → chunk-CAQDGXIF.js} +4 -2
- package/dist/{chunk-ILYFOW36.js.map → chunk-CAQDGXIF.js.map} +1 -1
- package/dist/{core-gq7Olh3c.d.ts → core-CckPNnHH.d.ts} +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/docs/styling-hooks.md +42 -0
- package/docs/theming.md +4 -1
- package/docs/widgets.md +1 -1
- package/package.json +1 -1
|
@@ -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/docs/widgets.md
CHANGED
|
@@ -107,7 +107,7 @@ Field props such as `x`, `label` or `value` name a field of each data row; dot p
|
|
|
107
107
|
|
|
108
108
|
| Kind | What it shows | Main props | Events |
|
|
109
109
|
|---|---|---|---|
|
|
110
|
-
| `BarChart` | Bars, grouped, stacked or horizontal | `x` (required), `y` (field or list), `seriesBy`, `labels`, `stacked`, `normalized`, `horizontal`, `range: { low, high }`, `pageSize`, `colorBy` (`average` / `none`), `partial`, `valueLabels`, `averageLine`, `legendLabels`, `target`, `targetLabel`, `valueAxis` (`min`, `max`, `atLeast`, `step`), `tooltip` (`{ title, lines }`, templates over the hovered `row`; `**bold**` for values), `unit`, `format` | `click`, `doubleClick`, `hover`, `hoverEnd`, `legendClick`, `brush`, `datazoom` (parts `bar`, `legend`, `axis`) |
|
|
110
|
+
| `BarChart` | Bars, grouped, stacked or horizontal | `x` (required), `y` (field or list), `seriesBy`, `labels`, `seriesColors` (colour per y field or series value), `stacked`, `normalized`, `horizontal`, `range: { low, high }`, `pageSize`, `colorBy` (`average` / `none`), `partial`, `valueLabels`, `averageLine`, `legendLabels`, `target`, `targetLabel`, `valueAxis` (`min`, `max`, `atLeast`, `step`), `tooltip` (`{ title, lines }`, templates over the hovered `row`; `**bold**` for values), `unit`, `format` | `click`, `doubleClick`, `hover`, `hoverEnd`, `legendClick`, `brush`, `datazoom` (parts `bar`, `legend`, `axis`) |
|
|
111
111
|
| `LineChart` | Lines or areas over `x` | `x` (required), `y`, `seriesBy`, `area`, `gradient`, `smooth`, plus the bar chart's `labels`, `target`, `unit`, `format` | same as BarChart (parts `point`, `legend`, `axis`) |
|
|
112
112
|
| `PieChart` | A pie or donut | `label`, `value` (required), `donut`, `unit`, `format`, `decimals` | `click`, `hover`, `hoverEnd`, `legendClick` (parts `slice`, `legend`) |
|
|
113
113
|
| `Scatter` | Points by two numbers | `x`, `y` (required), `size`, `series`, `xLabel`, `yLabel` | `click`, `hover`, `hoverEnd`, `brush`, `legendClick` |
|