@fusion.dev/helix-headless 0.146.0 → 0.148.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 (288) hide show
  1. package/custom-elements.json +9287 -1084
  2. package/dist/accordion/item/accordion-item.d.ts +43 -21
  3. package/dist/accordion/item/accordion-item.js +37 -11
  4. package/dist/accordion/root/accordion-root.d.ts +8 -2
  5. package/dist/accordion/root/accordion-root.js +6 -8
  6. package/dist/announcement/root/announcement-root.d.ts +66 -6
  7. package/dist/announcement/root/announcement-root.js +144 -13
  8. package/dist/area-chart/root/area-chart-root.d.ts +18 -1
  9. package/dist/area-chart/root/area-chart-root.js +14 -7
  10. package/dist/avatar/root/avatar-root.d.ts +31 -1
  11. package/dist/avatar/root/avatar-root.js +11 -1
  12. package/dist/badge/count.d.ts +14 -0
  13. package/dist/badge/count.js +20 -0
  14. package/dist/badge/root/badge-root.d.ts +57 -6
  15. package/dist/badge/root/badge-root.js +77 -8
  16. package/dist/bar-chart/root/bar-chart-root.js +11 -20
  17. package/dist/bar-chart/stack.d.ts +10 -0
  18. package/dist/bar-chart/stack.js +8 -0
  19. package/dist/blockquote/root/blockquote-root.d.ts +66 -8
  20. package/dist/blockquote/root/blockquote-root.js +85 -8
  21. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +14 -0
  22. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +12 -2
  23. package/dist/breadcrumbs/root/breadcrumbs-root.js +2 -2
  24. package/dist/button/root/button-root.d.ts +24 -38
  25. package/dist/button/root/button-root.js +6 -37
  26. package/dist/button/submitter.d.ts +27 -0
  27. package/dist/button/submitter.js +25 -0
  28. package/dist/button-group/arrows.d.ts +14 -0
  29. package/dist/button-group/arrows.js +10 -0
  30. package/dist/button-group/root/button-group-root.d.ts +141 -3
  31. package/dist/button-group/root/button-group-root.js +142 -2
  32. package/dist/canvas/edge-pan.d.ts +61 -0
  33. package/dist/canvas/edge-pan.js +63 -0
  34. package/dist/canvas/node/canvas-node.d.ts +12 -2
  35. package/dist/canvas/node/canvas-node.js +6 -2
  36. package/dist/canvas/root/canvas-document.d.ts +10 -0
  37. package/dist/canvas/root/canvas-document.js +1 -0
  38. package/dist/canvas/root/canvas-root.d.ts +107 -5
  39. package/dist/canvas/root/canvas-root.js +140 -36
  40. package/dist/canvas/snap.d.ts +42 -0
  41. package/dist/canvas/snap.js +32 -0
  42. package/dist/card/root/card-root.d.ts +12 -1
  43. package/dist/card/root/card-root.js +11 -4
  44. package/dist/carousel/root/carousel-root.d.ts +4 -3
  45. package/dist/carousel/root/carousel-root.js +2 -6
  46. package/dist/chat/root/chat-root.d.ts +28 -4
  47. package/dist/chat/root/chat-root.js +12 -7
  48. package/dist/checkbox/root/checkbox-root.js +5 -7
  49. package/dist/checkbox-group/root/checkbox-group-root.d.ts +13 -0
  50. package/dist/checkbox-group/root/checkbox-group-root.js +16 -7
  51. package/dist/checkbox-group/select-all.d.ts +9 -4
  52. package/dist/checkbox-group/select-all.js +1 -1
  53. package/dist/code-block/root/code-block-root.d.ts +41 -18
  54. package/dist/code-block/root/code-block-root.js +21 -6
  55. package/dist/color-input/root/color-input-root.d.ts +11 -0
  56. package/dist/color-input/root/color-input-root.js +12 -5
  57. package/dist/color-picker/channels.js +1 -2
  58. package/dist/color-picker/root/color-picker-root.d.ts +32 -24
  59. package/dist/color-picker/root/color-picker-root.js +99 -55
  60. package/dist/color-picker/wheel.d.ts +28 -0
  61. package/dist/color-picker/wheel.js +15 -0
  62. package/dist/combobox/root/combobox-root.d.ts +83 -11
  63. package/dist/combobox/root/combobox-root.js +81 -18
  64. package/dist/command/root/command-root.d.ts +7 -4
  65. package/dist/command/root/command-root.js +2 -19
  66. package/dist/copy-button/root/copy-button-root.d.ts +16 -1
  67. package/dist/copy-button/root/copy-button-root.js +7 -2
  68. package/dist/data-table/keys.d.ts +0 -18
  69. package/dist/data-table/keys.js +1 -11
  70. package/dist/data-table/root/data-table-root.js +29 -50
  71. package/dist/date-input/root/date-input-root.d.ts +8 -1
  72. package/dist/date-input/root/date-input-root.js +8 -5
  73. package/dist/date-picker/root/date-picker-root.d.ts +14 -9
  74. package/dist/date-picker/root/date-picker-root.js +21 -16
  75. package/dist/description-list/item/description-list-item.d.ts +22 -4
  76. package/dist/description-list/item/description-list-item.js +14 -4
  77. package/dist/divider/root/divider-root.d.ts +45 -16
  78. package/dist/divider/root/divider-root.js +28 -4
  79. package/dist/donut-chart/root/donut-chart-root.js +13 -6
  80. package/dist/donut-chart/slice-label.d.ts +35 -0
  81. package/dist/donut-chart/slice-label.js +11 -0
  82. package/dist/drawer/root/drawer-root.d.ts +4 -2
  83. package/dist/drawer/root/drawer-root.js +15 -3
  84. package/dist/drilldown/item/drilldown-item.d.ts +21 -1
  85. package/dist/drilldown/item/drilldown-item.js +38 -4
  86. package/dist/drilldown/root/drilldown-root.js +3 -2
  87. package/dist/element-events.generated.js +5 -1
  88. package/dist/empty/root/empty-root.d.ts +46 -2
  89. package/dist/empty/root/empty-root.js +50 -5
  90. package/dist/file-input/root/file-input-root.d.ts +34 -6
  91. package/dist/file-input/root/file-input-root.js +55 -21
  92. package/dist/file-input/status.d.ts +24 -0
  93. package/dist/file-input/status.js +11 -0
  94. package/dist/filter-input/chip/filter-chip.d.ts +23 -0
  95. package/dist/filter-input/chip/filter-chip.js +10 -2
  96. package/dist/filter-input/root/filter-input-root.d.ts +8 -0
  97. package/dist/filter-input/root/filter-input-root.js +17 -27
  98. package/dist/format-date/fields.d.ts +20 -0
  99. package/dist/format-date/fields.js +14 -0
  100. package/dist/format-date/options.d.ts +5 -5
  101. package/dist/format-date/options.js +10 -39
  102. package/dist/format-date/root/format-date-root.d.ts +53 -4
  103. package/dist/format-date/root/format-date-root.js +38 -50
  104. package/dist/graph/root/graph-root.d.ts +23 -5
  105. package/dist/graph/root/graph-root.js +17 -20
  106. package/dist/heatmap/root/buckets.d.ts +21 -0
  107. package/dist/heatmap/root/buckets.js +34 -0
  108. package/dist/heatmap/root/heatmap-root.d.ts +76 -3
  109. package/dist/heatmap/root/heatmap-root.js +105 -20
  110. package/dist/icon/index.d.ts +1 -1
  111. package/dist/icon/index.js +1 -1
  112. package/dist/icon/registry.d.ts +26 -1
  113. package/dist/icon/registry.js +12 -1
  114. package/dist/icon/root/icon-root.d.ts +13 -0
  115. package/dist/icon/root/icon-root.js +23 -2
  116. package/dist/icon/root/index.d.ts +1 -1
  117. package/dist/icon/root/index.js +1 -1
  118. package/dist/image/root/image-root.d.ts +20 -0
  119. package/dist/image/root/image-root.js +6 -1
  120. package/dist/input/root/input-root.d.ts +23 -2
  121. package/dist/input/root/input-root.js +12 -8
  122. package/dist/kbd/root/kbd-root.d.ts +20 -3
  123. package/dist/kbd/root/kbd-root.js +23 -50
  124. package/dist/legend/hidden-series.d.ts +10 -2
  125. package/dist/legend/hidden-series.js +5 -2
  126. package/dist/legend/root/legend-root.d.ts +25 -7
  127. package/dist/legend/root/legend-root.js +25 -26
  128. package/dist/lightbox/root/lightbox-root.d.ts +50 -5
  129. package/dist/lightbox/root/lightbox-root.js +76 -8
  130. package/dist/lightbox/zoom.d.ts +2 -0
  131. package/dist/lightbox/zoom.js +5 -3
  132. package/dist/line-chart/root/line-chart-root.d.ts +16 -0
  133. package/dist/line-chart/root/line-chart-root.js +10 -2
  134. package/dist/list/root/list-root.d.ts +10 -2
  135. package/dist/list/root/list-root.js +31 -24
  136. package/dist/list/selection.d.ts +17 -0
  137. package/dist/list/selection.js +16 -0
  138. package/dist/listbox/root/listbox-root.d.ts +125 -26
  139. package/dist/listbox/root/listbox-root.js +156 -166
  140. package/dist/map/marker/map-marker.d.ts +2 -1
  141. package/dist/map/root/map-root.d.ts +40 -2
  142. package/dist/map/root/map-root.js +64 -23
  143. package/dist/megamenu/hand-over.d.ts +75 -0
  144. package/dist/megamenu/hand-over.js +67 -0
  145. package/dist/megamenu/root/megamenu-root.d.ts +38 -14
  146. package/dist/megamenu/root/megamenu-root.js +29 -50
  147. package/dist/menu/item/menu-item.js +4 -4
  148. package/dist/menu/root/menu-root.d.ts +5 -2
  149. package/dist/meter/root/meter-root.d.ts +42 -0
  150. package/dist/meter/root/meter-root.js +33 -7
  151. package/dist/navigation/root/navigation-root.js +5 -8
  152. package/dist/notifications/group/notification-group.d.ts +8 -1
  153. package/dist/notifications/group/notification-group.js +12 -6
  154. package/dist/notifications/notification/notification.d.ts +12 -1
  155. package/dist/notifications/notification/notification.js +3 -1
  156. package/dist/notifications/root/notifications-root.d.ts +48 -3
  157. package/dist/notifications/root/notifications-root.js +36 -6
  158. package/dist/number-input/grain.d.ts +28 -0
  159. package/dist/number-input/grain.js +14 -0
  160. package/dist/number-input/root/number-input-root.d.ts +17 -1
  161. package/dist/number-input/root/number-input-root.js +29 -18
  162. package/dist/object-inspector/root/object-inspector-root.d.ts +17 -6
  163. package/dist/object-inspector/root/object-inspector-root.js +31 -20
  164. package/dist/option/index.d.ts +1 -0
  165. package/dist/option/index.js +1 -0
  166. package/dist/option/separator/option-separator.d.ts +30 -0
  167. package/dist/option/separator/option-separator.js +21 -0
  168. package/dist/outline/root/outline-root.d.ts +12 -0
  169. package/dist/outline/root/outline-root.js +5 -19
  170. package/dist/pagination/size/pagination-size.d.ts +6 -0
  171. package/dist/pagination/size/pagination-size.js +5 -3
  172. package/dist/pin-input/code.d.ts +51 -1
  173. package/dist/pin-input/code.js +37 -0
  174. package/dist/pin-input/root/pin-input-root.d.ts +98 -121
  175. package/dist/pin-input/root/pin-input-root.js +151 -156
  176. package/dist/popover/hide-outside.js +2 -9
  177. package/dist/popover/root/popover-root.d.ts +7 -1
  178. package/dist/popover/root/popover-root.js +9 -1
  179. package/dist/progress/root/progress-root.d.ts +27 -0
  180. package/dist/progress/root/progress-root.js +25 -7
  181. package/dist/qr-code/export.d.ts +19 -0
  182. package/dist/qr-code/export.js +14 -0
  183. package/dist/qr-code/name.d.ts +11 -0
  184. package/dist/qr-code/name.js +7 -0
  185. package/dist/qr-code/root/qr-code-root.d.ts +31 -9
  186. package/dist/qr-code/root/qr-code-root.js +29 -17
  187. package/dist/radio/group/radio-group.d.ts +15 -0
  188. package/dist/radio/root/radio-root.js +2 -2
  189. package/dist/rating/root/rating-root.d.ts +22 -9
  190. package/dist/rating/root/rating-root.js +15 -39
  191. package/dist/scatter-chart/measures.d.ts +22 -0
  192. package/dist/scatter-chart/measures.js +11 -0
  193. package/dist/scatter-chart/root/scatter-chart-root.d.ts +26 -0
  194. package/dist/scatter-chart/root/scatter-chart-root.js +21 -7
  195. package/dist/scroll-area/scrollbar.d.ts +0 -8
  196. package/dist/scroll-area/scrollbar.js +1 -1
  197. package/dist/select/align.d.ts +47 -0
  198. package/dist/select/align.js +7 -0
  199. package/dist/select/root/select-root.d.ts +115 -11
  200. package/dist/select/root/select-root.js +104 -20
  201. package/dist/slider/root/slider-root.d.ts +18 -1
  202. package/dist/slider/root/slider-root.js +22 -0
  203. package/dist/sparkline/readings.d.ts +30 -12
  204. package/dist/sparkline/readings.js +32 -15
  205. package/dist/sparkline/root/sparkline-root.d.ts +46 -3
  206. package/dist/sparkline/root/sparkline-root.js +60 -21
  207. package/dist/speed-dial/group/speed-dial-group.d.ts +48 -0
  208. package/dist/speed-dial/group/speed-dial-group.js +43 -0
  209. package/dist/speed-dial/index.d.ts +1 -0
  210. package/dist/speed-dial/index.js +1 -0
  211. package/dist/speed-dial/item/speed-dial-item.d.ts +27 -2
  212. package/dist/speed-dial/item/speed-dial-item.js +43 -5
  213. package/dist/speed-dial/long-press.d.ts +50 -0
  214. package/dist/speed-dial/long-press.js +48 -0
  215. package/dist/speed-dial/root/speed-dial-root.d.ts +86 -1
  216. package/dist/speed-dial/root/speed-dial-root.js +123 -6
  217. package/dist/splitter/root/splitter-root.d.ts +9 -2
  218. package/dist/splitter/root/splitter-root.js +18 -3
  219. package/dist/steps/root/steps-root.d.ts +8 -1
  220. package/dist/steps/root/steps-root.js +6 -1
  221. package/dist/steps/step/step.d.ts +1 -0
  222. package/dist/steps/step/step.js +1 -1
  223. package/dist/table/cell/table-cell.d.ts +8 -1
  224. package/dist/table/cell/table-cell.js +6 -2
  225. package/dist/table/column/table-column.d.ts +6 -0
  226. package/dist/table/column/table-column.js +5 -1
  227. package/dist/table/grid-controller.d.ts +117 -0
  228. package/dist/table/grid-controller.js +293 -0
  229. package/dist/table/root/table-root.d.ts +47 -3
  230. package/dist/table/root/table-root.js +93 -29
  231. package/dist/table/row/table-row.d.ts +36 -0
  232. package/dist/table/row/table-row.js +52 -2
  233. package/dist/tabs/root/tabs-root.d.ts +5 -3
  234. package/dist/tag/group/tag-group.d.ts +16 -4
  235. package/dist/tag/group/tag-group.js +23 -20
  236. package/dist/textarea/root/textarea-root.d.ts +14 -2
  237. package/dist/textarea/root/textarea-root.js +6 -7
  238. package/dist/time-input/root/time-input-root.d.ts +5 -1
  239. package/dist/time-input/root/time-input-root.js +10 -7
  240. package/dist/time-picker/root/time-picker-root.d.ts +12 -14
  241. package/dist/time-picker/root/time-picker-root.js +18 -23
  242. package/dist/toast/item/toast-item.d.ts +9 -6
  243. package/dist/toast/item/toast-item.js +1 -1
  244. package/dist/toast/root/toast-root.d.ts +40 -4
  245. package/dist/toast/root/toast-root.js +68 -16
  246. package/dist/toast/words.d.ts +12 -0
  247. package/dist/toast/words.js +25 -0
  248. package/dist/toggle/group/toggle-group.d.ts +29 -5
  249. package/dist/toggle/group/toggle-group.js +26 -43
  250. package/dist/toggle/root/toggle-root.js +2 -4
  251. package/dist/toolbar/root/toolbar-root.d.ts +52 -5
  252. package/dist/toolbar/root/toolbar-root.js +88 -13
  253. package/dist/tooltip/root/tooltip-root.d.ts +7 -1
  254. package/dist/tooltip/root/tooltip-root.js +10 -2
  255. package/dist/tour/root/tour-root.d.ts +15 -0
  256. package/dist/tour/root/tour-root.js +20 -1
  257. package/dist/tour/stop/tour-stop.d.ts +3 -0
  258. package/dist/tour/stop/tour-stop.js +3 -3
  259. package/dist/tree/root/tree-root.js +2 -2
  260. package/dist/trend/figure.d.ts +16 -0
  261. package/dist/trend/figure.js +8 -0
  262. package/dist/trend/root/trend-root.d.ts +41 -2
  263. package/dist/trend/root/trend-root.js +29 -3
  264. package/dist/video/root/extra-controls.d.ts +12 -0
  265. package/dist/video/root/extra-controls.js +6 -2
  266. package/dist/video/root/video-root.d.ts +16 -1
  267. package/dist/video/root/video-root.js +15 -1
  268. package/dist/video-playlist/root/video-playlist-root.d.ts +11 -1
  269. package/dist/video-playlist/root/video-playlist-root.js +3 -0
  270. package/dist/virtual-list/fill.d.ts +11 -0
  271. package/dist/virtual-list/fill.js +9 -0
  272. package/dist/virtual-list/keys.d.ts +16 -7
  273. package/dist/virtual-list/keys.js +17 -6
  274. package/dist/virtual-list/plan.d.ts +17 -1
  275. package/dist/virtual-list/plan.js +13 -2
  276. package/dist/virtual-list/root/virtual-list-root.d.ts +25 -3
  277. package/dist/virtual-list/root/virtual-list-root.js +53 -41
  278. package/lint.json +1 -1
  279. package/package.json +5 -5
  280. package/types/jsx.d.ts +4934 -954
  281. package/types/svelte.d.ts +2 -0
  282. package/types/vue.d.ts +946 -253
  283. package/dist/color-picker/swatches.d.ts +0 -12
  284. package/dist/color-picker/swatches.js +0 -26
  285. package/dist/rating/steps.d.ts +0 -7
  286. package/dist/rating/steps.js +0 -9
  287. package/dist/tooltip/focus-target.d.ts +0 -6
  288. package/dist/tooltip/focus-target.js +0 -9
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  var HelixHeadlessDataTable_1;
8
- import { arranged, commaList, countLabel, customElement, cycle, deepActiveElement, deepContains, fillTemplate, format, formatNumbers, HelixActivateEvent, HelixElement, HelixExpandEvent, HelixFilterEvent, HelixFilteredEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixReorderEvent, HelixReorderedEvent, HelixSelectEvent, HelixSelectedEvent, HelixSortEvent, HelixSortedEvent, hostAria, inlineStep, isRtl, MixinCollection, markRegion, ordered, parse, rangeAdd, reportRuntime, requestChange, Typeahead, toggleEvery, treeArrow, typesCharacter, VirtualizeController, valueAt, window_, writtenList, } from '@fusion.dev/helix-core';
8
+ import { anchorAt, arranged, commaList, countLabel, customElement, cycle, deepActiveElement, deepContains, everyState, fillTemplate, format, formatNumbers, gridMove, HelixActivateEvent, HelixElement, HelixExpandEvent, HelixFilterEvent, HelixFilteredEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixReorderEvent, HelixReorderedEvent, HelixSelectEvent, HelixSelectedEvent, HelixSortEvent, HelixSortedEvent, hostAria, inlineStep, inRowOrder, isRtl, MixinCollection, markRegion, onAndroid, ordered, pageRows, parse, rangeAdd, reportRuntime, requestChange, scrollRoom, selectsAll, Typeahead, toggleEvery, treeArrow, typesCharacter, VirtualizeController, valueAt, window_, writtenList, } from '@fusion.dev/helix-core';
9
9
  import { caretDown, caretRight } from '@fusion.dev/helix-icons';
