@fusion.dev/helix-headless 0.32.0 → 0.33.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 (61) hide show
  1. package/custom-elements.json +876 -164
  2. package/dist/area-chart/root/area-chart-root.d.ts +8 -0
  3. package/dist/area-chart/root/area-chart-root.js +1 -0
  4. package/dist/bar-chart/root/bar-chart-root.d.ts +8 -0
  5. package/dist/bar-chart/root/bar-chart-root.js +2 -1
  6. package/dist/breadcrumbs/breadcrumb/breadcrumb.js +1 -1
  7. package/dist/carousel/root/carousel-root.d.ts +12 -0
  8. package/dist/carousel/root/carousel-root.js +11 -7
  9. package/dist/chat/composer/chat-composer.d.ts +4 -0
  10. package/dist/chat/root/chat-root.d.ts +17 -0
  11. package/dist/chat/root/chat-root.js +12 -1
  12. package/dist/code-block/root/code-block-root.d.ts +25 -3
  13. package/dist/code-block/root/code-block-root.js +16 -5
  14. package/dist/color-picker/root/color-picker-root.js +2 -1
  15. package/dist/copy-button/root/copy-button-root.d.ts +8 -0
  16. package/dist/copy-button/root/copy-button-root.js +4 -1
  17. package/dist/data-table/root/data-table-root.d.ts +22 -3
  18. package/dist/data-table/root/data-table-root.js +25 -16
  19. package/dist/date-input/root/date-input-root.d.ts +34 -1
  20. package/dist/date-input/root/date-input-root.js +27 -1
  21. package/dist/date-picker/root/date-picker-root.js +6 -8
  22. package/dist/donut-chart/root/donut-chart-root.d.ts +21 -5
  23. package/dist/donut-chart/root/donut-chart-root.js +18 -6
  24. package/dist/drilldown/item/drilldown-item.js +1 -1
  25. package/dist/drilldown/root/drilldown-root.js +5 -4
  26. package/dist/heatmap/root/heatmap-root.d.ts +11 -2
  27. package/dist/icon/root/icon-root.d.ts +8 -0
  28. package/dist/icon/root/icon-root.js +5 -0
  29. package/dist/line-chart/root/line-chart-root.d.ts +9 -1
  30. package/dist/line-chart/root/line-chart-root.js +1 -0
  31. package/dist/menu/item/menu-item.js +1 -1
  32. package/dist/menu/root/menu-root.js +5 -4
  33. package/dist/object-inspector/root/object-inspector-root.d.ts +8 -0
  34. package/dist/object-inspector/root/object-inspector-root.js +20 -15
  35. package/dist/pagination/root/pagination-root.js +1 -1
  36. package/dist/pin-input/root/pin-input-root.d.ts +7 -1
  37. package/dist/pin-input/root/pin-input-root.js +5 -7
  38. package/dist/scatter-chart/root/scatter-chart-root.d.ts +20 -0
  39. package/dist/scatter-chart/root/scatter-chart-root.js +15 -9
  40. package/dist/scroll-area/root/scroll-area-root.js +3 -2
  41. package/dist/sparkline/root/sparkline-root.js +1 -0
  42. package/dist/splitter/root/splitter-root.d.ts +11 -0
  43. package/dist/splitter/root/splitter-root.js +16 -16
  44. package/dist/table/cell/table-cell.d.ts +2 -0
  45. package/dist/table/column/table-column.d.ts +40 -6
  46. package/dist/table/column/table-column.js +23 -3
  47. package/dist/table/root/table-root.d.ts +76 -11
  48. package/dist/table/root/table-root.js +90 -3
  49. package/dist/table/row/table-row.d.ts +14 -0
  50. package/dist/table/row/table-row.js +16 -0
  51. package/dist/toolbar/root/toolbar-root.js +6 -5
  52. package/dist/tooltip/root/tooltip-root.d.ts +20 -0
  53. package/dist/tooltip/root/tooltip-root.js +21 -3
  54. package/dist/tour/root/tour-root.js +1 -1
  55. package/dist/tour/stop/tour-stop.d.ts +10 -0
  56. package/dist/tour/stop/tour-stop.js +9 -2
  57. package/dist/tree/root/tree-root.js +4 -3
  58. package/dist/video/root/video-root.js +7 -0
  59. package/package.json +5 -5
  60. package/types/jsx.d.ts +1506 -596
  61. package/types/vue.d.ts +55 -23
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { anchorElement, customElement, HelixElement, hostAria, MixinControllerOpen, PopoverController, } from '@fusion.dev/helix-core';
8
8
  import { html } from 'lit';
9
- import { property } from 'lit/decorators.js';
9
+ import { property, state } from 'lit/decorators.js';
10
10
  const GENERIC = new Set(['div', 'p', 'section', 'span']);
