@fusion.dev/helix-headless 0.145.0 → 0.146.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 (278) hide show
  1. package/custom-elements.json +7373 -3849
  2. package/dist/accordion/item/accordion-item.d.ts +14 -0
  3. package/dist/accordion/item/accordion-item.js +16 -6
  4. package/dist/accordion/root/accordion-root.d.ts +8 -5
  5. package/dist/announcement/root/announcement-root.d.ts +3 -2
  6. package/dist/announcement/root/announcement-root.js +3 -1
  7. package/dist/app-header/root/app-header-root.d.ts +7 -2
  8. package/dist/app-header/root/app-header-root.js +9 -1
  9. package/dist/app-header/sectioning.d.ts +3 -1
  10. package/dist/app-header/sectioning.js +3 -2
  11. package/dist/avatar/group/avatar-group.d.ts +20 -14
  12. package/dist/avatar/group/avatar-group.js +17 -19
  13. package/dist/badge/root/badge-root.d.ts +3 -1
  14. package/dist/badge/root/badge-root.js +2 -2
  15. package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
  16. package/dist/bar-chart/root/bar-chart-root.js +52 -15
  17. package/dist/bar-chart/stack.d.ts +15 -0
  18. package/dist/bar-chart/stack.js +19 -0
  19. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +25 -0
  20. package/dist/breadcrumbs/root/breadcrumbs-root.js +50 -3
  21. package/dist/button/root/button-root.d.ts +26 -0
  22. package/dist/button/root/button-root.js +38 -18
  23. package/dist/button-group/root/button-group-root.d.ts +2 -1
  24. package/dist/button-group/root/button-group-root.js +5 -1
  25. package/dist/canvas/node/canvas-node.d.ts +4 -3
  26. package/dist/canvas/node/canvas-node.js +3 -2
  27. package/dist/canvas/root/canvas-root.js +2 -2
  28. package/dist/card/root/card-root.d.ts +24 -3
  29. package/dist/card/root/card-root.js +20 -8
  30. package/dist/carousel/root/carousel-root.d.ts +43 -4
  31. package/dist/carousel/root/carousel-root.js +40 -12
  32. package/dist/carousel/stops.d.ts +20 -0
  33. package/dist/carousel/stops.js +30 -0
  34. package/dist/chat/message/chat-message.js +5 -4
  35. package/dist/chat/naming.d.ts +5 -1
  36. package/dist/chat/naming.js +4 -2
  37. package/dist/chat/root/chat-root.d.ts +25 -3
  38. package/dist/chat/root/chat-root.js +22 -5
  39. package/dist/checkbox/root/checkbox-root.d.ts +20 -0
  40. package/dist/checkbox/root/checkbox-root.js +14 -1
  41. package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
  42. package/dist/checkbox-group/root/checkbox-group-root.js +12 -10
  43. package/dist/checkbox-group/select-all.d.ts +27 -0
  44. package/dist/checkbox-group/select-all.js +12 -0
  45. package/dist/code-block/highlight.d.ts +15 -0
  46. package/dist/code-block/highlight.js +4 -0
  47. package/dist/code-block/root/code-block-root.d.ts +49 -1
  48. package/dist/code-block/root/code-block-root.js +58 -3
  49. package/dist/color-input/root/color-input-root.d.ts +3 -0
  50. package/dist/color-input/root/color-input-root.js +6 -3
  51. package/dist/color-picker/root/color-picker-root.d.ts +33 -4
  52. package/dist/color-picker/root/color-picker-root.js +80 -21
  53. package/dist/color-picker/swatches.d.ts +12 -0
  54. package/dist/color-picker/swatches.js +26 -0
  55. package/dist/combobox/root/combobox-root.d.ts +43 -0
  56. package/dist/combobox/root/combobox-root.js +79 -15
  57. package/dist/command/root/command-root.d.ts +16 -1
  58. package/dist/command/root/command-root.js +22 -4
  59. package/dist/copy-button/root/copy-button-root.d.ts +5 -0
  60. package/dist/copy-button/root/copy-button-root.js +10 -3
  61. package/dist/data-table/index.d.ts +1 -1
  62. package/dist/data-table/index.js +1 -1
  63. package/dist/data-table/keys.d.ts +24 -0
  64. package/dist/data-table/keys.js +24 -0
  65. package/dist/data-table/root/data-table-root.d.ts +27 -18
  66. package/dist/data-table/root/data-table-root.js +20 -52
  67. package/dist/data-table/tree.d.ts +16 -1
  68. package/dist/data-table/tree.js +2 -3
  69. package/dist/date-input/root/date-input-root.d.ts +3 -1
  70. package/dist/date-input/root/date-input-root.js +18 -7
  71. package/dist/date-picker/root/date-picker-root.js +12 -6
  72. package/dist/dialog/description.js +15 -1
  73. package/dist/dialog/root/dialog-root.d.ts +8 -2
  74. package/dist/dialog/root/dialog-root.js +16 -1
  75. package/dist/divider/root/divider-root.d.ts +3 -0
  76. package/dist/divider/root/divider-root.js +2 -1
  77. package/dist/donut-chart/root/donut-chart-root.d.ts +31 -0
  78. package/dist/donut-chart/root/donut-chart-root.js +48 -1
  79. package/dist/drawer/reveal.d.ts +8 -0
  80. package/dist/drawer/reveal.js +1 -0
  81. package/dist/drawer/root/drawer-root.d.ts +59 -0
  82. package/dist/drawer/root/drawer-root.js +63 -4
  83. package/dist/drilldown/item/drilldown-item.js +1 -1
  84. package/dist/drilldown/root/drilldown-root.d.ts +21 -3
  85. package/dist/drilldown/root/drilldown-root.js +21 -3
  86. package/dist/element-events.generated.js +31 -5
  87. package/dist/empty/root/empty-root.d.ts +3 -1
  88. package/dist/empty/root/empty-root.js +3 -2
  89. package/dist/file-input/root/file-input-root.d.ts +69 -6
  90. package/dist/file-input/root/file-input-root.js +82 -19
  91. package/dist/file-input/screen.d.ts +2 -1
  92. package/dist/filter-input/menu/filter-menu.d.ts +2 -0
  93. package/dist/filter-input/menu/filter-menu.js +12 -4
  94. package/dist/filter-input/root/filter-input-root.d.ts +30 -6
  95. package/dist/filter-input/root/filter-input-root.js +1 -1
  96. package/dist/filter-input/suggest.d.ts +28 -3
  97. package/dist/filter-input/suggest.js +18 -8
  98. package/dist/format-date/root/format-date-root.d.ts +9 -16
  99. package/dist/format-date/root/format-date-root.js +10 -27
  100. package/dist/heatmap/root/heatmap-root.d.ts +24 -13
  101. package/dist/heatmap/root/heatmap-root.js +34 -12
  102. package/dist/icon/root/icon-root.d.ts +12 -1
  103. package/dist/icon/root/icon-root.js +21 -10
  104. package/dist/icon/settle.d.ts +7 -0
  105. package/dist/icon/settle.js +10 -0
  106. package/dist/icon-button/root/icon-button-root.d.ts +2 -0
  107. package/dist/image/root/image-root.d.ts +5 -1
  108. package/dist/image/root/image-root.js +1 -1
  109. package/dist/input/root/input-root.d.ts +12 -2
  110. package/dist/input/root/input-root.js +11 -2
  111. package/dist/kbd/root/kbd-root.d.ts +35 -1
  112. package/dist/kbd/root/kbd-root.js +23 -4
  113. package/dist/legend/root/legend-root.d.ts +55 -8
  114. package/dist/legend/root/legend-root.js +55 -13
  115. package/dist/lightbox/root/lightbox-root.d.ts +49 -6
  116. package/dist/lightbox/root/lightbox-root.js +86 -19
  117. package/dist/lightbox/zoom-controller.d.ts +59 -0
  118. package/dist/lightbox/zoom-controller.js +128 -0
  119. package/dist/lightbox/zoom.d.ts +22 -0
  120. package/dist/lightbox/zoom.js +16 -0
  121. package/dist/line-chart/root/line-chart-root.d.ts +22 -1
  122. package/dist/line-chart/root/line-chart-root.js +21 -1
  123. package/dist/list/item/list-item.d.ts +2 -0
  124. package/dist/list/item/list-item.js +11 -2
  125. package/dist/list/root/list-root.d.ts +62 -13
  126. package/dist/list/root/list-root.js +70 -13
  127. package/dist/list/selection.d.ts +37 -7
  128. package/dist/list/selection.js +16 -7
  129. package/dist/listbox/root/listbox-root.d.ts +37 -1
  130. package/dist/listbox/root/listbox-root.js +49 -3
  131. package/dist/loader/busy.d.ts +10 -0
  132. package/dist/loader/busy.js +11 -0
  133. package/dist/loader/root/loader-root.d.ts +9 -2
  134. package/dist/loader/root/loader-root.js +23 -3
  135. package/dist/megamenu/root/megamenu-root.d.ts +51 -10
  136. package/dist/megamenu/root/megamenu-root.js +76 -5
  137. package/dist/menu/item/menu-item.d.ts +51 -2
  138. package/dist/menu/item/menu-item.js +47 -23
  139. package/dist/menu/root/menu-root.d.ts +14 -0
  140. package/dist/menu/root/menu-root.js +2 -2
  141. package/dist/meter/root/meter-root.d.ts +20 -1
  142. package/dist/meter/root/meter-root.js +11 -15
  143. package/dist/navigation/root/navigation-root.d.ts +2 -1
  144. package/dist/navigation/root/navigation-root.js +2 -2
  145. package/dist/notifications/root/notifications-root.d.ts +10 -3
  146. package/dist/notifications/root/notifications-root.js +19 -7
  147. package/dist/number-input/root/number-input-root.d.ts +17 -8
  148. package/dist/number-input/root/number-input-root.js +2 -7
  149. package/dist/object-inspector/root/object-inspector-root.d.ts +75 -27
  150. package/dist/object-inspector/root/object-inspector-root.js +117 -76
  151. package/dist/object-inspector/rows.d.ts +18 -0
  152. package/dist/object-inspector/rows.js +33 -0
  153. package/dist/option/root/option-root.d.ts +5 -3
  154. package/dist/outline/root/outline-root.d.ts +18 -0
  155. package/dist/outline/root/outline-root.js +23 -5
  156. package/dist/pagination/size/pagination-size.d.ts +1 -0
  157. package/dist/pagination/size/pagination-size.js +1 -1
  158. package/dist/pin-input/code.d.ts +10 -0
  159. package/dist/pin-input/code.js +13 -0
  160. package/dist/pin-input/root/pin-input-root.d.ts +25 -1
  161. package/dist/pin-input/root/pin-input-root.js +10 -11
  162. package/dist/popover/hide-outside.d.ts +14 -0
  163. package/dist/popover/hide-outside.js +41 -0
  164. package/dist/popover/root/popover-root.d.ts +57 -7
  165. package/dist/popover/root/popover-root.js +58 -3
  166. package/dist/progress/root/progress-root.d.ts +20 -0
  167. package/dist/progress/root/progress-root.js +15 -15
  168. package/dist/qr-code/export.d.ts +26 -1
  169. package/dist/qr-code/export.js +14 -0
  170. package/dist/qr-code/root/qr-code-root.d.ts +19 -5
  171. package/dist/qr-code/root/qr-code-root.js +58 -9
  172. package/dist/quote/marks.d.ts +8 -0
  173. package/dist/quote/marks.js +5 -0
  174. package/dist/quote/root/quote-root.d.ts +14 -2
  175. package/dist/quote/root/quote-root.js +23 -1
  176. package/dist/radio/root/radio-root.d.ts +6 -2
  177. package/dist/radio/root/radio-root.js +6 -1
  178. package/dist/rating/root/rating-root.d.ts +9 -4
  179. package/dist/rating/root/rating-root.js +31 -7
  180. package/dist/rating/steps.d.ts +7 -0
  181. package/dist/rating/steps.js +9 -0
  182. package/dist/scatter-chart/fit.d.ts +15 -0
  183. package/dist/scatter-chart/fit.js +35 -0
  184. package/dist/scatter-chart/root/scatter-chart-root.d.ts +21 -1
  185. package/dist/scatter-chart/root/scatter-chart-root.js +30 -17
  186. package/dist/scroll-area/root/scroll-area-root.d.ts +22 -51
  187. package/dist/scroll-area/root/scroll-area-root.js +57 -173
  188. package/dist/scroll-area/scrollbar-controller.d.ts +111 -0
  189. package/dist/scroll-area/scrollbar-controller.js +172 -0
  190. package/dist/scroll-area/scrollbar.d.ts +27 -0
  191. package/dist/scroll-area/scrollbar.js +9 -0
  192. package/dist/select/root/select-root.d.ts +15 -0
  193. package/dist/select/root/select-root.js +18 -6
  194. package/dist/skeleton/root/skeleton-root.d.ts +3 -0
  195. package/dist/skeleton/root/skeleton-root.js +4 -2
  196. package/dist/skip-link/root/skip-link-root.js +2 -2
  197. package/dist/slider/root/slider-root.d.ts +41 -4
  198. package/dist/slider/root/slider-root.js +23 -3
  199. package/dist/sparkline/readings.d.ts +18 -0
  200. package/dist/sparkline/readings.js +19 -0
  201. package/dist/sparkline/root/sparkline-root.d.ts +78 -7
  202. package/dist/sparkline/root/sparkline-root.js +118 -23
  203. package/dist/speed-dial/root/speed-dial-root.js +2 -2
  204. package/dist/splitter/root/splitter-root.d.ts +7 -12
  205. package/dist/splitter/root/splitter-root.js +209 -204
  206. package/dist/stat/root/stat-root.d.ts +14 -5
  207. package/dist/stat/root/stat-root.js +21 -5
  208. package/dist/steps/reach.d.ts +5 -0
  209. package/dist/steps/reach.js +3 -0
  210. package/dist/steps/root/steps-root.d.ts +49 -3
  211. package/dist/steps/root/steps-root.js +44 -5
  212. package/dist/steps/step/step.d.ts +7 -0
  213. package/dist/steps/step/step.js +7 -2
  214. package/dist/switch/root/switch-root.d.ts +10 -0
  215. package/dist/table/column/table-column.d.ts +0 -10
  216. package/dist/table/column/table-column.js +3 -19
  217. package/dist/table/root/table-root.d.ts +31 -10
  218. package/dist/table/root/table-root.js +2 -13
  219. package/dist/tabs/panel/tab-panel.d.ts +16 -3
  220. package/dist/tabs/panel/tab-panel.js +34 -5
  221. package/dist/tabs/root/tabs-root.d.ts +12 -0
  222. package/dist/tabs/root/tabs-root.js +1 -1
  223. package/dist/tabs/tab/tab.d.ts +5 -0
  224. package/dist/tabs/tab/tab.js +5 -2
  225. package/dist/tag/group/tag-group.d.ts +31 -4
  226. package/dist/tag/group/tag-group.js +46 -7
  227. package/dist/tag/root/tag-root.js +9 -2
  228. package/dist/textarea/root/textarea-root.d.ts +28 -1
  229. package/dist/textarea/root/textarea-root.js +40 -1
  230. package/dist/time-input/root/time-input-root.d.ts +5 -1
  231. package/dist/time-input/root/time-input-root.js +16 -8
  232. package/dist/time-picker/root/time-picker-root.d.ts +18 -4
  233. package/dist/time-picker/root/time-picker-root.js +7 -10
  234. package/dist/time-picker/wheel-name.d.ts +9 -0
  235. package/dist/time-picker/wheel-name.js +15 -0
  236. package/dist/timeline/group/timeline-group.js +2 -2
  237. package/dist/toast/item/toast-item.d.ts +14 -1
  238. package/dist/toast/item/toast-item.js +22 -5
  239. package/dist/toast/root/toast-root.d.ts +6 -0
  240. package/dist/toast/root/toast-root.js +16 -1
  241. package/dist/toggle/group/toggle-group.d.ts +24 -3
  242. package/dist/toggle/group/toggle-group.js +34 -5
  243. package/dist/tooltip/root/tooltip-root.d.ts +13 -2
  244. package/dist/tooltip/root/tooltip-root.js +9 -1
  245. package/dist/tour/back.d.ts +10 -0
  246. package/dist/tour/back.js +8 -0
  247. package/dist/tour/root/tour-root.d.ts +30 -2
  248. package/dist/tour/root/tour-root.js +34 -8
  249. package/dist/tree/item/tree-item.d.ts +7 -3
  250. package/dist/tree/item/tree-item.js +3 -0
  251. package/dist/tree/root/tree-root.d.ts +24 -3
  252. package/dist/tree/root/tree-root.js +32 -13
  253. package/dist/tree/selection.js +2 -15
  254. package/dist/trend/root/trend-root.d.ts +43 -18
  255. package/dist/trend/root/trend-root.js +31 -6
  256. package/dist/video/media-events.d.ts +13 -18
  257. package/dist/video/media-events.js +1 -5
  258. package/dist/video/root/video-root.d.ts +18 -5
  259. package/dist/video/root/video-root.js +19 -10
  260. package/dist/video-playlist/menu/video-playlist-menu.d.ts +2 -0
  261. package/dist/video-playlist/menu/video-playlist-menu.js +2 -1
  262. package/dist/video-playlist/root/video-playlist-root.d.ts +7 -1
  263. package/dist/virtual-list/fill.d.ts +0 -8
  264. package/dist/virtual-list/fill.js +1 -17
  265. package/dist/virtual-list/plan.d.ts +49 -0
  266. package/dist/virtual-list/plan.js +16 -0
  267. package/dist/virtual-list/root/virtual-list-root.d.ts +114 -13
  268. package/dist/virtual-list/root/virtual-list-root.js +183 -40
  269. package/lint.json +1 -1
  270. package/package.json +8 -8
  271. package/types/jsx.d.ts +4577 -835
  272. package/types/vue.d.ts +926 -168
  273. package/dist/chat/relative-clock.d.ts +0 -39
  274. package/dist/chat/relative-clock.js +0 -31
  275. package/dist/data-table/root/order.d.ts +0 -141
  276. package/dist/data-table/root/order.js +0 -76
  277. package/dist/tag/selection.d.ts +0 -10
  278. package/dist/tag/selection.js +0 -12