10
10
  import { nothing } from 'lit';
11
11
  import { property, state } from 'lit/decorators.js';
@@ -15,7 +15,7 @@ import { html } from 'lit/static-html.js';
15
15
  import { edgeOf } from '../../table/column/table-column.js';
16
16
  import '../../checkbox/index.js';
17
17
  import '../../pagination/index.js';
18
- import { anchorAt, inRowOrder, toggledOpen } from '../keys.js';
18
+ import { toggledOpen } from '../keys.js';
19
19
  import { grow } from '../tree.js';
20
20
  const CONTROL = [
21
21
  'a[href]',
@@ -165,9 +165,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
165
165
  return;
166
166
  }
167
167
  const last = this.drawnPage.length - 1 + (this.moreDrawn ? 1 : 0);
168
- const edge = this.width - 1;
169
- const control = event.ctrlKey || event.metaKey;
170
- if (control && !event.shiftKey && event.key.toLowerCase() === 'a' && this.selectable) {
168
+ if (!event.shiftKey && selectsAll(event) && this.selectable) {
171
169
  event.preventDefault();
172
170
  this.requestSelected(new Set([...this.chosen, ...this.everyKey]));
173
171
  return;
@@ -180,43 +178,22 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
180
178
  }
181
179
  return;
182
180
  }
