@fusion.dev/helix-headless 0.144.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 (319) hide show
  1. package/custom-elements.json +15195 -4240
  2. package/dist/accordion/item/accordion-item.d.ts +62 -12
  3. package/dist/accordion/item/accordion-item.js +41 -10
  4. package/dist/accordion/root/accordion-root.d.ts +14 -5
  5. package/dist/accordion/root/accordion-root.js +7 -1
  6. package/dist/announcement/root/announcement-root.d.ts +24 -3
  7. package/dist/announcement/root/announcement-root.js +39 -2
  8. package/dist/app-header/root/app-header-root.d.ts +12 -0
  9. package/dist/app-header/root/app-header-root.js +13 -1
  10. package/dist/app-header/sectioning.d.ts +9 -0
  11. package/dist/app-header/sectioning.js +27 -0
  12. package/dist/avatar/group/avatar-group.d.ts +20 -14
  13. package/dist/avatar/group/avatar-group.js +17 -19
  14. package/dist/badge/root/badge-root.d.ts +3 -1
  15. package/dist/badge/root/badge-root.js +2 -2
  16. package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
  17. package/dist/bar-chart/root/bar-chart-root.js +52 -15
  18. package/dist/bar-chart/stack.d.ts +15 -0
  19. package/dist/bar-chart/stack.js +19 -0
  20. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +57 -1
  21. package/dist/breadcrumbs/root/breadcrumbs-root.js +73 -3
  22. package/dist/button/root/button-root.d.ts +26 -0
  23. package/dist/button/root/button-root.js +38 -18
  24. package/dist/button-group/root/button-group-root.d.ts +2 -1
  25. package/dist/button-group/root/button-group-root.js +5 -1
  26. package/dist/canvas/node/canvas-node.d.ts +4 -3
  27. package/dist/canvas/node/canvas-node.js +3 -2
  28. package/dist/canvas/root/canvas-root.d.ts +38 -3
  29. package/dist/canvas/root/canvas-root.js +123 -42
  30. package/dist/card/root/card-root.d.ts +24 -3
  31. package/dist/card/root/card-root.js +20 -8
  32. package/dist/carousel/root/carousel-root.d.ts +133 -4
  33. package/dist/carousel/root/carousel-root.js +174 -24
  34. package/dist/carousel/stops.d.ts +20 -0
  35. package/dist/carousel/stops.js +30 -0
  36. package/dist/chat/composer/chat-composer.d.ts +38 -6
  37. package/dist/chat/composer/chat-composer.js +42 -9
  38. package/dist/chat/message/chat-message.d.ts +32 -1
  39. package/dist/chat/message/chat-message.js +27 -10
  40. package/dist/chat/naming.d.ts +26 -0
  41. package/dist/chat/naming.js +14 -0
  42. package/dist/chat/root/chat-root.d.ts +58 -0
  43. package/dist/chat/root/chat-root.js +43 -3
  44. package/dist/checkbox/root/checkbox-root.d.ts +20 -0
  45. package/dist/checkbox/root/checkbox-root.js +14 -1
  46. package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
  47. package/dist/checkbox-group/root/checkbox-group-root.js +12 -10
  48. package/dist/checkbox-group/select-all.d.ts +27 -0
  49. package/dist/checkbox-group/select-all.js +12 -0
  50. package/dist/code-block/highlight.d.ts +15 -0
  51. package/dist/code-block/highlight.js +4 -0
  52. package/dist/code-block/root/code-block-root.d.ts +57 -2
  53. package/dist/code-block/root/code-block-root.js +63 -8
  54. package/dist/color-input/root/color-input-root.d.ts +3 -0
  55. package/dist/color-input/root/color-input-root.js +6 -3
  56. package/dist/color-picker/root/color-picker-root.d.ts +33 -4
  57. package/dist/color-picker/root/color-picker-root.js +80 -21
  58. package/dist/color-picker/swatches.d.ts +12 -0
  59. package/dist/color-picker/swatches.js +26 -0
  60. package/dist/combobox/root/combobox-root.d.ts +43 -0
  61. package/dist/combobox/root/combobox-root.js +79 -15
  62. package/dist/command/root/command-root.d.ts +16 -1
  63. package/dist/command/root/command-root.js +22 -4
  64. package/dist/copy-button/root/copy-button-root.d.ts +26 -1
  65. package/dist/copy-button/root/copy-button-root.js +12 -5
  66. package/dist/data-table/index.d.ts +1 -1
  67. package/dist/data-table/index.js +1 -1
  68. package/dist/data-table/keys.d.ts +24 -0
  69. package/dist/data-table/keys.js +24 -0
  70. package/dist/data-table/root/data-table-root.d.ts +170 -13
  71. package/dist/data-table/root/data-table-root.js +294 -52
  72. package/dist/data-table/tree.d.ts +55 -0
  73. package/dist/data-table/tree.js +54 -0
  74. package/dist/date-input/root/date-input-root.d.ts +3 -1
  75. package/dist/date-input/root/date-input-root.js +18 -7
  76. package/dist/date-picker/root/date-picker-root.js +12 -6
  77. package/dist/description-list/item/description-list-item.d.ts +17 -2
  78. package/dist/description-list/item/description-list-item.js +15 -2
  79. package/dist/description-list/root/description-list-root.d.ts +27 -1
  80. package/dist/description-list/root/description-list-root.js +26 -1
  81. package/dist/dialog/description.js +15 -1
  82. package/dist/dialog/root/dialog-root.d.ts +8 -2
  83. package/dist/dialog/root/dialog-root.js +16 -1
  84. package/dist/divider/root/divider-root.d.ts +3 -0
  85. package/dist/divider/root/divider-root.js +2 -1
  86. package/dist/donut-chart/root/donut-chart-root.d.ts +31 -0
  87. package/dist/donut-chart/root/donut-chart-root.js +48 -1
  88. package/dist/drawer/reveal.d.ts +8 -0
  89. package/dist/drawer/reveal.js +1 -0
  90. package/dist/drawer/root/drawer-root.d.ts +59 -0
  91. package/dist/drawer/root/drawer-root.js +63 -4
  92. package/dist/drilldown/item/drilldown-item.d.ts +11 -6
  93. package/dist/drilldown/item/drilldown-item.js +8 -5
  94. package/dist/drilldown/root/drilldown-root.d.ts +29 -0
  95. package/dist/drilldown/root/drilldown-root.js +28 -5
  96. package/dist/element-events.generated.js +83 -12
  97. package/dist/empty/root/empty-root.d.ts +3 -1
  98. package/dist/empty/root/empty-root.js +3 -2
  99. package/dist/file-input/root/file-input-root.d.ts +69 -6
  100. package/dist/file-input/root/file-input-root.js +82 -19
  101. package/dist/file-input/screen.d.ts +2 -1
  102. package/dist/filter-input/menu/filter-menu.d.ts +5 -0
  103. package/dist/filter-input/menu/filter-menu.js +16 -4
  104. package/dist/filter-input/root/filter-input-root.d.ts +30 -6
  105. package/dist/filter-input/root/filter-input-root.js +1 -1
  106. package/dist/filter-input/suggest.d.ts +28 -3
  107. package/dist/filter-input/suggest.js +18 -8
  108. package/dist/format-date/root/format-date-root.d.ts +9 -16
  109. package/dist/format-date/root/format-date-root.js +10 -27
  110. package/dist/heatmap/root/heatmap-root.d.ts +24 -13
  111. package/dist/heatmap/root/heatmap-root.js +34 -12
  112. package/dist/icon/root/icon-root.d.ts +12 -1
  113. package/dist/icon/root/icon-root.js +21 -10
  114. package/dist/icon/settle.d.ts +7 -0
  115. package/dist/icon/settle.js +10 -0
  116. package/dist/icon-button/root/icon-button-root.d.ts +2 -0
  117. package/dist/image/root/image-root.d.ts +5 -1
  118. package/dist/image/root/image-root.js +10 -2
  119. package/dist/input/root/input-root.d.ts +13 -3
  120. package/dist/input/root/input-root.js +12 -3
  121. package/dist/kbd/root/kbd-root.d.ts +35 -1
  122. package/dist/kbd/root/kbd-root.js +23 -4
  123. package/dist/legend/root/legend-root.d.ts +55 -8
  124. package/dist/legend/root/legend-root.js +55 -13
  125. package/dist/lightbox/root/lightbox-root.d.ts +49 -6
  126. package/dist/lightbox/root/lightbox-root.js +86 -19
  127. package/dist/lightbox/zoom-controller.d.ts +59 -0
  128. package/dist/lightbox/zoom-controller.js +128 -0
  129. package/dist/lightbox/zoom.d.ts +22 -0
  130. package/dist/lightbox/zoom.js +16 -0
  131. package/dist/line-chart/root/line-chart-root.d.ts +22 -1
  132. package/dist/line-chart/root/line-chart-root.js +21 -1
  133. package/dist/list/item/list-item.d.ts +70 -1
  134. package/dist/list/item/list-item.js +77 -6
  135. package/dist/list/numbering.d.ts +14 -0
  136. package/dist/list/numbering.js +8 -0
  137. package/dist/list/root/list-root.d.ts +155 -9
  138. package/dist/list/root/list-root.js +246 -4
  139. package/dist/list/selection.d.ts +49 -0
  140. package/dist/list/selection.js +30 -0
  141. package/dist/listbox/root/listbox-root.d.ts +37 -1
  142. package/dist/listbox/root/listbox-root.js +49 -4
  143. package/dist/loader/busy.d.ts +10 -0
  144. package/dist/loader/busy.js +11 -0
  145. package/dist/loader/root/loader-root.d.ts +9 -2
  146. package/dist/loader/root/loader-root.js +23 -3
  147. package/dist/map/root/map-root.d.ts +6 -2
  148. package/dist/map/root/map-root.js +5 -2
  149. package/dist/megamenu/root/megamenu-root.d.ts +62 -0
  150. package/dist/megamenu/root/megamenu-root.js +90 -5
  151. package/dist/menu/index.d.ts +1 -0
  152. package/dist/menu/index.js +1 -0
  153. package/dist/menu/item/menu-item.d.ts +87 -11
  154. package/dist/menu/item/menu-item.js +78 -22
  155. package/dist/menu/root/menu-root.d.ts +39 -1
  156. package/dist/menu/root/menu-root.js +65 -8
  157. package/dist/menu/section/menu-section.d.ts +55 -0
  158. package/dist/menu/section/menu-section.js +60 -0
  159. package/dist/meter/root/meter-root.d.ts +20 -1
  160. package/dist/meter/root/meter-root.js +11 -15
  161. package/dist/navigation/root/navigation-root.d.ts +18 -2
  162. package/dist/navigation/root/navigation-root.js +29 -3
  163. package/dist/notifications/root/notifications-root.d.ts +25 -0
  164. package/dist/notifications/root/notifications-root.js +33 -5
  165. package/dist/number-input/root/number-input-root.d.ts +17 -8
  166. package/dist/number-input/root/number-input-root.js +2 -7
  167. package/dist/object-inspector/root/object-inspector-root.d.ts +161 -32
  168. package/dist/object-inspector/root/object-inspector-root.js +264 -123
  169. package/dist/object-inspector/rows.d.ts +75 -0
  170. package/dist/object-inspector/rows.js +119 -0
  171. package/dist/option/root/option-root.d.ts +5 -3
  172. package/dist/outline/levels.d.ts +31 -0
  173. package/dist/outline/levels.js +23 -0
  174. package/dist/outline/root/outline-root.d.ts +86 -3
  175. package/dist/outline/root/outline-root.js +95 -12
  176. package/dist/pagination/size/pagination-size.d.ts +12 -2
  177. package/dist/pagination/size/pagination-size.js +20 -5
  178. package/dist/pin-input/code.d.ts +10 -0
  179. package/dist/pin-input/code.js +13 -0
  180. package/dist/pin-input/root/pin-input-root.d.ts +25 -1
  181. package/dist/pin-input/root/pin-input-root.js +10 -11
  182. package/dist/popover/hide-outside.d.ts +14 -0
  183. package/dist/popover/hide-outside.js +41 -0
  184. package/dist/popover/root/popover-root.d.ts +57 -7
  185. package/dist/popover/root/popover-root.js +58 -3
  186. package/dist/progress/root/progress-root.d.ts +20 -0
  187. package/dist/progress/root/progress-root.js +15 -15
  188. package/dist/qr-code/export.d.ts +26 -1
  189. package/dist/qr-code/export.js +14 -0
  190. package/dist/qr-code/root/qr-code-root.d.ts +19 -5
  191. package/dist/qr-code/root/qr-code-root.js +58 -9
  192. package/dist/quote/marks.d.ts +8 -0
  193. package/dist/quote/marks.js +5 -0
  194. package/dist/quote/root/quote-root.d.ts +14 -2
  195. package/dist/quote/root/quote-root.js +23 -1
  196. package/dist/radio/group/radio-group.d.ts +4 -10
  197. package/dist/radio/group/radio-group.js +5 -10
  198. package/dist/radio/root/radio-root.d.ts +6 -2
  199. package/dist/radio/root/radio-root.js +6 -1
  200. package/dist/rating/root/rating-root.d.ts +10 -5
  201. package/dist/rating/root/rating-root.js +32 -8
  202. package/dist/rating/steps.d.ts +7 -0
  203. package/dist/rating/steps.js +9 -0
  204. package/dist/scatter-chart/fit.d.ts +15 -0
  205. package/dist/scatter-chart/fit.js +35 -0
  206. package/dist/scatter-chart/root/scatter-chart-root.d.ts +21 -1
  207. package/dist/scatter-chart/root/scatter-chart-root.js +30 -17
  208. package/dist/scroll-area/root/scroll-area-root.d.ts +84 -0
  209. package/dist/scroll-area/root/scroll-area-root.js +106 -7
  210. package/dist/scroll-area/scrollbar-controller.d.ts +111 -0
  211. package/dist/scroll-area/scrollbar-controller.js +172 -0
  212. package/dist/scroll-area/scrollbar.d.ts +92 -0
  213. package/dist/scroll-area/scrollbar.js +33 -0
  214. package/dist/select/root/select-root.d.ts +15 -0
  215. package/dist/select/root/select-root.js +18 -6
  216. package/dist/skeleton/root/skeleton-root.d.ts +3 -0
  217. package/dist/skeleton/root/skeleton-root.js +4 -2
  218. package/dist/skip-link/root/skip-link-root.js +2 -2
  219. package/dist/slider/root/slider-root.d.ts +41 -4
  220. package/dist/slider/root/slider-root.js +23 -3
  221. package/dist/sparkline/readings.d.ts +18 -0
  222. package/dist/sparkline/readings.js +19 -0
  223. package/dist/sparkline/root/sparkline-root.d.ts +78 -7
  224. package/dist/sparkline/root/sparkline-root.js +118 -23
  225. package/dist/speed-dial/root/speed-dial-root.js +2 -2
  226. package/dist/splitter/root/splitter-root.d.ts +20 -12
  227. package/dist/splitter/root/splitter-root.js +226 -203
  228. package/dist/splitter/snap.d.ts +9 -0
  229. package/dist/splitter/snap.js +12 -0
  230. package/dist/stat/root/stat-root.d.ts +14 -5
  231. package/dist/stat/root/stat-root.js +21 -5
  232. package/dist/steps/reach.d.ts +20 -0
  233. package/dist/steps/reach.js +15 -0
  234. package/dist/steps/root/steps-root.d.ts +76 -0
  235. package/dist/steps/root/steps-root.js +93 -1
  236. package/dist/steps/step/step.d.ts +45 -2
  237. package/dist/steps/step/step.js +33 -6
  238. package/dist/switch/root/switch-root.d.ts +10 -0
  239. package/dist/table/column/table-column.d.ts +11 -10
  240. package/dist/table/column/table-column.js +8 -19
  241. package/dist/table/root/table-root.d.ts +126 -4
  242. package/dist/table/root/table-root.js +156 -6
  243. package/dist/table/row/table-row.d.ts +47 -1
  244. package/dist/table/row/table-row.js +39 -2
  245. package/dist/tabs/panel/tab-panel.d.ts +22 -5
  246. package/dist/tabs/panel/tab-panel.js +34 -6
  247. package/dist/tabs/root/tabs-root.d.ts +37 -1
  248. package/dist/tabs/root/tabs-root.js +22 -4
  249. package/dist/tabs/tab/tab.d.ts +41 -4
  250. package/dist/tabs/tab/tab.js +49 -3
  251. package/dist/tag/group/tag-group.d.ts +31 -4
  252. package/dist/tag/group/tag-group.js +46 -7
  253. package/dist/tag/root/tag-root.js +9 -2
  254. package/dist/textarea/root/textarea-root.d.ts +28 -1
  255. package/dist/textarea/root/textarea-root.js +40 -1
  256. package/dist/time-input/root/time-input-root.d.ts +5 -1
  257. package/dist/time-input/root/time-input-root.js +16 -8
  258. package/dist/time-picker/root/time-picker-root.d.ts +18 -4
  259. package/dist/time-picker/root/time-picker-root.js +7 -10
  260. package/dist/time-picker/wheel-name.d.ts +9 -0
  261. package/dist/time-picker/wheel-name.js +15 -0
  262. package/dist/timeline/group/timeline-group.d.ts +46 -0
  263. package/dist/timeline/group/timeline-group.js +37 -0
  264. package/dist/timeline/index.d.ts +1 -0
  265. package/dist/timeline/index.js +1 -0
  266. package/dist/timeline/root/timeline-root.d.ts +10 -3
  267. package/dist/toast/item/toast-item.d.ts +24 -18
  268. package/dist/toast/item/toast-item.js +36 -40
  269. package/dist/toast/root/toast-root.d.ts +6 -0
  270. package/dist/toast/root/toast-root.js +16 -1
  271. package/dist/toggle/group/toggle-group.d.ts +24 -3
  272. package/dist/toggle/group/toggle-group.js +34 -5
  273. package/dist/toolbar/root/toolbar-root.d.ts +13 -0
  274. package/dist/toolbar/root/toolbar-root.js +15 -5
  275. package/dist/tooltip/root/tooltip-root.d.ts +13 -2
  276. package/dist/tooltip/root/tooltip-root.js +9 -1
  277. package/dist/tour/back.d.ts +10 -0
  278. package/dist/tour/back.js +8 -0
  279. package/dist/tour/root/tour-root.d.ts +30 -2
  280. package/dist/tour/root/tour-root.js +34 -8
  281. package/dist/tree/item/tree-item.d.ts +61 -4
  282. package/dist/tree/item/tree-item.js +92 -20
  283. package/dist/tree/root/tree-root.d.ts +58 -0
  284. package/dist/tree/root/tree-root.js +80 -16
  285. package/dist/tree/selection.d.ts +24 -0
  286. package/dist/tree/selection.js +13 -0
  287. package/dist/trend/root/trend-root.d.ts +43 -18
  288. package/dist/trend/root/trend-root.js +31 -6
  289. package/dist/video/media-events.d.ts +44 -0
  290. package/dist/video/media-events.js +35 -0
  291. package/dist/video/root/video-root.d.ts +117 -18
  292. package/dist/video/root/video-root.js +93 -47
  293. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -0
  294. package/dist/video-playlist/menu/video-playlist-menu.js +3 -1
  295. package/dist/video-playlist/order.d.ts +41 -0
  296. package/dist/video-playlist/order.js +34 -0
  297. package/dist/video-playlist/root/video-playlist-root.d.ts +77 -3
  298. package/dist/video-playlist/root/video-playlist-root.js +60 -16
  299. package/dist/virtual-list/controls.d.ts +4 -0
  300. package/dist/virtual-list/controls.js +30 -0
  301. package/dist/virtual-list/fill.d.ts +22 -0
  302. package/dist/virtual-list/fill.js +23 -0
  303. package/dist/virtual-list/keys.d.ts +15 -0
  304. package/dist/virtual-list/keys.js +24 -0
  305. package/dist/virtual-list/plan.d.ts +49 -0
  306. package/dist/virtual-list/plan.js +16 -0
  307. package/dist/virtual-list/root/virtual-list-root.d.ts +259 -26
  308. package/dist/virtual-list/root/virtual-list-root.js +333 -49
  309. package/lint.json +1 -1
  310. package/package.json +8 -8
  311. package/types/jsx.d.ts +8113 -1394
  312. package/types/svelte.d.ts +2 -0
  313. package/types/vue.d.ts +1678 -353
  314. package/dist/data-table/root/order.d.ts +0 -141
  315. package/dist/data-table/root/order.js +0 -76
  316. package/dist/listbox/range.d.ts +0 -17
  317. package/dist/listbox/range.js +0 -5
  318. package/dist/tag/selection.d.ts +0 -10
  319. package/dist/tag/selection.js +0 -12