@@ -1,5 +1,5 @@
1
- import { type Curve, HelixElement, SourceController } from '@fusion.dev/helix-core';
2
- import { type PropertyValues, type TemplateResult } from 'lit';
1
+ import { ChartPointerController, type Curve, HelixElement, SourceController } from '@fusion.dev/helix-core';
2
+ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
4
  * @summary A small chart with no axes that shows the shape of a series beside its number.
5
5
  *
@@ -13,8 +13,16 @@ import { type PropertyValues, type TemplateResult } from 'lit';
13
13
  * are set.
14
14
  *
15
15
  * Without a `label` the sparkline is decorative and `aria-hidden`, for example
16
- * beside a stat that already says "Sessions, 1,102". With a `label` it is an
17
- * image named by that sentence.
16
+ * beside a stat that already says "Sessions, 1,102". With a `label` it is
17
+ * named by that sentence and read by key, as every chart is: the drawing takes
18
+ * focus, the arrow keys walk the readings, Home and End go to the first and
19
+ * the last, Escape puts the reading away, and the `live` part says each
20
+ * reading with where it stands, such as "Mon: 12 (3 of 7)".
21
+ *
22
+ * A pointer resting on the drawing shows the reading under it: the `cursor`
23
+ * part marks it and the `readout` part writes it. `marks` adds a mark on the
24
+ * highest and the lowest reading. A blank cell in a `for` table is a gap in
25
+ * the line.
18
26
  *
