@fusion.dev/helix-headless 0.0.0-dev → 0.0.3

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 (210) hide show
  1. package/custom-elements.json +4513 -4483
  2. package/dist/accordion/item/accordion-item.d.ts +13 -15
  3. package/dist/accordion/item/accordion-item.js +15 -17
  4. package/dist/announcement/root/announcement-root.d.ts +7 -25
  5. package/dist/announcement/root/announcement-root.js +7 -20
  6. package/dist/app-header/root/app-header-root.d.ts +10 -17
  7. package/dist/app-header/root/app-header-root.js +9 -18
  8. package/dist/avatar/group/avatar-group.d.ts +10 -19
  9. package/dist/avatar/group/avatar-group.js +12 -17
  10. package/dist/avatar/root/avatar-root.d.ts +8 -8
  11. package/dist/avatar/root/avatar-root.js +19 -20
  12. package/dist/badge/root/badge-root.d.ts +6 -6
  13. package/dist/badge/root/badge-root.js +13 -13
  14. package/dist/bar-chart/root/bar-chart-root.d.ts +21 -29
  15. package/dist/bar-chart/root/bar-chart-root.js +42 -57
  16. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +12 -18
  17. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +13 -16
  18. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +9 -28
  19. package/dist/breadcrumbs/root/breadcrumbs-root.js +9 -28
  20. package/dist/button/root/button-root.d.ts +84 -94
  21. package/dist/button/root/button-root.js +82 -92
  22. package/dist/callout/root/callout-root.d.ts +4 -5
  23. package/dist/carousel/root/carousel-root.d.ts +59 -71
  24. package/dist/carousel/root/carousel-root.js +73 -101
  25. package/dist/chat/composer/chat-composer.d.ts +29 -33
  26. package/dist/chat/composer/chat-composer.js +40 -44
  27. package/dist/chat/message/chat-message.d.ts +25 -25
  28. package/dist/chat/message/chat-message.js +26 -26
  29. package/dist/chat/root/chat-root.d.ts +28 -41
  30. package/dist/chat/root/chat-root.js +27 -40
  31. package/dist/checkbox/root/checkbox-root.d.ts +10 -12
  32. package/dist/checkbox/root/checkbox-root.js +29 -35
  33. package/dist/checkbox-group/root/checkbox-group-root.d.ts +32 -45
  34. package/dist/checkbox-group/root/checkbox-group-root.js +53 -79
  35. package/dist/code-block/root/code-block-root.d.ts +3 -4
  36. package/dist/code-block/root/code-block-root.js +8 -12
  37. package/dist/color-input/root/color-input-root.d.ts +36 -37
  38. package/dist/color-input/root/color-input-root.js +29 -34
  39. package/dist/color-picker/color.d.ts +7 -8
  40. package/dist/color-picker/color.js +7 -8
  41. package/dist/color-picker/root/color-picker-root.d.ts +55 -57
  42. package/dist/color-picker/root/color-picker-root.js +60 -64
  43. package/dist/combobox/root/combobox-root.d.ts +53 -58
  44. package/dist/combobox/root/combobox-root.js +85 -94
  45. package/dist/command/root/command-root.d.ts +8 -8
  46. package/dist/command/root/command-root.js +29 -33
  47. package/dist/copy-button/root/copy-button-root.d.ts +21 -24
  48. package/dist/copy-button/root/copy-button-root.js +25 -35
  49. package/dist/data-table/root/data-table-root.d.ts +77 -76
  50. package/dist/data-table/root/data-table-root.js +95 -84
  51. package/dist/data-table/root/order.d.ts +2 -2
  52. package/dist/data-table/root/order.js +1 -3
  53. package/dist/date-input/root/date-input-root.d.ts +88 -93
  54. package/dist/date-input/root/date-input-root.js +147 -158
  55. package/dist/date-picker/root/date-picker-root.d.ts +75 -83
  56. package/dist/date-picker/root/date-picker-root.js +120 -143
  57. package/dist/dialog/root/dialog-root.d.ts +41 -24
  58. package/dist/dialog/root/dialog-root.js +47 -24
  59. package/dist/divider/root/divider-root.d.ts +5 -6
  60. package/dist/divider/root/divider-root.js +4 -5
  61. package/dist/donut-chart/root/donut-chart-root.d.ts +22 -25
  62. package/dist/donut-chart/root/donut-chart-root.js +37 -51
  63. package/dist/drawer/root/drawer-root.d.ts +24 -29
  64. package/dist/drawer/root/drawer-root.js +15 -22
  65. package/dist/drilldown/item/drilldown-item.d.ts +14 -14
  66. package/dist/drilldown/item/drilldown-item.js +24 -26
  67. package/dist/drilldown/root/drilldown-root.d.ts +8 -10
  68. package/dist/drilldown/root/drilldown-root.js +6 -7
  69. package/dist/element-events.generated.js +1 -1
  70. package/dist/file-input/root/file-input-root.d.ts +20 -24
  71. package/dist/file-input/root/file-input-root.js +42 -57
  72. package/dist/format-date/root/format-date-root.js +1 -1
  73. package/dist/heatmap/root/buckets.d.ts +8 -8
  74. package/dist/heatmap/root/buckets.js +8 -8
  75. package/dist/heatmap/root/heatmap-root.d.ts +57 -63
  76. package/dist/heatmap/root/heatmap-root.js +72 -83
  77. package/dist/icon/root/icon-root.d.ts +4 -4
  78. package/dist/icon/root/icon-root.js +9 -9
  79. package/dist/icon-button/root/icon-button-root.d.ts +4 -6
  80. package/dist/icon-button/root/icon-button-root.js +4 -6
  81. package/dist/image/root/image-root.d.ts +49 -59
  82. package/dist/image/root/image-root.js +55 -65
  83. package/dist/index.d.ts +5 -5
  84. package/dist/index.js +5 -5
  85. package/dist/input/root/input-root.d.ts +61 -85
  86. package/dist/input/root/input-root.js +79 -106
  87. package/dist/kbd/root/kbd-root.d.ts +8 -7
  88. package/dist/kbd/root/kbd-root.js +71 -11
  89. package/dist/legend/root/legend-root.d.ts +1 -1
  90. package/dist/legend/root/legend-root.js +4 -5
  91. package/dist/line-chart/root/line-chart-root.d.ts +26 -30
  92. package/dist/line-chart/root/line-chart-root.js +10 -10
  93. package/dist/list/item/list-item.d.ts +14 -18
  94. package/dist/list/item/list-item.js +18 -22
  95. package/dist/list/root/list-root.d.ts +4 -4
  96. package/dist/list/root/list-root.js +3 -3
  97. package/dist/listbox/root/listbox-root.d.ts +31 -58
  98. package/dist/listbox/root/listbox-root.js +66 -109
  99. package/dist/megamenu/root/megamenu-root.d.ts +34 -35
  100. package/dist/megamenu/root/megamenu-root.js +53 -58
  101. package/dist/menu/item/menu-item.d.ts +39 -53
  102. package/dist/menu/item/menu-item.js +50 -64
  103. package/dist/menu/root/menu-root.d.ts +30 -40
  104. package/dist/menu/root/menu-root.js +49 -82
  105. package/dist/meter/root/meter-root.d.ts +49 -53
  106. package/dist/meter/root/meter-root.js +22 -27
  107. package/dist/navigation/root/navigation-root.js +11 -19
  108. package/dist/notifications/notification/notification.d.ts +16 -22
  109. package/dist/notifications/notification/notification.js +21 -27
  110. package/dist/notifications/root/notifications-root.d.ts +31 -39
  111. package/dist/notifications/root/notifications-root.js +41 -52
  112. package/dist/number-input/root/number-input-root.d.ts +31 -33
  113. package/dist/number-input/root/number-input-root.js +37 -39
  114. package/dist/option/root/option-root.d.ts +73 -74
  115. package/dist/option/root/option-root.js +62 -64
  116. package/dist/outline/root/outline-root.d.ts +38 -44
  117. package/dist/outline/root/outline-root.js +66 -82
  118. package/dist/pagination/root/pagination-root.d.ts +87 -92
  119. package/dist/pagination/root/pagination-root.js +116 -123
  120. package/dist/pagination/size/pagination-size.d.ts +31 -50
  121. package/dist/pagination/size/pagination-size.js +35 -55
  122. package/dist/pagination/summary/pagination-summary.d.ts +12 -12
  123. package/dist/pagination/summary/pagination-summary.js +18 -18
  124. package/dist/pin-input/root/pin-input-root.d.ts +53 -70
  125. package/dist/pin-input/root/pin-input-root.js +74 -94
  126. package/dist/popover/root/popover-root.d.ts +15 -20
  127. package/dist/popover/root/popover-root.js +19 -36
  128. package/dist/progress/root/progress-root.d.ts +12 -14
  129. package/dist/progress/root/progress-root.js +22 -25
  130. package/dist/qr-code/root/qr-code-root.d.ts +11 -11
  131. package/dist/qr-code/root/qr-code-root.js +12 -14
  132. package/dist/radio/group/radio-group.js +19 -26
  133. package/dist/radio/root/radio-root.d.ts +12 -13
  134. package/dist/radio/root/radio-root.js +12 -13
  135. package/dist/rating/root/rating-root.d.ts +25 -30
  136. package/dist/rating/root/rating-root.js +43 -50
  137. package/dist/scroll-area/root/scroll-area-root.d.ts +11 -14
  138. package/dist/scroll-area/root/scroll-area-root.js +39 -33
  139. package/dist/select/root/select-root.d.ts +7 -12
  140. package/dist/select/root/select-root.js +40 -55
  141. package/dist/slider/root/slider-root.d.ts +53 -60
  142. package/dist/slider/root/slider-root.js +74 -85
  143. package/dist/sparkline/root/sparkline-root.d.ts +43 -47
  144. package/dist/sparkline/root/sparkline-root.js +23 -32
  145. package/dist/speed-dial/item/speed-dial-item.d.ts +6 -6
  146. package/dist/speed-dial/item/speed-dial-item.js +9 -9
  147. package/dist/speed-dial/root/speed-dial-root.d.ts +21 -25
  148. package/dist/speed-dial/root/speed-dial-root.js +32 -40
  149. package/dist/splitter/root/splitter-root.d.ts +98 -111
  150. package/dist/splitter/root/splitter-root.js +96 -123
  151. package/dist/stat/root/stat-root.d.ts +2 -7
  152. package/dist/stat/root/stat-root.js +0 -5
  153. package/dist/steps/step/step.d.ts +19 -24
  154. package/dist/steps/step/step.js +27 -32
  155. package/dist/switch/root/switch-root.js +2 -2
  156. package/dist/table/column/table-column.d.ts +54 -60
  157. package/dist/table/column/table-column.js +95 -68
  158. package/dist/table/root/table-root.d.ts +5 -6
  159. package/dist/table/root/table-root.js +7 -10
  160. package/dist/tabs/panel/tab-panel.d.ts +21 -25
  161. package/dist/tabs/panel/tab-panel.js +25 -29
  162. package/dist/tabs/root/tabs-root.d.ts +25 -34
  163. package/dist/tabs/root/tabs-root.js +22 -28
  164. package/dist/tabs/tab/tab.d.ts +12 -12
  165. package/dist/tabs/tab/tab.js +19 -20
  166. package/dist/textarea/root/textarea-root.d.ts +36 -36
  167. package/dist/textarea/root/textarea-root.js +43 -47
  168. package/dist/time-input/root/time-input-root.d.ts +58 -68
  169. package/dist/time-input/root/time-input-root.js +62 -77
  170. package/dist/time-picker/root/time-picker-root.d.ts +73 -79
  171. package/dist/time-picker/root/time-picker-root.js +72 -84
  172. package/dist/timeline/item/timeline-item.d.ts +8 -11
  173. package/dist/timeline/item/timeline-item.js +8 -11
  174. package/dist/timeline/root/timeline-root.d.ts +5 -7
  175. package/dist/timeline/root/timeline-root.js +5 -7
  176. package/dist/toast/item/toast-item.d.ts +9 -27
  177. package/dist/toast/item/toast-item.js +19 -41
  178. package/dist/toast/root/toast-root.d.ts +10 -14
  179. package/dist/toast/root/toast-root.js +4 -5
  180. package/dist/toggle/group/toggle-group.d.ts +6 -15
  181. package/dist/toggle/group/toggle-group.js +21 -36
  182. package/dist/toggle/root/toggle-root.d.ts +26 -27
  183. package/dist/toggle/root/toggle-root.js +30 -31
  184. package/dist/toolbar/root/toolbar-root.d.ts +7 -10
  185. package/dist/toolbar/root/toolbar-root.js +10 -14
  186. package/dist/tooltip/root/tooltip-root.d.ts +52 -59
  187. package/dist/tooltip/root/tooltip-root.js +98 -93
  188. package/dist/tour/root/tour-root.d.ts +19 -23
  189. package/dist/tour/root/tour-root.js +31 -41
  190. package/dist/tour/stop/tour-stop.d.ts +14 -15
  191. package/dist/tour/stop/tour-stop.js +31 -34
  192. package/dist/tree/item/tree-item.d.ts +30 -35
  193. package/dist/tree/item/tree-item.js +43 -55
  194. package/dist/tree/root/tree-root.d.ts +7 -10
  195. package/dist/tree/root/tree-root.js +33 -42
  196. package/dist/trend/root/trend-root.d.ts +3 -5
  197. package/dist/trend/root/trend-root.js +5 -9
  198. package/dist/video/root/video-root.d.ts +100 -124
  199. package/dist/video/root/video-root.js +142 -176
  200. package/dist/video-playlist/item/video-playlist-item.d.ts +16 -16
  201. package/dist/video-playlist/item/video-playlist-item.js +24 -24
  202. package/dist/video-playlist/menu/video-playlist-menu.d.ts +5 -8
  203. package/dist/video-playlist/menu/video-playlist-menu.js +20 -29
  204. package/dist/video-playlist/root/video-playlist-root.d.ts +16 -11
  205. package/dist/video-playlist/root/video-playlist-root.js +21 -25
  206. package/dist/virtual-list/root/virtual-list-root.d.ts +8 -12
  207. package/dist/virtual-list/root/virtual-list-root.js +11 -16
  208. package/jsx.d.ts +9797 -12561
  209. package/package.json +6 -6
  210. package/vue.d.ts +2684 -3228
