@fusion.dev/helix-headless 0.104.1 → 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 (167) hide show
  1. package/custom-elements.json +10386 -3813
  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 +62 -56
  30. package/dist/color-input/root/color-input-root.js +3 -0
  31. package/dist/color-picker/root/color-picker-root.d.ts +61 -49
  32. package/dist/color-picker/root/color-picker-root.js +4 -0
  33. package/dist/combobox/root/combobox-root.d.ts +52 -53
  34. package/dist/command/root/command-root.d.ts +40 -40
  35. package/dist/command/root/command-root.js +1 -0
  36. package/dist/copy-button/root/copy-button-root.d.ts +24 -26
  37. package/dist/data-table/root/data-table-root.d.ts +106 -107
  38. package/dist/date-input/root/date-input-root.d.ts +54 -53
  39. package/dist/date-picker/root/date-picker-root.d.ts +25 -21
  40. package/dist/description-list/item/description-list-item.d.ts +7 -7
  41. package/dist/description-list/root/description-list-root.d.ts +10 -15
  42. package/dist/dialog/root/dialog-root.d.ts +22 -19
  43. package/dist/divider/root/divider-root.d.ts +12 -13
  44. package/dist/donut-chart/root/donut-chart-root.d.ts +19 -20
  45. package/dist/drawer/root/drawer-root.d.ts +19 -18
  46. package/dist/drilldown/item/drilldown-item.d.ts +28 -28
  47. package/dist/drilldown/root/drilldown-root.d.ts +22 -28
  48. package/dist/element-events.generated.js +19 -1
  49. package/dist/empty/root/empty-root.d.ts +16 -19
  50. package/dist/file-input/root/file-input-root.d.ts +32 -32
  51. package/dist/filter-input/chip/filter-chip.d.ts +36 -39
  52. package/dist/filter-input/field/filter-field.d.ts +25 -31
  53. package/dist/filter-input/menu/filter-menu.d.ts +50 -47
  54. package/dist/filter-input/operator/filter-operator.d.ts +15 -20
  55. package/dist/filter-input/root/filter-input-root.d.ts +80 -98
  56. package/dist/format-date/root/format-date-root.d.ts +19 -27
  57. package/dist/heatmap/root/heatmap-root.d.ts +40 -41
  58. package/dist/icon/root/icon-root.d.ts +21 -23
  59. package/dist/icon-button/root/icon-button-root.d.ts +12 -14
  60. package/dist/image/root/image-root.d.ts +30 -30
  61. package/dist/input/root/input-root.d.ts +36 -35
  62. package/dist/kbd/root/kbd-root.d.ts +13 -15
  63. package/dist/legend/root/legend-root.d.ts +18 -16
  64. package/dist/lightbox/item/lightbox-item.d.ts +13 -15
  65. package/dist/lightbox/root/lightbox-root.d.ts +40 -41
  66. package/dist/line-chart/root/line-chart-root.d.ts +20 -29
  67. package/dist/list/item/list-item.d.ts +17 -22
  68. package/dist/list/root/list-root.d.ts +6 -7
  69. package/dist/listbox/root/listbox-root.d.ts +42 -41
  70. package/dist/loader/root/loader-root.d.ts +16 -20
  71. package/dist/map/area/map-area.d.ts +48 -0
  72. package/dist/map/area/map-area.js +40 -0
  73. package/dist/map/buildings/map-buildings.d.ts +45 -0
  74. package/dist/map/buildings/map-buildings.js +37 -0
  75. package/dist/map/contours/map-contours.d.ts +61 -0
  76. package/dist/map/contours/map-contours.js +54 -0
  77. package/dist/map/index.d.ts +14 -0
  78. package/dist/map/index.js +10 -0
  79. package/dist/map/landcover/map-landcover.d.ts +47 -0
  80. package/dist/map/landcover/map-landcover.js +37 -0
  81. package/dist/map/marker/map-marker.d.ts +120 -0
  82. package/dist/map/marker/map-marker.js +109 -0
  83. package/dist/map/points/map-points.d.ts +139 -0
  84. package/dist/map/points/map-points.js +161 -0
  85. package/dist/map/position/map-position.d.ts +70 -0
  86. package/dist/map/position/map-position.js +89 -0
  87. package/dist/map/raster/map-raster.d.ts +84 -0
  88. package/dist/map/raster/map-raster.js +96 -0
  89. package/dist/map/root/map-root.d.ts +269 -52
  90. package/dist/map/root/map-root.js +473 -5
  91. package/dist/map/route/map-route.d.ts +73 -0
  92. package/dist/map/route/map-route.js +52 -0
  93. package/dist/map/terrain/map-terrain.d.ts +68 -0
  94. package/dist/map/terrain/map-terrain.js +58 -0
  95. package/dist/megamenu/root/megamenu-root.d.ts +27 -25
  96. package/dist/menu/item/menu-item.d.ts +30 -31
  97. package/dist/menu/root/menu-root.d.ts +25 -29
  98. package/dist/meter/root/meter-root.d.ts +22 -21
  99. package/dist/navigation/root/navigation-root.d.ts +13 -16
  100. package/dist/notifications/group/notification-group.d.ts +27 -28
  101. package/dist/notifications/notification/notification.d.ts +35 -42
  102. package/dist/notifications/root/notifications-root.d.ts +22 -24
  103. package/dist/number-input/root/number-input-root.d.ts +46 -50
  104. package/dist/object-inspector/root/object-inspector-root.d.ts +46 -58
  105. package/dist/option/group/option-group.d.ts +11 -11
  106. package/dist/option/root/option-root.d.ts +28 -33
  107. package/dist/outline/root/outline-root.d.ts +18 -17
  108. package/dist/pagination/root/pagination-root.d.ts +37 -39
  109. package/dist/pagination/size/pagination-size.d.ts +37 -43
  110. package/dist/pagination/summary/pagination-summary.d.ts +12 -14
  111. package/dist/pin-input/root/pin-input-root.d.ts +32 -38
  112. package/dist/popover/root/popover-root.d.ts +16 -21
  113. package/dist/progress/root/progress-root.d.ts +16 -14
  114. package/dist/qr-code/root/qr-code-root.d.ts +22 -25
  115. package/dist/quote/root/quote-root.d.ts +5 -6
  116. package/dist/radio/group/radio-group.d.ts +26 -28
  117. package/dist/radio/root/radio-root.d.ts +24 -28
  118. package/dist/rating/root/rating-root.d.ts +27 -30
  119. package/dist/scatter-chart/root/scatter-chart-root.d.ts +43 -55
  120. package/dist/scroll-area/root/scroll-area-root.d.ts +15 -21
  121. package/dist/select/root/select-root.d.ts +41 -44
  122. package/dist/skeleton/root/skeleton-root.d.ts +7 -8
  123. package/dist/skip-link/root/skip-link-root.d.ts +21 -28
  124. package/dist/slider/root/slider-root.d.ts +36 -39
  125. package/dist/sparkline/root/sparkline-root.d.ts +22 -28
  126. package/dist/speed-dial/item/speed-dial-item.d.ts +21 -21
  127. package/dist/speed-dial/root/speed-dial-root.d.ts +25 -27
  128. package/dist/splitter/root/splitter-root.d.ts +37 -41
  129. package/dist/stat/group/stat-group.d.ts +4 -4
  130. package/dist/stat/root/stat-root.d.ts +8 -9
  131. package/dist/steps/root/steps-root.d.ts +11 -14
  132. package/dist/steps/step/step.d.ts +22 -29
  133. package/dist/switch/root/switch-root.d.ts +20 -24
  134. package/dist/table/cell/table-cell.d.ts +18 -8
  135. package/dist/table/cell/table-cell.js +5 -1
  136. package/dist/table/column/table-column.d.ts +62 -55
  137. package/dist/table/root/table-root.d.ts +16 -17
  138. package/dist/table/row/table-row.d.ts +3 -3
  139. package/dist/tabs/panel/tab-panel.d.ts +3 -3
  140. package/dist/tabs/root/tabs-root.d.ts +19 -17
  141. package/dist/tabs/tab/tab.d.ts +6 -6
  142. package/dist/tag/root/tag-root.d.ts +11 -12
  143. package/dist/textarea/root/textarea-root.d.ts +29 -32
  144. package/dist/time-input/root/time-input-root.d.ts +70 -69
  145. package/dist/time-picker/root/time-picker-root.d.ts +58 -66
  146. package/dist/timeline/item/timeline-item.d.ts +18 -24
  147. package/dist/timeline/root/timeline-root.d.ts +13 -21
  148. package/dist/toast/item/toast-item.d.ts +21 -22
  149. package/dist/toast/root/toast-root.d.ts +18 -23
  150. package/dist/toggle/group/toggle-group.d.ts +23 -25
  151. package/dist/toggle/root/toggle-root.d.ts +8 -8
  152. package/dist/toolbar/root/toolbar-root.d.ts +7 -10
  153. package/dist/tooltip/root/tooltip-root.d.ts +41 -47
  154. package/dist/tour/root/tour-root.d.ts +24 -26
  155. package/dist/tour/stop/tour-stop.d.ts +39 -48
  156. package/dist/tree/item/tree-item.d.ts +23 -25
  157. package/dist/tree/root/tree-root.d.ts +13 -12
  158. package/dist/trend/root/trend-root.d.ts +18 -19
  159. package/dist/video/root/video-root.d.ts +108 -101
  160. package/dist/video-playlist/item/video-playlist-item.d.ts +23 -28
  161. package/dist/video-playlist/menu/video-playlist-menu.d.ts +17 -21
  162. package/dist/video-playlist/root/video-playlist-root.d.ts +21 -25
  163. package/dist/virtual-list/root/virtual-list-root.d.ts +27 -26
  164. package/package.json +5 -5
  165. package/types/jsx.d.ts +14011 -11983
  166. package/types/svelte.d.ts +10 -0
  167. package/types/vue.d.ts +2143 -1497