19
27
  * Place it beside a `Stat`, because a change beside a figure is a second fact,
20
28
  * as `Stat`'s own spec says. `Trend` is composed the same way.
@@ -32,8 +40,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
32
40
  *
33
41
  * @csspart area - The region between the line and the bottom of its range.
34
42
  * @csspart bar - One column, drawn when `plot="bar"`.
43
+ * @csspart cursor - The mark on the reading a pointer or a key rests on, rendered only while there is one. Placed with `inset-inline-start` and `inset-block-start`.
44
+ * @csspart high - The mark on the highest reading, under `marks="high"`. Placed as `cursor` is.
35
45
  * @csspart line - The line's path.
36
- * @csspart svg - The drawing.
46
+ * @csspart live - A polite region that says the reading a key moved to, rendered only with a `label`. Hide it visually.
47
+ * @csspart low - The mark on the lowest reading, under `marks="low"`. Placed as `cursor` is.
48
+ * @csspart readout - The reading a pointer or a key rests on, as the table or `values` writes it, rendered only while there is one. Placed as `cursor` is.
49
+ * @csspart svg - The drawing, which takes focus to be read by key where there is a `label`.
37
50
  * @csspart terminus - The mark on the last value.
38
51
  * @csspart wash-end - The far stop of the area's gradient.
