@fusion.dev/helix-headless 0.145.0 → 0.147.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 (343) hide show
  1. package/custom-elements.json +12286 -4281
  2. package/dist/accordion/item/accordion-item.d.ts +51 -18
  3. package/dist/accordion/item/accordion-item.js +45 -13
  4. package/dist/accordion/root/accordion-root.d.ts +16 -7
  5. package/dist/accordion/root/accordion-root.js +3 -3
  6. package/dist/announcement/root/announcement-root.d.ts +16 -6
  7. package/dist/announcement/root/announcement-root.js +37 -7
  8. package/dist/app-header/root/app-header-root.d.ts +7 -2
  9. package/dist/app-header/root/app-header-root.js +9 -1
  10. package/dist/app-header/sectioning.d.ts +3 -1
  11. package/dist/app-header/sectioning.js +3 -2
  12. package/dist/area-chart/root/area-chart-root.d.ts +18 -1
  13. package/dist/area-chart/root/area-chart-root.js +11 -3
  14. package/dist/avatar/group/avatar-group.d.ts +20 -14
  15. package/dist/avatar/group/avatar-group.js +17 -19
  16. package/dist/avatar/root/avatar-root.d.ts +31 -1
  17. package/dist/avatar/root/avatar-root.js +11 -1
  18. package/dist/badge/root/badge-root.d.ts +60 -7
  19. package/dist/badge/root/badge-root.js +89 -6
  20. package/dist/bar-chart/root/bar-chart-root.d.ts +18 -1
  21. package/dist/bar-chart/root/bar-chart-root.js +48 -20
  22. package/dist/bar-chart/stack.d.ts +25 -0
  23. package/dist/bar-chart/stack.js +27 -0
  24. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +14 -0
  25. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +12 -2
  26. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +25 -0
  27. package/dist/breadcrumbs/root/breadcrumbs-root.js +51 -4
  28. package/dist/button/root/button-root.d.ts +50 -38
  29. package/dist/button/root/button-root.js +42 -53
  30. package/dist/button/submitter.d.ts +27 -0
  31. package/dist/button/submitter.js +25 -0
  32. package/dist/button-group/root/button-group-root.d.ts +2 -1
  33. package/dist/button-group/root/button-group-root.js +5 -1
  34. package/dist/canvas/node/canvas-node.d.ts +4 -3
  35. package/dist/canvas/node/canvas-node.js +3 -2
  36. package/dist/canvas/root/canvas-root.js +2 -2
  37. package/dist/card/root/card-root.d.ts +36 -4
  38. package/dist/card/root/card-root.js +29 -10
  39. package/dist/carousel/root/carousel-root.d.ts +43 -4
  40. package/dist/carousel/root/carousel-root.js +40 -12
  41. package/dist/carousel/stops.d.ts +20 -0
  42. package/dist/carousel/stops.js +30 -0
  43. package/dist/chat/message/chat-message.js +5 -4
  44. package/dist/chat/naming.d.ts +5 -1
  45. package/dist/chat/naming.js +4 -2
  46. package/dist/chat/root/chat-root.d.ts +40 -4
  47. package/dist/chat/root/chat-root.js +32 -6
  48. package/dist/checkbox/root/checkbox-root.d.ts +20 -0
  49. package/dist/checkbox/root/checkbox-root.js +18 -7
  50. package/dist/checkbox-group/root/checkbox-group-root.d.ts +8 -2
  51. package/dist/checkbox-group/root/checkbox-group-root.js +14 -11
  52. package/dist/checkbox-group/select-all.d.ts +21 -0
  53. package/dist/checkbox-group/select-all.js +7 -0
  54. package/dist/code-block/highlight.d.ts +15 -0
  55. package/dist/code-block/highlight.js +4 -0
  56. package/dist/code-block/root/code-block-root.d.ts +79 -10
  57. package/dist/code-block/root/code-block-root.js +74 -5
  58. package/dist/color-input/root/color-input-root.d.ts +14 -0
  59. package/dist/color-input/root/color-input-root.js +17 -7
  60. package/dist/color-picker/channels.js +1 -2
  61. package/dist/color-picker/root/color-picker-root.d.ts +53 -16
  62. package/dist/color-picker/root/color-picker-root.js +155 -46
  63. package/dist/color-picker/wheel.d.ts +17 -0
  64. package/dist/color-picker/wheel.js +6 -0
  65. package/dist/combobox/root/combobox-root.d.ts +56 -0
  66. package/dist/combobox/root/combobox-root.js +92 -15
  67. package/dist/command/root/command-root.d.ts +19 -2
  68. package/dist/command/root/command-root.js +24 -23
  69. package/dist/copy-button/root/copy-button-root.d.ts +21 -1
  70. package/dist/copy-button/root/copy-button-root.js +16 -4
  71. package/dist/data-table/index.d.ts +1 -1
  72. package/dist/data-table/index.js +1 -1
  73. package/dist/data-table/keys.d.ts +6 -0
  74. package/dist/data-table/keys.js +14 -0
  75. package/dist/data-table/root/data-table-root.d.ts +27 -18
  76. package/dist/data-table/root/data-table-root.js +31 -57
  77. package/dist/data-table/tree.d.ts +16 -1
  78. package/dist/data-table/tree.js +2 -3
  79. package/dist/date-input/root/date-input-root.d.ts +11 -2
  80. package/dist/date-input/root/date-input-root.js +26 -12
  81. package/dist/date-picker/root/date-picker-root.d.ts +14 -9
  82. package/dist/date-picker/root/date-picker-root.js +33 -22
  83. package/dist/description-list/item/description-list-item.d.ts +18 -4
  84. package/dist/description-list/item/description-list-item.js +8 -4
  85. package/dist/dialog/description.js +15 -1
  86. package/dist/dialog/root/dialog-root.d.ts +8 -2
  87. package/dist/dialog/root/dialog-root.js +16 -1
  88. package/dist/divider/root/divider-root.d.ts +3 -0
  89. package/dist/divider/root/divider-root.js +2 -1
  90. package/dist/donut-chart/root/donut-chart-root.d.ts +31 -0
  91. package/dist/donut-chart/root/donut-chart-root.js +55 -1
  92. package/dist/donut-chart/slice-label.d.ts +35 -0
  93. package/dist/donut-chart/slice-label.js +11 -0
  94. package/dist/drawer/reveal.d.ts +8 -0
  95. package/dist/drawer/reveal.js +1 -0
  96. package/dist/drawer/root/drawer-root.d.ts +63 -2
  97. package/dist/drawer/root/drawer-root.js +75 -4
  98. package/dist/drilldown/item/drilldown-item.d.ts +21 -1
  99. package/dist/drilldown/item/drilldown-item.js +40 -5
  100. package/dist/drilldown/root/drilldown-root.d.ts +21 -3
  101. package/dist/drilldown/root/drilldown-root.js +22 -3
  102. package/dist/element-events.generated.js +35 -6
  103. package/dist/empty/root/empty-root.d.ts +34 -2
  104. package/dist/empty/root/empty-root.js +26 -4
  105. package/dist/file-input/root/file-input-root.d.ts +99 -8
  106. package/dist/file-input/root/file-input-root.js +120 -22
  107. package/dist/file-input/screen.d.ts +2 -1
  108. package/dist/file-input/status.d.ts +24 -0
  109. package/dist/file-input/status.js +10 -0
  110. package/dist/filter-input/chip/filter-chip.d.ts +23 -0
  111. package/dist/filter-input/chip/filter-chip.js +11 -2
  112. package/dist/filter-input/menu/filter-menu.d.ts +2 -0
  113. package/dist/filter-input/menu/filter-menu.js +12 -4
  114. package/dist/filter-input/root/filter-input-root.d.ts +38 -6
  115. package/dist/filter-input/root/filter-input-root.js +18 -28
  116. package/dist/filter-input/suggest.d.ts +28 -3
  117. package/dist/filter-input/suggest.js +18 -8
  118. package/dist/format-date/options.d.ts +3 -4
  119. package/dist/format-date/options.js +2 -2
  120. package/dist/format-date/root/format-date-root.d.ts +27 -17
  121. package/dist/format-date/root/format-date-root.js +27 -48
  122. package/dist/heatmap/root/buckets.d.ts +21 -0
  123. package/dist/heatmap/root/buckets.js +34 -0
  124. package/dist/heatmap/root/heatmap-root.d.ts +83 -11
  125. package/dist/heatmap/root/heatmap-root.js +104 -12
  126. package/dist/icon/index.d.ts +1 -1
  127. package/dist/icon/index.js +1 -1
  128. package/dist/icon/registry.d.ts +26 -1
  129. package/dist/icon/registry.js +12 -1
  130. package/dist/icon/root/icon-root.d.ts +25 -1
  131. package/dist/icon/root/icon-root.js +44 -12
  132. package/dist/icon/root/index.d.ts +1 -1
  133. package/dist/icon/root/index.js +1 -1
  134. package/dist/icon/settle.d.ts +7 -0
  135. package/dist/icon/settle.js +10 -0
  136. package/dist/icon-button/root/icon-button-root.d.ts +2 -0
  137. package/dist/image/root/image-root.d.ts +14 -1
  138. package/dist/image/root/image-root.js +7 -2
  139. package/dist/input/root/input-root.d.ts +34 -3
  140. package/dist/input/root/input-root.js +17 -4
  141. package/dist/kbd/keys.d.ts +29 -0
  142. package/dist/kbd/keys.js +52 -0
  143. package/dist/kbd/root/kbd-root.d.ts +52 -1
  144. package/dist/kbd/root/kbd-root.js +40 -47
  145. package/dist/legend/hidden-series.d.ts +10 -2
  146. package/dist/legend/hidden-series.js +5 -2
  147. package/dist/legend/root/legend-root.d.ts +77 -12
  148. package/dist/legend/root/legend-root.js +71 -17
  149. package/dist/lightbox/root/lightbox-root.d.ts +98 -10
  150. package/dist/lightbox/root/lightbox-root.js +153 -18
  151. package/dist/lightbox/zoom-controller.d.ts +59 -0
  152. package/dist/lightbox/zoom-controller.js +128 -0
  153. package/dist/lightbox/zoom.d.ts +24 -0
  154. package/dist/lightbox/zoom.js +18 -0
  155. package/dist/line-chart/root/line-chart-root.d.ts +38 -1
  156. package/dist/line-chart/root/line-chart-root.js +31 -3
  157. package/dist/list/item/list-item.d.ts +2 -0
  158. package/dist/list/item/list-item.js +11 -2
  159. package/dist/list/root/list-root.d.ts +70 -13
  160. package/dist/list/root/list-root.js +91 -13
  161. package/dist/list/selection.d.ts +54 -7
  162. package/dist/list/selection.js +32 -7
  163. package/dist/listbox/root/listbox-root.d.ts +44 -4
  164. package/dist/listbox/root/listbox-root.js +72 -34
  165. package/dist/loader/busy.d.ts +10 -0
  166. package/dist/loader/busy.js +11 -0
  167. package/dist/loader/root/loader-root.d.ts +9 -2
  168. package/dist/loader/root/loader-root.js +23 -3
  169. package/dist/megamenu/hand-over.d.ts +75 -0
  170. package/dist/megamenu/hand-over.js +67 -0
  171. package/dist/megamenu/root/megamenu-root.d.ts +80 -15
  172. package/dist/megamenu/root/megamenu-root.js +76 -19
  173. package/dist/menu/item/menu-item.d.ts +51 -2
  174. package/dist/menu/item/menu-item.js +50 -26
  175. package/dist/menu/root/menu-root.d.ts +17 -0
  176. package/dist/menu/root/menu-root.js +2 -2
  177. package/dist/meter/root/meter-root.d.ts +62 -1
  178. package/dist/meter/root/meter-root.js +38 -16
  179. package/dist/navigation/root/navigation-root.d.ts +2 -1
  180. package/dist/navigation/root/navigation-root.js +2 -2
  181. package/dist/notifications/root/notifications-root.d.ts +20 -4
  182. package/dist/notifications/root/notifications-root.js +30 -8
  183. package/dist/number-input/grain.d.ts +28 -0
  184. package/dist/number-input/grain.js +14 -0
  185. package/dist/number-input/root/number-input-root.d.ts +34 -9
  186. package/dist/number-input/root/number-input-root.js +31 -25
  187. package/dist/object-inspector/root/object-inspector-root.d.ts +88 -33
  188. package/dist/object-inspector/root/object-inspector-root.js +134 -92
  189. package/dist/object-inspector/rows.d.ts +18 -0
  190. package/dist/object-inspector/rows.js +33 -0
  191. package/dist/option/index.d.ts +1 -0
  192. package/dist/option/index.js +1 -0
  193. package/dist/option/root/option-root.d.ts +5 -3
  194. package/dist/option/separator/option-separator.d.ts +30 -0
  195. package/dist/option/separator/option-separator.js +21 -0
  196. package/dist/outline/root/outline-root.d.ts +30 -0
  197. package/dist/outline/root/outline-root.js +17 -13
  198. package/dist/pagination/size/pagination-size.d.ts +6 -0
  199. package/dist/pagination/size/pagination-size.js +5 -3
  200. package/dist/pin-input/code.d.ts +37 -0
  201. package/dist/pin-input/code.js +25 -0
  202. package/dist/pin-input/root/pin-input-root.d.ts +116 -115
  203. package/dist/pin-input/root/pin-input-root.js +163 -155
  204. package/dist/popover/hide-outside.d.ts +14 -0
  205. package/dist/popover/hide-outside.js +34 -0
  206. package/dist/popover/root/popover-root.d.ts +64 -8
  207. package/dist/popover/root/popover-root.js +67 -4
  208. package/dist/progress/root/progress-root.d.ts +47 -0
  209. package/dist/progress/root/progress-root.js +34 -16
  210. package/dist/qr-code/export.d.ts +45 -1
  211. package/dist/qr-code/export.js +28 -0
  212. package/dist/qr-code/name.d.ts +11 -0
  213. package/dist/qr-code/name.js +7 -0
  214. package/dist/qr-code/root/qr-code-root.d.ts +36 -11
  215. package/dist/qr-code/root/qr-code-root.js +58 -11
  216. package/dist/quote/marks.d.ts +8 -0
  217. package/dist/quote/marks.js +5 -0
  218. package/dist/quote/root/quote-root.d.ts +14 -2
  219. package/dist/quote/root/quote-root.js +23 -1
  220. package/dist/radio/group/radio-group.d.ts +15 -0
  221. package/dist/radio/root/radio-root.d.ts +6 -2
  222. package/dist/radio/root/radio-root.js +7 -2
  223. package/dist/rating/root/rating-root.d.ts +30 -12
  224. package/dist/rating/root/rating-root.js +27 -27
  225. package/dist/scatter-chart/fit.d.ts +15 -0
  226. package/dist/scatter-chart/fit.js +35 -0
  227. package/dist/scatter-chart/root/scatter-chart-root.d.ts +51 -1
  228. package/dist/scatter-chart/root/scatter-chart-root.js +64 -24
  229. package/dist/scroll-area/root/scroll-area-root.d.ts +22 -51
  230. package/dist/scroll-area/root/scroll-area-root.js +57 -173
  231. package/dist/scroll-area/scrollbar-controller.d.ts +111 -0
  232. package/dist/scroll-area/scrollbar-controller.js +172 -0
  233. package/dist/scroll-area/scrollbar.d.ts +27 -8
  234. package/dist/scroll-area/scrollbar.js +10 -1
  235. package/dist/select/align.d.ts +47 -0
  236. package/dist/select/align.js +7 -0
  237. package/dist/select/root/select-root.d.ts +71 -0
  238. package/dist/select/root/select-root.js +78 -6
  239. package/dist/skeleton/root/skeleton-root.d.ts +3 -0
  240. package/dist/skeleton/root/skeleton-root.js +4 -2
  241. package/dist/skip-link/root/skip-link-root.js +2 -2
  242. package/dist/slider/root/slider-root.d.ts +59 -5
  243. package/dist/slider/root/slider-root.js +45 -3
  244. package/dist/sparkline/readings.d.ts +36 -0
  245. package/dist/sparkline/readings.js +36 -0
  246. package/dist/sparkline/root/sparkline-root.d.ts +121 -7
  247. package/dist/sparkline/root/sparkline-root.js +160 -26
  248. package/dist/speed-dial/item/speed-dial-item.d.ts +1 -1
  249. package/dist/speed-dial/item/speed-dial-item.js +2 -2
  250. package/dist/speed-dial/root/speed-dial-root.d.ts +6 -0
  251. package/dist/speed-dial/root/speed-dial-root.js +11 -3
  252. package/dist/splitter/root/splitter-root.d.ts +10 -12
  253. package/dist/splitter/root/splitter-root.js +211 -204
  254. package/dist/stat/root/stat-root.d.ts +14 -5
  255. package/dist/stat/root/stat-root.js +21 -5
  256. package/dist/steps/reach.d.ts +5 -0
  257. package/dist/steps/reach.js +3 -0
  258. package/dist/steps/root/steps-root.d.ts +56 -3
  259. package/dist/steps/root/steps-root.js +50 -6
  260. package/dist/steps/step/step.d.ts +8 -0
  261. package/dist/steps/step/step.js +8 -3
  262. package/dist/switch/root/switch-root.d.ts +10 -0
  263. package/dist/table/column/table-column.d.ts +6 -10
  264. package/dist/table/column/table-column.js +8 -20
  265. package/dist/table/root/table-root.d.ts +31 -10
  266. package/dist/table/root/table-root.js +14 -18
  267. package/dist/table/row/table-row.d.ts +24 -0
  268. package/dist/table/row/table-row.js +37 -1
  269. package/dist/tabs/panel/tab-panel.d.ts +16 -3
  270. package/dist/tabs/panel/tab-panel.js +34 -5
  271. package/dist/tabs/root/tabs-root.d.ts +17 -3
  272. package/dist/tabs/root/tabs-root.js +1 -1
  273. package/dist/tabs/tab/tab.d.ts +5 -0
  274. package/dist/tabs/tab/tab.js +5 -2
  275. package/dist/tag/group/tag-group.d.ts +44 -5
  276. package/dist/tag/group/tag-group.js +60 -9
  277. package/dist/tag/root/tag-root.js +9 -2
  278. package/dist/textarea/root/textarea-root.d.ts +41 -2
  279. package/dist/textarea/root/textarea-root.js +39 -1
  280. package/dist/time-input/root/time-input-root.d.ts +10 -2
  281. package/dist/time-input/root/time-input-root.js +24 -13
  282. package/dist/time-picker/root/time-picker-root.d.ts +28 -17
  283. package/dist/time-picker/root/time-picker-root.js +18 -29
  284. package/dist/time-picker/wheel-name.d.ts +9 -0
  285. package/dist/time-picker/wheel-name.js +15 -0
  286. package/dist/timeline/group/timeline-group.js +2 -2
  287. package/dist/toast/item/toast-item.d.ts +16 -3
  288. package/dist/toast/item/toast-item.js +22 -6
  289. package/dist/toast/root/toast-root.d.ts +34 -4
  290. package/dist/toast/root/toast-root.js +74 -13
  291. package/dist/toast/words.d.ts +12 -0
  292. package/dist/toast/words.js +25 -0
  293. package/dist/toggle/group/toggle-group.d.ts +52 -7
  294. package/dist/toggle/group/toggle-group.js +58 -44
  295. package/dist/toggle/root/toggle-root.js +2 -4
  296. package/dist/toolbar/root/toolbar-root.d.ts +21 -5
  297. package/dist/toolbar/root/toolbar-root.js +52 -8
  298. package/dist/tooltip/root/tooltip-root.d.ts +20 -3
  299. package/dist/tooltip/root/tooltip-root.js +18 -1
  300. package/dist/tour/back.d.ts +10 -0
  301. package/dist/tour/back.js +8 -0
  302. package/dist/tour/root/tour-root.d.ts +45 -2
  303. package/dist/tour/root/tour-root.js +53 -8
  304. package/dist/tour/stop/tour-stop.d.ts +3 -0
  305. package/dist/tour/stop/tour-stop.js +3 -3
  306. package/dist/tree/item/tree-item.d.ts +7 -3
  307. package/dist/tree/item/tree-item.js +3 -0
  308. package/dist/tree/root/tree-root.d.ts +24 -3
  309. package/dist/tree/root/tree-root.js +32 -13
  310. package/dist/tree/selection.js +2 -15
  311. package/dist/trend/figure.d.ts +16 -0
  312. package/dist/trend/figure.js +8 -0
  313. package/dist/trend/root/trend-root.d.ts +83 -19
  314. package/dist/trend/root/trend-root.js +59 -8
  315. package/dist/video/media-events.d.ts +13 -18
  316. package/dist/video/media-events.js +1 -5
  317. package/dist/video/root/extra-controls.d.ts +12 -0
  318. package/dist/video/root/extra-controls.js +6 -2
  319. package/dist/video/root/video-root.d.ts +23 -6
  320. package/dist/video/root/video-root.js +19 -10
  321. package/dist/video-playlist/menu/video-playlist-menu.d.ts +2 -0
  322. package/dist/video-playlist/menu/video-playlist-menu.js +2 -1
  323. package/dist/video-playlist/root/video-playlist-root.d.ts +17 -1
  324. package/dist/video-playlist/root/video-playlist-root.js +3 -0
  325. package/dist/virtual-list/fill.d.ts +11 -8
  326. package/dist/virtual-list/fill.js +10 -17
  327. package/dist/virtual-list/keys.d.ts +16 -7
  328. package/dist/virtual-list/keys.js +17 -6
  329. package/dist/virtual-list/plan.d.ts +65 -0
  330. package/dist/virtual-list/plan.js +27 -0
  331. package/dist/virtual-list/root/virtual-list-root.d.ts +136 -13
  332. package/dist/virtual-list/root/virtual-list-root.js +218 -51
  333. package/lint.json +1 -1
  334. package/package.json +8 -8
  335. package/types/jsx.d.ts +7441 -1458
  336. package/types/svelte.d.ts +1 -0
  337. package/types/vue.d.ts +1501 -326
  338. package/dist/chat/relative-clock.d.ts +0 -39
  339. package/dist/chat/relative-clock.js +0 -31
  340. package/dist/data-table/root/order.d.ts +0 -141
  341. package/dist/data-table/root/order.js +0 -76
  342. package/dist/tag/selection.d.ts +0 -10
  343. package/dist/tag/selection.js +0 -12
