@fusion.dev/helix-headless 0.180.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.
@@ -29727,6 +29727,19 @@
29727
29727
  },
29728
29728
  "description": "Asks the slot, and records the answer as a state.\n\nCalled on `slotchange` and after every update, and the second is not\nbelt-and-braces: **`slotchange` does not fire when nothing is assigned.**\nWithout it a checkbox labeled only by its property, which is most of them,\nnever hears about its own label and renders without one.\n\n**`:state(has-label)` and not `data-has-label`.** The answer comes from\n`assignedNodes` and a server has no tree to ask, so an attribute would\nappear on every labeled checkbox the instant it upgraded and on none that\nany server sent. See `HelixElement.toggleState`."
29729
29729
  },
29730
+ {
29731
+ "kind": "method",
29732
+ "name": "click",
29733
+ "return": {
29734
+ "type": {
29735
+ "text": "void"
29736
+ }
29737
+ },
29738
+ "description": "Ticks or clears the box, as `click()` does a native checkbox: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
29739
+ "type": {
29740
+ "text": "click() => void"
29741
+ }
29742
+ },
29730
29743
  {
29731
29744
  "kind": "field",
29732
29745
  "name": "checked",
@@ -137270,6 +137283,19 @@
137270
137283
  },
137271
137284
  "description": "Whether the radio holds the group's tab stop. Unset, the chosen radio\nholds it.\n\nThe stop rides on the selection, and an unanswered group has no selection,\nso without this every choice is `tabindex=\"-1\"` and the keyboard cannot\nenter the set at all. The group writes `true` for the chosen radio, or for\nthe first that can be chosen while nothing is, and `false` for every radio,\nthe chosen one too, while a toolbar the group sits in holds the stop.\n\n**Written by the group, with no attribute, and it reaches the control\nrather than the host.** A `tabindex` on the host is two faults at once: it\nis markup a consumer rendered and their server never sent, which React\nreports as a mismatch and does not patch up, and it puts the tab stop on\nthe element rather than on the `<button role=\"radio\">` inside it, so a\nscreen reader meets an unnamed box where a native group would have given\nthem an unchecked radio. `Toggle.Root` carries the same property for the\nsame reason."
137272
137285
  },
137286
+ {
137287
+ "kind": "method",
137288
+ "name": "click",
137289
+ "return": {
137290
+ "type": {
137291
+ "text": "void"
137292
+ }
137293
+ },
137294
+ "description": "Chooses the radio, as `click()` does a native radio: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
137295
+ "type": {
137296
+ "text": "click() => void"
137297
+ }
137298
+ },
137273
137299
  {
137274
137300
  "kind": "field",
137275
137301
  "name": "disabled",
@@ -157082,6 +157108,19 @@
157082
157108
  },
157083
157109
  "description": "The thumb, drawn inside the track after the input: nothing on this tier.\n\nA seam for a tier that draws the thumb as an element, so it can be a part\nand hold icons. An element here would be an empty child on every page that\nloads only this tier, which is the cost the `track` part notes."
157084
157110
  },
157111
+ {
157112
+ "kind": "method",
157113
+ "name": "click",
157114
+ "return": {
157115
+ "type": {
157116
+ "text": "void"
157117
+ }
157118
+ },
157119
+ "description": "Turns the switch on or off, as `click()` does a native checkbox: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
157120
+ "type": {
157121
+ "text": "click() => void"
157122
+ }
157123
+ },
157085
157124
  {
157086
157125
  "kind": "field",
157087
157126
  "name": "checked",
@@ -182922,6 +182961,19 @@
182922
182961
  "text": "select() => boolean"
182923
182962
  }
182924
182963
  },
182964
+ {
182965
+ "kind": "method",
182966
+ "name": "click",
182967
+ "return": {
182968
+ "type": {
182969
+ "text": "void"
182970
+ }
182971
+ },
182972
+ "description": "Presses the toggle, as `click()` does a native button: passed to the control\ninside, so the one click a listener hears is the control's, after it has\nmoved. See `HostClickController`.",
182973
+ "type": {
182974
+ "text": "click() => void"
182975
+ }
182976
+ },
182925
182977
  {
182926
182978
  "kind": "field",
182927
182979
  "name": "disabled",
@@ -199834,6 +199886,6 @@
199834
199886
  ],
199835
199887
  "helix": {
199836
199888
  "package": "@fusion.dev/helix-headless",
199837
- "version": "0.180.0"
199889
+ "version": "0.180.1"
199838
199890
  }
199839
199891
  }
@@ -152,6 +152,12 @@ export declare class HelixHeadlessCheckbox extends HelixHeadlessCheckbox_base {
152
152
  * any server sent. See `HelixElement.toggleState`.
153
153
  */
154
154
  private syncLabelPresence;
155
+ /**
156
+ * Ticks or clears the box, as `click()` does a native checkbox: passed to the control
157
+ * inside, so the one click a listener hears is the control's, after it has
158
+ * moved. See `HostClickController`.
159
+ */
160
+ click(): void;
155
161
  protected render(): TemplateResult;
156
162
  }
157
163
  declare global {
@@ -83,6 +83,11 @@ let HelixHeadlessCheckbox = class HelixHeadlessCheckbox extends MixinControllerC
83
83
  this.toggleState('has-label', filled && !hidden);
84
84
  this.partNamed('label')?.toggleAttribute('hidden', !filled);
85
85
  }
86
+ click() {
87
+ if (!this.clicks.click()) {
88
+ super.click();
89
+ }
90
+ }
86
91
  render() {
87
92
  const named = this.label === '' ? this.getAttribute('aria-label') : null;
88
93
  return html `<label part="field">
@@ -106,6 +106,12 @@ export declare class HelixHeadlessRadio extends HelixHeadlessRadio_base {
106
106
  * re-renders nothing.
107
107
  */
108
108
  protected firstUpdated(changed: PropertyValues): void;
109
+ /**
110
+ * Chooses the radio, as `click()` does a native radio: passed to the control
111
+ * inside, so the one click a listener hears is the control's, after it has
112
+ * moved. See `HostClickController`.
113
+ */
114
+ click(): void;
109
115
  protected render(): TemplateResult;
110
116
  }
111
117
  declare global {
@@ -22,6 +22,11 @@ let HelixHeadlessRadio = class HelixHeadlessRadio extends MixinSelectableItem(He
22
22
  super.firstUpdated(changed);
23
23
  this.finishHydration();
24
24
  }
25
+ click() {
26
+ if (!this.clicks.click()) {
27
+ super.click();
28
+ }
29
+ }
25
30
  render() {
26
31
  return html `<button
27
32
  part="item"
@@ -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">
@@ -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;