39
52
  * @csspart wash-start - The stop of the area's gradient that meets the line.
@@ -91,6 +104,22 @@ export declare class HelixHeadlessSparkline extends HelixElement {
91
104
  * than announced without a name.
92
105
  */
93
106
  label: string;
107
+ /**
108
+ * The locale the readout's numbers and positions are written in, such as
109
+ * `de` for `1.240`.
110
+ *
111
+ * Absent uses the runtime's own. A table's cells are shown as the table
112
+ * writes them, whatever this says.
113
+ */
114
+ locale: string;
115
+ /**
116
+ * Which readings take a mark of their own: `high`, `low`, or both,
117
+ * separated by spaces.
118
+ *
119
+ * Absent marks none, and the drawing is what it was. Each mark is a part,
120
+ * placed at its reading, for a stylesheet to draw.
121
+ */
122
+ marks: string;
94
123
  /**
95
124
  * What the readings are drawn as.
96
125
  *
@@ -121,6 +150,15 @@ export declare class HelixHeadlessSparkline extends HelixElement {
121
150
  * is markup, the same reason `curve` lives here.
122
151
  */
123
152
  plot?: 'area' | 'bar' | 'line';
153
+ /**
154
+ * Where a reading the keys moved to stands among the readings, said after
155
+ * it. `{position}` and `{count}` are replaced with the numbers, written in
156
+ * `locale`.
157
+ *
158
+ * Set it to the words of the page's language, such as `{position} von
159
+ * {count}`, or to nothing to say no position.
160
+ */
161
+ positionLabel: string;
124
162
  /**
125
163
  * The numbers, separated by whitespace or by commas.
126
164
  *
@@ -131,10 +169,43 @@ export declare class HelixHeadlessSparkline extends HelixElement {
131
169
  */
132
170
  values: string | readonly number[];
133
171
  protected readonly source: SourceController;
172
+ /**
173
+ * Finds the reading a pointer or a key rests on, as it does for every
174
+ * chart, so a sparkline is read the way they are.
175
+ */
176
+ readonly pointer: ChartPointerController;
134
177
  protected willUpdate(changed: PropertyValues<this>): void;
135
- /** The series to draw: the table if there is one, the attribute otherwise. */
136
- private points;
178
+ /**
179
+ * The series to draw, and how many readings it has room for: the table's
180
+ * first series over the table's rows if there is one, the attribute
181
+ * otherwise.
182
+ *
183
+ * Over the rows, so a blank cell is a reading with nothing in it and the
184
+ * line breaks there, as `LineChart` draws one. Joined across, the line
185
+ * claimed a value the table does not have.
186
+ */
187
+ private drawn;
188
+ /** How many readings there are, which the pointer and the keys walk. */
189
+ get readings(): number;
190
+ /**
191
+ * The reading at a place, in words: the table's cell as it is written, or
192
+ * the number in `locale`, after the row's name where a table gave one.
193
+ */
194
+ private reading;
137
195
  protected render(): TemplateResult;
196
+ /** The marks `marks` asks for, on the highest and the lowest reading. */
197
+ protected renderMarks(slots: (number | undefined)[], at: (index: number, value: number) => string): TemplateResult | typeof nothing;
198
+ /**
199
+ * The reading a pointer or a key rests on: a mark on it and its words
200
+ * beside it. Hidden from a screen reader, which hears the `live` part.
201
+ */
202
+ protected renderReading(slots: (number | undefined)[], at: (index: number, value: number) => string): TemplateResult | typeof nothing;
203
+ /**
204
+ * The polite region that says a reading the keys moved to, in words and
205
+ * with where it stands. Rendered from the first drawing and empty until a
206
+ * key moves the reading, so it is heard when its words change.
207
+ */
208
+ protected renderLive(slots: (number | undefined)[]): TemplateResult;
138
209
  }
