@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
@@ -5,13 +5,12 @@ import type { FilterGrammarOperator } from '../grammar.js';
5
5
  import '../../divider/index.js';
6
6
  import '../../menu/index.js';
7
7
  /**
8
- * @summary The control that builds a filter: pick a field, tick its values.
8
+ * @summary A menu for building a filter by picking a field and checking its values.
9
9
  *
10
10
  * @description
11
- * **It reads the declarations and renders a menu.** A consumer writes their
12
- * fields as `FilterField`s inside this, and what comes out is a two level menu:
13
- * the fields, and under each one its comparisons and its values. Nothing here
14
- * knows what a field means, which is the line `FilterField` already draws.
11
+ * Reads the `FilterField` declarations inside it and renders a two-level menu:
12
+ * the fields, and under each field its operators and values. The menu does not
13
+ * interpret what a field means.
15
14
  *
16
15
  * ```html
17
16
  * <helix-headless-filter-menu label="Filter">
@@ -21,33 +20,36 @@ import '../../menu/index.js';
21
20
  * </helix-headless-filter-menu>
22
21
  * ```
23
22
  *
24
- * That field declares no comparisons and so is offered `is any of` and `is none
25
- * of`, which are the two the typed grammar can say. The menu and the text end up
26
- * offering the same filters because both read `FilterField.vocabulary`, and a
27
- * consumer whose field needs other words declares them there.
23
+ * That field declares no operators, so it offers `is any of` and `is none of`,
24
+ * the two the typed grammar supports. The menu and the typed text offer the
25
+ * same filters because both read `FilterField.vocabulary`. Declare other
26
+ * operators on the field when you need them.
28
27
  *
29
- * **A tick is a filter, immediately.** There is no Apply: ticking a value
30
- * announces the field's whole set as it now stands, so a queue narrows as the
31
- * reader works rather than after they have finished. Unticking the last value
32
- * announces an empty set, which is a consumer's cue to drop the chip.
28
+ * Ticking a value applies the filter immediately. There is no Apply button.
29
+ * Each tick fires `helix-facet` with the field's whole set of values, so
30
+ * results narrow as the user works. Unticking the last value fires an empty
31
+ * set, which is your cue to remove the chip.
33
32
  *
34
- * **The operator is chosen here and written nowhere else.** `helix-facet` carries
35
- * `operatorLabel` empty when the comparison is the field's default, which is
36
- * exactly what a chip's `operator-label` wants: the segment appears only where
37
- * somebody picked something worth noticing. Deciding it here is the point, since
38
- * this is the only thing that has read both the field and its operators.
33
+ * The operator is chosen in the menu. `helix-facet` carries an empty
34
+ * `operatorLabel` when the operator is the field's default, which is the value
35
+ * a chip's `operator-label` expects, so the operator segment appears only for a
36
+ * non-default choice. The menu decides this because it is the only element that
37
+ * reads both the field and its operators.
39
38
  *
40
- * **How many values a comparison takes decides what is under it.** A field
41
- * whose comparison is `arity="none"`, `is empty` or `is set`, is offered no
42
- * values at all and gives back any that were ticked: the comparison is the whole
43
- * filter. One at `arity="one"` offers its values as a single choice, so pressing
44
- * another replaces it and pressing the one already on clears it. Both announce
45
- * `arity` in the facet, which is what lets a consumer tell an empty filter from
46
- * no filter at all.
39
+ * An operator's `arity` sets what appears under it:
47
40
  *
48
- * **It applies nothing.** The chips are the consumer's markup and the rows are
49
- * their data, so this announces and stops, the way `Notification` reports a read
50
- * rather than inventing one. Refusing `helix-facet` refuses the change.
41
+ * - `arity="none"`, such as `is empty` or `is set`, offers no values and clears
42
+ * any that were ticked. The operator is the whole filter.
43
+ * - `arity="one"` offers the values as a single choice. Pressing another value
44
+ * replaces the choice, and pressing the chosen value clears it.
45
+ *
46
+ * `helix-facet` includes `arity`, so you can tell an empty filter from no
47
+ * filter.
48
+ *
49
+ * The menu applies nothing. The chips are your markup and the rows are your
50
+ * data, so the menu fires the event and leaves the change to you, as
51
+ * `Notification` does for a read. Call `preventDefault()` on `helix-facet` to
52
+ * cancel the change.
51
53
  *
52
54
  * @since 0.25.0
53
55
  * @status stable
@@ -55,31 +57,31 @@ import '../../menu/index.js';
55
57
  * @aliases FacetPicker, FilterBuilder
56
58
  * @documentation https://fusion.dev/helix/components/filter-input
57
59
  *
58
- * @slot - The fields this can filter by, as `FilterField`s. Read rather than rendered.
59
- * @slot trigger - The control that opens the menu. A `Button` is the usual one.
60
+ * @slot - The fields the menu can filter by, as `FilterField`s. The menu reads them and does not render them.
61
+ * @slot trigger - The control that opens the menu, usually a `Button`.
60
62
  *
61
- * @event {HelixFacetEvent} helix-facet - Fired when a field's values change. Cancelable: refusing it takes the decision and nothing moves.
63
+ * @event {HelixFacetEvent} helix-facet - Fired when a field's values change. Cancelable: call `preventDefault()` to keep the previous values.
62
64
  *
63
- * @csspart divider - The rule between a field's comparisons and its values.
64
- * @csspart divider-content - What is set into the rule.
65
- * @csspart divider-line - The rule itself.
66
- * @csspart entry - One row: a field, its comparison, an operator or a value.
65
+ * @csspart divider - The line between a field's comparisons and its values.
66
+ * @csspart divider-content - The content set into the line.
67
+ * @csspart divider-line - The line itself.
68
+ * @csspart entry - One row: a field, its comparison, an operator, or a value.
67
69
  * @csspart entry-item - The row itself.
68
- * @csspart entry-mark - The trailing mark: a tick on a chosen value, a caret on a field.
70
+ * @csspart entry-mark - The mark at the end of a row: a check mark on a chosen value, and a caret on a field.
69
71
  * @csspart entry-start - The leading column.
70
72
  * @csspart menu - The menu the fields are offered in.
71
- * @csspart menu-back - The control that returns from a field's page.
72
- * @csspart menu-back-mark - The glyph on the back control.
73
+ * @csspart menu-back - The button that goes back from a field's page.
74
+ * @csspart menu-back-mark - The icon on the back button.
73
75
  * @csspart menu-empty - Shown when there are no fields to offer.
74
- * @csspart menu-header - The bar above a field's page, holding the way back and its name.
75
- * @csspart menu-live - The inner menu's `live`, the region a screen reader hears its empty and loading lines from.
76
- * @csspart menu-loading - Shown while the fields are still on their way.
76
+ * @csspart menu-header - The bar above a field's page, with the back button and the field's name.
77
+ * @csspart menu-live - The inner menu's `live` part: the region that screen readers announce the empty and loading messages from.
78
+ * @csspart menu-loading - Shown while the fields are loading.
77
79
  * @csspart menu-surface - The floating panel the menu is drawn on.
78
80
  * @csspart menu-title - The name of the field whose page is showing.
79
81
  */
