@dashspec/renderer 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schema.json CHANGED
@@ -2617,6 +2617,10 @@
2617
2617
  "plain"
2618
2618
  ]
2619
2619
  },
2620
+ "variant": {
2621
+ "type": "string",
2622
+ "pattern": "^[A-Za-z][\\w-]*$"
2623
+ },
2620
2624
  "padding": {
2621
2625
  "anyOf": [
2622
2626
  {
package/docs/data.md CHANGED
@@ -493,6 +493,7 @@ Reading a member of `null` or `undefined` gives `undefined` instead of an error.
493
493
  | `today()` | Today's date, `YYYY-MM-DD` |
494
494
  | `includesToday(range)` | Whether a `{ from, to }` range contains today |
495
495
  | `granularityFor(range)` | `"heat"` (≤ 1 day), `"day"` (≤ 31), `"week"` (≤ 92), `"month"` (≤ 730) or `"year"` |
496
+ | `first(list, field)` | The first item whose `field` is truthy, e.g. `first(stages, 'waiting').name` |
496
497
  | `fmt.number(v, decimals?)` | `1,234.5` in the dashboard's locale |
497
498
  | `fmt.compact(v)` | `12.3K` |
498
499
  | `fmt.percent(v, decimals = 0)` | `42.5%` (`v` is already a percentage) |
package/docs/theming.md CHANGED
@@ -120,7 +120,8 @@ const theme = createTheme({
120
120
  });
121
121
  ```
122
122
 
123
- Each panel carries `data-kind="<kind>"`, which is what these rules target. Your own widget
123
+ Each panel carries `data-kind="<kind>"`, which is what these rules target. A key `"Kind:variant"`
124
+ styles only panels of that kind whose `style.variant` is that name, so two tables can look different. Your own widget
124
125
  (registered with `widgets` on the provider or renderer) reads its entry with
125
126
  `useThemeTokens()?.theme.widgets?.["acme.Gauge"]`. Variable names must look like `--name`; values
126
127
  with `;`, braces or `<>` are dropped, and `css` may not contain a `<style>` tag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashspec/renderer",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Draws a dashboard from DashSpec JSON: widgets, data, events, state.",
5
5
  "keywords": [
6
6
  "dashboard",