11
11
  let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpen(HelixElement) {
12
12
  constructor() {
@@ -33,6 +33,14 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
33
33
  this.holds.clear();
34
34
  this.hide();
35
35
  },
36
+ onPlace: (placement) => {
37
+ const side = placement.split('-')[0];
38
+ this.toggleState('placed-bottom', side === 'bottom');
39
+ this.toggleState('placed-left', side === 'left');
40
+ this.toggleState('placed-right', side === 'right');
41
+ this.toggleState('placed-top', side === 'top');
42
+ this.side = side;
43
+ },
36
44
  placement: () => this.placement,
37
45
  surface: () => this.partNamed('tooltip'),
38
46
  within: () => this.enclosure,
@@ -235,9 +243,16 @@ let HelixHeadlessTooltip = class HelixHeadlessTooltip extends MixinControllerOpe
235
243
  });
236
244
  }
237
245
  render() {
246
+ const side = this.side;
238
247
  return html `<slot></slot>
239
- <div part="tooltip" popover="manual" role="tooltip">
240
- <span part="arrow"></span>
248
+ <div
249
+ part="tooltip${side ? { bottom: ' tooltip-bottom', left: ' tooltip-left', right: ' tooltip-right', top: ' tooltip-top' }[side] : ''}"
250
+ popover="manual"
251
+ role="tooltip"
252
+ >
253
+ <span
254
+ part="arrow${side ? { bottom: ' arrow-bottom', left: ' arrow-left', right: ' arrow-right', top: ' arrow-top' }[side] : ''}"
255
+ ></span>
241
256
  <slot name="content" @slotchange=${this.handleContentChange}
242
257
  >${this.content}</slot
243
258
  >
@@ -271,6 +286,9 @@ __decorate([
271
286
  __decorate([
272
287
  property()
273
288
  ], HelixHeadlessTooltip.prototype, "within", void 0);
289
+ __decorate([
290
+ state()
291
+ ], HelixHeadlessTooltip.prototype, "side", void 0);
274
292
  HelixHeadlessTooltip = __decorate([
275
293
  customElement('helix-headless-tooltip')
276
294
  ], HelixHeadlessTooltip);
@@ -192,7 +192,7 @@ let HelixHeadlessTour = class HelixHeadlessTour extends HelixElement {
192
192
  : html `<div
193
193
  part="spotlight"
194
194
  aria-hidden="true"
195
- style=${`inset-block-start: ${spot.top}px; inset-inline-start: ${spot.left}px; block-size: ${spot.height}px; inline-size: ${spot.width}px`}
195
+ style=${`left: ${spot.left}px; top: ${spot.top}px; block-size: ${spot.height}px; inline-size: ${spot.width}px`}
196
196
  ></div>`}
197
197
  <slot></slot>`;
198
198
  }
@@ -46,6 +46,10 @@ import '../../button/index.js';
46
46
  *
47
47
  * @csspart actions - The row the controls sit in.
48
48
  * @csspart arrow - The point, which the floating pass places against the target.
49
+ * @csspart arrow-bottom - The point while the panel is below its target, so on the panel's top edge, beside `arrow`.
50
+ * @csspart arrow-left - The point while the panel is left of its target, so on the panel's right edge, beside `arrow`.
51
+ * @csspart arrow-right - The point while the panel is right of its target, so on the panel's left edge, beside `arrow`.
52
+ * @csspart arrow-top - The point while the panel is above its target, so on the panel's bottom edge, beside `arrow`.
49
53
  * @csspart back - The control that goes to the previous stop.
50
54
  * @csspart back-button - The inner control.
51
55
  * @csspart bubble - The panel that points at the target.
