@dashspec/renderer 0.1.39 → 0.1.40

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/docs/theming.md CHANGED
@@ -308,3 +308,29 @@ createTheme({
308
308
  ```
309
309
 
310
310
  Use `widgets` css only for what is specific to one kind or variant of your dashboards.
311
+
312
+
313
+ ## Light and dark
314
+
315
+ Every theme has both colour sets (`light` and `dark`), and every built-in widget reads only theme tokens, so all of
316
+ them work in both modes. Who decides the mode, strongest first:
317
+
318
+ 1. The host: `colorMode="light" | "dark" | "auto"` on `DashSpecProvider` or `DashboardRenderer` (e.g. your app's
319
+ dark-mode switch). `auto` follows the viewer's system setting.
320
+ 2. The document: `"display": { "theme": "dark" }`.
321
+ 3. The theme's own `mode`.
322
+
323
+ ```tsx
324
+ <DashSpecProvider themes={{ acme: acmeTheme }} colorMode={isDark ? "dark" : "light"}>
325
+ ```
326
+
327
+ Your own values per mode:
328
+
329
+ ```ts
330
+ createTheme({
331
+ light: { surface: { card: "#ffffff" }, text: { primary: "#1a1a1a" } },
332
+ dark: { surface: { card: "#1e1e1e" }, text: { primary: "#f2f2f2" } },
333
+ scale: { parts: { title: { color: { light: "#0d0d0d", dark: "#f5f5f5" } } } }, // any part colour
334
+ widgets: { Kpi: { css: "…", dark: { css: "…" } } }, // dark-only additions
335
+ });
336
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashspec/renderer",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "Draws a dashboard from DashSpec JSON: widgets, data, events, state.",
5
5
  "keywords": [
6
6
  "dashboard",