@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
@@ -13,15 +13,21 @@ declare const HelixHeadlessAccordionItem_base: (new (...args: any[]) => import("
13
13
  * accordion's, then 3.
14
14
  *
15
15
  * Content stays mounted when the item is closed, so it can animate and its text
16
- * is present in server-rendered HTML. Closed content has both `hidden` and
17
- * `inert`. `hidden` collapses it when no stylesheet is loaded. `inert` keeps it
18
- * out of the tab order and the accessibility tree after the styled tier's
19
- * `display` overrides `hidden`.
16
+ * is present in server-rendered HTML.
20
17
  *
21
- * Set `hidden-until-found` and the browser's find in page searches a closed
22
- * section too: a match opens it, with `helix-before-open` first, as React
23
- * Aria's disclosure does. The content is then `hidden="until-found"` while
24
- * closed, and not `inert`, since an inert region is never searched.
18
+ * The browser's find in page searches a closed section, and a match opens it,
19
+ * with `helix-before-open` first, as React Aria's disclosure does. Closed
20
+ * content is `hidden="until-found"`, which hides it with no stylesheet loaded
21
+ * and keeps it out of the tab order and the accessibility tree. A section
22
+ * that closes keeps its content drawn until the content part's animations and
23
+ * transitions end, so a sheet that animates the section closed shows the
24
+ * content shrinking rather than an empty box. Set `hidden-until-found="false"`
25
+ * and a closed section is `hidden` and `inert` instead, and find in page skips
26
+ * it.
27
+ *
28
+ * While it is open, the content part carries the content's height as
29
+ * `--accordion-content-height`, as Radix's accordion does, for a stylesheet
30
+ * that animates the section open with keyframes of its own.
25
31
  *
26
32
  * @since 0.1.0
27
33
  * @status stable
@@ -43,6 +49,8 @@ declare const HelixHeadlessAccordionItem_base: (new (...args: any[]) => import("
43
49
  * @csspart heading - The heading that holds the trigger.
44
50
  * @csspart trigger - The button that opens and closes the section, holding the summary.
45
51
  *
52
+ * @cssproperty --accordion-content-height - The height of the content, in pixels, written on the `content` part while the section is open.
53
+ *
46
54
  * @cssstate open - While the item is open.
47
55
  */
48
56
  export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionItem_base {
@@ -91,12 +99,11 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
91
99
  * Whether find in page searches the section while it is closed, and opens it
92
100
  * on a match.
93
101
  *
94
- * Off by default. A closed section is then `hidden="until-found"`, which
95
- * hides through `content-visibility`, so a stylesheet that animates the
96
- * section closed shows an empty box for the length of that animation. The
97
- * accordion's own `hidden-until-found` turns it on for every section.
102
+ * Unset takes the accordion's `hidden-until-found`, which is on. Write
103
+ * `hidden-until-found="false"` to keep find in page out of this section: a
104
+ * closed section is then `hidden` and `inert`.
98
105
  */
99
- hiddenUntilFound: boolean;
106
+ hiddenUntilFound?: boolean;
100
107
  /**
101
108
  * A group name. Opening an item closes the other items with the same name,
102
109
  * as `<details name>` does.
@@ -120,6 +127,24 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
120
127
  name?: string;
121
128
  /** Whether find in page searches this section while it is closed. */
122
129
  private get findable();
130
+ /**
131
+ * Whether the section has closed and its content is still drawn, until the
132
+ * content part's animations end.
133
+ *
134
+ * `hidden="until-found"` hides through `content-visibility`, which an
135
+ * author's `display` does not override, so writing it the moment the section
136
+ * closes empties the box a sheet is still shrinking. `inert` holds the
137
+ * content meanwhile.
138
+ */
139
+ private closing;
140
+ protected willUpdate(changed: PropertyValues): void;
141
+ /**
142
+ * Hides the content of a section that closed, once whatever animates the
143
+ * content part has finished. Nothing running, as under reduced motion or
144
+ * with no stylesheet, hides it at once. `getAnimations` brings the styles up
145
+ * to date first, so a transition the close starts is among them.
146
+ */
147
+ private finishClosing;
123
148
  /**
124
149
  * Opens the section find in page has matched in, before the match is shown.
125
150
  *
@@ -166,6 +191,12 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
166
191
  * settle, once every item is there to compare.
167
192
  */
168
193
  protected updated(changed: PropertyValues): void;
194
+ /**
195
+ * Writes the content's height onto the content part while the section is
196
+ * open. `scrollHeight`, so a sheet that clips the box while it grows still
197
+ * reads the whole height.
198
+ */
199
+ private readonly measure;
169
200
  /**
170
201
  * Moves focus to this item's trigger.
171
202
  *
@@ -192,17 +223,19 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
192
223
  * part outranks it and the transition runs exactly as before. Measured on
193
224
  * both tiers.
194
225
  *
195
- * **`hidden="until-found"` only where it was asked for.** It hides through
226
+ * **`hidden="until-found"` unless it is turned off.** It hides through
196
227
  * `content-visibility` rather than `display`, which an author `display` does
197
- * not override, so a section a sheet animates closed shows an empty box while
198
- * it shrinks. `beforematch` sets `open`, so find in page never reveals text
199
- * under a trigger that still reports collapsed.
228
+ * not override, so it is written only once the section's closing motion has
229
+ * ended (`closing`). `beforematch` sets `open`, so find in page never reveals
230
+ * text under a trigger that still reports collapsed.
200
231
  *
201
- * `inert` stays, except under `until-found`. `hidden` answers the reader who
232
+ * `inert` only where `until-found` is not. `hidden` answers the reader who
202
233
  * can see and `inert` answers the one tabbing through, and wherever a sheet
203
234
  * overrides `display`, `inert` is the only one of the two still in force.
204
235
  * `content-visibility: hidden` keeps skipped content out of the tab order and
205
236
  * the accessibility tree by itself, and an inert region is never searched.
237
+ * It leaves the region's own box in the tree, so a closed findable section
238
+ * drops `role="region"` and its name until it opens.
206
239
  */
207
240
  protected render(): TemplateResult;
208
241
  }
@@ -4,10 +4,10 @@ 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 { closestInstance, customElement, HelixElement, MixinControllerOpen, } from '@fusion.dev/helix-core';
7
+ import { closestInstance, customElement, HelixElement, headingLevel, MixinControllerOpen, onUnlessFalse, } from '@fusion.dev/helix-core';
8
8
  import { caretDown } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
- import { property } from 'lit/decorators.js';
10
+ import { property, state } from 'lit/decorators.js';
11
11
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
12
12
  import { HelixHeadlessAccordion } from '../root/accordion-root.js';
13
13
  const CONTENT_ID = 'content';
@@ -17,8 +17,8 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
17
17
  super(...arguments);
18
18
  this.disabled = false;
19
19
  this.groupHeadingLevel = undefined;
20
- this.groupHiddenUntilFound = false;
21
- this.hiddenUntilFound = false;
20
+ this.groupHiddenUntilFound = true;
21
+ this.closing = false;
22
22
  this.handleBeforeMatch = (event) => {
23
23
  if (this.open || this.requestOpen(true)) {
24
24
  return;
@@ -43,19 +43,42 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
43
43
  this.closePeers();
44
44
  }
45
45
  };
46
+ this.measure = () => {
47
+ const content = this.partNamed('content');
48
+ const inner = this.partNamed('content-inner');
49
+ if (!content || !inner || !this.open) {
50
+ return;
51
+ }
52
+ content.style.setProperty('--accordion-content-height', `${inner.scrollHeight}px`);
53
+ };
46
54
  }
47
55
  renderChevron() {
48
56
  if (this.chevronPlacement === 'none') {
49
57
  return nothing;
50
58
  }
51
- return html `<slot name="chevron"
59
+ return html `<slot name="chevron" aria-hidden="true"
52
60
  ><svg part="chevron" fill="currentColor" viewBox=${caretDown.viewBox} aria-hidden="true">
53
61
  ${unsafeSVG(caretDown.content)}
54
62
  </svg></slot
55
63
  >`;
56
64
  }
57
65
  get findable() {
58
- return this.hiddenUntilFound || this.groupHiddenUntilFound;
66
+ return this.hiddenUntilFound ?? this.groupHiddenUntilFound;
67
+ }
68
+ willUpdate(changed) {
69
+ super.willUpdate(changed);
70
+ if (changed.has('open')) {
71
+ this.closing = !this.open && changed.get('open') === true && this.findable;
72
+ }
73
+ }
74
+ finishClosing() {
75
+ const running = this.partNamed('content')?.getAnimations?.({ subtree: true }) ?? [];
76
+ const done = () => {
77
+ if (!this.open) {
78
+ this.closing = false;
79
+ }
80
+ };
81
+ Promise.all(running.map((animation) => animation.finished)).then(done, done);
59
82
  }
60
83
  get accordion() {
61
84
  return closestInstance(this, HelixHeadlessAccordion);
@@ -88,14 +111,20 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
88
111
  if (this.wasOpen === false && this.open) {
89
112
  this.closePeers();
90
113
  }
114
+ if (changed.has('closing') && this.closing) {
115
+ this.finishClosing();
116
+ }
91
117
  this.wasOpen = this.open;
118
+ this.measure();
92
119
  }
93
120
  focusTrigger() {
94
121
  this.renderRoot.querySelector(`#${TRIGGER_ID}`)?.focus();
95
122
  }
96
123
  render() {
97
124
  const open = this.open;
98
- const level = Math.min(6, Math.max(1, this.headingLevel ?? this.groupHeadingLevel ?? 3));
125
+ const shown = open || this.closing;
126
+ const landmark = shown || !this.findable;
127
+ const level = headingLevel(this.headingLevel ?? this.groupHeadingLevel);
99
128
  return html `
100
129
  <div part="container">
101
130
  <div part="heading" role="heading" aria-level=${level}>
@@ -115,15 +144,15 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
115
144
  </div>
116
145
  <div
117
146
  id=${CONTENT_ID}
118
- aria-labelledby=${TRIGGER_ID}
147
+ aria-labelledby=${landmark ? TRIGGER_ID : nothing}
119
148
  part="content"
120
- hidden=${open ? nothing : this.findable ? 'until-found' : ''}
121
- ?inert=${!open && !this.findable}
122
- role="region"
149
+ hidden=${shown ? nothing : this.findable ? 'until-found' : ''}
150
+ ?inert=${!open && (this.closing || !this.findable)}
151
+ role=${landmark ? 'region' : nothing}
123
152
  @beforematch=${this.handleBeforeMatch}
124
153
  >
125
154
  <div part="content-inner">
126
- <slot></slot>
155
+ <slot @slotchange=${this.measure}></slot>
127
156
  </div>
128
157
  </div>
129
158
  </div>
@@ -146,11 +175,14 @@ __decorate([
146
175
  property({ attribute: 'heading-level', type: Number })
147
176
  ], HelixHeadlessAccordionItem.prototype, "headingLevel", void 0);
148
177
  __decorate([
149
- property({ attribute: 'hidden-until-found', type: Boolean })
178
+ property({ attribute: 'hidden-until-found', converter: onUnlessFalse })
150
179
  ], HelixHeadlessAccordionItem.prototype, "hiddenUntilFound", void 0);
151
180
  __decorate([
152
181
  property({ reflect: true })
153
182
  ], HelixHeadlessAccordionItem.prototype, "name", void 0);
183
+ __decorate([
184
+ state()
185
+ ], HelixHeadlessAccordionItem.prototype, "closing", void 0);
154
186
  HelixHeadlessAccordionItem = __decorate([
155
187
  customElement('helix-headless-accordion-item')
156
188
  ], HelixHeadlessAccordionItem);
@@ -17,12 +17,18 @@ import { HelixHeadlessAccordionItem } from '../item/accordion-item.js';
17
17
  * matched with `instanceof HelixHeadlessAccordionItem`, so the headless tier
18
18
  * does not depend on the styled tier's tag names.
19
19
  *
20
- * The keyboard listener belongs to the controller and is attached on connect,
21
- * so it does not run on the server.
20
+ * Keys, on a trigger: Up and Down Arrow move to the previous and the next
21
+ * trigger, and so do Left and Right, wrapping at the ends; Home and End go to
22
+ * the first and the last. Enter and Space open and close the section. Disabled
23
+ * sections are passed over.
22
24
  *
23
- * Each trigger sits inside a heading, level 3 unless `heading-level` says
24
- * otherwise, so the sections are in a screen reader's list of headings. Set the
25
- * level that fits the page's outline.
25
+ * Each trigger is a button with `aria-expanded` and `aria-controls`, inside a
26
+ * heading, level 3 unless `heading-level` says otherwise, so the sections are
27
+ * in a screen reader's list of headings. An open section is a region named by
28
+ * its trigger. Set the level that fits the page's outline.
29
+ *
30
+ * Find in page searches the closed sections too, and opens the one it matches
31
+ * in. `hidden-until-found="false"` turns that off.
26
32
  *
27
33
  * @since 0.1.0
28
34
  * @status stable
@@ -41,8 +47,11 @@ export declare class HelixHeadlessAccordion extends HelixElement {
41
47
  headingLevel?: number;
42
48
  /**
43
49
  * Whether find in page searches every closed section, and opens the one it
44
- * matches in. Each item's own `hidden-until-found` turns it on for that item
45
- * alone.
50
+ * matches in.
51
+ *
52
+ * On by default, as in React Aria's disclosure. Write
53
+ * `hidden-until-found="false"` to turn it off for every section; an item's
54
+ * own `hidden-until-found` wins for that item.
46
55
  */
47
56
  hiddenUntilFound: boolean;
48
57
  /**
@@ -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, KeyboardNavigationController, whenHydrated, } from '@fusion.dev/helix-core';
7
+ import { customElement, HelixElement, KeyboardNavigationController, onUnlessFalse, whenHydrated, } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { HelixHeadlessAccordionItem } from '../item/accordion-item.js';
@@ -18,7 +18,7 @@ const navigable = (item) => ({
18
18
  let HelixHeadlessAccordion = class HelixHeadlessAccordion extends HelixElement {
19
19
  constructor() {
20
20
  super(...arguments);
21
- this.hiddenUntilFound = false;
21
+ this.hiddenUntilFound = true;
22
22
  this.keys = new KeyboardNavigationController(this, {
23
23
  items: () => this.items.map(navigable),
24
24
  origin: 'focus',
@@ -71,7 +71,7 @@ __decorate([
71
71
  property({ attribute: 'heading-level', type: Number })
72
72
  ], HelixHeadlessAccordion.prototype, "headingLevel", void 0);
73
73
  __decorate([
74
- property({ attribute: 'hidden-until-found', type: Boolean })
74
+ property({ attribute: 'hidden-until-found', converter: onUnlessFalse })
75
75
  ], HelixHeadlessAccordion.prototype, "hiddenUntilFound", void 0);
76
76
  __decorate([
77
77
  property({ reflect: true })
@@ -16,8 +16,9 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
16
16
  *
17
17
  * The live region is its own part. When the announcement appears after the page
18
18
  * has loaded, the message is written into the region one frame later, so screen
19
- * readers read it reliably, and the region is emptied seven seconds later, so
20
- * the message is not in the page twice. When the announcement is in the served
19
+ * readers read it reliably, and the region is emptied seven seconds later.
20
+ * While the region holds the copy, the message itself is hidden from screen
21
+ * readers, so it is in the page once. When the announcement is in the served
21
22
  * HTML, the region stays empty and nothing is read out.
22
23
  *
23
24
  * The dismiss button fires `helix-dismiss`, and the announcement stays in the
@@ -30,8 +31,11 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
30
31
  *
31
32
  * Set `duration` to dismiss it after a time. The clock stops while the pointer
32
33
  * or focus is on the announcement, and continues from what was left, so a
33
- * reader partway through is not cut off. When the time runs out it sends
34
- * `helix-dismiss`, as the button does.
34
+ * reader partway through is not cut off. It stops while the page is hidden too,
35
+ * in another tab or a minimized window, so the message is not spent where
36
+ * nobody can see it. While the clock is stopped the announcement carries
37
+ * `:state(paused)`. When the time runs out it sends `helix-dismiss`, as the
38
+ * button does.
35
39
  *
36
40
  * @since 0.1.0
37
41
  * @status stable
@@ -41,15 +45,18 @@ declare const HelixHeadlessAnnouncement_base: (new (...args: any[]) => import("@
41
45
  *
42
46
  * @slot - The message.
43
47
  * @slot actions - Actions for the message, usually a link or a button.
44
- * @slot icon - Replaces the icon inside the dismiss button.
48
+ * @slot dismiss-icon - Replaces the cross inside the dismiss button, as `Callout`'s slot of the same name does.
49
+ * @slot icon - Replaces the cross inside the dismiss button. Deprecated: use `dismiss-icon`, which is read first.
45
50
  *
46
51
  * @event {HelixDismissEvent} helix-dismiss - The dismiss button was pressed, or `duration` ran out. The announcement does not remove itself, so remove it in response. Cancelable.
47
52
  *
48
53
  * @csspart actions - The region after the message that holds the actions.
49
54
  * @csspart content - The region that holds the message.
50
55
  * @csspart dismiss - The button that dismisses the announcement.
51
- * @csspart dismiss-mark - The icon on the dismiss button, shown when the `icon` slot is empty.
56
+ * @csspart dismiss-mark - The cross on the dismiss button, shown when the `dismiss-icon` and `icon` slots are empty.
52
57
  * @csspart live - A copy of the message in a live region, read by screen readers when the announcement appears after the page has loaded, and emptied seven seconds later. Visually hidden in the styled tier.
58
+ *
59
+ * @cssstate paused - The clock `duration` started is stopped, while the pointer or focus is on the announcement or the page is hidden.
53
60
  */
54
61
  export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement_base {
55
62
  /**
@@ -86,6 +93,9 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
86
93
  protected readonly arrival: ArrivalController;
87
94
  /** The time `duration` gives it, held while a reader is on it. */
88
95
  private readonly countdown;
96
+ /** Whether the page being hidden is one of the reasons the clock is held. */
97
+ private heldHidden;
98
+ private readonly handleVisibility;
89
99
  private readonly handleHold;
90
100
  private readonly handleRelease;
91
101
  connectedCallback(): void;
@@ -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 { ArrivalController, CountdownController, customElement, HelixElement, MixinDismissible, markRegion, slottedWords, } from '@fusion.dev/helix-core';
7
+ import { ArrivalController, CountdownController, customElement, HelixElement, MixinDismissible, markRegion, reportRuntime, slottedWords, } from '@fusion.dev/helix-core';
8
8
  import { x } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -20,7 +20,21 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
20
20
  done: () => {
21
21
  this.dismiss();
22
22
  },
23
+ paused: (paused) => {
24
+ this.toggleState('paused', paused);
25
+ },
23
26
  });
27
+ this.heldHidden = false;
28
+ this.handleVisibility = () => {
29
+ if (document.hidden && !this.heldHidden) {
30
+ this.heldHidden = true;
31
+ this.countdown.hold();
32
+ }
33
+ else if (!document.hidden && this.heldHidden) {
34
+ this.heldHidden = false;
35
+ this.countdown.release();
36
+ }
37
+ };
24
38
  this.handleHold = () => {
25
39
  this.countdown.hold();
26
40
  };
@@ -34,8 +48,10 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
34
48
  this.addEventListener('mouseleave', this.handleRelease);
35
49
  this.addEventListener('focusin', this.handleHold);
36
50
  this.addEventListener('focusout', this.handleRelease);
51
+ document.addEventListener('visibilitychange', this.handleVisibility);
37
52
  if (this.hasUpdated) {
38
53
  this.countdown.resume();
54
+ this.handleVisibility();
39
55
  }
40
56
  }
41
57
  disconnectedCallback() {
@@ -44,10 +60,20 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
44
60
  this.removeEventListener('mouseleave', this.handleRelease);
45
61
  this.removeEventListener('focusin', this.handleHold);
46
62
  this.removeEventListener('focusout', this.handleRelease);
63
+ document.removeEventListener('visibilitychange', this.handleVisibility);
64
+ this.heldHidden = false;
47
65
  }
48
66
  firstUpdated(changed) {
49
67
  super.firstUpdated(changed);
50
68
  this.countdown.start(this.duration);
69
+ this.handleVisibility();
70
+ if (this.querySelector(':scope > [slot="icon"]')) {
71
+ reportRuntime({
72
+ kind: 'deprecated',
73
+ message: `<${this.localName}>'s \`icon\` slot is deprecated: slot the glyph as \`dismiss-icon\`, the name Callout uses.`,
74
+ tag: this.localName,
75
+ });
76
+ }
51
77
  }
