@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 { byRow, CategoryAxisController, CHART_PLOT, columnPoints, commaList, customElement, drawTooltip, drawValueAxis, formatNumbers, HelixElement, HelixReadingChangeEvent, HelixReadingPressEvent, linear, linePath, MIRROR_RULE, MixinChartSource, MixinChartStatus, PLOT_HEIGHT, PLOT_WIDTH, seriesIndex, seriesKey, ticks, unbroken, wordsLocale, } from '@fusion.dev/helix-core';
2
+ import { byRow, CategoryAxisController, CHART_PLOT, columnPoints, commaList, customElement, drawTooltip, drawValueAxis, formatNumbers, HelixElement, HelixReadingChangeEvent, HelixReadingPressEvent, headroom, linear, linePath, MIRROR_RULE, MixinChartSource, MixinChartStatus, PLOT_HEIGHT, PLOT_WIDTH, seriesIndex, seriesKey, ticks, unbroken, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing, svg } from 'lit';
4
4
  import { property } from 'lit/decorators.js';
5
5
  import '../../tooltip/index.js';
@@ -10,7 +10,6 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
10
10
  this.area = false;
11
11
  this.dashed = '';
12
12
  this.markers = false;
13
- this.valueAxis = false;
14
13
  this.drawn = new WeakMap();
15
14
  this.unbrokens = new WeakMap();
16
15
  this.slots = new WeakMap();
@@ -26,13 +25,16 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
26
25
  : new HelixReadingChangeEvent(detail));
27
26
  }
28
27
  get rulesValue() {
29
- return this.gridlines !== undefined && this.gridlines !== 'category';
28
+ return this.gridlines !== 'category' && this.gridlines !== 'none';
30
29
  }
31
30
  get rulesCategory() {
32
31
  return this.gridlines === 'both' || this.gridlines === 'category';
33
32
  }
33
+ get drawsAxis() {
34
+ return this.valueAxis !== 'none';
35
+ }
34
36
  range(series) {
35
- const key = `${this.zero} ${series.map((one) => (this.showsSeries(one.name) ? 1 : 0)).join('')}`;
37
+ const key = `${this.zero} ${this.drawsAxis || this.rulesValue} ${series.map((one) => (this.showsSeries(one.name) ? 1 : 0)).join('')}`;
36
38
  if (this.ranged?.series === series && this.ranged.key === key) {
37
39
  return this.ranged.domain;
38
40
  }
@@ -48,9 +50,10 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
48
50
  }
49
51
  }
50
52
  const [floor, top] = low <= high ? [low, high] : [0, 0];
51
- const domain = this.zero
53
+ const extent = this.zero
52
54
  ? [Math.min(0, floor), Math.max(0, top)]
53
55
  : [floor, top];
56
+ const domain = this.drawsAxis || this.rulesValue ? headroom(extent) : extent;
54
57
  this.ranged = { domain, key, series };
55
58
  return domain;
56
59
  }
@@ -127,7 +130,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
127
130
  }
128
131
  const domain = this.range(series);
129
132
  const { x, y } = this.scalesOf(domain, readings.length);
130
- return html `${this.valueAxis ? this.renderAxis(y, domain) : nothing}${this.renderPlot(series, x, y, domain)} ${this.renderLabels(readings)}${this.renderSummary(series)}${this.renderSonify()}${this.renderTable()}`;
133
+ return html `${this.drawsAxis ? this.renderAxis(y, domain) : nothing}${this.renderPlot(series, x, y, domain)} ${this.renderLabels(readings)}${this.renderSummary(series)}${this.renderSonify()}${this.renderTable()}`;
131
134
  }
132
135
  renderAxis(y, domain) {
133
136
  return drawValueAxis(domain, (value) => (y(value) / PLOT_HEIGHT) * 100, formatNumbers(wordsLocale(this)), (widest) => `--line-chart-axis: ${widest}ch`);
@@ -182,7 +185,8 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
182
185
  : svg `<line part="baseline" x1="0" x2=${PLOT_WIDTH} y1=${floor} y2=${floor} />`}
183
186
  ${this.renderBand(this.readings)}
184
187
  ${this.renderGuide(x)}