@@ -2,26 +2,24 @@ import { AriaForwardController, HelixFormElement } from '@fusion.dev/helix-core'
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  declare const HelixHeadlessCheckbox_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerCheckedInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
4
4
  /**
5
- * @summary A box that is ticked, or not, or neither.
5
+ * @summary A box that is checked, unchecked, or indeterminate.
6
6
  *
7
7
  * @description
8
- * Renders a real `<input type="checkbox">`, so the space key, the focus ring,
9
- * and the indeterminate glyph come from the platform. `delegatesFocus` puts
10
- * focus on it, and it serializes into the server's markup, so the control is
11
- * reachable before any script loads.
8
+ * Renders a native `<input type="checkbox">`, so the Space key, the focus ring,
9
+ * and the indeterminate glyph come from the platform. `delegatesFocus` sends
10
+ * focus to the input, and the input is in the server-rendered markup, so the
11
+ * control works before any script loads.
12
12
  *
13
- * **The input inside a shadow root submits nothing**, because the form is on
14
- * the other side of the boundary. The host is form-associated instead and
15
- * reports its own value through `ElementInternals`, which is also what carries
16
- * validity and what answers a form reset.
13
+ * An input inside a shadow root does not submit with a form. The host is
14
+ * form-associated and uses `ElementInternals` for its value, its validity, and
15
+ * form reset.
17
16
  *
18
- * A checked box submits its `value`, and an unchecked one submits nothing at
19
- * all. That is what a native checkbox does, and a form built around one reads
20
- * the absence rather than a `false`.
17
+ * A checked box submits its `value`, and an unchecked one submits nothing, as a
18
+ * native checkbox does.
21
19
  *
22
- * `indeterminate` is presentation and nothing else. It is neither checked nor
23
- * unchecked to a reader, it never submits, and the first click resolves it: a
24
- * third state that survives interaction is a control nobody can finish.
20
+ * `indeterminate` changes only the presentation. Assistive technology reports
21
+ * it as neither checked nor unchecked, it never submits, and the first click
22
+ * resolves it.
25
23
  *
26
24
  * @since 0.1.0
27
25
  * @status stable
@@ -31,34 +29,34 @@ declare const HelixHeadlessCheckbox_base: (new (...args: any[]) => import("@fusi
31
29
  *
32
30
  * @slot - The label.
33
31
  *
34
- * @event {Event} change - Relayed from the input once the state has changed.
35
- * @event {HelixBeforeToggleEvent} helix-before-toggle - Fired before the state changes, and cancelable.
36
- * @event {Event} input - Announced once the state has moved.
32
+ * @event {Event} change - The box was checked or unchecked. Relayed from the native input.
33
+ * @event {HelixBeforeToggleEvent} helix-before-toggle - The box is about to be checked or unchecked. Cancelable: cancel it to keep its state.
34
+ * @event {Event} input - The box was checked or unchecked.
37
35
  *
38
- * @csspart box - The frame the input is painted as, and the mark sits over.
39
- * @csspart control - The input.
40
- * @csspart feedback - What is wrong with it.
41
- * @csspart field - The row the box and its label share, and the surface the card appearance draws.
42
- * @csspart hint - Help under the control, while nothing is wrong.
43
- * @csspart label - The label beside it.
44
- * @csspart mark - The tick, or the dash when the box is indeterminate.
45
- * @csspart mark-checked - The mark while the box is checked, beside `mark`.
46
- * @csspart mark-indeterminate - The mark while the box is indeterminate, beside `mark`.
36
+ * @csspart box - The box drawn for the input, under the mark.
37
+ * @csspart control - The native input.
38
+ * @csspart feedback - The message that says what is wrong.
39
+ * @csspart field - The row that holds the box and its label. It is the card when `separation` is set.
40
+ * @csspart hint - Help text under the control, shown while there is no feedback.
41
+ * @csspart label - The label next to the box.
42
+ * @csspart mark - The check mark, or the dash when the box is indeterminate.
43
+ * @csspart mark-checked - Added to `mark` while the box is checked.
44
+ * @csspart mark-indeterminate - Added to `mark` while the box is indeterminate.
47
45
  *
48
46
  * @cssstate checked - While the box is checked.
49
- * @cssstate has-label - While the label slot holds something to read, which is what draws a label at all.
50
- * @cssstate invalid - While there is feedback to show: the platform's verdict, or the consumer's `feedback`.
47
+ * @cssstate has-label - The label slot has content, so the label is drawn.
48
+ * @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
51
49
  */
