@dashspec/renderer 0.1.3 → 0.1.5

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
@@ -136,7 +136,8 @@
136
136
  "type": "string",
137
137
  "enum": [
138
138
  "card",
139
- "plain"
139
+ "plain",
140
+ "segmented"
140
141
  ],
141
142
  "default": "card"
142
143
  }
@@ -2916,6 +2917,9 @@
2916
2917
  "minH": {
2917
2918
  "type": "integer",
2918
2919
  "minimum": 1
2920
+ },
2921
+ "fit": {
2922
+ "type": "boolean"
2919
2923
  }
2920
2924
  },
2921
2925
  "required": [
@@ -80,12 +80,13 @@ keeps the default theme.
80
80
 
81
81
  ```json
82
82
  "filterBar": { "apply": "change" | "button", "reset": false, "show": true,
83
- "icon": "sliders" | "filter" | "calendar" | "search" | "none", "look": "card" | "plain" }
83
+ "icon": "sliders" | "filter" | "calendar" | "search" | "none", "look": "card" | "plain" | "segmented" }
84
84
  ```
85
85
 
86
86
  `apply: "button"` holds filter changes as drafts until the viewer presses Apply;
87
87
  `reset: true` adds a Reset button; `show: false` hides the bar (filters can still be
88
- placed on the canvas).
88
+ placed on the canvas). `look: "segmented"` puts the icon and the filters together in one
89
+ track (the theme's sunken surface) as borderless chips without leading icons.
89
90
 
90
91
  **Translations.** `${t.revenue}` is the text for the active locale (the host's `locale`
91
92
  prop, else `display.locale`). A locale matches exactly (any case), then by language
@@ -302,7 +303,8 @@ Its nodes read the arguments as `${modal.args.*}`.
302
303
 
303
304
  ## `spec.layouts`
304
305
 
305
- One entry per view and breakpoint. Either `items` (`{ panel, x, y, w, h, minW?, minH? }`
306
+ One entry per view and breakpoint. Either `items` (`{ panel, x, y, w, h, minW?, minH?, fit? }`; `fit: true`
307
+ lets the card grow taller than `h` when its content needs it, so it never scrolls
306
308
  on the grid) or `auto`: `"flow"` (wrap in order, heights fit the content; phones use this
307
309
  when there is no mobile layout) or `"stack"` (one column at desktop heights). Only
308
310
  top-level nodes appear here; nested nodes live in slots.
package/docs/theming.md CHANGED
@@ -29,6 +29,7 @@ interface Theme {
29
29
  | `scale.z` | `raised`, `sticky`, `overlay`, `tooltip` |
30
30
  | `scale.breakpoints` | `sm`, `md`, `lg`, `xl`, `tv` (px) |
31
31
  | `scale.density` | `"compact"`, `"comfortable"` (default) or `"spacious"`. Scales every `--ds-space-*` (×0.75, ×1, ×1.25, rounded) and sets `--ds-control-height` (30, 36, 42 px) for filters, buttons and inputs; also emitted as `--ds-density`. Your own widgets can read it with `useThemeTokens` |
32
+ | `scale.chip` | Status chips ("On track", "Target un-defined"): `radius`, `border`, `weight`, `paddingX`, `height`, `fontSize` in px. Leave out for the default look; e.g. `{ "radius": 999, "border": 0, "weight": 700 }` for borderless pills |
32
33
  | `surface` | `page`, `card`, `sunken`, `overlay`, `selection`, `scrim`, `backdrop?` (page background, may be a gradient), `tableHeader?` |
33
34
  | `text` | `primary`, `secondary`, `subtle`, `disabled`, `onFill` |
34
35
  | `border` | `default`, `control`, `focus` |
package/docs/widgets.md CHANGED
@@ -66,7 +66,7 @@ Field props such as `x`, `label` or `value` name a field of each data row; dot p
66
66
 
67
67
  | Kind | What it shows | Main props | Events |
68
68
  |---|---|---|---|
69
- | `Kpi` | A metric card: label, big value, target and an "On track / Action needed" chip | `unit`, `format`, `decimals`, `target`, `targetLabel`, `goodWhen` (`up` / `down` / `none`), `badge`, `statusLabels`, `compare`, `band`, `progress`, `note`, `emptyText`, `sublabel`, `size` (`normal` / `hero`), `tone` | `click`, `hover` (part `value`) |
69
+ | `Kpi` | A metric card: label, big value, target and an "On track / Action needed" chip | `unit`, `unitStyle` (`small` / `value`), `format`, `decimals`, `target`, `targetLabel`, `goodWhen` (`up` / `down` / `none`), `badge`, `statusLabels`, `compare`, `band`, `progress`, `note`, `emptyText`, `empty` (show `emptyText` even with a value), `sublabel`, `size` (`normal` / `hero`), `tone` | `click`, `hover` (part `value`) |
70
70
  | `Tiles` | One tile per row: label, big number, caption | `label`, `value` (required), `caption`, `status`, `statusMap`, `valueTone`, `count`, `format`, `unit`, `columns`, `minTileWidth`, `wrap`, `selectable`, `selected` | `click`, `hover`, `select` (part `tile`) |
71
71
  | `Gauge` | A value on an arc or circle with coloured bands | `min` (0), `max` (100), `bands: [{ to, tone }]`, `shape` (`arc` / `circle`), `unit`, `format`, `decimals` | `click` |
72
72
  | `Status` | A status badge from a state field, or fixed text | `state` (field, default `"state"`), `stateMap`, `labels`, `label`, `text`, `tone` | `click` |
@@ -147,7 +147,7 @@ Charts take their colours from the theme's `chart.series` tokens (see
147
147
 
148
148
  | Kind | What it shows | Main props | Events |
149
149
  |---|---|---|---|
150
- | `Table` | Rows and columns with sorting, search, filters, paging, totals and pivots | `columns` (below), `columnsFrom`, `totals`, `pivot`, `pagination`, `search`, `sorting`, `filtering`, `sticky`, `rowKey`, `rowMutedWhen`, `virtual`, `density` | `rowClick`, `cellClick`, `hover` (parts `row`, `cell`) |
150
+ | `Table` | Rows and columns with sorting, search, filters, paging, totals and pivots | `columns` (below), `columnsFrom`, `totals`, `pivot`, `pagination`, `search`, `sorting`, `filtering`, `sticky`, `rowKey`, `rowMutedWhen`, `virtual`, `density`, `maxHeight` (px; rows scroll past it) | `rowClick`, `cellClick`, `hover` (parts `row`, `cell`) |
151
151
  | `CardGrid` | One card per row with fields, a status and a progress bar | `cardTitle` (required), `fields: [{ key, label, format, unit }]`, `status`, `statusMap`, `progress: { value, max, label }`, `badge`, `minCardWidth`, `selectable`, `selected`, `rowKey` | `click`, `select` (part `card`) |
152
152
 
153
153
  A table column is `{ key, label?, type?, … }`. `type` is `text`, `number`, `badge`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashspec/renderer",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Draws a dashboard from DashSpec JSON: widgets, data, events, state.",
5
5
  "keywords": [
6
6
  "dashboard",