183
- let { column, row } = place;
184
- switch (event.key) {
185
- case 'ArrowUp':
186
- row = Math.max(-1, row - 1);
187
- break;
188
- case 'ArrowDown':
189
- row = Math.min(last, row + 1);
190
- break;
191
- case 'ArrowLeft':
192
- case 'ArrowRight':
193
- if (this.treeKey(event, place)) {
194
- return;
195
- }
196
- column = Math.max(0, Math.min(edge, column + inlineStep(this, event.key)));
197
- break;
198
- case 'Home':
199
- row = control ? -1 : row;
200
- column = 0;
201
- break;
202
- case 'End':
203
- row = control ? Math.max(row, last) : row;
204
- column = edge;
205
- break;
206
- case 'PageUp':
207
- row = Math.max(-1, row - this.pageStep(place.cell));
208
- break;
209
- case 'PageDown':
210
- row = Math.min(last, row + this.pageStep(place.cell));
211
- break;
212
- case 'Enter':
213
- case ' ':
214
- case 'F2':
215
- this.activate(event, place);
216
- return;
217
- default:
218
- return;
181
+ if (event.key === 'Enter' || event.key === ' ' || event.key === 'F2') {
182
+ this.activate(event, place);
183
+ return;
184
+ }
185
+ if ((event.key === 'ArrowLeft' || event.key === 'ArrowRight') && this.treeKey(event, place)) {
186
+ return;
187
+ }
188
+ const to = gridMove(event.key, place, { last, top: -1, width: this.width }, {
189
+ control: event.ctrlKey || event.metaKey,
190
+ page: event.key.startsWith('Page') ? this.pageStep(place.cell) : 1,
191
+ step: inlineStep(this, event.key),
192
+ });
193
+ if (!to) {
194
+ return;
219
195
  }
196
+ const { column, row } = to;
220
197
  event.preventDefault();
221
198
  if (event.shiftKey &&
222
199
  this.selectable &&
@@ -887,6 +864,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
887
864
  const stop = this.currentRow(this.drawnPage) === -1 ? this.currentColumn : -1;
888
865
  const offset = this.selectable ? 1 : 0;
889
866
  const shown = this.shownColumns;
867
+ const android = onAndroid();
890
868
  for (const column of this.tableColumns) {
891
869
  column.movable = this.reorderable && column.field !== '';
892
870
  column.gridCell = true;
@@ -897,6 +875,13 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
897
875
  ? 'ascending'
898
876
  : 'descending'
899
877
  : undefined;
878
+ column.sortWords =
879
+ android && column.sorted
880
+ ? fillTemplate(this.sortedLabel, {
881
+ column: column.textContent?.trim() || column.field,
882
+ order: column.sorted === 'ascending' ? this.ascendingLabel : this.descendingLabel,
883
+ })
884
+ : '';
900
885
  }
901
886
  }
902
887
  renderCell(column, row, picked, place, stop, header) {
@@ -1013,15 +998,13 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1013
998
  : html `<div part="after" role="presentation" style="block-size: ${after}px"></div>`;
1014
999
  }
1015
1000
  renderSelectAll(stop) {
1016
- const every = this.everyKey;
1017
- const keys = this.chosen;
1018
- const count = every.filter((key) => keys.has(key)).length;
1001
+ const { checked, indeterminate } = everyState(this.chosen, this.everyKey);
1019
1002
  return html `<span
1020
1003
  part="select-all"
1021
1004
  role="columnheader"
1022
1005
  tabindex=${stop ? '0' : '-1'}
1023
1006
  data-column="0"
1024
- >${this.renderCheckbox(this.selectAllLabel, every.length > 0 && count === every.length, count > 0 && count < every.length, this.toggleAll)}</span>`;
1007
+ >${this.renderCheckbox(this.selectAllLabel, checked, indeterminate, this.toggleAll)}</span>`;
1025
1008
  }
1026
1009
  renderMore(page) {
1027
1010
  if (!this.moreDrawn) {
@@ -1198,11 +1181,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
1198
1181
  this.focusWanted = true;
1199
1182
  }
1200
1183
  pageStep(cell) {
1201
- const box = this.partNamed('table');
1202
- const tall = cell.getBoundingClientRect().height || this.estimate;
1203
- const scrolls = box !== null && box.scrollHeight > box.clientHeight + 1;
1204
- const room = scrolls ? box.clientHeight - this.headHeight() : window.innerHeight;
1205
- return Math.max(1, Math.floor(room / tall) - 1);
1184
+ return pageRows(scrollRoom(this.partNamed('table'), { covered: this.headHeight() }), cell.getBoundingClientRect().height || this.estimate);
1206
1185
  }
1207
1186
  headHeight() {
1208
1187
  return this.cellAt(-1, 0)?.getBoundingClientRect().height ?? 0;
@@ -71,6 +71,7 @@ declare const HelixHeadlessDateInput_base: (new (...args: any[]) => import("@fus
71
71
  * @csspart picker-day-outside - A day from a neighboring month. Applied with `picker-day`.
72
72
  * @csspart picker-day-selected - The chosen day, or either end of a chosen range. Applied with `picker-day`.
73
73
  * @csspart picker-day-today - Today. Applied with `picker-day`.
74
+ * @csspart picker-feedback - The calendar's own message, under it, while the calendar's `feedback` is set.
74
75
  * @csspart picker-grid - The grid of days.
75
76
  * @csspart picker-header - The month name and its controls.
76
77
  * @csspart picker-heading - The month and year being shown.
@@ -173,9 +174,15 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
173
174
  */
174
175
  isDateUnavailable?: ((date: string) => boolean) | undefined;
175
176
  /**
176
- * The language tag for the names of months and days in the calendar.
177
+ * The language tag for the field's order and words, and for the names of
178
+ * months and days in the calendar.
179
+ *
180
+ * Absent is the page's: the `lang` of the nearest element with one, as
181
+ * Shoelace and Web Awesome read it, then the runtime's own.
177
182
  */
178
183
  locale: string;
184
+ /** The locale the words are written in: `locale`, or the page's `lang`. */
185
+ private get language();
179
186
  /**
180
187
  * The latest date that can be chosen, as `YYYY-MM-DD`.
181
188
  */
@@ -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 { AriaForwardController, valueAsDate as asDate, barredBy, customElement, fillTemplate, dateAsValue as fromDate, HelixFormElement, isDateValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, valueAsDate as asDate, barredBy, customElement, fillTemplate, dateAsValue as fromDate, HelixFormElement, isDateValue, localeOf, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, } from '@fusion.dev/helix-core';
8
8
  import { calendarBlank } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -100,6 +100,9 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
100
100
  this.requestUpdate();
101
101
  };
102
102
  }
103
+ get language() {
104
+ return localeOf(this, this.locale);
105
+ }
103
106
  placed(room) {
104
107
  const all = Math.max(1, Math.floor(this.months) || 1);
105
108
  const surface = this.partNamed('surface');
@@ -132,7 +135,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
132
135
  return 'date';
133
136
  }
134
137
  get segmentLocale() {
135
- return this.locale;
138
+ return this.language;
136
139
  }
137
140
  written(date) {
138
141
  if (this.dateStyle === 'iso' || !isDateValue(date)) {
@@ -141,7 +144,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
141
144
  const at = new Date(`${date}T00:00:00Z`);
142
145
  return Number.isNaN(at.getTime())
143
146
  ? date
144
- : new Intl.DateTimeFormat(this.locale || undefined, {
147
+ : new Intl.DateTimeFormat(this.language || undefined, {
145
148
  dateStyle: this.dateStyle,
146
149
  timeZone: 'UTC',
147
150
  }).format(at);
@@ -215,7 +218,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
215
218
  exportparts="cell: picker-cell, cell-range-end: picker-cell-range-end,
216
219
  cell-range-middle: picker-cell-range-middle, cell-range-start: picker-cell-range-start,
217
220
  day: picker-day, day-disabled: picker-day-disabled, day-outside: picker-day-outside,
218
- day-selected: picker-day-selected, day-today: picker-day-today, grid: picker-grid,
221
+ day-selected: picker-day-selected, day-today: picker-day-today, feedback: picker-feedback, grid: picker-grid,
219
222
  header: picker-header, heading: picker-heading, heading-button: picker-heading-button,
220
223
  month: picker-month, months: picker-months, next: picker-next,
221
224
  next-mark: picker-next-mark, period: picker-period, period-current: picker-period-current,
@@ -231,7 +234,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
231
234
  disable-days=${this.disableDays || nothing}
232
235
  first-day-of-week=${this.firstDayOfWeek ?? nothing}
233
236
  label=${this.calendarLabel}
234
- locale=${this.locale || nothing}
237
+ locale=${this.language || nothing}
235
238
  max=${this.max || nothing}
236
239
  max-view=${this.maxView ?? nothing}
237
240
  min=${this.min || nothing}
@@ -1,6 +1,6 @@
1
1
  import { type CalendarView, HelixFormElement } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
- declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & typeof HelixFormElement;
3
+ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinPickerFeedbackInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & typeof HelixFormElement;
4
4
  /**
5
5
  * @summary A month calendar for choosing one or more dates.
6
6
  *
@@ -60,6 +60,7 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
60
60
  * @csspart day-outside - A day from a neighboring month, filling the grid out, beside `day`.
61
61
  * @csspart day-selected - The chosen day, or either end of a chosen range, beside `day`.
62
62
  * @csspart day-today - Today, beside `day`.
63
+ * @csspart feedback - The message under the calendar, while `feedback` is set.
63
64
  * @csspart grid - The grid of days.
64
65
  * @csspart header - The month name and its controls.
65
66
  * @csspart heading - The month and year being shown.
@@ -80,6 +81,8 @@ declare const HelixHeadlessDatePicker_base: (new (...args: any[]) => import("@fu
80
81
  * @csspart weekday - A column header naming a day of the week.
81
82
  *
82
83
  * @cssproperty --date-picker-column-count - How many month columns are drawn, capped at two. `--date-picker-columns` overrides it.
84
+ *
85
+ * @cssstate invalid - While `invalid` is set or `feedback` says what is wrong.
83
86
  */
84
87
  export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_base {
85
88
  /**
@@ -123,10 +126,6 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
123
126
  * (Firefox does not), and is Sunday otherwise.
124
127
  */
125
128
  firstDayOfWeek?: number;
126
- /**
127
- * Whether the current selection fails validation.
128
- */
129
- invalid: boolean;
130
129
  /**
131
130
  * A rule for which dates cannot be chosen: a function given the date as
132
131
  * `YYYY-MM-DD` that returns `true` to bar it.
@@ -142,11 +141,14 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
142
141
  */
143
142
  label: string;
144
143
  /**
145
- * Locale for month and day names.
144
+ * Locale for month and day names, and the day a week starts on.
146
145
  *
147
- * Absent uses the runtime's own.
146
+ * Absent is the page's: the `lang` of the nearest element with one, as
147
+ * Shoelace and Web Awesome read it, then the runtime's own.
148
148
  */
149
149
  locale: string;
150
+ /** The locale the words are written in: `locale`, or the page's `lang`. */
151
+ private get language();
150
152
  /**
151
153
  * Latest selectable date, as `YYYY-MM-DD`.
152
154
  */
@@ -267,8 +269,11 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
267
269
  *
268
270
  * Each candidate is tested in turn rather than the first one winning
269
271
  * outright. Where the last date focused is in some other month, the selected
270
- * date still holds the stop, and only with neither in view does it fall to
271
- * the first of the month.
272
+ * date still holds the stop, then today, as the APG date picker and React
273
+ * Aria's calendar put it, and only with none of them in view does it fall
274
+ * to the first of the month. Measured before today was a candidate: a
275
+ * calendar with no value opened on October 5 with its stop on "Thursday,
276
+ * October 1".
272
277
  */
273
278
  private get anchor();
274
279
  /** Six weeks of dates, so a grid does not change height between months. */
@@ -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 { addDays, addMonths, valueAsDate as asDate, barredBy, customElement, fillTemplate, dateAsValue as fromDate, HelixFormElement, HelixNavigateEvent, hostAria, inlineStep, commaList as list, localToday, MixinControllerValue, monthOf, monthOut, periodCells, periodKey, reportValues, requestChange, sameMonth, weekStartOf, YEARS_SHOWN, yearOut, yearPageOf, } from '@fusion.dev/helix-core';
7
+ import { addDays, addMonths, valueAsDate as asDate, barredBy, customElement, fillTemplate, dateAsValue as fromDate, HelixFormElement, HelixNavigateEvent, hostAria, inlineStep, commaList as list, localeOf, localToday, MixinControllerValue, MixinPickerFeedback, monthOf, monthOut, periodCells, periodKey, reportValues, requestChange, sameMonth, weekStartOf, YEARS_SHOWN, yearOut, yearPageOf, } from '@fusion.dev/helix-core';
8
8
  import { caretLeft, caretRight } from '@fusion.dev/helix-icons';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -22,13 +22,12 @@ const KEYS = new Set([
22
22
  ' ',
23
23
  ]);
24
24
  const firstOf = (year, month) => addMonths(asDate('2000-01-01'), (year - 2000) * 12 + month);
25
- let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControllerValue(HelixFormElement) {
25
+ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerFeedback(MixinControllerValue(HelixFormElement)) {
26
26
  constructor() {
27
27
  super(...arguments);
28
28
  this.defaultMonth = '';
29
29
  this.disableDates = '';
30
30
  this.disableDays = '';
31
- this.invalid = false;
32
31
  this.label = 'Date Picker';
33
32
  this.locale = '';
34
33
  this.max = '';
@@ -105,6 +104,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
105
104
  this.view = 'day';
106
105
  this.yearViewLabel = '{heading}. Choose a year';
107
106
  }
107
+ get language() {
108
+ return localeOf(this, this.locale);
109
+ }
108
110
  get month() {
109
111
  return this.monthState ?? (this.defaultMonth || fromDate(this.derivedMonth).slice(0, 7));
110
112
  }
@@ -120,7 +122,8 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
120
122
  if (this.firstDayOfWeek !== undefined && Number.isFinite(this.firstDayOfWeek)) {
121
123
  return ((Math.floor(this.firstDayOfWeek) % 7) + 7) % 7;
122
124
  }
123
- return this.locale === '' ? 0 : weekStartOf(this.locale);
125
+ const language = this.language;
126
+ return language === '' ? 0 : weekStartOf(language);
124
127
  }
125
128
  get range() {
126
129
  const dates = this.selected;
@@ -145,12 +148,16 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
145
148
  return this.derivedMonth;
146
149
  }
147
150
  get derivedMonth() {
148
- const from = asDate(this.selected[0] ?? '') ?? new Date();
151
+ const from = asDate(this.selected[0] ?? '') ?? asDate(localToday()) ?? new Date();
149
152
  return firstOf(from.getUTCFullYear(), from.getUTCMonth());
150
153
  }
151
154
  get anchor() {
152
155
  const shown = this.shown;
153
- for (const candidate of [asDate(this.focused), asDate(this.selected[0] ?? '')]) {
156
+ for (const candidate of [
157
+ asDate(this.focused),
158
+ asDate(this.selected[0] ?? ''),
159
+ asDate(localToday()),
160
+ ]) {
154
161
  if (candidate && sameMonth(candidate, shown)) {
155
162
  return candidate;
156
163
  }
@@ -414,7 +421,6 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
414
421
  role: 'group',
415
422
  });
416
423
  this.internals.ariaDisabled = this.isDisabled ? 'true' : null;
417
- this.internals.ariaInvalid = this.invalid ? 'true' : null;
418
424
  this.report();
419
425
  }
420
426
  updated(changed) {
@@ -432,14 +438,15 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
432
438
  return Math.max(1, Math.floor(this.months) || 1);
433
439
  }
434
440
  get formats() {
435
- if (this.cachedFormats?.locale === this.locale) {
441
+ const language = this.language;
442
+ if (this.cachedFormats?.locale === language) {
436
443
  return this.cachedFormats;
437
444
  }
438
- const locale = this.locale || undefined;
445
+ const locale = language || undefined;
439
446
  const built = {
440
447
  full: new Intl.DateTimeFormat(locale, { dateStyle: 'full', timeZone: 'UTC' }),
441
448
  heading: new Intl.DateTimeFormat(locale, { month: 'long', timeZone: 'UTC', year: 'numeric' }),
442
- locale: this.locale,
449
+ locale: language,
443
450
  long: new Intl.DateTimeFormat(locale, { dateStyle: 'long', timeZone: 'UTC' }),
444
451
  monthName: new Intl.DateTimeFormat(locale, { month: 'short', timeZone: 'UTC' }),
445
452
  weekday: new Intl.DateTimeFormat(locale, { timeZone: 'UTC', weekday: 'short' }),
@@ -619,14 +626,15 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinControl
619
626
  render() {
620
627
  if (this.view !== 'day') {
621
628
  return html `<div part="months" style="--date-picker-column-count: 1">
622
- ${this.renderPeriods()}
623
- </div>`;
629
+ ${this.renderPeriods()}
630
+ </div>
631
+ ${this.renderPickerFeedback()}`;
624
632
  }
625
633
  const shown = this.shown;
626
634
  const count = this.monthCount;
627
635
  return html `<div part="months" style="--date-picker-column-count: ${Math.min(count, 2)}">
628
636
  ${Array.from({ length: count }, (_, index) => this.renderMonth(addMonths(shown, index), index))}
629
- </div>`;
637
+ </div>${this.renderPickerFeedback()}`;
630
638
  }
631
639
  get valueAsDate() {
632
640
  return asDate(this.value);
@@ -659,9 +667,6 @@ __decorate([
659
667
  __decorate([
660
668
  property({ attribute: 'first-day-of-week', type: Number })
661
669
  ], HelixHeadlessDatePicker.prototype, "firstDayOfWeek", void 0);
662
- __decorate([
663
- property({ reflect: true, type: Boolean })
664
- ], HelixHeadlessDatePicker.prototype, "invalid", void 0);
665
670
  __decorate([
666
671
  property({ attribute: false })
667
672
  ], HelixHeadlessDatePicker.prototype, "isDateUnavailable", void 0);
@@ -16,17 +16,28 @@ import { type PropertyValues, type TemplateResult } from 'lit';
16
16
  * the authors of a paper. The item then puts your `<dd>` elements after its
17
17
  * `<dt>` in place of its own, so a screen reader hears one term and each of
18
18
  * its descriptions, as in a native `<dl>`. A server cannot see your elements,
19
- * so the served item wraps them in its own `<dd>` until it runs.
19
+ * so set `several` as well, and the served item leaves them unwrapped too.
20
+ * Without it, the served item wraps them in its own `<dd>` until it runs.
21
+ *
22
+ * **Controls that act on the value**, such as a copy button, go in the
23
+ * `actions` slot, drawn after the value inside its `<dd>`, as Radix Themes'
24
+ * data list puts an icon button beside a value. A screen reader hears them as
25
+ * part of the description they act on. With several values, put each control
26
+ * inside the `<dd>` it acts on.
20
27
  *
21
28
  * @since 0.1.0
22
29
  * @status stable
23
30
  * @documentation https://fusion.dev/helix/components/description-list
24
31
  *
25
32
  * @slot - The value, or several `<dd>` elements for several values.
33
+ * @slot actions - Controls that act on the value, such as a copy button, after it inside its `<dd>`.
26
34
  * @slot label - The label, when it is more than text. Falls back to `label`.
27
35
  *
36
+ * @csspart actions - The box after the value inside its `<dd>`, holding the `actions` slot.
28
37
  * @csspart label - The `<dt>`, holding the label.
29
38
  * @csspart value - The `<dd>`, holding the value.
39
+ *
40
+ * @cssstate several - The values are several `<dd>` elements of your own, so the item draws no `value` part.
30
41
  */
31
42
  export declare class HelixHeadlessDescriptionListItem extends HelixElement {
32
43
  /**
@@ -37,13 +48,20 @@ export declare class HelixHeadlessDescriptionListItem extends HelixElement {
37
48
  * that varies and is often more than text.
38
49
  */
39
50
  label: string;
51
+ /**
52
+ * Says the values are several `<dd>` elements of your own, so the item
53
+ * draws no `<dd>` of its own around them, on the server too. Without it the
54
+ * item finds them once it runs, and the served markup wraps them until then.
55
+ */
56
+ several: boolean;
40
57
  /**
41
58
  * Whether the values are the consumer's own `<dd>` elements, which the item
42
- * then does not wrap. Unknown on a server and while hydrating, where the
43
- * item draws its own.
59
+ * then does not wrap: `several`, or `<dd>` children found once it runs.
60
+ * Unknown on a server and while hydrating, where `several` decides.
44
61
  */
45
- private get several();
62
+ private get ownValues();
46
63
  protected firstUpdated(changed: PropertyValues): void;
64
+ protected updated(changed: PropertyValues): void;
47
65
  protected render(): TemplateResult;
48
66
  /** A value arriving or leaving can change whether the item wraps them. */
49
67
  private readonly handleSlotChange;
@@ -11,28 +11,38 @@ let HelixHeadlessDescriptionListItem = class HelixHeadlessDescriptionListItem ex
11
11
  constructor() {
12
12
  super(...arguments);
13
13
  this.label = '';
14
+ this.several = false;
14
15
  this.handleSlotChange = () => {
15
16
  this.requestUpdate();
16
17
  };
17
18
  }
18
- get several() {
19
- return this.knownChildren.some((child) => child.localName === 'dd');
19
+ get ownValues() {
20
+ return this.several || this.knownChildren.some((child) => child.localName === 'dd');
20
21
  }
21
22
  firstUpdated(changed) {
22
23
  super.firstUpdated(changed);
23
24
  this.finishHydration();
24
25
  }
26
+ updated(changed) {
27
+ super.updated(changed);
28
+ this.toggleState('several', this.ownValues);
29
+ }
25
30
  render() {
26
31
  const label = html `<dt part="label"><slot name="label">${this.label}</slot></dt>`;
27
- return this.several
32
+ return this.ownValues
28
33
  ? html `${label}<slot @slotchange=${this.handleSlotChange}></slot>`
29
34
  : html `${label}
30
- <dd part="value"><slot @slotchange=${this.handleSlotChange}></slot></dd>`;
35
+ <dd part="value"><slot @slotchange=${this.handleSlotChange}></slot><span part="actions"
36
+ ><slot name="actions"></slot></span
37
+ ></dd>`;
31
38
  }
