@fusion.dev/helix-headless 0.174.0 → 0.176.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 (44) hide show
  1. package/custom-elements.json +198 -59
  2. package/dist/app-header/root/app-header-root.d.ts +2 -1
  3. package/dist/app-header/root/app-header-root.js +6 -1
  4. package/dist/button/root/button-root.d.ts +6 -1
  5. package/dist/button/root/button-root.js +1 -0
  6. package/dist/command/root/command-root.d.ts +4 -2
  7. package/dist/command/root/command-root.js +1 -0
  8. package/dist/date-picker/root/date-picker-root.d.ts +6 -0
  9. package/dist/date-picker/root/date-picker-root.js +7 -1
  10. package/dist/dialog/form-method.d.ts +12 -0
  11. package/dist/dialog/form-method.js +13 -0
  12. package/dist/dialog/root/dialog-root.d.ts +1 -9
  13. package/dist/dialog/root/dialog-root.js +2 -11
  14. package/dist/drawer/root/drawer-root.d.ts +2 -0
  15. package/dist/drawer/root/drawer-root.js +6 -0
  16. package/dist/filter-input/index.d.ts +0 -1
  17. package/dist/filter-input/index.js +0 -1
  18. package/dist/filter-input/menu/filter-menu.d.ts +4 -0
  19. package/dist/filter-input/menu/index.d.ts +1 -0
  20. package/dist/filter-input/menu/index.js +1 -0
  21. package/dist/filter-input/root/filter-input-root.d.ts +26 -2
  22. package/dist/filter-input/root/filter-input-root.js +39 -5
  23. package/dist/icon/all/index.d.ts +1 -0
  24. package/dist/icon/all/index.js +4 -0
  25. package/dist/icon/root/icon-root.d.ts +9 -8
  26. package/dist/icon/root/icon-root.js +4 -2
  27. package/dist/icon/set.js +16 -2
  28. package/dist/index.d.ts +2 -1
  29. package/dist/index.js +2 -1
  30. package/dist/lightbox/item/lightbox-item.d.ts +1 -0
  31. package/dist/lightbox/root/lightbox-root.d.ts +25 -5
  32. package/dist/lightbox/root/lightbox-root.js +33 -10
  33. package/dist/notifications/group/notification-group.js +2 -2
  34. package/dist/notifications/notification/notification.js +4 -5
  35. package/dist/notifications/root/notifications-root.d.ts +4 -3
  36. package/dist/notifications/root/notifications-root.js +1 -1
  37. package/dist/pagination/root/pagination-root.d.ts +2 -1
  38. package/dist/pagination/root/pagination-root.js +6 -1
  39. package/dist/tooltip/root/tooltip-root.d.ts +5 -2
  40. package/dist/tooltip/root/tooltip-root.js +11 -11
  41. package/lint.json +1 -1
  42. package/package.json +5 -5
  43. package/types/jsx.d.ts +102 -72
  44. package/types/vue.d.ts +13 -14
@@ -41,7 +41,7 @@ let HelixHeadlessNotificationGroup = class HelixHeadlessNotificationGroup extend
41
41
  }
42
42
  willUpdate(changed) {
43
43
  super.willUpdate(changed);
44
- hostAria(this.internals, { role: 'listitem' });
44
+ hostAria(this.internals, { label: this.label, role: 'article' });
45
45
  }
46
46
  firstUpdated(changed) {
47
47
  super.firstUpdated(changed);
@@ -92,7 +92,7 @@ let HelixHeadlessNotificationGroup = class HelixHeadlessNotificationGroup extend
92
92
  ${count}`}
93
93
  <span part="actions"><slot name="actions"></slot></span>
94
94
  </div>
95
- <div id=${ITEMS_ID} part="items" role="list" aria-labelledby=${LABEL_ID}>
95
+ <div id=${ITEMS_ID} part="items" role="feed" aria-labelledby=${LABEL_ID}>
96
96
  <slot></slot>
97
97
  </div>`;
98
98
  }
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, deepActiveElement, deepContains, focusableElements, HelixElement, HelixReadEvent, hostAria, MixinDismissible, requestChange, slotFilled, words, } from '@fusion.dev/helix-core';
7
+ import { customElement, deepActiveElement, deepContains, focusableElements, HelixElement, HelixReadEvent, MixinDismissible, requestChange, slotFilled, words, } from '@fusion.dev/helix-core';
8
8
  import { x } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
