@fusion.dev/helix-headless 0.105.0 → 0.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/custom-elements.json +7324 -3890
  2. package/dist/accordion/item/accordion-item.d.ts +17 -16
  3. package/dist/accordion/root/accordion-root.d.ts +13 -17
  4. package/dist/announcement/root/announcement-root.d.ts +24 -31
  5. package/dist/app-header/root/app-header-root.d.ts +14 -14
  6. package/dist/area-chart/root/area-chart-root.d.ts +29 -48
  7. package/dist/avatar/group/avatar-group.d.ts +6 -8
  8. package/dist/avatar/root/avatar-root.d.ts +11 -11
  9. package/dist/badge/root/badge-root.d.ts +14 -15
  10. package/dist/bar-chart/root/bar-chart-root.d.ts +40 -44
  11. package/dist/blockquote/root/blockquote-root.d.ts +5 -7
  12. package/dist/breadcrumbs/breadcrumb/breadcrumb.d.ts +25 -33
  13. package/dist/breadcrumbs/root/breadcrumbs-root.d.ts +12 -11
  14. package/dist/button/root/button-root.d.ts +16 -17
  15. package/dist/button-group/root/button-group-root.d.ts +9 -10
  16. package/dist/callout/root/callout-root.d.ts +10 -15
  17. package/dist/canvas/edge/canvas-edge.d.ts +21 -21
  18. package/dist/canvas/node/canvas-node.d.ts +43 -45
  19. package/dist/canvas/root/canvas-root.d.ts +100 -99
  20. package/dist/card/root/card-root.d.ts +10 -12
  21. package/dist/carousel/root/carousel-root.d.ts +32 -33
  22. package/dist/chat/composer/chat-composer.d.ts +24 -26
  23. package/dist/chat/message/chat-message.d.ts +30 -33
  24. package/dist/chat/root/chat-root.d.ts +63 -80
  25. package/dist/checkbox/root/checkbox-root.d.ts +30 -32
  26. package/dist/checkbox-group/root/checkbox-group-root.d.ts +25 -25
  27. package/dist/code/root/code-root.d.ts +6 -10
  28. package/dist/code-block/root/code-block-root.d.ts +35 -48
  29. package/dist/color-input/root/color-input-root.d.ts +52 -56
  30. package/dist/color-picker/root/color-picker-root.d.ts +49 -49
  31. package/dist/combobox/root/combobox-root.d.ts +52 -53
  32. package/dist/command/root/command-root.d.ts +35 -40
  33. package/dist/copy-button/root/copy-button-root.d.ts +24 -26
  34. package/dist/data-table/root/data-table-root.d.ts +106 -107
  35. package/dist/date-input/root/date-input-root.d.ts +54 -53
  36. package/dist/date-picker/root/date-picker-root.d.ts +25 -21
  37. package/dist/description-list/item/description-list-item.d.ts +7 -7
  38. package/dist/description-list/root/description-list-root.d.ts +10 -15
  39. package/dist/dialog/root/dialog-root.d.ts +22 -19
  40. package/dist/divider/root/divider-root.d.ts +12 -13
  41. package/dist/donut-chart/root/donut-chart-root.d.ts +19 -20
  42. package/dist/drawer/root/drawer-root.d.ts +19 -18
  43. package/dist/drilldown/item/drilldown-item.d.ts +28 -28
  44. package/dist/drilldown/root/drilldown-root.d.ts +22 -28
  45. package/dist/element-events.generated.js +7 -0
  46. package/dist/empty/root/empty-root.d.ts +16 -19
  47. package/dist/file-input/root/file-input-root.d.ts +32 -32
  48. package/dist/filter-input/chip/filter-chip.d.ts +36 -39
  49. package/dist/filter-input/field/filter-field.d.ts +25 -31
  50. package/dist/filter-input/menu/filter-menu.d.ts +50 -47
  51. package/dist/filter-input/operator/filter-operator.d.ts +15 -20
  52. package/dist/filter-input/root/filter-input-root.d.ts +80 -98
  53. package/dist/format-date/root/format-date-root.d.ts +19 -27
  54. package/dist/heatmap/root/heatmap-root.d.ts +40 -41
  55. package/dist/icon/root/icon-root.d.ts +21 -23
  56. package/dist/icon-button/root/icon-button-root.d.ts +12 -14
  57. package/dist/image/root/image-root.d.ts +30 -30
  58. package/dist/input/root/input-root.d.ts +36 -35
  59. package/dist/kbd/root/kbd-root.d.ts +13 -15
  60. package/dist/legend/root/legend-root.d.ts +18 -16
  61. package/dist/lightbox/item/lightbox-item.d.ts +13 -15
  62. package/dist/lightbox/root/lightbox-root.d.ts +40 -41
  63. package/dist/line-chart/root/line-chart-root.d.ts +20 -29
  64. package/dist/list/item/list-item.d.ts +17 -22
  65. package/dist/list/root/list-root.d.ts +6 -7
  66. package/dist/listbox/root/listbox-root.d.ts +42 -41
  67. package/dist/loader/root/loader-root.d.ts +16 -20
  68. package/dist/map/area/map-area.d.ts +6 -0
  69. package/dist/map/area/map-area.js +3 -0
  70. package/dist/map/buildings/map-buildings.d.ts +45 -0
  71. package/dist/map/buildings/map-buildings.js +37 -0
  72. package/dist/map/contours/map-contours.d.ts +61 -0
  73. package/dist/map/contours/map-contours.js +54 -0
  74. package/dist/map/index.d.ts +7 -0
  75. package/dist/map/index.js +5 -0
  76. package/dist/map/landcover/map-landcover.d.ts +47 -0
  77. package/dist/map/landcover/map-landcover.js +37 -0
  78. package/dist/map/marker/map-marker.d.ts +11 -4
  79. package/dist/map/marker/map-marker.js +13 -1
  80. package/dist/map/points/map-points.d.ts +7 -1
  81. package/dist/map/points/map-points.js +3 -0
  82. package/dist/map/raster/map-raster.d.ts +84 -0
  83. package/dist/map/raster/map-raster.js +96 -0
  84. package/dist/map/root/map-root.d.ts +169 -7
  85. package/dist/map/root/map-root.js +352 -4
  86. package/dist/map/route/map-route.d.ts +6 -0
  87. package/dist/map/route/map-route.js +3 -0
  88. package/dist/map/terrain/map-terrain.d.ts +68 -0
  89. package/dist/map/terrain/map-terrain.js +58 -0
  90. package/dist/megamenu/root/megamenu-root.d.ts +27 -25
  91. package/dist/menu/item/menu-item.d.ts +30 -31
  92. package/dist/menu/root/menu-root.d.ts +25 -29
  93. package/dist/meter/root/meter-root.d.ts +22 -21
  94. package/dist/navigation/root/navigation-root.d.ts +13 -16
  95. package/dist/notifications/group/notification-group.d.ts +27 -28
  96. package/dist/notifications/notification/notification.d.ts +35 -42
  97. package/dist/notifications/root/notifications-root.d.ts +22 -24
  98. package/dist/number-input/root/number-input-root.d.ts +46 -50
  99. package/dist/object-inspector/root/object-inspector-root.d.ts +46 -58
  100. package/dist/option/group/option-group.d.ts +11 -11
  101. package/dist/option/root/option-root.d.ts +28 -33
  102. package/dist/outline/root/outline-root.d.ts +18 -17
  103. package/dist/pagination/root/pagination-root.d.ts +37 -39
  104. package/dist/pagination/size/pagination-size.d.ts +37 -43
  105. package/dist/pagination/summary/pagination-summary.d.ts +12 -14
  106. package/dist/pin-input/root/pin-input-root.d.ts +32 -38
  107. package/dist/popover/root/popover-root.d.ts +16 -21
  108. package/dist/progress/root/progress-root.d.ts +16 -14
  109. package/dist/qr-code/root/qr-code-root.d.ts +22 -25
  110. package/dist/quote/root/quote-root.d.ts +5 -6
  111. package/dist/radio/group/radio-group.d.ts +26 -28
  112. package/dist/radio/root/radio-root.d.ts +24 -28
  113. package/dist/rating/root/rating-root.d.ts +27 -30
  114. package/dist/scatter-chart/root/scatter-chart-root.d.ts +43 -55
  115. package/dist/scroll-area/root/scroll-area-root.d.ts +15 -21
  116. package/dist/select/root/select-root.d.ts +41 -44
  117. package/dist/skeleton/root/skeleton-root.d.ts +7 -8
  118. package/dist/skip-link/root/skip-link-root.d.ts +21 -28
  119. package/dist/slider/root/slider-root.d.ts +36 -39
  120. package/dist/sparkline/root/sparkline-root.d.ts +22 -28
  121. package/dist/speed-dial/item/speed-dial-item.d.ts +21 -21
  122. package/dist/speed-dial/root/speed-dial-root.d.ts +25 -27
  123. package/dist/splitter/root/splitter-root.d.ts +37 -41
  124. package/dist/stat/group/stat-group.d.ts +4 -4
  125. package/dist/stat/root/stat-root.d.ts +8 -9
  126. package/dist/steps/root/steps-root.d.ts +11 -14
  127. package/dist/steps/step/step.d.ts +22 -29
  128. package/dist/switch/root/switch-root.d.ts +20 -24
  129. package/dist/table/cell/table-cell.d.ts +18 -8
  130. package/dist/table/cell/table-cell.js +5 -1
  131. package/dist/table/column/table-column.d.ts +62 -55
  132. package/dist/table/root/table-root.d.ts +16 -17
  133. package/dist/table/row/table-row.d.ts +3 -3
  134. package/dist/tabs/panel/tab-panel.d.ts +3 -3
  135. package/dist/tabs/root/tabs-root.d.ts +19 -17
  136. package/dist/tabs/tab/tab.d.ts +6 -6
  137. package/dist/tag/root/tag-root.d.ts +11 -12
  138. package/dist/textarea/root/textarea-root.d.ts +29 -32
  139. package/dist/time-input/root/time-input-root.d.ts +70 -69
  140. package/dist/time-picker/root/time-picker-root.d.ts +58 -66
  141. package/dist/timeline/item/timeline-item.d.ts +18 -24
  142. package/dist/timeline/root/timeline-root.d.ts +13 -21
  143. package/dist/toast/item/toast-item.d.ts +21 -22
  144. package/dist/toast/root/toast-root.d.ts +18 -23
  145. package/dist/toggle/group/toggle-group.d.ts +23 -25
  146. package/dist/toggle/root/toggle-root.d.ts +8 -8
  147. package/dist/toolbar/root/toolbar-root.d.ts +7 -10
  148. package/dist/tooltip/root/tooltip-root.d.ts +41 -47
  149. package/dist/tour/root/tour-root.d.ts +24 -26
  150. package/dist/tour/stop/tour-stop.d.ts +39 -48
  151. package/dist/tree/item/tree-item.d.ts +23 -25
  152. package/dist/tree/root/tree-root.d.ts +13 -12
  153. package/dist/trend/root/trend-root.d.ts +18 -19
  154. package/dist/video/root/video-root.d.ts +108 -101
  155. package/dist/video-playlist/item/video-playlist-item.d.ts +23 -28
  156. package/dist/video-playlist/menu/video-playlist-menu.d.ts +17 -21
  157. package/dist/video-playlist/root/video-playlist-root.d.ts +21 -25
  158. package/dist/virtual-list/root/virtual-list-root.d.ts +27 -26
  159. package/package.json +5 -5
  160. package/types/jsx.d.ts +10363 -9520
  161. package/types/svelte.d.ts +5 -0
  162. package/types/vue.d.ts +1440 -1032
