@dashspec/renderer 0.1.7 → 0.1.9

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 CHANGED
@@ -14,6 +14,32 @@ under the new version.
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.1.9] - 2026-11-18
18
+
19
+ ### Added
20
+
21
+ - Table column options `sub` (second line), `chips` (`{ text, tone, when }` tags), `weight` and
22
+ `valueTone` (an expression returning a tone, `action` or `muted`).
23
+ - Table `columnsFrom.column`: a column pattern for every generated column (`{key}`, `{label}`
24
+ filled in); `columnsFrom.after`: mix generated columns into fixed `columns`.
25
+ - Table `totalsRow: { path, label }`: a total row taken from the data, drawn with the column options.
26
+ - Table `expand: true` with a `detail` slot: a clicked row opens the slot under it (the row is
27
+ `${item.*}`); the open row is in `panels.<id>.ui.expanded` and `ui.expandedRow`.
28
+ - Tiles `chips`, `mutedWhen` (dashed, greyed), `highlightWhen` / `highlightTone` (accent border),
29
+ and a `value` that may be a template over `row`.
30
+
31
+ ### Fixed
32
+
33
+ - The ⓘ tooltip fades and slides in when it opens and fades out before it closes (no motion
34
+ with reduced motion).
35
+
36
+ ## [0.1.8] - 2026-11-18
37
+
38
+ ### Fixed
39
+
40
+ - Stacked bar charts label each column once, with its total, on the top segment, instead of one
41
+ overlapping label per segment.
42
+
17
43
  ## [0.1.7] - 2026-11-18
18
44
 
19
45
  ### Added
@@ -164,7 +190,9 @@ First public release.
164
190
  never reach object prototypes, values inserted into Markdown are escaped, and custom
165
191
  code runs in the sandbox by default. See [docs/security.md](docs/security.md).
166
192
 
167
- [Unreleased]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.7...HEAD
193
+ [Unreleased]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.9...HEAD
194
+ [0.1.9]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.8...v0.1.9
195
+ [0.1.8]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.7...v0.1.8
168
196
  [0.1.7]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.6...v0.1.7
169
197
  [0.1.6]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.5...v0.1.6
170
198
  [0.1.5]: https://github.com/vaskar-nowpurchase/dashspec-renderer/compare/v0.1.4...v0.1.5
