@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
@@ -1,7 +1,7 @@
1
1
  var HelixHeadlessDataTable_1;
2
2
  import { __decorate } from "tslib";
3
- import { anchorAt, arranged, assignSlot, auditChildren, auditServed, commaList, countLabel, customElement, cycle, deepActiveElement, deepContains, everyState, format, formatWords, gridMove, HelixBeforeFilterEvent, HelixBeforeNavigateEvent, HelixBeforeReorderEvent, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixElement, HelixExpandEvent, HelixFilterEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixReorderEvent, HelixSelectEvent, HelixSortEvent, handedLocale, hostAria, inlineStep, inRowOrder, internalsOf, MIRROR_RULE, MixinCollection, markMatches, markRegion, numberConverter, onAndroid, ordered, pageRows, parse, placeKey, ReorderController, rangeAdd, reportRuntime, requestChange, requestReorder, SCROLLER_RULE, scrollingAncestor, scrollRoom, selectsAll, Typeahead, toggleEvery, treeArrow, typesCharacter, VIRTUAL_RULE, VirtualizeController, valueAt, whenHydrated, window_, words, wordsLocale, writtenList, } from '@fusion.dev/helix-core';
4
- import { caretDown, caretRight, dotsSixVertical } from '@fusion.dev/helix-icons';
3
+ import { anchorAt, arranged, assignSlot, auditChildren, auditServed, commaList, countLabel, customElement, cycle, deepActiveElement, deepContains, everyState, format, formatWords, gridMove, HelixBeforeFilterEvent, HelixBeforeNavigateEvent, HelixBeforeReorderEvent, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixElement, HelixExpandEvent, HelixFilterEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixReorderEvent, HelixSelectEvent, HelixSortEvent, handedLocale, hostAria, inlineStep, inRowOrder, internalsOf, LayoutMotionController, MixinCollection, markMatches, markRegion, numberConverter, onAndroid, ordered, pageRows, parse, placeKey, ReorderController, rangeAdd, reportRuntime, requestChange, requestReorder, SCROLLER_RULE, SHUT_RULE, scrollingAncestor, scrollRoom, selectsAll, Typeahead, toggleEvery, treeArrow, typesCharacter, VIRTUAL_RULE, VirtualizeController, valueAt, whenHydrated, window_, words, wordsLocale, writtenList, } from '@fusion.dev/helix-core';
4
+ import { caretDown, dotsSixVertical } from '@fusion.dev/helix-icons';
5
5
  import { nothing } from 'lit';
6
6
  import { property, state } from 'lit/decorators.js';
7
7
  import { live } from 'lit/directives/live.js';
@@ -145,7 +145,12 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
145
145
  },
146
146
  enabled: () => this.reorderable,
147
147
  grip: (event) => {
148
- const column = this.partIn(event, 'grip') ? this.columnFrom(event) : undefined;
148
+ const own = event
149
+ .composedPath()
150
+ .some((node) => node instanceof Element && /^(menu|resizer)/.test(node.getAttribute('part') ?? ''));
151
+ const column = this.partIn(event, 'grip') || (this.partIn(event, 'column') && !own)
152
+ ? this.columnFrom(event)
153
+ : undefined;
149
154
  return column?.field ? { element: column, key: column.field } : undefined;
150
155
  },
151
156
  holds: false,
@@ -183,6 +188,37 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
183
188
  },
184
189
  });
185
190
  this.warnedAboutKey = false;
191
+ this.motion = new LayoutMotionController(this, {
192
+ items: () => [...(this.renderRoot?.querySelectorAll('[part~="row"]') ?? [])],
193
+ scroller: () => this.renderRoot?.querySelector('[part="table"]'),
194
+ timing: () => {
195
+ const style = getComputedStyle(this);
196
+ return {
197
+ duration: style.getPropertyValue('--data-table-move-duration'),
198
+ easing: style.getPropertyValue('--data-table-move-easing'),
199
+ };
200
+ },
201
+ watch: 'updates',
202
+ });
203
+ this.columnMotion = new LayoutMotionController(this, {
204
+ boxes: (heading) => {
205
+ const at = this.shownColumns.indexOf(heading) + this.lead;
206
+ return [
207
+ heading,
208
+ ...(this.renderRoot?.querySelectorAll(`[part~="row"] > [data-column="${at}"]`) ?? []),
209
+ ];
210
+ },
211
+ items: () => this.shownColumns,
212
+ scroller: () => this.renderRoot?.querySelector('[part="table"]'),
213
+ timing: () => {
214
+ const style = getComputedStyle(this);
215
+ return {
216
+ duration: style.getPropertyValue('--data-table-move-duration'),
217
+ easing: style.getPropertyValue('--data-table-move-easing'),
218
+ };
219
+ },
220
+ watch: 'updates',
221
+ });
186
222
  this.virtualize = new VirtualizeController(this, {
187
223
  container: () => (this.windowed ? this.partNamed('table') : null),
188
224
  count: () => this.available,
@@ -539,7 +575,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
539
575
  };
540
576
  }