52
78
  updated(changed) {
53
79
  super.updated(changed);
@@ -57,14 +83,18 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
57
83
  markRegion(this.renderRoot, 'actions', ['actions']);
58
84
  }
59
85
  renderDismissIcon() {
60
- return html `<slot name="icon">
61
- <svg part="dismiss-mark" viewBox=${x.viewBox} fill="currentColor" aria-hidden="true">
62
- ${unsafeSVG(x.content)}
63
- </svg>
64
- </slot>`;
86
+ return html `<slot name="dismiss-icon"
87
+ ><slot name="icon">
88
+ <svg part="dismiss-mark" viewBox=${x.viewBox} fill="currentColor" aria-hidden="true">
89
+ ${unsafeSVG(x.content)}
90
+ </svg>
91
+ </slot></slot
92
+ >`;
65
93
  }
66
94
  render() {
67
- return html `<div part="content"><slot @slotchange=${() => this.arrival.say()}></slot></div>
95
+ return html `<div aria-hidden=${this.arrival.said === '' ? nothing : 'true'} part="content"
96
+ ><slot @slotchange=${() => this.arrival.say()}></slot
97
+ ></div>
68
98
  <span part="live" role="status">${this.arrival.said}</span>
69
99
  <div part="actions"><slot name="actions" @slotchange=${() => this.markEmpty()}></slot></div>
70
100
  ${this.dismissible
@@ -22,8 +22,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
22
22
  * The host is the page's `banner` landmark. Placed inside `main`, `article`,
23
23
  * `aside`, `nav` or `section`, it is a plain box instead, as a native
24
24
  * `<header>` is there, so a header inside a card or a pane does not add a
25
- * second banner. A server cannot see the ancestors, so it serves the banner and
26
- * the browser corrects it when the element connects.
25
+ * second banner. The ancestors are read as the accessibility tree reads them,
26
+ * through the slots that take the header in, so one slotted into a component
27
+ * that draws a `<nav>`, such as `Navigation`, is not a banner either. A server
28
+ * cannot see the ancestors, so it serves the banner and the browser corrects
29
+ * it when the element connects.
27
30
  *
28
31
  * @since 0.1.0
29
32
  * @status stable
@@ -105,6 +108,8 @@ export declare class HelixHeadlessAppHeader extends HelixElement {
105
108
  private readonly handleScroll;
106
109
  protected willUpdate(changed: PropertyValues): void;
107
110
  connectedCallback(): void;
111
+ /** Whether this header is the page's banner, read from where it sits. */
112
+ private readLandmark;
108
113
  disconnectedCallback(): void;
109
114
  protected updated(changed: PropertyValues): void;
110
115
  protected render(): TemplateResult;
@@ -47,9 +47,17 @@ let HelixHeadlessAppHeader = class HelixHeadlessAppHeader extends HelixElement {
47
47
  }
48
48
  connectedCallback() {
49
49
  super.connectedCallback();
50
+ this.readLandmark();
51
+ setTimeout(() => {
52
+ if (this.isConnected) {
53
+ this.readLandmark();
54
+ }
55
+ });
56
+ this.listen();
57
+ }
58
+ readLandmark() {
50
59
  this.landmark = inSectioningContent(this) ? '' : 'banner';
51
60
  hostAria(this.internals, { role: this.landmark });
52
- this.listen();
53
61
  }
54
62
  disconnectedCallback() {
55
63
  super.disconnectedCallback();
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Whether an element sits inside sectioning content, read across shadow
3
- * boundaries as the accessibility tree reads it.
3
+ * boundaries as the accessibility tree reads it: through the slot an element
4
+ * is assigned to, so a header slotted into a component that draws a `<nav>`
5
+ * around its slot, as `Navigation` does, is inside that `<nav>`.
4
6
  *
5
7
  * Client only: a server has no ancestors to read.
6
8
  */
@@ -11,15 +11,16 @@ const SECTIONING = [
11
11
  '[role="region"]',
12
12
  ].join(', ');
13
13
  export const inSectioningContent = (element) => {
14
- let node = element.parentElement ?? hostOf(element);
14
+ let node = above(element);
15
15
  while (node) {
16
16
  if (node.matches(SECTIONING)) {
17
17
  return true;
18
18
  }
19
- node = node.parentElement ?? hostOf(node);
19
+ node = above(node);
20
20
  }
21
21
  return false;
22
22
  };
23
+ const above = (element) => element.assignedSlot ?? element.parentElement ?? hostOf(element);
23
24
  const hostOf = (element) => {
24
25
  const root = element.getRootNode();
25
26
  return root instanceof ShadowRoot ? root.host : null;
@@ -5,7 +5,10 @@ import '../../tooltip/index.js';
5
5
  export interface AreaStack {
6
6
  /** The table's columns that hold numbers, by their place among its cells. */
7
7
  columns: number[];
8
- /** Each column's running sum at each reading, the top edge of its band. */
8
+ /**
9
+ * Each column's top edge at each reading: its running sum, or its own
10
+ * reading under `overlap`.
11
+ */
9
12
  layers: number[][];
10
13
  /** Each column's heading. */
11
14
  names: string[];
@@ -44,6 +47,11 @@ declare const HelixHeadlessAreaChart_base: typeof HelixElement & (new (...args:
44
47
  * bands show each part's share. Use it to see which part grew. The default
45
48
  * shows whether the total grew.
46
49
  *
50
+ * `overlap` draws every band from zero, one in front of another, so each
51
+ * part's own amount is its height: the first column is in front. Use it to
52
+ * compare the parts with each other; the scale then fits the largest part
53
+ * rather than the total.
54
+ *
47
55
  * The drawing is hidden from screen readers. The text summary gives the latest
48
56
  * reading's total and each part's share of it, and the table beside the chart
49
57
  * has every number.
@@ -121,6 +129,15 @@ export declare class HelixHeadlessAreaChart extends HelixHeadlessAreaChart_base
121
129
  * a rule nobody sees.
122
130
  */
123
131
  gridlines?: 'both' | 'category' | 'value';
132
+ /**
133
+ * Draws every band from zero, in front of the next, so a band's height is
134
+ * its own part's amount and not its place in a stack.
135
+ *
136
+ * Absent stacks the parts, so the top edge is the total. Set, the first
137
+ * column is in front and the scale fits the largest part. Reflected, because
138
+ * the styled tier lets the bands behind show through the ones in front.
139
+ */
140
+ overlap: boolean;
124
141
  /**
125
142
  * Draws each reading as a hundred percent, so each band shows its share of
126
143
  * the total.
@@ -23,6 +23,7 @@ const percentIn = (locale) => {
23
23
  let HelixHeadlessAreaChart = class HelixHeadlessAreaChart extends MixinChartSource(HelixElement) {
24
24
  constructor() {
25
25
  super(...arguments);
26
+ this.overlap = false;
26
27
  this.share = false;
27
28
  this.totalLabel = 'Total';
28
29
  this.warnedAboutNegatives = false;
@@ -57,7 +58,7 @@ let HelixHeadlessAreaChart = class HelixHeadlessAreaChart extends MixinChartSour
57
58
  const layers = [];
58
59
  let running = rows.map(() => 0);
59
60
  for (const column of drawn) {
60
- running = running.map((sum, index) => sum + (column[index] ?? 0));
61
+ running = this.overlap ? column : running.map((sum, index) => sum + (column[index] ?? 0));
61
62
  layers.push(running);
62
63
  }
63
64
  return {
@@ -88,7 +89,11 @@ let HelixHeadlessAreaChart = class HelixHeadlessAreaChart extends MixinChartSour
88
89
  if (rows.length === 0 || stack.columns.length === 0) {
89
90
  return html `<div id=${CHART_PLOT} part="plot"></div>`;
90
91
  }
91
- const top = this.share ? 1 : Math.max(0, ...stack.totals);
92
+ const top = this.overlap
93
+ ? Math.max(0, ...stack.layers.flat())
94
+ : this.share
95
+ ? 1
96
+ : Math.max(0, ...stack.totals);
92
97
  const domain = [0, top > 0 ? top : 1];
93
98
  const y = linear(domain, [PLOT_HEIGHT, 0]);
94
99
  const slot = PLOT_WIDTH / rows.length;
@@ -213,7 +218,7 @@ let HelixHeadlessAreaChart = class HelixHeadlessAreaChart extends MixinChartSour
213
218
  return drawTooltip(rows, at, this.tag('tooltip'), {
214
219
  placement: 'top',
215
220
  x: `${at * slot + slot / 2}%`,
216
- y: `${y(stack.layers.at(-1)?.[at] ?? 0)}%`,
221
+ y: `${y(Math.max(0, ...stack.layers.map((layer) => layer[at] ?? 0)))}%`,
217
222
  }, (cell) => this.seriesOf(cell), this.pointer);
218
223
  }
219
224
  };
@@ -223,6 +228,9 @@ __decorate([
223
228
  __decorate([
224
229
  property()
225
230
  ], HelixHeadlessAreaChart.prototype, "gridlines", void 0);
231
+ __decorate([
232
+ property({ reflect: true, type: Boolean })
233
+ ], HelixHeadlessAreaChart.prototype, "overlap", void 0);
226
234
  __decorate([
227
235
  property({ reflect: true, type: Boolean })
228
236
  ], HelixHeadlessAreaChart.prototype, "share", void 0);