@vielzeug/codex 26.10.3 → 26.10.4

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/data/catalog.json CHANGED
@@ -73,7 +73,7 @@
73
73
  "coins"
74
74
  ],
75
75
  "slug": "arsenal",
76
- "version": "26.10.2"
76
+ "version": "26.10.3"
77
77
  },
78
78
  {
79
79
  "availableDocPages": [
@@ -123,7 +123,7 @@
123
123
  "refine"
124
124
  ],
125
125
  "slug": "assay",
126
- "version": "26.10.2"
126
+ "version": "26.10.3"
127
127
  },
128
128
  {
129
129
  "availableDocPages": [
@@ -165,7 +165,7 @@
165
165
  "ward"
166
166
  ],
167
167
  "slug": "clockwork",
168
- "version": "26.10.2"
168
+ "version": "26.10.3"
169
169
  },
170
170
  {
171
171
  "availableDocPages": [
@@ -197,7 +197,7 @@
197
197
  "refine"
198
198
  ],
199
199
  "slug": "codex",
200
- "version": "26.10.2"
200
+ "version": "26.10.3"
201
201
  },
202
202
  {
203
203
  "availableDocPages": [
@@ -267,7 +267,7 @@
267
267
  "spell"
268
268
  ],
269
269
  "slug": "coins",
270
- "version": "26.10.2"
270
+ "version": "26.10.3"
271
271
  },
272
272
  {
273
273
  "availableDocPages": [
@@ -308,7 +308,7 @@
308
308
  "rune"
309
309
  ],
310
310
  "slug": "conduit",
311
- "version": "26.10.2"
311
+ "version": "26.10.3"
312
312
  },
313
313
  {
314
314
  "availableDocPages": [
@@ -353,7 +353,7 @@
353
353
  "postmaster"
354
354
  ],
355
355
  "slug": "courier",
356
- "version": "26.10.2"
356
+ "version": "26.10.3"
357
357
  },
358
358
  {
359
359
  "availableDocPages": [
@@ -399,7 +399,7 @@
399
399
  "refine"
400
400
  ],
401
401
  "slug": "dnd",
402
- "version": "26.10.2"
402
+ "version": "26.10.3"
403
403
  },
404
404
  {
405
405
  "availableDocPages": [
@@ -441,7 +441,7 @@
441
441
  "herald"
442
442
  ],
443
443
  "slug": "familiar",
444
- "version": "26.10.2"
444
+ "version": "26.10.3"
445
445
  },
446
446
  {
447
447
  "availableDocPages": [
@@ -508,7 +508,7 @@
508
508
  "courier"
509
509
  ],
510
510
  "slug": "flux",
511
- "version": "26.10.2"
511
+ "version": "26.10.3"
512
512
  },
513
513
  {
514
514
  "availableDocPages": [
@@ -548,7 +548,7 @@
548
548
  "ore"
549
549
  ],
550
550
  "slug": "focus",
551
- "version": "26.10.2"
551
+ "version": "26.10.3"
552
552
  },
553
553
  {
554
554
  "availableDocPages": [
@@ -589,7 +589,7 @@
589
589
  "assay"
590
590
  ],
591
591
  "slug": "forge",
592
- "version": "26.10.2"
592
+ "version": "26.10.3"
593
593
  },
594
594
  {
595
595
  "availableDocPages": [
@@ -627,7 +627,7 @@
627
627
  "keymap"
628
628
  ],
629
629
  "slug": "gesture",
630
- "version": "26.10.2"
630
+ "version": "26.10.3"
631
631
  },
632
632
  {
633
633
  "availableDocPages": [
@@ -671,7 +671,7 @@
671
671
  "familiar"
672
672
  ],
673
673
  "slug": "herald",
674
- "version": "26.10.2"
674
+ "version": "26.10.3"
675
675
  },
676
676
  {
677
677
  "availableDocPages": [
@@ -714,7 +714,7 @@
714
714
  "tempo"
715
715
  ],
716
716
  "slug": "illusionist",
717
- "version": "26.10.2"
717
+ "version": "26.10.3"
718
718
  },