541
577
  static { HelixHeadlessDataTable_1 = this; }
542
- static { this.markRules = [SCROLLER_RULE, VIRTUAL_RULE, MIRROR_RULE]; }
578
+ static { this.markRules = [SCROLLER_RULE, VIRTUAL_RULE, SHUT_RULE]; }
543
579
  static { this.shadowRootOptions = {
544
580
  ...HelixElement.shadowRootOptions,
545
581
  slotAssignment: 'manual',
@@ -2126,12 +2162,11 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
2126
2162
  });
2127
2163
  }
2128
2164
  renderToggle(row, open) {
2129
- const glyph = open ? caretDown : caretRight;
2130
2165
  return html `<span
2131
2166
  part="toggle${open ? ' toggle-open' : ''}"
2132
2167
  aria-hidden="true"
2133
2168
  @click=${() => this.toggleOpen(row, !open)}
2134
- ><svg part="toggle-mark" ?data-mirror=${!open} fill="currentColor" viewBox=${glyph.viewBox}>${unsafeSVG(glyph.content)}</svg></span>`;
2169
+ ><svg part="toggle-mark" ?data-shut=${!open} fill="currentColor" viewBox=${caretDown.viewBox}>${unsafeSVG(caretDown.content)}</svg></span>`;
2135
2170
  }
2136
2171
  toggleOpen(row, open) {
2137
2172
  const next = toggledOpen(this.expanded, this.rowKeyOf(row, -1), open, this.everyKey);
@@ -2333,7 +2368,7 @@ let HelixHeadlessDataTable = class HelixHeadlessDataTable extends MixinCollectio
2333
2368
  ${this.paginated
2334
2369
  ? html `<${pagination}
2335
2370
  part="pagination"
2336
- exportparts="first: pagination-first, gap: pagination-gap, item: pagination-item,
2371
+ exportparts="first: pagination-first, gap: pagination-gap, indicator: pagination-indicator, item: pagination-item,
2337
2372
  last: pagination-last, list: pagination-list, live: pagination-live,
2338
2373
  mark: pagination-mark, next: pagination-next, page: pagination-page,
2339
2374
  page-current: pagination-page-current, previous: pagination-previous,
@@ -1,4 +1,4 @@
1
- import { AriaForwardController, type DateCalendar, HelixFormElement, type MonthCalendar, type MonthSystem } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, type DateCalendar, HelixFormElement, LayoutMotionController, type MonthCalendar, type MonthSystem } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../date-picker/index.js';
4
4
  import '../../tag/root/index.js';
@@ -151,6 +151,13 @@ export declare class HelixHeadlessDateInput extends HelixHeadlessDateInput_base
151
151
  * `registerWords('de', { 'helix-date-input': { triggerLabel: 'Datum auswählen' } })`.
152
152
  */
153
153
  static words: string;
154
+ /**
155
+ * Sliding the dates chosen to their new places as they come and go: one arriving
156
+ * fades in, one leaving fades where it was, and the rest close up. Timed by
157
+ * `--date-input-move-duration` and `--date-input-move-easing`, which this tier never
158
+ * sets, so it moves nothing until a stylesheet does.
159
+ */
160
+ protected readonly motion: LayoutMotionController;
154
161
  protected readonly aria: AriaForwardController;