@@ -1,17 +1,16 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import { type TemplateResult } from 'lit';
3
3
  /**
4
- * @summary One measurement, with the word for what it measures.
4
+ * @summary One measurement, with a label that names what it measures.
5
5
  *
6
6
  * @description
7
- * Label first in the markup and the value after it, which is the reading order
8
- * a screen reader takes and the order a caption sits above a figure. The eye
9
- * lands on the number either way, because the number is the loud thing; a
10
- * reader hearing it needs to know what it counts before hearing how many.
7
+ * The label comes first in the markup and the value after it, so a screen
8
+ * reader reads what the figure counts before the number. Visually, the number
9
+ * stands out either way.
11
10
  *
12
- * Both are bare slots. An element whose only job is to assign itself a slot on
13
- * connect gives its own host an attribute after upgrade, which a React
14
- * consumer's server markup never had.
11
+ * Both are bare slots. An element that assigned itself a slot on connect would
12
+ * add an attribute after upgrade, which markup rendered on the server by React
13
+ * does not have.
15
14
  *
16
15
  * @since 0.1.0
17
16
  * @status stable
@@ -21,7 +20,7 @@ import { type TemplateResult } from 'lit';
21
20
  *
22
21
  * @slot - The value.
23
22
  * @slot label - What the value measures.
24
- * @slot unit - The unit, set beside the value.
23
+ * @slot unit - The unit, shown beside the value.
25
24
  */
