@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
@@ -8,10 +8,11 @@ declare const HelixHeadlessAccordionItem_base: (new (...args: any[]) => import("
8
8
  * Carries its own open state, which is why it is an element rather than a slot.
9
9
  * Used alone, outside an accordion, it is a disclosure.
10
10
  *
11
- * Content stays mounted when closed and is hidden by the styled tier's CSS, so
12
- * it can animate and so the text is present in server-rendered HTML. Closed
13
- * content is `inert`, keeping it out of the tab order and the accessibility
14
- * tree without removing it from the box tree.
11
+ * Content stays mounted when closed, so it can animate and so the text is
12
+ * present in server-rendered HTML. Closed content carries both `hidden` and
13
+ * `inert`: the first collapses it with no stylesheet in play, the second keeps
14
+ * it out of the tab order and the accessibility tree once the styled tier's
15
+ * `display` has overridden the first.
15
16
  *
16
17
  * @since 0.1.0
17
18
  * @status experimental
@@ -22,7 +23,7 @@ declare const HelixHeadlessAccordionItem_base: (new (...args: any[]) => import("
22
23
  * @slot summary - The always-visible trigger content.
23
24
  *
24
25
  * @event {HelixBeforeCloseEvent} helix-before-close - Fired before the section closes, and cancelable.
25
- * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the item opens or closes. Cancelable: refusing it takes the decision and nothing moves.
26
+ * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the section opens. Cancelable: refusing it takes the decision and nothing moves.
26
27
  * @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
27
28
  *
28
29
  * @csspart chevron - The open and close indicator.
@@ -103,22 +104,19 @@ export declare class HelixHeadlessAccordionItem extends HelixHeadlessAccordionIt
103
104
  * The item, with `hidden` doing the collapsing.
104
105
  *
105
106
  * **A closed section has to be closed with no stylesheet at all**, which is
106
- * the whole claim `headless` makes. `inert` alone was not that: it takes the
107
+ * the whole claim `headless` makes. `inert` alone is not that: it takes the
107
108
  * region out of the accessibility tree and off the tab order and leaves every
108
- * pixel of it on the screen, so a consumer taking this tier got two sections
109
- * of text permanently open with a trigger underneath saying
110
- * `aria-expanded="false"`. Worse than merely unstyled: a sighted reader saw
111
- * content a screen reader was told is not there.
112
- *
113
- * The collapse was living in the styled tier's `grid-template-rows: 0fr`,
114
- * which is an animation and was doing the hiding as a side effect. So the
115
- * state was in a stylesheet, and only one of the two tiers had it.
109
+ * pixel of it on the screen, so a consumer taking this tier gets sections of
110
+ * text permanently open under a trigger saying `aria-expanded="false"`, and a
111
+ * sighted reader sees content a screen reader is told is not there. Leaving
112
+ * the collapse to the styled tier's `grid-template-rows: 0fr` puts the state
113
+ * in a stylesheet, where only one of the two tiers has it.
116
114
  *
117
115
  * **`hidden` costs the styled tier nothing**, which is what makes this the
118
116
  * cheap fix rather than a trade. The UA sheet hides `[hidden]` from the UA
119
117
  * origin, and `accordion-item.css` already sets `display: grid` on this part
120
118
  * unconditionally, so the author rule wins and the 0fr transition runs
121
- * exactly as before. Measured both tiers after the change.
119
+ * exactly as before. Measured on both tiers.
122
120
  *
123
121
  * **Not `hidden="until-found"`**, which would be the better accordion and is
124
122
  * a different piece of work. It hides through `content-visibility` rather
@@ -28,10 +28,11 @@ const TRIGGER_ID = 'trigger';
28
28
  * Carries its own open state, which is why it is an element rather than a slot.
29
29
  * Used alone, outside an accordion, it is a disclosure.
30
30
  *
31
- * Content stays mounted when closed and is hidden by the styled tier's CSS, so
32
- * it can animate and so the text is present in server-rendered HTML. Closed
33
- * content is `inert`, keeping it out of the tab order and the accessibility
34
- * tree without removing it from the box tree.
31
+ * Content stays mounted when closed, so it can animate and so the text is
32
+ * present in server-rendered HTML. Closed content carries both `hidden` and
33
+ * `inert`: the first collapses it with no stylesheet in play, the second keeps
34
+ * it out of the tab order and the accessibility tree once the styled tier's
35
+ * `display` has overridden the first.
35
36
  *
36
37
  * @since 0.1.0
37
38
  * @status experimental
@@ -42,7 +43,7 @@ const TRIGGER_ID = 'trigger';
42
43
  * @slot summary - The always-visible trigger content.
43
44
  *
44
45
  * @event {HelixBeforeCloseEvent} helix-before-close - Fired before the section closes, and cancelable.
45
- * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the item opens or closes. Cancelable: refusing it takes the decision and nothing moves.
46
+ * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the section opens. Cancelable: refusing it takes the decision and nothing moves.
46
47
  * @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
47
48
  *
48
49
  * @csspart chevron - The open and close indicator.
@@ -76,8 +77,8 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
76
77
  if (next && (mode !== undefined || (this.name !== undefined && this.name !== ''))) {
77
78
  for (const peer of this.peers) {
78
79
  if (peer !== this && peer.open) {
79
- // A peer in controlled mode will only notify: its consumer owns the
80
- // value and may decline, which can legitimately leave two open.
80
+ // A peer whose consumer refuses the request stays open, which can
81
+ // legitimately leave two open.
81
82
  peer.requestOpen(false);
82
83
  }
83
84
  }
@@ -142,22 +143,19 @@ let HelixHeadlessAccordionItem = class HelixHeadlessAccordionItem extends MixinC
142
143
  * The item, with `hidden` doing the collapsing.
143
144
  *
144
145
  * **A closed section has to be closed with no stylesheet at all**, which is
145
- * the whole claim `headless` makes. `inert` alone was not that: it takes the
146
+ * the whole claim `headless` makes. `inert` alone is not that: it takes the
146
147
  * region out of the accessibility tree and off the tab order and leaves every
147
- * pixel of it on the screen, so a consumer taking this tier got two sections
148
- * of text permanently open with a trigger underneath saying
149
- * `aria-expanded="false"`. Worse than merely unstyled: a sighted reader saw
150
- * content a screen reader was told is not there.
151
- *
152
- * The collapse was living in the styled tier's `grid-template-rows: 0fr`,
153
- * which is an animation and was doing the hiding as a side effect. So the
154
- * state was in a stylesheet, and only one of the two tiers had it.
148
+ * pixel of it on the screen, so a consumer taking this tier gets sections of
149
+ * text permanently open under a trigger saying `aria-expanded="false"`, and a
150
+ * sighted reader sees content a screen reader is told is not there. Leaving
151
+ * the collapse to the styled tier's `grid-template-rows: 0fr` puts the state
152
+ * in a stylesheet, where only one of the two tiers has it.
155
153
  *
156
154
  * **`hidden` costs the styled tier nothing**, which is what makes this the
157
155
  * cheap fix rather than a trade. The UA sheet hides `[hidden]` from the UA
158
156
  * origin, and `accordion-item.css` already sets `display: grid` on this part
159
157
  * unconditionally, so the author rule wins and the 0fr transition runs
160
- * exactly as before. Measured both tiers after the change.
158
+ * exactly as before. Measured on both tiers.
161
159
  *
162
160
  * **Not `hidden="until-found"`**, which would be the better accordion and is
163
161
  * a different piece of work. It hides through `content-visibility` rather
@@ -45,25 +45,11 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
45
45
  /**
46
46
  * Which color the band wears.
47
47
  *
48
- * **This was `severity` and it was claiming more than it did.** Severity is a
49
- * judgment about the message, and elsewhere in this library it carries one:
50
- * `Callout` reads `TONE_MARKS` for an icon and a label, so `tone="danger"`
51
- * puts a mark beside the text and names it to a screen reader. Here it did
52
- * none of that. It set a color, the live region stayed polite either way, and
53
- * nothing about the announcement's semantics moved. A property that only
54
- * changes the paint should say so.
55
- *
56
- * `tone` is the word this library already uses for exactly that, and `Tag`
57
- * made the identical rename for the identical reason: the word it left was a
58
- * treatment, `tone` is semantic color. The set matches `Tag`'s so the two
59
- * agree, with `neutral` as the resting value and `primary` for a band that is
60
- * about the product rather than about a state.
61
- *
62
- * `neutral` is what an unset announcement already looked like, said out loud
63
- * so a consumer can put a band back to it from markup, and `surface` is the
64
- * one value that is not a color: it lifts the band onto the surface step
65
- * instead of the sunken one, for a strip carrying something that is not a
66
- * state at all.
48
+ * Paint only: unlike `Callout`, no value here draws a mark, changes the label,
49
+ * or moves the live region off polite. The set matches `Tag`'s. `neutral` is
50
+ * the resting value, said out loud so a consumer can put a band back to it
51
+ * from markup, and `surface` is the one value that is not a color: it lifts
52
+ * the band onto the surface step instead of the sunken one.
67
53
  */
68
54
  tone?: 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'surface' | 'warning';
69
55
  protected willUpdate(changed: PropertyValues): void;
@@ -88,12 +74,8 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
88
74
  * layer, and a fallback with only the first is one a tier can restyle and
89
75
  * cannot change.
90
76
  *
91
- * **Named for what it draws, which it was not.** It was `renderIcon`, with a
92
- * description of "the mark for the announcement's tone", and it draws the `x`
93
- * glyph inside the dismiss button and has never drawn a tone. The name is
94
- * `renderIcon` on `Toast` and `Callout` too, and on both of those it takes a
95
- * severity and draws exactly the tone mark this claimed to: the prose came
96
- * from a sibling that meant it. An announcement has no tone mark at all.
77
+ * Not `renderIcon`, which is what `Toast` and `Callout` call the method that
78
+ * draws a tone mark. An announcement has no tone mark at all.
97
79
  */
98
80
  protected renderDismissIcon(): TemplateResult;
99
81
  protected render(): TemplateResult;
@@ -90,12 +90,8 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
90
90
  * layer, and a fallback with only the first is one a tier can restyle and
91
91
  * cannot change.
92
92
  *
93
- * **Named for what it draws, which it was not.** It was `renderIcon`, with a
94
- * description of "the mark for the announcement's tone", and it draws the `x`
95
- * glyph inside the dismiss button and has never drawn a tone. The name is
96
- * `renderIcon` on `Toast` and `Callout` too, and on both of those it takes a
97
- * severity and draws exactly the tone mark this claimed to: the prose came
98
- * from a sibling that meant it. An announcement has no tone mark at all.
93
+ * Not `renderIcon`, which is what `Toast` and `Callout` call the method that
94
+ * draws a tone mark. An announcement has no tone mark at all.
99
95
  */
100
96
  renderDismissIcon() {
101
97
  return html `<slot name="icon">
@@ -109,20 +105,11 @@ let HelixHeadlessAnnouncement = class HelixHeadlessAnnouncement extends MixinDis
109
105
  <div part="actions"><slot name="actions"></slot></div>
110
106
  ${
111
107
  /* A plain `<button>`, the way `Menu` renders its way back and every
112
- other in-shadow control in the library.
113
-
114
- It was `helix-headless-icon-button`, which is the headless tier and
115
- therefore ships no CSS at all, so the `<button>` inside it kept the
116
- browser's own border and gray fill and the dismiss control read as a
117
- form button dropped into a message bar. The styled tier could not
118
- reach it: `[part="dismiss"]` selects the host and stops at its shadow
119
- boundary, and its rules were already written for a plain button,
120
- `all: unset` and all, which is the clue that this element was never
121
- meant to be here.
122
-
123
- Nesting a component inside a component's shadow root also makes the
124
- parent depend on the child being registered, invisibly, and this was
125
- the only place in the library doing it. */
108
+ other in-shadow control in the library. Never a nested component
109
+ here: `[part="dismiss"]` would select the host and stop at its shadow
110
+ boundary, so the styled tier could not reach the inner control at
111
+ all, and the parent would depend invisibly on the child being
112
+ registered. */
126
113
  this.dismissible
127
114
  ? html `<button
128
115
  part="dismiss"
@@ -11,15 +11,11 @@ import { type PropertyValues, type TemplateResult } from 'lit';
11
11
  * load starts at the top, which is what the server rendered, and a reload
12
12
  * part-way down corrects on hydration.
13
13
  *
14
- * **A custom state and not `data-scrolled`, which is what this used to be.**
15
- * The attribute was written onto the host by the element itself, so a server
16
- * sent the header without it and the element added it on upgrade. A framework
17
- * hydrating the page then found an attribute it had not rendered and reported
18
- * the tree as mismatched: intermittently, because it only happens when the
19
- * reader reloads far enough down the page to pass the threshold. Every
20
- * server-rendered consumer paid for that, and could only answer it by
21
- * suppressing hydration warnings on an element they did not write.
22
- *
14
+ * **A custom state and never `data-scrolled`.** An attribute the element writes
15
+ * onto its own host is one the server did not send, so a hydrating framework
16
+ * reports the tree as mismatched, intermittently: only when the reader reloads
17
+ * far enough down the page to pass the threshold. A consumer can answer that
18
+ * only by suppressing hydration warnings on an element they did not write.
23
19
  * `ElementInternals.states` is deliberately not in the DOM, so there is nothing
24
20
  * for a hydration pass to disagree with, and `:state(scrolled)` selects it. The
25
21
  * base class made the same move for `data-settled` and its note explains the
@@ -73,12 +69,9 @@ export declare class HelixHeadlessAppHeader extends HelixElement {
73
69
  *
74
70
  * `start` is the opt-out, for a header whose middle region trails the brand.
75
71
  *
76
- * **Named for the region and not for what is usually in it.** It was
77
- * `nav-align`, which reads as a property about `Navigation` and is not: the
78
- * middle slot takes whatever a consumer puts there, a search field or a
79
- * breadcrumb trail as readily as a nav, and a header that centered its search
80
- * box would have been setting `nav-align` to do it. The part is called
81
- * `content`, so the property is too.
72
+ * **Named for the region and not for what is usually in it.** The middle slot
73
+ * takes a search field or a breadcrumb trail as readily as a `Navigation`, so
74
+ * the property carries the part's name, `content`.
82
75
  */
83
76
  contentAlign?: 'start';
84
77
  private scrolled;
@@ -90,8 +83,8 @@ export declare class HelixHeadlessAppHeader extends HelixElement {
90
83
  * quiet place: rubber-banding overshoots past it and comes back, scroll
91
84
  * anchoring nudges by a pixel when an image or a font lands, and a
92
85
  * `scroll-behavior: smooth` jump settles by oscillating around its target.
93
- * Every one of those crossings toggled the attribute, and the fill and the
94
- * blur are both transitioned, so each toggle started a fresh animation in the
86
+ * Every one of those crossings toggles the state, and the fill and the blur
87
+ * are both transitioned, so each toggle starts a fresh animation in the
95
88
  * opposite direction. What a reader sees is a bar that shimmers, and text
96
89
  * legible through it for as long as the fill is part way in.
97
90
  *
@@ -18,15 +18,11 @@ import { property } from 'lit/decorators.js';
18
18
  * load starts at the top, which is what the server rendered, and a reload
19
19
  * part-way down corrects on hydration.
20
20
  *
21
- * **A custom state and not `data-scrolled`, which is what this used to be.**
22
- * The attribute was written onto the host by the element itself, so a server
23
- * sent the header without it and the element added it on upgrade. A framework
24
- * hydrating the page then found an attribute it had not rendered and reported
25
- * the tree as mismatched: intermittently, because it only happens when the
26
- * reader reloads far enough down the page to pass the threshold. Every
27
- * server-rendered consumer paid for that, and could only answer it by
28
- * suppressing hydration warnings on an element they did not write.
29
- *
21
+ * **A custom state and never `data-scrolled`.** An attribute the element writes
22
+ * onto its own host is one the server did not send, so a hydrating framework
23
+ * reports the tree as mismatched, intermittently: only when the reader reloads
24
+ * far enough down the page to pass the threshold. A consumer can answer that
25
+ * only by suppressing hydration warnings on an element they did not write.
30
26
  * `ElementInternals.states` is deliberately not in the DOM, so there is nothing
31
27
  * for a hydration pass to disagree with, and `:state(scrolled)` selects it. The
32
28
  * base class made the same move for `data-settled` and its note explains the
@@ -72,7 +68,7 @@ let HelixHeadlessAppHeader = class HelixHeadlessAppHeader extends HelixElement {
72
68
  constructor() {
73
69
  super(...arguments);
74
70
  /* Whether the bar currently believes the page has moved, kept alongside the
75
- attribute so a scroll that changes nothing writes nothing. */
71
+ custom state so a scroll that changes nothing writes nothing. */
76
72
  this.scrolled = false;
77
73
  /**
78
74
  * A band rather than a line, so the fill cannot flicker at the boundary.
@@ -82,8 +78,8 @@ let HelixHeadlessAppHeader = class HelixHeadlessAppHeader extends HelixElement {
82
78
  * quiet place: rubber-banding overshoots past it and comes back, scroll
83
79
  * anchoring nudges by a pixel when an image or a font lands, and a
84
80
  * `scroll-behavior: smooth` jump settles by oscillating around its target.
85
- * Every one of those crossings toggled the attribute, and the fill and the
86
- * blur are both transitioned, so each toggle started a fresh animation in the
81
+ * Every one of those crossings toggles the state, and the fill and the blur
82
+ * are both transitioned, so each toggle starts a fresh animation in the
87
83
  * opposite direction. What a reader sees is a bar that shimmers, and text
88
84
  * legible through it for as long as the fill is part way in.
89
85
  *
@@ -102,12 +98,7 @@ let HelixHeadlessAppHeader = class HelixHeadlessAppHeader extends HelixElement {
102
98
  /* The state is what CSS selects; the event is what anything outside this
103
99
  element can hear. Both, because neither covers the other: a state cannot
104
100
  be observed and an event cannot be styled. */
105
- if (next) {
106
- this.internals.states.add('scrolled');
107
- }
108
- else {
109
- this.internals.states.delete('scrolled');
110
- }
101
+ this.toggleState('scrolled', next);
111
102
  this.dispatchEvent(new HelixScrolledEvent({ scrolled: next }));
112
103
  };
113
104
  }
@@ -29,15 +29,13 @@ export declare const FOLDS_UP_TO = 12;
29
29
  * gets; the group's own name is what everyone else gets, and "Seven people" is
30
30
  * more useful than seven names read in a row.
31
31
  *
32
- * **And hidden by the stylesheet, not by this class.** It wrote `data-overflow`
33
- * onto each avatar from `updated`, which is one update too late and one element
34
- * too far out: Lit renders on a microtask, so an avatar appended past the limit
35
- * was laid out and painted before anything ran to hide it, and the group was
36
- * writing attributes onto markup a consumer owns to do it. Measured in Chrome
37
- * 148, appending two past `max="3"` and reading before yielding: five `flex`,
38
- * folding to three on the next update. The styled tier now does it with
39
- * `:host([max="N"]) ::slotted(:nth-child(n + N+1))`, which is right at the
40
- * first style resolution and writes nothing.
32
+ * **And hidden by the stylesheet, not by this class.** Hiding from `updated` is
33
+ * one update too late and one element too far out: Lit renders on a microtask,
34
+ * so an avatar appended past the limit is laid out and painted before anything
35
+ * runs to hide it, and marking each one means writing attributes onto markup a
36
+ * consumer owns. The styled tier's
37
+ * `:host([max="N"]) ::slotted(:nth-child(n + N+1))` is right at the first style
38
+ * resolution and writes nothing.
41
39
  *
42
40
  * **The fold is finite, and the count agrees with it.** `An+B` takes a literal,
43
41
  * so there is one selector per value of `max` and the range stops at twelve.
@@ -76,16 +74,9 @@ export declare class HelixHeadlessAvatarGroup extends HelixElement {
76
74
  * styled tier hides past the limit with `:host([max="N"]) ::slotted(:nth-child(n + N+1))`,
77
75
  * so the attribute *is* the mechanism: a `max` that reaches this property and
78
76
  * never reaches the host matches no rule, and every avatar is drawn beside a
79
- * count that says two of them are hidden. That is the failure this repository
80
- * already writes down as "reflect only what CSS selects on", and it went
81
- * unnoticed because the examples set `max` in markup, where the author had
82
- * written the attribute themselves.
83
- *
84
- * It is the path a script takes that was broken, and React takes it for
85
- * everyone: React assigns a matching property rather than an attribute, so
86
- * `<helix-avatar-group max={4}>` folded nothing at all. Measured against the
87
- * markup twin, the fifth and sixth avatars rendered at full size where the
88
- * markup version had them at 0x0.
77
+ * count claiming some are hidden. Markup is the safe path and hides the fault;
78
+ * a script is the broken one, and React takes it for everyone, assigning a
79
+ * matching property rather than an attribute.
89
80
  *
90
81
  * **Optional rather than defaulted, per the rule that a reflected property
91
82
  * takes no default**: `max = 0` would stamp `max="0"` onto every host that
@@ -36,15 +36,13 @@ export const FOLDS_UP_TO = 12;
36
36
  * gets; the group's own name is what everyone else gets, and "Seven people" is
37
37
  * more useful than seven names read in a row.
38
38
  *
39
- * **And hidden by the stylesheet, not by this class.** It wrote `data-overflow`
40
- * onto each avatar from `updated`, which is one update too late and one element
41
- * too far out: Lit renders on a microtask, so an avatar appended past the limit
42
- * was laid out and painted before anything ran to hide it, and the group was
43
- * writing attributes onto markup a consumer owns to do it. Measured in Chrome
44
- * 148, appending two past `max="3"` and reading before yielding: five `flex`,
45
- * folding to three on the next update. The styled tier now does it with
46
- * `:host([max="N"]) ::slotted(:nth-child(n + N+1))`, which is right at the
47
- * first style resolution and writes nothing.
39
+ * **And hidden by the stylesheet, not by this class.** Hiding from `updated` is
40
+ * one update too late and one element too far out: Lit renders on a microtask,
41
+ * so an avatar appended past the limit is laid out and painted before anything
42
+ * runs to hide it, and marking each one means writing attributes onto markup a
43
+ * consumer owns. The styled tier's
44
+ * `:host([max="N"]) ::slotted(:nth-child(n + N+1))` is right at the first style
45
+ * resolution and writes nothing.
48
46
  *
49
47
  * **The fold is finite, and the count agrees with it.** `An+B` takes a literal,
50
48
  * so there is one selector per value of `max` and the range stops at twelve.
@@ -81,9 +79,7 @@ let HelixHeadlessAvatarGroup = class HelixHeadlessAvatarGroup extends HelixEleme
81
79
  /** The avatars, in light-DOM order. Empty on the server, which has no tree. */
82
80
  get avatars() {
83
81
  /* `?? []` is the server: Lit's element shim carries attributes and not a
84
- tree, so `children` is undefined there and spreading it throws. The same
85
- fault the menu item, the table and the carousel each had in turn, which
86
- is why it is written before it can happen again. */
82
+ tree, so `children` is undefined there and spreading it throws. */
87
83
  return [...(this.children ?? [])].filter((child) => child instanceof HTMLElement);
88
84
  }
89
85
  /**
@@ -105,11 +101,10 @@ let HelixHeadlessAvatarGroup = class HelixHeadlessAvatarGroup extends HelixEleme
105
101
  }
106
102
  updated(changed) {
107
103
  super.updated(changed);
108
- /* Nothing hides anything here any more: the stylesheet does it, from `max`
109
- on the host, so the arrangement is right at the first style resolution
110
- rather than one update later. What is left is saying so when a `max` is
111
- set that no rule can match, because showing everyone is a defensible
112
- answer and showing everyone beside a "+5" is not. */
104
+ /* Nothing hides anything here: the stylesheet does it, from `max` on the
105
+ host. What is left is saying so when a `max` is set that no rule can
106
+ match, because showing everyone is a defensible answer and showing
107
+ everyone beside a "+5" is not. */
113
108
  const limit = this.max ?? 0;
114
109
  if (limit > FOLDS_UP_TO && this.avatars.length > limit && !this.warned) {
115
110
  this.warned = true;
@@ -32,18 +32,18 @@ export declare const initialsOf: (name: string) => string;
32
32
  * @csspart initials - The initials shown when there is no usable image.
33
33
  */
34
34
  export declare class HelixHeadlessAvatar extends HelixElement {
35
- /**
36
- * Image to show.
37
- *
38
- * Falls back to the slot, or to initials, if it fails.
39
- */
40
- src: string;
41
35
  /**
42
36
  * Name of the person or entity.
43
37
  *
44
38
  * Used for the label and the initials.
45
39
  */
46
40
  name: string;
41
+ /**
42
+ * Image to show.
43
+ *
44
+ * Falls back to the slot, or to initials, if it fails.
45
+ */
46
+ src: string;
47
47
  /**
48
48
  * Whether the image failed.
49
49
  *
@@ -59,8 +59,8 @@ export declare class HelixHeadlessAvatar extends HelixElement {
59
59
  *
60
60
  * A consumer replaces it by slotting something; a tier above replaces it by
61
61
  * overriding this, and those answer different people. Written inline it
62
- * answered only the first, and a styled tier wanting initials drawn its own
63
- * way had to reimplement the whole template to reach three elements.
62
+ * answers only the first, and a styled tier wanting initials drawn its own way
63
+ * has to reimplement the whole template to reach three elements.
64
64
  */
65
65
  protected renderInitials(): TemplateResult;
66
66
  }
@@ -56,18 +56,18 @@ export const initialsOf = (name) => {
56
56
  let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
57
57
  constructor() {
58
58
  super(...arguments);
59
- /**
60
- * Image to show.
61
- *
62
- * Falls back to the slot, or to initials, if it fails.
63
- */
64
- this.src = '';
65
59
  /**
66
60
  * Name of the person or entity.
67
61
  *
68
62
  * Used for the label and the initials.
69
63
  */
70
64
  this.name = '';
65
+ /**
66
+ * Image to show.
67
+ *
68
+ * Falls back to the slot, or to initials, if it fails.
69
+ */
70
+ this.src = '';
71
71
  /**
72
72
  * Whether the image failed.
73
73
  *
@@ -86,21 +86,20 @@ let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
86
86
  super.willUpdate(changed);
87
87
  /* A new source is a new attempt.
88
88
  *
89
- * `failed` is an observation about the image that was loading, and it
90
- * outlived the image: it latched on the first error and nothing ever
91
- * cleared it, so an avatar that failed once fell back to initials for the
92
- * life of the element. A consumer swapping a broken URL for a good one, or
93
- * a list reusing an avatar for the next person, got the initials forever
94
- * and no error to say why. */
89
+ * `failed` is an observation about the image that was loading, so it has to
90
+ * be cleared with the source. Latched, an avatar that failed once falls back
91
+ * to initials for the life of the element, and a consumer swapping a broken
92
+ * URL for a good one, or a list reusing an avatar for the next person, gets
93
+ * the initials forever with no error to say why. */
95
94
  if (changed.has('src')) {
96
95
  this.failed = false;
97
96
  }
98
97
  /* A role only where there is a name to carry.
99
98
  *
100
- * `role="img"` was asserted unconditionally, so an avatar with no `name`
101
- * was an unnamed image: a screen reader announces "image" and stops, which
102
- * is worse than announcing nothing, because nothing is what a decorative
103
- * mark should be. With a name it is content and needs the role to hold it. */
99
+ * An unconditional `role="img"` makes an avatar with no `name` an unnamed
100
+ * image: a screen reader announces "image" and stops, which is worse than
101
+ * announcing nothing, because nothing is what a decorative mark should be.
102
+ * With a name it is content and needs the role to hold it. */
104
103
  hostAria(this.internals, {
105
104
  label: this.name,
106
105
  role: this.name === '' ? '' : 'img',
@@ -123,8 +122,8 @@ let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
123
122
  *
124
123
  * A consumer replaces it by slotting something; a tier above replaces it by
125
124
  * overriding this, and those answer different people. Written inline it
126
- * answered only the first, and a styled tier wanting initials drawn its own
127
- * way had to reimplement the whole template to reach three elements.
125
+ * answers only the first, and a styled tier wanting initials drawn its own way
126
+ * has to reimplement the whole template to reach three elements.
128
127
  */
129
128
  renderInitials() {
130
129
  return html `<slot>
@@ -134,10 +133,10 @@ let HelixHeadlessAvatar = class HelixHeadlessAvatar extends HelixElement {
134
133
  };
135
134
  __decorate([
136
135
  property()
137
- ], HelixHeadlessAvatar.prototype, "src", void 0);
136
+ ], HelixHeadlessAvatar.prototype, "name", void 0);
138
137
  __decorate([
139
138
  property()
140
- ], HelixHeadlessAvatar.prototype, "name", void 0);
139
+ ], HelixHeadlessAvatar.prototype, "src", void 0);
141
140
  __decorate([
142
141
  state()
143
142
  ], HelixHeadlessAvatar.prototype, "failed", void 0);
@@ -31,11 +31,11 @@ import { type TemplateResult } from 'lit';
31
31
  */
32
32
  export declare class HelixHeadlessBadge extends HelixElement {
33
33
  /**
34
- * The count or short text to show.
34
+ * Accessible name.
35
35
  *
36
- * Absent shows a dot, zero shows nothing.
36
+ * Required for a dot, which has no text to read.
37
37
  */
38
- value: string;
38
+ label: string;
39
39
  /**
40
40
  * Cap for a numeric value.
41
41
  *
@@ -43,11 +43,11 @@ export declare class HelixHeadlessBadge extends HelixElement {
43
43
  */
44
44
  max?: number;
45
45
  /**
46
- * Accessible name.
46
+ * The count or short text to show.
47
47
  *
48
- * Required for a dot, which has no text to read.
48
+ * Absent shows a dot, zero shows nothing.
49
49
  */
50
- label: string;
50
+ value: string;
51
51
  /** Whether the value counts nothing, in which case there is no mark. */
52
52
  private get blank();
53
53
  /** What the indicator reads, once the cap has been applied. */
@@ -39,18 +39,18 @@ import { property } from 'lit/decorators.js';
39
39
  let HelixHeadlessBadge = class HelixHeadlessBadge extends HelixElement {
40
40
  constructor() {
41
41
  super(...arguments);
42
- /**
43
- * The count or short text to show.
44
- *
45
- * Absent shows a dot, zero shows nothing.
46
- */
47
- this.value = '';
48
42
  /**
49
43
  * Accessible name.
50
44
  *
51
45
  * Required for a dot, which has no text to read.
52
46
  */
53
47
  this.label = '';
48
+ /**
49
+ * The count or short text to show.
50
+ *
51
+ * Absent shows a dot, zero shows nothing.
52
+ */
53
+ this.value = '';
54
54
  }
55
55
  /** Whether the value counts nothing, in which case there is no mark. */
56
56
  get blank() {
@@ -70,11 +70,11 @@ let HelixHeadlessBadge = class HelixHeadlessBadge extends HelixElement {
70
70
  /* A mark with text is content and is announced; a dot is decoration and is
71
71
  not.
72
72
  *
73
- * This asked for a `label` as well, so a badge showing a count and no label
74
- * was `aria-hidden` and the number it exists to show reached nobody using a
75
- * screen reader. The number is its own name where none is given, which is
76
- * why `aria-label` is now conditional on the label rather than on this: a
77
- * `4` announces as "4" from the text, and `label="4 unread"` says the
73
+ * It must not ask for a `label` as well, or a badge showing a count and no
74
+ * label is `aria-hidden` and the number it exists to show reaches nobody
75
+ * using a screen reader. The number is its own name where none is given,
76
+ * which is why `aria-label` is conditional on the label rather than on this:
77
+ * a `4` announces as "4" from the text, and `label="4 unread"` says the
78
78
  * better thing.
79
79
  *
80
80
  * A dot with no label still says nothing, which is the deliberate half: a
@@ -108,13 +108,13 @@ let HelixHeadlessBadge = class HelixHeadlessBadge extends HelixElement {
108
108
  };
109
109
  __decorate([
110
110
  property()
111
- ], HelixHeadlessBadge.prototype, "value", void 0);
111
+ ], HelixHeadlessBadge.prototype, "label", void 0);
112
112
  __decorate([
113
113
  property({ type: Number })
114
114
  ], HelixHeadlessBadge.prototype, "max", void 0);
115
115
  __decorate([
116
116
  property()
117
- ], HelixHeadlessBadge.prototype, "label", void 0);
117
+ ], HelixHeadlessBadge.prototype, "value", void 0);
118
118
  HelixHeadlessBadge = __decorate([
119
119
  customElement('helix-headless-badge')
120
120
  ], HelixHeadlessBadge);