719
719
  {
720
720
  "availableDocPages": [
@@ -759,7 +759,7 @@
759
759
  "ore"
760
760
  ],
761
761
  "slug": "keymap",
762
- "version": "26.10.2"
762
+ "version": "26.10.3"
763
763
  },
764
764
  {
765
765
  "availableDocPages": [
@@ -806,7 +806,7 @@
806
806
  "vault"
807
807
  ],
808
808
  "slug": "ledger",
809
- "version": "26.10.2"
809
+ "version": "26.10.3"
810
810
  },
811
811
  {
812
812
  "availableDocPages": [
@@ -852,7 +852,7 @@
852
852
  "courier"
853
853
  ],
854
854
  "slug": "lingua",
855
- "version": "26.10.2"
855
+ "version": "26.10.3"
856
856
  },
857
857
  {
858
858
  "availableDocPages": [
@@ -890,7 +890,7 @@
890
890
  "herald"
891
891
  ],
892
892
  "slug": "mesh",
893
- "version": "26.10.2"
893
+ "version": "26.10.3"
894
894
  },
895
895
  {
896
896
  "availableDocPages": [
@@ -927,7 +927,7 @@
927
927
  "ore"
928
928
  ],
929
929
  "slug": "necromancer",
930
- "version": "26.10.2"
930
+ "version": "26.10.3"
931
931
  },
932
932
  {
933
933
  "availableDocPages": [
@@ -967,7 +967,7 @@
967
967
  "prism"
968
968
  ],
969
969
  "slug": "orbit",
970
- "version": "26.10.2"
970
+ "version": "26.10.3"
971
971
  },
972
972
  {
973
973
  "availableDocPages": [
@@ -1031,7 +1031,7 @@
1031
1031
  "orbit"
1032
1032
  ],
1033
1033
  "slug": "ore",
1034
- "version": "26.10.2"
1034
+ "version": "26.10.3"
1035
1035
  },
1036
1036
  {
1037
1037
  "availableDocPages": [
@@ -1075,7 +1075,7 @@
1075
1075
  "ripple"
1076
1076
  ],
1077
1077
  "slug": "postmaster",
1078
- "version": "26.10.2"
1078
+ "version": "26.10.3"
1079
1079
  },
1080
1080
  {
1081
1081
  "availableDocPages": [
@@ -1118,7 +1118,7 @@
1118
1118
  "orbit"
1119
1119
  ],
1120
1120
  "slug": "prism",
1121
- "version": "26.10.2"
1121
+ "version": "26.10.3"
1122
1122
  },
1123
1123
  {
1124
1124
  "availableDocPages": [
@@ -1182,7 +1182,7 @@
1182
1182
  "clockwork"
1183
1183
  ],
1184
1184
  "slug": "pulse",
1185
- "version": "26.10.2"
1185
+ "version": "26.10.3"
1186
1186
  },
1187
1187
  {
1188
1188
  "availableDocPages": [
@@ -1300,7 +1300,7 @@
1300
1300
  "keymap"
1301
1301
  ],
1302
1302
  "slug": "refine",
1303
- "version": "26.10.2"
1303
+ "version": "26.10.3"
1304
1304
  },
1305
1305
  {
1306
1306
  "availableDocPages": [
@@ -1353,7 +1353,7 @@
1353
1353
  "ledger"
1354
1354
  ],
1355
1355
  "slug": "ripple",
1356
- "version": "26.10.2"
1356
+ "version": "26.10.3"
1357
1357
  },
1358
1358
  {
1359
1359
  "availableDocPages": [
@@ -1407,7 +1407,7 @@
1407
1407
  "familiar"
1408
1408
  ],
1409
1409
  "slug": "rune",
1410
- "version": "26.10.2"
1410
+ "version": "26.10.3"
1411
1411
  },
1412
1412
  {
1413
1413
  "availableDocPages": [
@@ -1448,7 +1448,7 @@
1448
1448
  "refine"
1449
1449
  ],
1450
1450
  "slug": "sandbox",
1451
- "version": "26.10.2"
1451
+ "version": "26.10.3"
1452
1452
  },