32
39
  };
33
40
  __decorate([
34
41
  property()
35
42
  ], HelixHeadlessDescriptionListItem.prototype, "label", void 0);
43
+ __decorate([
44
+ property({ type: Boolean })
45
+ ], HelixHeadlessDescriptionListItem.prototype, "several", void 0);
36
46
  HelixHeadlessDescriptionListItem = __decorate([
37
47
  customElement('helix-headless-description-list-item')
38
48
  ], HelixHeadlessDescriptionListItem);
@@ -9,12 +9,22 @@ import { type PropertyValues, type TemplateResult } from 'lit';
9
9
  * rendered element. The semantics are then in the server-rendered markup, with
10
10
  * no attribute written by script after the element connects.
11
11
  *
12
- * Set `announced` for a line that divides one thing from another, and it is
13
- * read as a separator, named by any content set into it.
12
+ * **The line is a separator**, as `<hr>` is, and as Radix Separator, React
13
+ * Aria Separator, and Web Awesome's divider are. It is named by any content
14
+ * set into it, so a screen reader says "Or, separator" where you wrote "Or" on
15
+ * the line. Set `decorative` on a rule that separates nothing, such as one
16
+ * under a heading or between the facts of a byline, and it leaves the
17
+ * accessibility tree.
14
18
  *