80
82
  export declare class HelixHeadlessFilterMenu extends HelixElement {
81
83
  /**
82
- * Accessible name for the menu.
84
+ * The menu's name, read by screen readers.
83
85
  */
84
86
  label: string;
85
87
  /**
@@ -94,7 +96,7 @@ export declare class HelixHeadlessFilterMenu extends HelixElement {
94
96
  /** Which comparison each field is using, where the reader chose one. */
95
97
  private readonly comparisons;
96
98
  /**
97
- * The fields declared inside this, in the order they were written.
99
+ * The fields declared inside the menu, in source order.
98
100
  *
99
101
  * What a render may know of them: none on a server, whose shim has no tree
100
102
  * and threw here, and none while hydrating what one sent.
@@ -107,11 +109,11 @@ export declare class HelixHeadlessFilterMenu extends HelixElement {
107
109
  */
108
110
  get fields(): HelixHeadlessFilterField[];
109
111
  protected firstUpdated(changed: PropertyValues): void;
110
- /** What is ticked for one field, as the consumer's own values. */
112
+ /** The values checked for one field. */
111
113
  valuesFor(field: string): readonly string[];
112
114
  /**
113
- * Which comparison a field is using: the reader's choice, then the one the
114
- * field marked, then the first one it supports.
115
+ * The comparison a field uses: the one the user chose, or the field's
116
+ * `default`, or the first one the field supports, in that order.
115
117
  *
116
118
  * **The last of those is not a fallback for nothing, it is the scalar case.**
117
119
  * A date supports `after` and nothing else and marks no default, because there
@@ -135,7 +137,8 @@ export declare class HelixHeadlessFilterMenu extends HelixElement {
135
137
  */
136
138
  private announce;
137
139
  /**
138
- * Filters a field by these values, announcing it the way a tick does.
140
+ * Filters a field by the given values and sends `helix-facet`, as checking a
141
+ * value does.
139
142
  *
140
143
  * **The one way this element's state changes**, whether the move came from a
141
144
  * row here, from a filter typed into the field around it, or from a chip
@@ -4,23 +4,18 @@ import { nothing, type PropertyValues } from 'lit';
4
4
  * @summary One way a filter can compare a field to its values.
5
5
  *
6
6
  * @description
7
- * **A declaration, not a control.** It renders nothing and is never seen: it is
8
- * how a consumer says which comparisons their field supports, in markup, beside
9
- * the values it supports them on. `Field` reads them; the chip shows the one in
10
- * force; the menu offers the rest.
7
+ * Declares one operator a field supports. It renders nothing. Write operators
8
+ * in markup beside the field's values. `FilterField` reads them, the chip shows the
9
+ * one in use, and the menu offers the rest.
11
10
  *
12
- * **The vocabulary is the consumer's and this element never learns it.** What
13
- * `is none of` means against a queue of refunds is a question about refunds, so
14
- * nothing here compares anything or knows what `name` will be handed to. Helix
15
- * owns the shape a filter has, which is a field, an operator and some values,
16
- * and owns the interaction that builds one. What the words mean is the domain's,
17
- * which is the same line `FilterInput` already draws when it declines to learn a
18
- * grammar.
11
+ * Helix defines the shape of a filter, which is a field, an operator, and
12
+ * values, and the interaction that builds one. The meaning of each operator
13
+ * belongs to your domain: the element compares nothing and does not interpret
14
+ * `name`.
19
15
  *
20
- * **`default` is what makes a chip readable.** The operator a field is usually
21
- * filtered by is the one nobody needs told, so a chip drawn with it says only
22
- * the field and the values. Naming a second operator `default` on one field is a
23
- * consumer bug and the field reports it rather than guessing.
16
+ * Mark the field's usual operator `default`. A chip with the default operator
17
+ * shows only the field and the values. Marking a second operator `default` on
18
+ * one field is an error, and the field reports it.
24
19
  *
25
20
  * @since 0.23.0
26
21
  * @status stable
@@ -30,7 +25,7 @@ import { nothing, type PropertyValues } from 'lit';
30
25
  */
31
26
  export declare class HelixHeadlessFilterOperator extends HelixElement {
32
27
  /**
33
- * How many values this comparison takes.
28
+ * How many values the comparison takes.
34
29
  *
35
30
  * `none` is a comparison that is complete on its own, which is what `is empty`
36
31
  * and `is set` are: a chip drawn for one shows no values because there are
@@ -60,8 +55,8 @@ export declare class HelixHeadlessFilterOperator extends HelixElement {
60
55
  */
61
56
  arity?: 'many' | 'none' | 'one';
62
57
  /**
63
- * Whether this is the comparison the field is filtered by unless asked
64
- * otherwise.
58
+ * Marks the comparison as the field's usual one, used unless the user picks
59
+ * another.
65
60
  *
66
61
  * The chip leaves a default operator unwritten, so the common filter reads as
67
62
  * a field and its values and nothing else, and the word only appears once
@@ -69,7 +64,7 @@ export declare class HelixHeadlessFilterOperator extends HelixElement {
69
64
  */
70
65
  default: boolean;
71
66
  /**
72
- * What a reader is shown, in the chip and in the menu that changes it.
67
+ * The comparison's text, shown on the chip and in the menu that changes it.
73
68
  *
74
69
  * Words rather than symbols, and the reason is that a set has more than one
75
70
  * negation: `!=` cannot tell "is none of" from "is not all of", and both are
@@ -78,7 +73,7 @@ export declare class HelixHeadlessFilterOperator extends HelixElement {
78
73
  */
79
74
  label: string;
80
75
  /**
81
- * What the consumer's own model calls this comparison.
76
+ * The comparison's name in your data model.
82
77
  *
83
78
  * Never shown. It is what arrives in the filter this element helps build, so
84
79
  * a consumer matches on it rather than on the words a reader sees, and
@@ -3,83 +3,64 @@ import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import type { HelixHeadlessFilterField } from '../field/filter-field.js';
4
4
  declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinTokensInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
5
5
  /**
6
- * @summary A field that narrows something else, beside what is already narrowing it.
6
+ * @summary A text field for filters, with the active filters shown in it as tokens.
7
7
  *
8
8
  * @description
9
- * **The tokens are the consumer's own elements, slotted.** What a filter narrows
10
- * by belongs to the consumer's model rather than to this element: a facet with a
11
- * prefix, a saved query, a range. So they are slotted rather than rendered from
12
- * a list of strings, and removing one is a request this element makes rather
13
- * than a change it applies. Combobox is the other way round, and that is the
14
- * difference between the two: its tokens are a view of a selection it owns,
15
- * drawn from options it was handed.
9
+ * Tokens are your own elements, slotted in. A filter can be a facet with a
10
+ * prefix, a saved query, or a range, and these belong to your model, so the
11
+ * element does not render tokens from a list of strings. Removing a token is a
12
+ * request the element fires, and you apply it. Combobox works the other way:
13
+ * its tokens show a selection it owns, drawn from the options it was given.
16
14
  *
17
- * **`value` is the text being typed, not the tokens**, which is what makes this
18
- * a field a consumer can listen to. Every keystroke announces `input` with the
19
- * text on the element, so a table narrows as the reader types. The tokens need
20
- * no reporting back, being markup the consumer already holds.
15
+ * `value` is the typed text. Every keystroke fires `input` with the text on the
16
+ * element, so a table can narrow as the user types. Tokens are not reported,
17
+ * because they are markup you already hold. Backspace in an empty field fires
18
+ * `helix-dismiss` on the last token, the same event its remove control fires,
19
+ * so one handler covers the pointer and the keyboard.
21
20
  *
22
- * Backspace on an empty field asks the last token to go, through the same
23
- * `helix-dismiss` its own remove control fires, so a consumer who handled the
24
- * pointer has already handled the keyboard.
21
+ * **Typed filters.** The field parses only the fields you declare. Write
22
+ * `FilterField` elements, usually inside the `FilterMenu` slotted into `start`,
23
+ * so the picker and the text share one set. On Enter, the field reads the text
24
+ * against them. `disposition:refunded,settled` and `-disposition:refunded` fire
25
+ * `helix-facet` exactly as ticking those values in the picker would, and the
26
+ * parsed text is removed. Everything else stays, so `refund tuesday
27
+ * disposition:settled` is a filter and a search at once. Helix defines the
28
+ * punctuation and you define every word. `grammar.ts` has the full rule, so
29
+ * read it before you rely on it. A field with no `FilterField` in it parses
30
+ * nothing.
25
31
  *
26
- * **It reads what was declared, and nothing that was not.** Write
27
- * `FilterField`s (usually inside the `FilterMenu` slotted into `start`, so the
28
- * picker and the text work off one set), and Enter reads the box against them:
29
- * `disposition:refunded,settled` and `-disposition:refunded` announce
30
- * `helix-facet`, exactly as ticking those values in the picker would, and the
31
- * text they were read from goes. Everything else stays where it was typed, so
32
- * `refund tuesday disposition:settled` is a filter and a search at once.
33
- * `grammar.ts` carries the whole rule and is worth reading before relying on it;
34
- * the short version is that Helix owns the punctuation and the consumer owns
35
- * every word in it. A field with no `FilterField` in it parses nothing, which is
36
- * the behavior this had before it could.
32
+ * A field whose values cannot be listed, such as `assignee:ada`, goes directly
33
+ * inside this element, outside the menu. It is not assigned to a slot, so
34
+ * nothing draws it and the menu has no page for it, and the grammar still reads
35
+ * it.
37
36
  *
38
- * **A field whose values cannot be listed belongs here rather than in the
39
- * picker.** `assignee:ada` is a filter and nobody wants to enumerate every name
40
- * in the company, but a menu page for it would have nothing on it to press.
41
- * Written directly inside this element it is read by the grammar and never
42
- * offered as a page: unslotted, so nothing draws it, which is the same trick
43
- * `FilterField` already plays on its own children.
37
+ * **Suggestions.** Slot options into `suggestions` and the field shows them,
38
+ * moves through them with the arrow keys, and presses one on Enter. The option
39
+ * fires its own `helix-select`, and you decide what choosing it means. Keys
40
+ * before a colon and values after it use the same panel with different
41
+ * contents. `readFilterText` is exported so you can narrow the panel against
42
+ * partly typed text. The panel opens when it has options and closes when it has
43
+ * none, and a choice does not close it, so after picking a key you see its
44
+ * values next. Use `selectionStart` and `setSelectionRange` to write a
45
+ * completion back and put the caret after it, or the next parse reads the wrong
46
+ * term.
44
47
  *
45
- * **It can suggest what to type next, and deciding what to suggest is still the
46
- * consumer's.** Slot options into `suggestions` and the field shows them, moves
47
- * through them with the arrows, and lets Enter press one; the option fires its
48
- * own `helix-select` and the consumer decides what choosing meant. Keys before
49
- * a colon and values after it are the same panel with different contents, and
50
- * `readFilterText` is exported for a consumer narrowing that panel against what
51
- * a reader has half typed.
48
+ * **State.** Three things have three different owners:
52
49
  *
53
- * **The panel opens when there is something in it and closes when there is
54
- * not**, rather than on a choice. A reader who picks a key wants its values
55
- * next, and closing on the choice would shut the panel between two renders. Use
56
- * `selectionStart` and `setSelectionRange` to write a completion back and put
57
- * the caret after it, or the next parse reads the wrong term.
58
- *
59
- * **Three things here have three different owners.**
60
- *
61
- * `value` is the text: the reader types, the element applies it, and `input`
62
- * says so. **Writing `value` does not take that over.** It is a seed and a
63
- * correction, so a consumer who sets it and then expects the field to hold
64
- * still will watch the next keystroke overwrite them.
65
- * Ownership is taken by refusing `helix-before-change` and writing the value
66
- * you want, which is the same shape every field in this library uses and is
67
- * worth saying out loud here because the property looks like React's.
68
- * `default-value` seeds the field without claiming anything.
69
- *
70
- * `open` is the suggestions panel, and it is the ordinary pair: refuse
71
- * `helix-before-open` or `helix-before-close` to take the decision, and
72
- * `default-open` to seed it.
73
- *
74
- * The tokens are neither, because they are not state. They are the consumer's
75
- * own elements in a slot, so there is nothing for this to own and nothing to
76
- * report back: a token goes when the consumer removes it from their markup,
77
- * having been asked by `helix-dismiss`. **A `FilterChip` naming a declared field
78
- * is asked differently**, and it has to be: the picker holds what is ticked, so
79
- * a chip that removed itself without telling it left the value ticked in a list
80
- * nobody could see was wrong. That dismissal is answered as the field being
81
- * filtered by nothing, so it arrives as `helix-facet` like every other change
82
- * and the chip goes because the filter went.
50
+ * - `value` is the text. The user types, the element applies it, and `input`
51
+ * reports it. Setting `value` seeds or corrects the text, and the next
52
+ * keystroke overwrites it, even in React. To control the value, cancel
53
+ * `helix-before-change` and write the value you want, as with every field in
54
+ * this library. `default-value` seeds the field.
55
+ * - `open` is the suggestions panel. Cancel `helix-before-open` or
56
+ * `helix-before-close` to control it, and use `default-open` to seed it.
57
+ * - Tokens are your elements in a slot and hold no state. A token goes when you
58
+ * remove it from your markup after `helix-dismiss`. A `FilterChip` naming a
59
+ * declared field works differently, because the picker holds what is ticked
60
+ * and removing the chip alone would leave its value ticked in the hidden
61
+ * menu. Its dismissal is treated as the field being filtered by nothing, so
62
+ * it fires `helix-facet` like every other change, and the chip goes when the
63
+ * filter goes.
83
64
  *
84
65
  * @since 0.1.0
85
66
  * @status stable
@@ -87,41 +68,41 @@ declare const HelixHeadlessFilterInput_base: (new (...args: any[]) => import("@f
87
68
  * @aliases SearchField, FacetInput, TokenInput
88
69
  * @documentation https://fusion.dev/helix/components/filter-input
89
70
  *
90
- * @slot end - After the text, for a count or a control.
91
- * @slot start - Before the text, for a search icon.
92
- * @slot suggestions - What could be typed next, as `Option`s, and `Option.Group`s of them.
93
- * @slot tags - What is already narrowing the results, as `FilterChip`s or `Tag`s.
71
+ * @slot end - Content after the text, such as a count or a control.
72
+ * @slot start - Content before the text, such as a search icon.
73
+ * @slot suggestions - Suggestions for what to type next, as `Option`s and `Option.Group`s.
74
+ * @slot tags - The active filters, as `FilterChip`s or `Tag`s.
94
75
  *
95
- * @event {Event} change - Relayed from the input once the reader has finished.
96
- * @event {HelixBeforeChangeEvent} helix-before-change - Fired as the text changes, and cancelable.
97
- * @event {HelixBeforeCloseEvent} helix-before-close - Fired before the suggestions go, and cancelable.
98
- * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the suggestions show, and cancelable.
99
- * @event {HelixDismissEvent} helix-dismiss - A token asking to go, from its close control or from Backspace on an empty field. A `FilterChip` naming a declared field is answered as `helix-facet` instead. Cancelable: refusing it takes the decision and the token stays.
100
- * @event {HelixFacetEvent} helix-facet - Fired when a filter changes, whether read out of the text, picked, or dismissed. Cancelable: refusing it leaves the text and the chip where they were.
101
- * @event {HelixSelectEvent} helix-select - A suggestion was chosen: the option's own, heard here because it bubbles out of `suggestions`. Cancelable: refusing it takes the decision from any other listener, and this field never acts on a choice itself, since what it means is the page's.
102
- * @event {Event} input - Announced once the text has moved.
103
- * @event {Event} toggle - Says the panel moved, carrying `newState` and `oldState`.
76
+ * @event {Event} change - Fired from the input when the user finishes editing the text.
77
+ * @event {HelixBeforeChangeEvent} helix-before-change - Fired as the text changes. Cancelable: call `preventDefault()` to keep the current text.
78
+ * @event {HelixBeforeCloseEvent} helix-before-close - Fired before the suggestions close. Cancelable: call `preventDefault()` to keep them open.
79
+ * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the suggestions open. Cancelable: call `preventDefault()` to keep them closed.
80
+ * @event {HelixDismissEvent} helix-dismiss - Fired when the user removes a token with its remove button or with Backspace in an empty field. A `FilterChip` that names a declared field sends `helix-facet` instead. Cancelable: call `preventDefault()` to keep the token.
81
+ * @event {HelixFacetEvent} helix-facet - Fired when a filter changes, whether it was typed, picked, or removed. Cancelable: call `preventDefault()` to leave the text and the chip as they were.
82
+ * @event {HelixSelectEvent} helix-select - Fired by an option in `suggestions` when it is chosen, and bubbles out of the field. Cancelable: call `preventDefault()` to stop other listeners acting on it. The field takes no action on a choice; you decide what it does.
83
+ * @event {Event} input - Fired when the text changes.
84
+ * @event {Event} toggle - Fired when the suggestions panel opens or closes, with `newState` and `oldState`.
104
85
  *
105
86
  * @csspart clear - The button that empties the field.
106
87
  * @csspart control - The input itself.
107
- * @csspart feedback - What is wrong with it.
108
- * @csspart field - The box holding everything.
109
- * @csspart hint - Help under the field, while nothing is wrong.
110
- * @csspart label - The question, over the field.
111
- * @csspart lead - The box before the text, holding whatever is slotted into `start`.
112
- * @csspart rest - How many tokens did not fit. A `<button>` with `expandable`, a `<span>` without it.
88
+ * @csspart feedback - The error message under the field.
89
+ * @csspart field - The box that holds everything.
90
+ * @csspart hint - The help text under the field, shown while there is no error.
91
+ * @csspart label - The label above the field.
92
+ * @csspart lead - The box before the text that holds the `start` slot.
93
+ * @csspart rest - The count of tokens that did not fit. It is a `<button>` with `expandable` and a `<span>` without it.
113
94
  * @csspart surface - The floating panel the suggestions sit in.
114
95
  * @csspart tags - The row the tokens sit in.
115
96
  *
116
- * @cssstate invalid - While there is feedback to show: the platform's verdict, or the consumer's `feedback`.
117
- * @cssstate open - While the suggestions are open.
97
+ * @cssstate invalid - The field has an error to show, from the browser's validation or from your `feedback`.
98
+ * @cssstate open - The suggestions are open.
118
99
  */
119
100
  export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_base {
120
101
  protected readonly aria: AriaForwardController;
121
102
  /** Typed, so every keystroke is announced. See `announcesInput`. */
122
103
  protected readonly announcesInput = true;
123
104
  /**
124
- * Whether the field offers a button that empties it.
105
+ * Shows a button that empties the field.
125
106
  *
126
107
  * The text only. The tokens are the consumer's markup and this element is not
127
108
  * entitled to take them out of the document, which is the same reason
@@ -130,11 +111,12 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
130
111
  */
131
112
  clearable: boolean;
132
113
  /**
133
- * What the clear button is called, since an icon has no name of its own.
114
+ * The name of the clear button, read by screen readers. The button shows only
115
+ * an icon.
134
116
  */
135
117
  clearLabel: string;
136
118
  /**
137
- * Shown while the field is empty.
119
+ * The text shown while the field is empty.
138
120
  *
139
121
  * Not a label: it goes when typing starts.
140
122
  */
@@ -214,7 +196,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
214
196
  */
215
197
  private get suggestions();
216
198
  /**
217
- * The caret and the selection, under the platform's own names.
199
+ * The direction of the selection, named as on `<input>`.
218
200
  *
219
201
  * **Published for the reason `Input` publishes them, and this element needs
220
202
  * them more.** The `<input>` is inside this shadow root, so a consumer has no
@@ -228,9 +210,9 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
228
210
  * be anyway.
229
211
  */
230
212
  get selectionDirection(): 'backward' | 'forward' | 'none';
231
- /** Where the selection ends, which is the caret when nothing is selected. */
213
+ /** Where the selection ends. With nothing selected, it is the caret position. */
232
214
  get selectionEnd(): number;
233
- /** Where the selection starts, which is the caret when nothing is selected. */
215
+ /** Where the selection starts. With nothing selected, it is the caret position. */
234
216
  get selectionStart(): number;
235
217
  /** Moves the caret, or selects a run of the text. */
236
218
  setSelectionRange(start: number, end: number, direction?: 'backward' | 'forward' | 'none'): void;
@@ -245,7 +227,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
245
227
  /** Relayed, because `change` does not cross a shadow boundary on its own. */
246
228
  private readonly handleChange;
247
229
  /**
248
- * The fields this can be filtered by, wherever they were written.
230
+ * The fields the input can filter by, declared anywhere inside it.
249
231
  *
250
232
  * Descendants rather than children, because the usual place to write them is
251
233
  * inside the `FilterMenu` slotted into `start`: the picker and the text are
@@ -392,7 +374,7 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
392
374
  * and the highlight is still drawn.
393
375
  */
394
376
  private markActive;
395
- /** Puts the caret in the field, the way a label pointing at one would. */
377
+ /** Puts the caret in the text field. */
396
378
  focus(options?: FocusOptions): void;
397
379
  protected render(): TemplateResult;
398
380
  }
@@ -1,33 +1,24 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
- * @summary A timestamp, written the way the reader's locale writes one.
4
+ * @summary A timestamp, formatted for the user's locale.
5
5
  *
6
6
  * @description
7
- * A date in a page is almost never wanted as an ISO string, and formatting one
8
- * in the consumer's own code means every consumer ships a copy of the same
9
- * `Intl` call and a different set of options. This is that call, as an element,
10
- * so a date is written where it is shown.
7
+ * Formats a date with `Intl` where it is shown, so you do not write the same
8
+ * `Intl` call and options in your own code.
11
9
  *
12
- * **`elapsed` is the mode a feed wants, and it stops being relative on
13
- * purpose.** "42m", "3h", "1d" is what a row of activity reads as, and past a
14
- * week the compact form is a lie: `Intl.NumberFormat` narrow renders both
15
- * `minute` and `month` as `m` in en-US, so "3m" is three minutes at the top of a
16
- * feed and three months further down it. Past six days this shows a date, which
17
- * is shorter to read and impossible to misread. `elapsedTime` in `helix/core`
18
- * carries the measurement.
10
+ * **`elapsed` shows compact relative time for a feed**, such as "42m", "3h", or
11
+ * "1d". After six days it shows a date. In en-US, `Intl.NumberFormat` narrow
12
+ * renders both `minute` and `month` as `m`, so a compact "3m" could mean three
13
+ * minutes or three months. `elapsedTime` in `helix/core` does the measurement.
19
14
  *
20
- * **The reading refreshes itself, from one timer the page shares.** A relative
21
- * timestamp is correct for as long as its unit lasts and wrong afterwards, and a
22
- * page left open is exactly where that shows. Each element asks to be woken when
23
- * its own reading expires rather than polling, and an element showing a date
24
- * asks for nothing at all: fifty rows and fifty intervals is fifty wakeups a
25
- * second where one will do, and a feed of last month's notifications should cost
26
- * nothing to leave open.
15
+ * **The text refreshes on one timer shared by the page.** Each element
16
+ * schedules an update for when its current reading expires, and an element
17
+ * showing a date schedules none, so a long feed left open costs almost nothing.
27
18
  *
28
- * **`<time datetime>` whatever the text says**, so a screen reader, a copy and
29
- * paste, and anything parsing the page all get the real instant rather than
30
- * "yesterday".
19
+ * **The output is always `<time datetime>`**, so screen readers, copy and
20
+ * paste, and scripts parsing the page get the exact instant, whatever the
21
+ * visible text says.
31
22
  *
32
23
  * @since 0.1.0
33
24
  * @status stable
@@ -35,11 +26,11 @@ import { nothing, type PropertyValues, type TemplateResult } from 'lit';
35
26
  * @aliases RelativeTime, Timestamp, TimeAgo
36
27
  * @documentation https://fusion.dev/helix/components/format-date
37
28
  *
38
- * @csspart time - The `<time>` element carrying the reading.
29
+ * @csspart time - The `<time>` element that holds the formatted text.
39
30
  */
40
31
  export declare class HelixHeadlessFormatDate extends HelixElement {
41
32
  /**
42
- * The timestamp, as anything `Date` parses.
33
+ * The timestamp, in any format `Date` can parse.
43
34
  *
44
35
  * An ISO string is what an API sends and what `<time datetime>` takes, so it
45
36
  * is the shape that needs no translation at either end. Left unset this
@@ -61,7 +52,8 @@ export declare class HelixHeadlessFormatDate extends HelixElement {
61
52
  */
62
53
  day?: 'numeric' | '2-digit';
63
54
  /**
64
- * Show how long ago it was, compactly, instead of the date.
55
+ * Shows how long ago the timestamp was, in a compact form such as "3h", in
56
+ * place of the date.
65
57
  *
66
58
  * Reflected, because it is the one property that decides which of two readings
67
59
  * this is and a stylesheet has a reason to know: a compact reading is a fixed
@@ -73,7 +65,7 @@ export declare class HelixHeadlessFormatDate extends HelixElement {
73
65
  */
74
66
  hour?: 'numeric' | '2-digit';
75
67
  /**
76
- * Locale for the reading.
68
+ * The locale to format the timestamp in.
77
69
  *
78
70
  * Empty is the runtime's own.
79
71
  */
@@ -97,7 +89,7 @@ export declare class HelixHeadlessFormatDate extends HelixElement {
97
89
  */
98
90
  timeZone?: string;
99
91
  /**
100
- * Whether to name the time zone, and how.
92
+ * Shows the name of the time zone, in its `long` or `short` form.
101
93
  */
102
94
  timeZoneName?: 'long' | 'short';
103
95
  /**