1453
1453
  {
1454
1454
  "availableDocPages": [
@@ -1499,7 +1499,7 @@
1499
1499
  "ripple"
1500
1500
  ],
1501
1501
  "slug": "scout",
1502
- "version": "26.10.2"
1502
+ "version": "26.10.3"
1503
1503
  },
1504
1504
  {
1505
1505
  "availableDocPages": [
@@ -1552,7 +1552,7 @@
1552
1552
  "refine"
1553
1553
  ],
1554
1554
  "slug": "scroll",
1555
- "version": "26.10.2"
1555
+ "version": "26.10.3"
1556
1556
  },
1557
1557
  {
1558
1558
  "availableDocPages": [
@@ -1599,7 +1599,7 @@
1599
1599
  "gesture"
1600
1600
  ],
1601
1601
  "slug": "sentinel",
1602
- "version": "26.10.2"
1602
+ "version": "26.10.3"
1603
1603
  },
1604
1604
  {
1605
1605
  "availableDocPages": [
@@ -1639,7 +1639,7 @@
1639
1639
  "refine"
1640
1640
  ],
1641
1641
  "slug": "sigil",
1642
- "version": "26.10.2"
1642
+ "version": "26.10.3"
1643
1643
  },
1644
1644
  {
1645
1645
  "availableDocPages": [
@@ -1703,7 +1703,7 @@
1703
1703
  "wayfinder"
1704
1704
  ],
1705
1705
  "slug": "sourcerer",
1706
- "version": "26.10.2"
1706
+ "version": "26.10.3"
1707
1707
  },
1708
1708
  {
1709
1709
  "availableDocPages": [
@@ -1762,7 +1762,7 @@
1762
1762
  "vault"
1763
1763
  ],
1764
1764
  "slug": "spell",
1765
- "version": "26.10.2"
1765
+ "version": "26.10.3"
1766
1766
  },
1767
1767
  {
1768
1768
  "availableDocPages": [
@@ -1803,7 +1803,7 @@
1803
1803
  "ripple"
1804
1804
  ],
1805
1805
  "slug": "tandem",
1806
- "version": "26.10.2"
1806
+ "version": "26.10.3"
1807
1807
  },
1808
1808
  {
1809
1809
  "availableDocPages": [
@@ -1847,7 +1847,7 @@
1847
1847
  "herald"
1848
1848
  ],
1849
1849
  "slug": "tavern",
1850
- "version": "26.10.2"
1850
+ "version": "26.10.3"
1851
1851
  },
1852
1852
  {
1853
1853
  "availableDocPages": [
@@ -1915,7 +1915,7 @@
1915
1915
  "vault"
1916
1916
  ],
1917
1917
  "slug": "tempo",
1918
- "version": "26.10.2"
1918
+ "version": "26.10.3"
1919
1919
  },
1920
1920
  {
1921
1921
  "availableDocPages": [
@@ -1966,7 +1966,7 @@
1966
1966
  "ripple"
1967
1967
  ],
1968
1968
  "slug": "vault",
1969
- "version": "26.10.2"
1969
+ "version": "26.10.3"
1970
1970
  },
1971
1971
  {
1972
1972
  "availableDocPages": [
@@ -2012,7 +2012,7 @@
2012
2012
  "refine"
2013
2013
  ],
2014
2014
  "slug": "ward",
2015
- "version": "26.10.2"
2015
+ "version": "26.10.3"
2016
2016
  },
2017
2017
  {
2018
2018
  "availableDocPages": [
@@ -2066,8 +2066,8 @@
2066
2066
  "herald"
2067
2067
  ],
2068
2068
  "slug": "wayfinder",
2069
- "version": "26.10.2"
2069
+ "version": "26.10.3"
2070
2070
  }
2071
2071
  ],
2072
- "version": "26.10.2"
2072
+ "version": "26.10.3"
2073
2073
  }
@@ -1,6 +1,6 @@
1
1
  # Vielzeug: Full Documentation
2
2
 
3
- > Complete documentation for 41 packages. Version: 26.10.2
3
+ > Complete documentation for 41 packages. Version: 26.10.3
4
4
 
5
5
  ---
6
6
 
@@ -16480,7 +16480,7 @@ yarn add @vielzeug/prism
16480
16480
 
