@fusion.dev/helix-headless 0.235.1 → 0.237.0

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.
Files changed (126) hide show
  1. package/api.json +1 -1
  2. package/custom-elements.json +1 -1
  3. package/dist/app-header/root/app-header-root.d.ts +9 -0
  4. package/dist/app-header/root/app-header-root.js +21 -0
  5. package/dist/area-chart/root/area-chart-root.d.ts +29 -15
  6. package/dist/area-chart/root/area-chart-root.js +10 -7
  7. package/dist/bar-chart/root/bar-chart-root.d.ts +41 -23
  8. package/dist/bar-chart/root/bar-chart-root.js +15 -10
  9. package/dist/button/root/button-root.js +1 -1
  10. package/dist/canvas/root/canvas-root.d.ts +10 -3
  11. package/dist/canvas/root/canvas-root.js +31 -14
  12. package/dist/color-input/root/color-input-root.d.ts +4 -2
  13. package/dist/color-input/root/color-input-root.js +1 -1
  14. package/dist/combobox/root/combobox-root.d.ts +8 -7
  15. package/dist/combobox/root/combobox-root.js +7 -3
  16. package/dist/command/root/command-root.d.ts +22 -2
  17. package/dist/command/root/command-root.js +39 -5
  18. package/dist/data-table/root/data-table-root.d.ts +15 -7
  19. package/dist/data-table/root/data-table-root.js +9 -2
  20. package/dist/date-picker/root/date-picker-root.d.ts +1 -1
  21. package/dist/date-picker/root/date-picker-root.js +9 -2
  22. package/dist/dialog/root/dialog-root.d.ts +13 -3
  23. package/dist/dialog/root/dialog-root.js +33 -2
  24. package/dist/donut-chart/root/donut-chart-root.d.ts +23 -1
  25. package/dist/donut-chart/root/donut-chart-root.js +41 -13
  26. package/dist/drawer/root/drawer-root.d.ts +10 -2
  27. package/dist/drawer/root/drawer-root.js +34 -1
  28. package/dist/filter-input/chip/filter-chip.js +2 -2
  29. package/dist/find/root/find-root.d.ts +11 -1
  30. package/dist/find/root/find-root.js +11 -0
  31. package/dist/heatmap/root/heatmap-root.d.ts +11 -8
  32. package/dist/heatmap/root/heatmap-root.js +27 -2
  33. package/dist/kbd/root/kbd-root.d.ts +4 -0
  34. package/dist/kbd/root/kbd-root.js +2 -1
  35. package/dist/lightbox/root/lightbox-root.js +3 -2
  36. package/dist/line-chart/root/line-chart-root.d.ts +36 -23
  37. package/dist/line-chart/root/line-chart-root.js +20 -13
  38. package/dist/list/item/list-item.d.ts +2 -1
  39. package/dist/list/item/list-item.js +4 -1
  40. package/dist/list/root/list-root.d.ts +33 -8
  41. package/dist/list/root/list-root.js +17 -3
  42. package/dist/listbox/root/listbox-root.d.ts +48 -15
  43. package/dist/listbox/root/listbox-root.js +65 -6
  44. package/dist/map/root/map-root.js +7 -7
  45. package/dist/markdown/tree.d.ts +6 -1
  46. package/dist/markdown/tree.js +1 -1
  47. package/dist/megamenu/root/megamenu-root.d.ts +19 -0
  48. package/dist/megamenu/root/megamenu-root.js +24 -0
  49. package/dist/menu/filter/menu-filter.js +3 -1
  50. package/dist/menu/item/menu-item.d.ts +12 -0
  51. package/dist/menu/item/menu-item.js +3 -0
  52. package/dist/menu/root/menu-root.d.ts +7 -1
  53. package/dist/menu/root/menu-root.js +6 -3
  54. package/dist/motion-toggle/root/motion-toggle-root.js +2 -2
  55. package/dist/notifications/notification/notification.d.ts +1 -0
  56. package/dist/notifications/notification/notification.js +1 -0
  57. package/dist/notifications/root/notifications-root.d.ts +7 -5
  58. package/dist/notifications/root/notifications-root.js +1 -1
  59. package/dist/number-input/root/number-input-root.d.ts +6 -0
  60. package/dist/number-input/root/number-input-root.js +14 -4
  61. package/dist/object-inspector/root/object-inspector-root.d.ts +6 -5
  62. package/dist/object-inspector/root/object-inspector-root.js +9 -3
  63. package/dist/option/root/option-root.d.ts +16 -2
  64. package/dist/option/root/option-root.js +7 -0
  65. package/dist/pagination/root/pagination-root.d.ts +36 -0
  66. package/dist/pagination/root/pagination-root.js +55 -2
  67. package/dist/pin-input/code.js +1 -1
  68. package/dist/qr-code/root/qr-code-root.d.ts +1 -0
  69. package/dist/qr-code/root/qr-code-root.js +1 -0
  70. package/dist/radio/root/radio-root.js +4 -0
  71. package/dist/rating/root/rating-root.d.ts +1 -0
  72. package/dist/rating/root/rating-root.js +1 -0
  73. package/dist/scatter-chart/root/scatter-chart-root.d.ts +6 -0
  74. package/dist/select/root/select-root.d.ts +27 -1
  75. package/dist/select/root/select-root.js +34 -3
  76. package/dist/shortcut-overlay/root/shortcut-overlay-root.d.ts +5 -0
  77. package/dist/shortcut-overlay/root/shortcut-overlay-root.js +15 -1
  78. package/dist/skeleton/root/skeleton-root.d.ts +1 -0
  79. package/dist/skeleton/root/skeleton-root.js +3 -0
  80. package/dist/sparkline/root/sparkline-root.d.ts +53 -0
  81. package/dist/sparkline/root/sparkline-root.js +37 -1
  82. package/dist/spatial-bar-chart/root/spatial-bar-chart-root.d.ts +4 -1
  83. package/dist/spatial-bar-chart/root/spatial-bar-chart-root.js +2 -2
  84. package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.d.ts +3 -0
  85. package/dist/spatial-ribbon-chart/root/spatial-ribbon-chart-root.js +2 -2
  86. package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.d.ts +3 -0
  87. package/dist/spatial-scatter-chart/root/spatial-scatter-chart-root.js +2 -2
  88. package/dist/spatial-scatter-chart/view.d.ts +17 -8
  89. package/dist/spatial-scatter-chart/view.js +7 -6
  90. package/dist/spatial-surface-chart/root/spatial-surface-chart-root.d.ts +3 -0
  91. package/dist/spatial-surface-chart/root/spatial-surface-chart-root.js +2 -2
  92. package/dist/spatial-treemap/root/spatial-treemap-root.d.ts +3 -0
  93. package/dist/spatial-treemap/root/spatial-treemap-root.js +2 -2
  94. package/dist/splitter/root/splitter-root.js +3 -1
  95. package/dist/stat/group/stat-group.d.ts +13 -0
  96. package/dist/stat/group/stat-group.js +22 -1
  97. package/dist/stat/root/stat-root.d.ts +62 -1
  98. package/dist/stat/root/stat-root.js +146 -4
  99. package/dist/table/cell/table-cell.d.ts +1 -0
  100. package/dist/table/cell/table-cell.js +4 -0
  101. package/dist/table/column/table-column.d.ts +11 -0
  102. package/dist/table/column/table-column.js +4 -0
  103. package/dist/table/root/table-root.d.ts +7 -6
  104. package/dist/table/root/table-root.js +1 -1
  105. package/dist/tabs/panel/tab-panel.d.ts +30 -0
  106. package/dist/tabs/panel/tab-panel.js +28 -3
  107. package/dist/tabs/root/tabs-root.d.ts +8 -0
  108. package/dist/tabs/root/tabs-root.js +8 -2
  109. package/dist/tabs/tab/tab.js +2 -2
  110. package/dist/tag/root/tag-root.js +2 -2
  111. package/dist/timeline/root/timeline-root.d.ts +2 -2
  112. package/dist/timeline/root/timeline-root.js +1 -1
  113. package/dist/toast/root/toast-root.d.ts +53 -6
  114. package/dist/toast/root/toast-root.js +158 -1
  115. package/dist/toggle/root/toggle-root.d.ts +1 -0
  116. package/dist/toggle/root/toggle-root.js +1 -1
  117. package/dist/video-playlist/root/video-playlist-root.d.ts +1 -0
  118. package/dist/video-playlist/root/video-playlist-root.js +2 -0
  119. package/dist/virtual-list/root/virtual-list-root.d.ts +2 -2
  120. package/dist/virtual-list/root/virtual-list-root.js +1 -1
  121. package/examples.json +1 -1
  122. package/lint.json +1 -1
  123. package/package.json +5 -5
  124. package/types/jsx.d.ts +693 -169
  125. package/types/vue.d.ts +423 -96
  126. package/types/words.d.ts +51 -12
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, motionPaused, reducedMotion, shortNumber, spokenReading, words, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, motionPaused, reducedMotion, shortNumber, spokenReading, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing, svg, } from 'lit';
4
4
  import { property, state } from 'lit/decorators.js';