@@ -11,13 +11,11 @@ import { property, state } from 'lit/decorators.js';
11
11
  * @summary Links to the headings on this page, marking the one being read.
12
12
  *
13
13
  * @description
14
- * A table of contents, named for the job. Three of the obvious names are taken
15
- * by things that are not this: `Outline` is a CSS property and the focus ring's
16
- * whole vocabulary, `Contents` is `display: contents` and the `content` part
17
- * half this library renders, and `TableOfContents` would sit beside `Table` and
18
- * `TableColumn` and read as a third part of that family. `Outline` sits beside
19
- * `Navigation`, which is the same job at the other scale: one navigates a site, the
20
- * other navigates a document.
14
+ * A table of contents, named for the job. It sits beside `Navigation`, which is
15
+ * the same job at the other scale: one navigates a site, the other navigates a
16
+ * document. `Contents` and `TableOfContents` are both taken by something else,
17
+ * `display: contents` and the `content` part in one case and the `Table` family
18
+ * in the other.
21
19
  *
22
20
  * **The links are the consumer's own anchors**, the same as `Navigation`. A router
23
21
  * renders its own `<a>` and cannot render one inside this shadow root, and the
@@ -67,18 +65,6 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
67
65
  indicator: () => this.renderRoot?.querySelector('[part="indicator"]'),
