@fusion.dev/helix-headless 0.241.2 → 0.242.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 (91) hide show
  1. package/api.json +1 -1
  2. package/custom-elements.json +1 -1
  3. package/dist/chat/composer/chat-composer.d.ts +8 -1
  4. package/dist/chat/composer/chat-composer.js +15 -1
  5. package/dist/chat/message/chat-message.d.ts +12 -0
  6. package/dist/chat/message/chat-message.js +8 -0
  7. package/dist/chat/root/chat-root.d.ts +9 -0
  8. package/dist/chat/root/chat-root.js +13 -1
  9. package/dist/code-editor/root/code-editor-root.d.ts +1 -0
  10. package/dist/code-editor/root/code-editor-root.js +1 -1
  11. package/dist/column-manager/root/column-manager-root.d.ts +30 -2
  12. package/dist/column-manager/root/column-manager-root.js +73 -9
  13. package/dist/combobox/root/combobox-root.d.ts +8 -1
  14. package/dist/combobox/root/combobox-root.js +19 -2
  15. package/dist/data-table/binding.d.ts +22 -0
  16. package/dist/data-table/binding.js +52 -7
  17. package/dist/data-table/root/data-table-root.d.ts +34 -6
  18. package/dist/data-table/root/data-table-root.js +42 -7
  19. package/dist/date-input/root/date-input-root.d.ts +8 -1
  20. package/dist/date-input/root/date-input-root.js +19 -2
  21. package/dist/date-picker/root/date-picker-root.d.ts +5 -0
  22. package/dist/date-picker/root/date-picker-root.js +3 -0
  23. package/dist/editor/root/editor-root.d.ts +1 -0
  24. package/dist/editor/root/editor-root.js +1 -1
  25. package/dist/element-events.generated.js +2 -0
  26. package/dist/file-input/root/file-input-root.d.ts +8 -1
  27. package/dist/file-input/root/file-input-root.js +19 -2
  28. package/dist/filter-input/root/filter-input-root.d.ts +8 -1
  29. package/dist/filter-input/root/filter-input-root.js +13 -1
  30. package/dist/find/root/find-root.d.ts +1 -0
  31. package/dist/find/root/find-root.js +4 -4
  32. package/dist/hover-card/index.d.ts +1 -0
  33. package/dist/hover-card/index.js +1 -0
  34. package/dist/hover-card/root/hover-card-root.d.ts +122 -0
  35. package/dist/hover-card/root/hover-card-root.js +185 -0
  36. package/dist/index.d.ts +2 -0
  37. package/dist/index.js +2 -0
  38. package/dist/line-chart/root/line-chart-root.d.ts +7 -1
  39. package/dist/line-chart/root/line-chart-root.js +6 -0
  40. package/dist/list/root/list-root.d.ts +12 -1
  41. package/dist/list/root/list-root.js +11 -1
  42. package/dist/log/line/log-line.d.ts +11 -0
  43. package/dist/log/line/log-line.js +8 -0
  44. package/dist/log/root/log-root.d.ts +9 -0
  45. package/dist/log/root/log-root.js +13 -1
  46. package/dist/meter/root/meter-root.d.ts +12 -1
  47. package/dist/meter/root/meter-root.js +31 -2
  48. package/dist/navigation/root/navigation-root.d.ts +5 -1
  49. package/dist/navigation/root/navigation-root.js +13 -1
  50. package/dist/notifications/root/notifications-root.d.ts +10 -1
  51. package/dist/notifications/root/notifications-root.js +12 -1
  52. package/dist/object-inspector/root/object-inspector-root.js +6 -6
  53. package/dist/pagination/root/pagination-root.d.ts +16 -1
  54. package/dist/pagination/root/pagination-root.js +19 -1
  55. package/dist/popover/root/popover-root.d.ts +6 -0
  56. package/dist/popover/root/popover-root.js +2 -0
  57. package/dist/progress/root/progress-root.d.ts +11 -1
  58. package/dist/progress/root/progress-root.js +29 -2
  59. package/dist/sparkline/root/sparkline-root.d.ts +3 -1
  60. package/dist/sparkline/root/sparkline-root.js +8 -1
  61. package/dist/stat/root/stat-root.d.ts +22 -1
  62. package/dist/stat/root/stat-root.js +27 -4
  63. package/dist/table/root/table-root.d.ts +22 -5
  64. package/dist/table/root/table-root.js +13 -1
  65. package/dist/tabs/root/tabs-root.d.ts +6 -1
  66. package/dist/tabs/root/tabs-root.js +12 -1
  67. package/dist/tag/group/tag-group.d.ts +13 -1
  68. package/dist/tag/group/tag-group.js +12 -1
  69. package/dist/terminal/root/terminal-root.d.ts +1 -0
  70. package/dist/terminal/root/terminal-root.js +1 -1
  71. package/dist/theme-toggle/index.d.ts +1 -0
  72. package/dist/theme-toggle/index.js +1 -0
  73. package/dist/theme-toggle/root/theme-toggle-root.d.ts +98 -0
  74. package/dist/theme-toggle/root/theme-toggle-root.js +68 -0
  75. package/dist/time-input/root/time-input-root.d.ts +8 -1
  76. package/dist/time-input/root/time-input-root.js +19 -2
  77. package/dist/timeline/root/timeline-root.d.ts +10 -1
  78. package/dist/timeline/root/timeline-root.js +11 -1
  79. package/dist/toggle/group/toggle-group.d.ts +5 -1
  80. package/dist/toggle/group/toggle-group.js +12 -2
  81. package/dist/tree/root/tree-root.d.ts +13 -1
  82. package/dist/tree/root/tree-root.js +11 -1
  83. package/dist/trend/root/trend-root.d.ts +14 -1
  84. package/dist/trend/root/trend-root.js +20 -2
  85. package/examples.json +1 -1
  86. package/lint.json +1 -1
  87. package/package.json +5 -5
  88. package/types/jsx.d.ts +425 -10
  89. package/types/svelte.d.ts +2 -0
  90. package/types/vue.d.ts +249 -8
  91. package/types/words.d.ts +8 -0
