@fusion.dev/helix-headless 0.227.0 → 0.229.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.
@@ -116,29 +116,6 @@ export declare class HelixHeadlessAnnouncement extends HelixHeadlessAnnouncement
116
116
  * Off by default, so every announcement on a page shows at once.
117
117
  */
118
118
  queued: boolean;
119
- /**
120
- * The band's color.
121
- *
122
- * Paint only: unlike `Callout`, no value here draws a mark, changes the label,
123
- * or moves the live region off polite. `neutral` is the resting value, said
124
- * out loud so a consumer can put a band back to it from markup.
125
- *
126
- * **The set is `Tag`'s and `Badge`'s, and now actually is.** This doc claimed
127
- * to match `Tag` while differing from it in both directions: it carried
128
- * `surface`, which `Tag` does not, and lacked `accent`, which `Tag` has. Three
129
- * components saying what a thing means, in three vocabularies, one of which
130
- * described itself as a fourth.
131
- *
132
- * `accent` is the second emphasis, the second color a theme names, and the
133
- * brand itself until one is named. `primary` is the brand.
134
- *
135
- * **`surface` was never a color and has moved to `separation`**, which is the
136
- * axis that owns where a box sits relative to the page. It said the band rode
137
- * the surface step instead of the sunken one, which is an elevation, and a
138
- * band can be `info` and elevated at once: two values true together are two
139
- * axes, which is the test the registry answers to.
140
- */
141
- tone?: 'accent' | 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning';
142
119
  /** Whether a queued announcement before this one is still there. */
143
120
  private waiting;
144
121
  /** Watches the parent for the announcements before this one leaving. */
