@fusion.dev/helix-headless 0.179.0 → 0.180.1

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 (48) hide show
  1. package/custom-elements.json +212 -50
  2. package/dist/chat/composer/chat-composer.d.ts +2 -1
  3. package/dist/chat/composer/chat-composer.js +1 -1
  4. package/dist/checkbox/root/checkbox-root.d.ts +6 -0
  5. package/dist/checkbox/root/checkbox-root.js +5 -0
  6. package/dist/combobox/root/combobox-root.d.ts +12 -0
  7. package/dist/combobox/root/combobox-root.js +3 -2
  8. package/dist/command/root/command-root.d.ts +12 -0
  9. package/dist/command/root/command-root.js +3 -2
  10. package/dist/data-table/root/data-table-root.d.ts +13 -1
  11. package/dist/data-table/root/data-table-root.js +18 -15
  12. package/dist/date-input/root/date-input-root.d.ts +7 -0
  13. package/dist/date-input/root/date-input-root.js +12 -0
  14. package/dist/date-picker/root/date-picker-root.d.ts +7 -1
  15. package/dist/date-picker/root/date-picker-root.js +12 -0
  16. package/dist/drilldown/root/drilldown-root.js +9 -0
  17. package/dist/filter-input/root/filter-input-root.d.ts +13 -0
  18. package/dist/filter-input/root/filter-input-root.js +2 -1
  19. package/dist/listbox/root/listbox-root.d.ts +16 -2
  20. package/dist/listbox/root/listbox-root.js +8 -4
  21. package/dist/meter/root/meter-root.js +1 -2
  22. package/dist/notifications/notification/notification.js +14 -1
  23. package/dist/option/among.d.ts +23 -0
  24. package/dist/option/among.js +2 -0
  25. package/dist/option/root/option-root.d.ts +1 -17
  26. package/dist/option/root/option-root.js +1 -4
  27. package/dist/radio/root/radio-root.d.ts +6 -0
  28. package/dist/radio/root/radio-root.js +5 -0
  29. package/dist/scatter-chart/root/scatter-chart-root.d.ts +5 -4
  30. package/dist/scatter-chart/root/scatter-chart-root.js +1 -0
  31. package/dist/select/root/select-root.d.ts +13 -2
  32. package/dist/select/root/select-root.js +3 -3
  33. package/dist/switch/root/switch-root.d.ts +6 -0
  34. package/dist/switch/root/switch-root.js +5 -0
  35. package/dist/table/column/table-column.d.ts +1 -10
  36. package/dist/table/column/table-column.js +1 -2
  37. package/dist/table/edge.d.ts +10 -0
  38. package/dist/table/edge.js +2 -0
  39. package/dist/tabs/root/tabs-root.d.ts +1 -0
  40. package/dist/tabs/root/tabs-root.js +13 -0
  41. package/dist/toggle/root/toggle-root.d.ts +6 -0
  42. package/dist/toggle/root/toggle-root.js +5 -0
  43. package/dist/tooltip/root/tooltip-root.js +1 -0
  44. package/lint.json +1 -1
  45. package/package.json +5 -5
  46. package/types/jsx.d.ts +234 -16
  47. package/types/vue.d.ts +25 -11
  48. package/types/words.d.ts +14 -0
