@voidable/ui 0.9.0 → 0.11.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 (114) hide show
  1. package/dist/base-entry.d.ts +1 -0
  2. package/dist/base.d.ts +8 -1
  3. package/dist/base.js +5 -1
  4. package/dist/chunks/base-BGrS4eIl.js +307 -0
  5. package/dist/chunks/data-BpiiNapL.js +95 -0
  6. package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
  7. package/dist/chunks/{modal-hivQ4YoU.js → modal-DWGkNdNG.js} +3 -3
  8. package/dist/chunks/{overlay-BywGMcDW.js → overlay-CH7L4N-h.js} +2 -2
  9. package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
  10. package/dist/chunks/{base-CMruMbxC.js → projection-oPe6ipjL.js} +105 -389
  11. package/dist/components/accordion.js +2 -2
  12. package/dist/components/action-input.d.ts +2 -2
  13. package/dist/components/action-input.js +56 -54
  14. package/dist/components/alert.d.ts +11 -0
  15. package/dist/components/alert.js +11 -4
  16. package/dist/components/avatar.js +13 -11
  17. package/dist/components/badge.d.ts +8 -2
  18. package/dist/components/badge.js +1 -4
  19. package/dist/components/banner.d.ts +9 -0
  20. package/dist/components/banner.js +11 -4
  21. package/dist/components/bar-chart.d.ts +21 -7
  22. package/dist/components/bar-chart.js +67 -43
  23. package/dist/components/breadcrumbs.js +2 -2
  24. package/dist/components/button.js +1 -1
  25. package/dist/components/calendar.d.ts +40 -2
  26. package/dist/components/calendar.js +170 -79
  27. package/dist/components/card.js +1 -1
  28. package/dist/components/carousel.js +20 -19
  29. package/dist/components/charts/data.d.ts +72 -0
  30. package/dist/components/checkbox-group.js +13 -12
  31. package/dist/components/checkbox.js +17 -16
  32. package/dist/components/collapsible.js +2 -2
  33. package/dist/components/color-picker.js +26 -24
  34. package/dist/components/combobox.js +17 -16
  35. package/dist/components/compose-input.js +13 -11
  36. package/dist/components/dialog.js +1 -1
  37. package/dist/components/divider.js +11 -9
  38. package/dist/components/donut-chart.d.ts +22 -6
  39. package/dist/components/donut-chart.js +96 -68
  40. package/dist/components/drawer.d.ts +2 -2
  41. package/dist/components/drawer.js +1 -1
  42. package/dist/components/dropdown-menu.js +4 -4
  43. package/dist/components/editable.js +13 -12
  44. package/dist/components/error-fallback.js +2 -2
  45. package/dist/components/field.js +10 -9
  46. package/dist/components/file-upload.d.ts +20 -5
  47. package/dist/components/file-upload.js +52 -20
  48. package/dist/components/gauge.d.ts +32 -8
  49. package/dist/components/gauge.js +209 -135
  50. package/dist/components/hamburger.d.ts +12 -1
  51. package/dist/components/hamburger.js +33 -20
  52. package/dist/components/hover-card.js +3 -3
  53. package/dist/components/indicator.js +14 -12
  54. package/dist/components/input.js +41 -39
  55. package/dist/components/line-chart.d.ts +22 -7
  56. package/dist/components/line-chart.js +80 -56
  57. package/dist/components/list.js +1 -1
  58. package/dist/components/menu.js +3 -3
  59. package/dist/components/multiselect.js +30 -29
  60. package/dist/components/nav-bar.d.ts +9 -0
  61. package/dist/components/nav-bar.js +16 -3
  62. package/dist/components/nav-menu.js +20 -19
  63. package/dist/components/number-input.js +17 -15
  64. package/dist/components/pagination.js +22 -20
  65. package/dist/components/panel.js +2 -2
  66. package/dist/components/pin-input.js +32 -30
  67. package/dist/components/popover.js +3 -3
  68. package/dist/components/progress.js +14 -12
  69. package/dist/components/radio-group.js +13 -11
  70. package/dist/components/radio.d.ts +25 -0
  71. package/dist/components/radio.js +78 -29
  72. package/dist/components/scroll-area.js +8 -7
  73. package/dist/components/segmented-control.js +21 -21
  74. package/dist/components/select.js +49 -47
  75. package/dist/components/sidebar.d.ts +2 -2
  76. package/dist/components/sidebar.js +2 -2
  77. package/dist/components/skeleton.js +1 -1
  78. package/dist/components/slider.js +16 -14
  79. package/dist/components/spinner.js +11 -9
  80. package/dist/components/stat.d.ts +13 -1
  81. package/dist/components/stat.js +29 -19
  82. package/dist/components/status-dot.js +1 -1
  83. package/dist/components/stepper.js +15 -13
  84. package/dist/components/switch.js +14 -12
  85. package/dist/components/table.d.ts +4 -0
  86. package/dist/components/table.js +42 -29
  87. package/dist/components/tabs.js +29 -29
  88. package/dist/components/tag.js +9 -8
  89. package/dist/components/tags-input.js +24 -22
  90. package/dist/components/textarea.js +34 -32
  91. package/dist/components/toast.d.ts +19 -2
  92. package/dist/components/toast.js +43 -10
  93. package/dist/components/toggle-group.js +16 -15
  94. package/dist/components/toggle.js +1 -1
  95. package/dist/components/tooltip.js +3 -3
  96. package/dist/components.json +15 -13
  97. package/dist/custom-elements.json +320 -88
  98. package/dist/dev/types.d.ts +3 -1
  99. package/dist/dev.js +85 -16
  100. package/dist/index.js +1 -1
  101. package/dist/keyboard.d.ts +10 -0
  102. package/dist/llms.txt +1 -1
  103. package/dist/parts.d.ts +5 -0
  104. package/dist/projection-api.d.ts +23 -0
  105. package/dist/projection.d.ts +8 -2
  106. package/dist/reference.md +84 -59
  107. package/dist/types/elements.d.ts +13 -13
  108. package/dist/types/react.d.ts +2 -2
  109. package/dist/types/solid.d.ts +2 -2
  110. package/dist/types/svelte.d.ts +2 -2
  111. package/dist/types/vue.d.ts +2 -2
  112. package/dist/vscode.html-custom-data.json +108 -28
  113. package/dist/web-types.json +189 -60
  114. package/package.json +1 -1