16481
16481
  ```ts
16482
16482
  import { createLineChart } from '@vielzeug/prism';
16483
- import '@vielzeug/prism/theme';
16483
+ import '@vielzeug/prism/theme.css';
16484
16484
 
16485
16485
  const chart = createLineChart(document.getElementById('chart')!, {
16486
16486
  a11y: { ariaLabel: 'Revenue by month' },
@@ -16526,7 +16526,9 @@ chart.dispose();
16526
16526
  - **`createSparkline(container, config)`**: minimal inline line, area, bar, or stack chart
16527
16527
  - **`linearScale`, `timeScale`, `bandScale`**: standalone scales with nice tick generation
16528
16528
  - **`ChartHandle.update(data)`**: replace chart data synchronously without coupling to a state library
16529
- - **`setTheme(theme)` / `resetTheme()`**: apply or clear custom colors, font, and grid tokens at runtime
16529
+ - **`setTheme(theme, { scope })` / `resetTheme({ scope })`**: apply or clear colors, font, grid, axis, text, and tooltip tokens globally or on one subtree at runtime
16530
+ - **Axes on by default**: line, area, and bar charts render both axes with gridlines on the value axis; `xAxis: false` / `yAxis: false` opt out
16531
+ - **Animations on by default**: every chart animates entry and updates through one rAF loop, honors reduced motion, and opts out with `transition: false`
16530
16532
  - **Series comparison**: hover or keyboard focus reports every series at the active key in the tooltip, `onHover`, and screen-reader announcements
16531
16533
  - **Keyboard navigation**: arrow keys, `Enter`, and `Escape` on every labelled chart except sparklines
16532
16534
  - **CSS custom properties**: full theme control via `--prism-*` tokens, with dark mode built in
@@ -16561,8 +16563,8 @@ chart.dispose();
16561
16563
  | `linearScale()` | Create a numeric scale | Sync | `nice` defaults to `true` |
16562
16564
  | `timeScale()` | Create a date scale | Sync | Invalid dates produce an invalid domain |
16563
16565
  | `bandScale()` | Create a categorical scale | Sync | Unknown categories map to `0` and warn in development |
16564
- | `setTheme()` | Set Prism CSS custom properties | Sync | Values apply to `document.documentElement` |
16565
- | `resetTheme()` | Remove Prism theme overrides | Sync | Removes only properties managed by `setTheme()` |
16566
+ | `setTheme()` | Set Prism CSS custom properties | Sync | Writes to `document.documentElement` unless `scope` is given |
16567
+ | `resetTheme()` | Remove Prism theme overrides | Sync | Clears only properties `setTheme()` wrote, on the same target |
16566
16568
  | `seriesColor()` | Resolve a series palette color | Sync | Palette indexes wrap after eight colors |
16567
16569
 
16568
16570
  ## Package Entry Point
@@ -16570,7 +16572,7 @@ chart.dispose();
16570
16572
  | Import | Purpose |
16571
16573
  | --- | --- |
16572
16574
  | `@vielzeug/prism` | Chart factories, scales, theme helpers, errors, and public types |
16573
- | `@vielzeug/prism/theme` | Default CSS custom properties and dark-mode values |
16575
+ | `@vielzeug/prism/theme.css` | Default CSS custom properties and dark-mode values |
16574
16576
 
16575
16577
  ## Chart Factories
16576
16578
 
@@ -16844,18 +16846,23 @@ const scale = bandScale({ domain: ['A', 'B'], range: [0, 200] });
16844
16846
  ### `setTheme()`
16845
16847
 
16846
16848
  ```ts
16847
- function setTheme(theme: PrismTheme): void;
16849
+ function setTheme(theme: PrismTheme, options?: ThemeScope): void;
16848
16850
  ```
16849
16851
 
16850
- Sets Prism color, font, and grid custom properties on `document.documentElement`.
16852
+ Sets Prism theme custom properties as inline styles on `options.scope` when given, otherwise on `document.documentElement`. Inline values outrank every stylesheet rule, including dark-mode selectors.
16853
+
16854
+ | Parameter | Type | Description |
16855
+ | --- | --- | --- |
16856
+ | `theme` | `PrismTheme` | Tokens to write; omitted keys are left untouched |
16857
+ | `options.scope` | `HTMLElement` | Subtree to theme instead of `:root`; charts inside it resolve their `var(--prism-*)` lookups against these values |
16851
16858
 
16852
16859
  ### `resetTheme()`
16853
16860
 
16854
16861
  ```ts
