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

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
@@ -28,10 +28,9 @@ const CARETLESS = new Set(['button', 'checkbox', 'color', 'file', 'image', 'rese
28
28
  * Whether the press was already the business of whatever it landed on.
29
29
  *
30
30
  * A toolbar holds anything, and some of what it holds uses the arrow keys for
31
- * itself. The handler below found the control the press came from and moved the
32
- * toolbar regardless, so an input in a toolbar could not be edited: pressing
33
- * ArrowRight to move the caret moved the focus to the next control instead, and
34
- * `preventDefault` meant the caret never moved at all.
31
+ * itself. Moving the toolbar regardless makes an input in a toolbar
32
+ * uneditable: ArrowRight moves focus to the next control, and `preventDefault`
33
+ * means the caret never moves at all.
35
34
  *
36
35
  * `composedPath()[0]` rather than `event.target`, which is retargeted to the
37
36
  * control's host at the shadow boundary and cannot tell a text field inside a
@@ -95,10 +94,9 @@ let HelixHeadlessToolbar = class HelixHeadlessToolbar extends HelixElement {
95
94
  * Gives the tab stop back to a control that still exists.
96
95
  *
97
96
  * `controls` excludes anything disabled or hidden, so disabling the control
98
- * holding the stop dropped it out of the list while every other control was
99
- * already at `-1`. The toolbar then had no tab stop at all and the keyboard
100
- * could not reach it again, from a change as ordinary as a Save button
101
- * disabling itself once the form is clean.
97
+ * holding the stop drops it out of the list while every other control is
98
+ * already at `-1`, leaving a toolbar the keyboard cannot reach at all. A Save
99
+ * button disabling itself once the form is clean is enough to do it.
102
100
  *
103
101
  * `foreign` stays false, the same as the first claim: a control this package
104
102
  * has never heard of that was never given `tabindex="-1"` is still in the
@@ -153,12 +151,10 @@ let HelixHeadlessToolbar = class HelixHeadlessToolbar extends HelixElement {
153
151
  * toolbar holds anything, including elements this package has never heard of.
154
152
  * Client only, there being no tree to walk on the server.
155
153
  *
156
- * **It does not ask a child whether it is focusable, and the description said
157
- * it did.** That would mean reading a `focusable` property off each one, which
158
- * `focus` below does when moving the stop and this does not when choosing the
159
- * set. The two are separable and only one of them was ever written: an element
160
- * that is neither disabled nor hidden and still cannot take focus is counted
161
- * here and skipped there.
154
+ * **It does not ask a child whether it is focusable.** Reading a `focusable`
155
+ * property is what `setTabStop` does when moving the stop, not what this does
156
+ * when choosing the set, so an element that is neither disabled nor hidden and
157
+ * still cannot take focus is counted here and skipped there.
162
158
  */
163
159
  get controls() {
164
160
  return [...this.children].filter((child) => {
@@ -85,6 +85,22 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
85
85
  * of using fallback content rather than rendering whichever is present.
86
86
  */
87
87
  content: string;
88
+ /**
89
+ * How long the pointer must rest before the bubble appears, in milliseconds.
90
+ *
91
+ * Without one, sweeping across a row of controls flashes a tooltip for each
92
+ * of them, which is noise rather than help. Focus opens with no delay: a
93
+ * keyboard reader arriving on a control has already committed to it.
94
+ */
95
+ delay: number;
96
+ /**
97
+ * How long the bubble stays after the pointer leaves, in milliseconds.
98
+ */
99
+ delayOut: number;
100
+ /**
101
+ * Whether the tooltip never shows.
102
+ */
103
+ disabled: boolean;
88
104
  /**
89
105
  * The id of the element this describes, in this tooltip's own tree.
90
106
  *
@@ -105,12 +121,6 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
105
121
  * why this does not reflect and nothing styles on it.
106
122
  */
107
123
  for: string;
108
- /**
109
- * Preferred side.
110
- *
111
- * It moves if that side does not fit.
112
- */
113
- placement: Placement;
114
124
  /**
115
125
  * Space between the trigger and the point of the bubble, in pixels.
116
126
  *
@@ -123,34 +133,15 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
123
133
  * it changes the visible gap rather than a number the arrow then eats into.
124
134
  */
125
135
  offset: number;
126
- /**
127
- * The id of a box to keep the bubble inside, instead of the viewport.
128
- *
129
- * Resolved the way `for` is, so an id in the same tree, which is what lets a
130
- * component name a box in its own shadow root. A chart does: its bubble is
131
- * centered on a reading, and the first and last readings sit at the ends of
132
- * the plot, so half the box hangs past the drawing and, measured on a chart
133
- * in a 320px card, three pixels past the card itself.
134
- *
135
- * Clamping is on the cross axis only, which is what makes this safe to point
136
- * at a box the bubble genuinely does not fit inside. See `within` on
137
- * `FloatingController` for what happens if it is applied to the rest.
138
- */
139
- within: string;
140
- /**
141
- * Whether the tooltip never shows.
142
- */
143
- disabled: boolean;
144
136
  /**
145
137
  * Whether the bubble survives the trigger being used.
146
138
  *
147
139
  * **Activation takes a tooltip down, because a hint about what a control will
148
140
  * do is spent once the control has done it.** That is right for a gear that
149
141
  * opens a drawer and wrong for a control whose tooltip *becomes* the answer:
150
- * `CopyButton` swaps its content from Copy to Copied on the same click, so the
151
- * bubble was being hidden at the exact moment it had something to say. What a
152
- * reader saw was a flash, and the confirmation the component had carefully
153
- * written was never on screen long enough to read.
142
+ * `CopyButton` swaps its content from Copy to Copied on the same click, so
143
+ * the bubble would be hidden at the exact moment it has something to say and
144
+ * the confirmation would never be on screen long enough to read.
154
145
  *
155
146
  * So this is not "keep it open", it is "the hint is not spent": set it where
156
147
  * the words change to describe what just happened, and leave it alone
@@ -160,26 +151,33 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
160
151
  */
161
152
  persist: boolean;
162
153
  /**
163
- * How long the pointer must rest before the bubble appears, in milliseconds.
154
+ * Preferred side.
164
155
  *
165
- * Without one, sweeping across a row of controls flashes a tooltip for each
166
- * of them, which is noise rather than help. Focus opens with no delay: a
167
- * keyboard reader arriving on a control has already committed to it.
156
+ * It moves if that side does not fit.
168
157
  */
169
- delay: number;
158
+ placement: Placement;
170
159
  /**
171
- * How long the bubble stays after the pointer leaves, in milliseconds.
160
+ * The id of a box to keep the bubble inside, instead of the viewport.
161
+ *
162
+ * Resolved the way `for` is, so an id in the same tree, which is what lets a
163
+ * component name a box in its own shadow root. A chart does: its bubble is
164
+ * centered on a reading, and the first and last readings sit at the ends of
165
+ * the plot, so half the box hangs past the drawing and, measured on a chart
166
+ * in a 320px card, three pixels past the card itself.
167
+ *
168
+ * Clamping is on the cross axis only, which is what makes this safe to point
169
+ * at a box the bubble genuinely does not fit inside. See `within` on
170
+ * `FloatingController` for what happens if it is applied to the rest.
172
171
  */
173
- delayOut: number;
172
+ within: string;
174
173
  private timer;
175
174
  /**
176
175
  * What is currently keeping the bubble up.
177
176
  *
178
- * The pointer and focus are two holders and they shared one timer with
179
- * nothing counting them, so whichever left last won: moving the pointer off a
180
- * control that still had keyboard focus scheduled a hide and took the bubble
181
- * away from under the reader. The same fault the toast timer had, and the
182
- * same answer.
177
+ * The pointer and focus are two holders, so a single timer with nothing
178
+ * counting them hides on whichever leaves last: moving the pointer off a
179
+ * control that still has keyboard focus would take the bubble away from under
180
+ * the reader. Same shape as the toast timer, and the same answer.
183
181
  */
184
182
  private readonly holds;
185
183
  /**
@@ -272,15 +270,11 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
272
270
  * Focus opens the bubble, but only the kind of focus a reader chose.
273
271
  *
274
272
  * **A mouse press focuses the button it pressed**, so an unconditional focus
275
- * hold meant that after any click the bubble was held up by a reader who was
276
- * not asking for it: moving the pointer away released the pointer hold, found
277
- * a focus hold still set, and left the tooltip on screen until something else
278
- * blurred the control.
279
- *
280
- * It never showed until `persist` arrived, because activation used to clear
281
- * every hold and hide, so the click path threw the stale hold away before
282
- * anyone could see it. A tooltip that survives its own activation is the first
283
- * one to hold that focus long enough to matter.
273
+ * hold leaves the bubble up after any click for a reader who was not asking
274
+ * for it: moving the pointer away releases the pointer hold, finds a focus
275
+ * hold still set, and leaves the tooltip on screen until something else blurs
276
+ * the control. `persist` is what makes that reachable, activation otherwise
277
+ * clearing every hold before anyone can see it.
284
278
  *
285
279
  * `:focus-visible` is the platform's own answer to "did they mean it", and a
286
280
  * button does not match it on a mouse press. Keyboard focus still opens with no
@@ -293,14 +287,14 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
293
287
  /** Hides only once nothing is holding the bubble up. */
294
288
  private release;
295
289
  /**
296
- * Activating the trigger closes the bubble, which nothing was doing.
290
+ * Activating the trigger closes the bubble.
297
291
  *
298
292
  * A tooltip is a hint about what a control will do, and once the control has
299
- * been used the hint is spent. Nothing else was going to take it down either:
293
+ * been used the hint is spent. Nothing else takes it down either:
300
294
  * `pointerleave` cannot fire while the pointer is still on the button it just
301
295
  * pressed, and `focusout` does not fire when activation leaves focus where it
302
- * was. So a gear that opened a drawer left its own label floating over the
303
- * drawer until the reader moved the mouse away.
296
+ * was. Without this, a gear that opened a drawer leaves its own label
297
+ * floating over the drawer until the reader moves the mouse away.
304
298
  *
305
299
  * `click` rather than `pointerdown`, because it is the one event both a mouse
306
300
  * and a keyboard produce: Enter and Space on a focused button raise it, and a
@@ -320,11 +314,10 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
320
314
  /**
321
315
  * Escape closes the bubble from wherever the reader is.
322
316
  *
323
- * On the document, not on the host, which is where it was: a tooltip opened
324
- * by hover has focus somewhere else entirely, so the press never reached this
325
- * element and Escape worked only for the one case that needed it least. That
326
- * is the case the pattern names, a reader escaping a tooltip obscuring what
327
- * is under it, and it was the case that did nothing.
317
+ * On the document, not on the host: a tooltip opened by hover has focus
318
+ * somewhere else entirely, so a press never reaches this element and Escape
319
+ * would work for everything except the case the pattern is named for, a
320
+ * reader escaping a tooltip obscuring what is under it.
328
321
  *
329
322
  * Not stopped from propagating: a tooltip is not what the reader was trying
330
323
  * to escape if it sits inside something else that also closes.
@@ -365,7 +358,7 @@ export declare class HelixHeadlessTooltip extends HelixHeadlessTooltip_base {
365
358
  *
366
359
  * On first open rather than on connect, because a framework may render the
367
360
  * attribute after this element upgrades, and because a tooltip that never
368
- * opens has described nothing eitherway.
361
+ * opens has described nothing either way.
369
362
  *
370
363
  * Either attribute counts. WebAwesome uses `aria-labelledby` over
371
364
  * `aria-describedby` on purpose, their reasoning being that some screen
@@ -95,6 +95,22 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
95
95
  * of using fallback content rather than rendering whichever is present.
96
96
  */
97
97
  this.content = '';
98
+ /**
99
+ * How long the pointer must rest before the bubble appears, in milliseconds.
100
+ *
101
+ * Without one, sweeping across a row of controls flashes a tooltip for each
102
+ * of them, which is noise rather than help. Focus opens with no delay: a
103
+ * keyboard reader arriving on a control has already committed to it.
104
+ */
105
+ this.delay = 400;
106
+ /**
107
+ * How long the bubble stays after the pointer leaves, in milliseconds.
108
+ */
109
+ this.delayOut = 100;
110
+ /**
111
+ * Whether the tooltip never shows.
112
+ */
113
+ this.disabled = false;
98
114
  /**
99
115
  * The id of the element this describes, in this tooltip's own tree.
100
116
  *
@@ -115,12 +131,6 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
115
131
  * why this does not reflect and nothing styles on it.
116
132
  */
117
133
  this.for = '';
118
- /**
119
- * Preferred side.
120
- *
121
- * It moves if that side does not fit.
122
- */
123
- this.placement = 'top';
124
134
  /**
125
135
  * Space between the trigger and the point of the bubble, in pixels.
126
136
  *
@@ -133,34 +143,15 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
133
143
  * it changes the visible gap rather than a number the arrow then eats into.
134
144
  */
135
145
  this.offset = 8;
136
- /**
137
- * The id of a box to keep the bubble inside, instead of the viewport.
138
- *
139
- * Resolved the way `for` is, so an id in the same tree, which is what lets a
140
- * component name a box in its own shadow root. A chart does: its bubble is
141
- * centered on a reading, and the first and last readings sit at the ends of
142
- * the plot, so half the box hangs past the drawing and, measured on a chart
143
- * in a 320px card, three pixels past the card itself.
144
- *
145
- * Clamping is on the cross axis only, which is what makes this safe to point
146
- * at a box the bubble genuinely does not fit inside. See `within` on
147
- * `FloatingController` for what happens if it is applied to the rest.
148
- */
149
- this.within = '';
150
- /**
151
- * Whether the tooltip never shows.
152
- */
153
- this.disabled = false;
154
146
  /**
155
147
  * Whether the bubble survives the trigger being used.
156
148
  *
157
149
  * **Activation takes a tooltip down, because a hint about what a control will
158
150
  * do is spent once the control has done it.** That is right for a gear that
159
151
  * opens a drawer and wrong for a control whose tooltip *becomes* the answer:
160
- * `CopyButton` swaps its content from Copy to Copied on the same click, so the
161
- * bubble was being hidden at the exact moment it had something to say. What a
162
- * reader saw was a flash, and the confirmation the component had carefully
163
- * written was never on screen long enough to read.
152
+ * `CopyButton` swaps its content from Copy to Copied on the same click, so
153
+ * the bubble would be hidden at the exact moment it has something to say and
154
+ * the confirmation would never be on screen long enough to read.
164
155
  *
165
156
  * So this is not "keep it open", it is "the hint is not spent": set it where
166
157
  * the words change to describe what just happened, and leave it alone
@@ -170,36 +161,38 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
170
161
  */
171
162
  this.persist = false;
172
163
  /**
173
- * How long the pointer must rest before the bubble appears, in milliseconds.
164
+ * Preferred side.
174
165
  *
175
- * Without one, sweeping across a row of controls flashes a tooltip for each
176
- * of them, which is noise rather than help. Focus opens with no delay: a
177
- * keyboard reader arriving on a control has already committed to it.
166
+ * It moves if that side does not fit.
178
167
  */
179
- this.delay = 400;
168
+ this.placement = 'top';
180
169
  /**
181
- * How long the bubble stays after the pointer leaves, in milliseconds.
170
+ * The id of a box to keep the bubble inside, instead of the viewport.
171
+ *
172
+ * Resolved the way `for` is, so an id in the same tree, which is what lets a
173
+ * component name a box in its own shadow root. A chart does: its bubble is
174
+ * centered on a reading, and the first and last readings sit at the ends of
175
+ * the plot, so half the box hangs past the drawing and, measured on a chart
176
+ * in a 320px card, three pixels past the card itself.
177
+ *
178
+ * Clamping is on the cross axis only, which is what makes this safe to point
179
+ * at a box the bubble genuinely does not fit inside. See `within` on
180
+ * `FloatingController` for what happens if it is applied to the rest.
182
181
  */
183
- this.delayOut = 100;
182
+ this.within = '';
184
183
  /**
185
184
  * What is currently keeping the bubble up.
186
185
  *
187
- * The pointer and focus are two holders and they shared one timer with
188
- * nothing counting them, so whichever left last won: moving the pointer off a
189
- * control that still had keyboard focus scheduled a hide and took the bubble
190
- * away from under the reader. The same fault the toast timer had, and the
191
- * same answer.
186
+ * The pointer and focus are two holders, so a single timer with nothing
187
+ * counting them hides on whichever leaves last: moving the pointer off a
188
+ * control that still has keyboard focus would take the bubble away from under
189
+ * the reader. Same shape as the toast timer, and the same answer.
192
190
  */
193
191
  this.holds = new Set();
194
- /* One controller rather than the pair this was: a `FloatingController` beside
195
- hand-written `showPopover`/`hidePopover` calls, which is exactly the
196
- composition `PopoverController` exists to own. Its own documentation named
197
- the controller it was not using.
198
- *
199
- * The boundary is the host and not the bubble, for the reason `Popover` gives:
200
- * the host is `display: contents`, so a press on the trigger is inside the
201
- * host and outside the bubble, and a boundary of the bubble alone would treat
202
- * the press that opened it as a press outside. */
192
+ /* The boundary is the host and not the bubble, for the reason `Popover` gives:
193
+ the host is `display: contents`, so a press on the trigger is inside the
194
+ host and outside the bubble, and a boundary of the bubble alone would treat
195
+ the press that opened it as a press outside. */
203
196
  this.bubbleLayer = new PopoverController(this, {
204
197
  anchor: () => this.trigger,
205
198
  arrow: () => this.renderRoot.querySelector('[part="arrow"]'),
@@ -254,15 +247,11 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
254
247
  * Focus opens the bubble, but only the kind of focus a reader chose.
255
248
  *
256
249
  * **A mouse press focuses the button it pressed**, so an unconditional focus
257
- * hold meant that after any click the bubble was held up by a reader who was
258
- * not asking for it: moving the pointer away released the pointer hold, found
259
- * a focus hold still set, and left the tooltip on screen until something else
260
- * blurred the control.
261
- *
262
- * It never showed until `persist` arrived, because activation used to clear
263
- * every hold and hide, so the click path threw the stale hold away before
264
- * anyone could see it. A tooltip that survives its own activation is the first
265
- * one to hold that focus long enough to matter.
250
+ * hold leaves the bubble up after any click for a reader who was not asking
251
+ * for it: moving the pointer away releases the pointer hold, finds a focus
252
+ * hold still set, and leaves the tooltip on screen until something else blurs
253
+ * the control. `persist` is what makes that reachable, activation otherwise
254
+ * clearing every hold before anyone can see it.
266
255
  *
267
256
  * `:focus-visible` is the platform's own answer to "did they mean it", and a
268
257
  * button does not match it on a mouse press. Keyboard focus still opens with no
@@ -283,14 +272,14 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
283
272
  this.release();
284
273
  };
285
274
  /**
286
- * Activating the trigger closes the bubble, which nothing was doing.
275
+ * Activating the trigger closes the bubble.
287
276
  *
288
277
  * A tooltip is a hint about what a control will do, and once the control has
289
- * been used the hint is spent. Nothing else was going to take it down either:
278
+ * been used the hint is spent. Nothing else takes it down either:
290
279
  * `pointerleave` cannot fire while the pointer is still on the button it just
291
280
  * pressed, and `focusout` does not fire when activation leaves focus where it
292
- * was. So a gear that opened a drawer left its own label floating over the
293
- * drawer until the reader moved the mouse away.
281
+ * was. Without this, a gear that opened a drawer leaves its own label
282
+ * floating over the drawer until the reader moves the mouse away.
294
283
  *
295
284
  * `click` rather than `pointerdown`, because it is the one event both a mouse
296
285
  * and a keyboard produce: Enter and Space on a focused button raise it, and a
@@ -316,11 +305,10 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
316
305
  /**
317
306
  * Escape closes the bubble from wherever the reader is.
318
307
  *
319
- * On the document, not on the host, which is where it was: a tooltip opened
320
- * by hover has focus somewhere else entirely, so the press never reached this
321
- * element and Escape worked only for the one case that needed it least. That
322
- * is the case the pattern names, a reader escaping a tooltip obscuring what
323
- * is under it, and it was the case that did nothing.
308
+ * On the document, not on the host: a tooltip opened by hover has focus
309
+ * somewhere else entirely, so a press never reaches this element and Escape
310
+ * would work for everything except the case the pattern is named for, a
311
+ * reader escaping a tooltip obscuring what is under it.
324
312
  *
325
313
  * Not stopped from propagating: a tooltip is not what the reader was trying
326
314
  * to escape if it sits inside something else that also closes.
@@ -350,11 +338,9 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
350
338
  if (named) {
351
339
  return named;
352
340
  }
353
- /* Through the util, which was written from a measurement of this component
354
- and then not used by it. Its extra is the descent: the first assigned
355
- element may itself draw nothing, and an icon button wrapped in a
356
- `display: contents` span was the case that took the bubble to the corner
357
- of the window. */
341
+ /* Through the util, whose extra is the descent: the first assigned element
342
+ may itself draw nothing, and an icon button wrapped in a
343
+ `display: contents` span takes the bubble to the corner of the window. */
358
344
  return anchorElement(this.renderRoot.querySelector('slot:not([name])'), this);
359
345
  }
360
346
  /**
@@ -430,12 +416,11 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
430
416
  }
431
417
  /* A wrapper is empty when it holds nothing; anything else draws.
432
418
  *
433
- * The test was children-or-text for every element, which reads as careful
434
- * and refused the exact case this getter's own paragraph calls the whole
435
- * point of slotting. `<helix-icon slot="content">` has no children and no
436
- * text, so `hasContent` was false, `show()` returned early, and a tooltip
437
- * whose bubble is an icon could not be opened at all. Measured in a
438
- * browser: `open` stayed false through a direct `show()`.
419
+ * Not children-or-text for every element, which reads as careful and
420
+ * refuses the exact case this getter's own paragraph calls the whole
421
+ * point of slotting: `<helix-icon slot="content">` has no children and no
422
+ * text, so `hasContent` would be false, `show()` would return early, and
423
+ * a tooltip whose bubble is an icon could not be opened at all.
439
424
  *
440
425
  * The spec beside this one is the other half, and it is why the answer is
441
426
  * not simply "an element is content": `<span slot="content"> </span>`
@@ -547,7 +532,7 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
547
532
  *
548
533
  * On first open rather than on connect, because a framework may render the
549
534
  * attribute after this element upgrades, and because a tooltip that never
550
- * opens has described nothing eitherway.
535
+ * opens has described nothing either way.
551
536
  *
552
537
  * Either attribute counts. WebAwesome uses `aria-labelledby` over
553
538
  * `aria-describedby` on purpose, their reasoning being that some screen
@@ -556,10 +541,30 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
556
541
  * this should not be the thing to settle it.
557
542
  */
558
543
  auditDescription() {
559
- if (this.audited || this.for === '' || !this.hasContent) {
544
+ if (this.audited || !this.hasContent) {
560
545
  return;
561
546
  }
562
547
  this.audited = true;
548
+ /* **The unlinked form is the one that describes nothing, so it is the one
549
+ warned about.** This returned on `for === ''`, which made the guard the
550
+ exact inverse of the risk: the wrapping form is never linked, so it was
551
+ the single form that could never be reported.
552
+
553
+ Measured in Chrome's accessibility tree,
554
+ `<helix-tooltip content="..."><helix-button>Save</helix-button></helix-tooltip>`
555
+ exposes `button name="Save" desc=""`. All three routes to fixing it are
556
+ closed: an `aria-describedby` IDREF resolves only within one tree,
557
+ `ariaDescribedByElements` is valid outward and this points inward, and
558
+ `aria-description` is the hydration mismatch 322 closed the library
559
+ against. So the wrapping form is no longer the documented API, and this
560
+ says so once, where somebody using it will see it. */
561
+ if (this.for === '') {
562
+ console.warn(`<${this.localName}> is wrapping its trigger rather than naming one, so its text ` +
563
+ "reaches no screen reader: a description in this element's shadow root cannot be " +
564
+ 'referenced from a trigger in the light DOM. Give this tooltip an `id`, set `for` to ' +
565
+ 'the trigger\'s id, and add `aria-describedby="<that id>"` to the trigger.');
566
+ return;
567
+ }
563
568
  const trigger = this.named;
564
569
  if (!trigger) {
565
570
  console.warn(`<${this.localName} for="${this.for}"> found no element with that id in its own tree, ` +
@@ -678,29 +683,29 @@ __decorate([
678
683
  property()
679
684
  ], HelixHeadlessTooltip.prototype, "content", void 0);
680
685
  __decorate([
681
- property()
682
- ], HelixHeadlessTooltip.prototype, "for", void 0);
686
+ property({ attribute: 'delay', type: Number })
687
+ ], HelixHeadlessTooltip.prototype, "delay", void 0);
683
688
  __decorate([
684
- property()
685
- ], HelixHeadlessTooltip.prototype, "placement", void 0);
689
+ property({ attribute: 'delay-out', type: Number })
690
+ ], HelixHeadlessTooltip.prototype, "delayOut", void 0);
686
691
  __decorate([
687
- property({ type: Number })
688
- ], HelixHeadlessTooltip.prototype, "offset", void 0);
692
+ property({ reflect: true, type: Boolean })
693
+ ], HelixHeadlessTooltip.prototype, "disabled", void 0);
689
694
  __decorate([
690
695
  property()
691
- ], HelixHeadlessTooltip.prototype, "within", void 0);
696
+ ], HelixHeadlessTooltip.prototype, "for", void 0);
692
697
  __decorate([
693
- property({ reflect: true, type: Boolean })
694
- ], HelixHeadlessTooltip.prototype, "disabled", void 0);
698
+ property({ type: Number })
699
+ ], HelixHeadlessTooltip.prototype, "offset", void 0);
695
700
  __decorate([
696
701
  property({ reflect: true, type: Boolean })
697
702
  ], HelixHeadlessTooltip.prototype, "persist", void 0);
698
703
  __decorate([
699
- property({ attribute: 'delay', type: Number })
700
- ], HelixHeadlessTooltip.prototype, "delay", void 0);
704
+ property()
705
+ ], HelixHeadlessTooltip.prototype, "placement", void 0);
701
706
  __decorate([
702
- property({ attribute: 'delay-out', type: Number })
703
- ], HelixHeadlessTooltip.prototype, "delayOut", void 0);
707
+ property()
708
+ ], HelixHeadlessTooltip.prototype, "within", void 0);
704
709
  HelixHeadlessTooltip = __decorate([
705
710
  customElement('helix-headless-tooltip')
706
711
  ], HelixHeadlessTooltip);