155
162
  /**
156
163
  * 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, valueAsDate as asDate, barredBy, calendarLocale, customElement, drawIcon, formatWords, dateAsValue as fromDate, HelixClearEvent, HelixFormElement, handedLocale, isDateValue, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, MONTH_CALENDARS, monthSystem, numberConverter, readWrittenDate, words, wordsLocale, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, valueAsDate as asDate, barredBy, calendarLocale, customElement, drawIcon, formatWords, dateAsValue as fromDate, HelixClearEvent, HelixFormElement, handedLocale, isDateValue, LayoutMotionController, MixinControllerOpen, MixinControllerValue, MixinField, MixinPickerEditing, MixinPickerField, MixinSegmentedField, MixinTokens, MONTH_CALENDARS, monthSystem, numberConverter, readWrittenDate, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { calendarBlank, 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 '../../date-picker/index.js';
@@ -16,6 +17,22 @@ const dates = (value) => value
16
17
  let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmentedField(MixinPickerEditing(MixinPickerField(MixinControllerOpen(MixinTokens(MixinControllerValue(MixinField(HelixFormElement))))))) {
17
18
  constructor() {
18
19
  super(...arguments);
20
+ this.motion = new LayoutMotionController(this, {
21
+ arriveIntoEmpty: true,
22
+ items: () => [
23
+ ...(this.renderRoot?.querySelectorAll('[part~="date"]:not([data-leaving])') ??
24
+ []),
25
+ ],
26
+ leaving: () => this.partNamed('field'),
27
+ timing: () => {
28
+ const style = getComputedStyle(this);
29
+ return {
30
+ duration: style.getPropertyValue('--date-input-move-duration'),
31
+ easing: style.getPropertyValue('--date-input-move-easing'),
32
+ };
33
+ },
34
+ watch: 'updates',
35
+ });
19
36
  this.aria = new AriaForwardController(this, {
20
37
  target: () => this.partNamed('control') ?? this.segmentGroup,
21
38
  });
@@ -409,7 +426,7 @@ let HelixHeadlessDateInput = class HelixHeadlessDateInput extends MixinSegmented
409
426
  <div part="field" @keydown=${this.handleKeydown} @mousedown=${this.handleFieldPress}>
410
427
  <slot name="start"></slot>
411
428
  ${this.mode === 'multiple'
412
- ? this.renderTokenRow(this.shownDates.map((date) => this.renderTag(date)), this.restCount)
429
+ ? this.renderTokenRow(repeat(this.shownDates, (date) => date, (date) => this.renderTag(date)), this.restCount)
413
430
  : nothing}
414
431
  ${this.segmentsShown ? html `${this.renderSegments()}${this.renderAutofill()}` : this.renderControl()}
415
432
  <slot name="end"></slot>
@@ -335,6 +335,11 @@ export declare class HelixHeadlessDatePicker extends HelixHeadlessDatePicker_bas
335
335
  private preview;
336
336
  private readonly handleGridLeave;
337
337
  private isSelected;
338
+ /**
339
+ * When the first month on show begins, as a time, for a tier above that
340
+ * moves between two months: it changes only as the calendar pages.
341
+ */
342
+ protected get shownTime(): number;
338
343
  /** The month being shown, resolved from `month`, then `value`, then today. */
339
344
  private get shown();