5
5
  import '../../tooltip/index.js';
@@ -334,7 +334,7 @@ let HelixHeadlessSpatialBarChart = class HelixHeadlessSpatialBarChart extends Mi
334
334
  const layout = this.layout ?? 'grid';
335
335
  const lined = layout === 'grid' ? undefined : layout;
336
336
  const bare = this.noBox || lined !== undefined;
337
- const view = wordsFitted(this.room, (words) => boxView(read.axes, this.camera, [], bare, words));
337
+ const view = wordsFitted(this.room, (words) => boxView(read.axes, this.camera, [], bare, words, wordsLocale(this)));
338
338
  const room = this.room;
339
339
  const sized = lined && room?.bar ? this.sized(read, view.projection, lined, room) : undefined;
340
340
  const field = sized?.field ?? read;
@@ -64,6 +64,7 @@ declare const HelixHeadlessSpatialRibbonChart_base: typeof HelixElement & (new (
64
64
  *
65
65
  * @slot - The renderer's box, which the 3D drawing is made in.
66
66
  * @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
67
+ * @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
67
68
  * @slot loading - Content shown while `loading` is set and there are no readings yet. Falls back to `loading-text`.
68
69
  *
69
70
  * @event {HelixPlotChangeEvent} helix-plot-change - The readings or the reading the keys rest on changed, which the renderer is told. It stays on the chart.
@@ -74,6 +75,7 @@ declare const HelixHeadlessSpatialRibbonChart_base: typeof HelixElement & (new (
74
75
  * @csspart axis-name - A measure's name, along its edge of the box, in the chart's own drawing.
75
76
  * @csspart drawing - The chart's own drawing in SVG: the box, its grid and names, and the ribbons.
76
77
  * @csspart empty - The words when the table has no readings: the `empty` slot, falling back to `empty-text`.
78
+ * @csspart error - The words while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
77
79
  * @csspart face - One face of a ribbon the view shows: a piece of its top, an end, or its side, shaded by how far it turns from the light.
78
80
  * @csspart fallback - The box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.
79
81
  * @csspart grid - The box's edges and its grid, in the chart's own drawing.
@@ -110,6 +112,7 @@ declare const HelixHeadlessSpatialRibbonChart_base: typeof HelixElement & (new (
110
112
  * @cssstate active - While a reading is shown, under the pointer or the keys.
111
113
  * @cssstate drawn - While a renderer has drawn the ribbons, and the chart's own drawing is hidden.
112
114
  * @cssstate empty - While the `empty` part stands in place of the readings.
115
+ * @cssstate error - While the `error` part stands in place of the readings.
113
116
  * @cssstate loading - While the `loading` part stands in place of the readings.
114
117
  */
115
118
  export declare class HelixHeadlessSpatialRibbonChart extends HelixHeadlessSpatialRibbonChart_base {
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, spokenReading, words, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, spokenReading, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing, svg, } from 'lit';
4
4
  import { property, state } from 'lit/decorators.js';
5
5
  import '../../tooltip/index.js';
@@ -154,7 +154,7 @@ let HelixHeadlessSpatialRibbonChart = class HelixHeadlessSpatialRibbonChart exte
154
154
  ${readable ? this.renderSummary(field) : this.renderStatus()}${this.renderSonify()}${this.renderTable()}`;
155
155
  }
156
156
  renderFallback(field, at) {
157
- const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words));
157
+ const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words, wordsLocale(this)));
158
158
  const ribbons = ribbonsDrawn(field, view.projection).sort((one, other) => one.depth - other.depth);
159
159
  const places = ribbons.flatMap((ribbon) => ribbon.readings);
160
160
  this.placed = places;
@@ -61,6 +61,7 @@ declare const HelixHeadlessSpatialScatterChart_base: typeof HelixElement & (new
61
61
  *
62
62
  * @slot - The renderer's box, which the 3D drawing is made in.
63
63
  * @slot empty - Content shown when the table has no points. Falls back to `empty-text`.
64
+ * @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
64
65
  * @slot loading - Content shown while `loading` is set and there are no points yet. Falls back to `loading-text`.
65
66
  *
66
67
  * @event {HelixPlotChangeEvent} helix-plot-change - The points or the point the keys rest on changed, which the renderer is told. It stays on the chart.
@@ -72,6 +73,7 @@ declare const HelixHeadlessSpatialScatterChart_base: typeof HelixElement & (new
72
73
  * @csspart drawing - The chart's own drawing in SVG: the box, its grid and numbers, and the points.
73
74
  * @csspart drop-line - The line from a point straight down to the floor of the box, drawn under `drop-lines`, in its group's color.
74
75
  * @csspart empty - The words when the table has no points: the `empty` slot, falling back to `empty-text`.
76
+ * @csspart error - The words while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
75
77
  * @csspart fallback - The box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.
76
78
  * @csspart grid - The box's edges and its grid at the ticks, in the chart's own drawing.
77
79
  * @csspart live - The readout: a polite live region that says the point the keys moved to. Hide it visually.
@@ -106,6 +108,7 @@ declare const HelixHeadlessSpatialScatterChart_base: typeof HelixElement & (new
106
108
  * @cssstate active - While a point is shown, under the pointer or the keys.
107
109
  * @cssstate drawn - While a renderer has drawn the points, and the chart's own drawing is hidden.
108
110
  * @cssstate empty - While the `empty` part stands in place of the points.
111
+ * @cssstate error - While the `error` part stands in place of the points.
109
112
  * @cssstate loading - While the `loading` part stands in place of the points.
110
113
  */
111
114
  export declare class HelixHeadlessSpatialScatterChart extends HelixHeadlessSpatialScatterChart_base {
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, shortNumber, spokenReading, words, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, shortNumber, spokenReading, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing, svg } from 'lit';
4
4
  import { property, state } from 'lit/decorators.js';
5
5
  import '../../tooltip/index.js';
@@ -156,7 +156,7 @@ let HelixHeadlessSpatialScatterChart = class HelixHeadlessSpatialScatterChart ex
156
156
  ${readable ? this.renderSummary(field) : this.renderStatus()}${this.renderSonify()}${this.renderTable()}`;
157
157
  }
158
158
  renderFallback(field, at) {
159
- const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words));
159
+ const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words, wordsLocale(this)));
160
160
  const places = field.points.map((point, index) => {
161
161
  const box = [
162
162
  inBox(field.axes.x, point.x),
@@ -63,21 +63,26 @@ export interface BoxView {
63
63
  }
64
64
  /** Where a number stands in the box, from -1 at its axis' low end to 1 at its high end. */
65
65
  export declare const inBox: (axis: PlotAxis, value: number) => number;
66
- /** A number on an axis, written short enough for a tick. */
67
- export declare const tickText: (value: number) => string;
66
+ /**
67
+ * A number on an axis, written short enough for a tick and grouped in
68
+ * `locale` as the flat charts write theirs, such as `3,000`: the runtime's own
69
+ * locale where it is empty. Negative zero is written as zero.
70
+ */
71
+ export declare const tickText: (value: number, locale?: string) => string;
68
72
  /** How large a tick's number and a measure's name are, on the page, in the box's units. */
69
73
  export declare const TICK_SIZE = 0.13;
70
74
  export declare const NAME_SIZE = 0.15;
71
75
  /**
72
76
  * The box for `axes`, seen from `camera`, and the readings' own places on
73
- * the page, which `extra` adds to the bounds.
77
+ * the page, which `extra` adds to the bounds. Its numbers are written in
78
+ * `locale`.
74
79
  */
75
80
  export declare const boxView: (axes: {
76
81
  extent?: BoxExtent | undefined;
77
82
  x: PlotAxis;
78
83
  y: PlotAxis;
79
84
  z: PlotAxis;
80
- }, camera: Camera, extra?: readonly PagePoint[], bare?: boolean, words?: number) => BoxView;
85
+ }, camera: Camera, extra?: readonly PagePoint[], bare?: boolean, words?: number, locale?: string) => BoxView;
81
86
  /** The drawing's box on the page, and the font size its words are measured against. */
82
87
  export interface PlotRoom {
83
88
  font: number;
@@ -85,13 +90,17 @@ export interface PlotRoom {
85
90
  width: number;
86
91
  }
87
92
  /**
88
- * The view whose ticks stand at the box's font size or larger on the page.
93
+ * The view whose ticks stand at the box's font size on the page.
89
94
  *
90
95
  * The drawing scales through its `viewBox`, so a tick written in the box's units
91
96
  * shrinks with the box: measured October 2026 at 390 wide, 7.4 pixels on Scatter
92
- * and Surface, under the 12 of the box's own font. The words widen the frame they
93
- * are measured on, so the measure runs again on what they widened. Where nothing
94
- * has measured the box, as on a server, the words stay at their written size.
97
+ * and Surface, under the 12 of the box's own font. **And it grows with the box**,
98
+ * so the words are held to the font size from above as well as from below:
99
+ * measured November 4, 2026 at 640 wide, Treemap's ticks drew at 15.4 and its
100
+ * axis name at 17.8, against 12 and 13.8 on Surface beside it. The words widen
101
+ * the frame they are measured on, so the measure runs again on what they
102
+ * widened. Where nothing has measured the box, as on a server, the words stay
103
+ * at their written size.
95
104
  */
96
105
  export declare const wordsFitted: (room: PlotRoom | undefined, draw: (words: number) => BoxView) => BoxView;
97
106
  /** Keeps a chart told the size and font size of the box its own drawing fills. */
@@ -1,4 +1,4 @@
1
- import { boxLabels, pathData, projectionOf, shortNumber, } from '@fusion.dev/helix-core';
1
+ import { boxLabels, formatNumbers, pathData, projectionOf, shortNumber, } from '@fusion.dev/helix-core';
2
2
  import { svg } from 'lit';
3
3
  export const SPATIAL_VIEW = { tilt: 25, turn: 42 };
4
4
  export const VIEW_STEP = 15;
@@ -6,12 +6,12 @@ export const inBox = (axis, value) => {
6
6
  const [low, high] = axis.range;
7
7
  return high === low ? 0 : ((value - low) / (high - low)) * 2 - 1;
8
8
  };
9
- export const tickText = (value) => String(Number(value.toPrecision(6)));
9
+ export const tickText = (value, locale = '') => formatNumbers(locale)(Number(value.toPrecision(6)) || 0);
10
10
  const WIDE = 0.58;
11
11
  export const TICK_SIZE = 0.13;
12
12
  export const NAME_SIZE = 0.15;
13
13
  const LABEL_GAP = 0.06;
14
- export const boxView = (axes, camera, extra = [], bare = false, words = 1) => {
14
+ export const boxView = (axes, camera, extra = [], bare = false, words = 1, locale = '') => {
15
15
  const projection = projectionOf(camera);
16
16
  const [ex, ey, ez] = axes.extent ?? [1, 1, 1];
17
17
  const on = ([x, y, z]) => projection.at(x * ex, -z * ez, y * ey);
@@ -50,7 +50,7 @@ export const boxView = (axes, camera, extra = [], bare = false, words = 1) => {
50
50
  return {
51
51
  at: inBox(axis, tick),
52
52
  category: label !== undefined && !/\d/.test(label),
53
- text: label ?? tickText(tick),
53
+ text: label ?? tickText(tick, locale),
54
54
  };
55
55
  }),
56
56
  });
@@ -86,6 +86,7 @@ export const boxView = (axes, camera, extra = [], bare = false, words = 1) => {
86
86
  };
87
87
  const WORD_PASSES = 4;
88
88
  const MOST_WORDS = 3;
89
+ const FEWEST_WORDS = 0.25;
89
90
  export const wordsFitted = (room, draw) => {
90
91
  let view = draw(1);
91
92
  if (!room) {
@@ -93,7 +94,7 @@ export const wordsFitted = (room, draw) => {
93
94
  }
94
95
  for (let pass = 0; pass < WORD_PASSES; pass += 1) {
95
96
  const pixel = 1 / Math.min(room.width / view.bounds.width, room.height / view.bounds.height);
96
- view = draw(Math.min(MOST_WORDS, Math.max(1, (room.font * pixel) / TICK_SIZE)));
97
+ view = draw(Math.min(MOST_WORDS, Math.max(FEWEST_WORDS, (room.font * pixel) / TICK_SIZE)));
97
98
  }
98
99
  return view;
99
100
  };
@@ -115,7 +116,7 @@ export class PlotRoomWatch {
115
116
  const was = this.room;
116
117
  if (was?.width !== width || was.height !== height || was.font !== font) {
117
118
  this.room = height > 0 && width > 0 ? { font, height, width } : undefined;
118
- this.host.requestUpdate();
119
+ requestAnimationFrame(() => this.host.requestUpdate());
119
120
  }
120
121
  });
121
122
  this.sizes.observe(box);
@@ -63,6 +63,7 @@ declare const HelixHeadlessSpatialSurfaceChart_base: typeof HelixElement & (new
63
63
  *
64
64
  * @slot - The renderer's box, which the 3D drawing is made in.
65
65
  * @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
66
+ * @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
66
67
  * @slot loading - Content shown while `loading` is set and there are no readings yet. Falls back to `loading-text`.
67
68
  *
68
69
  * @event {HelixPlotChangeEvent} helix-plot-change - The readings or the place the keys rest on changed, which the renderer is told. It stays on the chart.
@@ -74,6 +75,7 @@ declare const HelixHeadlessSpatialSurfaceChart_base: typeof HelixElement & (new
74
75
  * @csspart contour - The pieces of one contour line that cross one square of the surface, drawn under `contours` at their height, colored along the ramp by it.
75
76
  * @csspart drawing - The chart's own drawing in SVG: the box, its grid and numbers, and the surface.
76
77
  * @csspart empty - The words when the table has no readings: the `empty` slot, falling back to `empty-text`.
78
+ * @csspart error - The words while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
77
79
  * @csspart face - One square of the surface between four readings, or a triangle where one is missing, shaded by its height and by which way it faces.
78
80
  * @csspart fallback - The box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.
79
81
  * @csspart grid - The box's edges and its grid at the ticks, in the chart's own drawing.
@@ -110,6 +112,7 @@ declare const HelixHeadlessSpatialSurfaceChart_base: typeof HelixElement & (new
110
112
  * @cssstate active - While a place is shown, under the pointer or the keys.
111
113
  * @cssstate drawn - While a renderer has drawn the surface, and the chart's own drawing is hidden.
112
114
  * @cssstate empty - While the `empty` part stands in place of the readings.
115
+ * @cssstate error - While the `error` part stands in place of the readings.
113
116
  * @cssstate loading - While the `loading` part stands in place of the readings.
114
117
  */
115
118
  export declare class HelixHeadlessSpatialSurfaceChart extends HelixHeadlessSpatialSurfaceChart_base {
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, spokenReading, words, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, spokenReading, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing, svg, } from 'lit';
4
4
  import { property, state } from 'lit/decorators.js';
5
5
  import '../../tooltip/index.js';
@@ -163,7 +163,7 @@ let HelixHeadlessSpatialSurfaceChart = class HelixHeadlessSpatialSurfaceChart ex
163
163
  ${readable ? this.renderSummary(field) : this.renderStatus()}${this.renderSonify()}${this.renderTable()}`;
164
164
  }
165
165
  renderFallback(field, at) {
166
- const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words));
166
+ const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words, wordsLocale(this)));
167
167
  const depths = field.depths.length;
168
168
  const boxed = field.cells.map((cell) => cell.value === undefined
169
169
  ? undefined
@@ -65,6 +65,7 @@ declare const HelixHeadlessSpatialTreemap_base: typeof HelixElement & (new (...a
65
65
  *
66
66
  * @slot - The renderer's box, which the 3D drawing is made in.
67
67
  * @slot empty - Content shown when the table has no readings. Falls back to `empty-text`.
68
+ * @slot error - Content shown after `error-text` while it is set and there are no readings, such as a button that tries again.
68
69
  * @slot loading - Content shown while `loading` is set and there are no readings yet. Falls back to `loading-text`.
69
70
  *
70
71
  * @event {HelixPlotChangeEvent} helix-plot-change - The blocks or the block the keys rest on changed, which the renderer is told. It stays on the chart.
@@ -77,6 +78,7 @@ declare const HelixHeadlessSpatialTreemap_base: typeof HelixElement & (new (...a
77
78
  * @csspart block-active - The block the pointer or the keys rest on. Set alongside `block`.
78
79
  * @csspart drawing - The chart's own drawing in SVG: the box, its grid and numbers, and the blocks.
79
80
  * @csspart empty - The words when the table has no readings: the `empty` slot, falling back to `empty-text`.
81
+ * @csspart error - The words while `error-text` is set and there are no readings, followed by the `error` slot. Announced as it appears.
80
82
  * @csspart face - One face of a block the view shows, shaded by which way it faces.
81
83
  * @csspart fallback - The box the chart's own drawing fills, shown until a renderer has drawn and where none is connected. Hidden from screen readers.
82
84
  * @csspart grid - The box's edges and its grid, in the chart's own drawing.
@@ -113,6 +115,7 @@ declare const HelixHeadlessSpatialTreemap_base: typeof HelixElement & (new (...a
113
115
  * @cssstate active - While a block is shown, under the pointer or the keys.
114
116
  * @cssstate drawn - While a renderer has drawn the blocks, and the chart's own drawing is hidden.
115
117
  * @cssstate empty - While the `empty` part stands in place of the readings.
118
+ * @cssstate error - While the `error` part stands in place of the readings.
116
119
  * @cssstate loading - While the `loading` part stands in place of the readings.
117
120
  */
118
121
  export declare class HelixHeadlessSpatialTreemap extends HelixHeadlessSpatialTreemap_base {
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, spokenReading, words, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, CHART_PLOT, customElement, drawTooltip, formatWords, HelixElement, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, isRtl, MixinChartSource, MixinChartStatus, spokenReading, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing, svg, } from 'lit';
4
4
  import { property, state } from 'lit/decorators.js';
5
5
  import '../../tooltip/index.js';
@@ -156,7 +156,7 @@ let HelixHeadlessSpatialTreemap = class HelixHeadlessSpatialTreemap extends Mixi
156
156
  ${readable ? this.renderSummary(field) : this.renderStatus()}${this.renderSonify()}${this.renderTable()}`;
157
157
  }
158
158
  renderFallback(field, at) {
159
- const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words));
159
+ const view = wordsFitted(this.plotRoom.room, (words) => boxView(field.axes, this.camera, [], this.noBox, words, wordsLocale(this)));
160
160
  const blocks = blocksDrawn(field, view.projection);
161
161
  const active = blocks[at];
162
162
  const bounds = this.drag.frame(this.noBox
@@ -604,10 +604,12 @@ let HelixHeadlessSplitter = class HelixHeadlessSplitter extends HelixElement {
604
604
  }
605
605
  render() {
606
606
  const position = this.showing;
607
+ const shut = this.flush ? this.shutAt(position) : undefined;
607
608
  return html `<div
608
609
  part="start"
609
610
  id="start"
610
611
  ?data-dragging=${this.dragging}
612
+ ?inert=${shut === 'start'}
611
613
  style="--splitter-position: ${position}%"
612
614
  >
613
615
  <slot name="start"></slot>
@@ -638,7 +640,7 @@ let HelixHeadlessSplitter = class HelixHeadlessSplitter extends HelixElement {
638
640
  >
639
641
  <slot name="handle"></slot>
640
642
  </div>
641
- <div part="end" ?data-dragging=${this.dragging}>
643
+ <div part="end" ?data-dragging=${this.dragging} ?inert=${shut === 'end'}>
642
644
  <slot name="end"></slot>
643
645
  </div>
644
646
  ${this.crossings.map((crossing, index) => html `<div
@@ -40,6 +40,19 @@ export declare class HelixHeadlessStatGroup extends HelixElement {
40
40
  */
41
41
  attributeChangedCallback(name: string, old: string | null, value: string | null): void;
42
42
  protected willUpdate(changed: PropertyValues): void;
43
+ /**
44
+ * The step a stat's figure takes: its own outside columns, and in columns the
45
+ * largest any stat in the group needs, so a row of figures shares one size.
46
+ * The others are set at that step as it changes.
47
+ *
48
+ * **Only in columns**, where a stat is as wide as its column whatever its
49
+ * figure. Stats that flow take the width of their figures, so a stat set a
50
+ * step down shrank and then needed the step it was given, and the group never
51
+ * stepped back up.
52
+ */
53
+ stepFor(stat: Element): number;
54
+ /** Sets every stat at the step the group shares, once one comes or goes. */
55
+ private readonly share;
43
56
  protected render(): TemplateResult;
44
57
  }
45
58
  declare global {
@@ -2,10 +2,19 @@ import { __decorate } from "tslib";
2
2
  import { customElement, HelixElement, hostAria, internalsOf } from '@fusion.dev/helix-core';
3
3
  import { html } from 'lit';
4
4
  import { property } from 'lit/decorators.js';
5
+ function steps(child) {
6
+ return 'stepNeeded' in child && 'showStep' in child ? child : undefined;
7
+ }
5
8
  let HelixHeadlessStatGroup = class HelixHeadlessStatGroup extends HelixElement {
6
9
  constructor() {
7
10
  super(...arguments);
8
11
  this.label = '';
12
+ this.share = () => {
13
+ const first = [...this.children].find((child) => steps(child) !== undefined);
14
+ if (first) {
15
+ steps(first)?.showStep(this.stepFor(first));
16
+ }
17
+ };
9
18
  }
10
19
  static get observedAttributes() {
11
20
  return [...super.observedAttributes, 'aria-label', 'aria-labelledby'];
@@ -23,8 +32,20 @@ let HelixHeadlessStatGroup = class HelixHeadlessStatGroup extends HelixElement {
23
32
  Boolean(this.getAttribute?.('aria-labelledby')?.trim());
24
33
  hostAria(internalsOf(this), { label: this.label, role: named ? 'group' : '' });
25
34
  }
35
+ stepFor(stat) {
36
+ const own = steps(stat)?.stepNeeded ?? 0;
37
+ if (!this.hasAttribute('columns')) {
38
+ return own;
39
+ }
40
+ const stats = [...this.children].filter((child) => child !== stat && steps(child));
41
+ const shared = Math.max(own, ...stats.map((one) => steps(one)?.stepNeeded ?? 0));
42
+ for (const one of stats) {
43
+ steps(one)?.showStep(shared);
44
+ }
45
+ return shared;
46
+ }
26
47
  render() {
27
- return html `<slot></slot>`;
48
+ return html `<slot @slotchange=${this.share}></slot>`;
28
49
  }
29
50
  };
30
51
  __decorate([
@@ -25,6 +25,12 @@ import { type PropertyValues, type TemplateResult } from 'lit';
25
25
  * a server writes it as the browser does. A number in `value` takes the place
26
26
  * of a slotted figure.
27
27
  *
28
+ * **A figure too wide for its column breaks after a group separator**, slotted
29
+ * or written from `value`, so "$1,284,567" breaks as "$1,284," over "567" and
30
+ * never between two digits. A slotted figure that is text alone is written by
31
+ * the stat with those breaks, and the slot is hidden while it is. A figure
32
+ * holding an element is shown as it is.
33
+ *
28
34
  * **Each slot is a part of the same name**, and `value` for the figure, so a
29
35
  * page reaches the label, the unit and the trend from outside. A slot draws no
30
36
  * box, so a part passes inherited properties to what is slotted. **The stat
@@ -46,11 +52,14 @@ import { type PropertyValues, type TemplateResult } from 'lit';
46
52
  * @csspart label - The slot the label arrives through, drawing no box, as `value` does.
47
53
  * @csspart trend - The slot the trend arrives through, drawing no box, as `value` does.
48
54
  * @csspart unit - The slot the unit arrives through, drawing no box, as `value` does.
49
- * @csspart value - The slot the value is written in, or the figure `value` writes. A slot draws no box, so it takes the inherited properties, such as color and font, and passes them to the value.
55
+ * @csspart value - The slot the value is written in, or the figure the stat writes from `value` or from slotted text. A slot draws no box, so it takes the inherited properties, such as color and font, and passes them to the value.
50
56
  *
51
57
  * @cssstate has-label - Something is slotted into `label`.
52
58
  * @cssstate has-trend - Something is slotted into `trend`.
53
59
  * @cssstate has-unit - Something is slotted into `unit`.
60
+ * @cssstate number - The slotted figure is text that reads as a number, such as `1284392118` or `$8,402`, so it breaks only after a group separator and never between two digits.
61
+ * @cssstate stepped - The figure is set a step smaller, because at full size it does not fit the stat's width on one line.
62
+ * @cssstate stepped-twice - The figure is set two steps smaller, because one step smaller it still does not fit. `stepped` holds as well.
54
63
  */
55
64
  export declare class HelixHeadlessStat extends HelixElement {
56
65
  /**
@@ -106,7 +115,59 @@ export declare class HelixHeadlessStat extends HelixElement {
106
115
  value?: number;
107
116
  protected willUpdate(changed: PropertyValues): void;
108
117
  protected firstUpdated(changed: PropertyValues): void;
118
+ /** Watches the stat's own width, to step the figure down where it does not fit. */
119
+ private widths;
120
+ /**
121
+ * A slotted figure that is text alone, cut into the runs it may break
122
+ * after. Empty where the slot holds an element, or text with no group
123
+ * separator, which the slot then shows as it is.
124
+ */
125
+ private slottedRuns;
126
+ /** Whether the figure has been read since the children were known. */
127
+ private figureRead;
128
+ /** Watches the slotted text, which a framework edits in place with no `slotchange`. */
129
+ private edits;
130
+ connectedCallback(): void;
131
+ disconnectedCallback(): void;
132
+ private readonly refit;
133
+ /**
134
+ * Sets the figure a step or two smaller where it does not fit on one line.
135
+ *
136
+ * **A figure is read whole, so it is never broken between digits first.** At
137
+ * full size "1,284" measured 104.5 pixels against a 6rem column and wrapped as
138
+ * "1,28" over "4". Decided by the owner on November 3, 2026: step a long value
139
+ * down the type scale, a second step where one is not enough, and break it only
140
+ * where even that does not fit, and then only after a group separator. One step
141
+ * left "$8,402" as "$8," over "402" at 6rem.
142
+ *
143
+ * Each size is measured on one line, with no wrapping, against the stat's own
144
+ * width rather than the screen's, smallest step last. Measured afresh on every
145
+ * resize, so the figure steps back up once the room is there.
146
+ */
147
+ private fit;
148
+ /**
149
+ * The steps down this stat's own figure needs to fit its width, from 0 to 2,
150
+ * measured at full size whatever step it shows. A group in columns reads it
151
+ * to set every figure at the same step.
152
+ */
153
+ stepNeeded: number;
154
+ /** Sets the figure at a step, 0 for full size, without measuring it again. */
155
+ showStep(step: number): void;
156
+ /** The width of what a part shows, slotted or its own, on the lines it takes. */
157
+ private widthOf;
109
158
  protected updated(changed: PropertyValues): void;
159
+ /**
160
+ * Reads a slotted figure that is text alone into the runs it may break
161
+ * after: each ends at a group separator between two digits.
162
+ *
163
+ * **A slotted figure broke between digits.** A slot offers no break of its
164
+ * own, so it took `overflow-wrap: anywhere`, and "12,345,678" in a 120 pixel
165
+ * stat broke as "12,345,67" over "8". The separators are the locale's own
166
+ * group character and the ones figures are written with, a comma, a point, an
167
+ * apostrophe, or a space, less the locale's decimal sign, so "1.284.567,89"
168
+ * breaks after its points in German and "1,284.5" never after its point.
169
+ */
170
+ private readonly readFigure;
110
171
  /** Says which pieces the stat holds, one call apiece so each pairs with its `@cssstate`. */
111
172
  private readonly readPieces;
112
173
  protected render(): TemplateResult;