185
- ${series.map((one, depth) => this.renderSeries(one, depth, x, y))}
188
+ ${series.map((one, depth) => this.renderSeries(one, depth, x, y, 'area')).reverse()}
189
+ ${series.map((one, depth) => this.renderSeries(one, depth, x, y, 'line'))}
186
190
  ${this.renderMarkers(series, x, y)}
187
191
  </svg>
188
192
  ${this.renderTermini(ends)}
@@ -190,7 +194,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
190
194
  </div>`;
191
195
  }
192
196
  renderGridlines(x, y, domain, count) {
193
- if (this.gridlines === undefined) {
197
+ if (!this.rulesValue && !this.rulesCategory) {
194
198
  return nothing;
195
199
  }
196
200
  const down = this.rulesCategory
@@ -289,7 +293,7 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
289
293
  const key = seriesKey(name);
290
294
  return this.dashed !== '' && commaList(this.dashed).some((one) => seriesKey(one) === key);
291
295
  }
292
- renderSeries(one, depth, x, y) {
296
+ renderSeries(one, depth, x, y, piece) {
293
297
  if (!this.showsSeries(one.name)) {
294
298
  return html `${nothing}`;
295
299
  }
@@ -306,14 +310,17 @@ let HelixHeadlessLineChart = class HelixHeadlessLineChart extends MixinChartStat
306
310
  return `${run.path}L${last[0]},${PLOT_HEIGHT}L${first[0]},${PLOT_HEIGHT}Z`;
307
311
  })
308
312
  .join('');
309
- return svg `${this.area
310
- ? svg `<path
313
+ if (piece === 'area') {
314
+ return this.area
315
+ ? svg `<path
311
316
  d=${wash}
312
317
  data-series=${index}
313
318
  part="area"
314
319
  style="--chart-series: var(--chart-series-${index})"
315
320
  />`
316
- : nothing}<path
321
+ : html `${nothing}`;
322
+ }
323
+ return svg `<path
317
324
  d=${path}
318
325
  data-series=${index}
319
326
  fill="none"
@@ -369,7 +376,7 @@ __decorate([
369
376
  property({ reflect: true })
370
377
  ], HelixHeadlessLineChart.prototype, "terminus", void 0);
371
378
  __decorate([
372
- property({ attribute: 'value-axis', reflect: true, type: Boolean })
379
+ property({ attribute: 'value-axis', reflect: true })
373
380
  ], HelixHeadlessLineChart.prototype, "valueAxis", void 0);
374
381
  __decorate([
375
382
  property({ reflect: true, type: Boolean })
@@ -81,7 +81,8 @@ export declare class HelixHeadlessListItem extends HelixElement {
81
81
  * Takes the row out of reach in a list with `selection-mode`: the arrow keys
82
82
  * pass over it and it cannot be selected or acted on. In a list with
83
83
  * `disabled-behavior="selection"`, it cannot be selected and is reached and
84
- * acted on as any row is.
84
+ * acted on as any row is. Anywhere else, a disabled row with `href` does
85
+ * not follow its link.
85
86
  */
86
87
  disabled: boolean;
87
88
  /**
@@ -91,6 +91,7 @@ let HelixHeadlessListItem = class HelixHeadlessListItem extends HelixElement {
91
91
  const tabindex = this.grouped ? (this.focusable ? '0' : '-1') : nothing;
92
92
  const labelledby = this.grouped && this.words !== '' ? 'label' : nothing;
93
93
  const describedby = this.grouped && this.described ? 'description' : nothing;
94
+ const off = this.disabled && !this.selectionOnly;
94
95
  return this.href === ''
95
96
  ? html `<div
96
97
  part="row${this.current === undefined ? '' : ' row-current'}"
@@ -111,7 +112,9 @@ let HelixHeadlessListItem = class HelixHeadlessListItem extends HelixElement {
111
112
  @blur=${this.handleCellFocus}
112
113
  ><a
113
114
  part="link"
114
- href=${this.href}
115
+ href=${off ? nothing : this.href}
116
+ role=${off ? 'link' : nothing}
117
+ aria-disabled=${off ? 'true' : nothing}
115
118
  target=${this.target || nothing}
116
119
  rel=${this.rel || nothing}
117
120
  aria-current=${this.current ?? nothing}
@@ -71,18 +71,18 @@ import { type ListSelectionBehavior, type ListSelectionMode } from '../selection
71
71
  * no `start` counts down from the number of rows, which a server cannot know,
72
72
  * so served markup counts from one until the list runs.
73
73
  *
74
- * **An empty list.** Set `empty-text`, or put your own content in the `empty`
75
- * slot, for a row shown while the list has no rows and none are loading, such
76
- * as "No files yet" and a link to add one. Without either, an empty list shows
77
- * nothing. The list takes the `empty` state while it has no rows, whatever it
78
- * shows.
74
+ * **An empty list.** A list with no rows and none loading shows a row that
75
+ * says "Nothing to show", the words every collection uses. Set `empty-text`,
76
+ * or put your own content in the `empty` slot, to say more, such as "No files
77
+ * yet" and a link to add one. An empty `empty-text` shows no row. The list
78
+ * takes the `empty` state while it has no rows, whatever it shows.
79
79
  *
80
80
  * **Loading more.** `load-more` sends `helix-load-more` once the end of the
81
81
  * list comes within a screen of view, in the box that scrolls it or the page,
82
82
  * once for each number of rows: add rows and it can send it again. While you
83
83
  * fetch, set `loading`: the list is busy, and a row after the last says
84
- * "Loading more" (`loading-text`, or your own content in the `loading`
85
- * slot). The list asks for nothing while `loading` is set.
84
+ * "Loading" (`loading-text`, or your own content in the `loading` slot). The
85
+ * list asks for nothing while `loading` is set.
86
86
  *
87
87
  * An interactive list with no name is reported once in a development build,
88
88
  * since a screen reader announces it as a grid and nothing more. Name it with
@@ -96,6 +96,7 @@ import { type ListSelectionBehavior, type ListSelectionMode } from '../selection
96
96
  *
97
97
  * @slot - The rows.
98
98
  * @slot empty - Content for the row shown while the list has no rows and none are loading. Falls back to `empty-text`.
99
+ * @slot error - Content shown after `error-text` while it is set, such as a button that tries again.
99
100
  * @slot loading - Content for the row after the last while `loading` is set. Falls back to `loading-text`.
100
101
  *
101
102
  * @event {Event} change - Fired once a press has changed which rows are selected.
@@ -107,6 +108,7 @@ import { type ListSelectionBehavior, type ListSelectionMode } from '../selection
107
108
  *
108
109
  * @csspart drag-preview - A copy of the row a pointer drags, which follows the pointer in the top layer until the row is let go, in a `reorderable` list. Hidden from assistive technology.
109
110
  * @csspart empty - The row shown while the list has no rows and none are loading, where `empty-text` or the `empty` slot gives it content. A grid row with one cell in a list that selects.
111
+ * @csspart error - The row after the last while `error-text` is set, in place of the empty and loading rows: the words, then the `error` slot. A grid row with one cell in a list that selects.
110
112
  * @csspart live - The region that says each step of a move to screen readers, in a `reorderable` list. Drawn from the first move. Visually hidden in the styled tier.
111
113
  * @csspart loading - The row after the last while `loading` is set. A grid row with one cell in a list that selects.
112
114
  *
@@ -114,6 +116,7 @@ import { type ListSelectionBehavior, type ListSelectionMode } from '../selection
114
116
  * @cssproperty --list-step - What each row adds to the number before it: `1`, or `-1` where `reversed`.
115
117
  *
116
118
  * @cssstate empty - While the list has no rows.
119
+ * @cssstate error - While `error-text` is set.
117
120
  * @cssstate loading - While `loading` is set.
118
121
  */
119
122
  export declare class HelixHeadlessList extends HelixElement {
@@ -149,6 +152,17 @@ export declare class HelixHeadlessList extends HelixElement {
149
152
  * slot is empty. An empty string shows no row.
150
153
  */
151
154
  emptyText: string;
155
+ /**
156
+ * The words shown after the rows when they did not load, such as "The files
157
+ * did not load". Set it when a fetch fails, and clear it once you try again.
158
+ * Empty, the default, shows nothing.
159
+ *
160
+ * While it is set, a row after the last shows it, followed by your own
161
+ * content in the `error` slot, such as a button that tries again, in place of
162
+ * the empty and loading rows, and screen readers hear it. Table, Listbox, and
163
+ * every chart take the same property and slot.
164
+ */
165
+ errorText: string;
152
166
  /**
153
167
  * The kind of list, which follows from the content.
154
168
  *
@@ -187,7 +201,11 @@ export declare class HelixHeadlessList extends HelixElement {
187
201
  * @deprecated Use `loading-text`. Removed in the next release.
188
202
  */
189
203
  loadingLabel?: string;
190
- /** The text of the row drawn while `loading` is set, where the `loading` slot is empty. */
204
+ /**
205
+ * The text of the row drawn while `loading` is set, where the `loading` slot
206
+ * is empty. "Loading", the word every collection uses, since the same row
207
+ * stands alone in a list that has no rows yet.
208
+ */
191
209
  loadingText: string;
192
210
  /**
193
211
  * Sends `helix-load-more` once the end of the list comes within a screen of
@@ -397,6 +415,13 @@ export declare class HelixHeadlessList extends HelixElement {
397
415
  * while it has neither `empty-text` nor content in the `empty` slot.
398
416
  */
399
417
  private drawEmpty;
418
+ /**
419
+ * The row after the last while `error-text` is set: the words and then the
420
+ * `error` slot, so a button that tries again never stands alone with no
421
+ * reason for it. A list item, or a grid row with one cell in a list that
422
+ * selects, carrying no value, so a key never lands on it.
423
+ */
424
+ private drawError;
400
425
  /**
401
426
  * The row after the last while `loading` is set: a list item, or a grid row
402
427
  * with one cell in a list that selects. It is not one of the rows, so it
@@ -11,10 +11,11 @@ let HelixHeadlessList = class HelixHeadlessList extends HelixElement {
11
11
  super(...arguments);
12
12
  this.canceledLabel = 'Canceled';
13
13
  this.droppedLabel = 'Dropped';
14
- this.emptyText = 'No items';
14
+ this.emptyText = 'Nothing to show';
15
+ this.errorText = '';
15
16
  this.label = '';
16
17
  this.loading = false;
17
- this.loadingText = 'Loading more';
18
+ this.loadingText = 'Loading';
18
19
  this.loadMore = false;
19
20
  this.movedLabel = '{name} moved to position {position} of {count}';
20
21
  this.moveLabel = 'Move {name}';
@@ -386,6 +387,10 @@ let HelixHeadlessList = class HelixHeadlessList extends HelixElement {
386
387
  super.willUpdate(changed);
387
388
  hostAria(internalsOf(this), { label: this.label, role: this.interactive ? 'grid' : 'list' });
388
389
  internalsOf(this).ariaBusy = this.loading ? 'true' : null;
390
+ if (changed.has('errorText') && this.errorText !== '') {
391
+ this.status.say(this.errorText);
392
+ }
393
+ this.toggleState('error', this.errorText !== '');
389
394
  internalsOf(this).ariaMultiSelectable = this.selectionMode === 'multiple' ? 'true' : null;
390
395
  }
391
396
  get numbers() {
@@ -395,7 +400,7 @@ let HelixHeadlessList = class HelixHeadlessList extends HelixElement {
395
400
  return counted ? `--list-first: ${counted.first}; --list-step: ${counted.step}` : nothing;
396
401
  }
397
402
  render() {
398
- return html `<slot style=${this.numbers} @slotchange=${this.handleSlotChange}></slot>${this.drawLoading()}${this.drawEmpty()}${this.loadMore ? html `<span data-end aria-hidden="true"></span>` : nothing}${drawStatus(this.status)}${this.reorder.drawDragPreview()}`;
403
+ return html `<slot style=${this.numbers} @slotchange=${this.handleSlotChange}></slot>${this.errorText === '' ? html `${this.drawLoading()}${this.drawEmpty()}` : this.drawError()}${this.loadMore ? html `<span data-end aria-hidden="true"></span>` : nothing}${drawStatus(this.status)}${this.reorder.drawDragPreview()}`;
399
404
  }
400
405
  drawEmpty() {
401
406
  if (!this.childrenKnown || this.rows.length > 0 || this.loading) {
@@ -408,6 +413,12 @@ let HelixHeadlessList = class HelixHeadlessList extends HelixElement {
408
413
  ? html `<div part="empty" role="row" ?hidden=${!shown}><div role="gridcell">${content}</div></div>`
409
414
  : html `<div part="empty" role="listitem" ?hidden=${!shown}>${content}</div>`;
410
415
  }
416
+ drawError() {
417
+ const content = html `${this.errorText}<slot name="error"></slot>`;
418
+ return this.interactive
419
+ ? html `<div part="error" role="row"><div role="gridcell">${content}</div></div>`
420
+ : html `<div part="error" role="listitem">${content}</div>`;
421
+ }
411
422
  drawLoading() {
412
423
  if (!this.loading) {
413
424
  return nothing;
@@ -464,6 +475,9 @@ __decorate([
464
475
  words,
465
476
  property({ attribute: 'empty-text' })
466
477
  ], HelixHeadlessList.prototype, "emptyText", void 0);
478
+ __decorate([
479
+ property({ attribute: 'error-text' })
480
+ ], HelixHeadlessList.prototype, "errorText", void 0);
467
481
  __decorate([
468
482
  property({ reflect: true })
469
483
  ], HelixHeadlessList.prototype, "kind", void 0);
@@ -54,7 +54,7 @@ declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusio
54
54
  *
55
55
  * As a filter narrows the list, a screen reader hears how many options are
56
56
  * left, such as "3 results", from `result-label` and `results-label`. A filter
57
- * that leaves none says `empty-text`.
57
+ * that leaves none says `no-results-text`.
58
58
  *
59
59
  * **Moving options** is a separate import, `@fusion.dev/helix/listbox/reorder`,
60
60
  * so a list that never moves options carries none of its code. With it
@@ -97,7 +97,7 @@ declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusio
97
97
  *
98
98
  * @slot - The options, and any groups of them.
99
99
  * @slot empty - What the list shows when it has no options to show, for content richer than `empty-text`.
100
- * @slot error - What the list shows while `error-text` is set, for content richer than its text.
100
+ * @slot error - Content shown after `error-text` while it is set, such as a button that tries again.
101
101
  * @slot feedback - The message that says what is wrong, for content richer than a string. It shows while there is a message.
102
102
  * @slot filter-icon - The icon in the filter field. Defaults to a magnifying glass.
103
103
  * @slot hint - The hint, for content richer than plain text.
@@ -117,7 +117,7 @@ declare const HelixHeadlessListbox_base: (new (...args: any[]) => import("@fusio
117
117
  * @event {Event} input - Fired after the value changes.
118
118
  *
119
119
  * @csspart empty - The text shown when the list has no options to show, or the filter hides every one. `:state(no-results)` is set for the second.
120
- * @csspart error - The text shown while `error-text` is set.
120
+ * @csspart error - The text shown while `error-text` is set, followed by the `error` slot.
121
121
  * @csspart feedback - The message that says what is wrong with the value.
122
122
  * @csspart filter-icon - The icon beside the filter field.
123
123
  * @csspart filter-mark - The default icon beside the filter field, shown when none is slotted.
@@ -167,12 +167,11 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
167
167
  */
168
168
  defaultFilter: string;
169
169
  /**
170
- * The text shown when the filter hides every option.
170
+ * The text shown when the list has no options. A filter that hides every
171
+ * option shows `no-results-text`.
171
172
  *
172
- * From `MixinCollection`, which every collection in the library now shares,
173
- * and re-declared here only to keep this list's own wording: "No matches" is
174
- * about a filter, and the mixin's "Nothing to show" is about a list that was
175
- * never given anything.
173
+ * From `MixinCollection`, and re-declared here to name what the list holds,
174
+ * as Select does.
176
175
  */
177
176
  emptyText: string;
178
177
  /** What the list is narrowed to, whoever set it. */
@@ -292,11 +291,9 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
292
291
  multiple: boolean;
293
292
  /**
294
293
  * The text shown when a filter hides every option of a list that has some.
295
- *
296
- * Absent, the list says `empty-text` in both cases. Set it to tell "nothing
297
- * matches what you typed" from "there is nothing here".
294
+ * `empty-text` is what a list with no options says.
298
295
  */
299
- noResultsText?: string;
296
+ noResultsText: string;
300
297
  /**
301
298
  * Lets a reader move options, once `@fusion.dev/helix/listbox/reorder` (or
302
299
  * `@fusion.dev/helix-headless/listbox/reorder`) is imported: Alt with an
@@ -362,6 +359,17 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
362
359
  * its way down to the option, which is where React Aria extends a range.
363
360
  */
364
361
  private shifted;
362
+ /**
363
+ * Where the highlight was before the pointer took it, so leaving the list
364
+ * gives it back. Unset while the keyboard has it.
365
+ */
366
+ private beforePointer;
367
+ /**
368
+ * Whether the pointer moved the highlight on this update, which then is not
369
+ * scrolled to: the row is already under the pointer, and scrolling the list
370
+ * would slide another row under it.
371
+ */
372
+ private pointed;
365
373
  /** The letters typed at the list, which move the highlight to a match. */
366
374
  private readonly typeahead;
367
375
  /**
@@ -423,8 +431,8 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
423
431
  * was said here, so a query that left forty options and one that left one
424
432
  * sounded the same. Said when the filter changes and the count with it, so
425
433
  * a keystroke that leaves the same options says nothing new. An empty filter
426
- * says nothing, being the list as it was given; no matches is `empty-text`,
427
- * which the region says in place of this. A load that ends says the count
434
+ * says nothing, being the list as it was given; no matches is
435
+ * `no-results-text`, which the region says in place of this. A load that ends says the count
428
436
  * too, whatever the filter.
429
437
  */
430
438
  private tell;
@@ -515,6 +523,29 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
515
523
  * panel, so a query of two words could not be typed.
516
524
  */
517
525
  private readonly handleClick;
526
+ /**
527
+ * Moves the highlight to the option under a mouse or a pen, as Radix's Select
528
+ * and the menus of macOS do, so a list draws one highlighted row. The hover
529
+ * and the highlight were drawn in one wash, and an open Select lit the chosen
530
+ * row and the row under the pointer alike. Only a move counts, so a list that
531
+ * scrolls under a resting pointer keeps the highlight the keyboard gave it.
532
+ * Nothing is chosen on the way past.
533
+ */
534
+ private readonly handlePointerMove;
535
+ /**
536
+ * Puts the highlight where the reader arrives, as Tab brings them in.
537
+ *
538
+ * **The chosen option, or the first one a reader can reach**, which is
539
+ * where APG's listbox puts focus as it arrives and the option
540
+ * `aria-activedescendant` already named. The list took the ring and every
541
+ * option stayed transparent until an arrow key, so a reader could not see
542
+ * where the arrows would start. Only from the keyboard, since a press
543
+ * places the highlight on the option pressed, and only where nothing holds
544
+ * it yet: a highlight the reader left stays where they left it.
545
+ */
546
+ private readonly handleItemsFocus;
547
+ /** Gives the highlight back to where the keyboard left it. */
548
+ private readonly handlePointerLeave;
518
549
  private readonly handleKeydown;
519
550
  /**
520
551
  * Puts the highlight on an option, and chooses it where moving is choosing.
@@ -728,7 +759,9 @@ export declare class HelixHeadlessListbox extends HelixHeadlessListbox_base {
728
759
  *
729
760
  * **The text is the slot's fallback**, which is this library's rule for a
730
761
  * content property, so `empty-text` still shows where nothing is slotted and
731
- * the live region still says it.
762
+ * the live region still says it. **The error line keeps its words** and puts
763
+ * the `error` slot after them, as Table does, so a button that tries again
764
+ * never stands alone with no reason for it.
732
765
  */
733
766
  protected renderStatus(hasContent: boolean): TemplateResult | typeof nothing;
734
767
  /**
@@ -16,7 +16,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
16
16
  });
17
17
  this.autocomplete = 'off';
18
18
  this.defaultFilter = '';
19
- this.emptyText = 'No matches';
19
+ this.emptyText = 'No options';
20
20
  this.filterState = undefined;
21
21
  this.errorText = '';
22
22
  this.fieldHomeEnd = false;
@@ -30,6 +30,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
30
30
  });
31
31
  this.manual = false;
32
32
  this.multiple = false;
33
+ this.noResultsText = 'No matches';
33
34
  this.reorderable = false;
34
35
  this.resultsLabel = '{count, plural, one {# result} other {# results}}';
35
36
  this.selectedLabel = '{name}, selected';
@@ -40,6 +41,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
40
41
  this.sources = undefined;
41
42
  this.anchor = '';
42
43
  this.shifted = false;
44
+ this.pointed = false;
43
45
  this.typeahead = new Typeahead();
44
46
  this.seen = new Set();
45
47
  this.forwarded = false;
@@ -72,7 +74,49 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
72
74
  this.handleClick = (event) => {
73
75
  this.shifted = event.shiftKey;
74
76
  };
77
+ this.handlePointerMove = (event) => {
78
+ if (event.pointerType === 'touch') {
79
+ return;
80
+ }
81
+ const options = this.elements;
82
+ const option = event
83
+ .composedPath()
84
+ .find((node) => options.includes(node));
85
+ if (!option || option.disabled || option.hidden || option.value === this.activeValue) {
86
+ return;
87
+ }
88
+ this.beforePointer ??= { parked: this.parked, steered: this.steered, value: this.activeValue };
89
+ this.parked = false;
90
+ this.steered = true;
91
+ this.pointed = true;
92
+ this.activeValue = option.value;
93
+ };
94
+ this.handleItemsFocus = (event) => {
95
+ const items = event.currentTarget;
96
+ if (this.activeValue !== '' || this.filterable || !items.matches(':focus-visible')) {
97
+ return;
98
+ }
99
+ const shown = this.shown.filter((option) => !option.disabled);
100
+ const values = new Set(this.values);
101
+ const at = shown.find((option) => values.has(option.value)) ?? shown[0];
102
+ if (at) {
103
+ this.parked = false;
104
+ this.activeValue = at.value;
105
+ }
106
+ };
107
+ this.handlePointerLeave = () => {
108
+ const before = this.beforePointer;
109
+ if (!before) {
110
+ return;
111
+ }
112
+ this.beforePointer = undefined;
113
+ this.parked = before.parked;
114
+ this.steered = before.steered;
115
+ this.pointed = true;
116
+ this.activeValue = before.value;
117
+ };
75
118
  this.handleKeydown = (event) => {
119
+ this.beforePointer = undefined;
76
120
  const shown = this.shown.filter((option) => !option.disabled);
77
121
  if (shown.length === 0) {
78
122
  return;
@@ -243,6 +287,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
243
287
  this.value = option?.value ?? '';
244
288
  }
245
289
  highlight(where) {
290
+ this.beforePointer = undefined;
246
291
  const shown = this.shown.filter((option) => !option.disabled);
247
292
  this.typeahead.reset();
248
293
  this.parked = where === 'none';
@@ -289,6 +334,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
289
334
  }
290
335
  }
291
336
  typeaheadTo(key) {
337
+ this.beforePointer = undefined;
292
338
  const shown = this.shown.filter((option) => !option.disabled);
293
339
  const current = this.currentValue;
294
340
  const from = shown.findIndex((option) => option.value === current);
@@ -368,6 +414,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
368
414
  }
369
415
  }
370
416
  arrive(value) {
417
+ this.beforePointer = undefined;
371
418
  this.parked = false;
372
419
  this.steered = true;
373
420
  this.activeValue = value;
@@ -404,6 +451,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
404
451
  }
405
452
  }
406
453
  highlightValue(value) {
454
+ this.beforePointer = undefined;
407
455
  if (!this.shown.some((option) => !option.disabled && option.value === value)) {
408
456
  return;
409
457
  }
@@ -481,6 +529,10 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
481
529
  }
482
530
  }
483
531
  followActive(changed) {
532
+ if (this.pointed) {
533
+ this.pointed = false;
534
+ return;
535
+ }
484
536
  if (this.data.records &&
485
537
  !this.data.follow(changed.has('activeValue') || changed.has('filter'))) {
486
538
  return;
@@ -505,6 +557,8 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
505
557
  this.addEventListener('helix-before-select', this.handleSelection);
506
558
  this.addEventListener('keydown', this.handleKeydown);
507
559
  this.addEventListener('click', this.handleClick, true);
560
+ this.addEventListener('pointermove', this.handlePointerMove);
561
+ this.addEventListener('pointerleave', this.handlePointerLeave);
508
562
  auditChildren(this, 'option', 'option', 'the list offers no choices');
509
563
  if (this.hasUpdated) {
510
564
  this.watchSources(this.filter.trim() !== '');
@@ -515,6 +569,8 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
515
569
  this.removeEventListener('helix-before-select', this.handleSelection);
516
570
  this.removeEventListener('keydown', this.handleKeydown);
517
571
  this.removeEventListener('click', this.handleClick, true);
572
+ this.removeEventListener('pointermove', this.handlePointerMove);
573
+ this.removeEventListener('pointerleave', this.handlePointerLeave);
518
574
  this.sources?.disconnect();
519
575
  markMatches(this, [], '');
520
576
  }
@@ -536,6 +592,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
536
592
  }
537
593
  if (changed.has('filter')) {
538
594
  this.steered = false;
595
+ this.beforePointer = undefined;
539
596
  }
540
597
  if (this.childrenKnown) {
541
598
  this.place();
@@ -623,7 +680,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
623
680
  }
624
681
  renderStatus(hasContent) {
625
682
  if (this.failed) {
626
- return html `<p part="error"><slot name="error">${this.loadError || this.errorText}</slot></p>`;
683
+ return html `<p part="error">${this.loadError || this.errorText}<slot name="error"></slot></p>`;
627
684
  }
628
685
  if (!this.loading && hasContent) {
629
686
  return nothing;
@@ -631,10 +688,8 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
631
688
  if (this.loading) {
632
689
  return html `<p part="loading"><slot name="loading">${this.loadingText}</slot></p>`;
633
690
  }
634
- const given = this.noResultsText !== undefined ||
635
- this.querySelector?.(':scope > [slot="no-results"]') != null;
636
- return this.noResults && given
637
- ? html `<p part="empty"><slot name="no-results">${this.noResultsText ?? this.emptyText}</slot></p>`
691
+ return this.noResults
692
+ ? html `<p part="empty"><slot name="no-results">${this.noResultsText}</slot></p>`
638
693
  : html `<p part="empty"><slot name="empty">${this.emptyText}</slot></p>`;
639
694
  }
640
695
  get noResults() {
@@ -667,7 +722,9 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
667
722
  <input
668
723
  part="search-field"
669
724
  type="text"
725
+ autocapitalize="off"
670
726
  autocomplete="off"
727
+ autocorrect="off"
671
728
  spellcheck="false"
672
729
  .value=${this.filter}
673
730
  placeholder=${this.filterLabel}
@@ -691,6 +748,7 @@ let HelixHeadlessListbox = class HelixHeadlessListbox extends MixinVoice(MixinCo
691
748
  aria-multiselectable=${this.multiple ? 'true' : nothing}
692
749
  aria-required=${this.required ? 'true' : nothing}
693
750
  tabindex=${this.filterable ? nothing : this.isDisabled ? -1 : 0}
751
+ @focus=${this.handleItemsFocus}
694
752
  @scroll=${this.handleScroll}
695
753
  >
696
754
  ${this.data.render() ?? html `<slot @slotchange=${() => this.requestUpdate()}></slot>`}
@@ -756,6 +814,7 @@ __decorate([
756
814
  property({ reflect: true, type: Boolean })
757
815
  ], HelixHeadlessListbox.prototype, "multiple", void 0);
758
816
  __decorate([
817
+ words,
759
818
  property({ attribute: 'no-results-text' })
760
819
  ], HelixHeadlessListbox.prototype, "noResultsText", void 0);
761
820
  __decorate([