@@ -1,13 +1,13 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
- * The largest `max` a stylesheet can hide past.
4
+ * The largest `max` a stylesheet folds a server's markup at.
5
5
  *
6
- * The fold is `:host([max="N"]) ::slotted(:nth-child(n + N+1))`, one selector
6
+ * The rule is `:host([max="N"]) ::slotted(:nth-child(n + N+1))`, one selector
7
7
  * per value, because `An+B` takes a literal and no custom property can be read
8
- * into it. So the range is finite, and it is written down beside the count that
9
- * has to agree with it: a count that folds and a stylesheet that does not would
10
- * put a "+5" beside five avatars that are still on screen.
8
+ * into it. So the range a stylesheet covers is finite. The group folds any
9
+ * `max` itself once it runs, with the platform's `hidden`; past this one, a
10
+ * server's markup shows every avatar until the page hydrates.
11
11
  */
12
12
  export declare const FOLDS_UP_TO = 12;
13
13
  /**
@@ -21,9 +21,10 @@ export declare const FOLDS_UP_TO = 12;
21
21
  * hidden.
22
22
  *
23
23
  * Avatars past `max` stay in the DOM and are hidden. The group writes `hidden`
24
- * on each of them, so they are hidden on the headless tier as well, and the
25
- * count is read out as `overflow-label`, such as "3 more", so a screen reader
26
- * hears that there are more people than the ones it can reach.
24
+ * on each of them, so they are hidden on the headless tier as well, and at any
25
+ * `max`. The count is read out as `overflow-label`, such as "3 more: Grace
26
+ * Hopper, Alan Turing, Barbara Liskov", so a screen reader hears who is there
27
+ * past the ones it can reach.
27
28
  *
28
29
  * @since 0.1.0
29
30
  * @status stable
@@ -59,10 +60,11 @@ export declare class HelixHeadlessAvatarGroup extends HelixElement {
59
60
  */