@@ -62,9 +62,10 @@ declare const HelixHeadlessScatterChart_base: typeof HelixElement & (new (...arg
62
62
  *
63
63
  * The plot runs left to right in every text direction, as a number line does.
64
64
  * The plot, its axes, and the axis names sit in a `plane` part with
65
- * `dir="ltr"`. The axis names carry `dir="auto"`, so a name in Arabic or Hebrew
66
- * reads in its own direction. The summary and the tooltip bubble follow the
67
- * page's direction.
65
+ * `dir="ltr"`, and the arrow keys follow the drawing: Right moves to the next
66
+ * point on a right-to-left page too. The axis names carry `dir="auto"`, so a
67
+ * name in Arabic or Hebrew reads in its own direction. The summary and the
68
+ * tooltip bubble follow the page's direction.
68
69
  *
69
70
  * **A tap shows the reading under it**, and keeps it until a tap lands
70
71
  * elsewhere. `helix-reading-change` says each move of the reading, by pointer,
@@ -86,7 +87,7 @@ declare const HelixHeadlessScatterChart_base: typeof HelixElement & (new (...arg
86
87
  * | Key | What it does |
87
88
  * |---|---|
88
89
  * | Tab | Moves focus to the plot and shows the first reading. |
89
- * | Right, Left | Moves to the next or the previous point, left to right across the plot. On a right-to-left page, Left moves to the next. |
90
+ * | Right, Left | Moves to the next or the previous point, left to right across the plot, on a right-to-left page too. |
90
91
  * | Down, Up | Moves among the series of the point. With one series, moves to the next or the previous point. |
91
92
  * | Home, End | Moves to the first or the last point. |
92
93
  * | Page Down, Page Up | Moves a tenth of the points on or back. |
@@ -76,6 +76,7 @@ let HelixHeadlessScatterChart = class HelixHeadlessScatterChart extends MixinCha
76
76
  connectedCallback() {
77
77
  super.connectedCallback();
78
78
  this.pointer.axis = 'none';
79
+ this.pointer.drawnLtr = true;
79
80
  this.pointer.onReading = (heard, detail) => this.dispatchEvent(heard === 'press'
80
81
  ? new HelixReadingPressEvent(detail)
81
82
  : new HelixReadingChangeEvent(detail));
@@ -1,8 +1,7 @@
1
1
  import { AriaForwardController, type DataOptionItem, HelixFormElement, PopoverController, UpgradeController } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
- import { type HelixHeadlessOption } from '../../option/root/option-root.js';
3
+ import type { HelixHeadlessOption } from '../../option/root/option-root.js';
4
4
  import '../../listbox/index.js';
5
- import '../../option/index.js';
6
5
  declare const HelixHeadlessSelect_base: (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;
7
6
  /**
8
7
  * @summary A control that opens a list of options to choose from.
@@ -60,6 +59,18 @@ declare const HelixHeadlessSelect_base: (new (...args: any[]) => import("@fusion
60
59
  * Set `autocomplete` to let a browser's autofill choose, as a native `<select>`
61
60
  * with the same attribute would.
62
61
  *
62
+ * **The options are an import of their own.** An option is the Option family's,
63
+ * which the select does not register, so a page that writes one imports it
64
+ * beside the select:
65
+ *
66
+ * ```js
67
+ * import '@fusion.dev/helix/select'
68
+ * import '@fusion.dev/helix/option'
69
+ * ```
70
+ *
71
+ * In development, a select holding an option nobody registered says so once the
72
+ * page has loaded, with the line to add.
73
+ *
63
74
  * @since 0.1.0
64
75
  * @status stable
65
76
  * @category forms
@@ -4,15 +4,14 @@ 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 { AriaForwardController, afterLinkFollowed, chosenValues, customElement, dataOptions, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, inlineStep, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, sideOf, typesCharacter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
7
+ import { AriaForwardController, afterLinkFollowed, auditChildren, chosenValues, customElement, dataOptions, drawAutofill, drawStatus, HelixFormElement, hostAria, hostWords, inlineStep, isRtl, MixinControllerOpen, MixinControllerValue, MixinField, onApple, PopoverController, reportValues, StatusController, sideOf, typesCharacter, UpgradeController, words, wordsLocale, } from '@fusion.dev/helix-core';
8
8
  import { caretDown } from '@fusion.dev/helix-icons';
9
9
  import { nothing } from 'lit';
10
10
  import { property } from 'lit/decorators.js';
11
11
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
12
12
  import { html } from 'lit/static-html.js';
13
- import { optionsAmong } from '../../option/root/option-root.js';
13
+ import { optionsAmong } from '../../option/among.js';
14
14
  import '../../listbox/index.js';
15
- import '../../option/index.js';
16
15
  import { over } from '../align.js';
17
16
  let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(MixinControllerValue(MixinField(HelixFormElement))) {
18
17
  constructor() {
@@ -210,6 +209,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
210
209
  }
211
210
  connectedCallback() {
212
211
  super.connectedCallback();
212
+ auditChildren(this, 'option', 'option', 'it offers no choices');
213
213
  this.addEventListener('helix-select', this.handleLinkFollowed);
214
214
  const words = new MutationObserver(() => this.requestUpdate());
215
215
  words.observe(this, {
@@ -101,6 +101,12 @@ export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
101
101
  * loads only this tier, which is the cost the `track` part notes.
102
102
  */
103
103
  protected renderThumb(): TemplateResult | typeof nothing;
104
+ /**
105
+ * Turns the switch on or off, as `click()` does a native checkbox: passed to the control
106
+ * inside, so the one click a listener hears is the control's, after it has
107
+ * moved. See `HostClickController`.
108
+ */
109
+ click(): void;
104
110
  protected render(): TemplateResult;
105
111
  }
106
112
  declare global {
@@ -48,6 +48,11 @@ let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerCheck
48
48
  renderThumb() {
49
49
  return nothing;
50
50
  }
51
+ click() {
52
+ if (!this.clicks.click()) {
53
+ super.click();
54
+ }
55
+ }
51
56
  render() {
52
57
  return html `<label part="field">
53
58
  <span part="track">
@@ -10,16 +10,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
10
10
  * `undefined` falls back to the field.
11
11
  */
12
12
  export type CellReader = (row: Readonly<Record<string, unknown>>) => unknown;
13
- /**
14
- * The edge a column names, where it names one of the three.
15
- *
16
- * **`text-align` is a string anybody can write**, the union on the property being a
17
- * compile-time claim and nothing else, and both tables put the value straight
18
- * into CSS: `Table` into a rule in each row's shadow root, `DataTable` into the
19
- * cell it draws. One guard, here with the property, rather than one in each
20
- * table and only one of them written.
21
- */
22
- export declare const edgeOf: (align: string | undefined) => string | undefined;
13
+ export { edgeOf } from '../edge.js';
23
14
  /**
24
15
  * @summary One column of a table: its heading, its width, and the field it reads from each row.
25
16
  *
@@ -10,8 +10,7 @@ import { dotsSixVertical } from '@fusion.dev/helix-icons';
10
10
  import { html, nothing } from 'lit';
11
11
  import { property, state } from 'lit/decorators.js';
12
12
  import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
13
- const EDGES = new Set(['center', 'end', 'start']);
14
- export const edgeOf = (align) => align && EDGES.has(align) ? align : undefined;
13
+ export { edgeOf } from '../edge.js';
15
14
  let HelixHeadlessTableColumn = class HelixHeadlessTableColumn extends HelixElement {
16
15
  constructor() {
17
16
  super(...arguments);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The edge a column names, where it names one of the three.
3
+ *
4
+ * **`text-align` is a string anybody can write**, the union on the property being a
5
+ * compile-time claim and nothing else, and both tables put the value straight
6
+ * into CSS: `Table` into a rule in each row's shadow root, `DataTable` into the
7
+ * cell it draws. One guard, here with the property, rather than one in each
8
+ * table and only one of them written.
9
+ */
10
+ export declare const edgeOf: (align: string | undefined) => string | undefined;
@@ -0,0 +1,2 @@
1
+ const EDGES = new Set(['center', 'end', 'start']);
2
+ export const edgeOf = (align) => align && EDGES.has(align) ? align : undefined;
@@ -192,6 +192,7 @@ export declare class HelixHeadlessTabs extends HelixHeadlessTabs_base {
192
192
  private refocus;
193
193
  connectedCallback(): void;
194
194
  disconnectedCallback(): void;
195
+ protected willUpdate(changed: PropertyValues): void;
195
196
  protected firstUpdated(changed: PropertyValues): void;
196
197
  /** Watches the strip's size while `scroll-controls` asks, and reads it. */
197
198
  private watchStrip;
@@ -68,6 +68,9 @@ let HelixHeadlessTabs = class HelixHeadlessTabs extends MixinControllerActive(He
68
68
  };
69
69
  this.handleSlotChange = () => {
70
70
  this.sync();
71
+ if (this.active === '') {
72
+ this.requestUpdate();
73
+ }
71
74
  this.indicator.place();
72
75
  this.refocus();
73
76
  this.measure();
@@ -161,6 +164,16 @@ let HelixHeadlessTabs = class HelixHeadlessTabs extends MixinControllerActive(He
161
164
  this.resizing?.disconnect();
162
165
  this.resizing = undefined;
163
166
  }
167
+ willUpdate(changed) {
168
+ super.willUpdate(changed);
169
+ if (this.active === '' && this.childrenKnown) {
170
+ const tabs = this.tabs;
171
+ const shown = tabs.find((tab) => tab.selected) ?? this.resolveActive(tabs);
172
+ if (shown) {
173
+ this.active = shown.value;
174
+ }
175
+ }
176
+ }
164
177
  firstUpdated(changed) {
165
178
  super.firstUpdated(changed);
166
179
  this.sync();
@@ -110,6 +110,12 @@ export declare class HelixHeadlessToggle extends HelixHeadlessToggle_base {
110
110
  * re-renders nothing.
111
111
  */
112
112
  protected firstUpdated(changed: PropertyValues): void;
113
+ /**
114
+ * Presses the toggle, as `click()` does a native button: passed to the control
115
+ * inside, so the one click a listener hears is the control's, after it has
116
+ * moved. See `HostClickController`.
117
+ */
118
+ click(): void;
113
119
  protected render(): TemplateResult;
114
120
  }
115
121
  declare global {
@@ -41,6 +41,11 @@ let HelixHeadlessToggle = class HelixHeadlessToggle extends MixinSelectableItem(
41
41
  this.finishHydration();
42
42
  auditName(this, () => this.partNamed('item'), 'Give it words in its default slot, an `aria-label`, or a label on the icon it holds.');
43
43
  }
44
+ click() {
45
+ if (!this.clicks.click()) {
46
+ super.click();
47
+ }
48
+ }
44
49
  render() {
45
50
  const alone = this.alone;
46
51
  const radio = !alone && this.pressed === undefined;
@@ -353,6 +353,7 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
353
353
  hostAria(this.internals, {
354
354
  describedBy: this.hasContent ? [bubble] : [],
355
355
  label: this.describedText,
356
+ role: 'none',
356
357
  });
357
358
  this.internals.ariaHidden = this.for !== '' && !this.open ? 'true' : null;
358
359
  }