@fusion.dev/helix-headless 0.157.0 → 0.159.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 (56) hide show
  1. package/custom-elements.json +851 -56
  2. package/dist/app-header/root/app-header-root.d.ts +59 -12
  3. package/dist/app-header/root/app-header-root.js +68 -29
  4. package/dist/button/root/button-root.d.ts +8 -0
  5. package/dist/button/root/button-root.js +4 -0
  6. package/dist/button-group/root/button-group-root.d.ts +20 -7
  7. package/dist/button-group/root/button-group-root.js +30 -5
  8. package/dist/command/root/command-root.d.ts +19 -5
  9. package/dist/command/root/command-root.js +14 -4
  10. package/dist/data-table/root/data-table-root.js +5 -2
  11. package/dist/element-events.generated.js +7 -1
  12. package/dist/lightbox/item/lightbox-item.d.ts +7 -1
  13. package/dist/lightbox/item/lightbox-item.js +15 -2
  14. package/dist/lightbox/root/lightbox-root.d.ts +8 -4
  15. package/dist/lightbox/root/lightbox-root.js +9 -1
  16. package/dist/lightbox/zoom-controller.d.ts +13 -4
  17. package/dist/lightbox/zoom-controller.js +17 -0
  18. package/dist/list/item/list-item.d.ts +15 -1
  19. package/dist/list/item/list-item.js +20 -1
  20. package/dist/list/root/list-root.d.ts +29 -1
  21. package/dist/list/root/list-root.js +44 -10
  22. package/dist/listbox/root/listbox-root.d.ts +19 -2
  23. package/dist/listbox/root/listbox-root.js +16 -8
  24. package/dist/map/root/map-root.d.ts +4 -0
  25. package/dist/map/root/map-root.js +1 -1
  26. package/dist/menu/item/menu-item.js +1 -1
  27. package/dist/menu/root/menu-root.d.ts +6 -2
  28. package/dist/menu/root/menu-root.js +9 -2
  29. package/dist/number-input/root/number-input-root.d.ts +7 -4
  30. package/dist/number-input/root/number-input-root.js +3 -3
  31. package/dist/progress/root/progress-root.js +1 -1
  32. package/dist/select/root/select-root.d.ts +8 -1
  33. package/dist/select/root/select-root.js +8 -5
  34. package/dist/skeleton/root/skeleton-root.d.ts +2 -1
  35. package/dist/skeleton/root/skeleton-root.js +1 -1
  36. package/dist/steps/root/steps-root.js +8 -6
  37. package/dist/steps/step/step.d.ts +9 -0
  38. package/dist/steps/step/step.js +19 -2
  39. package/dist/tabs/panel/tab-panel.d.ts +22 -1
  40. package/dist/tabs/panel/tab-panel.js +22 -1
  41. package/dist/tabs/root/tabs-root.d.ts +21 -5
  42. package/dist/tabs/root/tabs-root.js +24 -13
  43. package/dist/tabs/tab/tab.d.ts +4 -2
  44. package/dist/tabs/tab/tab.js +3 -1
  45. package/dist/toast/item/toast-item.d.ts +27 -8
  46. package/dist/toast/item/toast-item.js +47 -11
  47. package/dist/toast/root/toast-root.d.ts +24 -1
  48. package/dist/toast/root/toast-root.js +54 -0
  49. package/dist/tour/root/tour-root.d.ts +34 -0
  50. package/dist/tour/root/tour-root.js +92 -3
  51. package/dist/tour/stop/tour-stop.d.ts +33 -1
  52. package/dist/tour/stop/tour-stop.js +12 -1
  53. package/lint.json +1 -1
  54. package/package.json +5 -5
  55. package/types/jsx.d.ts +667 -102
  56. package/types/vue.d.ts +148 -23
@@ -1,6 +1,23 @@
1
- import { HelixElement, type Placement } from '@fusion.dev/helix-core';
1
+ import { HelixElement, OpenPhaseController, type Placement } from '@fusion.dev/helix-core';
2
2
  import { type PropertyValues, type TemplateResult } from 'lit';
3
3
  import '../../button/index.js';