60
61
  max?: number;
61
62
  /**
62
- * What a screen reader is told the count is, with `{count}` for the number.
63
+ * What a screen reader is told the count is, with `{count}` for the number
64
+ * and `{names}` for the people it stands for, by each avatar's `name`.
63
65
  *
64
66
  * The count shows "+3", which reads as "plus three" and says nothing about
65
- * what was counted.
67
+ * what was counted, nor who.
66
68
  */
67
69
  overflowLabel: string;
68
70
  /** The avatars this group hid, so it unhides only those. */
@@ -78,8 +80,6 @@ export declare class HelixHeadlessAvatarGroup extends HelixElement {
78
80
  * the attribute that hides the whole group.
79
81
  */
80
82
  get overflow(): number;
81
- /** Said once per element, because a re-render is not a second mistake. */
82
- private warned;
83
83
  protected willUpdate(changed: PropertyValues): void;
84
84
  protected firstUpdated(changed: PropertyValues): void;
85
85
  protected updated(changed: PropertyValues): void;
@@ -89,10 +89,16 @@ export declare class HelixHeadlessAvatarGroup extends HelixElement {
89
89
  * **State in markup, so the headless tier folds too.** The fold was a styled
90
90
  * rule alone, and on the headless tier every avatar was drawn beside a "+3".
91
91
  * The styled rule stays, because it is what folds a server's markup before
92
- * this runs. Written through `whenHydrated`, so an avatar's hydrating render
93
- * is the server's, and undone only on the avatars this group hid.
92
+ * this runs, up to `FOLDS_UP_TO`, and this folds at any `max`. Written
93
+ * through `whenHydrated`, so an avatar's hydrating render is the server's,
94
+ * and undone only on the avatars this group hid.
94
95
  */
95
96
  private fold;
97
+ /**
98
+ * The names of the people past `max`, by each avatar's `name`, then its
99
+ * `aria-label`, in the order they are read.
100
+ */
101
+ private foldedNames;
96
102
  protected render(): TemplateResult;
97
103
  }
98
104
  declare global {
@@ -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 { customElement, HelixElement, hostAria, reportRuntime, whenHydrated, } from '@fusion.dev/helix-core';
7
+ import { customElement, fillTemplate, HelixElement, hostAria, whenHydrated, } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  export const FOLDS_UP_TO = 12;
@@ -12,17 +12,15 @@ let HelixHeadlessAvatarGroup = class HelixHeadlessAvatarGroup extends HelixEleme
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  this.label = '';
15
- this.overflowLabel = '{count} more';
15
+ this.overflowLabel = '{count} more: {names}';
16
16
  this.folded = new WeakSet();
17
- this.warned = false;
18
17
  }
19
18
  get avatars() {
20
19
  return this.knownChildren.filter((child) => child instanceof HTMLElement);
21
20
  }
22
21
  get overflow() {
23
22
  const limit = this.max ?? 0;
24
- const limited = limit > 0 && limit <= FOLDS_UP_TO;
25
- return limited ? Math.max(this.avatars.length - limit, 0) : 0;
23
+ return limit > 0 ? Math.max(this.avatars.length - limit, 0) : 0;
26
24
  }
27
25
  willUpdate(changed) {
28
26
  super.willUpdate(changed);
@@ -35,23 +33,11 @@ let HelixHeadlessAvatarGroup = class HelixHeadlessAvatarGroup extends HelixEleme
35
33
  updated(changed) {
36
34
  super.updated(changed);
37
35
  this.fold();
38
- const limit = this.max ?? 0;
39
- if (limit > FOLDS_UP_TO && this.avatars.length > limit && !this.warned) {
40
- this.warned = true;
41
- reportRuntime({
42
- kind: 'max-past-fold',
43
- message: `<${this.localName}> has max="${this.max}", past the ${FOLDS_UP_TO} the fold is written for, ` +
44
- 'so every avatar is shown and none are counted. Lower `max`, or hand the group the ' +
45
- 'avatars you want shown.',
46
- tag: this.localName,
47
- });
48
- }
49
36
  }
50
37
  fold() {
51
38
  const limit = this.max ?? 0;
52
- const limited = limit > 0 && limit <= FOLDS_UP_TO;
53
39
  for (const [index, avatar] of this.avatars.entries()) {
54
- const past = limited && index >= limit;
40
+ const past = limit > 0 && index >= limit;
55
41
  if (past && !avatar.hidden) {
56
42
  this.folded.add(avatar);
57
43
  whenHydrated(avatar, () => {
@@ -66,6 +52,15 @@ let HelixHeadlessAvatarGroup = class HelixHeadlessAvatarGroup extends HelixEleme
66
52
  }
67
53
  }
68
54
  }
55
+ foldedNames() {
56
+ const limit = this.max ?? 0;
57
+ return this.avatars
58
+ .slice(limit)
59
+ .map((avatar) => avatar.name ||
60
+ avatar.getAttribute('aria-label') ||
61
+ '')
62
+ .filter(Boolean);
63
+ }
69
64
  render() {
70
65
  const past = this.overflow;
71
66
  return html `<slot @slotchange=${() => this.requestUpdate()}></slot>
@@ -73,7 +68,10 @@ let HelixHeadlessAvatarGroup = class HelixHeadlessAvatarGroup extends HelixEleme
73
68
  ? html `<span
74
69
  part="overflow"
75
70
  role="img"
76
- aria-label=${this.overflowLabel.replace('{count}', String(past))}
71
+ aria-label=${fillTemplate(this.overflowLabel, {
72
+ count: String(past),
73
+ names: this.foldedNames().join(', '),
74
+ }).replace(/[\s:,]+$/, '')}
77
75
  >+${past}</span
78
76
  >`
79
77
  : ''}`;
@@ -15,7 +15,16 @@ export declare const initialsOf: (name: string) => string;
15
15
  * a person's name does not describe what the avatar stands for.
16
16
  *
17
17
  * `load` and `error` are re-dispatched from the host, because they are not
18
- * composed and would otherwise stop at the shadow boundary.
18
+ * composed and would otherwise stop at the shadow boundary. `status` says
19
+ * which of the two happened, for a listener that arrives after it, and the
20
+ * `loading`, `loaded` and `error` custom states say the same to a stylesheet.
21
+ *
22
+ * **On a server the avatar sends the picture's place**, an `<img>` that the
23
+ * browser fetches while it reads the page. The initials stand in only on the
24
+ * client: at once where the picture failed before the page hydrated, and after
25
+ * `fallback-delay` where it is still on its way. `load` or `error` for a
26
+ * picture that settled before hydration is sent a task after the avatar
27
+ * hydrates, so a page's own scripts are listening by then.
19
28
  *
20
29
  * @since 0.1.0
21
30
  * @status stable
@@ -30,6 +39,10 @@ export declare const initialsOf: (name: string) => string;
30
39
  *
31
40
  * @csspart image - The image, when one is loading or loaded.
32
41
  * @csspart initials - The initials shown when there is no usable image.
42
+ *
43
+ * @cssstate error - The picture failed, or there is none, and the initials show.
44
+ * @cssstate loaded - The picture arrived.
45
+ * @cssstate loading - The picture is on its way.
33
46
  */
34
47
  export declare class HelixHeadlessAvatar extends HelixElement {
35
48
  /**
@@ -43,6 +56,23 @@ export declare class HelixHeadlessAvatar extends HelixElement {
43
56
  * same idea.
44
57
  */
45
58
  fallbackDelay?: number;
59
+ /**
60
+ * The letters shown where no picture loaded, such as `GH`, in place of the
61
+ * ones taken from `name`.
62
+ *
63
+ * For a name whose initials are not its first and last letters, or an
64
+ * entity with a short mark of its own. Absent, the first letters of the
65
+ * first and last words of `name` are shown.
66
+ */
67
+ initials?: string;
68
+ /**
69
+ * When the browser fetches the picture: `lazy` waits until it is near the
70
+ * screen, as an `<img loading="lazy">` does, and `eager` fetches it at once.
71
+ *
72
+ * Absent is the browser's own default, which is `eager`. `lazy` suits a long
73
+ * list of people, most of them off screen.
74
+ */
75
+ loading?: 'eager' | 'lazy';
46
76
  /**
47
77
  * Name of the person or entity.
48
78
  *
@@ -45,6 +45,9 @@ let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
45
45
  label: this.name,
46
46
  role: this.name === '' ? '' : 'img',
47
47
  });
48
+ this.toggleState('error', this.status === 'error');
49
+ this.toggleState('loaded', this.status === 'loaded');
50
+ this.toggleState('loading', this.status === 'loading');
48
51
  }
49
52
  firstUpdated(changed) {
50
53
  super.firstUpdated(changed);
@@ -91,6 +94,7 @@ let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
91
94
  part="image"
92
95
  src=${this.src}
93
96
  alt=""
97
+ loading=${this.loading ?? nothing}
94
98
  ?hidden=${standIn}
95
99
  @error=${this.handleError}
96
100
  @load=${this.handleLoad}
@@ -100,13 +104,19 @@ let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
100
104
  }
101
105
  renderInitials() {
102
106
  return html `<slot>
103
- <span part="initials" aria-hidden="true">${initialsOf(this.name)}</span>
107
+ <span part="initials" aria-hidden="true">${this.initials ?? initialsOf(this.name)}</span>
104
108
  </slot>`;
105
109
  }
106
110
  };
107
111
  __decorate([
108
112
  property({ attribute: 'fallback-delay', type: Number })
109
113
  ], HelixHeadlessAvatar.prototype, "fallbackDelay", void 0);
114
+ __decorate([
115
+ property()
116
+ ], HelixHeadlessAvatar.prototype, "initials", void 0);
117
+ __decorate([
118
+ property()
119
+ ], HelixHeadlessAvatar.prototype, "loading", void 0);
110
120
  __decorate([
111
121
  property()
112
122
  ], HelixHeadlessAvatar.prototype, "name", void 0);
@@ -1,5 +1,5 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
- import { type TemplateResult } from 'lit';
2
+ import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
4
  * @summary A count or a dot pinned to the corner of another element.
5
5
  *
@@ -14,15 +14,20 @@ import { type TemplateResult } from 'lit';
14
14
  * - Any other value shows the value. Above `max`, the indicator shows `{max}+`,
15
15
  * so its width stays the same as the count grows.
16
16
  *
17
+ * `format-options` writes a count with `Intl.NumberFormat`, in `locale`:
18
+ * `format-options='{"notation":"compact"}'` shows 1,200 as `1.2K`. Absent, the
19
+ * count is shown as it was given.
20
+ *
17
21
  * A count is announced from its own text, and `label` replaces that with a
18
22
  * fuller name, such as `4 unread`. A dot needs a `label`. Without one, the dot
19
23
  * is a colored circle that screen readers do not announce.
20
24
  *
21
- * **A badge wrapped around a control is not part of the control's name.** It
22
- * is a status of its own, read when it changes and when a reader moves to it,
23
- * so focusing a button inside a badge announces the button's name alone. A
24
- * reference from the control to the count would point into the badge's shadow
25
- * root, which the platform does not allow.
25
+ * **A badge wrapped around a control describes it.** The control is the first
26
+ * element in the badge that takes focus, and its description is the badge's
27
+ * words, so focusing `<helix-badge value="8" label="{count} unread"><button>Inbox
28
+ * </button></helix-badge>` announces "Inbox, button, 8 unread", current as the
29
+ * count changes. A control that already has a description keeps its own. The
30
+ * count is also a status of its own, read when it changes.
26
31
  *
27
32
  * **Put the badge inside the control to have its count read with the
28
33
  * control's name**, as Web Awesome and Shoelace do: `<button>Inbox
@@ -39,14 +44,34 @@ import { type TemplateResult } from 'lit';
39
44
  * @slot - The element being decorated.
40
45
  *
41
46
  * @csspart indicator - The count, or the dot when there is no value.
47
+ *
48
+ * @cssstate blank - The value is zero, so there is no mark.
49
+ * @cssstate capped - The count is past `max`, so the mark shows `{max}+`.
50
+ * @cssstate dot - There is no value, so the mark is a dot.
42
51
  */
43
52
  export declare class HelixHeadlessBadge extends HelixElement {
53
+ /**
54
+ * `Intl.NumberFormat` options a count is written with, such as
55
+ * `{"notation":"compact"}` for `1.2K`, written as JSON in the attribute.
56
+ *
57
+ * Absent, a count is shown as it was given. Text that is not a number is
58
+ * shown as it is either way.
59
+ */
60
+ formatOptions?: Intl.NumberFormatOptions;
44
61
  /**
45
62
  * The badge's name, read by screen readers.
46
63
  *
47
- * Required for a dot, which has no text to read.
64
+ * Required for a dot, which has no text to read. `{count}` is replaced with
65
+ * what the badge shows, so `label="{count} unread"` reads "8 unread" and
66
+ * stays current as `value` changes, with no label of yours to keep in step.
48
67
  */
49
68
  label: string;
69
+ /**
70
+ * The locale a count is written in under `format-options`, such as `de`.
71
+ *
72
+ * Absent uses the runtime's own.
73
+ */
74
+ locale: string;
50
75
  /**
51
76
  * The largest number the badge shows.
52
77
  *
@@ -73,8 +98,36 @@ export declare class HelixHeadlessBadge extends HelixElement {
73
98
  private get given();
74
99
  /** Whether the value counts nothing, in which case there is no mark. */
75
100
  private get blank();
101
+ /** Whether the count is past `max`, which the mark shows as `{max}+`. */
102
+ private get capped();
76
103
  /** What the indicator reads, once the cap has been applied. */
77
104
  private get text();
105
+ /** What a reader hears for the mark, or nothing for a blank or unnamed one. */
106
+ private get words();
107
+ /** The control the badge describes, while it describes one. */
108
+ private described;
109
+ /**
110
+ * The first element the badge wraps that takes focus: one with a tab stop,
111
+ * or a component that hands its focus on.
112
+ */
113
+ private wrapped;
114
+ protected firstUpdated(changed: PropertyValues): void;
115
+ /**
116
+ * Points the wrapped control's description at the badge, which carries its
117
+ * words as its own label, or takes the pointer back.
118
+ *
119
+ * **The badge itself and not the count**, because a reference from the
120
+ * control into the badge's shadow root is one the platform drops, and the
121
+ * badge is in the control's own tree. A control the page described is left
122
+ * alone.
123
+ */
124
+ private describe;
125
+ private undescribe;
126
+ private readonly handleSlotchange;
127
+ disconnectedCallback(): void;
128
+ connectedCallback(): void;
129
+ protected willUpdate(changed: PropertyValues): void;
130
+ protected updated(changed: PropertyValues): void;
78
131
  protected render(): TemplateResult;
79
132
  }
80
133
  declare global {
@@ -4,14 +4,18 @@ 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, HelixElement } from '@fusion.dev/helix-core';
7
+ import { customElement, fillTemplate, formatNumber, HelixElement } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  let HelixHeadlessBadge = class HelixHeadlessBadge extends HelixElement {
11
11
  constructor() {
12
12
  super(...arguments);
13
13
  this.label = '';
14
+ this.locale = '';
14
15
  this.value = '';
16
+ this.handleSlotchange = () => {
17
+ this.describe();
18
+ };
15
19
  }
16
20
  get given() {
17
21
  return String(this.value ?? '');
@@ -19,31 +23,110 @@ let HelixHeadlessBadge = class HelixHeadlessBadge extends HelixElement {
19
23
  get blank() {
20
24
  return this.given.trim() !== '' && Number(this.given) === 0;
21
25
  }
26
+ get capped() {
27
+ const count = Number(this.given);
28
+ return this.max !== undefined && Number.isFinite(count) && count > this.max;
29
+ }
22
30
  get text() {
31
+ const write = (count) => this.formatOptions ? formatNumber(count, this.locale, this.formatOptions) : String(count);
32
+ if (this.capped) {
33
+ return `${write(this.max)}+`;
34
+ }
23
35
  const count = Number(this.given);
24
- if (this.max !== undefined && Number.isFinite(count) && count > this.max) {
25
- return `${this.max}+`;
36
+ return this.formatOptions && this.given.trim() !== '' && Number.isFinite(count)
37
+ ? write(count)
38
+ : this.given;
39
+ }
40
+ get words() {
41
+ const text = this.text;
42
+ if (this.blank || (text === '' && this.label === '')) {
43
+ return '';
44
+ }
45
+ return fillTemplate(this.label, { count: text }) || text;
46
+ }
47
+ wrapped() {
48
+ const found = this.renderRoot
49
+ .querySelector('slot:not([name])')
50
+ ?.assignedElements({ flatten: true })
51
+ .find((element) => element instanceof HTMLElement &&
52
+ (element.tabIndex >= 0 || element.shadowRoot?.delegatesFocus === true));
53
+ const inner = found?.shadowRoot?.delegatesFocus
54
+ ? found.shadowRoot.querySelector('a[href], button, input, select, textarea')
55
+ : null;
56
+ return inner ?? found;
57
+ }
58
+ firstUpdated(changed) {
59
+ super.firstUpdated(changed);
60
+ requestAnimationFrame(() => this.describe());
61
+ }
62
+ describe() {
63
+ const words = this.words;
64
+ const control = words === '' ? undefined : this.wrapped();
65
+ if (this.described && this.described !== control) {
66
+ this.undescribe();
67
+ }
68
+ if (!control || !('ariaDescribedByElements' in control)) {
69
+ return;
70
+ }
71
+ const own = control.getAttribute('aria-describedby') || control.ariaDescribedByElements?.length;
72
+ if (control !== this.described && own) {
73
+ return;
26
74
  }
27
- return this.given;
75
+ this.internals.ariaLabel = words;
76
+ control.ariaDescribedByElements = [this];
77
+ this.described = control;
78
+ }
79
+ undescribe() {
80
+ if (this.described?.ariaDescribedByElements?.includes(this)) {
81
+ this.described.ariaDescribedByElements = null;
82
+ }
83
+ this.described = undefined;
84
+ this.internals.ariaLabel = null;
85
+ }
86
+ disconnectedCallback() {
87
+ super.disconnectedCallback();
88
+ this.undescribe();
89
+ }
90
+ connectedCallback() {
91
+ super.connectedCallback();
92
+ if (this.hasUpdated) {
93
+ this.describe();
94
+ }
95
+ }
96
+ willUpdate(changed) {
97
+ super.willUpdate(changed);
98
+ this.toggleState('capped', this.capped);
99
+ this.toggleState('dot', this.given.trim() === '');
100
+ this.toggleState('blank', this.blank);
101
+ }
102
+ updated(changed) {
103
+ super.updated(changed);
104
+ this.describe();
28
105
  }
29
106
  render() {
30
107
  const blank = this.blank;
31
108
  const text = this.text;
32
109
  const announced = !blank && (text !== '' || this.label !== '');
33
- return html `<slot></slot>
110
+ return html `<slot @slotchange=${this.handleSlotchange}></slot>
34
111
  <span
35
112
  part="indicator"
36
113
  data-blank=${blank ? '' : nothing}
37
114
  data-single=${text.length <= 1 ? '' : nothing}
38
115
  role="status"
39
- aria-label=${announced ? this.label || text : nothing}
116
+ aria-label=${announced ? fillTemplate(this.label, { count: text }) || text : nothing}
40
117
  >${blank ? html `<span aria-hidden="true">${text}</span>` : text}</span
41
118
  >`;
42
119
  }
43
120
  };
121
+ __decorate([
122
+ property({ attribute: 'format-options', type: Object })
123
+ ], HelixHeadlessBadge.prototype, "formatOptions", void 0);
44
124
  __decorate([
45
125
  property()
46
126
  ], HelixHeadlessBadge.prototype, "label", void 0);
127
+ __decorate([
128
+ property()
129
+ ], HelixHeadlessBadge.prototype, "locale", void 0);
47
130
  __decorate([
48
131
  property({ type: Number })
49
132
  ], HelixHeadlessBadge.prototype, "max", void 0);
@@ -176,6 +176,17 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
176
176
  * of any scale question the picture raises.
177
177
  */
178
178
  secondary?: string;
179
+ /**
180
+ * Stacks a category's columns into one, each series standing on the ones
181
+ * before it, so the column's height is the category's total.
182
+ *
183
+ * Absent stands them side by side, as it always did. A negative reading
184
+ * hangs below zero on the negatives before it, so neither direction hides
185
+ * the other. The scale fits the stacks. A series
186
+ * in `lines` is still a line, measured on its own reading; columns on the
187
+ * second scale stack among themselves.
188
+ */
189
+ stacked: boolean;
179
190
  /** The series names on the second scale, lowercased and trimmed. */
180
191
  private get scaled();
181
192
  /** The series names drawn as a line, lowercased and trimmed for matching. */
@@ -204,7 +215,8 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
204
215
  *
205
216
  * The highest, because which category leads is the question a bar chart is
206
217
  * read for, and the table beside it has every other number. The reading is
207
- * written the way the table writes it, such as `$128k` for `128000`.
218
+ * written the way the table writes it, such as `$128k` for `128000`. A
219
+ * series a legend hid is not drawn and is not said.
208
220
  */
209
221
  protected renderSummary(series: Series[]): TemplateResult;
210
222
  /**
@@ -214,6 +226,11 @@ export declare class HelixHeadlessBarChart extends HelixHeadlessBarChart_base {
214
226
  * and a screen reader hearing both hears the same numbers twice.
215
227
  */
216
228
  protected renderPlot(series: Series[], categories: string[], y: (value: number) => number, domain: [number, number], floor: number, z?: (value: number) => number): TemplateResult;
229
+ /**
230
+ * One category's columns stacked into one, each on the ones before it on
231
+ * its own scale, through the pure `stackSpans`.
232
+ */
233
+ private renderStack;
217
234
  /**
218
235
  * The numbers along one scale, drawn only where there are two of them.
219
236
  *