15
- * Use `orientation="vertical"` between items on one line, such as inside a
16
- * toolbar. A vertical divider stretches to fit its flex parent and sets no
17
- * height of its own.
19
+ * Use `orientation="vertical"` between items on one line. A vertical divider
20
+ * stretches to fit its flex parent and sets no height of its own.
21
+ *
22
+ * **Inside a toolbar it runs across the toolbar** without being told: vertical
23
+ * in a horizontal toolbar and horizontal in a vertical one, with
24
+ * `aria-orientation` to match, as React Aria's separator does inside a
25
+ * toolbar. Inside means a child of Toolbar or of the page's own
26
+ * `role="toolbar"`. An `orientation` you write still wins. A server cannot see
27
+ * the toolbar, so the turn arrives with hydration, inside the shadow root.
18
28
  *
19
29
  * @since 0.1.0
20
30
  * @status stable
@@ -26,27 +36,44 @@ import { type PropertyValues, type TemplateResult } from 'lit';
26
36
  *
27
37
  * @csspart content - The content set into the line.
28
38
  * @csspart line - The line, or each half of it when content is set into it.
39
+ *
40
+ * @cssstate vertical - The line runs vertically: `orientation="vertical"`, or no `orientation` inside a horizontal toolbar.
29
41
  */
30
42
  export declare class HelixHeadlessDivider extends HelixElement {
31
43
  /**
32
- * Whether screen readers announce the line as a separator.
33
- *
34
- * Off by default, and out of the accessibility tree. Most rules on a page
35
- * separate nothing: they underline a heading or close a section that space
36
- * had already closed, and announcing every one as a separator is noise a
37
- * screen-reader user has to walk past.
44
+ * Whether screen readers announce the line as a separator, which they now do
45
+ * by default.
38
46
  *
39
- * An opt-in, not a `decorative` opt-out, because a boolean attribute cannot
40
- * be turned off: `decorative="false"` parses as `true`, which would put the
41
- * quiet default out of reach from HTML and leave it settable only as a
42
- * property. An opt-in is absent by default, which every reflected property
43
- * here has to be.
47
+ * It dates from when the line was decorative by default. It is still read,
48
+ * and it wins over `decorative`, so a divider written with it stays a
49
+ * separator.
44
50
  */
45
51
  announced: boolean;
52
+ /**
53
+ * Takes the line out of the accessibility tree, for a rule that separates
54
+ * nothing: one under a heading, or between the facts of a byline.
55
+ *
56
+ * Absent, the line is a separator, as `<hr>` is. Radix Separator's opt-out
57
+ * has the same name. It turns the role off because a boolean attribute that
58
+ * is on by default cannot be turned off from HTML.
59
+ */
60
+ decorative: boolean;
46
61
  /**
47
62
  * The direction the line runs: `horizontal` or `vertical`.
63
+ *
64
+ * Unset is horizontal, or across the toolbar the divider sits in.
48
65
  */
49
66
  orientation?: 'horizontal' | 'vertical';
67
+ /**
68
+ * The direction the line is drawn and announced in: `orientation`, else
69
+ * across the toolbar around it, else horizontal.
70
+ *
71
+ * The toolbar is read only where the tree is known, never while hydrating
72
+ * what a server sent, whose render has to be the server's.
73
+ */
74
+ private get drawn();
75
+ /** Reads the toolbar again when the divider moves into or out of one. */
76
+ connectedCallback(): void;
50
77
  /**
51
78
  * Marks the middle region when nothing has been set into it.
52
79
  *
@@ -59,6 +86,8 @@ export declare class HelixHeadlessDivider extends HelixElement {
59
86
  * attribute written onto the host is a change to markup the consumer rendered.
60
87
  */
61
88
  private markEmpty;
89
+ protected willUpdate(changed: PropertyValues): void;
90
+ protected firstUpdated(changed: PropertyValues): void;
62
91
  protected updated(changed: PropertyValues): void;
63
92
  protected render(): TemplateResult;
64
93
  }