68
66
  surface: () => this.renderRoot?.querySelector('[part="nav"]'),
69
67
  });
70
- /**
71
- * Accessible name for the navigation.
72
- */
73
- this.label = 'On this page';
74
- /**
75
- * How far below the top of the window a heading counts as reached, in pixels.
76
- *
77
- * The reading line. A page with a sticky masthead sets this to its height, or
78
- * a little more: without it the current section changes as a heading slides
79
- * under the chrome rather than as it reaches the top of what can be seen.
80
- */
81
- this.offset = 0;
82
68
  /**
83
69
  * How a click on one of these links travels to its section.
84
70
  *
@@ -101,6 +87,18 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
101
87
  * JavaScript rather than CSS decides.
102
88
  */
103
89
  this.behavior = 'auto';
90
+ /**
91
+ * Accessible name for the navigation.
92
+ */
93
+ this.label = 'On this page';
94
+ /**
95
+ * How far below the top of the window a heading counts as reached, in pixels.
96
+ *
97
+ * The reading line. A page with a sticky masthead sets this to its height, or
98
+ * a little more: without it the current section changes as a heading slides
99
+ * under the chrome rather than as it reaches the top of what can be seen.
100
+ */
101
+ this.offset = 0;
104
102
  /**
105
103
  * What `current` reports, which only `mark` writes.
106
104
  */