@@ -1808,7 +1808,7 @@ function migrateDocument(input, widgets = []) {
1808
1808
  import { z as z10 } from "zod";
1809
1809
 
1810
1810
  // src/version.ts
1811
- var RENDERER_VERSION = "0.1.7";
1811
+ var RENDERER_VERSION = "0.1.9";
1812
1812
  var parse2 = (v) => {
1813
1813
  const m = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:[-+].*)?$/.exec(v.trim());
1814
1814
  return m ? [Number(m[1]), Number(m[2] ?? 0), Number(m[3] ?? 0)] : void 0;
@@ -2586,6 +2586,8 @@ var Common2 = {
2586
2586
  /** Hover group for cross-panel highlight. */
2587
2587
  highlight: z12.string().optional()
2588
2588
  };
2589
+ var Chip = z12.object({ text: z12.string(), tone: z12.string().optional(), when: z12.string().optional() }).strict();
2590
+ var Chips = z12.array(Chip);
2589
2591
 
2590
2592
  // src/widgets/schemas/Breakdown.ts
2591
2593
  var BreakdownContract = {
@@ -2870,6 +2872,14 @@ var Column = z25.object({
2870
2872
  max: z25.number().optional(),
2871
2873
  width: z25.union([z25.number(), z25.string()]).optional(),
2872
2874
  sortable: z25.boolean().optional(),
2875
+ /** A second line under the value (template), e.g. "${row.date} · ${row.shift}". */
2876
+ sub: z25.string().optional(),
2877
+ /** Tags under the value: `{ text, tone, when }`, e.g. a "12 waiting" chip when `row.waiting > 0`. */
2878
+ chips: Chips.optional(),
2879
+ /** Text weight of the value. */
2880
+ weight: z25.enum(["regular", "medium", "semibold", "bold"]).optional(),
2881
+ /** Colour of the value: an expression returning a tone, "action" or "muted", e.g. "value > 0 ? 'bad' : 'muted'". */
2882
+ valueTone: z25.string().optional(),
2873
2883
  /** A filter under the header: free text, a choice of values, or a minimum number. */
2874
2884
  filter: z25.enum(["text", "select", "min"]).optional(),
2875
2885
  /** Choices for a select filter; default: the values in the data (browser mode). */
@@ -2887,9 +2897,22 @@ var schema = z25.object({
2887
2897
  key: z25.string().default("key"),
2888
2898
  label: z25.string().default("label"),
2889
2899
  type: Column.shape.type,
2890
- format: Format.optional()
2900
+ format: Format.optional(),
2901
+ /**
2902
+ * A column pattern for every generated column: any column option, with `{key}` and `{label}` in its strings
2903
+ * replaced by that column's, e.g. { "key": "groups.{key}.rejected", "chips": [{ "text": "${row.groups.{key}.waiting} waiting" }] }.
2904
+ */
2905
+ column: z25.record(z25.unknown()).optional(),
2906
+ /** With fixed `columns` too: insert the generated columns after the column with this key (default: at the end). */
2907
+ after: z25.string().optional()
2891
2908
  }).strict().optional(),
2892
2909
  totals: z25.object({ label: z25.string().default("Total"), columns: z25.record(Agg) }).strict().optional(),
2910
+ /** A total row taken from the data (e.g. the API's own totals) at `path` in the datasource result, drawn with
2911
+ * the columns' own cell options; `label` (template over that row) goes in the first column. */
2912
+ totalsRow: z25.object({ path: z25.string(), label: z25.string().optional() }).strict().optional(),
2913
+ /** Rows open on click to show the `detail` slot under them; the open row is in `panels.<id>.ui.expanded`
2914
+ * (its key) and `ui.expandedRow` (the row), for a datasource to fetch its details. */
2915
+ expand: z25.boolean().optional(),
2893
2916
  pivot: z25.object({ rows: z25.union([z25.string(), z25.array(z25.string())]), cols: z25.string(), value: z25.string() }).strict().optional(),
2894
2917
  /**
2895
2918
  * Pages. "client": the table slices the rows it has. "server": the table writes page, pageSize and offset to
@@ -2933,6 +2956,7 @@ var schema = z25.object({
2933
2956
  var TableContract = {
2934
2957
  kind: "Table",
2935
2958
  version: 1,
2959
+ slots: { detail: { label: "Row detail" } },
2936
2960
  schema
2937
2961
  };
2938
2962
 
@@ -2945,6 +2969,7 @@ var TilesContract = {
2945
2969
  schema: z26.object({
2946
2970
  ...Common2,
2947
2971
  label: z26.string(),
2972
+ /** A field, or a template over the tile's `row` (e.g. "${row.value ?? row.passed}"). */
2948
2973
  value: z26.string(),
2949
2974
  /** Small text under the number: plain ("heats") or per row ("of ${row.total} pending"). */
2950
2975
  caption: z26.string().optional(),
@@ -2964,6 +2989,13 @@ var TilesContract = {
2964
2989
  minTileWidth: z26.number().int().min(60).max(600).default(128),
2965
2990
  /** Wrap onto new lines when the row is full; off = one row that scrolls sideways. */
2966
2991
  wrap: z26.boolean().default(true),
2992
+ /** Tags under the caption: `{ text, tone, when }` over the tile's `row`. */
2993
+ chips: Chips.optional(),
2994
+ /** A tile shown greyed with a dashed border, e.g. "row.reached == false". */
2995
+ mutedWhen: z26.string().optional(),
2996
+ /** A tile with an accent border, e.g. "row.waiting > 0". `highlightTone` picks the colour (default warn). */
2997
+ highlightWhen: z26.string().optional(),
2998
+ highlightTone: z26.enum(["good", "warn", "bad", "info", "neutral"]).optional(),
2967
2999
  selectable: z26.boolean().default(false),
2968
3000
  /** The selected tile's label value, e.g. "${filters.stage}". */
2969
3001
  selected: z26.unknown().optional()
@@ -3392,4 +3424,4 @@ export {
3392
3424
  RepeaterContract,
3393
3425
  builtInWidgetChecks
3394
3426
  };
3395
- //# sourceMappingURL=chunk-RJI35HZD.js.map
3427
+ //# sourceMappingURL=chunk-5EYC4E5K.js.map