@@ -482,7 +482,7 @@ let HelixHeadlessTerminal = class HelixHeadlessTerminal extends HelixElement {
482
482
  const find = this.tag('find');
483
483
  return html `<${find}
484
484
  part="find"
485
- exportparts="actions: find-actions, bar: find-bar, close: find-close, close-button: find-close-button, close-live: find-close-live, close-spinner: find-close-spinner, close-text: find-close-text, controls: find-controls, controls-toolbar: find-controls-toolbar, count: find-count, field: find-field, live: find-live, match-case: find-match-case, match-case-button: find-match-case-button, match-case-live: find-match-case-live, match-case-pressed: find-match-case-pressed, match-case-spinner: find-match-case-spinner, match-case-text: find-match-case-text, next: find-next, next-button: find-next-button, next-live: find-next-live, next-spinner: find-next-spinner, next-text: find-next-text, previous: find-previous, previous-button: find-previous-button, previous-live: find-previous-live, previous-spinner: find-previous-spinner, previous-text: find-previous-text, regex: find-regex, regex-button: find-regex-button, regex-live: find-regex-live, regex-pressed: find-regex-pressed, regex-spinner: find-regex-spinner, regex-text: find-regex-text, replace-all-button: find-replace-all-button, replace-all-live: find-replace-all-live, replace-all-spinner: find-replace-all-spinner, replace-all-text: find-replace-all-text, replace-all: find-replace-all, replace-button: find-replace-button, replace-field: find-replace-field, replace-live: find-replace-live, replace-spinner: find-replace-spinner, replace-text: find-replace-text, replace-toggle-button: find-replace-toggle-button, replace-toggle-live: find-replace-toggle-live, replace-toggle-spinner: find-replace-toggle-spinner, replace-toggle-text: find-replace-toggle-text, replace-toggle: find-replace-toggle, replace: find-replace, whole-word: find-whole-word, whole-word-button: find-whole-word-button, whole-word-live: find-whole-word-live, whole-word-pressed: find-whole-word-pressed, whole-word-spinner: find-whole-word-spinner, whole-word-text: find-whole-word-text"
485
+ exportparts="actions: find-actions, bar: find-bar, close: find-close, close-button: find-close-button, close-live: find-close-live, close-spinner: find-close-spinner, close-text: find-close-text, controls: find-controls, controls-toolbar: find-controls-toolbar, count: find-count, field: find-field, live: find-live, match-case: find-match-case, match-case-button: find-match-case-button, match-case-live: find-match-case-live, match-case-pressed: find-match-case-pressed, match-case-spinner: find-match-case-spinner, match-case-text: find-match-case-text, next: find-next, next-button: find-next-button, next-live: find-next-live, next-spinner: find-next-spinner, next-text: find-next-text, previous: find-previous, previous-button: find-previous-button, previous-live: find-previous-live, previous-spinner: find-previous-spinner, previous-text: find-previous-text, regex: find-regex, regex-button: find-regex-button, regex-live: find-regex-live, regex-pressed: find-regex-pressed, regex-spinner: find-regex-spinner, regex-text: find-regex-text, replace-all-button: find-replace-all-button, replace-all-live: find-replace-all-live, replace-all-spinner: find-replace-all-spinner, replace-all-text: find-replace-all-text, replace-all: find-replace-all, replace-button: find-replace-button, replace-field: find-replace-field, replace-live: find-replace-live, replace-spinner: find-replace-spinner, replace-text: find-replace-text, replace-toggle-button: find-replace-toggle-button, replace-toggle-live: find-replace-toggle-live, replace-toggle-mark: find-replace-toggle-mark, replace-toggle-spinner: find-replace-toggle-spinner, replace-toggle-text: find-replace-toggle-text, replace-toggle: find-replace-toggle, replace: find-replace, whole-word: find-whole-word, whole-word-button: find-whole-word-button, whole-word-live: find-whole-word-live, whole-word-pressed: find-whole-word-pressed, whole-word-spinner: find-whole-word-spinner, whole-word-text: find-whole-word-text"
486
486
  close-label=${this.findCloseLabel}
487
487
  controls-label=${this.findControlsLabel}
488
488
  invalid-label=${this.findInvalidLabel}
@@ -0,0 +1 @@
1
+ export { HelixHeadlessThemeToggle } from './root/theme-toggle-root.js';
@@ -0,0 +1 @@
1
+ export { HelixHeadlessThemeToggle } from './root/theme-toggle-root.js';
@@ -0,0 +1,98 @@
1
+ import { type ColorModeTransition, HelixElement } from '@fusion.dev/helix-core';
2
+ import { type TemplateResult } from 'lit';
3
+ /**
4
+ * @summary A button that switches the page between light and dark, with the new mode spreading from the button.
5
+ *
6
+ * @description
7
+ * A press moves the whole page to the other color mode. By default the new
8
+ * mode spreads in a circle from the button. `transition` picks another way:
9
+ * `wipe` draws it across from the inline start, `fade` fades it over the old,
10
+ * and `none` changes it at once.
11
+ *
12
+ * **The choice is the page's**, held on the document element as
13
+ * `data-color-mode`, which is the one thing `helix.css` decides the mode by.
14
+ * Two of these on one page agree, and a page can set the mode in its markup,
15
+ * or from its own code with `setColorMode` from `@fusion.dev/helix-core`,
16
+ * which takes the same transitions. With no attribute the page follows the
17
+ * reader's system setting, and the button says which mode that is. To keep a
18
+ * reader's choice across visits, listen for `change` and write the mode into
19
+ * the page you serve next.
20
+ *
21
+ * **The one Helix component that starts a view transition.** A view transition
22
+ * draws the whole document twice and runs between the two pictures, so a
23
+ * component that started one for its own sake would cancel the page's, or
24
+ * have its own canceled. The color mode is the document's own state, so
25
+ * changing it is the one move that is the document's to make. Where the
26
+ * reader asked for reduced motion, or the browser has no view transitions,
27
+ * the mode changes at once.
28
+ *
29
+ * It is a toggle button: a `<button>` that says whether the page is dark with
30
+ * `aria-pressed`, under one name, `label`, whichever way it stands. Its icon
31
+ * shows what a press does next: the moon while the page is light, and the sun
32
+ * while it is dark.
33
+ *
34
+ * @since 0.241.0
35
+ * @status experimental
36
+ * @category actions
37
+ * @aliases Dark mode toggle, Color mode switch, Light and dark switch, Theme switcher
38
+ * @documentation https://fusion.dev/helix/components/theme-toggle
39
+ *
40
+ * @slot - The button's text, where it shows more than its icon. Defaults to nothing, the icon alone, named by `label`.
41
+ * @slot icon - Replaces the icon, which is the moon while the page is light and the sun while it is dark.
42
+ *
43
+ * @event {Event} change - Fired once a press has switched the page's color mode.
44
+ *
45
+ * @csspart button - The toggle button, with `aria-pressed` while the page is dark.
46
+ * @csspart icon - The icon inside the button.
47
+ *
48
+ * @cssproperty --theme-toggle-origin-x - Where a `circle` spreads from, across the viewport, while it runs. Written on the document element.
49
+ * @cssproperty --theme-toggle-origin-y - Where a `circle` spreads from, down the viewport, while it runs. Written on the document element.
50
+ * @cssproperty --theme-toggle-radius - How far a `circle` reaches, to the viewport's furthest corner, while it runs. Written on the document element.
51
+ *
52
+ * @cssstate dark - The page is in dark mode.
53
+ *
54
+ * @interactive button
55
+ */
56
+ export declare class HelixHeadlessThemeToggle extends HelixElement {
57
+ /**
58
+ * The key this family's words are registered under, its styled tag:
59
+ * `registerWords('de', { 'helix-theme-toggle': { fallbackLabel: 'Dunkler Modus' } })`.
60
+ */
61
+ static words: string;
62
+ /** The name the element gives itself where `label` is empty. */
63
+ fallbackLabel: string;
64
+ /**
65
+ * The button's name, which stays the same whichever way it stands.
66
+ *
67
+ * Empty by default, which leaves the name to `fallbackLabel`.
68
+ */
69
+ label: string;
70
+ /**
71
+ * How the page moves to the other mode: `circle` from the button, `wipe`
72
+ * across from the inline start, `fade`, or `none`.
73
+ *
74
+ * Absent is `circle`.
75
+ */
76
+ transition?: ColorModeTransition;
77
+ /** The page's mode, kept with the document element's attribute and the reader's setting. */
78
+ private mode;
79
+ /** What stops hearing the page's mode. */
80
+ private unheard;
81
+ connectedCallback(): void;
82
+ disconnectedCallback(): void;
83
+ protected updated(): void;
84
+ /** Switches the page to the other mode, spreading from the middle of the button. */
85
+ private readonly toggle;
86
+ protected render(): TemplateResult;
87
+ /**
88
+ * The icon the `icon` slot falls back to: the moon while the page is light,
89
+ * and the sun while it is dark, which is what a press does next. A tier
90
+ * above draws its own here.
91
+ */
92
+ protected renderIcon(): TemplateResult;
93
+ }
94
+ declare global {
95
+ interface HTMLElementTagNameMap {
96
+ 'helix-headless-theme-toggle': HelixHeadlessThemeToggle;
97
+ }
98
+ }
@@ -0,0 +1,68 @@
1
+ import { __decorate } from "tslib";
2
+ import { colorMode, customElement, drawIcon, HelixElement, onColorModeChange, setColorMode, words, } from '@fusion.dev/helix-core';
3
+ import { moon, sun } from '@fusion.dev/helix-icons';
4
+ import { html } from 'lit';
5
+ import { property, state } from 'lit/decorators.js';
6
+ let HelixHeadlessThemeToggle = class HelixHeadlessThemeToggle extends HelixElement {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.fallbackLabel = 'Dark mode';
10
+ this.label = '';
11
+ this.mode = 'light';
12
+ this.toggle = async () => {
13
+ const box = this.partNamed('button')?.getBoundingClientRect();
14
+ const next = colorMode() === 'dark' ? 'light' : 'dark';
15
+ await setColorMode(next, {
16
+ ...(box ? { from: { x: box.left + box.width / 2, y: box.top + box.height / 2 } } : {}),
17
+ transition: this.transition ?? 'circle',
18
+ });
19
+ this.mode = colorMode();
20
+ this.dispatchEvent(new Event('change', { bubbles: true }));
21
+ };
22
+ }
23
+ static { this.words = 'helix-theme-toggle'; }
24
+ connectedCallback() {
25
+ super.connectedCallback();
26
+ this.mode = colorMode();
27
+ this.unheard ??= onColorModeChange((mode) => {
28
+ this.mode = mode;
29
+ });
30
+ }
31
+ disconnectedCallback() {
32
+ super.disconnectedCallback();
33
+ this.unheard?.();
34
+ this.unheard = undefined;
35
+ }
36
+ updated() {
37
+ this.toggleState('dark', this.mode === 'dark');
38
+ }
39
+ render() {
40
+ return html `<button
41
+ aria-label=${this.label || this.fallbackLabel}
42
+ aria-pressed=${this.mode === 'dark' ? 'true' : 'false'}
43
+ part="button"
44
+ type="button"
45
+ @click=${this.toggle}
46
+ ><span part="icon">${this.renderIcon()}</span><slot></slot></button>`;
47
+ }
48
+ renderIcon() {
49
+ return html `<slot name="icon">${drawIcon(this.mode === 'dark' ? sun : moon)}</slot>`;
50
+ }
51
+ };
52
+ __decorate([
53
+ words,
54
+ property({ attribute: 'fallback-label' })
55
+ ], HelixHeadlessThemeToggle.prototype, "fallbackLabel", void 0);
56
+ __decorate([
57
+ property()
58
+ ], HelixHeadlessThemeToggle.prototype, "label", void 0);
59
+ __decorate([
60
+ property()
61
+ ], HelixHeadlessThemeToggle.prototype, "transition", void 0);
62
+ __decorate([
63
+ state()
64
+ ], HelixHeadlessThemeToggle.prototype, "mode", void 0);
65
+ HelixHeadlessThemeToggle = __decorate([
66
+ customElement('helix-headless-theme-toggle')
67
+ ], HelixHeadlessThemeToggle);
68
+ export { HelixHeadlessThemeToggle };
@@ -1,4 +1,4 @@
1
- import { AriaForwardController, HelixFormElement, type HourCycle } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, HelixFormElement, type HourCycle, LayoutMotionController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../tag/root/index.js';
4
4
  import '../../time-picker/index.js';
@@ -169,6 +169,13 @@ export declare class HelixHeadlessTimeInput extends HelixHeadlessTimeInput_base
169
169
  * `registerWords('de', { 'helix-time-input': { triggerLabel: 'Uhrzeit auswählen' } })`.
170
170
  */
171
171
  static words: string;
172
+ /**
173
+ * Sliding the times chosen to their new places as they come and go: one arriving
174
+ * fades in, one leaving fades where it was, and the rest close up. Timed by
175
+ * `--time-input-move-duration` and `--time-input-move-easing`, which this tier never
176
+ * sets, so it moves nothing until a stylesheet does.
177
+ */
178
+ protected readonly motion: LayoutMotionController;
172
179
  protected readonly aria: AriaForwardController;
173
180
  /**
174
181
  * What the browser may autofill here, as one of the platform's own tokens.
@@ -1,8 +1,9 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, valueAsTime as asTime, clockLocale, customElement, drawIcon, formatWords, timeAsValue as fromTime, HelixClearEvent, HelixFormElement, handedLocale, hostWords, isClockValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, numberConverter, readWrittenTime, slottedWords, timeFault, words, wordsLocale, writeClock, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, valueAsTime as asTime, clockLocale, customElement, drawIcon, formatWords, timeAsValue as fromTime, HelixClearEvent, HelixFormElement, handedLocale, hostWords, isClockValue, LayoutMotionController, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, numberConverter, readWrittenTime, slottedWords, timeFault, words, wordsLocale, writeClock, } from '@fusion.dev/helix-core';
3
3
  import { clock, x } from '@fusion.dev/helix-icons';
4
4
  import { nothing } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
6
+ import { repeat } from 'lit/directives/repeat.js';
6
7
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
7
8
  import { html } from 'lit/static-html.js';
8
9
  import '../../tag/root/index.js';
@@ -10,6 +11,22 @@ import '../../time-picker/index.js';
10
11
  let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmentedField(MixinPickerEditing(MixinPickerField(MixinControllerOpen(MixinTokens(MixinControllerValue(MixinField(HelixFormElement))))))) {
11
12
  constructor() {
12
13
  super(...arguments);
14
+ this.motion = new LayoutMotionController(this, {
15
+ arriveIntoEmpty: true,
16
+ items: () => [
17
+ ...(this.renderRoot?.querySelectorAll('[part~="time"]:not([data-leaving])') ??
18
+ []),
19
+ ],
20
+ leaving: () => this.partNamed('field'),
21
+ timing: () => {
22
+ const style = getComputedStyle(this);
23
+ return {
24
+ duration: style.getPropertyValue('--time-input-move-duration'),
25
+ easing: style.getPropertyValue('--time-input-move-easing'),
26
+ };
27
+ },
28
+ watch: 'updates',
29
+ });
13
30
  this.aria = new AriaForwardController(this, {
14
31
  target: () => this.partNamed('control') ?? this.segmentGroup,
15
32
  });
@@ -320,7 +337,7 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinSegmented
320
337
  <div part="field" @keydown=${this.handleKeydown}>
321
338
  <slot name="start"></slot>
322
339
  ${this.mode === 'multiple'
323
- ? this.renderTokenRow(this.shownTimes.map((at) => this.renderTag(at)), this.restCount)
340
+ ? this.renderTokenRow(repeat(this.shownTimes, (at) => at, (at) => this.renderTag(at)), this.restCount)
324
341
  : nothing}
325
342
  ${this.segmentsShown ? this.renderSegments() : this.renderControl()}
326
343
  <slot name="end"></slot>
@@ -1,4 +1,4 @@
1
- import { HelixElement } from '@fusion.dev/helix-core';
1
+ import { HelixElement, LayoutMotionController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
4
  * @summary A list of events, in the order they happened.
@@ -43,6 +43,9 @@ import { type PropertyValues, type TemplateResult } from 'lit';
43
43
  *
44
44
  * @csspart loading - The entry after the last while `loading` is set.
45
45
  *
46
+ * @cssproperty --timeline-move-duration - How long an entry or a group takes to slide to its new place when one before it arrives or goes, or to fade in. Unset, nothing moves.
47
+ * @cssproperty --timeline-move-easing - The curve an entry slides and fades in along.
48
+ *
46
49
  * @cssstate loading - While `loading` is set.
47
50
  */
48
51
  export declare class HelixHeadlessTimeline extends HelixElement {
@@ -66,6 +69,12 @@ export declare class HelixHeadlessTimeline extends HelixElement {
66
69
  * @deprecated Use `loading-text`. Removed in the next release.
67
70
  */
68
71
  loadingLabel?: string;
72
+ /**
73
+ * Slides the entries and groups to their places when one arrives or goes,
74
+ * and fades in one that arrives, as `List` does, timed from
75
+ * `--timeline-move-duration` and `--timeline-move-easing`.
76
+ */
77
+ protected readonly motion: LayoutMotionController;
69
78
  /** The text of the entry drawn while `loading` is set, where the `loading` slot is empty. */
70
79
  loadingText: string;
71
80
  protected render(): TemplateResult;
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { customElement, HelixElement, hostAria, internalsOf, words } from '@fusion.dev/helix-core';
2
+ import { customElement, HelixElement, hostAria, internalsOf, LayoutMotionController, words, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing } from 'lit';
4
4
  import { property } from 'lit/decorators.js';
5
5
  let HelixHeadlessTimeline = class HelixHeadlessTimeline extends HelixElement {
@@ -7,6 +7,16 @@ let HelixHeadlessTimeline = class HelixHeadlessTimeline extends HelixElement {
7
7
  super(...arguments);
8
8
  this.label = '';
9
9
  this.loading = false;
10
+ this.motion = new LayoutMotionController(this, {
11
+ items: () => [...this.children].filter((child) => child instanceof HTMLElement && child.getAttribute('slot') !== 'loading'),
12
+ timing: () => {
13
+ const style = getComputedStyle(this);
14
+ return {
15
+ duration: style.getPropertyValue('--timeline-move-duration'),
16
+ easing: style.getPropertyValue('--timeline-move-easing'),
17
+ };
18
+ },
19
+ });
10
20
  this.loadingText = 'Loading';
11
21
  }
12
22
  static { this.words = 'helix-timeline'; }
@@ -1,4 +1,4 @@
1
- import { DisabledCascadeController, HelixFormElement, KeyboardNavigationController, UpgradeController } from '@fusion.dev/helix-core';
1
+ import { DisabledCascadeController, HelixFormElement, HoverMarkController, KeyboardNavigationController, UpgradeController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  declare const HelixHeadlessToggleGroup_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerValueInterface) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinFieldInterface) & typeof HelixFormElement;
4
4
  /**
@@ -63,6 +63,7 @@ declare const HelixHeadlessToggleGroup_base: (new (...args: any[]) => import("@f
63
63
  * @event {Event} input - Fired after the value changes.
64
64
  *
65
65
  * @csspart feedback - The error message under the row.
66
+ * @csspart highlight - The wash under the pointer, which glides from item to item while a mouse or pen moves along them. It carries the item's place and size as the indicator does, `data-placed` while it is over one, and `data-gliding` from the frame after it arrives. Hidden until a stylesheet shows it, so the headless tier lays out as it did without it.
66
67
  * @csspart hint - The help text under the row, shown while there is no error.
67
68
  * @csspart indicator - The moving marker behind the selected item.
68
69
  * @csspart label - The label above the row.
@@ -72,6 +73,7 @@ declare const HelixHeadlessToggleGroup_base: (new (...args: any[]) => import("@f
72
73
  * ships no CSS, so it renders no separate element for the line, which would add
73
74
  * an empty child to your layout.
74
75
  *
76
+ * @cssstate gliding - While a mouse or pen is over an item, so the highlight draws the hover wash in place of each item's own.
75
77
  * @cssstate invalid - The group has an error to show, from the browser's validation or from your `feedback`.
76
78
  */
77
79
  export declare class HelixHeadlessToggleGroup extends HelixHeadlessToggleGroup_base {
@@ -194,6 +196,8 @@ export declare class HelixHeadlessToggleGroup extends HelixHeadlessToggleGroup_b
194
196
  */
195
197
  protected get focusTarget(): HTMLElement | null;
196
198
  private readonly indicator;
199
+ /** Moves the hover wash to whichever item is under the pointer, as segmented `Tabs` does. A disabled item takes none. */
200
+ protected readonly highlight: HoverMarkController;
197
201
  protected readonly keys: KeyboardNavigationController;
198
202
  protected readonly cascade: DisabledCascadeController;
199
203
  /**
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { commaList, customElement, DisabledCascadeController, HelixFormElement, hostAria, IndicatorController, internalsOf, KeyboardNavigationController, MixinControllerValue, MixinField, reportValues, rovingStop, toggleValue, toolbarAround, UpgradeController, } from '@fusion.dev/helix-core';
2
+ import { commaList, customElement, DisabledCascadeController, HelixFormElement, HoverMarkController, hostAria, IndicatorController, internalsOf, KeyboardNavigationController, MixinControllerValue, MixinField, reportValues, rovingStop, toggleValue, toolbarAround, UpgradeController, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing } from 'lit';
4
4
  import { property } from 'lit/decorators.js';
5
5
  import { HelixHeadlessToggle } from '../root/toggle-root.js';
@@ -23,6 +23,16 @@ let HelixHeadlessToggleGroup = class HelixHeadlessToggleGroup extends MixinContr
23
23
  observe: () => this.items,
24
24
  surface: () => this.partNamed('track'),
25
25
  });
26
+ this.highlight = new HoverMarkController(this, {
27
+ gliding: (on) => this.toggleState('gliding', on),
28
+ item: (under) => {
29
+ const items = this.items;
30
+ return under.find((one) => one instanceof HelixHeadlessToggle && items.includes(one) && !one.disabled);
31
+ },
32
+ mark: () => this.partNamed('highlight'),
33
+ observe: () => this.items,
34
+ surface: () => this.partNamed('track'),
35
+ });
26
36
  this.keys = new KeyboardNavigationController(this, {
27
37
  items: () => this.items,
28
38
  selects: () => !this.multiple,
@@ -190,7 +200,7 @@ let HelixHeadlessToggleGroup = class HelixHeadlessToggleGroup extends MixinContr
190
200
  render() {
191
201
  const inside = this.labelPlacement === 'start';
192
202
  const label = this.renderGroupLabel();
193
- return html `${inside ? nothing : label}<div part="row"><slot name="start"></slot><div part="track">${inside ? label : nothing}<div part="indicator" aria-hidden="true"></div><slot @slotchange=${this.handleItems}></slot></div><slot name="end"></slot></div>${this.renderHint()}${this.renderFeedback()}`;
203
+ return html `${inside ? nothing : label}<div part="row"><slot name="start"></slot><div part="track">${inside ? label : nothing}<span part="highlight" aria-hidden="true" hidden></span><div part="indicator" aria-hidden="true"></div><slot @slotchange=${this.handleItems}></slot></div><slot name="end"></slot></div>${this.renderHint()}${this.renderFeedback()}`;
194
204
  }
195
205
  };
196
206
  __decorate([
@@ -1,4 +1,4 @@
1
- import { AriaForwardController, HelixElement, UpgradeController } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, HelixElement, LayoutMotionController, UpgradeController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  declare const HelixHeadlessTree_base: (new (...args: any[]) => import("@fusion.dev/helix-core").CollectionElement) & (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerActiveInterface) & typeof HelixElement;
4
4
  /**
@@ -71,6 +71,13 @@ declare const HelixHeadlessTree_base: (new (...args: any[]) => import("@fusion.d
71
71
  * holding that branch's items in their new order. The tree says the move with
72
72
  * `moved-into-label`.
73
73
  *
74
+ * **Items slide to their places.** When you move, add, remove or hide items,
75
+ * each one moves from where it was drawn to where it is now, a branch carrying
76
+ * its rows with it, and an item you add fades in. The tree times it from
77
+ * `--tree-move-duration` and `--tree-move-easing`, which the styled tier sets
78
+ * from the duration and easing tokens. Here neither is set, so nothing moves
79
+ * until you set them. Under reduced motion nothing moves, whatever they say.
80
+ *
74
81
  * @since 0.1.0
75
82
  * @status stable
76
83
  * @category navigation
@@ -90,6 +97,9 @@ declare const HelixHeadlessTree_base: (new (...args: any[]) => import("@fusion.d
90
97
  * @csspart live - A copy of the empty and loading messages, and each step of a move in a `reorderable` tree, in a live region that announces them when they change. Visually hidden in the styled tier.
91
98
  * @csspart loading - Shown while the rows load.
92
99
  * @csspart tree - The tree container.
100
+ *
101
+ * @cssproperty --tree-move-duration - How long an item takes to slide to its new place, or to fade in. Unset, nothing moves.
102
+ * @cssproperty --tree-move-easing - The curve an item slides and fades in along.
93
103
  */
94
104
  export declare class HelixHeadlessTree extends HelixHeadlessTree_base {
95
105
  /**
@@ -132,6 +142,8 @@ export declare class HelixHeadlessTree extends HelixHeadlessTree_base {
132
142
  protected readonly aria: AriaForwardController;
133
143
  /** The letters typed so far, for moving to an item by its name. */
134
144
  private readonly typeahead;
145
+ /** Sliding each item to its new place when the page moves, adds, removes or hides items. */
146
+ protected readonly motion: LayoutMotionController;
135
147
  /**
136
148
  * Moving items among their siblings, in a `reorderable` tree. The items are
137
149
  * the page's, so a drop asks the page to move them.
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, auditName, closestInstance, commaList, customElement, deepActiveElement, formatWords, HelixElement, inlineStep, keyClaimed, MixinCollection, MixinControllerActive, ReorderController, requestReorder, scrollItemIntoView, selectsAll, slottedWords, Typeahead, treeArrow, typesCharacter, UpgradeController, whenHydrated, words, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, auditName, closestInstance, commaList, customElement, deepActiveElement, formatWords, HelixElement, inlineStep, keyClaimed, LayoutMotionController, MixinCollection, MixinControllerActive, ReorderController, requestReorder, scrollItemIntoView, selectsAll, slottedWords, Typeahead, treeArrow, typesCharacter, UpgradeController, whenHydrated, words, } from '@fusion.dev/helix-core';
3
3
  import { html, nothing } from 'lit';
4
4
  import { property } from 'lit/decorators.js';
5
5
  import { fromGrip } from '../grip.js';
@@ -28,6 +28,16 @@ let HelixHeadlessTree = class HelixHeadlessTree extends MixinCollection(MixinCon
28
28
  target: () => this.partNamed('tree'),
29
29
  });
30
30
  this.typeahead = new Typeahead();
31
+ this.motion = new LayoutMotionController(this, {
32
+ items: () => this.items,
33
+ timing: () => {
34
+ const style = getComputedStyle(this);
35
+ return {
36
+ duration: style.getPropertyValue('--tree-move-duration'),
37
+ easing: style.getPropertyValue('--tree-move-easing'),
38
+ };
39
+ },
40
+ });
31
41
  this.reorder = new ReorderController(this, {
32
42
  axis: 'block',
33
43
  box: (key) => this.itemFor(key)?.getBoundingClientRect(),
@@ -1,4 +1,4 @@
1
- import { HelixElement } from '@fusion.dev/helix-core';
1
+ import { CountController, HelixElement } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
4
  * @summary An indicator that shows which way a measurement moved, and whether the change is good.
@@ -27,6 +27,13 @@ import { type PropertyValues, type TemplateResult } from 'lit';
27
27
  * such as `{"style":"percent"}` for `12%`. `movement` still wins when it is
28
28
  * written. Without `value` the metric is what the page slots.
29
29
  *
30
+ * **A new `value` counts to the new change** from the one before, as Stat's
31
+ * figure does, and a screen reader reads only the new change. The trend times
32
+ * the count from `--trend-count-duration` and `--trend-count-easing`, which
33
+ * the styled tier sets from the duration and easing tokens. Here neither is
34
+ * set, so the change shows at once until you set them, and under reduced
35
+ * motion it always does.
36
+ *
30
37
  * Slot one glyph per movement into `up-icon`, `down-icon` and `neutral-icon`,
31
38
  * and the trend shows the one that matches; a glyph in `icon` stands in for
32
39
  * all three. Inside a `Stat`, put the trend in the stat's `trend` slot so it is
@@ -53,12 +60,18 @@ import { type PropertyValues, type TemplateResult } from 'lit';
53
60
  * @csspart icon - The arrow.
54
61
  * @csspart value - The change written from `value`, hidden while `value` is no number.
55
62
  *
63
+ * @cssproperty --trend-count-duration - How long a new `value` takes to count from the one before. Unset, the change shows at once.
64
+ * @cssproperty --trend-count-easing - The curve a new `value` counts along.
65
+ *
56
66
  * @cssstate better - The trend moved the way `good` names.
57
67
  * @cssstate down - The trend moved down, as `movement`, the old `direction`, or the sign of `value` says.
58
68
  * @cssstate up - The trend moved up, as `movement`, the old `direction`, or the sign of `value` says.
59
69
  * @cssstate worse - The trend moved against the way `good` names.
60
70
  */
61
71
  export declare class HelixHeadlessTrend extends HelixElement {
72
+ protected static markRules: string[];
73
+ /** Counting a new `value` from the one before. */
74
+ protected readonly count: CountController;
62
75
  /**
63
76
  * The key this family's words are registered under, its styled tag:
64
77
  * `registerWords('de', { 'helix-trend': { upLabel: 'Gestiegen' } })`.
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { customElement, formatWords, HelixElement, numberConverter, reportRuntime, words, wordsLocale, } from '@fusion.dev/helix-core';
2
+ import { CountController, customElement, formatWords, HelixElement, numberConverter, reportRuntime, SPOKEN_RULE, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { arrowDown, arrowUp, minus } from '@fusion.dev/helix-icons';
4
4
  import { html } from 'lit';
5
5
  import { property } from 'lit/decorators.js';
@@ -14,6 +14,15 @@ const readDirection = (value) => DIRECTIONS[value] ?? DIRECTIONS.neutral;
14
14
  let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
15
15
  constructor() {
16
16
  super(...arguments);
17
+ this.count = new CountController(this, {
18
+ timing: () => {
19
+ const style = getComputedStyle(this);
20
+ return {
21
+ duration: style.getPropertyValue('--trend-count-duration'),
22
+ easing: style.getPropertyValue('--trend-count-easing'),
23
+ };
24
+ },
25
+ });
17
26
  this.betterLabel = 'better';
18
27
  this.downLabel = 'Down';
19
28
  this.judgmentLabel = '{judgment, select, better {{direction}, {betterLabel}} worse {{direction}, {worseLabel}} other {{direction}}}';
@@ -22,6 +31,7 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
22
31
  this.upLabel = 'Up';
23
32
  this.worseLabel = 'worse';
24
33
  }
34
+ static { this.markRules = [SPOKEN_RULE]; }
25
35
  static { this.words = 'helix-trend'; }
26
36
  renderIcon(icon) {
27
37
  return html `<slot aria-hidden="true" name="icon"
@@ -59,6 +69,10 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
59
69
  }