340
345
  /**
@@ -186,6 +186,9 @@ let HelixHeadlessDatePicker = class HelixHeadlessDatePicker extends MixinPickerF
186
186
  }
187
187
  return this.selected.includes(iso);
188
188
  }
189
+ get shownTime() {
190
+ return this.shown.getTime();
191
+ }
189
192
  get shown() {
190
193
  const explicit = /^(\d{4})-(\d{2})(?:-(\d{2}))?$/.exec(this.monthState ?? this.defaultMonth);
191
194
  if (explicit) {
@@ -270,6 +270,7 @@ export interface EditorSink {
270
270
  * @csspart find-replace-toggle - The button that shows the replace field under the find field. Expanded while it shows. Not drawn while `readonly`.
271
271
  * @csspart find-replace-toggle-button - The find and replace button's inner button.
272
272
  * @csspart find-replace-toggle-live - The find and replace button's live region, which speaks while the button is pending.
273
+ * @csspart find-replace-toggle-mark - The caret on the find bar's replace toggle, which points down while the replace row shows and along the line while it is shut.
273
274
  * @csspart find-replace-toggle-spinner - The ring the find and replace button turns while it is pending.
274
275
  * @csspart find-replace-toggle-text - The box the find and replace button's icon sits in.
275
276
  * @csspart find-toggle - The Find button in the toolbar, drawn where `tools` names `find`, which opens and closes the find bar. Expanded while it is open.
@@ -774,7 +774,7 @@ let HelixHeadlessEditor = class HelixHeadlessEditor extends HelixElement {
774
774
  const find = this.tag('find');
775
775
  return html `<${find}
776
776
  part="find"
777
- 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: find-replace, replace-all: find-replace-all, 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-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: find-replace-toggle, 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, 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"
777
+ 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: find-replace, replace-all: find-replace-all, 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-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: find-replace-toggle, 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, 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"
778
778
  label=${this.findLabel}
779
779
  ?readonly=${this.readOnly}
780
780
  shortcut=""
@@ -202,6 +202,7 @@ registerElementEvents({
202
202
  'helix-reading-press',
203
203
  'helix-resize',
204
204
  ],
205
+ 'helix-headless-hover-card': ['helix-before-close', 'helix-before-open', 'toggle'],
205
206
  'helix-headless-icon': ['error', 'load'],
206
207
  'helix-headless-icon-button': ['helix-press'],
207
208
  'helix-headless-image': ['error', 'load'],
@@ -435,6 +436,7 @@ registerElementEvents({
435
436
  'helix-listen',
436
437
  'input',
437
438
  ],
439
+ 'helix-headless-theme-toggle': ['change'],
438
440
  'helix-headless-time-input': [
439
441
  'change',
440
442
  'helix-before-change',
@@ -1,4 +1,4 @@
1
- import { AriaForwardController, HelixFormElement } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, HelixFormElement, LayoutMotionController } from '@fusion.dev/helix-core';
2
2
  import { nothing, type PropertyValues, type TemplateResult } from 'lit';
3
3
  import { type FileStatus } from '../status.js';
4
4
  export type { FileStatus } from '../status.js';
@@ -100,6 +100,13 @@ export declare class HelixHeadlessFileInput extends HelixHeadlessFileInput_base
100
100
  * `registerWords('de', { 'helix-file-input': { triggerLabel: 'Dateien auswählen' } })`.
101
101
  */
102
102
  static words: string;
103
+ /**
104
+ * Sliding the files to their new places as they come and go: one arriving
105
+ * fades in, one leaving fades where it was, and the rest close up. Timed by
106
+ * `--file-input-move-duration` and `--file-input-move-easing`, which this tier never
107
+ * sets, so it moves nothing until a stylesheet does.
108
+ */
109
+ protected readonly motion: LayoutMotionController;
103
110
  protected readonly aria: AriaForwardController;
104
111
  /**
105
112
  * Which files the picker offers and a drop takes, as a native `accept` list.
@@ -1,8 +1,9 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, customElement, drawIcon, drawStatus, formatWords, HelixBeforeChangeEvent, HelixFormElement, internalsOf, labelWith, MixinField, numberConverter, requestChange, restoreValue, SlottedGlyph, StatusController, words, wordsLocale, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, customElement, drawIcon, drawStatus, formatWords, HelixBeforeChangeEvent, HelixFormElement, internalsOf, LayoutMotionController, labelWith, MixinField, numberConverter, requestChange, restoreValue, SlottedGlyph, StatusController, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { trash } 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 { html } from 'lit/static-html.js';
7
8
  import { HelixRejectEvent } from '../events/index.js';
8
9
  import { screenFiles } from '../screen.js';
@@ -33,6 +34,22 @@ const kind = (file) => {
33
34
  let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(HelixFormElement) {
34
35
  constructor() {
35
36
  super(...arguments);
37
+ this.motion = new LayoutMotionController(this, {
38
+ arriveIntoEmpty: true,
39
+ items: () => [
40
+ ...(this.renderRoot?.querySelectorAll('[part~="file"]:not([data-leaving])') ??
41
+ []),
42
+ ],
43
+ leaving: () => this.partNamed('list'),
44
+ timing: () => {
45
+ const style = getComputedStyle(this);
46
+ return {
47
+ duration: style.getPropertyValue('--file-input-move-duration'),
48
+ easing: style.getPropertyValue('--file-input-move-easing'),
49
+ };
50
+ },
51
+ watch: 'updates',
52
+ });
36
53
  this.aria = new AriaForwardController(this, {
37
54
  named: () => this.labeled,
38
55
  target: () => this.partNamed('control'),
@@ -332,7 +349,7 @@ let HelixHeadlessFileInput = class HelixHeadlessFileInput extends MixinField(Hel
332
349
  ${files.length === 0
333
350
  ? nothing
334
351
  : html `<ul part="list">
335
- ${files.map((file, at) => {
352
+ ${repeat(files, (file) => file, (file, at) => {
336
353
  const state = this.statuses.get(file)?.state;
337
354
  const done = state === 'done';
338
355
  const failed = state === 'error';
@@ -1,4 +1,4 @@
1
- import { AriaForwardController, HelixFormElement, PopoverController } from '@fusion.dev/helix-core';
1
+ import { AriaForwardController, HelixFormElement, LayoutMotionController, PopoverController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import { HelixHeadlessFilterField } from '../field/filter-field.js';
4
4
  import { type FilterSource } from '../suggest.js';
@@ -203,6 +203,13 @@ export declare class HelixHeadlessFilterInput extends HelixHeadlessFilterInput_b
203
203
  * `registerWords('de', { 'helix-filter-input': { clearLabel: 'Leeren' } })`.
204
204
  */