@@ -61,9 +61,6 @@ let HelixHeadlessNotification = class HelixHeadlessNotification extends MixinDis
61
61
  }
62
62
  willUpdate(changed) {
63
63
  super.willUpdate(changed);
64
- hostAria(this.internals, { role: 'listitem' });
65
- this.internals.ariaPosInSet = this.position > 0 ? String(this.position) : null;
66
- this.internals.ariaSetSize = this.setSize === 0 ? null : String(this.setSize);
67
64
  this.toggleState('read', this.read);
68
65
  }
69
66
  updated(changed) {
@@ -116,8 +113,10 @@ let HelixHeadlessNotification = class HelixHeadlessNotification extends MixinDis
116
113
  render() {
117
114
  return html `<div
118
115
  part="item"
119
- role="group"
116
+ role="article"
120
117
  aria-labelledby="label"
118
+ aria-posinset=${this.position > 0 ? String(this.position) : nothing}
119
+ aria-setsize=${this.setSize === 0 ? nothing : String(this.setSize)}
121
120
  tabindex=${this.stop ? 0 : -1}
122
121
  >
123
122
  <span part="media"><slot name="media"></slot></span>
@@ -21,8 +21,9 @@ declare const HelixHeadlessNotifications_base: (new (...args: any[]) => import("
21
21
  * the items and written to an attribute, so a stylesheet and a badge can both
22
22
  * use it without counting.
23
23
  *
24
- * **The feed is one `Tab` stop for its rows.** Each row takes focus itself and
25
- * is read by its label. `ArrowDown` and `ArrowUp` move to the next and the
24
+ * **The feed is one `Tab` stop for its rows.** It is an APG feed: the list is
25
+ * a `feed`, busy while `loading` is set, and each row is an `article` that
26
+ * takes focus itself and is read by its label. `ArrowDown` and `ArrowUp` move to the next and the
26
27
  * previous row, `Home` and `End` to the first and the last, and `PageDown` and
27
28
  * `PageUp` move a row on or back from anywhere inside one, as in the APG feed
28
29
  * pattern. The controls inside a row stay in the `Tab` order. Set `total` when
@@ -77,7 +78,7 @@ declare const HelixHeadlessNotifications_base: (new (...args: any[]) => import("
77
78
  * @csspart error - Shown while `load-error` is set, under any rows there are, in place of the empty and loading lines.
78
79
  * @csspart footer - The region below the list.
79
80
  * @csspart header - The region above the list.
80
- * @csspart list - The list itself.
81
+ * @csspart list - The list itself, a `feed` whose rows are its articles.
81
82
  * @csspart live - A copy of the empty, loading and error messages, in a live region that screen readers announce when they change. Visually hidden in the styled tier.
82
83
  * @csspart loading - Shown while the feed is loading.
83
84
  * @csspart mark-all - The control that marks everything read.
@@ -291,7 +291,7 @@ let HelixHeadlessNotifications = class HelixHeadlessNotifications extends MixinC
291
291
  </div>
292
292
  <div
293
293
  part="list"
294
- role="list"
294
+ role="feed"
295
295
  aria-busy=${this.loading ? 'true' : nothing}
296
296
  aria-label=${this.label || nothing}
297
297
  >
@@ -1,5 +1,5 @@
1
1
  import { HelixElement } from '@fusion.dev/helix-core';
2
- import { type PropertyValues, type TemplateResult } from 'lit';
2
+ import { type CSSResultGroup, type PropertyValues, type TemplateResult } from 'lit';
3
3
  /**
4
4
  * @summary Controls for moving between the pages of a long set of results.
5
5
  *
@@ -63,6 +63,7 @@ export declare class HelixHeadlessPagination extends HelixElement {
63
63
  * `registerWords('de', { 'helix-pagination': { nextLabel: 'Nächste Seite' } })`.
64
64
  */
65
65
  static words: string;
66
+ static styles: CSSResultGroup;
66
67
  /**
67
68
  * How many pages to show at each end, whatever the current one is.
68
69
  */
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { customElement, deepActiveElement, fillTemplate, formatNumbers, formatWords, HelixActivateEvent, HelixElement, HelixNavigateEvent, hostAria, requestChange, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { caretDoubleLeft, caretDoubleRight, caretLeft, caretRight, } from '@fusion.dev/helix-icons';
9
- import { html, nothing } from 'lit';
9
+ import { css, html, nothing, } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
11
11
  import { repeat } from 'lit/directives/repeat.js';
12
12
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
@@ -48,6 +48,11 @@ let HelixHeadlessPagination = class HelixHeadlessPagination extends HelixElement
48
48
  };
49
49
  }
50
50
  static { this.words = 'helix-pagination'; }
51
+ static { this.styles = css `
52
+ [part='list'] {
53
+ list-style: none;
54
+ }
55
+ `; }
51
56
  get page() {
52
57
  const asked = this.pageState ?? this.defaultPage;
53
58
  return Math.min(this.count, Math.max(1, Math.floor(asked) || 1));
@@ -28,8 +28,11 @@ declare const HelixHeadlessTooltip_base: (new (...args: any[]) => import("@fusio
28
28
  * markup is described when you first point at it or focus it, so a screen
29
29
  * reader in reading mode meets it with no description until then. Where the
30
30
  * browser has no element references, nothing links the two, and the tooltip
31
- * warns once on first open. The tooltip can also wrap its trigger, which
32
- * describes a Helix component and leaves a plain element undescribed. In the
31
+ * warns once on first open. The tooltip can also wrap its trigger. A Helix
32
+ * component inside is described at once, and a plain element as in the `for`
33
+ * form: when you first point at it or focus it, or at rest where it names the
34
+ * tooltip's `id` in its own `aria-describedby`, which a reference to the
35
+ * element around it allows. In the
33
36
  * `for` form the tooltip itself is out of the accessibility tree while its
34
37
  * bubble is down, so you meet its words once, as the trigger's description.
35
38
  * A trigger whose name is already the tooltip's words, such as an icon button
@@ -251,21 +251,27 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
251
251
  if (this.linked) {
252
252
  return;
253
253
  }
254
+ const trigger = this.for === '' ? this.trigger : this.named;
255
+ const names = `${trigger?.getAttribute('aria-describedby') ?? ''} ${trigger?.getAttribute('aria-labelledby') ?? ''}`
256
+ .split(/\s+/)
257
+ .filter(Boolean);
258
+ if (this.id !== '' && names.includes(this.id)) {
259
+ return;
260
+ }
254
261
  if (this.for === '') {
255
262
  if (this.triggerSays(this.describedText)) {
256
263
  return;
257
264
  }
258
265
  reportRuntime({
259
266
  kind: 'wrapped-trigger',
260
- message: `<${this.localName}> is wrapping its trigger rather than naming one, so its text ` +
261
- "reaches no screen reader: a description in this element's shadow root cannot be " +
262
- 'referenced from a trigger in the light DOM. Give this tooltip an `id`, set `for` to ' +
263
- 'the trigger\'s id, and add `aria-describedby="<that id>"` to the trigger.',
267
+ message: `<${this.localName}> opened before its trigger was described, so a screen reader ` +
268
+ 'reading the page meets the trigger without its text. Give this tooltip an `id` and ' +
269
+ 'add `aria-describedby="<that id>"` to the trigger inside it. Written in your own ' +
270
+ 'markup it describes the trigger at rest and survives server rendering.',
264
271
  tag: this.localName,
265
272
  });
266
273
  return;
267
274
  }
268
- const trigger = this.named;
269
275
  if (!trigger) {
270
276
  reportRuntime({
271
277
  kind: 'missing-trigger',
@@ -276,12 +282,6 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
276
282
  });
277
283
  return;
278
284
  }
279
- const names = `${trigger.getAttribute('aria-describedby') ?? ''} ${trigger.getAttribute('aria-labelledby') ?? ''}`
280
- .split(/\s+/)
281
- .filter(Boolean);
282
- if (this.id !== '' && names.includes(this.id)) {
283
- return;
284
- }
285
285
  reportRuntime({
286
286
  kind: 'unlinked-trigger',
287
287
  message: `<${this.localName} for="${this.for}"> is not read out with its trigger. The link is ` +