139
210
  declare global {
140
211
  interface HTMLElementTagNameMap {
@@ -4,62 +4,117 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, extent, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, writtenNumbers, } from '@fusion.dev/helix-core';
7
+ import { CHART_PLOT, ChartPointerController, customElement, extent, formatNumbers, HelixElement, linear, linePath, PLOT_WIDTH, SourceController, unbroken, writtenList, writtenNumbers, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing, svg } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
+ import { extremesOf, readingWords } from '../readings.js';
10
11
  const STRIP_HEIGHT = 32;
11
12
  let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
12
13
  constructor() {
13
14
  super(...arguments);
14
15
  this.for = '';
15
16
  this.label = '';
17
+ this.locale = '';
18
+ this.marks = '';
19
+ this.positionLabel = '{position} of {count}';
16
20
  this.values = '';
17
21
  this.source = new SourceController(this);
22
+ this.pointer = new ChartPointerController(this);
18
23
  }
19
24
  willUpdate(changed) {
20
25
  if (changed.has('for')) {
21
26
  this.source.watch();
22
27
  }
23
28
  }
24
- points() {
25
- const series = this.source.series;
26
- return series.length > 0
27
- ? (series[0]?.points.map((point) => point.value) ?? [])
28
- : writtenNumbers(this.values);
29
+ drawn() {
30
+ const read = this.source.series;
31
+ if (read.length > 0) {
32
+ return {
33
+ count: this.source.rows.length,
34
+ series: read[0] ?? { name: '', points: [] },
35
+ };
36
+ }
37
+ const values = writtenNumbers(this.values);
38
+ return {
39
+ count: values.length,
40
+ series: { name: '', points: values.map((value, at) => ({ at, label: '', value })) },
41
+ };
42
+ }
43
+ get readings() {
44
+ return this.drawn().count;
45
+ }
46
+ reading(at, value) {
47
+ const rows = this.source.rows;
48
+ const row = rows[at];
49
+ if (!row) {
50
+ return { label: '', text: value === undefined ? '' : formatNumbers(this.locale)(value) };
51
+ }
52
+ const column = row.cells.findIndex((_, index) => rows.some((one) => one.cells[index]?.value !== undefined));
53
+ return { label: row.label, text: row.cells[column]?.text ?? '' };
29
54
  }
30
55
  render() {
31
- const points = this.points();
32
- const x = linear([0, Math.max(points.length - 1, 1)], [0, PLOT_WIDTH]);
56
+ const { count, series } = this.drawn();
57
+ const slots = Array.from({ length: count }, () => undefined);
58
+ for (const point of series.points) {
59
+ if (point.at >= 0 && point.at < count) {
60
+ slots[point.at] = point.value;
61
+ }
62
+ }
63
+ const points = slots.filter((value) => value !== undefined);
64
+ const x = linear([0, Math.max(count - 1, 1)], [0, PLOT_WIDTH]);
33
65
  const [low, high] = extent(points.length > 0 ? points : [0]);
34
66
  const y = this.plot === 'bar'
35
67
  ? linear([Math.min(0, low), Math.max(0, high)], [STRIP_HEIGHT, 0])
36
68
  : linear([low, high], [STRIP_HEIGHT, 0]);
37
- const coordinates = points.map((value, index) => [x(index), y(value)]);
38
- const path = this.plot === 'bar' ? '' : linePath(coordinates, this.curve ?? 'smooth');
69
+ const runs = this.plot === 'bar'
70
+ ? []
71
+ : unbroken(series)
72
+ .map((run) => run.map((point) => [x(point.at), y(point.value)]))
73
+ .map((run) => ({ path: linePath(run, this.curve ?? 'smooth'), run }))
74
+ .filter((one) => one.path !== '');
75
+ const path = runs.map((one) => one.path).join('');
39
76
  const area = this.plot !== 'bar' && this.plot !== 'line' && path !== ''
40
- ? `${path}L${PLOT_WIDTH},${STRIP_HEIGHT}L0,${STRIP_HEIGHT}Z`
77
+ ? runs
78
+ .map((one) => {
79
+ const first = one.run[0];
80
+ const last = one.run.at(-1);
81
+ return `${one.path}L${last[0]},${STRIP_HEIGHT}L${first[0]},${STRIP_HEIGHT}Z`;
82
+ })
83
+ .join('')
41
84
  : '';
42
- const slot = PLOT_WIDTH / Math.max(points.length, 1);
85
+ const slot = PLOT_WIDTH / Math.max(count, 1);
43
86
  const floor = y(0);
44
87
  const bars = this.plot === 'bar'
45
- ? points.map((value, index) => ({
46
- height: Math.abs(floor - y(value)),
47
- width: slot * 0.72,
48
- x: index * slot + slot * 0.14,
49
- y: Math.min(floor, y(value)),
50
- }))
88
+ ? slots.flatMap((value, index) => value === undefined
89
+ ? []
90
+ : [
91
+ {
92
+ height: Math.abs(floor - y(value)),
93
+ width: slot * 0.72,
94
+ x: index * slot + slot * 0.14,
95
+ y: Math.min(floor, y(value)),
96
+ },
97
+ ])
51
98
  : [];
99
+ const lastAt = slots.findLastIndex((value) => value !== undefined);
52
100
  const end = points.length < 2
53
101
  ? undefined
54
- : `--chart-terminus-x: 100%; --chart-terminus-y: ${(y(points[points.length - 1]) / STRIP_HEIGHT) * 100}%`;
102
+ : `--chart-terminus-x: ${(x(lastAt) / PLOT_WIDTH) * 100}%; --chart-terminus-y: ${(y(slots[lastAt]) / STRIP_HEIGHT) * 100}%`;
103
+ const at = (index, value) => {
104
+ const across = this.plot === 'bar' ? index * slot + slot / 2 : x(index);
105
+ return `inset-inline-start: ${(across / PLOT_WIDTH) * 100}%; inset-block-start: ${(y(value) / STRIP_HEIGHT) * 100}%`;
106
+ };
107
+ const named = this.label !== '';
55
108
  return html `<svg
56
- aria-hidden=${this.label === '' ? 'true' : nothing}
57
- aria-label=${this.label === '' ? nothing : this.label}
109
+ aria-hidden=${named ? nothing : 'true'}
110
+ aria-label=${named ? this.label : nothing}
58
111
  data-mirror
112
+ id=${CHART_PLOT}
59
113
  part="svg"
60
114
  preserveAspectRatio="none"
61
- role=${this.label === '' ? nothing : 'img'}
115
+ role=${named ? (points.length > 0 ? 'application' : 'img') : nothing}
62
116
  style=${end ?? nothing}
117
+ tabindex=${named && points.length > 0 ? '0' : nothing}
63
118
  viewBox="0 0 ${PLOT_WIDTH} ${STRIP_HEIGHT}"
64
119
  >
65
120
  ${svg `<defs>
@@ -80,7 +135,38 @@ let HelixHeadlessSparkline = class HelixHeadlessSparkline extends HelixElement {
80
135
  </svg>
81
136
  ${points.length < 2 || this.plot === 'bar'
82
137
  ? nothing
83
- : html `<span aria-hidden="true" part="terminus" style=${end ?? nothing}></span>`}`;
138
+ : html `<span aria-hidden="true" part="terminus" style=${end ?? nothing}></span>`}${this.renderMarks(slots, at)}${this.renderReading(slots, at)}${named && count > 0 ? this.renderLive(slots) : nothing}`;
139
+ }
140
+ renderMarks(slots, at) {
141
+ const asked = writtenList(this.marks);
142
+ if (asked.length === 0) {
143
+ return nothing;
144
+ }
145
+ const found = extremesOf(slots);
146
+ const place = (index, name) => asked.includes(name) && index !== undefined ? at(index, slots[index]) : undefined;
147
+ const high = place(found.high, 'high');
148
+ const low = place(found.low, 'low');
149
+ return html `${high === undefined ? nothing : html `<span aria-hidden="true" part="high" style=${high}></span>`}${low === undefined ? nothing : html `<span aria-hidden="true" part="low" style=${low}></span>`}`;
150
+ }
151
+ renderReading(slots, at) {
152
+ const index = this.pointer.at;
153
+ const value = slots[index];
154
+ if (index < 0 || value === undefined) {
155
+ return nothing;
156
+ }
157
+ const { label, text } = this.reading(index, value);
158
+ const place = at(index, value);
159
+ return html `<span aria-hidden="true" part="cursor" style=${place}></span
160
+ ><span aria-hidden="true" part="readout" style=${place}
161
+ >${readingWords(label, text, '')}</span
162
+ >`;
163
+ }
164
+ renderLive(slots) {
165
+ const index = this.pointer.at;
166
+ const said = this.pointer.keyed && index >= 0 ? this.reading(index, slots[index]) : undefined;
167
+ return html `<span aria-live="polite" part="live" role="status"
168
+ >${said ? readingWords(said.label, said.text, this.pointer.position) : ''}</span
169
+ >`;
84
170
  }
85
171
  };
86
172
  __decorate([
@@ -92,9 +178,18 @@ __decorate([
92
178
  __decorate([
93
179
  property()
94
180
  ], HelixHeadlessSparkline.prototype, "label", void 0);
181
+ __decorate([
182
+ property()
183
+ ], HelixHeadlessSparkline.prototype, "locale", void 0);
184
+ __decorate([
185
+ property()
186
+ ], HelixHeadlessSparkline.prototype, "marks", void 0);
95
187
  __decorate([
96
188
  property({ reflect: true })
97
189
  ], HelixHeadlessSparkline.prototype, "plot", void 0);
190
+ __decorate([
191
+ property({ attribute: 'position-label' })
192
+ ], HelixHeadlessSparkline.prototype, "positionLabel", void 0);
98
193
  __decorate([
99
194
  property()
100
195
  ], HelixHeadlessSparkline.prototype, "values", void 0);
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { anchorElement, customElement, drawIcon, HelixElement, KeyboardNavigationController, MixinControllerOpen, PopoverController, slottedWords, tellDisclosure, } from '@fusion.dev/helix-core';
7
+ import { anchorElement, customElement, drawIcon, HelixElement, KeyboardNavigationController, MixinControllerOpen, PopoverController, slottedWords, tellDisclosure, typeaheadBy, } from '@fusion.dev/helix-core';
8
8
  import { plus } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -17,7 +17,7 @@ let HelixHeadlessSpeedDial = class HelixHeadlessSpeedDial extends MixinControlle
17
17
  this.keys = new KeyboardNavigationController(this, {
18
18
  items: () => (this.open ? this.items : []),
19
19
  selects: () => false,
20
- typeahead: (item) => slottedWords(item, ['']),
20
+ typeahead: typeaheadBy((item) => slottedWords(item, [''])),
21
21
  });
22
22
  this.focusOnOpen = false;
23
23
  this.panel = new PopoverController(this, {
@@ -264,8 +264,8 @@ export declare class HelixHeadlessSplitter extends HelixElement {
264
264
  * divider, because the child fills the pane and the pane spans this splitter
265
265
  * end to end on the axis the divider runs.
266
266
  *
267
- * Not `@state`, because the array is mutated in place. `cross` and `uncross`
268
- * request the update themselves.
267
+ * Not `@state`, because the array is mutated in place. The channel's `cross`
268
+ * and `uncross` request the update themselves.
269
269
  */
270
270
  private crossings;
271
271
  /** The splitter this one is nested in, once it has found it. */
@@ -499,17 +499,12 @@ export declare class HelixHeadlessSplitter extends HelixElement {
499
499
  */
500
500
  private readonly handleCornerDoubleClick;
501
501
  /**
502
- * @internal Records that a nested splitter crosses this one at `at` percent
503
- * along it.
504
- *
505
- * Public because it is the whole of the channel between the two, and it runs
506
- * one way: the child tells the parent where it is, and the parent draws the
507
- * corner and drives them both. Nothing is read back, so neither has to know
508
- * anything about the other's state.
502
+ * Opens the channel a nested splitter reports through: where it crosses this
503
+ * one, and when it has left. It runs one way, the child telling the parent
504
+ * where it is and the parent drawing the corner and driving them both, so
505
+ * nothing is read back. Kept off the element, so it is no API of it.
509
506
  */
510
- cross(by: HelixHeadlessSplitter, at: number): void;
511
- /** @internal Forgets a nested splitter that has left the tree. See `cross`. */
512
- uncross(by: HelixHeadlessSplitter): void;
507
+ constructor();
513
508
  /**
514
509
  * Announces this splitter to the one it is nested in, if they cross.
515
510
  *