@@ -103,6 +107,12 @@ export declare class HelixHeadlessTourStop extends HelixElement {
103
107
  * Label for the control that leaves the tour.
104
108
  */
105
109
  skipLabel: string;
110
+ /**
111
+ * The side of its target the panel last landed on, which names the arrow's
112
+ * second part. Undefined until the first placement, which the server never
113
+ * makes.
114
+ */
115
+ private side?;
106
116
  /** The element this stop is about, or null where the id resolves to nothing. */
107
117
  get target(): HTMLElement | null;
108
118
  private readonly floating;
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { customElement, HelixElement, HelixTourAskEvent, hostAria, PopoverController, } from '@fusion.dev/helix-core';
8
- import { property } from 'lit/decorators.js';
8
+ import { property, state } from 'lit/decorators.js';
9
9
  import { html } from 'lit/static-html.js';
10
10
  import '../../button/index.js';
11
11
  let HelixHeadlessTourStop = class HelixHeadlessTourStop extends HelixElement {
@@ -34,6 +34,7 @@ let HelixHeadlessTourStop = class HelixHeadlessTourStop extends HelixElement {
34
34
  this.toggleState('placed-left', side === 'left');
35
35
  this.toggleState('placed-right', side === 'right');
36
36
  this.toggleState('placed-top', side === 'top');
37
+ this.side = side;
37
38
  },
38
39
  placement: () => this.placement,
39
40
  surface: () => this.partNamed('bubble'),
@@ -87,7 +88,10 @@ let HelixHeadlessTourStop = class HelixHeadlessTourStop extends HelixElement {
87
88
  render() {
88
89
  return html `<div part="bubble" popover="manual" ?hidden=${!this.current}>
89
90
  ${''}
90
- <div part="arrow" aria-hidden="true"></div>
91
+ <div
92
+ part="arrow${this.side ? { bottom: ' arrow-bottom', left: ' arrow-left', right: ' arrow-right', top: ' arrow-top' }[this.side] : ''}"
93
+ aria-hidden="true"
94
+ ></div>
91
95
  <div part="content"><slot></slot></div>
92
96
  <div part="actions">
93
97
  ${this.renderActions()}
@@ -125,6 +129,9 @@ __decorate([
125
129
  __decorate([
126
130
  property({ attribute: 'skip-label' })
127
131
  ], HelixHeadlessTourStop.prototype, "skipLabel", void 0);
132
+ __decorate([
133
+ state()
134
+ ], HelixHeadlessTourStop.prototype, "side", void 0);
128
135
  HelixHeadlessTourStop = __decorate([
129
136
  customElement('helix-headless-tour-stop')
130
137
  ], HelixHeadlessTourStop);
@@ -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 { closestInstance, customElement, HelixElement, MixinCollection, MixinControllerActive, scrollItemIntoView, } from '@fusion.dev/helix-core';
7
+ import { closestInstance, customElement, HelixElement, inlineStep, MixinCollection, MixinControllerActive, scrollItemIntoView, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { HelixHeadlessTreeItem } from '../item/tree-item.js';
@@ -31,6 +31,7 @@ let HelixHeadlessTree = class HelixHeadlessTree extends MixinCollection(MixinCon
31
31
  if (!current || !this.items.includes(current) || !KEYS.has(event.key)) {
32
32
  return;
33
33
  }
34
+ const along = inlineStep(this, event.key);
34
35
  if (event.key === 'ArrowDown') {
35
36
  this.move(current, 1);
36
37
  }
@@ -43,7 +44,7 @@ let HelixHeadlessTree = class HelixHeadlessTree extends MixinCollection(MixinCon
43
44
  else if (event.key === 'End') {
44
45
  this.focusOn(this.visibleItems.at(-1));
45
46
  }
46
- else if (event.key === 'ArrowRight') {
47
+ else if (along === 1) {
47
48
  if (current.isBranch && !current.open) {
48
49
  current.requestOpen(true);
49
50
  this.syncItems();
@@ -52,7 +53,7 @@ let HelixHeadlessTree = class HelixHeadlessTree extends MixinCollection(MixinCon
52
53
  this.move(current, 1);
53
54
  }
54
55
  }
55
- else if (event.key === 'ArrowLeft') {
56
+ else if (along === -1) {
56
57
  if (current.isBranch && current.open) {
57
58
  current.requestOpen(false);
58
59
  this.syncItems();
@@ -689,8 +689,15 @@ let HelixHeadlessVideo = class HelixHeadlessVideo extends HelixElement {
689
689
  ${drawIcon(this.playing ? pause : play)}
690
690
  </button>
691
691
  <span part="time">${clock(this.position)} / ${clock(this.knownDuration)}</span>
692
+ <!-- Left to right on every page. A player's timeline is a tape running
693
+ one way rather than a line of text, which is why its skip glyphs are
694
+ not mirrored and the left arrow rewinds whatever the script. Allowed
695
+ to follow the page, a range turns round on a right-to-left one, and
696
+ the arrows on the scrubber moved through time the other way to the
697
+ same arrows pressed on the video. -->
692
698
  <input
693
699
  part="scrubber"
700
+ dir="ltr"
694
701
  type="range"
695
702
  min="0"
696
703
  max=${Number.isFinite(this.knownDuration) && this.knownDuration > 0 ? this.knownDuration : 0}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-headless",
3
3
  "description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
4
- "version": "0.32.0",
4
+ "version": "0.33.1",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -46,14 +46,14 @@
46
46
  },
47
47
  "bugs": "https://github.com/project-fusion/fusion/issues",
48
48
  "dependencies": {
49
- "@fusion.dev/helix-core": "0.32.0",
50
- "@fusion.dev/helix-icons": "0.32.0",
49
+ "@fusion.dev/helix-core": "0.33.1",
50
+ "@fusion.dev/helix-icons": "0.33.1",
51
51
  "uqr": "^0.1.3"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@custom-elements-manifest/analyzer": "^0.11.0",
55
- "@fusion.dev/helix-cem": "0.32.0",
56
- "@fusion.dev/helix-testing": "0.32.0",
55
+ "@fusion.dev/helix-cem": "0.33.1",
56
+ "@fusion.dev/helix-testing": "0.33.1",
57
57
  "@fusion.dev/scripts": "0.0.0-dev",
58
58
  "@happy-dom/global-registrator": "^20.0.0",
59
59
  "@lit-labs/ssr": "^4.1.0",