@@ -111,9 +109,6 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
111
109
  * The two things an `IntersectionObserver` cannot see, and one listener for
112
110
  * both.
113
111
  *
114
- * This component's own note said the observer keeps the marker honest without
115
- * a scroll listener. It was wrong twice.
116
- *
117
112
  * *At the bottom*, arriving at the end of a page changes no intersection: a
118
113
  * short last section is fully visible long before the final pixel, so its
119
114
  * ratio reached 1 and stopped moving. Nothing fires for the scroll that ends
@@ -128,13 +123,12 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
128
123
  * heading has not crossed yet, and no callback follows for the rest of the
129
124
  * way.
130
125
  *
131
- * There was a listener already, added for the first of those, and it compared
132
- * two numbers and marked only when the answer *changed*. That was too clever
133
- * by half: it fixed the bottom and could not fix the settle. Marking once per
134
- * animation frame while a scroll is happening covers both and every other case
135
- * of the same shape, and the cost is what `mark()` costs, a `getBoundingClientRect`
136
- * per section on frames a reader is already scrolling through. Passive, and
137
- * coalesced to one call per frame however many events arrive.
126
+ * Marking once per animation frame while a scroll is happening covers both,
127
+ * where a listener that marks only when its own comparison changes fixes the
128
+ * bottom and cannot fix the settle. The cost is what `mark()` costs, a
129
+ * `getBoundingClientRect` per section on frames a reader is already scrolling
130
+ * through. Passive, and coalesced to one call per frame however many events
131
+ * arrive.
138
132
  */
139
133
  this.handleScroll = () => {
140
134
  if (this.frame !== 0) {
@@ -171,9 +165,7 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
171
165
  * and wrong when they have said where they are going: traveling to the
172
166
  * fifth section passes the second, third and fourth, each became current
173
167
  * for a frame or two on the way, and the mark stepped down the list one
174
- * item at a time instead of making the journey. Asked for as "it stops at
175
- * each item rather than seamlessly moving", which is exactly what it was
176
- * doing.
168
+ * item at a time instead of making the journey.
177
169
  *
178
170
  * Suppressed for any click on one of these links, not only the ones this
179
171
  * component scrolls itself: a consumer with `scroll-behavior: smooth` on
@@ -298,10 +290,10 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
298
290
  * thing being read, and the marker stayed on the second. The last item in a
299
291
  * contents list was unreachable by scrolling.
300
292
  *
301
- * The same fault has no mirror at the top, where `passed` is empty and the
302
- * first section is already the fallback. Asked, because the shape suggests
303
- * one: the first heading's top starts *at* the line rather than below it,
304
- * so there is nothing for it to fail to reach.
293
+ * There is no mirror of it at the top: `passed` is empty there and the first
294
+ * section is already the fallback, and the first heading's top starts *at*
295
+ * the line rather than below it, so there is nothing for it to fail to
296
+ * reach.
305
297
  *
306
298
  * What this cannot do is tell trailing sections apart. If the last three
307
299
  * share the final screenful, none of them can reach the line and the page
@@ -321,12 +313,10 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
321
313
  link.removeAttribute('aria-current');
322
314
  }
323
315
  }
324
- /* And say so, which it did not.
325
- *
326
- * `reading` is derived from scroll position and was announced to nobody, so
327
- * a consumer syncing a URL hash to the reading position had to poll for it:
328
- * the one fact this component computes that nothing else on the page can,
329
- * and the only way out of it was a `MutationObserver` on the anchors.
316
+ /* And say so. `reading` is derived from scroll position, which is the one
317
+ * fact this component computes that nothing else on the page can, so a
318
+ * consumer syncing a URL hash to it has no other way in short of a
319
+ * `MutationObserver` on the anchors.
330
320
  *
331
321
  * Only on a change, because this runs from a scroll frame and an event per
332
322
  * frame is not a signal, it is a firehose. */