16855
- function resetTheme(): void;
16862
+ function resetTheme(options?: ThemeScope): void;
16856
16863
  ```
16857
16864
 
16858
- Removes every custom property managed by `setTheme()`.
16865
+ Removes every custom property `setTheme()` can set from `options.scope` (default `documentElement`). Scoped and global calls are independent targets.
16859
16866
 
16860
16867
  ### `seriesColor()`
16861
16868
 
@@ -16972,9 +16979,10 @@ interface BaseChartConfig {
16972
16979
  onClick?: (event: ChartEvent) => void;
16973
16980
  onHover?: (event: ChartEvent | null) => void;
16974
16981
  tooltip?: boolean | TooltipConfig;
16975
- transition?: TransitionConfig;
16976
- xAxis?: XAxisConfig;
16977
- yAxis?: YAxisConfig;
16982
+ transition?: TransitionOption; // motion is on by default; false renders synchronously
16983
+ // Omitted renders the axis with defaults (value axis with gridlines); false suppresses it.
16984
+ xAxis?: XAxisConfig | false;
16985
+ yAxis?: YAxisConfig | false;
16978
16986
  }
16979
16987
 
16980
16988
  interface LineChartConfig extends BaseChartConfig {
@@ -17032,7 +17040,7 @@ interface SparklineConfig {
17032
17040
  padPixels?: number;
17033
17041
  showEndPoint?: boolean; // default true: dot on the latest value (line, area)
17034
17042
  strokeWidth?: number;
17035
- transition?: TransitionConfig;
17043
+ transition?: TransitionOption; // motion is on by default; false renders synchronously
17036
17044
  }
17037
17045
  ```
17038
17046
 