4
+ /** What a stop's `effect` is given: the stop's place, its target, and the tour's moves. */
5
+ export interface TourStopContext {
6
+ /** The stop's index in the tour. */
7
+ index: number;
8
+ /** Goes on to the next stop, as Next does. */
9
+ next(): void;
10
+ /** Ends the tour early, as Skip does. */
11
+ skip(): void;
12
+ /** The element `for` names, now, or `null` where it is not on the page yet. */
13
+ target: HTMLElement | null;
14
+ }
15
+ /**
16
+ * A stop's `effect`: run as the tour reaches the stop, before it is shown. A
17
+ * promise holds the stop back until it settles, and a function returned, or
18
+ * resolved, runs when the tour leaves the stop.
19
+ */
20
+ export type TourStopEffect = (context: TourStopContext) => void | (() => void) | Promise<void | (() => void)>;
4
21
  /**
5
22
  * @summary One stop on a tour: the element it points at, and a panel of content about it.
6
23
  *
@@ -30,6 +47,13 @@ import '../../button/index.js';
30
47
  * get Back, Next, and Skip, already wired. Slot your own `actions` and drive
31
48
  * them with `next()`, `back()`, and `skip()` on the root.
32
49
  *
50
+ * **Set `effect` to prepare the page for a stop**, such as opening the menu
51
+ * it points into or loading what it describes. It is a function, set from
52
+ * script, that the tour runs as it reaches the stop. Return a promise and the
53
+ * stop waits for it, and the tour has `:state(preparing)` meanwhile; return a
54
+ * function, or resolve to one, and the tour runs it when it leaves the stop.
55
+ * Zag's tour step has the same `effect`.
56
+ *
33
57
  * **`for` is an id, as with `Tooltip`**, so you can point at a target elsewhere
34
58
  * on the page from markup. It resolves against the stop's root node, so a stop
35
59
  * inside a shadow tree points at a target in that tree.
@@ -81,6 +105,8 @@ import '../../button/index.js';
81
105
  * @csspart skip-spinner - The ring `skip` turns while it is pending.
82
106
  * @csspart skip-text - The words on that button, trimmed to their capitals and baseline.
83
107
  *
108
+ * @cssstate entering - From the moment the stop is shown until its entrance has finished.
109
+ * @cssstate exiting - From the moment the stop is left until its exit has finished.
84
110
  * @cssstate placed-bottom - The panel sits below its target.
85
111
  * @cssstate placed-left - The panel sits to the left of its target.
86
112
  * @cssstate placed-right - The panel sits to the right of its target.
@@ -110,6 +136,11 @@ export declare class HelixHeadlessTourStop extends HelixElement {
110
136
  * Label for the control that goes on from the last stop.
111
137
  */
112
138
  doneLabel: string;
139
+ /**
140
+ * Run as the tour reaches the stop, before it is shown: see the description
141
+ * above. A function, so it is set from script and has no attribute.
142
+ */
143
+ effect?: TourStopEffect;
113
144
  /**
114
145
  * Whether the stop is the first one, with no stop before it.
115
146
  */
@@ -165,6 +196,7 @@ export declare class HelixHeadlessTourStop extends HelixElement {
165
196
  * makes.
166
197
  */
167
198
  private side?;
199
+ protected readonly phases: OpenPhaseController;
168
200
  /** The element the stop points at, or `null` when no element has the `for` id. */
169
201
  get target(): HTMLElement | null;
170
202
  private readonly floating;
@@ -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 { arrowReach, customElement, elementById, HelixElement, HelixTourAskEvent, PopoverController, reflectElements, sideOf, words, } from '@fusion.dev/helix-core';
7
+ import { arrowReach, customElement, elementById, HelixElement, HelixTourAskEvent, OpenPhaseController, PopoverController, reflectElements, sideOf, words, } from '@fusion.dev/helix-core';
8
8
  import { nothing } from 'lit';
9
9
  import { property, state } from 'lit/decorators.js';
10
10
  import { html } from 'lit/static-html.js';
@@ -25,6 +25,14 @@ let HelixHeadlessTourStop = class HelixHeadlessTourStop extends HelixElement {
25
25
  this.position = '';
26
26
  this.progress = false;
27
27
  this.skipLabel = 'Skip';
28
+ this.phases = new OpenPhaseController(this, {
29
+ mark: {
30
+ entering: (on) => this.toggleState('entering', on),
31
+ exiting: (on) => this.toggleState('exiting', on),
32
+ },
33
+ open: () => this.current && this.type !== 'wait',
34
+ surface: () => this.partNamed('bubble'),
35
+ });
28
36
  this.floating = new PopoverController(this, {
29
37
  anchor: () => this.target,
30
38
  arrow: () => this.partNamed('arrow'),
@@ -154,6 +162,9 @@ __decorate([
154
162
  words,
155
163
  property({ attribute: 'done-label' })
156
164
  ], HelixHeadlessTourStop.prototype, "doneLabel", void 0);
165
+ __decorate([
166
+ property({ attribute: false })
167
+ ], HelixHeadlessTourStop.prototype, "effect", void 0);
157
168
  __decorate([
158
169
  property({ reflect: true, type: Boolean })
159
170
  ], HelixHeadlessTourStop.prototype, "first", void 0);