52
50
  export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
53
51
  protected readonly aria: AriaForwardController;
54
52
  /**
55
- * Whether the box shows as neither checked nor unchecked.
53
+ * Shows the box as neither checked nor unchecked.
56
54
  *
57
55
  * Presentation only. It never submits, and the first change resolves it.
58
56
  */
59
57
  indeterminate: boolean;
60
58
  /**
61
- * Value submitted when the box is checked.
59
+ * The value submitted when the box is checked.
62
60
  */
63
61
  value: string;
64
62
  /** Focus is delegated to the input, so the host is never the focus target. */
@@ -66,7 +64,7 @@ export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
66
64
  private readonly handleChange;
67
65
  /** Reports the value and the validity the host stands behind. */
68
66
  private sync;
69
- /** Returns the box to the state its markup declared. */
67
+ /** Resets the box to the state set in its markup. */
70
68
  formResetCallback(): void;
71
69
  protected willUpdate(changed: PropertyValues): void;
72
70
  protected updated(changed: PropertyValues): void;
@@ -3,25 +3,25 @@ import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import { HelixHeadlessCheckbox } from '../../checkbox/root/checkbox-root.js';
4
4
  declare const HelixHeadlessCheckboxGroup_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
5
5
  /**
6
- * @summary Groups related checkboxes, and reports them as one set.
6
+ * @summary A group of related checkboxes under one label, with one value for the set.
7
7
  *
8
8
  * @description
9
- * The host is the group, so `role="group"` sits on it through internals and
10
- * `label` names it. A run of checkboxes with no name is announced as separate
11
- * controls, which is what the grouping exists to say it is not.
9
+ * The host is the group. It has `role="group"` through internals, and `label`
10
+ * names it. Without a name, screen readers announce the checkboxes as separate
11
+ * controls.
12
12
  *
13
- * **Each checkbox still submits itself.** They are form-associated already and
14
- * a native group is several inputs sharing a name, so this adds no form value
15
- * of its own: it would submit the same answers twice. What it adds is the
16
- * grouping, a shared `name` so it is written once, and one place to read and
17
- * write the whole set.
13
+ * **Each checkbox submits its own value.** Checkboxes are already
14
+ * form-associated, and a native group is several inputs that share a name, so
15
+ * the group adds no form value of its own. It adds the grouping, a shared
16
+ * `name` that you write once, and one place to read and write the whole set.
18
17
  *
19
- * `value` is the checked values, comma separated, in the order the boxes are
20
- * written. Setting it ticks exactly those and unticks the rest.
18
+ * `value` is the checked values, separated by commas, in the order the
19
+ * checkboxes are written. Setting it checks exactly those values and unchecks
20
+ * the rest.
21
21
  *
22
- * **Its message is always given, never derived.** The group is form-associated
23
- * for validity alone and never calls `setFormValue`, so `feedback` is what shows
24
- * here: the browser has nothing to say about a set it does not submit.
22
+ * **The group shows the message you set in `feedback`.** It is form-associated
23
+ * only for validity and never calls `setFormValue`, so the browser does not
24
+ * generate a message for it.
25
25
  *
26
26
  * @since 0.1.0
27
27
  * @status stable
@@ -30,19 +30,19 @@ declare const HelixHeadlessCheckboxGroup_base: (new (...args: any[]) => import("
30
30
  * @documentation https://fusion.dev/helix/components/checkbox-group
31
31
  *
32
32
  * @slot - The checkboxes.
33
- * @slot hint - Richer than a string.
34
- * @slot label - Richer than a string, where the label is more than one.
33
+ * @slot hint - Help under the checkboxes, for help that needs more than plain text.
34
+ * @slot label - The group's label, for a label that needs more than plain text.
35
35
  *
36
- * @event {Event} change - Announced once the value has moved.
37
- * @event {HelixBeforeChangeEvent} helix-before-change - Fired before any box changes, with the whole set. Cancelable: refusing it takes the decision and nothing moves.
38
- * @event {Event} input - Announced once the value has moved.
36
+ * @event {Event} change - The set of checked boxes changed.
37
+ * @event {HelixBeforeChangeEvent} helix-before-change - A box is about to change. Carries the whole set that would result. Cancelable: canceling it leaves every box as it was.
38
+ * @event {Event} input - The set of checked boxes changed.
39
39
  *
40
- * @csspart feedback - What is wrong with it.
41
- * @csspart hint - Help under the set.
42
- * @csspart items - The list itself, which is what `orientation` lays out.
43
- * @csspart label - The group's name, over the set.
40
+ * @csspart feedback - The message that says what is wrong with the set.
41
+ * @csspart hint - The help under the checkboxes.
42
+ * @csspart items - The element that holds the checkboxes, laid out by `orientation`.
43
+ * @csspart label - The group's label, above the checkboxes.
44
44
  *
45
- * @cssstate invalid - While there is feedback to show: the platform's verdict, or the consumer's `feedback`.
45
+ * @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
46
46
  */