60
70
  willUpdate(changed) {
61
71
  super.willUpdate(changed);
72
+ const was = changed.get('value');
73
+ if (changed.has('value') && this.hasUpdated && was !== undefined) {
74
+ this.count.start(was, this.value);
75
+ }
62
76
  const judged = this.judged;
63
77
  this.toggleState('better', judged === 'better');
64
78
  this.toggleState('worse', judged === 'worse');
@@ -85,9 +99,13 @@ let HelixHeadlessTrend = class HelixHeadlessTrend extends HelixElement {
85
99
  const figure = value === undefined || !Number.isFinite(value)
86
100
  ? ''
87
101
  : figureOf(value, wordsLocale(this), this.formatOptions);
102
+ const counting = this.count.counting;
103
+ const shown = counting === undefined
104
+ ? figure
105
+ : html `<span aria-hidden="true">${figureOf(counting, wordsLocale(this), this.formatOptions)}</span><span data-spoken>${figure}</span>`;
88
106
  return html `${glyph}
89
107
  <span part="direction">${said}</span>
90
- <span part="value" ?hidden=${figure === ''}>${figure}</span><slot></slot>
108
+ <span part="value" ?hidden=${figure === ''}>${shown}</span><slot></slot>
91
109
  <slot name="label"></slot>`;
92
110
  }
93
111
  };