@@ -1,12 +1,14 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-CMQQop0D.js";
4
- import { html as r, nothing as i } from "lit";
5
- import { property as a } from "lit/decorators.js";
3
+ import { r as n } from "../chunks/projection-oPe6ipjL.js";
4
+ import { n as r } from "../chunks/parts-DI_3VpSy.js";
5
+ import { html as i, nothing as a } from "lit";
6
+ import { property as o } from "lit/decorators.js";
6
7
  //#region src/components/select.ts
7
- var o = class t extends e {
8
+ n();
9
+ var s = class t extends e {
8
10
  constructor(...e) {
9
- super(...e), this.size = "md", this.error = "", this._choice = null, this._pending = !1, this._serverSelection = null, this._initial = null, this._parts = new n(this, {
11
+ super(...e), this.size = "md", this.error = "", this._choice = null, this._pending = !1, this._serverSelection = null, this._initial = null, this._parts = new r(this, {
10
12
  tags: [
11
13
  "select",
12
14
  "option",
@@ -18,7 +20,7 @@ var o = class t extends e {
18
20
  if (!t || e.target !== t) return;
19
21
  this._pendingReset = null;
20
22
  let n = this.value;
21
- this._choice = g(t), this._pending = !1, this._changed(n);
23
+ this._choice = _(t), this._pending = !1, this._changed(n);
22
24
  }, this._onChange = (e) => {
23
25
  e.target === this.select && (this._onPick(e), this.dispatchEvent(new CustomEvent("void-change", {
24
26
  bubbles: !0,
@@ -26,14 +28,14 @@ var o = class t extends e {
26
28
  detail: { value: this.value }
27
29
  })));
28
30
  }, this._observer = null, this._observed = null, this._onMutations = (e) => {
29
- this._morphQueued || !this.isConnected || this._reconcile(u(e) ? "mutation" : "none", e);
31
+ this._morphQueued || !this.isConnected || this._reconcile(d(e) ? "mutation" : "none", e);
30
32
  }, this._form = null, this._onFormData = (e) => {
31
33
  let t = this.select;
32
34
  if (!t || t.form !== e.target) return;
33
- let n = _(t);
35
+ let n = v(t);
34
36
  if (this._flush(), this._apply(), !t.name) return;
35
- let r = _(t);
36
- if (c(n, r)) return;
37
+ let r = v(t);
38
+ if (l(n, r)) return;
37
39
  let i = e.formData.getAll(t.name);
38
40
  for (let e of n) {
39
41
  let t = i.indexOf(e);
@@ -64,7 +66,7 @@ var o = class t extends e {
64
66
  let t = this.value;
65
67
  if (e == null) {
66
68
  let e = this.select;
67
- this._choice = e ? m(e) : null, this._pending = !1;
69
+ this._choice = e ? h(e) : null, this._pending = !1;
68
70
  } else this._choice = [String(e)], this._pending = !0;
69
71
  this._apply(), this.requestUpdate("value", t);
70
72
  }
@@ -91,32 +93,32 @@ var o = class t extends e {
91
93
  }
92
94
  _wire() {
93
95
  let e = this.select, t = !!e && !!this._observed && e !== this._observed, n = this._observer?.takeRecords() ?? [];
94
- this._observe(e), e && (this._markInvalid(e), this._watchForm(e.form), !this._morphQueued && (this._serverSelection === null ? this._serverSelection = f(e) : t && this._serverMarked(e), this._reconcile(t || u(n) ? "mutation" : "none", n)));
96
+ this._observe(e), e && (this._markInvalid(e), this._watchForm(e.form), !this._morphQueued && (this._serverSelection === null ? this._serverSelection = p(e) : t && this._serverMarked(e), this._reconcile(t || d(n) ? "mutation" : "none", n)));
95
97
  }
96
98
  _reconcile(e, t = []) {
97
99
  let n = this.select;
98
100
  if (!n) return;
99
- this._finishReset(), e === "mutation" && d(t) && this._serverMarked(n);
101
+ this._finishReset(), e === "mutation" && f(t) && this._serverMarked(n);
100
102
  let r = this.value, i = this._choice;
101
- if (i === null || !this._pending && !n.multiple && i.length === 0) n.options.length && (this._choice = g(n));
102
- else if (e !== "morph" && !this._pending && i.every((e) => s(n, e))) {
103
- let t = g(n), r = e === "mutation" && c(t, m(n));
104
- t.length && !r && !c(t, i) && (this._choice = t);
103
+ if (i === null || !this._pending && !n.multiple && i.length === 0) n.options.length && (this._choice = _(n));
104
+ else if (e !== "morph" && !this._pending && i.every((e) => c(n, e))) {
105
+ let t = _(n), r = e === "mutation" && l(t, h(n));
106
+ t.length && !r && !l(t, i) && (this._choice = t);
105
107
  }
106
108
  this._apply(), this._changed(r);
107
109
  }
108
110
  _flush() {
109
111
  if (this._morphQueued || !this.select) return;
110
112
  let e = this._observer?.takeRecords() ?? [];
111
- this._reconcile(u(e) ? "mutation" : "none", e);
113
+ this._reconcile(d(e) ? "mutation" : "none", e);
112
114
  }
113
115
  _apply() {
114
116
  let e = this.select, t = this._choice;
115
117
  if (!e || !t) return;
116
- if (!t.every((t) => s(e, t))) {
118
+ if (!t.every((t) => c(e, t))) {
117
119
  if (this._pending) return;
118
120
  let t = this.value;
119
- this._choice = g(e), this._changed(t);
121
+ this._choice = _(e), this._changed(t);
120
122
  return;
121
123
  }
122
124
  if (this._pending = !1, !e.multiple) {
@@ -135,7 +137,7 @@ var o = class t extends e {
135
137
  this.error ? (e.getAttribute("aria-invalid") !== "true" && e.setAttribute("aria-invalid", "true"), this._invalid = e) : this._invalid &&= (this._invalid.getAttribute("aria-invalid") === "true" && !this._invalid.hasAttribute("data-void-field-invalid") && this._invalid.removeAttribute("aria-invalid"), null);
136
138
  }
137
139
  render() {
138
- return this.error ? r`<span class="void-select-error">${this.error}</span>` : i;
140
+ return this.error ? i`<span class="void-select-error">${this.error}</span>` : a;
139
141
  }
140
142
  _observe(e) {
141
143
  e !== this._observed && (this._observer?.disconnect(), this._observed = e, e && (this._observer ??= new MutationObserver(this._onMutations), this._observer.observe(e, {
@@ -146,7 +148,7 @@ var o = class t extends e {
146
148
  })));
147
149
  }
148
150
  _serverMarked(e) {
149
- let t = f(e);
151
+ let t = p(e);
150
152
  if (t === this._serverSelection || (this._serverSelection = t, this._pending)) return;
151
153
  let n = JSON.parse(t);
152
154
  if (!n.length) return;
@@ -163,12 +165,12 @@ var o = class t extends e {
163
165
  let t = this.select;
164
166
  if (e.defaultPrevented || !t || !this.isConnected) return;
165
167
  let n = this.value;
166
- this._initial === null ? (this._choice = m(t), this._pending = !1) : (this._choice = [this._initial], this._pending = !0), this._apply(), this._changed(n);
168
+ this._initial === null ? (this._choice = h(t), this._pending = !1) : (this._choice = [this._initial], this._pending = !0), this._apply(), this._changed(n);
167
169
  }
168
170
  voidBeforeMorph(e) {
169
171
  if (e && e !== this) {
170
172
  this._flush();
171
- let n = e instanceof t ? e._serverSelection : null, r = n ?? p(e), i = n === null && e instanceof t && !!this.select && r === f(this.select);
173
+ let n = e instanceof t ? e._serverSelection : null, r = n ?? m(e), i = n === null && e instanceof t && !!this.select && r === p(this.select);
172
174
  if (r !== null && !i) {
173
175
  let e = this._serverSelection !== null && r !== this._serverSelection;
174
176
  this._serverSelection = r;
@@ -183,57 +185,57 @@ var o = class t extends e {
183
185
  return super.voidBeforeMorph(e);
184
186
  }
185
187
  };
186
- t([a({
188
+ t([o({
187
189
  type: String,
188
190
  reflect: !0
189
- })], o.prototype, "size", void 0), t([a({
191
+ })], s.prototype, "size", void 0), t([o({
190
192
  type: String,
191
193
  reflect: !0
192
- })], o.prototype, "error", void 0), t([a({
194
+ })], s.prototype, "error", void 0), t([o({
193
195
  type: String,
194
196
  reflect: !0
195
- })], o.prototype, "value", null);
196
- function s(e, t) {
197
+ })], s.prototype, "value", null);
198
+ function c(e, t) {
197
199
  for (let n of Array.from(e.options)) if (n.value === t) return !0;
198
200
  return !1;
199
201
  }
200
- function c(e, t) {
202
+ function l(e, t) {
201
203
  return e.length === t.length && e.every((e, n) => e === t[n]);
202
204
  }
203
- function l(e) {
205
+ function u(e) {
204
206
  return e.nodeName === "OPTION" || e.nodeName === "OPTGROUP";
205
207
  }
206
- function u(e) {
208
+ function d(e) {
207
209
  return e.some((e) => e.type === "attributes" ? e.attributeName === "selected" || e.attributeName === "multiple" : !0);
208
210
  }
209
- function d(e) {
211
+ function f(e) {
210
212
  let t = !1, n = !1;
211
- for (let r of e) r.type === "childList" && (t ||= Array.from(r.removedNodes).some(l), n ||= Array.from(r.addedNodes).some(l));
213
+ for (let r of e) r.type === "childList" && (t ||= Array.from(r.removedNodes).some(u), n ||= Array.from(r.addedNodes).some(u));
212
214
  return t && n;
213
215
  }
214
- function f(e) {
216
+ function p(e) {
215
217
  return JSON.stringify(Array.from(e.querySelectorAll("option[selected]"), (e) => e.value));
216
218
  }
217
- function p(e) {
219
+ function m(e) {
218
220
  let t = e.querySelector("select");
219
- return t ? f(t) : null;
221
+ return t ? p(t) : null;
220
222
  }
221
- function m(e) {
222
- let t = JSON.parse(f(e));
223
+ function h(e) {
224
+ let t = JSON.parse(p(e));
223
225
  if (e.multiple) return t;
224
226
  if (t.length) return [t[t.length - 1]];
225
227
  let n = Array.from(e.options).find((e) => !e.disabled);
226
228
  return n ? [n.value] : [];
227
229
  }
228
- function h(e) {
229
- return Array.from(e.options).filter((e) => e.selected);
230
- }
231
230
  function g(e) {
232
- return h(e).map((e) => e.value);
231
+ return Array.from(e.options).filter((e) => e.selected);
233
232
  }
234
233
  function _(e) {
235
- return !e.name || e.matches(":disabled") ? [] : h(e).filter((e) => !e.matches(":disabled")).map((e) => e.value);
234
+ return g(e).map((e) => e.value);
235
+ }
236
+ function v(e) {
237
+ return !e.name || e.matches(":disabled") ? [] : g(e).filter((e) => !e.matches(":disabled")).map((e) => e.value);
236
238
  }
237
- customElements.get("void-select") || customElements.define("void-select", o);
239
+ customElements.get("void-select") || customElements.define("void-select", s);
238
240
  //#endregion
239
- export { o as VoidSelect };
241
+ export { s as VoidSelect };
@@ -16,8 +16,8 @@ export declare class VoidSidebar extends VoidElement {
16
16
  width: string;
17
17
  /** CSS width when collapsed. Defaults to the theme's `--void-sidebar-collapsed-width`. */
18
18
  collapsedWidth: string;
19
- /** Which edge of the page the sidebar sits on: `left` (default) or `right`. */
20
- side: 'left' | 'right';
19
+ /** Which side of the content the sidebar sits on, in the reading direction: `start` (default) or `end`. */
20
+ side: 'start' | 'end';
21
21
  /**
22
22
  * Collapses or expands the sidebar on behalf of the user (call it from the
23
23
  * control that toggles it, such as a `void-hamburger`) and dispatches
@@ -1,10 +1,10 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  //#region src/components/sidebar.ts
5
5
  var r = class extends e {
6
6
  constructor(...e) {
7
- super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.side = "left";
7
+ super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.side = "start";
8
8
  }
9
9
  toggle(e) {
10
10
  let t = e ?? !this.collapsed;
@@ -1,4 +1,4 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  //#region src/components/skeleton.ts
@@ -1,10 +1,12 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { n } from "../chunks/form-control-C0vH6gii.js";
4
- import { html as r, nothing as i } from "lit";
5
- import { property as a } from "lit/decorators.js";
4
+ import { r } from "../chunks/projection-oPe6ipjL.js";
5
+ import { html as i, nothing as a } from "lit";
6
+ import { property as o } from "lit/decorators.js";
6
7
  //#region src/components/slider.ts
7
- var o = class extends n(e) {
8
+ r();
9
+ var s = class extends n(e) {
8
10
  constructor(...e) {
9
11
  super(...e), this.value = 50, this.min = 0, this.max = 100, this.step = 1, this.disabled = !1, this.name = "", this.showValue = !1, this.size = "md";
10
12
  }
@@ -44,7 +46,7 @@ var o = class extends n(e) {
44
46
  }
45
47
  render() {
46
48
  let e = this._fill();
47
- return r`
49
+ return i`
48
50
  <input
49
51
  type="range"
50
52
  .value=${String(this.value)}
@@ -53,31 +55,31 @@ var o = class extends n(e) {
53
55
  step=${this.step}
54
56
  ?disabled=${this.disabled}
55
57
  name=${this.name}
56
- form=${this.formAttr ?? i}
58
+ form=${this.formAttr ?? a}
57
59
  style="--void-slider-fill: ${e}%"
58
60
  @input=${this._onInput}
59
61
  @change=${this._onChange}
60
62
  />
61
- ${this.showValue ? r`<span class="void-slider-value">${this.value}</span>` : ""}
63
+ ${this.showValue ? i`<span class="void-slider-value">${this.value}</span>` : ""}
62
64
  `;
63
65
  }
64
66
  };
65
- t([a({
67
+ t([o({
66
68
  type: Number,
67
69
  reflect: !0
68
- })], o.prototype, "value", void 0), t([a({ type: Number })], o.prototype, "min", void 0), t([a({ type: Number })], o.prototype, "max", void 0), t([a({ type: Number })], o.prototype, "step", void 0), t([a({
70
+ })], s.prototype, "value", void 0), t([o({ type: Number })], s.prototype, "min", void 0), t([o({ type: Number })], s.prototype, "max", void 0), t([o({ type: Number })], s.prototype, "step", void 0), t([o({
69
71
  type: Boolean,
70
72
  reflect: !0
71
- })], o.prototype, "disabled", void 0), t([a({
73
+ })], s.prototype, "disabled", void 0), t([o({
72
74
  type: String,
73
75
  reflect: !0
74
- })], o.prototype, "name", void 0), t([a({
76
+ })], s.prototype, "name", void 0), t([o({
75
77
  type: Boolean,
76
78
  attribute: "show-value",
77
79
  reflect: !0
78
- })], o.prototype, "showValue", void 0), t([a({
80
+ })], s.prototype, "showValue", void 0), t([o({
79
81
  type: String,
80
82
  reflect: !0
81
- })], o.prototype, "size", void 0), customElements.get("void-slider") || customElements.define("void-slider", o);
83
+ })], s.prototype, "size", void 0), customElements.get("void-slider") || customElements.define("void-slider", s);
82
84
  //#endregion
83
- export { o as VoidSlider };
85
+ export { s as VoidSlider };
@@ -1,9 +1,11 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { html as n } from "lit";
4
- import { property as r } from "lit/decorators.js";
3
+ import { r as n } from "../chunks/projection-oPe6ipjL.js";
4
+ import { html as r } from "lit";
5
+ import { property as i } from "lit/decorators.js";
5
6
  //#region src/components/spinner.ts
6
- var i = class extends e {
7
+ n();
8
+ var a = class extends e {
7
9
  constructor(...e) {
8
10
  super(...e), this.size = "md", this.label = "Loading";
9
11
  }
@@ -14,15 +16,15 @@ var i = class extends e {
14
16
  e.has("label") && this.setHostAttribute("aria-label", this.label);
15
17
  }
16
18
  render() {
17
- return n`<span data-void-sr>${this.label}</span>`;
19
+ return r`<span data-void-sr>${this.label}</span>`;
18
20
  }
19
21
  };
20
- t([r({
22
+ t([i({
21
23
  type: String,
22
24
  reflect: !0
23
- })], i.prototype, "size", void 0), t([r({
25
+ })], a.prototype, "size", void 0), t([i({
24
26
  type: String,
25
27
  reflect: !0
26
- })], i.prototype, "label", void 0), customElements.get("void-spinner") || customElements.define("void-spinner", i);
28
+ })], a.prototype, "label", void 0), customElements.get("void-spinner") || customElements.define("void-spinner", a);
27
29
  //#endregion
28
- export { i as VoidSpinner };
30
+ export { a as VoidSpinner };
@@ -1,5 +1,9 @@
1
1
  import { VoidElement } from '../base.js';
2
- /** Key metric display for analytics dashboards and KPI summaries with label, value, delta, and trend. */
2
+ /**
3
+ * Key metric display for analytics dashboards and KPI summaries with label, value, delta, and trend.
4
+ *
5
+ * With a `label` it is a `group` named by the label; without one it has no role.
6
+ */
3
7
  export declare class VoidStat extends VoidElement {
4
8
  /** Small caption above the value, such as `Active users`. */
5
9
  label: string;
@@ -25,7 +29,15 @@ export declare class VoidStat extends VoidElement {
25
29
  color: 'default' | 'error' | 'warning' | 'caution' | 'success' | 'info' | 'notice' | 'highlight';
26
30
  /** Size step: `sm`, `md` (default) or `lg`. */
27
31
  size: 'sm' | 'md' | 'lg';
32
+ private readonly _labelId;
28
33
  connectedCallback(): void;
34
+ protected updated(changed: Map<string, unknown>): void;
35
+ /**
36
+ * A stat with a `label` is a `group` named by it, so a reader hears "Revenue, group" and then the figures;
37
+ * without a label it is plain text and has no role. A role or name the author wrote is kept.
38
+ */
39
+ private _syncName;
40
+ private _writtenRole;
29
41
  render(): import('lit').TemplateResult<1>;
30
42
  }
31
43
  declare global {
@@ -1,45 +1,55 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { html as n } from "lit";
4
- import { property as r } from "lit/decorators.js";
3
+ import { r as n } from "../chunks/projection-oPe6ipjL.js";
4
+ import { o as r } from "../chunks/keyboard-CEhMSkws.js";
5
+ import { html as i } from "lit";
6
+ import { property as a } from "lit/decorators.js";
5
7
  //#region src/components/stat.ts
6
- var i = class extends e {
8
+ n();
9
+ var o = class extends e {
7
10
  constructor(...e) {
8
- super(...e), this.label = "", this.value = "", this.delta = "", this.description = "", this.trend = null, this.color = "default", this.size = "md";
11
+ super(...e), this.label = "", this.value = "", this.delta = "", this.description = "", this.trend = null, this.color = "default", this.size = "md", this._labelId = r("void-stat-label"), this._writtenRole = null;
9
12
  }
10
13
  connectedCallback() {
11
- super.connectedCallback(), this.setHostAttribute("role", "figure");
14
+ super.connectedCallback(), this._syncName();
15
+ }
16
+ updated(e) {
17
+ super.updated(e), e.has("label") && this._syncName();
18
+ }
19
+ _syncName() {
20
+ let e = this.getAttribute("role");
21
+ (e === null || e === this._writtenRole) && (this._writtenRole = this.label ? "group" : null, this.setHostAttribute("role", this._writtenRole)), !this.hasAttribute("aria-label") && (!this.hasAttribute("aria-labelledby") || this.getAttribute("aria-labelledby") === this._labelId) && this.setHostAttribute("aria-labelledby", this.label ? this._labelId : null);
12
22
  }
13
23
  render() {
14
- return n`
15
- ${this.label ? n`<span class="void-stat-label">${this.label}</span>` : ""}
24
+ return i`
25
+ ${this.label ? i`<span class="void-stat-label" id=${this._labelId}>${this.label}</span>` : ""}
16
26
  <span class="void-stat-value">${this.value}</span>
17
- ${this.delta ? n`<span class="void-stat-delta">${this.delta}</span>` : ""}
18
- ${this.description ? n`<span class="void-stat-description">${this.description}</span>` : ""}
27
+ ${this.delta ? i`<span class="void-stat-delta">${this.delta}</span>` : ""}
28
+ ${this.description ? i`<span class="void-stat-description">${this.description}</span>` : ""}
19
29
  `;
20
30
  }
21
31
  };
22
- t([r({
32
+ t([a({
23
33
  type: String,
24
34
  reflect: !0
25
- })], i.prototype, "label", void 0), t([r({
35
+ })], o.prototype, "label", void 0), t([a({
26
36
  type: String,
27
37
  reflect: !0
28
- })], i.prototype, "value", void 0), t([r({
38
+ })], o.prototype, "value", void 0), t([a({
29
39
  type: String,
30
40
  reflect: !0
31
- })], i.prototype, "delta", void 0), t([r({
41
+ })], o.prototype, "delta", void 0), t([a({
32
42
  type: String,
33
43
  reflect: !0
34
- })], i.prototype, "description", void 0), t([r({
44
+ })], o.prototype, "description", void 0), t([a({
35
45
  type: String,
36
46
  reflect: !0
37
- })], i.prototype, "trend", void 0), t([r({
47
+ })], o.prototype, "trend", void 0), t([a({
38
48
  type: String,
39
49
  reflect: !0
40
- })], i.prototype, "color", void 0), t([r({
50
+ })], o.prototype, "color", void 0), t([a({
41
51
  type: String,
42
52
  reflect: !0
43
- })], i.prototype, "size", void 0), customElements.get("void-stat") || customElements.define("void-stat", i);
53
+ })], o.prototype, "size", void 0), customElements.get("void-stat") || customElements.define("void-stat", o);
44
54
  //#endregion
45
- export { i as VoidStat };
55
+ export { o as VoidStat };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  //#region src/components/status-dot.ts
@@ -1,9 +1,11 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { html as n, nothing as r } from "lit";
4
- import { property as i } from "lit/decorators.js";
3
+ import { r as n } from "../chunks/projection-oPe6ipjL.js";
4
+ import { html as r, nothing as i } from "lit";
5
+ import { property as a } from "lit/decorators.js";
5
6
  //#region src/components/stepper.ts
6
- var a = class extends e {
7
+ n();
8
+ var o = class extends e {
7
9
  constructor(...e) {
8
10
  super(...e), this.value = 0, this.steps = "";
9
11
  }
@@ -11,15 +13,15 @@ var a = class extends e {
11
13
  super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.setHostAttribute("aria-label", "Progress");
12
14
  }
13
15
  render() {
14
- return n`${this.steps.split(",").map((e) => e.trim()).filter(Boolean).map((e, t) => {
15
- let i = t < this.value ? "completed" : t === this.value ? "active" : "upcoming";
16
- return n`${t > 0 ? n`<div class="void-stepper-connector" data-state=${t <= this.value ? "completed" : "upcoming"}></div>` : null}<div
16
+ return r`${this.steps.split(",").map((e) => e.trim()).filter(Boolean).map((e, t) => {
17
+ let n = t < this.value ? "completed" : t === this.value ? "active" : "upcoming";
18
+ return r`${t > 0 ? r`<div class="void-stepper-connector" data-state=${t <= this.value ? "completed" : "upcoming"}></div>` : null}<div
17
19
  class="void-stepper-step"
18
- data-state=${i}
19
- aria-current=${t === this.value ? "step" : r}
20
+ data-state=${n}
21
+ aria-current=${t === this.value ? "step" : i}
20
22
  >
21
23
  <span class="void-stepper-circle"
22
- >${i === "completed" ? n`<svg
24
+ >${n === "completed" ? r`<svg
23
25
  viewBox="0 0 12 12"
24
26
  width="1em"
25
27
  height="1em"
@@ -37,9 +39,9 @@ var a = class extends e {
37
39
  })}`;
38
40
  }
39
41
  };
40
- t([i({
42
+ t([a({
41
43
  type: Number,
42
44
  reflect: !0
43
- })], a.prototype, "value", void 0), t([i({ reflect: !0 })], a.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", a);
45
+ })], o.prototype, "value", void 0), t([a({ reflect: !0 })], o.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", o);
44
46
  //#endregion
45
- export { a as VoidStepper };
47
+ export { o as VoidStepper };
@@ -1,11 +1,13 @@
1
- import { t as e } from "../chunks/base-CMruMbxC.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
4
4
  import { t as r } from "../chunks/form-control-C0vH6gii.js";
5
- import { html as i } from "lit";
6
- import { property as a } from "lit/decorators.js";
5
+ import { r as i } from "../chunks/projection-oPe6ipjL.js";
6
+ import { html as a } from "lit";
7
+ import { property as o } from "lit/decorators.js";
7
8
  //#region src/components/switch.ts
8
- var o = class extends r(e) {
9
+ i();
10
+ var s = class extends r(e) {
9
11
  constructor(...e) {
10
12
  super(...e), this._activation = new n(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.value = "on", this.color = "default", this.size = "md", this._handleClick = () => {
11
13
  this.formDisabled || (this.checked = !this.checked, this.dispatchEvent(new CustomEvent("void-change", {
@@ -40,24 +42,24 @@ var o = class extends r(e) {
40
42
  this.checked = !!e;
41
43
  }
42
44
  render() {
43
- return i`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
45
+ return a`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
44
46
  }
45
47
  };
46
- t([a({
48
+ t([o({
47
49
  type: Boolean,
48
50
  reflect: !0
49
- })], o.prototype, "checked", void 0), t([a({
51
+ })], s.prototype, "checked", void 0), t([o({
50
52
  type: Boolean,
51
53
  reflect: !0
52
- })], o.prototype, "disabled", void 0), t([a({
54
+ })], s.prototype, "disabled", void 0), t([o({
53
55
  type: String,
54
56
  reflect: !0
55
- })], o.prototype, "value", void 0), t([a({
57
+ })], s.prototype, "value", void 0), t([o({
56
58
  type: String,
57
59
  reflect: !0
58
- })], o.prototype, "color", void 0), t([a({
60
+ })], s.prototype, "color", void 0), t([o({
59
61
  type: String,
60
62
  reflect: !0
61
- })], o.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", o);
63
+ })], s.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", s);
62
64
  //#endregion
63
- export { o as VoidSwitch };
65
+ export { s as VoidSwitch };
@@ -14,6 +14,10 @@ import { VoidElement } from '../base.js';
14
14
  * `data-align="end"` on a header cell right-aligns a numeric column. Because browsers can drop table
15
15
  * semantics when `display` changes, a table with `stack` carries explicit table, row and cell roles.
16
16
  *
17
+ * **Name.** A table needs a name: write a `<caption>` (the caption part; it can be visually hidden), or an
18
+ * `aria-label` (or `label`) on the `<void-table>`, which the component copies onto the native `<table>`. `voidable check`
19
+ * reports a `<void-table>` with neither (rule `missing-name`).
20
+ *
17
21
  * **Overflow.** Nothing is clipped by default, so a menu, popover or tooltip opened from a cell is
18
22
  * always fully visible. `scrollable` makes the table its own horizontal scroll region: it is
19
23
  * focusable and labelled (`label`, else the `<caption>`, else `aria-label`) only while it actually