47
47
  export declare class HelixHeadlessCheckboxGroup extends HelixHeadlessCheckboxGroup_base {
48
48
  /**
@@ -50,7 +50,7 @@ export declare class HelixHeadlessCheckboxGroup extends HelixHeadlessCheckboxGro
50
50
  */
51
51
  value: string;
52
52
  protected readonly cascade: DisabledCascadeController;
53
- /** The boxes, in light-DOM order. Client only: the server has no tree. */
53
+ /** The checkboxes in the group, in the order they are written. Browser only. */
54
54
  get boxes(): HelixHeadlessCheckbox[];
55
55
  /**
56
56
  * Pushes the group's name and value onto the boxes.
@@ -4,17 +4,13 @@ import { type TemplateResult } from 'lit';
4
4
  * @summary A fragment of code inside a line of prose.
5
5
  *
6
6
  * @description
7
- * **A real `<code>`, because the element is the meaning.** A styled span reads
8
- * as code and is not: a screen reader announces nothing about it, a translation
9
- * tool will happily translate it, and a search that understands documents
10
- * cannot tell it from emphasis. The tag is the whole point, which is also why
11
- * this component is so small.
7
+ * Renders a real `<code>` element, which marks the text as code for translation
8
+ * tools and document search. A styled span carries no such meaning, and a
9
+ * screen reader announces nothing about it.
12
10
  *
13
- * **Inline, and only inline.** A block of code is `CodeBlock`, a separate
14
- * family rather than a variant here. The two differ in more than presentation:
15
- * one flows with a sentence and must never scroll, the other is a figure with
16
- * its own box, its own overflow and something to copy. Namespacing them
17
- * together would say `CodeBlock` is part of `Code`, and it is not.
11
+ * `Code` is inline only and never scrolls. For a block of code with its own
12
+ * box, its own overflow, and copying, use `CodeBlock`, which is a separate
13
+ * family.
18
14
  *
19
15
  * @since 0.1.0
20
16
  * @status stable
@@ -2,44 +2,31 @@ import { HelixElement } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../copy-button/index.js';
4
4
  /**
5
- * @summary A block of code, with somewhere to put its name and a way to take it.
5
+ * @summary A block of code with an optional name and a copy button.
6
6
  *
7
7
  * @description
8
- * **`<pre><code>` and nothing cleverer.** The pair is what the platform means
9
- * by a block of code: `pre` keeps the whitespace, `code` says what the
10
- * whitespace is for, and losing either one loses something no styling puts
11
- * back. Indentation in a `div` is a paragraph with odd spacing.
8
+ * Renders a `<pre><code>` pair: `pre` keeps the whitespace, and `code` marks it
9
+ * as code. Long lines scroll inside the block and do not wrap, because a line
10
+ * break can be significant in code.
12
11
  *
13
- * **It scrolls rather than wraps.** A wrapped line of code is a lie about where
14
- * the line ends, and in a language where a line break can be significant it is
15
- * a lie that costs someone an afternoon. The box takes its own scrollbar.
12
+ * A copy button is on by default. Set `no-copy` to remove it. The button copies
13
+ * the slotted text, so there is no second copy of the code to keep in sync.
16
14
  *
17
- * **The copy button is here because the alternative is selecting it by hand.**
18
- * Every consumer would otherwise put one there, slightly differently, and the
19
- * one that forgot would be the one with the longest snippet. It is on unless
20
- * `no-copy` says otherwise, and takes its text from the slot rather than from a
21
- * property, so there is no second copy of the code to keep in step.
15
+ * For a fragment of code inside a sentence, use `Code`.
22
16
  *
23
- * A `Code` for a fragment inside a sentence. Separate families, because one
24
- * flows with prose and the other is a figure.
17
+ * Set `diff` to show a change. Put a unified diff, the output of `git diff` or
18
+ * `diff -u`, in the same slot, and the block draws the lines it added and
19
+ * removed. The block never computes a diff itself. Line numbers come from the
20
+ * hunk headers and are hidden from the accessibility tree. Changed lines are
21
+ * `<ins>` and `<del>` with the `+` and `-` kept as text, so the change does not
22
+ * depend on color. Each file in the patch is its own block under its own name,
23
+ * and its copy button copies the new version of the file. `variant="split"`
24
+ * shows the old version beside the new, each removal opposite its replacement.
25
25
  *
26
- * **`diff` reads the code as a change.** The content is then a unified diff,
27
- * what `git diff` and `diff -u` write, in the same slot ordinary code goes in,
28
- * and it is drawn as the lines it added and removed. The block reads a diff and
29
- * never computes one, so the algorithm stays wherever the two versions are.
30
- * Numbers come from the hunk headers, which makes them the file's; changed lines
31
- * are `<ins>` and `<del>` with the `+` and `-` kept as text, so the change is not
32
- * carried by color; the numbers are hidden from the accessibility tree. Each
33
- * file in the patch is a block of its own under its own name, and its copy
34
- * button takes the file as it now reads. `variant="split"` sets the old version
35
- * beside the new, each removal opposite its replacement.
36
- *
37
- * **Before the script runs, a diff is its own text.** A server has no children
38
- * to read, so it renders the slot as ordinary code, which for a diff is the
39
- * patch in a `<pre>`: a legible diff, and the first render the client makes
40
- * too, which is what keeps hydration clean. The drawn diff replaces it once the
41
- * content can be read. Diff mode is experimental while the rest of the family
42
- * is stable.
26
+ * On the server, the slot renders as ordinary code, so a diff first appears as
27
+ * the patch text in a `<pre>`. The client makes the same first render, which
28
+ * keeps hydration clean, and draws the diff once it can read the content. Diff
29
+ * mode is experimental. The rest of the family is stable.
43
30
  *
44
31
  * @since 0.1.0
45
32
  * @status stable
@@ -53,26 +40,26 @@ import '../../copy-button/index.js';
53
40
  * @csspart block - The scrolling `<pre>`.
54
41
  * @csspart code - The `<code>` inside it.
55
42
  * @csspart context - In a diff, a line both versions share.
56
- * @csspart copy - The copy button: in the header where there is one, and otherwise beside the code.
43
+ * @csspart copy - The copy button. It sits in the header when there is one, and beside the code otherwise.
57
44
  * @csspart copy-button - The inner button.
58
- * @csspart copy-mark - The clipboard glyph, and the confirmation that replaces it.
59
- * @csspart copy-tooltip - The bubble, forwarded from the tooltip inside.
60
- * @csspart copy-tooltip-arrow - The point, resting against the trigger.
61
- * @csspart copy-tooltip-arrow-bottom - The point while the bubble is below the copy button, so on its top edge, beside `copy-tooltip-arrow`.
62
- * @csspart copy-tooltip-arrow-left - The point while the bubble is left of the copy button, so on its right edge, beside `copy-tooltip-arrow`.
63
- * @csspart copy-tooltip-arrow-right - The point while the bubble is right of the copy button, so on its left edge, beside `copy-tooltip-arrow`.
64
- * @csspart copy-tooltip-arrow-top - The point while the bubble is above the copy button, so on its bottom edge, beside `copy-tooltip-arrow`.
65
- * @csspart copy-tooltip-bottom - The bubble while it is below the copy button, beside `copy-tooltip`.
66
- * @csspart copy-tooltip-left - The bubble while it is left of the copy button, beside `copy-tooltip`.
67
- * @csspart copy-tooltip-right - The bubble while it is right of the copy button, beside `copy-tooltip`.
68
- * @csspart copy-tooltip-top - The bubble while it is above the copy button, beside `copy-tooltip`.
45
+ * @csspart copy-mark - The clipboard icon, and the check mark that replaces it after a copy.
46
+ * @csspart copy-tooltip - The copy button's tooltip.
47
+ * @csspart copy-tooltip-arrow - The tooltip's arrow, which points at the copy button.
48
+ * @csspart copy-tooltip-arrow-bottom - The arrow while the tooltip is below the copy button, on the tooltip's top edge. Applied with `copy-tooltip-arrow`.
49
+ * @csspart copy-tooltip-arrow-left - The arrow while the tooltip is left of the copy button, on the tooltip's right edge. Applied with `copy-tooltip-arrow`.
50
+ * @csspart copy-tooltip-arrow-right - The arrow while the tooltip is right of the copy button, on the tooltip's left edge. Applied with `copy-tooltip-arrow`.
51
+ * @csspart copy-tooltip-arrow-top - The arrow while the tooltip is above the copy button, on the tooltip's bottom edge. Applied with `copy-tooltip-arrow`.
52
+ * @csspart copy-tooltip-bottom - The tooltip while it is below the copy button. Applied with `copy-tooltip`.
53
+ * @csspart copy-tooltip-left - The tooltip while it is left of the copy button. Applied with `copy-tooltip`.
54
+ * @csspart copy-tooltip-right - The tooltip while it is right of the copy button. Applied with `copy-tooltip`.
55
+ * @csspart copy-tooltip-top - The tooltip while it is above the copy button. Applied with `copy-tooltip`.
69
56
  * @csspart file - In a diff, one file's header and block.
70
57
  * @csspart filler - In a split diff, the empty row opposite a line the other side does not have.
71
58
  * @csspart frame - The code, and the copy button beside it where there is no header.
72
- * @csspart header - The bar carrying the name and the copy button, where there is a name.
59
+ * @csspart header - The bar that holds the name and the copy button, shown when there is a name.
73
60
  * @csspart hunk - In a diff, a `@@` line saying where the lines under it are.
74
61
  * @csspart label - The file name or language, where one is given.
75
- * @csspart marker - In a diff, the `+`, `-` or space that opens a line.
62
+ * @csspart marker - In a diff, the `+`, `-`, or space that starts a line.
76
63
  * @csspart new - In a split diff, the new version's `<pre>`.
77
64
  * @csspart number - In a diff, a line number.
78
65
  * @csspart old - In a split diff, the old version's `<pre>`.
@@ -89,7 +76,7 @@ export declare class HelixHeadlessCodeBlock extends HelixElement {
89
76
  */
90
77
  diff: boolean;
91
78
  /**
92
- * What to call this block, usually a file name or a language.
79
+ * The block's name, usually a file name or a language.
93
80
  *
94
81
  * In a diff, each file is named from the patch, and this names a patch that
95
82
  * carries no name of its own.
@@ -118,7 +105,7 @@ export declare class HelixHeadlessCodeBlock extends HelixElement {
118
105
  */
119
106
  noCopy: boolean;
120
107
  /**
121
- * How a diff's two versions are arranged; nothing without `diff`.
108
+ * How a diff's two versions are arranged. It has no effect without `diff`.
122
109
  *
123
110
  * Absent is unified, each removal above its replacement, which fits any
124
111
  * width. `split` sets the old version beside the new one. Optional rather
@@ -3,33 +3,29 @@ import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../color-picker/index.js';
4
4
  declare const HelixHeadlessColorInput_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinPickerFieldInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & (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 color, typed in any syntax or picked from a panel.
6
+ * @summary A field for a color, typed in any syntax or picked from a panel.
7
7
  *
8
8
  * @description
9
- * **The picker is `ColorPicker`, not a second one written here.** It owns the
10
- * square, the ramps, the eyedropper and the syntax toggle, and it is worth
11
- * having on its own: a settings pane wants a picker flat on the page with
12
- * nothing to open. This element is the field, the overlay, and the form.
13
- * Exactly the arrangement Date Input has with `DatePicker`.
9
+ * A text field with a button that opens `ColorPicker` in an overlay.
10
+ * `ColorPicker` provides the square, the ramps, the eyedropper, and the syntax
11
+ * toggle, and you can also use it on its own, flat on the page. Color Input
12
+ * adds the field, the overlay, and the form value, the same arrangement Date
13
+ * Input has with `DatePicker`.
14
14
  *
15
- * **Typed as well as picked, and the typing is the reason this is not
16
- * `<input type="color">`.** The native control gives a free picker and takes
17
- * nearly all styling with it, which is a fair trade until a product needs the
18
- * panel to match everything around it. What is kept from the native one is the
19
- * part worth keeping: a real text field, so a reader who has the hex pastes it
20
- * and never opens anything.
15
+ * You can type or paste a color into the field without opening the picker.
16
+ * Color Input is a custom control, unlike `<input type="color">`, so you can
17
+ * style the panel to match your interface.
21
18
  *
22
- * **Every syntax is read; the one `format` names is written.** `#f00`,
23
- * `#ff0000`, `rgb(255 0 0)`, `rgba(255,0,0,.5)`, `rgb(255 0 0 / 50%)` and
24
- * `hsl(0 100% 50%)` are all colors, and a field that refuses one because it
25
- * prefers another is arguing with the person using it. What the field *shows* is
26
- * the value itself, for the reason Date Input gives about its dates: half-typed
27
- * input does not survive a round trip through a formatter.
19
+ * The field reads every color syntax, including `#f00`, `#ff0000`,
20
+ * `rgb(255 0 0)`, `rgba(255,0,0,.5)`, `rgb(255 0 0 / 50%)`, and
21
+ * `hsl(0 100% 50%)`. It writes colors in the syntax that `format` names. The
22
+ * field shows the value without reformatting it, because half-typed input does
23
+ * not survive a round trip through a formatter. Date Input does the same with
24
+ * dates.
28
25
  *
29
- * The custom property below is written by this component and never set by a
30
- * consumer: it carries a value this element resolved and CSS cannot, which is
31
- * what lets a stylesheet on this tier paint the swatch without parsing anything
32
- * itself.
26
+ * The component sets `--color-input-swatch`, so do not set it yourself. It
27
+ * holds the resolved color, so the styled tier can paint the swatch without
28
+ * parsing the value.
33
29
  *
34
30
  * @since 0.1.0
35
31
  * @status stable
@@ -38,58 +34,58 @@ declare const HelixHeadlessColorInput_base: (new (...args: any[]) => import("@fu
38
34
  * @documentation https://fusion.dev/helix/components/color-input
39
35
  *
40
36
  * @slot end - Content at the trailing end, before the trigger.
41
- * @slot feedback - What is wrong with it.
42
- * @slot hint - Help under the field.
37
+ * @slot feedback - The message that says what is wrong with the value.
38
+ * @slot hint - Help text under the field.
43
39
  * @slot start - Content at the leading end of the field, inside its border.
44
- * @slot trigger - The mark on the field saying a panel opens.
40
+ * @slot trigger - The icon on the trigger, which shows that the field opens a panel.
45
41
  *
46
- * @event {Event} change - Announced once the value has moved.
47
- * @event {HelixBeforeChangeEvent} helix-before-change - Fired before the color changes. Cancelable: refusing it takes the decision and nothing moves.
48
- * @event {HelixBeforeCloseEvent} helix-before-close - Fired before it closes. Cancelable: refusing it takes the decision and nothing moves.
49
- * @event {HelixBeforeOpenEvent} helix-before-open - Fired before the panel opens. Cancelable: refusing it takes the decision and nothing moves.
50
- * @event {Event} input - Announced once the value has moved.
51
- * @event {Event} toggle - Says the state moved, carrying `newState` and `oldState`.
42
+ * @event {Event} change - Sent when the user finishes changing the value.
43
+ * @event {HelixBeforeChangeEvent} helix-before-change - The color is about to change. Cancelable: cancel it to keep the current color.
44
+ * @event {HelixBeforeCloseEvent} helix-before-close - The panel is about to close. Cancelable: cancel it to keep it open.
45
+ * @event {HelixBeforeOpenEvent} helix-before-open - The panel is about to open. Cancelable: cancel it to keep it closed.
46
+ * @event {Event} input - Fired as the value changes.
47
+ * @event {Event} toggle - The panel opened or closed. The event carries `newState` and `oldState`.
52
48
  *
53
- * @csspart control - The text input carrying the value. Absent in `swatch`.
54
- * @csspart feedback - What is wrong with it.
49
+ * @csspart control - The text input that holds the value. Absent in the `swatch` variant.
50
+ * @csspart feedback - The message that says what is wrong with the value.
55
51
  * @csspart field - The box holding the text and the trigger.
56
- * @csspart hint - Help under the field, while nothing is wrong.
57
- * @csspart label - The question, over the field.
58
- * @csspart picker - The color picker inside it.
52
+ * @csspart hint - Help text under the field, shown while there is no feedback.
53
+ * @csspart label - The label above the field.
54
+ * @csspart picker - The color picker inside the panel.
59
55
  * @csspart picker-actions - The group holding the eyedropper and the syntax toggle.
60
- * @csspart picker-channel - One ramp.
61
- * @csspart picker-channel-control - The range input.
62
- * @csspart picker-channel-feedback - What is wrong with it.
63
- * @csspart picker-channel-field - The row: the control and its readout.
64
- * @csspart picker-channel-hint - Help under the track, while nothing is wrong.
65
- * @csspart picker-channel-label - The question, over the track.
66
- * @csspart picker-channel-marker - One mark.
56
+ * @csspart picker-channel - One channel slider.
57
+ * @csspart picker-channel-control - The range input of a channel slider.
58
+ * @csspart picker-channel-feedback - The error message for a channel slider.
59
+ * @csspart picker-channel-field - The row that holds a channel slider's control and its readout.
60
+ * @csspart picker-channel-hint - The help text under the track, shown while there is no error.
61
+ * @csspart picker-channel-label - The label above the track.
62
+ * @csspart picker-channel-marker - One mark on the track.
67
63
  * @csspart picker-channel-marker-label - The value a mark stands at, when `marker-labels` is set.
68
64
  * @csspart picker-channel-markers - The row of marks along the track.
69
- * @csspart picker-channel-output - The current value, shown beside it.
70
- * @csspart picker-channels - The ramps beside it.
65
+ * @csspart picker-channel-output - The current value, shown beside the track.
66
+ * @csspart picker-channels - The channel sliders beside the sample.
71
67
  * @csspart picker-controls - The row under the square.
72
68
  * @csspart picker-eyedropper - The control that samples a color from the screen.
73
- * @csspart picker-eyedropper-button - The inner control.
69
+ * @csspart picker-eyedropper-button - The button inside `picker-eyedropper`.
74
70
  * @csspart picker-footer - The row holding the value and the tools.
75
71
  * @csspart picker-format - The control that changes the syntax the value is written in.
76
- * @csspart picker-format-button - The inner control.
72
+ * @csspart picker-format-button - The button inside `picker-format`.
77
73
  * @csspart picker-grid - The saturation and brightness square.
78
- * @csspart picker-grid-brightness - The range input for its vertical axis.
74
+ * @csspart picker-grid-brightness - The range input for the square's vertical axis.
79
75
  * @csspart picker-grid-handle - The mark showing where in the square the color sits.
80
76
  * @csspart picker-grid-saturation - The range input for the square's horizontal axis.
81
- * @csspart picker-icon - A glyph this component draws.
82
- * @csspart picker-sample - The chip of the current color, which copies it when pressed.
77
+ * @csspart picker-icon - An icon drawn by the picker.
78
+ * @csspart picker-sample - A chip of the current color. Pressing it copies the value.
83
79
  * @csspart picker-swatch - One preset.
84
80
  * @csspart picker-swatches - The row of presets.
85
- * @csspart picker-value - The color as text, which can be typed or pasted.
81
+ * @csspart picker-value - The text field that holds the color. It accepts a typed or pasted color.
86
82
  * @csspart preview - The chip showing the color, inside the trigger.
87
83
  * @csspart surface - The floating panel.
88
84
  * @csspart trigger - The control that opens the panel.
89
85
  *
90
- * @cssproperty --color-input-swatch - The chosen color, to paint over the transparency check.
86
+ * @cssproperty --color-input-swatch - The chosen color, painted over the checkerboard that shows transparency.
91
87
  *
92
- * @cssstate invalid - While there is feedback to show: the platform's verdict, or the consumer's `feedback`.
88
+ * @cssstate invalid - The control has an error to show, from the browser's validation or from your `feedback`.
93
89
  * @cssstate open - While the picker is open.
94
90
  */
95
91
  export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_base {
@@ -108,7 +104,7 @@ export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_bas
108
104
  */
109
105
  autocomplete: string;
110
106
  /**
111
- * The syntax the value is written in: `hex`, `rgb` or `hsl`.
107
+ * The syntax the value is written in: `hex`, `rgb`, or `hsl`.
112
108
  *
113
109
  * **Undefaulted, because it reflects.** The two together stamp an attribute
114
110
  * onto every host anybody renders, including the ones nobody configured: the
@@ -120,11 +116,11 @@ export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_bas
120
116
  */
121
117
  format?: ColorFormat;
122
118
  /**
123
- * Whether the reader may change the format from the panel.
119
+ * Hides the button in the panel that changes the format.
124
120
  */
125
121
  noFormat: boolean;
126
122
  /**
127
- * What the field says before a color is in it.
123
+ * The text the field shows before a color is entered.
128
124
  */
129
125
  placeholder: string;
130
126
  /**
@@ -184,6 +180,16 @@ export declare class HelixHeadlessColorInput extends HelixHeadlessColorInput_bas
184
180
  private get painted();
185
181
  /** Relayed under this element's name, so a consumer hears one control. */
186
182
  private readonly handleInput;
183
+ /**
184
+ * The picker's request, taken as this element's own.
185
+ *
186
+ * **Only the picker's.** A request from anything inside it arrives here
187
+ * retargeted to the picker, and a slider's carried its number: a hue of 120
188
+ * became this field's value and every page listening heard it. The picker
189
+ * keeps its sliders' requests now, and this checks where the event started
190
+ * as well, so a picker a tier above renders cannot say for it what it did
191
+ * not mean.
192
+ */
187
193
  private readonly handlePickerChange;
188
194
  /**
189
195
  * The picker is about to take the pointer over, so the panel gets out of the
@@ -29,6 +29,9 @@ let HelixHeadlessColorInput = class HelixHeadlessColorInput extends MixinPickerF
29
29
  };
30
30
  this.handlePickerChange = (event) => {
31
31
  event.stopPropagation();
32
+ if (event.composedPath()[0] !== event.currentTarget) {
33
+ return;
34
+ }
32
35
  this.requestValue(event.detail.value);
33
36
  this.restore();
34
37
  };