205
205
  static words: string;
206
+ /**
207
+ * Sliding the filters to their new places as they come and go: one arriving
208
+ * fades in, one leaving fades where it was, and the rest close up. Timed by
209
+ * `--filter-input-move-duration` and `--filter-input-move-easing`, which this tier never
210
+ * sets, so it moves nothing until a stylesheet does.
211
+ */
212
+ protected readonly motion: LayoutMotionController;
206
213
  protected readonly aria: AriaForwardController;
207
214
  /** Typed, so every keystroke is announced. See `announcesInput`. */
208
215
  protected readonly announcesInput = true;
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { AriaForwardController, auditChildren, countLabel, customElement, DelayController, drawIcon, drawStatus, formatWords, HelixFormElement, holdCaret, howToRegister, internalsOf, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, MixinVoice, PopoverController, reportRuntime, restoreValue, SPOKEN_RULE, StatusController, scrollItemIntoView, timeConverter, words, wordsLocale, } from '@fusion.dev/helix-core';
2
+ import { AriaForwardController, auditChildren, countLabel, customElement, DelayController, drawIcon, drawStatus, formatWords, HelixFormElement, holdCaret, howToRegister, internalsOf, LayoutMotionController, MixinControllerOpen, MixinControllerValue, MixinField, MixinTokens, MixinVoice, PopoverController, reportRuntime, restoreValue, SPOKEN_RULE, StatusController, scrollItemIntoView, timeConverter, words, wordsLocale, } from '@fusion.dev/helix-core';
3
3
  import { x } from '@fusion.dev/helix-icons';
4
4
  import { html, nothing } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