26
25
  export declare class HelixHeadlessStat extends HelixElement {
27
26
  /**
@@ -2,19 +2,16 @@ import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  declare const HelixHeadlessSteps_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerActiveInterface) & typeof HelixElement;
4
4
  /**
5
- * @summary A sequence of stages, and where the reader is in it.
5
+ * @summary A sequence of stages that shows which stage the user is on.
6
6
  *
7
7
  * @description
8
- * **`active` names where the reader is. `complete` stays on each step.** Only
9
- * one of them is positional: return to stage one of three and stages one and
10
- * two are still finished, where "everything before the active one" says only
11
- * the first is. So this element drives `current` and never touches `complete`.
8
+ * `active` sets where the user is, and `complete` stays on each step. Returning
9
+ * to stage one of three leaves stages one and two finished, so the root sets
10
+ * `current` on the steps and never changes `complete`.
12
11
  *
13
- * **`active` is optional, and a sequence without it still renders.** Left
14
- * unset, each step's own `current` stands, which is what lets the whole
15
- * sequence be right in the server's markup: this element would have to count
16
- * its slotted children to know which is third, and the server has none to
17
- * count.
12
+ * `active` is optional. Without it, each step keeps its own `current`, so the
13
+ * sequence is correct in the server's markup, where the root cannot count its
14
+ * slotted children.
18
15
  *
19
16
  * @since 0.1.0
20
17
  * @status stable
@@ -24,13 +21,13 @@ declare const HelixHeadlessSteps_base: (new (...args: any[]) => import("@fusion.
24
21
  *
25
22
  * @slot - The steps.
26
23
  *
27
- * @event {HelixActivateEvent} helix-activate - Fired once the current one has moved, so the element already holds it.
28
- * @event {HelixBeforeActivateEvent} helix-before-activate - Fired before the active step changes. Cancelable: refusing it takes the decision and nothing moves.
29
- * @event {HelixSelectEvent} helix-select - Fired when a step is pressed. Dispatched by the step and listened for here, because the root is what a consumer holds. Cancelable: refusing it takes the decision and nothing moves.
24
+ * @event {HelixActivateEvent} helix-activate - Fired after the current step changes, when the element already holds the new step.
25
+ * @event {HelixBeforeActivateEvent} helix-before-activate - Fired before the active step changes. Cancelable: cancel it to keep the current step.
26
+ * @event {HelixSelectEvent} helix-select - Fired when a step is pressed. The step dispatches it, and you can listen for it on the sequence. Cancelable: cancel it to keep the current step.
30
27
  */
31
28
  export declare class HelixHeadlessSteps extends HelixHeadlessSteps_base {
32
29
  /**
33
- * Accessible name for the sequence.
30
+ * The sequence's name, read by screen readers.
34
31
  *
35
32
  * A list of stages is a landmark a reader arrives at out of order, so it
36
33
  * needs a name of its own rather than borrowing the heading above it.
@@ -5,28 +5,21 @@ import '../../button/index.js';
5
5
  * @summary One stage in a sequence.
6
6
  *
7
7
  * @description
8
- * **The name is a button, and only the name.** The marker is `aria-hidden`
9
- * decoration, so wrapping it would add hit area and no meaning. It is `Button`
10
- * rather than a `<button>` this element resets: the hover wash, the focus ring
11
- * and the disabled treatment are decisions the button carries.
8
+ * Only the step's name is a button. The marker is `aria-hidden` decoration, so
9
+ * it is outside the button. The name uses `Button`, so the hover wash, the
10
+ * focus ring, and the disabled style come from `Button`.
12
11
  *
13
- * **It says nothing about where a reader may go.** Every step is pressable and
14
- * announces itself with `helix-select`; refusing the ones ahead is `disabled`,
15
- * which the consumer sets, because only they know whether a form can be
16
- * skipped.
12
+ * Every step can be pressed and fires `helix-select`. To stop the user from
13
+ * moving to a step, set `disabled` on it.
17
14
  *
18
- * **The marker is a slot whose fallback is the state.** A finished stage shows
19
- * a check, the current one a target, one not yet reached an empty ring. Exactly
20
- * one is rendered, chosen from the step's own two booleans, rather than three
21
- * with two hidden in CSS: the accessibility tree would otherwise carry marks
22
- * that are not there.
15
+ * The marker is a slot, and its fallback shows the step's state: a check for a
16
+ * finished stage, a target for the current stage, and an empty ring for a stage
17
+ * not reached yet. Only that one mark is rendered, so the accessibility tree
18
+ * has no hidden marks.
23
19
  *
24
- * **The two half lines either side of the mark are a sheet's, on `::before` and
25
- * `::after` of the step.** Both are placed entirely from properties the list
26
- * hands down, so there was nothing about them for a box to carry, and this tier
27
- * ships no CSS: a box it rendered for one to paint would be an empty child
28
- * costing whatever the consumer's own layout charges for a child. `ListItem`
29
- * measured that.
20
+ * The half lines on each side of the mark are drawn on the step's `::before`
21
+ * and `::after` from properties the list sets, so the step renders no extra
22
+ * element for them.
30
23
  *
31
24
  * @since 0.1.0
32
25
  * @status stable
@@ -34,38 +27,38 @@ import '../../button/index.js';
34
27
  * @documentation https://fusion.dev/helix/components/steps
35
28
  *
36
29
  * @slot - The step's name.
37
- * @slot content - What the stage holds. Always rendered here, a tier with no stylesheet having nothing to fold it with, so whether it is folded away is the sheet's answer and not this tier's.
38
- * @slot description - A line under the name, for what the stage is for.
30
+ * @slot content - The stage's content. The headless tier always renders it, because it has no stylesheet to collapse it with. Your stylesheet decides whether it is collapsed.
31
+ * @slot description - A line under the name that describes the stage.
39
32
  * @slot marker - Replaces the number, or the check a complete step shows.
40
33
  *
41
- * @event {HelixSelectEvent} helix-select - Fired when the step is pressed. Cancelable: refusing it takes the decision and nothing moves.
34
+ * @event {HelixSelectEvent} helix-select - Fired when the step is pressed. Cancelable: cancel it to keep the current step.
42
35
  *
43
36
  * @csspart body - The name and its description.
44
37
  * @csspart content - What the stage holds, while it is open.
45
- * @csspart description - The line under it.
38
+ * @csspart description - The line under the name.
46
39
  * @csspart label - The step's name, which is a control.
47
- * @csspart label-button - The inner control.
40
+ * @csspart label-button - The button inside the label.
48
41
  * @csspart mark - The glyph inside the marker: a tick, a dot, or an empty ring.
49
42
  * @csspart marker - The shape carrying the number or the check.
50
43
  */
51
44
  export declare class HelixHeadlessStep extends HelixElement {
52
45
  /**
53
- * Whether the reader has finished this stage.
46
+ * Whether this stage is finished.
54
47
  */
55
48
  complete: boolean;
56
49
  /**
57
- * Whether this is the stage the reader is in.
50
+ * Whether this is the current stage.
58
51
  */
59
52
  current: boolean;
60
53
  /**
61
- * Whether the reader may go to this stage.
54
+ * Whether the stage is disabled, so the user cannot go to it.
62
55
  */
63
56
  disabled: boolean;
64
57
  /**
65
- * What this stage is called when it announces itself.
58
+ * The value the step sends in `helix-select`.
66
59
  */
67
60
  value: string;
68
- /** Announces the step, unless it is refusing. */
61
+ /** Fires `helix-select` for the step, unless the step is `disabled`. */
69
62
  select(): void;
70
63
  /**
71
64
  * The mark this stage's state calls for.
@@ -5,21 +5,18 @@ declare const HelixHeadlessSwitch_base: (new (...args: any[]) => import("@fusion
5
5
  * @summary A control that turns something on or off.
6
6
  *
7
7
  * @description
8
- * **A switch is not a checkbox with a different shape.** A checkbox is an
9
- * answer to a question the form asks when it is submitted; a switch is a thing
10
- * happening now. That is why `role="switch"` exists and why a switch belongs
11
- * outside a form as often as in one: it says "on" and "off" rather than
12
- * "ticked" and "unticked", and a reader expects the effect immediately rather
13
- * than on Save.
8
+ * A switch turns something on or off right away, and a checkbox is an answer
9
+ * the form submits later. A screen reader announces `role="switch"` as "on" or
10
+ * "off", and people expect the change to take effect immediately. A switch is
11
+ * as common outside a form as inside one.
14
12
  *
15
- * Rendered as a real `<input type="checkbox">` carrying `role="switch"`, which
16
- * is the pairing ARIA describes: the input is what a form submits and what a
17
- * label forwards a press to, and the role is what a screen reader announces.
18
- * Neither half can be got from the other.
13
+ * It renders a real `<input type="checkbox">` with `role="switch"`, the pairing
14
+ * ARIA describes. The input is what a form submits and what a label forwards a
15
+ * press to, and the role is what a screen reader announces.
19
16
  *
20
- * The label sits beside it, inside the `<label>` that forwards the press, the
21
- * way a checkbox's does. The hint and the message go under the row, because
22
- * there is no above: the switch and the words naming it are one line.
17
+ * The label sits beside the switch, inside the `<label>` that forwards the
18
+ * press, the same as a checkbox. The hint and the message go below the row,
19
+ * because the switch and its label share one line.
23
20
  *
24
21
  * @since 0.1.0
25
22
  * @status stable
@@ -27,25 +24,24 @@ declare const HelixHeadlessSwitch_base: (new (...args: any[]) => import("@fusion
27
24
  * @aliases Toggle switch, On/off
28
25
  * @documentation https://fusion.dev/helix/components/switch
29
26
  *
30
- * @slot - The words naming what this turns on.
27
+ * @slot - The label that names what the switch turns on.
31
28
  *
32
- * @event {Event} change - Relayed from the input once the state has changed.
29
+ * @event {Event} change - Sent from the input after the state changes.
33
30
  * @event {HelixBeforeToggleEvent} helix-before-toggle - Fired before the state changes, and cancelable.
34
- * @event {Event} input - Announced once the state has moved.
31
+ * @event {Event} input - Sent after the state changes.
35
32
  *
36
33
  * @csspart control - The input.
37
- * @csspart feedback - What is wrong with it.
34
+ * @csspart feedback - The message that says what is wrong.
38
35
  * @csspart field - The row: the track and its label.
39
36
  * @csspart hint - Help under the control, while nothing is wrong.
40
- * @csspart label - The words beside it.
41
- * @csspart track - The groove. The thumb that travels in it is drawn on the
42
- * groove itself, which is `::part(track)::after` from a consumer's sheet: this
43
- * tier ships no CSS, so a box it renders for one to paint is an empty child
44
- * costing whatever the consumer's own layout charges for a child. `ListItem`
45
- * measured that.
37
+ * @csspart label - The label beside the track.
38
+ * @csspart track - The track. Draw the thumb on the track itself, with
39
+ * `::part(track)::after` in your stylesheet. This tier ships no CSS, so it
40
+ * renders no separate thumb element, which would be an empty child that costs
41
+ * your layout as much as any other child. `ListItem` measured that cost.
46
42
  *
47
43
  * @cssstate checked - While it is on.
48
- * @cssstate invalid - While there is feedback to show: the platform's verdict, or the consumer's `feedback`.
44
+ * @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
49
45
  */
50
46
  export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
51
47
  protected readonly aria: AriaForwardController;
@@ -4,13 +4,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
4
4
  * @summary One cell of a table.
5
5
  *
6
6
  * @description
7
- * Carries its own role, because a grid of divs is not a table to anything
8
- * reading it. `header` makes the cell a `columnheader`, which is what lets a
9
- * screen reader announce "Attribute, appearance" rather than just the value.
7
+ * Sets its own role, because a grid of elements has no table structure for
8
+ * assistive technology otherwise. `header` makes the cell a `columnheader`, so
9
+ * a screen reader announces the heading with the value, for example "Attribute,
10
+ * appearance".
10
11
  *
11
- * The role goes on the host rather than inside the shadow root, because the
12
- * cell has to be a child of its row in the flat tree for the table's structure
13
- * to hold together.
12
+ * The role is on the host so the cell stays a child of its row in the flat
13
+ * tree, which keeps the table structure intact.
14
14
  *
15
15
  * @since 0.1.0
16
16
  * @status stable
@@ -19,14 +19,24 @@ import { type PropertyValues, type TemplateResult } from 'lit';
19
19
  *
20
20
  * @slot - The cell's content.
21
21
  *
22
- * @cssproperty --table-cell-align - The edge the column this cell sits under is set to, `start`, `center` or `end`, and unset under a column that sets none. Written by the table around it, since the cell is the consumer's markup and nothing is written onto it; read by the sheet that draws the cell, where `justify-content` and `text-align` both take it as it comes and both follow the writing direction.
22
+ * @cssproperty --table-cell-align - The text alignment of the column above the cell: `start`, `center`, or `end`, and unset when the column sets none. The table writes it, and the stylesheet that draws the cell reads it for `justify-content` and `text-align`, which both follow the writing direction.
23
+ *
24
+ * @cssstate text - The cell holds text of its own, beside or instead of elements, so the stylesheet lets its content flow as a line of text.
23
25
  */
24
26
  export declare class HelixHeadlessTableCell extends HelixElement {
25
27
  /**
26
- * Whether the cell heads its column.
28
+ * Whether the cell is the header cell of its column.
27
29
  */
28
30
  header: boolean;
29
31
  protected willUpdate(changed: PropertyValues): void;
32
+ /**
33
+ * Sets the `text` state from the cell's own content.
34
+ *
35
+ * Only text nodes count, and only ones with more than whitespace. A cell of
36
+ * elements alone keeps its elements laid out as they were, which is what a
37
+ * lone tag, button, or block of text wants.
38
+ */
39
+ private readonly handleSlotChange;
30
40
  protected render(): TemplateResult;
31
41
  }
32
42
  declare global {
@@ -11,13 +11,17 @@ let HelixHeadlessTableCell = class HelixHeadlessTableCell extends HelixElement {
11
11
  constructor() {
12
12
  super(...arguments);
13
13
  this.header = false;
14
+ this.handleSlotChange = () => {
15
+ const text = [...this.childNodes].some((node) => node.nodeType === Node.TEXT_NODE && (node.textContent ?? '').trim() !== '');
16
+ this.toggleState('text', text);
17
+ };
14
18
  }
15
19
  willUpdate(changed) {
16
20
  super.willUpdate(changed);
17
21
  hostAria(this.internals, { role: this.header ? 'columnheader' : 'cell' });
18
22
  }
19
23
  render() {
20
- return html `<slot></slot>`;
24
+ return html `<slot @slotchange=${this.handleSlotChange}></slot>`;
21
25
  }
22
26
  };
23
27
  __decorate([
@@ -31,51 +31,49 @@ export declare const at: (row: Readonly<Record<string, unknown>>, path: string)
31
31
  */
32
32
  export declare const edgeOf: (align: string | undefined) => string | undefined;
33
33
  /**
34
- * @summary One column of a table: its heading, how wide it is, and what it reads.
34
+ * @summary One column of a table: its heading, its width, and the field it reads from each row.
35
35
  *
36
36
  * @description
37
- * **The column is the source of both its heading and its track.** Add one and
38
- * the table has another track; remove one and it does not. That is what ties
39
- * the two together, and a table-level track list on its own does not: a list
40
- * that is accidentally the headings is invalid CSS a grid ignores in silence,
41
- * drawing the whole table as one column. `Table`'s `columns` is dealt out a
42
- * track at a time against the columns declared under it, so a heading among the
43
- * widths costs its own column a width and no more, and a list longer or shorter
44
- * than the columns is trimmed or shared rather than being a second count of
45
- * them. A column's own `width` wins over the track in its place.
37
+ * Each column provides both its heading and its grid track. Adding a column
38
+ * adds a track, and removing one removes it. `Table`'s `columns` is applied one
39
+ * track at a time to the columns declared under it:
46
40
  *
47
- * **It is also where every per-column fact goes**, which is the reason
48
- * `DataTable` needs no column config object. `field` names the key the cell
49
- * reads, `sortable` says a reader may reorder by it, `text-align` says which edge
50
- * the values line up against, and `cell` takes a function for anything the
51
- * field alone cannot express. The schema is markup and the data is a property:
52
- * a schema is small, declarative, and something a reader should be able to see
53
- * in the HTML, and data is large and windowed.
41
+ * - A heading name in the list affects only its own column's width.
42
+ * - A list longer or shorter than the columns is trimmed or shared.
43
+ * - A column's own `width` overrides the track in its place.
54
44
  *
55
- * **The same element serves both tables**, the markup one and the data one. It
56
- * is identified by a flag rather than by `instanceof`, so a `TableColumn` works
57
- * inside either without the two roots sharing anything else.
45
+ * This protects the table from a track list that contains the headings by
46
+ * mistake, which is invalid CSS that the grid ignores silently, drawing the
47
+ * whole table as one column.
58
48
  *
59
- * **It generates no box of its own**, the same as a row: the heading is a grid
60
- * item of the table, so it lines up with the cells under it rather than sitting
61
- * in a wrapper that has to be kept the same width.
49
+ * Every per-column setting goes on the column, so `DataTable` needs no column
50
+ * configuration object:
62
51
  *
63
- * **`hidden` takes the column out of the grid**, its heading and its track
64
- * both, so the columns after it keep their own widths and every row keeps its
65
- * cells under their headings. `hidden="until-found"` keeps its track, the
66
- * heading being left drawn, as every Helix element leaves one with that value.
67
- * `DataTable` draws the cells, so it leaves out the ones under a hidden column.
68
- * A `Table`'s cells are markup the consumer wrote, so hide them with the
69
- * column, as removing a column means removing its cells: a row with a cell more
70
- * than the table has tracks wraps into the next.
52
+ * - `field` names the key the cell reads.
53
+ * - `sortable` lets people sort by the column.
54
+ * - `text-align` sets which edge the values line up against.
55
+ * - `cell` takes a function for anything `field` alone cannot express.
71
56
  *
72
- * **A heading that does something holds a control that does it.** The host is
73
- * the column header, and a header is not focusable, so a sortable heading is a
74
- * `<button>` inside it: the pattern for a sortable table, and the only way a
75
- * reader on a keyboard reaches the sort at all. A column a reader may resize
76
- * carries a `separator` on its end edge, moved by dragging it or with the arrow
77
- * keys, and a column in a table that lets a reader reorder its columns carries
78
- * a grip the table moves.
57
+ * The same element works in both `Table` and `DataTable`. It is identified by a
58
+ * flag, so the two roots share nothing else.
59
+ *
60
+ * The column generates no box of its own, the same as a row. The heading is a
61
+ * grid item of the table, so it lines up with the cells below it.
62
+ *
63
+ * `hidden` takes the column out of the grid, both its heading and its track, so
64
+ * the other columns keep their widths and every row keeps its cells under their
65
+ * headings. `hidden="until-found"` keeps the track and leaves the heading
66
+ * drawn, as it does on every Helix element. `DataTable` leaves out the cells
67
+ * under a hidden column. In a `Table` the cells are markup you wrote, so hide
68
+ * them with the column: a row with more cells than the table has tracks wraps
69
+ * onto the next line.
70
+ *
71
+ * A heading that does something holds a control. A column header is not
72
+ * focusable, so a sortable heading contains a `<button>`, which is the pattern
73
+ * for a sortable table and the only way to reach the sort by keyboard. A
74
+ * resizable column has a `separator` on its end edge, moved by dragging or with
75
+ * the arrow keys. In a table with reorderable columns, each column has a grip
76
+ * that the table moves.
79
77
  *
80
78
  * @since 0.1.0
81
79
  * @status stable
@@ -84,20 +82,21 @@ export declare const edgeOf: (align: string | undefined) => string | undefined;
84
82
  *
85
83
  * @slot - The heading.
86
84
  *
87
- * @event {HelixBeforeResizeEvent} helix-before-resize - Fired as a reader resizes the column, with the width asked for, and cancelable.
85
+ * @event {HelixBeforeResizeEvent} helix-before-resize - The column is about to be resized, with the requested width. Cancelable: cancel it to keep the current width.
88
86
  *
89
87
  * @csspart column - The heading cell.
90
- * @csspart grip - The handle a reader moves the column by, where the table allows it.
91
- * @csspart grip-mark - The glyph on it.
92
- * @csspart resizer - The edge a reader drags to change the width, where the column allows it.
93
- * @csspart sort - The button a sortable heading is.
88
+ * @csspart grip - The handle for moving the column, when the table allows it.
89
+ * @csspart grip-mark - The icon on the grip.
90
+ * @csspart resizer - The edge that is dragged to change the width, when the column is resizable.
91
+ * @csspart sort - The button that a sortable heading renders as.
94
92
  *
95
93
  * @cssstate sorted-ascending - While the table is sorted by this column, smallest first.
96
94
  * @cssstate sorted-descending - While the table is sorted by this column, largest first.
97
95
  */
98
96
  export declare class HelixHeadlessTableColumn extends HelixElement {
99
97
  /**
100
- * How to read the cell, where the field alone will not do.
98
+ * A function that reads the cell's content from a row, for cells that `field`
99
+ * alone cannot read.
101
100
  *
102
101
  * A property and not an attribute, because it is a function. Set it from a Lit
103
102
  * template with `.cell=${...}`, or assign it in script. A column with neither
@@ -106,7 +105,8 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
106
105
  */
107
106
  cell: CellReader | undefined;
108
107
  /**
109
- * How to read the value that gets sorted and filtered, where it is not the cell.
108
+ * A function that reads the value used for sorting and filtering, when it
109
+ * differs from the cell.
110
110
  *
111
111
  * **The one that is easy to leave out and expensive to add later.** A cell
112
112
  * showing `2.4 MB` sorts as a string unless something says the underlying value
@@ -132,15 +132,15 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
132
132
  */
133
133
  field: string;
134
134
  /**
135
- * What the grip that moves the column is called, with the heading's words as
136
- * `{name}`.
135
+ * The accessible name of the grip that moves the column. `{name}` is replaced
136
+ * with the heading text.
137
137
  *
138
138
  * **Every word a column speaks is a property**, so a table in another
139
139
  * language hears its own rather than English around its own headings.
140
140
  */
141
141
  moveLabel: string;
142
142
  /**
143
- * Whether a reader may change this column's width.
143
+ * Whether the column can be resized.
144
144
  *
145
145
  * By dragging the edge at the end of the heading, or with the arrow keys once
146
146
  * it has focus, a step at a time and four with Shift. The width lands in
@@ -149,12 +149,12 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
149
149
  */
150
150
  resizable: boolean;
151
151
  /**
152
- * What the separator that resizes the column is called, with the heading's
153
- * words as `{name}`.
152
+ * The accessible name of the separator that resizes the column. `{name}` is
153
+ * replaced with the heading text.
154
154
  */
155
155
  resizeLabel: string;
156
156
  /**
157
- * Whether a reader may reorder the set by this column.
157
+ * Whether the table can be sorted by this column.
158
158
  *
159
159
  * Ignored without a `field`, and silently: a column with nothing to sort by
160
160
  * has no order to offer, and refusing loudly would mean an actions column
@@ -226,7 +226,8 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
226
226
  */
227
227
  width: string;
228
228
  /**
229
- * How the separator reads out the column's width, with `{width}` filled in.
229
+ * The text screen readers announce for the column's width. `{width}` is
230
+ * replaced with the width.
230
231
  */
231
232
  widthLabel: string;
232
233
  /**
@@ -257,7 +258,7 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
257
258
  /** Watches `hidden`, which is the platform's attribute and no property of this element's. */
258
259
  private hiding;
259
260
  /**
260
- * The narrowest a reader can drag a column, in pixels.
261
+ * The narrowest width a column can be dragged to, in pixels.
261
262
  *
262
263
  * Three characters and the inset around them. Narrower and the heading has
263
264
  * nothing left to be read by, and the separator is a grab target with no
@@ -275,7 +276,10 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
275
276
  * exactly when the heading stops being drawn.
276
277
  */
277
278
  get shown(): boolean;
278
- /** Whether a reader can actually reorder by this column. */
279
+ /**
280
+ * Whether the table can be sorted by this column, which needs `sortable` and
281
+ * a `field`.
282
+ */
279
283
  get canSort(): boolean;
280
284
  /**
281
285
  * The value this column shows for a row.
@@ -285,7 +289,10 @@ export declare class HelixHeadlessTableColumn extends HelixElement {
285
289
  * default back for the rows it has nothing to say about.
286
290
  */
287
291
  read(row: Readonly<Record<string, unknown>>): unknown;
288
- /** The value this column sorts and filters by, which is not always what it shows. */
292
+ /**
293
+ * The value this column sorts and filters by for a row, which can differ from
294
+ * what it shows.
295
+ */
289
296
  order(row: Readonly<Record<string, unknown>>): unknown;
290
297
  protected willUpdate(changed: PropertyValues): void;
291
298
  /** The words of the heading, for naming the controls on it. */
@@ -3,23 +3,22 @@ import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import { type HelixHeadlessTableColumn } from '../column/table-column.js';
4
4
  declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.dev/helix-core").CollectionElement) & typeof HelixElement;
5
5
  /**
6
- * @summary Tabular data laid out on a grid.
6
+ * @summary A table of data, laid out on a grid.
7
7
  *
8
8
  * @description
9
- * A grid rather than a `<table>`, so every column lines up across rows while
9
+ * Lays out the rows on a CSS grid, so every column lines up across rows and
10
10
  * each row stays a real element that can be styled, hidden, or made
11
- * interactive. Table layout gives column alignment and takes away almost
12
- * everything else; grid gives both.
11
+ * interactive. A `<table>` layout aligns columns but limits almost everything
12
+ * else.
13
13
  *
14
- * The cost is that the roles have to be declared, since a grid of divs is not a
15
- * table to anyone reading it. `table`, `row`, `cell`, and `columnheader` are
16
- * all set explicitly, and rows are `display: contents` so their cells become
17
- * items of the one grid that does the aligning.
14
+ * A grid of elements has no table structure for assistive technology, so the
15
+ * roles are set explicitly: `table`, `row`, `cell`, and `columnheader`. Rows
16
+ * are `display: contents`, so their cells become items of the one grid.
18
17
  *
19
- * The properties below are written by this component and read by whoever draws
20
- * it. A consumer sets none of them: they carry a number this element computed
21
- * and CSS cannot, which is what lets a stylesheet on this tier draw the thing
22
- * without measuring anything itself.
18
+ * The CSS custom properties listed for this component are written by it and
19
+ * read by the stylesheet that draws it. Do not set them. Each holds a number
20
+ * the component computes and CSS cannot, so the stylesheet can draw the table
21
+ * without measuring anything.
23
22
  *
24
23
  * @since 0.1.0
25
24
  * @status stable
@@ -29,13 +28,13 @@ declare const HelixHeadlessTable_base: (new (...args: any[]) => import("@fusion.
29
28
  *
30
29
  * @slot - The table's rows.
31
30
  *
32
- * @csspart empty - Shown when there are no rows to show.
33
- * @csspart head - The row the column headings sit in. `display: contents`, so it takes no space.
34
- * @csspart live - The empty and loading lines again, in a region a screen reader hears when they change. Visually hidden in the styled tier.
35
- * @csspart loading - Shown while the rows are still on their way.
31
+ * @csspart empty - The text shown when there are no rows.
32
+ * @csspart head - The row that holds the column headings. It has `display: contents`, so it takes no space of its own.
33
+ * @csspart live - A live region that repeats the empty and loading text, so screen readers announce it when it changes. Visually hidden in the styled tier.
34
+ * @csspart loading - The text shown while the rows are loading.
36
35
  * @csspart table - The grid.
37
36
  *
38
- * @cssproperty --table-template - The column track list this element worked out from the columns declared in it. Written by the component, read by the sheet that paints: a stylesheet takes it to lay the grid out, and setting it does nothing, because the component writes it inline on the very element that reads it and an inline declaration beats any sheet. `columns` is the one to set.
37
+ * @cssproperty --table-template - The column track list the table works out from its columns. The component writes it inline on the element that reads it, so setting it has no effect. Set `columns` to change the tracks.
39
38
  */
40
39
  export declare class HelixHeadlessTable extends HelixHeadlessTable_base {
41
40
  /**
@@ -5,9 +5,9 @@ import { type PropertyValues, type TemplateResult } from 'lit';
5
5
  *
6
6
  * @description
7
7
  * The row renders its cells straight through and lays out none of them, so a
8
- * sheet can take them into the table's own grid and every column lines up
9
- * across every row. The row still exists as an element, which is what a
10
- * `<table>` gives away when its cells are laid out by the table algorithm.
8
+ * stylesheet can place them in the table's grid and every column lines up
9
+ * across rows. The row still exists as an element, so you can style it, hide
10
+ * it, or make it interactive.
11
11
  *
12
12
  * @since 0.1.0
13
13
  * @status stable
@@ -4,9 +4,9 @@ import { type PropertyValues, type TemplateResult } from 'lit';
4
4
  * @summary The content shown for one tab.
5
5
  *
6
6
  * @description
7
- * Hidden rather than unmounted when inactive, so anything typed into a panel is
8
- * still there when the reader comes back to it, and so the content is in the
9
- * server's markup for a crawler regardless of which tab is open.
7
+ * An inactive panel is hidden and stays mounted. Anything typed into it is
8
+ * still there when the person comes back, and the content of every panel is in
9
+ * the server-rendered markup for crawlers, whichever tab is open.
10
10
  *
11
11
  * @since 0.1.0
12
12
  * @status stable