@@ -343,16 +333,16 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
343
333
  * leaves the position a hair under the height at the very bottom and an exact
344
334
  * comparison never fires.
345
335
  *
346
- * **All three numbers off the same element**, which this did not do: it added
347
- * `scrollY` and `innerHeight`, both of the window, and compared them against
348
- * `documentElement.scrollHeight`. Those are one coordinate system only while
349
- * the viewport is what scrolls, and the body takes that job the moment it
350
- * becomes a scroll container. Measured on a page whose body is
336
+ * **All three numbers off the same element.** Adding the window's `scrollY`
337
+ * and `innerHeight` and comparing them against
338
+ * `documentElement.scrollHeight` mixes two coordinate systems, which agree
339
+ * only while the viewport is what scrolls, and the body takes that job the
340
+ * moment it becomes a scroll container. Measured on a page whose body is
351
341
  * `overflow: clip visible`, which is a pair CSS resolves by making the
352
342
  * `visible` axis `auto`: `documentElement.scrollTop` read 1126 at the bottom
353
343
  * of the page and `window.scrollY` read 240, so a contents rail never learned
354
- * it had reached the end and its last item stayed unreachable. That page is
355
- * this library's own base layer.
344
+ * it had reached the end and its last item stayed unreachable. This library's
345
+ * own base layer produces exactly that page.
356
346
  *
357
347
  * `clientHeight` rather than `innerHeight` for the same reason, and because it
358
348
  * is the one that excludes a scrollbar, which is what `scrollHeight` is
@@ -368,15 +358,14 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
368
358
  /**
369
359
  * Gives every section the same reading line the marker uses.
370
360
  *
371
- * `offset` described where the top of the readable area is and was read by
372
- * exactly one thing, the marker. Click a link and the browser put the heading
373
- * against the very top of the window, underneath the sticky masthead whose
374
- * height the consumer had just finished measuring for us. So the component
375
- * knew about the chrome when deciding what you were reading and forgot about
376
- * it when taking you somewhere, which is the same number meaning two things.
361
+ * `offset` says where the top of the readable area is, so it has to govern
362
+ * where a click lands as much as what the marker calls current. Read by the
363
+ * marker alone, a click puts the heading against the very top of the window
364
+ * and underneath the sticky masthead the consumer measured the offset from,
365
+ * which is the same number meaning two things.
377
366
  *
378
367
  * `scroll-margin-block-start` rather than an interception, because it is the
379
- * property the platform provides for exactly this and the UA honours it on
368
+ * property the platform provides for exactly this and the UA honors it on
380
369
  * ordinary fragment navigation, on `scrollIntoView`, and on a browser
381
370
  * restoring a position. Nothing has to be taken over to get it.
382
371
  *
@@ -398,18 +387,17 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
398
387
  * The thresholds are what make the trigger frequent enough: an observer fires
399
388
  * on entering and leaving, and a long section scrolled slowly crosses neither
400
389
  * for a long time. Asking for a callback at each quarter of visibility is
401
- * cheap and keeps the marker honest without a scroll listener.
390
+ * cheap. It is still only a trigger: see `handleScroll` for the two cases no
391
+ * intersection can see.
402
392
  */