@@ -213,9 +213,6 @@ __decorate([
213
213
  __decorate([
214
214
  property({ reflect: true, type: Boolean })
215
215
  ], HelixHeadlessAnnouncement.prototype, "queued", void 0);
216
- __decorate([
217
- property({ reflect: true })
218
- ], HelixHeadlessAnnouncement.prototype, "tone", void 0);
219
216
  __decorate([
220
217
  state()
221
218
  ], HelixHeadlessAnnouncement.prototype, "waiting", void 0);
@@ -103,9 +103,8 @@ export declare class HelixHeadlessButtonGroup extends HelixElement {
103
103
  * Unset is a row and stays unset, so a reflected default cannot appear on a
104
104
  * host whose server output never had it.
105
105
  *
106
- * **A property and not an `auto`, which the splitter and the carousel earned
107
- * and this has not.** Turning those two changes what they *do*: a drag axis,
108
- * arrow keys, how many slides a page holds. A group of buttons turning is
106
+ * **A property and not an `auto`, which the splitter earned and this has not.**
107
+ * Turning a splitter changes what it *does*: a drag axis and arrow keys. A group of buttons turning is
109
108
  * paint, so there is no state to resolve and nothing to observe; what it needs
110
109
  * is for a consumer who knows the column is narrow to be able to say so.
111
110
  *
@@ -55,8 +55,8 @@ import { type PropertyValues, type TemplateResult } from 'lit';
55
55
  * @csspart node - The box the content sits in.
56
56
  * @csspart outline - The drawn outline of a `diamond` card, a shape a box cannot draw.
57
57
  *
58
+ * @cssstate active - The card that receives focus when you tab into the board.
58
59
  * @cssstate candidate - While a connection is being drawn and this card is somewhere it could arrive.
59
- * @cssstate current - The card that receives focus when you tab into the board.
60
60
  * @cssstate placed - Placed on the board.
61
61
  * @cssstate selected - The card is selected.
62
62
  * @cssstate target - A connection being drawn would end here if you released it.
@@ -48,7 +48,7 @@ let HelixHeadlessCanvasNode = class HelixHeadlessCanvasNode extends HelixElement
48
48
  willUpdate(changed) {
49
49
  super.willUpdate(changed);
50
50
  this.toggleState('candidate', this.candidate);
51
- this.toggleState('current', this.current);
51
+ this.toggleState('active', this.current);
52
52
  this.toggleState('selected', this.selected);
53
53
  this.toggleState('target', this.target);
54
54
  }
@@ -33,7 +33,7 @@ let HelixHeadlessFilterChip = class HelixHeadlessFilterChip extends MixinDismiss
33
33
  ${operator
34
34
  ? html `<span part="operator"><slot name="operator">${this.operatorLabel}</slot></span>`
35
35
  : nothing}
36
- ${values ? html `<span part="values"><slot></slot></span>` : nothing}
36
+ <span part="values" ?hidden=${!values}><slot></slot></span>
37
37
  ${this.dismissible
38
38
  ? html `<button
39
39
  part="dismiss"
@@ -40,6 +40,7 @@ import { type PropertyValues, type TemplateResult } from 'lit';
40
40
  * @event {Event} load - The image loaded. Relayed from the inner image, whose own event stays inside the shadow root.
41
41
  *
42
42
  * @csspart fallback - The fallback, shown when the image fails to load.
43
+ * @csspart fallback-mark - The mark drawn where a failed image has no `fallback` slot.
43
44
  * @csspart image - The image itself.
44
45
  * @csspart placeholder - The placeholder, shown until the image loads.
45
46
  *
@@ -239,6 +240,8 @@ export declare class HelixHeadlessImage extends HelixElement {
239
240
  get naturalHeight(): number;
240
241
  /** The image's intrinsic width in pixels. Zero until the image loads. */
241
242
  get naturalWidth(): number;
243
+ /** What a failed image shows, a mark where the `fallback` slot is empty. */
244
+ protected renderFallback(): TemplateResult;
242
245
  protected render(): TemplateResult;
243
246
  }
244
247
  declare global {
@@ -124,6 +124,14 @@ let HelixHeadlessImage = class HelixHeadlessImage extends HelixElement {
124
124
  get naturalWidth() {
125
125
  return this.image?.naturalWidth ?? 0;
126
126
  }
127
+ renderFallback() {
128
+ return html `<span
129
+ part="fallback"
130
+ aria-hidden=${this.status === 'error' ? nothing : 'true'}
131
+ ?hidden=${this.status !== 'error'}
132
+ ><slot name="fallback"><span part="fallback-mark"></span></slot
133
+ ></span>`;
134
+ }
127
135
  render() {
128
136
  return html `<img
129
137
  part="image"
@@ -145,12 +153,7 @@ let HelixHeadlessImage = class HelixHeadlessImage extends HelixElement {
145
153
  ?hidden=${this.status !== 'loading' || this.waiting}
146
154
  ><slot name="placeholder"></slot
147
155
  ></span>
148
- <span
149
- part="fallback"
150
- aria-hidden=${this.status === 'error' ? nothing : 'true'}
151
- ?hidden=${this.status !== 'error'}
152
- ><slot name="fallback"></slot
153
- ></span>`;
156
+ ${this.renderFallback()}`;
154
157
  }
155
158
  };
156
159
  __decorate([
@@ -146,7 +146,7 @@ export declare class HelixHeadlessList extends HelixElement {
146
146
  emptyLabel?: string;
147
147
  /**
148
148
  * The text of the row shown while the list has no rows, where the `empty`
149
- * slot is empty. Empty, the default, shows no row.
149
+ * slot is empty. An empty string shows no row.
150
150
  */
151
151
  emptyText: string;
152
152
  /**
@@ -11,7 +11,7 @@ let HelixHeadlessList = class HelixHeadlessList extends HelixElement {
11
11
  super(...arguments);
12
12
  this.canceledLabel = 'Canceled';
13
13
  this.droppedLabel = 'Dropped';
14
- this.emptyText = '';
14
+ this.emptyText = 'No items';
15
15
  this.label = '';
16
16
  this.loading = false;
17
17
  this.loadingText = 'Loading more';
@@ -461,6 +461,7 @@ __decorate([
461
461
  property({ attribute: 'empty-label' })
462
462
  ], HelixHeadlessList.prototype, "emptyLabel", void 0);
463
463
  __decorate([
464
+ words,
464
465
  property({ attribute: 'empty-text' })
465
466
  ], HelixHeadlessList.prototype, "emptyText", void 0);
466
467
  __decorate([
@@ -30,10 +30,10 @@ import { type PropertyValues, type TemplateResult } from 'lit';
30
30
  * @csspart marker - The button, holding the point and the name.
31
31
  * @csspart point - The dot on the place, holding the icon if there is one.
32
32
  *
33
+ * @cssstate active - Holds the map's tab stop.
33
34
  * @cssstate behind - On the far side of a globe, out of sight until the globe turns it into view.
34
35
  * @cssstate cluster - Shows several markers as one count.
35
36
  * @cssstate clustered - Hidden inside another marker's cluster.
36
- * @cssstate current - Holds the map's tab stop.
37
37
  * @cssstate fanned - Spread out from a location it shares with other markers, after their cluster was pressed.
38
38
  * @cssstate icon - Has content in the icon slot.
39
39
  * @cssstate passed - Marked as passed.
@@ -44,7 +44,7 @@ let HelixHeadlessMapMarker = class HelixHeadlessMapMarker extends HelixElement {
44
44
  this.toggleState('behind', this.behind);
45
45
  this.toggleState('cluster', this.gathered.length > 1);
46
46
  this.toggleState('clustered', this.gatheredBy !== undefined);
47
- this.toggleState('current', this.current);
47
+ this.toggleState('active', this.current);
48
48
  this.toggleState('fanned', this.fanned);
49
49
  this.toggleState('passed', this.passed);
50
50
  this.toggleState('start', this.side === 'start');
@@ -40,11 +40,6 @@ export declare class HelixHeadlessMeterSegment extends HelixElement {
40
40
  * Not announced: see the note on a meter's children above.
41
41
  */
42
42
  label: string;
43
- /**
44
- * What the segment means, as it does on a callout. Takes the tone's color in
45
- * place of the next color in the series.
46
- */
47
- tone?: 'accent' | 'danger' | 'info' | 'neutral' | 'primary' | 'success' | 'warning';
48
43
  /**
49
44
  * How much of the meter's range the segment takes, in the units of the meter's
50
45
  * `min` and `max`.
@@ -35,9 +35,6 @@ let HelixHeadlessMeterSegment = class HelixHeadlessMeterSegment extends HelixEle
35
35
  __decorate([
36
36
  property()
37
37
  ], HelixHeadlessMeterSegment.prototype, "label", void 0);
38
- __decorate([
39
- property({ reflect: true })
40
- ], HelixHeadlessMeterSegment.prototype, "tone", void 0);
41
38
  __decorate([
42
39
  property({ converter: numberConverter('value', 0) })
43
40
  ], HelixHeadlessMeterSegment.prototype, "value", void 0);
@@ -52,7 +52,7 @@ export { isOption, optionsAmong } from '../among.js';
52
52
  * @cssstate disabled - While the option cannot be chosen.
53
53
  * @cssstate has-indicator - An icon is slotted into `indicator`.
54
54
  * @cssstate hovered - While a mouse or a pen is over the option. A touch sets no hover, as React Aria's `data-hovered` does not.
55
- * @cssstate pressed - While a pointer presses the option, from the press to the release.
55
+ * @cssstate pressing - While a pointer presses the option, from the press to the release.
56
56
  * @cssstate selected - While the option is chosen.
57
57
  */
58
58
  export declare class HelixHeadlessOption extends HelixElement {
@@ -25,13 +25,13 @@ let HelixHeadlessOption = class HelixHeadlessOption extends HelixElement {
25
25
  };
26
26
  this.handlePointerLeave = () => {
27
27
  this.toggleState('hovered', false);
28
- this.toggleState('pressed', false);
28
+ this.toggleState('pressing', false);
29
29
  };
30
30
  this.handlePointerDown = (event) => {
31
- this.toggleState('pressed', event.button === 0 && !this.disabled);
31
+ this.toggleState('pressing', event.button === 0 && !this.disabled);
32
32
  };
33
33
  this.handlePointerUp = () => {
34
- this.toggleState('pressed', false);
34
+ this.toggleState('pressing', false);
35
35
  };
36
36
  }
37
37
  get defaultSelected() {
@@ -374,7 +374,7 @@ let HelixHeadlessSelect = class HelixHeadlessSelect extends MixinControllerOpen(
374
374
  @keydown=${this.handleTriggerKeydown}
375
375
  >
376
376
  <slot name="start"></slot>
377
- <span part="value" id="value">${this.renderValue()}</span>
377
+ <span part="value" id="value" ?data-placeholder=${this.chosen.length === 0}>${this.renderValue()}</span>
378
378
  <slot name="end"></slot>
379
379
  ${this.renderIndicator()}
380
380
  </button>
@@ -83,6 +83,7 @@ export declare class HelixHeadlessSwitch extends HelixHeadlessSwitch_base {
83
83
  private sync;
84
84
  /** Returns the switch to the state its markup declared. */
85
85
  formResetCallback(): void;
86
+ protected firstUpdated(changed: PropertyValues): void;
86
87
  protected updated(changed: PropertyValues): void;
87
88
  /**
88
89
  * Says on the `label` region whether anything is in it.
@@ -33,6 +33,10 @@ let HelixHeadlessSwitch = class HelixHeadlessSwitch extends MixinControllerCheck
33
33
  super.formResetCallback();
34
34
  this.resetChecked();
35
35
  }
36
+ firstUpdated(changed) {
37
+ super.firstUpdated(changed);
38
+ this.renderRoot.addEventListener('slotchange', () => this.markEmpty());
39
+ }
36
40
  updated(changed) {
37
41
  super.updated(changed);
38
42
  this.markEmpty();