@@ -60,24 +60,20 @@ import type { HelixHeadlessTourStop } from '../stop/tour-stop.js';
60
60
  */
61
61
  export declare class HelixHeadlessTour extends HelixElement {
62
62
  /**
63
- * Whether the tour is running.
63
+ * Label for the control that goes back, handed to every stop.
64
64
  */
65
- open: boolean;
65
+ backLabel: string;
66
66
  /**
67
67
  * Which stop the reader is on.
68
68
  *
69
- * **It announced after it moved for two days, which made refusing it
70
- * impossible.** `index` was a plain property the tour wrote to directly:
71
- * `move` assigned it and *then* announced, so `preventDefault` on the change
72
- * arrived after the move it was refusing. It goes through `requestChange`
73
- * now, which announces first and applies only if nobody refused, and refusing
74
- * is how a consumer takes the decision. See 294.
69
+ * **Moved through `requestChange`, never by assignment from `move`.** That
70
+ * announces first and applies only if nobody refused, and refusing is how a
71
+ * consumer takes the decision; writing the property and then announcing puts
72
+ * `preventDefault` after the move it is refusing.
75
73
  *
76
74
  * The shape is `Carousel`'s, which is the nearest thing in the library: a
77
75
  * `default-index` for markup that only seeds and a held state that is
78
76
  * `undefined` until somebody sets one.
79
- *
80
- *
81
77
  */
82
78
  get index(): number;
83
79
  set index(next: number);
@@ -88,29 +84,29 @@ export declare class HelixHeadlessTour extends HelixElement {
88
84
  /** The stop being shown, whoever set it, and `undefined` until somebody has. */
89
85
  private indexState;
90
86
  /**
91
- * Accessible name for the run, such as "Getting started".
92
- */
93
- label: string;
94
- /**
95
- * Space left around the target when it is lit, in pixels.
87
+ * Label for the control that goes on from the last stop.
96
88
  */
97
- spotlightPadding: number;
89
+ doneLabel: string;
98
90
  /**
99
- * Label for the control that goes back, handed to every stop.
91
+ * Accessible name for the run, such as "Getting started".
100
92
  */
101
- backLabel: string;
93
+ label: string;
102
94
  /**
103
95
  * Label for the control that goes on.
104
96
  */
105
97
  nextLabel: string;
106
98
  /**
107
- * Label for the control that goes on from the last stop.
99
+ * Whether the tour is running.
108
100
  */
109
- doneLabel: string;
101
+ open: boolean;
110
102
  /**
111
103
  * Label for the control that leaves the tour.
112
104
  */
113
105
  skipLabel: string;
106
+ /**
107
+ * Space left around the target when it is lit, in pixels.
108
+ */
109
+ spotlightPadding: number;
114
110
  private assigned;
115
111
  /**
116
112
  * Where the light falls, read from the current target.
@@ -127,9 +123,9 @@ export declare class HelixHeadlessTour extends HelixElement {
127
123
  /**
128
124
  * Leaves the run early, which is a close rather than a completion.
129
125
  *
130
- * Announced before it is applied, and cancelable because of it. Both closes
131
- * wrote `open` first and dispatched after, so a consumer calling
132
- * `preventDefault` was refusing something that had already happened.
126
+ * Announced before it is applied, and cancelable because of it: writing
127
+ * `open` first and dispatching after leaves a consumer calling
128
+ * `preventDefault` refusing something that has already happened.
133
129
  */
134
130
  skip(): void;
135
131
  private finish;