403
393
  watch() {
404
394
  this.observer?.disconnect();
405
- /* Nothing to watch yet is not nothing to watch ever.
406
- *
407
- * This returned when no href resolved at first update, having already
408
- * disconnected the observer, and only `slotchange` ever called it again: a
409
- * page whose sections arrive after the nav does, which is every page that
410
- * renders its content asynchronously, left the component dead for good. The
411
- * observer is left disconnected either way, so re-running is the whole of
412
- * the fix, and `updated` re-runs it while there is nothing to watch. */
395
+ /* Nothing to watch yet is not nothing to watch ever. A page whose sections
396
+ * arrive after the nav does, which is every page rendering its content
397
+ * asynchronously, resolves no href at first update, and returning here
398
+ * without leaving a way back kills the component for the life of the page.
399
+ * `updated` re-runs this while `observer` is undefined, which is why the
400
+ * field is cleared rather than left holding a disconnected observer. */
413
401
  if (this.sections.length === 0) {
414
402
  this.observer = undefined;
415
403
  return;
@@ -435,11 +423,9 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
435
423
  this.observer = undefined;
436
424
  this.resize?.disconnect();
437
425
  this.resize = undefined;
438
- /* The landing timer, which nothing was clearing. It holds a closure over
439
- this element for 1.2 seconds after it leaves the document and then
440
- touches it, which on a route change is a write to a tree nobody is
441
- looking at. Every other subscription here was already torn down, which is
442
- what made this one easy to miss. */
426
+ /* The landing timer holds a closure over this element for 1.2 seconds after
427
+ it leaves the document and then touches it, which on a route change is a
428
+ write to a tree nobody is looking at. */
443
429
  clearTimeout(this.landed);
444
430
  this.landed = undefined;
445
431
  }
@@ -447,15 +433,13 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
447
433
  super.connectedCallback();
448
434
  this.addEventListener('click', this.handleClick);
449
435
  globalThis.addEventListener?.('scroll', this.handleScroll, { passive: true });
450
- /* Both observers are rebuilt on reconnection, and neither was.
451
- *
452
- * They were created in `firstUpdated`, which runs once for the life of the
453
- * element, and torn down in `disconnectedCallback`, which runs every time it
454
- * moves. So a outline moved in the DOM, which a framework does on any
455
- * reorder, came back permanently frozen: `aria-current`, `current` and the
456
- * traveling mark all stopped for the rest of the page's life with nothing
457
- * to say why. Guarded on `hasUpdated`, because the first connection happens
458
- * before the first render and there is nothing to watch yet. */
436
+ /* Both observers are rebuilt on reconnection. `firstUpdated` runs once for
437
+ * the life of the element and `disconnectedCallback` runs every time it
438
+ * moves, so without this an outline moved in the DOM, which a framework does
439
+ * on any reorder, comes back permanently frozen: `aria-current`, `current`
440
+ * and the traveling mark all stop for the rest of the page's life with
441
+ * nothing to say why. Guarded on `hasUpdated`, because the first connection
442
+ * happens before the first render and there is nothing to watch yet. */
459
443
  if (this.hasUpdated) {
460
444
  this.watch();
461
445
  this.resize = new ResizeObserver(() => this.indicator.place());
@@ -501,15 +485,15 @@ let HelixHeadlessOutline = class HelixHeadlessOutline extends HelixElement {
501
485
  </nav>`;
502
486
  }
503
487
  };
488
+ __decorate([
489
+ property()
490
+ ], HelixHeadlessOutline.prototype, "behavior", void 0);
504
491
  __decorate([
505
492
  property()
506
493
  ], HelixHeadlessOutline.prototype, "label", void 0);
507
494
  __decorate([
508
495
  property({ type: Number })
509
496
  ], HelixHeadlessOutline.prototype, "offset", void 0);
510
- __decorate([
511
- property()
512
- ], HelixHeadlessOutline.prototype, "behavior", void 0);
513
497
  __decorate([
514
498
  state()
515
499
  ], HelixHeadlessOutline.prototype, "reading", void 0);
@@ -40,13 +40,12 @@ import { type PropertyValues, type TemplateResult } from 'lit';
40
40
  * result that has not changed. A consumer driving the view has to be able to
41
41
  * hear that without being told an answer changed.
42
42
  *
43
- * **The count and the page-size control are their own elements.** They were
44
- * briefly a part and a pair of slots in here, and a slot can only offer one
45
- * place: at one end of one row, in one order, on one axis. `Pagination.Summary`
46
- * and `Pagination.Size` sit beside this one instead, so the direction and the
47
- * order of a footer are the consumer's, which is what they were always going to
48
- * want. `total` and `page-size` stay here for the arithmetic below and nothing
49
- * else.
43
+ * **The count and the page-size control are their own elements.** A slot can
44
+ * only offer one place: at one end of one row, in one order, on one axis.
45
+ * `Pagination.Summary` and `Pagination.Size` sit beside this one instead, so
46
+ * the direction and the order of a footer are the consumer's, which is what
47
+ * they were always going to want. `total` and `page-size` stay here for the
48
+ * arithmetic below and nothing else.
50
49
  *
51
50
  * **A single page renders nothing.** A control offering one page offers no
52
51
  * navigation, and the row it sits in should close over it rather than hold a
@@ -56,16 +55,16 @@ import { type PropertyValues, type TemplateResult } from 'lit';
56
55
  * framework reports the difference; a custom state carries the same fact to a
57
56
  * stylesheet and none of that to the DOM.
58
57
  *
59
- * **And a page change is announced.** Nothing did: moving the page moves
60
- * `aria-current` onto a different element, and a screen reader does not announce
61
- * that, so a reader who pressed 5 heard the word "5" from the button they were
62
- * on and nothing at all about having arrived. A polite live region says where
63
- * they now are. It ships empty and is filled only on a change, because a region
64
- * populated as it enters the document announces itself on arrival.
58
+ * **And a page change is announced.** Moving the page moves `aria-current` onto
59
+ * a different element, which a screen reader does not announce, so a reader who
60
+ * pressed 5 hears the word "5" from the button they were on and nothing at all
61
+ * about having arrived. A polite live region says where they now are. It ships
62
+ * empty and is filled only on a change, because a region populated as it enters
63
+ * the document announces itself on arrival.
65
64
  *
66
- * `page` is the controlled property and `default-page` seeds one the element
67
- * owns. Naming `page` is a claim of ownership: the element announces and waits
68
- * to be told, which is what a consumer paging through a router already wants.
65
+ * `page` is what the element holds and `default-page` seeds it. A consumer
66
+ * paging through a router refuses `helix-navigate` and assigns their own, which
67
+ * is how they take the decision.
69
68
  *
70
69
  * @since 0.1.0
71
70
  * @status experimental
@@ -94,35 +93,25 @@ import { type PropertyValues, type TemplateResult } from 'lit';
94
93
  */
95
94
  export declare class HelixHeadlessPagination extends HelixElement {
96
95
  /**
97
- * How many pages there are in total.
98
- *
99
- * Clamped to at least one wherever it is read, so a result that has not
100
- * loaded yet renders a single page rather than an empty control that then
101
- * appears and pushes the layout down.
102
- *
103
- * Left unset where `total` and `page-size` are both given, since the two of
104
- * them already say it. A fallback rather than an override: writing this wins,
105
- * so there is never a question of which of two sources is current.
96
+ * How many pages to show at each end, whatever the current one is.
106
97
  */
107
- pages: number;
98
+ boundaries: number;
108
99
  /**
109
- * How many items there are across every page.
100
+ * Where the numbers are replaced by a reading of the two.
110
101
  *
111
- * What `pages` falls back to together with `page-size`. Unset is the common
112
- * case, where a consumer knows the page total and not the item total.
102
+ * A different structure rather than a different look, which is why it is
103
+ * here: the run of pages is gone and a single status line stands in its
104
+ * place. This is the shape a narrow screen wants, and the only shape possible
105
+ * where the total is large enough that no window over it is useful.
113
106
  *
114
- * Nothing is rendered from it. `Pagination.Summary` is what reads a total out
115
- * to a reader, and takes its own.
107
+ * Not reflected, for the reason `ends` is not: it decides what renders, so
108
+ * nothing has to select on it.
116
109
  */
117
- total: number;
110
+ compact: boolean;
118
111
  /**
119
- * How many items are on a page.
120
- *
121
- * Only arithmetic: this does not slice anything, because the component never
122
- * sees the items. It is what turns `total` into a page count, and nothing
123
- * else.
112
+ * Page to open on, where nothing declared one.
124
113
  */
125
- pageSize: number;
114
+ defaultPage: number;
126
115
  /**
127
116
  * Whether to offer a jump to the first and last pages.
128
117
  *
@@ -142,34 +131,28 @@ export declare class HelixHeadlessPagination extends HelixElement {
142
131
  * The page on show, one-based.
143
132
  *
144
133
  * An accessor pair, the same shape as the calendar's `month`. Reading gives
145
- * the page on show; writing declares it the consumer's, and `default-page`
146
- * seeds one the element owns.
134
+ * the page on show; writing sets it, and `default-page` seeds one the element
135
+ * keeps until somebody does.
147
136
  *
148
137
  * **Clamped on the way out, because "the page on show" is what it says it
149
- * gives.** It returned whatever had been written, so `default-page="99"` on a
150
- * ten-page result rendered page 10, marked page 10 with `aria-current`, and
151
- * reported 99. A consumer syncing their query from this read a page that does
152
- * not exist while the control in front of them said otherwise. Not a
138
+ * gives.** Returning whatever was written means `default-page="99"` on a
139
+ * ten-page result renders page 10, marks page 10 with `aria-current`, and
140
+ * reports 99, so a consumer syncing their query from this reads a page that
141
+ * does not exist while the control in front of them says otherwise. Not a
153
142
  * far-fetched value: it is a bookmarked link after the result shrank.
154
143
  *
155
144
  * Rounded here too, so `2.7` reads as the 2 it renders.
156
- *
157
- *
158
145
  */
159
146
  get page(): number;
160
147
  set page(next: number);
161
148
  /**
162
- * Page to open on, where nothing declared one.
163
- */
164
- defaultPage: number;
165
- /**
166
- * How many pages to show either side of the current one.
149
+ * Accessible name for the control that jumps to the first page.
167
150
  */
168
- siblings: number;
151
+ firstLabel: string;
169
152
  /**
170
- * How many pages to show at each end, whatever the current one is.
153
+ * Accessible name for a gap, with `{page}` filled in as where it goes.
171
154
  */
172
- boundaries: number;
155
+ gapLabel: string;
173
156
  /**
174
157
  * Address for a page, with `{page}` standing in for its number.
175
158
  *
@@ -178,22 +161,14 @@ export declare class HelixHeadlessPagination extends HelixElement {
178
161
  * one, and the back button works without the consumer wiring anything.
179
162
  */
180
163
  href: string;
181
- /**
182
- * Where the numbers are replaced by a reading of the two.
183
- *
184
- * A different structure rather than a different look, which is why it is
185
- * here: the run of pages is gone and a single status line stands in its
186
- * place. This is the shape a narrow screen wants, and the only shape possible
187
- * where the total is large enough that no window over it is useful.
188
- *
189
- * Not reflected, for the reason `ends` is not: it decides what renders, so
190
- * nothing has to select on it.
191
- */
192
- compact: boolean;
193
164
  /**
194
165
  * Accessible name for the navigation landmark.
195
166
  */
196
167
  label: string;
168
+ /**
169
+ * Accessible name for the control that jumps to the last page.
170
+ */
171
+ lastLabel: string;
197
172
  /**
198
173
  * Locale for the page numbers. Absent uses the runtime's own.
199
174
  *
@@ -208,39 +183,61 @@ export declare class HelixHeadlessPagination extends HelixElement {
208
183
  * different address from `?page=1234`.
209
184
  */
210
185
  locale: string;
186
+ /**
187
+ * Accessible name for the control that moves forward.
188
+ */
189
+ nextLabel: string;
211
190
  /**
212
191
  * Accessible name for one page, with `{page}` and `{pages}` filled in.
213
192
  */
214
193
  pageLabel: string;
215
194
  /**
216
- * The reading shown in `compact`, with `{page}` and `{pages}` filled in.
195
+ * How many pages there are in total.
217
196
  *
218
- * The word went: it read "Page 7 of 24" and the landmark it sits in is
219
- * already named "Pagination", so the noun was said twice to a screen reader
220
- * and took a third of the width from a control whose whole reason for
221
- * existing is that the row is narrow. The numbers are the reading.
197
+ * Clamped to at least one wherever it is read, so a result that has not
198
+ * loaded yet renders a single page rather than an empty control that then
199
+ * appears and pushes the layout down.
200
+ *
201
+ * Left unset where `total` and `page-size` are both given, since the two of
202
+ * them already say it. A fallback rather than an override: writing this wins,
203
+ * so there is never a question of which of two sources is current.
222
204
  */
223
- statusLabel: string;
205
+ pages: number;
224
206
  /**
225
- * Accessible name for the control that moves back.
207
+ * How many items are on a page.
208
+ *
209
+ * Only arithmetic: this does not slice anything, because the component never
210
+ * sees the items. It is what turns `total` into a page count, and nothing
211
+ * else.
226
212
  */
227
- previousLabel: string;
213
+ pageSize: number;
228
214
  /**
229
- * Accessible name for the control that moves forward.
215
+ * Accessible name for the control that moves back.
230
216
  */
231
- nextLabel: string;
217
+ previousLabel: string;
232
218
  /**
233
- * Accessible name for the control that jumps to the first page.
219
+ * How many pages to show either side of the current one.
234
220
  */
235
- firstLabel: string;
221
+ siblings: number;
236
222
  /**
237
- * Accessible name for the control that jumps to the last page.
223
+ * The reading shown in `compact`, with `{page}` and `{pages}` filled in.
224
+ *
225
+ * No noun: the landmark this sits in is already named "Pagination", so
226
+ * "Page 7 of 24" says it twice to a screen reader and takes a third of the
227
+ * width from a control whose whole reason for existing is that the row is
228
+ * narrow. The numbers are the reading.
238
229
  */
239
- lastLabel: string;
230
+ statusLabel: string;
240
231
  /**
241
- * Accessible name for a gap, with `{page}` filled in as where it goes.
232
+ * How many items there are across every page.
233
+ *
234
+ * What `pages` falls back to together with `page-size`. Unset is the common
235
+ * case, where a consumer knows the page total and not the item total.
236
+ *
237
+ * Nothing is rendered from it. `Pagination.Summary` is what reads a total out
238
+ * to a reader, and takes its own.
242
239
  */
243
- gapLabel: string;
240
+ total: number;
244
241
  /**
245
242
  * What the live region says, and nothing until the page has moved once.
246
243
  *
@@ -265,7 +262,7 @@ export declare class HelixHeadlessPagination extends HelixElement {
265
262
  * later and pushes the layout down.
266
263
  */
267
264
  private get count();
268
- /** The page on show. `page` does the clamping now; this is the older name. */
265
+ /** The page on show, which `page` has already clamped. */
269
266
  private get current();
270
267
  /**
271
268
  * Which pages to show, and where the runs break.
@@ -285,9 +282,8 @@ export declare class HelixHeadlessPagination extends HelixElement {
285
282
  * Asks to move, and reports whether the request stood.
286
283
  *
287
284
  * Announced before it is applied, so `preventDefault()` is a refusal and
288
- * nothing moves. In controlled mode nothing is written whatever the answer:
289
- * the consumer holds the page and this is the element telling them a reader
290
- * asked for another one.
285
+ * nothing moves. A consumer who holds the page refuses it and assigns their
286
+ * own.
291
287
  */
292
288
  private request;
293
289
  /**
@@ -333,17 +329,16 @@ export declare class HelixHeadlessPagination extends HelixElement {
333
329
  * at which it stops being possible. It would also make `Pagination` depend on
334
330
  * `Menu` and `Popover` for a case a button already covers.
335
331
  *
336
- * So it is announced rather than hidden, which is the change from when it was
337
- * a decoration: a control a reader can reach has to be in the tree, and the
338
- * label naming its destination is the whole affordance.
332
+ * So it is announced rather than hidden: a control a reader can reach has to
333
+ * be in the tree, and the label naming its destination is the whole
334
+ * affordance.
339
335
  */
340
336
  private renderGap;
341
337
  /**
342
338
  * Everything a step needs, computed once, so the markup below is only markup.
343
339
  *
344
- * Split out because the part name has to be a literal. `check:parts` reads
345
- * `part="name"` out of the source, so a computed one is a part the tooling
346
- * cannot see: nothing pairs it with its `@csspart` and a later rename takes
340
+ * Split out because the part name has to be a literal. A part name is read
341
+ * from the source, so a computed one is a part nothing can see: nothing pairs it with its `@csspart` and a later rename takes
347
342
  * the promise silently. With four controls and two shapes each that is eight
348
343
  * literals, and eight copies of the arithmetic behind them would be the
349
344
  * actual duplication. This is the arithmetic, written once.