@@ -17159,12 +17167,18 @@ interface LegendConfig {
17159
17167
  type LegendPosition = 'bottom' | 'left' | 'right' | 'top';
17160
17168
 
17161
17169
  interface TransitionConfig {
17162
- duration?: number;
17163
- easing?: EasingFn | 'ease-in' | 'ease-in-out' | 'ease-out' | 'linear';
17164
- preference?: 'always' | 'never' | 'system';
17165
- stagger?: number;
17170
+ duration?: number; // ms per lane; default 300
17171
+ easing?: EasingName | EasingFn;
17172
+ preference?: 'always' | 'never' | 'system'; // 'system' (default) skips reduced-motion
17173
+ stagger?: number; // ms per bar (bar) or series (radar); ignored elsewhere
17166
17174
  }
17167
17175
 
17176
+ // Motion is on by default. `false` renders every update synchronously,
17177
+ // `true` uses the chart defaults, or pass a config to tune them.
17178
+ type TransitionOption = TransitionConfig | boolean;
17179
+
17180
+ type EasingName = 'ease-in' | 'ease-in-out' | 'ease-out' | 'back-out' | 'expo-out' | 'linear';
17181
+
17168
17182
  type EasingFn = (t: number) => number;
17169
17183
  ```
17170
17184
 
@@ -17223,10 +17237,20 @@ type PieVariant = 'donut' | 'pie' | 'semi';
17223
17237
  type SparklineVariant = 'area' | 'bar' | 'line' | 'stack';
17224
17238
 
17225
17239
  interface PrismTheme {
17240
+ axisColor?: string; // --prism-axis-color
17226
17241
  colors?: string[];
17227
17242
  fontFamily?: string;
17228
17243
  gridColor?: string;
17229
17244
  gridOpacity?: number;
17245
+ textColor?: string; // --prism-text-color
17246
+ textColorSecondary?: string; // --prism-text-color-secondary
17247
+ tooltipBg?: string; // --prism-tooltip-bg
17248
+ tooltipBorder?: string; // --prism-tooltip-border
17249
+ tooltipColor?: string; // --prism-tooltip-color
17250
+ }
17251
+
17252
+ interface ThemeScope {
17253
+ readonly scope?: HTMLElement;
17230
17254
  }
17231
17255
  ```
17232
17256
 
@@ -17248,7 +17272,7 @@ Every chart needs a container element with defined dimensions and the theme CSS:
17248
17272
 
17249
17273
  ```ts
17250
17274
  import { createLineChart } from '@vielzeug/prism';
17251
- import '@vielzeug/prism/theme';
17275
+ import '@vielzeug/prism/theme.css';
17252
17276
 
17253
17277
  const container = document.querySelector('#chart')!;
17254
17278
  const chart = createLineChart(container, {
@@ -17751,6 +17775,8 @@ const spark = createSparkline(container, {
17751
17775
 
17752
17776
  ## Axes and Grid
17753
17777
 
17778
+ Both axes render by default: the value axis (y on vertical charts, x on horizontal ones) carries gridlines, the category axis does not. Set `xAxis: false` or `yAxis: false` to suppress one. An explicit config is used verbatim:
17779
+
17754
17780
  ```ts
17755
17781
  {
17756
17782
  xAxis: {
@@ -17853,7 +17879,13 @@ const chart = createLineChart(container, {
17853
17879
 
17854
17880
  ## Animations
17855
17881
 
17856
- Pass a `transition` config to animate enter and update transitions:
17882
+ Every chart animates by default: bars grow from the baseline, line and area
17883
+ series rise out of the plot, pie slices sweep in and then morph between values,
17884
+ radar polygons reshape, and sparklines tween. Motion runs through one
17885
+ `requestAnimationFrame` loop and is skipped when the user prefers reduced motion
17886
+ (`preference: 'system'`, the default).
17887
+
17888
+ Tune it with `transition`, or turn it off entirely:
17857
17889
 
17858
17890
  ```ts
17859
17891
  {
@@ -17865,14 +17897,23 @@ Pass a `transition` config to animate enter and update transitions:
17865
17897
  }
17866
17898
  ```
17867
17899
 
17868
- All chart types use `requestAnimationFrame`-based interpolation and skip animation when the user prefers reduced motion (`preference: 'system'`, the default). Bar and radar charts apply `stagger` on entry; line, area, and pie charts ignore it.
17900
+ ```ts
17901
+ { transition: false } // every update renders synchronously
17902
+ { transition: true } // the defaults, stated explicitly
17903
+ ```
17904
+
17905
+ Named easings are `'linear'`, `'ease-in'`, `'ease-out'`, `'ease-in-out'`,
17906
+ `'expo-out'` (a hard decelerate), and `'back-out'` (a small overshoot); pass a
17907
+ `(t: number) => number` for anything else. `stagger` applies to bar-chart bars
17908
+ and radar-chart series and is ignored elsewhere — bar charts cap the total
17909
+ staggered delay near 400 ms so a long category axis still finishes promptly.
17869
17910
 
17870
17911
  ## Theming
17871
17912
 
17872
17913
  Import the default theme:
17873
17914
 
17874
17915
  ```ts
17875
- import '@vielzeug/prism/theme';
17916
+ import '@vielzeug/prism/theme.css';
17876
17917
  ```
17877
17918
 
17878
17919
  ### Programmatic Theme with `setTheme`
@@ -17883,14 +17924,17 @@ Call `setTheme` once at app startup to apply custom tokens programmatically:
17883
17924
  import { setTheme } from '@vielzeug/prism';
17884
17925
 
17885
17926
  setTheme({
17927
+ axisColor: '#94a3b8', // sets --prism-axis-color
17886
17928
  colors: ['#6366f1', '#22d3ee', '#f59e0b', '#10b981'], // replaces --prism-color-1 through -4
17887
17929
  fontFamily: 'Inter, system-ui, sans-serif', // sets --prism-font-family
17888
17930
  gridColor: '#e2e8f0', // sets --prism-grid-color
17889
17931
  gridOpacity: 0.6, // sets --prism-grid-opacity
17932
+ textColor: '#0f172a', // sets --prism-text-color
17933
+ tooltipBg: '#0f172a', // sets --prism-tooltip-bg
17890
17934
  });
17891
17935
  ```
17892
17936
 
17893
- `setTheme` writes to `document.documentElement` style, so it takes precedence over CSS file defaults. Call `resetTheme()` to clear every custom property `setTheme` can set and restore the default theme: useful for a theme-switcher's "reset" action or test teardown:
17937
+ `setTheme` writes inline custom properties, so it takes precedence over stylesheet defaults. Call `resetTheme()` to clear every custom property `setTheme` can set and restore the default theme: useful for a theme-switcher's "reset" action or test teardown:
17894
17938
 
17895
17939
  ```ts
17896
17940
  import { resetTheme } from '@vielzeug/prism';
@@ -17898,6 +17942,45 @@ import { resetTheme } from '@vielzeug/prism';
17898
17942
  resetTheme();
17899
17943
  ```
17900
17944
 
17945
+ ### Theming One Subtree (component libraries)
17946
+
17947
+ Pass `scope` to write the tokens onto one element instead of `document.documentElement`. Charts render inside it, so their `var(--prism-*)` lookups resolve against the scoped values without touching `:root` — the hook for apps whose theme lives in a JS palette object (MUI, Chakra, Backstage):
17948
+
17949
+ ```tsx
17950
+ import { useEffect, useRef } from 'react';
17951
+ import { useTheme } from '@mui/material/styles';
17952
+ import { createBarChart, resetTheme, setTheme, type BarSeriesConfig } from '@vielzeug/prism';
17953
+ import '@vielzeug/prism/theme.css';
17954
+
17955
+ function CostsChart({ series }: { series: BarSeriesConfig[] }) {
17956
+ const theme = useTheme();
17957
+ const containerRef = useRef(null);
17958
+
17959
+ useEffect(() => {
17960
+ const scope = containerRef.current;
17961
+
17962
+ if (!scope) return;
17963
+
17964
+ // Scoped tokens win over :root inside this subtree and never leak out of it.
17965
+ setTheme(
17966
+ { axisColor: theme.palette.divider, textColor: theme.palette.text.primary },
17967
+ { scope },
17968
+ );
17969
+
17970
+ const chart = createBarChart(scope, { series });
17971
+
17972
+ return () => {
17973
+ chart.dispose();
17974
+ resetTheme({ scope });
17975
+ };
17976
+ }, [series, theme]);
17977
+
17978
+ return ;
17979
+ }
17980
+ ```
17981
+
17982
+ A scoped call and a global call are independent: `resetTheme({ scope })` clears only what `setTheme({ scope })` wrote.
17983
+
17901
17984
  ### Custom Theme (CSS)
17902
17985
 
17903
17986
  ```css
@@ -17941,7 +18024,7 @@ Apply tokens to a specific container:
17941
18024
  | `--prism-crosshair-color` | `hsl(215deg 16% 47%)` | Crosshair line |
17942
18025
  | `--prism-crosshair-dash` | `4 2` | Crosshair dash pattern |
17943
18026
 
17944
- The palette follows Wong (2011) so adjacent series stay distinguishable under common color-vision deficiencies. Dark mode applies automatically through `prefers-color-scheme` or an `html.dark` class.
18027
+ The palette follows Wong (2011) so adjacent series stay distinguishable under common color-vision deficiencies. Dark mode applies through `prefers-color-scheme`, an `html.dark` class, or `data-prism-theme="dark"` on the chart container or any ancestor — the last is the hook for apps that switch theme in JS without owning ``.
17945
18028
 
17946
18029
  Radar charts add their own tokens, each defaulting to a shared one:
17947
18030
 
package/data/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vielzeug
2
2
 
3
- > 41 focused TypeScript packages. Version: 26.10.2
3
+ > 41 focused TypeScript packages. Version: 26.10.3
4
4
 
5
5
  Install any package independently: `pnpm add @vielzeug/<name>`
6
6
 
@@ -4,5 +4,5 @@
4
4
  "refine": "refine.json",
5
5
  "schemaVersion": 1,
6
6
  "search": "search.json",
7
- "version": "26.10.2"
7
+ "version": "26.10.3"
8
8
  }