@@ -15,6 +15,18 @@ const isOption = (node) => 'active' in node && 'value' in node;
15
15
  let HelixHeadlessFilterInput = class HelixHeadlessFilterInput extends MixinVoice(MixinControllerOpen(MixinTokens(MixinControllerValue(MixinField(HelixFormElement))))) {
16
16
  constructor() {
17
17
  super(...arguments);
18
+ this.motion = new LayoutMotionController(this, {
19
+ arriveIntoEmpty: true,
20
+ items: () => (this.tokens?.assignedElements() ?? []).filter((one) => one instanceof HTMLElement),
21
+ leaving: () => this.partNamed('field'),
22
+ timing: () => {
23
+ const style = getComputedStyle(this);
24
+ return {
25
+ duration: style.getPropertyValue('--filter-input-move-duration'),
26
+ easing: style.getPropertyValue('--filter-input-move-easing'),
27
+ };
28
+ },
29
+ });
18
30
  this.aria = new AriaForwardController(this, {
19
31
  target: () => this.partNamed('control'),
20
32
  });
@@ -116,6 +116,7 @@ declare const HelixHeadlessFind_base: (new (...args: any[]) => import("@fusion.d
116
116
  * @csspart replace-toggle - The button that shows the replace row. Expanded while it shows.
117
117
  * @csspart replace-toggle-button - The replace toggle's inner button.
118
118
  * @csspart replace-toggle-live - The replace toggle's live region, which speaks while the button is pending.
119
+ * @csspart replace-toggle-mark - The caret on the replace toggle, which points down while the replace row shows and along the line while it is shut.
119
120
  * @csspart replace-toggle-spinner - The ring the replace toggle turns while it is pending.
120
121
  * @csspart replace-toggle-text - The box the replace toggle's icon sits in.
121
122
  * @csspart whole-word - The button that matches whole words only. Pressed while it does.
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
- import { customElement, deepActiveElement, deepContains, drawIcon, elementById, findPattern, formatWords, HelixElement, HelixFoundEvent, MIRROR_RULE, MixinControllerOpen, matchesChord, onApple, stopPress, textFinder, words, } from '@fusion.dev/helix-core';
3
- import { asterisk, caretDown, caretRight, caretUp, textAa, textAUnderline, x, } from '@fusion.dev/helix-icons';
2
+ import { customElement, deepActiveElement, deepContains, drawIcon, elementById, findPattern, formatWords, HelixElement, HelixFoundEvent, MixinControllerOpen, matchesChord, onApple, SHUT_RULE, stopPress, textFinder, words, } from '@fusion.dev/helix-core';
3
+ import { asterisk, caretDown, caretUp, textAa, textAUnderline, x } from '@fusion.dev/helix-icons';
4
4
  import { nothing } from 'lit';
5
5
  import { property, state } from 'lit/decorators.js';
6
6
  import { keyed } from 'lit/directives/keyed.js';
@@ -92,7 +92,7 @@ let HelixHeadlessFind = class HelixHeadlessFind extends MixinControllerOpen(Heli
92
92
  }
93
93
  };
94
94
  }
95
- static { this.markRules = [MIRROR_RULE]; }
95
+ static { this.markRules = [SHUT_RULE]; }
96
96
  static { this.words = 'helix-find'; }
97
97
  attach(finder) {
98
98
  this.endSearch();
@@ -342,7 +342,7 @@ let HelixHeadlessFind = class HelixHeadlessFind extends MixinControllerOpen(Heli
342
342
  }}
343
343
  @helix-press=${stopPress}
344
344
  >
345
- ${this.replacing ? drawIcon(caretDown) : html `<span data-mirror>${drawIcon(caretRight)}</span>`}
345
+ <span part="replace-toggle-mark" ?data-shut=${!this.replacing}>${drawIcon(caretDown)}</span>
346
346
  </${button}>`;
347
347
  }
348
348
  renderOptionButtons() {
@@ -0,0 +1 @@
1
+ export { HelixHeadlessHoverCard } from './root/hover-card-root.js';
@@ -0,0 +1 @@
1
+ export { HelixHeadlessHoverCard } from './root/hover-card-root.js';
@@ -0,0 +1,122 @@
1
+ import { HelixElement, OpenPhaseController, type Placement } from '@fusion.dev/helix-core';
2
+ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
3
+ declare const HelixHeadlessHoverCard_base: (new (...args: any[]) => import("@fusion.dev/helix-core").MixinControllerOpenInterface) & typeof HelixElement;
4
+ /**
5
+ * @summary A card that opens beside a link while the pointer rests on it or focus is on it, such as a preview of a person or a page.
6
+ *
7
+ * @description
8
+ * Name the link it opens from with `for`, and put the card's content inside:
9
+ *
10
+ * ```html
11
+ * <a href="/people/ada" id="ada">Ada Lovelace</a>
12
+ * <helix-headless-hover-card for="ada">
13
+ * <p>Ada Lovelace, analyst. <a href="/people/ada/notes">Read her notes</a></p>
14
+ * </helix-headless-hover-card>
15
+ * ```
16
+ *
17
+ * The card opens once the pointer has rested on the link for `delay`, and at
18
+ * once on keyboard focus. It stays open while the pointer is over the link or
19
+ * the card, or focus is in either, and closes `delay-out` after both are left.
20
+ * It closes on Escape and on a press elsewhere.
21
+ *
22
+ * **It adds to the link and never stands in for it.** The link still goes
23
+ * where it goes when pressed, and a touch screen, which has no hover, follows
24
+ * the link without opening the card. So put nothing in the card that a
25
+ * reader can only reach there.
26
+ *
27
+ * **Opening moves no focus.** A reader who tabbed to the link stays on it,
28
+ * and the next Tab goes into the card, whose content follows the link in the
29
+ * page's order: place the element right after the link. The card is no
30
+ * description of the link and names nothing on it, so a screen reader reads
31
+ * the link as it is and the card as content when it is reached.
32
+ *
33
+ * The card is in the top layer through the popover API, so an ancestor with
34
+ * `overflow: hidden` does not clip it and no `z-index` is needed, and it moves
35
+ * to another side where the one asked for does not fit.
36
+ *
37
+ * @since 0.241.0
38
+ * @status experimental
39
+ * @category overlays
40
+ * @aliases Preview card, Link preview, Profile card, Hover preview
41
+ * @documentation https://fusion.dev/helix/components/hover-card
42
+ *
43
+ * @slot - The card's content, which may hold links and buttons.
44
+ *
45
+ * @event {HelixBeforeCloseEvent} helix-before-close - The card is about to close. Cancelable: cancel it to keep it open.
46
+ * @event {HelixBeforeOpenEvent} helix-before-open - The card is about to open. Cancelable: cancel it to keep it closed.
47
+ * @event {ToggleEvent} toggle - The card opened or closed. The event carries `newState` and `oldState`.
48
+ *
49
+ * @csspart surface - The card.
50
+ * @csspart surface-bottom - Added to `surface` while the card is below the link.
51
+ * @csspart surface-left - Added to `surface` while the card is left of the link.
52
+ * @csspart surface-right - Added to `surface` while the card is right of the link.
53
+ * @csspart surface-top - Added to `surface` while the card is above the link.
54
+ *
55
+ * @cssstate entering - From the moment the card opens until its entrance has finished.
56
+ * @cssstate exiting - From the moment the card closes until its exit has finished.
57
+ * @cssstate open - While the card is open.
58
+ * @cssstate placed-bottom - While the card sits below the link.
59
+ * @cssstate placed-left - While the card sits to the left of the link.
60
+ * @cssstate placed-right - While the card sits to the right of the link.
61
+ * @cssstate placed-top - While the card sits above the link.
62
+ */
63
+ export declare class HelixHeadlessHoverCard extends HelixHeadlessHoverCard_base {
64
+ static styles: CSSResultGroup;
65
+ /** How long the pointer rests on the link before the card opens, in milliseconds. */
66
+ delay: number;
67
+ /** How long the card stays once the pointer and focus have left the link and the card, in milliseconds. */
68
+ delayOut: number;
69
+ /**
70
+ * The `id` of the link the card opens from, looked up in the card's own
71
+ * root.
72
+ */
73
+ for: string;
74
+ /** The gap between the link and the card, in pixels. */
75
+ offset: number;
76
+ /** The side to open the card on. It moves if that side does not fit. */
77
+ placement: Placement;
78
+ /** The side the card landed on, for the parts a sheet draws by side. */
79
+ private side;
80
+ /** What is keeping the card open: a pointer over the link or the card, or focus in either. */
81
+ private readonly holds;
82
+ /** The open or close waiting on a delay. */
83
+ private timer;
84
+ /** The link the listeners are on, held so they come off the same element. */
85
+ private bound;
86
+ /** The element `for` names, or nothing. */
87
+ private get trigger();
88
+ private readonly layer;
89
+ protected readonly phases: OpenPhaseController;
90
+ /** Opens the card, and cancels a waiting close. */
91
+ show(): void;
92
+ /** Closes the card, and cancels a waiting open. */
93
+ hide(): void;
94
+ /** A pointer on the link or the card: hold it open, and open it after `delay` where it is closed. */
95
+ private readonly enter;
96
+ /** A pointer leaving the link or the card. */
97
+ private readonly leave;
98
+ /**
99
+ * Focus on the link or in the card. **Keyboard focus on the link opens it at
100
+ * once**, as a reader who tabbed there has chosen it, and a mouse press,
101
+ * which focuses without `:focus-visible`, does not.
102
+ */
103
+ private readonly focusIn;
104
+ /** Focus leaving, to somewhere outside both the link and the card. */
105
+ private readonly focusOut;
106
+ /** Closes after `delay-out` once nothing holds the card open, so crossing the gap does not close it. */
107
+ private release;
108
+ /** Puts the listeners on the link `for` names. Client only, after the first render. */
109
+ private bind;
110
+ private unbind;
111
+ connectedCallback(): void;
112
+ disconnectedCallback(): void;
113
+ protected firstUpdated(changed: PropertyValues): void;
114
+ protected updated(changed: PropertyValues): void;
115
+ protected render(): TemplateResult;
116
+ }
117
+ declare global {
118
+ interface HTMLElementTagNameMap {
119
+ 'helix-headless-hover-card': HelixHeadlessHoverCard;
120
+ }
121
+ }
122
+ export {};