@@ -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, {
@@ -179,6 +179,17 @@ export declare class HelixHeadlessSplitter extends HelixElement {
179
179
  */
180
180
  get position(): number;
181
181
  set position(next: number);
182
+ /**
183
+ * Where a dragged divider snaps, comma separated, as Web Awesome's split
184
+ * panel does: a bare number is a percentage and a length such as `240px` is
185
+ * measured along the splitter, so `snap="25, 50, 75"` or `snap="240px, 50"`.
186
+ * The arrow keys move by `step` and do not snap.
187
+ */
188
+ snap: string;
189
+ /**
190
+ * How close a drag has to come to a snap point to land on it, in pixels.
191
+ */
192
+ snapThreshold: number;
182
193
  /**
183
194
  * How far one arrow key press moves the divider, as a percentage.
184
195
  */
@@ -253,8 +264,8 @@ export declare class HelixHeadlessSplitter extends HelixElement {
253
264
  * divider, because the child fills the pane and the pane spans this splitter
254
265
  * end to end on the axis the divider runs.
255
266
  *
256
- * Not `@state`, because the array is mutated in place. `cross` and `uncross`
257
- * 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.
258
269
  */
259
270
  private crossings;
260
271
  /** The splitter this one is nested in, once it has found it. */
@@ -434,6 +445,8 @@ export declare class HelixHeadlessSplitter extends HelixElement {
434
445
  private settle;
435
446
  private readonly handlePointerDown;
436
447
  private readonly handlePointerMove;
448
+ /** Where a drag at `position` lands once `snap` has had its say. */
449
+ private snapped;
437
450
  private readonly handlePointerUp;
438
451
  /**
439
452
  * The keys a separator answers.
@@ -486,17 +499,12 @@ export declare class HelixHeadlessSplitter extends HelixElement {
486
499
  */
487
500
  private readonly handleCornerDoubleClick;
488
501
  /**
489
- * @internal Records that a nested splitter crosses this one at `at` percent
490
- * along it.
491
- *
492
- * Public because it is the whole of the channel between the two, and it runs
493
- * one way: the child tells the parent where it is, and the parent draws the
494
- * corner and drives them both. Nothing is read back, so neither has to know
495
- * 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.
496
506
  */
497
- cross(by: HelixHeadlessSplitter, at: number): void;
498
- /** @internal Forgets a nested splitter that has left the tree. See `cross`. */
499
- uncross(by: HelixHeadlessSplitter): void;
507
+ constructor();
500
508
  /**
501
509
  * Announces this splitter to the one it is nested in, if they cross.
502
510
  *