@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,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/table.ts
@@ -19,7 +19,7 @@ function s(e) {
19
19
  }
20
20
  var c = class extends e {
21
21
  constructor(...e) {
22
- super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1, this.inset = !1, this.stack = null, this.scrollable = !1, this.stickyHeader = !1, this.stickyColumn = !1, this.maxHeight = null, this.label = null, this.#e = null, this.#t = null, this.#n = !1, this.#r = /* @__PURE__ */ new WeakMap(), this.#i = /* @__PURE__ */ new WeakMap(), this.#a = /* @__PURE__ */ new WeakMap(), this.#o = null, this.#s = !1, this.#c = !1, this.#l = () => this.#v();
22
+ super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1, this.inset = !1, this.stack = null, this.scrollable = !1, this.stickyHeader = !1, this.stickyColumn = !1, this.maxHeight = null, this.label = null, this.#e = null, this.#t = null, this.#n = !1, this.#r = /* @__PURE__ */ new WeakMap(), this.#i = /* @__PURE__ */ new WeakMap(), this.#a = null, this.#o = /* @__PURE__ */ new WeakMap(), this.#s = /* @__PURE__ */ new WeakMap(), this.#c = null, this.#l = !1, this.#u = !1, this.#d = () => this.#x();
23
23
  }
24
24
  #e;
25
25
  #t;
@@ -30,8 +30,10 @@ var c = class extends e {
30
30
  #o;
31
31
  #s;
32
32
  #c;
33
+ #l;
34
+ #u;
33
35
  connectedCallback() {
34
- super.connectedCallback(), this.#e ??= new MutationObserver(() => this.#u()), this.#e.observe(this, {
36
+ super.connectedCallback(), this.#e ??= new MutationObserver(() => this.#f()), this.#e.observe(this, {
35
37
  childList: !0,
36
38
  subtree: !0,
37
39
  characterData: !0,
@@ -43,28 +45,31 @@ var c = class extends e {
43
45
  "role",
44
46
  "colspan"
45
47
  ]
46
- }), typeof ResizeObserver < "u" && (this.#t ??= new ResizeObserver(() => this.#u()), this.#t.observe(this)), this.addEventListener("scroll", this.#l, { passive: !0 }), this.#u();
48
+ }), this.#a ??= new MutationObserver(() => this.#f()), this.#a.observe(this, {
49
+ attributes: !0,
50
+ attributeFilter: ["aria-label"]
51
+ }), typeof ResizeObserver < "u" && (this.#t ??= new ResizeObserver(() => this.#f()), this.#t.observe(this)), this.addEventListener("scroll", this.#d, { passive: !0 }), this.#f();
47
52
  }
48
53
  disconnectedCallback() {
49
- super.disconnectedCallback(), this.#e?.disconnect(), this.#t?.disconnect(), this.removeEventListener("scroll", this.#l);
54
+ super.disconnectedCallback(), this.#e?.disconnect(), this.#a?.disconnect(), this.#t?.disconnect(), this.removeEventListener("scroll", this.#d);
50
55
  }
51
56
  updated(e) {
52
57
  super.updated(e), this.setHostStyle("--void-table-max-height", this.maxHeight || "");
53
58
  let t = (this.stack ?? "").trim();
54
- /^\d*\.?\d+(px|rem|em)$/.test(t) ? (this.setHostStyle("--void-table-stack-at", t), this.#c = !0) : this.#c &&= (this.setHostStyle("--void-table-stack-at", null), !1), this.#u();
59
+ /^\d*\.?\d+(px|rem|em)$/.test(t) ? (this.setHostStyle("--void-table-stack-at", t), this.#u = !0) : this.#u &&= (this.setHostStyle("--void-table-stack-at", null), !1), this.#f();
55
60
  }
56
- #l;
57
- #u() {
61
+ #d;
62
+ #f() {
58
63
  this.#n || (this.#n = !0, queueMicrotask(() => {
59
- this.#n = !1, this.isConnected && (this.#d(this.stack !== null), this.#g(), this.#e?.takeRecords());
64
+ this.#n = !1, this.isConnected && (this.#p(this.stack !== null), this.#y(), this.#e?.takeRecords());
60
65
  }));
61
66
  }
62
- #d(e) {
67
+ #p(e) {
63
68
  let t = !1, n = !1, a = 0;
64
69
  for (let i of this.querySelectorAll("table")) {
65
70
  if (i.closest("void-table") !== this) continue;
66
- e && this.#m(i);
67
- let c = this.#f(i), l = [];
71
+ this.#m(i), e && this.#_(i);
72
+ let c = this.#h(i), l = [];
68
73
  if (c) for (let e of o(c)) {
69
74
  let i = {
70
75
  label: e.hasAttribute("data-label") ? e.getAttribute("data-label") ?? "" : (e.textContent ?? "").replace(/\s+/g, " ").trim(),
@@ -80,15 +85,15 @@ var c = class extends e {
80
85
  let e = c.querySelector("[data-controls]") !== null;
81
86
  e !== c.hasAttribute("data-controls") && c.toggleAttribute("data-controls", e);
82
87
  }
83
- if (e) for (let e of i.querySelectorAll(":scope > caption, :scope > thead, :scope > tbody, :scope > tfoot")) this.#m(e);
88
+ if (e) for (let e of i.querySelectorAll(":scope > caption, :scope > thead, :scope > tbody, :scope > tfoot")) this.#_(e);
84
89
  for (let t of Array.from(i.querySelectorAll("tr"))) {
85
90
  if (t.closest("table") !== i) continue;
86
- a++, e && this.#m(t);
91
+ a++, e && this.#_(t);
87
92
  let n = t.parentElement?.tagName === "THEAD" || t === c, r = 0;
88
93
  for (let i of o(t)) {
89
- if (e && (i.tagName === "TH" ? this.#m(i, n || i.getAttribute("scope") === "col" ? "columnheader" : "rowheader") : this.#m(i)), !n) {
94
+ if (e && (i.tagName === "TH" ? this.#_(i, n || i.getAttribute("scope") === "col" ? "columnheader" : "rowheader") : this.#_(i)), !n) {
90
95
  let t = l[r];
91
- t && (e && this.#p(i, "data-label", t.label, this.#r, !0), this.#p(i, "data-stack", t.stack, this.#i), this.#p(i, "data-align", t.align, this.#a));
96
+ t && (e && this.#g(i, "data-label", t.label, this.#r, !0), this.#g(i, "data-stack", t.stack, this.#o), this.#g(i, "data-align", t.align, this.#s));
92
97
  }
93
98
  r += s(i);
94
99
  }
@@ -96,38 +101,46 @@ var c = class extends e {
96
101
  }
97
102
  this.setHostAttribute("data-stack-title", t ? "" : null), this.setHostAttribute("data-stack-select", n ? "" : null), this.setHostAttribute("data-long", a > i ? "" : null);
98
103
  }
99
- #f(e) {
104
+ #m(e) {
105
+ let t = this.getAttribute("aria-label"), n = (t !== null && t !== this.#c && t.trim() !== "" ? t : null) ?? (this.label?.trim() ? this.label : null), r = e.getAttribute("aria-label"), i = this.#i.get(e), a = r !== null && r !== i || e.hasAttribute("aria-labelledby") || e.querySelector(":scope > caption") !== null;
106
+ if (n === null || a) {
107
+ i !== void 0 && r === i && e.removeAttribute("aria-label"), this.#i.delete(e);
108
+ return;
109
+ }
110
+ r !== n && e.setAttribute("aria-label", n), this.#i.set(e, n);
111
+ }
112
+ #h(e) {
100
113
  let t = e.querySelectorAll(":scope > thead > tr");
101
114
  if (t.length) return t[t.length - 1];
102
115
  let n = e.querySelector(":scope > tbody > tr, :scope > tr");
103
116
  return n && o(n).every((e) => e.tagName === "TH") ? n : null;
104
117
  }
105
- #p(e, t, n, r, i = !1) {
118
+ #g(e, t, n, r, i = !1) {
106
119
  let a = e.getAttribute(t), o = r.get(e);
107
120
  if (a !== null && a !== o) return;
108
121
  let s = n === null || !i && n === "" ? null : n;
109
122
  s === null ? (a !== null && e.removeAttribute(t), r.delete(e)) : (a !== s && e.setAttribute(t, s), r.set(e, s));
110
123
  }
111
- #m(e, t = a[e.tagName]) {
124
+ #_(e, t = a[e.tagName]) {
112
125
  t && (e.hasAttribute("role") || e.setAttribute("role", t));
113
126
  }
114
- get #h() {
127
+ get #v() {
115
128
  return this.scrollable && this.scrollWidth > this.clientWidth + 1;
116
129
  }
117
- #g() {
118
- let e = this.#h;
130
+ #y() {
131
+ let e = this.#v;
119
132
  if (this.setHostAttribute("data-overflowing", e ? "" : null), !e) {
120
- this.#_(), this.setHostAttribute("data-overflow-start", null), this.setHostAttribute("data-overflow-end", null);
133
+ this.#b(), this.setHostAttribute("data-overflow-start", null), this.setHostAttribute("data-overflow-end", null);
121
134
  return;
122
135
  }
123
- let t = this.getAttribute("aria-label"), n = t !== null && t !== this.#o, r = this.label || (n || this.hasAttribute("aria-labelledby") ? "" : (this.querySelector("caption")?.textContent ?? "").replace(/\s+/g, " ").trim());
124
- !r && !n && !this.hasAttribute("aria-labelledby") && !this.#s && (this.#s = !0, console.warn("<void-table scrollable>: the scroll region has no accessible name. Set label, aria-label or add a <caption>.", this)), this.setHostAttribute("tabindex", "0"), (!this.hasAttribute("role") || this.getAttribute("role") === "region") && this.setHostAttribute("role", "region"), r && !n && (this.setHostAttribute("aria-label", r), this.#o = r), this.#v();
136
+ let t = this.getAttribute("aria-label"), n = t !== null && t !== this.#c, r = this.label || (n || this.hasAttribute("aria-labelledby") ? "" : (this.querySelector("caption")?.textContent ?? "").replace(/\s+/g, " ").trim());
137
+ !r && !n && !this.hasAttribute("aria-labelledby") && !this.#l && (this.#l = !0, console.warn("<void-table scrollable>: the scroll region has no accessible name. Set label, aria-label or add a <caption>.", this)), this.setHostAttribute("tabindex", "0"), (!this.hasAttribute("role") || this.getAttribute("role") === "region") && this.setHostAttribute("role", "region"), r && !n && (this.setHostAttribute("aria-label", r), this.#c = r), this.#x();
125
138
  }
126
- #_() {
127
- this.setHostAttribute("tabindex", null), this.getAttribute("role") === "region" && this.setHostAttribute("role", null), this.#o !== null && (this.getAttribute("aria-label") === this.#o && this.setHostAttribute("aria-label", null), this.#o = null);
139
+ #b() {
140
+ this.setHostAttribute("tabindex", null), this.getAttribute("role") === "region" && this.setHostAttribute("role", null), this.#c !== null && (this.getAttribute("aria-label") === this.#c && this.setHostAttribute("aria-label", null), this.#c = null);
128
141
  }
129
- #v() {
130
- if (!this.#h) return;
142
+ #x() {
143
+ if (!this.#v) return;
131
144
  let e = this.scrollWidth - this.clientWidth, t = Math.abs(this.scrollLeft);
132
145
  this.setHostAttribute("data-overflow-start", t > 1 ? "" : null), this.setHostAttribute("data-overflow-end", t < e - 1 ? "" : null);
133
146
  }
@@ -1,16 +1,16 @@
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 { i as r, n as i } from "../chunks/keyboard-MQpfTX5I.js";
5
- import { property as a } from "lit/decorators.js";
3
+ import { n } from "../chunks/parts-DI_3VpSy.js";
4
+ import { a as r, n as i, r as a } from "../chunks/keyboard-CEhMSkws.js";
5
+ import { property as o } from "lit/decorators.js";
6
6
  //#region src/components/tabs.ts
7
- var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l = class extends e {
7
+ var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u = class extends e {
8
8
  constructor(...e) {
9
9
  super(...e), this.value = "", this.size = "md", this.activation = "manual", this._parts = new n(this, {
10
10
  tags: [
11
- o,
12
11
  s,
13
- c
12
+ c,
13
+ l
14
14
  ],
15
15
  onChange: () => this._wire()
16
16
  }), this._matchedValue = null, this._onClick = (e) => {
@@ -24,13 +24,13 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
24
24
  e.preventDefault(), this._select(t);
25
25
  return;
26
26
  }
27
- let n = this._triggers(), a = n.indexOf(t), o = n.map((e) => this._disabled(e)), s = -1;
28
- if (e.key === "ArrowRight") s = r(o, a, 1);
29
- else if (e.key === "ArrowLeft") s = r(o, a, -1);
30
- else if (e.key === "Home") s = i(o, 1);
31
- else if (e.key === "End") s = i(o, -1);
27
+ let n = this._triggers(), o = n.indexOf(t), s = n.map((e) => this._disabled(e)), c = -1, l = a(this);
28
+ if (e.key === l.next) c = r(s, o, 1);
29
+ else if (e.key === l.prev) c = r(s, o, -1);
30
+ else if (e.key === "Home") c = i(s, 1);
31
+ else if (e.key === "End") c = i(s, -1);
32
32
  else return;
33
- e.preventDefault(), !(s < 0) && (n[s].focus(), this.activation === "auto" && this._select(n[s]));
33
+ e.preventDefault(), !(c < 0) && (n[c].focus(), this.activation === "auto" && this._select(n[c]));
34
34
  };
35
35
  }
36
36
  connectedCallback() {
@@ -43,7 +43,7 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
43
43
  super.updated(e), e.has("value") && this._wire();
44
44
  }
45
45
  _triggers() {
46
- return this._parts.within(this._parts.one(o), s);
46
+ return this._parts.within(this._parts.one(s), c);
47
47
  }
48
48
  _disabled(e) {
49
49
  return e.hasAttribute("disabled");
@@ -61,22 +61,22 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
61
61
  this._matchedValue = null, t && (this.value = this._valueOf(t), this._matchedValue = this.value);
62
62
  }
63
63
  _wire() {
64
- let e = this._parts.one(o), t = this._triggers(), n = this._parts.all(c);
64
+ let e = this._parts.one(s), t = this._triggers(), n = this._parts.all(l);
65
65
  this._reconcileRemovedSelection(t), e && this._parts.set(e, "role", "tablist");
66
66
  let r = t.map((e) => this._disabled(e)), a = t.findIndex((e, t) => this._valueOf(e) === this.value && !r[t]);
67
67
  a < 0 && (a = i(r, 1));
68
- let s = /* @__PURE__ */ new Map();
69
- for (let e of n) s.has(this._valueOf(e)) || s.set(this._valueOf(e), e);
70
- let l = /* @__PURE__ */ new Map();
68
+ let o = /* @__PURE__ */ new Map();
69
+ for (let e of n) o.has(this._valueOf(e)) || o.set(this._valueOf(e), e);
70
+ let c = /* @__PURE__ */ new Map();
71
71
  t.forEach((e, t) => {
72
- let n = this._valueOf(e), i = n === this.value, o = this._parts.id(e, "void-tabs-trigger");
73
- l.has(n) || l.set(n, o);
74
- let c = s.get(n);
75
- this._parts.set(e, "role", "tab"), this._parts.set(e, "aria-selected", i ? "true" : "false"), this._parts.set(e, "active", i), this._parts.set(e, "tabindex", t === a ? "0" : "-1"), this._parts.set(e, "aria-disabled", r[t] ? "true" : null), this._parts.set(e, "aria-controls", c ? this._parts.id(c, "void-tabs-content") : null);
72
+ let n = this._valueOf(e), i = n === this.value, s = this._parts.id(e, "void-tabs-trigger");
73
+ c.has(n) || c.set(n, s);
74
+ let l = o.get(n);
75
+ this._parts.set(e, "role", "tab"), this._parts.set(e, "aria-selected", i ? "true" : "false"), this._parts.set(e, "active", i), this._parts.set(e, "tabindex", t === a ? "0" : "-1"), this._parts.set(e, "aria-disabled", r[t] ? "true" : null), this._parts.set(e, "aria-controls", l ? this._parts.id(l, "void-tabs-content") : null);
76
76
  });
77
77
  for (let e of n) {
78
78
  let t = this._valueOf(e), n = t === this.value;
79
- this._parts.id(e, "void-tabs-content"), this._parts.set(e, "role", "tabpanel"), this._parts.set(e, "active", n), this._parts.set(e, "tabindex", n ? "0" : null), this._parts.set(e, "aria-labelledby", l.get(t) ?? null);
79
+ this._parts.id(e, "void-tabs-content"), this._parts.set(e, "role", "tabpanel"), this._parts.set(e, "active", n), this._parts.set(e, "tabindex", n ? "0" : null), this._parts.set(e, "aria-labelledby", c.get(t) ?? null);
80
80
  }
81
81
  }
82
82
  _select(e) {
@@ -89,19 +89,19 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
89
89
  }));
90
90
  }
91
91
  _triggerOf(e) {
92
- let t = e instanceof Element ? e.closest(s) : null;
92
+ let t = e instanceof Element ? e.closest(c) : null;
93
93
  return t && this._parts.owns(t) ? t : null;
94
94
  }
95
95
  };
96
- t([a({
96
+ t([o({
97
97
  type: String,
98
98
  reflect: !0
99
- })], l.prototype, "value", void 0), t([a({
99
+ })], u.prototype, "value", void 0), t([o({
100
100
  type: String,
101
101
  reflect: !0
102
- })], l.prototype, "size", void 0), t([a({
102
+ })], u.prototype, "size", void 0), t([o({
103
103
  type: String,
104
104
  reflect: !0
105
- })], l.prototype, "activation", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", l);
105
+ })], u.prototype, "activation", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", u);
106
106
  //#endregion
107
- export { l as VoidTabs };
107
+ export { u as VoidTabs };
@@ -1,11 +1,12 @@
1
- import { n as e, t } from "../chunks/base-CMruMbxC.js";
2
- import { t as n } from "../chunks/decorate-CaYbmmmm.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
+ import { t } from "../chunks/decorate-CaYbmmmm.js";
3
+ import { t as n } from "../chunks/projection-oPe6ipjL.js";
3
4
  import { html as r, nothing as i } from "lit";
4
5
  import { property as a } from "lit/decorators.js";
5
6
  //#region src/components/tag.ts
6
- var o = class extends t {
7
- constructor(...t) {
8
- super(...t), this.color = "default", this.removable = !1, this.size = "md", this._projection = new e(this, { regions: [{
7
+ var o = class extends e {
8
+ constructor(...e) {
9
+ super(...e), this.color = "default", this.removable = !1, this.size = "md", this._projection = new n(this, { regions: [{
9
10
  name: "label",
10
11
  target: "before"
11
12
  }] });
@@ -25,13 +26,13 @@ var o = class extends t {
25
26
  })), this.remove();
26
27
  }
27
28
  };
28
- n([a({
29
+ t([a({
29
30
  type: String,
30
31
  reflect: !0
31
- })], o.prototype, "color", void 0), n([a({
32
+ })], o.prototype, "color", void 0), t([a({
32
33
  type: Boolean,
33
34
  reflect: !0
34
- })], o.prototype, "removable", void 0), n([a({
35
+ })], o.prototype, "removable", void 0), t([a({
35
36
  type: String,
36
37
  reflect: !0
37
38
  })], o.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", o);
@@ -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/form-control-C0vH6gii.js";
4
- import { t as r } from "../chunks/value-list-CH6GjYXM.js";
5
- import { html as i, nothing as a } from "lit";
6
- import { property as o } from "lit/decorators.js";
4
+ import { r } from "../chunks/projection-oPe6ipjL.js";
5
+ import { t as i } from "../chunks/value-list-CH6GjYXM.js";
6
+ import { html as a, nothing as o } from "lit";
7
+ import { property as s } from "lit/decorators.js";
7
8
  //#region src/components/tags-input.ts
8
- var s = class extends n(e) {
9
+ r();
10
+ var c = class extends n(e) {
9
11
  constructor(...e) {
10
12
  super(...e), this.value = [], this.disabled = !1, this.readonly = !1, this.max = Infinity, this.placeholder = "Add tag...", this.size = "md", this.color = "default", this.variant = "outline", this.allowDuplicates = !1;
11
13
  }
@@ -27,25 +29,25 @@ var s = class extends n(e) {
27
29
  }
28
30
  render() {
29
31
  let e = this.value.length >= this.max;
30
- return i`
32
+ return a`
31
33
  <div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
32
34
  ${this.value.map((e, t) => {
33
35
  let n = this._tagText(e);
34
- return i`
35
- <span class="void-tags-input-tag" data-color=${this._tagColor(e) || a}>
36
+ return a`
37
+ <span class="void-tags-input-tag" data-color=${this._tagColor(e) || o}>
36
38
  <span class="void-tags-input-tag-text">${n}</span>
37
- ${!this.disabled && !this.readonly ? i`<button
39
+ ${!this.disabled && !this.readonly ? a`<button
38
40
  type="button"
39
41
  class="void-tags-input-tag-remove"
40
42
  aria-label="Remove ${n}"
41
43
  @click=${(e) => {
42
44
  e.stopPropagation(), this._removeTag(t);
43
45
  }}
44
- >×</button>` : a}
46
+ >×</button>` : o}
45
47
  </span>
46
48
  `;
47
49
  })}
48
- ${!e && !this.readonly ? i`<input
50
+ ${!e && !this.readonly ? a`<input
49
51
  class="void-tags-input-field"
50
52
  type="text"
51
53
  placeholder=${this.value.length === 0 ? this.placeholder : ""}
@@ -53,7 +55,7 @@ var s = class extends n(e) {
53
55
  @keydown=${this._onKeydown}
54
56
  @input=${this._onFieldInput}
55
57
  @paste=${this._onPaste}
56
- />` : a}
58
+ />` : o}
57
59
  </div>
58
60
  `;
59
61
  }
@@ -97,27 +99,27 @@ var s = class extends n(e) {
97
99
  }));
98
100
  }
99
101
  };
100
- t([o({
101
- converter: r,
102
+ t([s({
103
+ converter: i,
102
104
  reflect: !0
103
- })], s.prototype, "value", void 0), t([o({
105
+ })], c.prototype, "value", void 0), t([s({
104
106
  type: Boolean,
105
107
  reflect: !0
106
- })], s.prototype, "disabled", void 0), t([o({
108
+ })], c.prototype, "disabled", void 0), t([s({
107
109
  type: Boolean,
108
110
  reflect: !0
109
- })], s.prototype, "readonly", void 0), t([o({ type: Number })], s.prototype, "max", void 0), t([o({ type: String })], s.prototype, "placeholder", void 0), t([o({
111
+ })], c.prototype, "readonly", void 0), t([s({ type: Number })], c.prototype, "max", void 0), t([s({ type: String })], c.prototype, "placeholder", void 0), t([s({
110
112
  type: String,
111
113
  reflect: !0
112
- })], s.prototype, "size", void 0), t([o({
114
+ })], c.prototype, "size", void 0), t([s({
113
115
  type: String,
114
116
  reflect: !0
115
- })], s.prototype, "color", void 0), t([o({
117
+ })], c.prototype, "color", void 0), t([s({
116
118
  type: String,
117
119
  reflect: !0
118
- })], s.prototype, "variant", void 0), t([o({
120
+ })], c.prototype, "variant", void 0), t([s({
119
121
  type: Boolean,
120
122
  attribute: "allow-duplicates"
121
- })], s.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", s);
123
+ })], c.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", c);
122
124
  //#endregion
123
- export { s as VoidTagsInput };
125
+ export { c as VoidTagsInput };
@@ -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 { 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";
6
- import { live as o } from "lit/directives/live.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";
7
+ import { live as s } from "lit/directives/live.js";
7
8
  //#region src/components/textarea.ts
8
- var s = class extends n(e) {
9
+ r();
10
+ var c = class extends n(e) {
9
11
  constructor(...e) {
10
12
  super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.rows = 3, this.resize = "vertical", this.size = "md", this.error = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null;
11
13
  }
@@ -16,29 +18,29 @@ var s = class extends n(e) {
16
18
  this.editState = ["value"];
17
19
  }
18
20
  render() {
19
- return r`
21
+ return i`
20
22
  <textarea
21
- .value=${o(this.value)}
23
+ .value=${s(this.value)}
22
24
  placeholder=${this.placeholder}
23
25
  ?disabled=${this.disabled}
24
26
  ?readonly=${this.readonly}
25
27
  ?required=${this.required}
26
28
  name=${this.name}
27
- autocomplete=${this.autocomplete || i}
28
- minlength=${this.minlength ?? i}
29
- maxlength=${this.maxlength ?? i}
30
- inputmode=${this.inputMode || i}
31
- enterkeyhint=${this.enterKeyHint || i}
32
- autocapitalize=${this.autocapitalize || i}
33
- spellcheck=${this.spellcheckAttr ?? i}
34
- form=${this.formAttr ?? i}
29
+ autocomplete=${this.autocomplete || a}
30
+ minlength=${this.minlength ?? a}
31
+ maxlength=${this.maxlength ?? a}
32
+ inputmode=${this.inputMode || a}
33
+ enterkeyhint=${this.enterKeyHint || a}
34
+ autocapitalize=${this.autocapitalize || a}
35
+ spellcheck=${this.spellcheckAttr ?? a}
36
+ form=${this.formAttr ?? a}
35
37
  rows=${this.rows}
36
38
  style="--void-textarea-resize: ${this.resize}"
37
39
  aria-invalid=${this.error ? "true" : "false"}
38
40
  @input=${this._onInput}
39
41
  @change=${this._onChange}
40
42
  ></textarea>
41
- ${this.error ? r`<span class="void-textarea-error">${this.error}</span>` : ""}
43
+ ${this.error ? i`<span class="void-textarea-error">${this.error}</span>` : ""}
42
44
  `;
43
45
  }
44
46
  formWriteNativeDefault(e) {
@@ -70,48 +72,48 @@ var s = class extends n(e) {
70
72
  }));
71
73
  }
72
74
  };
73
- t([a({
75
+ t([o({
74
76
  type: String,
75
77
  reflect: !0
76
- })], s.prototype, "value", void 0), t([a({
78
+ })], c.prototype, "value", void 0), t([o({
77
79
  type: String,
78
80
  reflect: !0
79
- })], s.prototype, "placeholder", void 0), t([a({
81
+ })], c.prototype, "placeholder", void 0), t([o({
80
82
  type: Boolean,
81
83
  reflect: !0
82
- })], s.prototype, "disabled", void 0), t([a({
84
+ })], c.prototype, "disabled", void 0), t([o({
83
85
  type: Boolean,
84
86
  reflect: !0
85
- })], s.prototype, "readonly", void 0), t([a({
87
+ })], c.prototype, "readonly", void 0), t([o({
86
88
  type: Boolean,
87
89
  reflect: !0
88
- })], s.prototype, "required", void 0), t([a({
90
+ })], c.prototype, "required", void 0), t([o({
89
91
  type: String,
90
92
  reflect: !0
91
- })], s.prototype, "name", void 0), t([a({
93
+ })], c.prototype, "name", void 0), t([o({
92
94
  type: Number,
93
95
  reflect: !0
94
- })], s.prototype, "rows", void 0), t([a({
96
+ })], c.prototype, "rows", void 0), t([o({
95
97
  type: String,
96
98
  reflect: !0
97
- })], s.prototype, "resize", void 0), t([a({
99
+ })], c.prototype, "resize", void 0), t([o({
98
100
  type: String,
99
101
  reflect: !0
100
- })], s.prototype, "size", void 0), t([a({
102
+ })], c.prototype, "size", void 0), t([o({
101
103
  type: String,
102
104
  reflect: !0
103
- })], s.prototype, "error", void 0), t([a({
105
+ })], c.prototype, "error", void 0), t([o({
104
106
  type: String,
105
107
  reflect: !0
106
- })], s.prototype, "autocomplete", void 0), t([a({ type: Number })], s.prototype, "minlength", void 0), t([a({ type: Number })], s.prototype, "maxlength", void 0), t([a({
108
+ })], c.prototype, "autocomplete", void 0), t([o({ type: Number })], c.prototype, "minlength", void 0), t([o({ type: Number })], c.prototype, "maxlength", void 0), t([o({
107
109
  type: String,
108
110
  attribute: "inputmode"
109
- })], s.prototype, "inputMode", void 0), t([a({
111
+ })], c.prototype, "inputMode", void 0), t([o({
110
112
  type: String,
111
113
  attribute: "enterkeyhint"
112
- })], s.prototype, "enterKeyHint", void 0), t([a({ type: String })], s.prototype, "autocapitalize", void 0), t([a({
114
+ })], c.prototype, "enterKeyHint", void 0), t([o({ type: String })], c.prototype, "autocapitalize", void 0), t([o({
113
115
  type: String,
114
116
  attribute: "spellcheck"
115
- })], s.prototype, "spellcheckAttr", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", s);
117
+ })], c.prototype, "spellcheckAttr", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", c);
116
118
  //#endregion
117
- export { s as VoidTextarea };
119
+ export { c as VoidTextarea };
@@ -31,9 +31,16 @@ export declare class VoidToast extends VoidElement {
31
31
  private _focused;
32
32
  connectedCallback(): void;
33
33
  disconnectedCallback(): void;
34
- protected updated(changed: Map<string, unknown>): void;
35
- /** Errors and warnings interrupt (alert); everything else is polite (status). */
34
+ /**
35
+ * The toast is a plain group, reachable by a screen reader but not a live region itself: a live region inserted
36
+ * together with its text is commonly not announced. The container announces it instead, through its own
37
+ * announcer elements, which exist before any toast does.
38
+ */
36
39
  private _syncRole;
40
+ /** The `aria-labelledby` this toast wrote itself, so an author's own name is never replaced. */
41
+ private _labelledBy;
42
+ /** What a screen reader should say for this toast: its title, then its message (or, without parts, its text). */
43
+ announcement(): string;
37
44
  private _startTimer;
38
45
  private _pause;
39
46
  private _resume;
@@ -63,8 +70,18 @@ export declare class VoidToastContainer extends VoidElement {
63
70
  /** Where the container sits. The corner and centre values overlay the page at a fixed position; `inline` keeps the container in normal flow so toasts push content instead of covering it. */
64
71
  placement: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'inline';
65
72
  private _observer;
73
+ private _announceTimers;
66
74
  connectedCallback(): void;
67
75
  disconnectedCallback(): void;
76
+ /**
77
+ * Two persistent, visually hidden live regions that exist from the container's connection: a polite one
78
+ * (`role="status"`) and an assertive one (`role="alert"`). A screen reader announces text that changes inside a
79
+ * region it already knows, so a toast's words are written here after the toast is in, never together with it.
80
+ */
81
+ private _ensureAnnouncers;
82
+ private _region;
83
+ /** Writes a toast's text into the matching announcer on a later task, after clearing it so a repeat is spoken again. */
84
+ private _announce;
68
85
  /** Shown while it holds a toast; raised to the top of the top layer when one is added. */
69
86
  private _syncShown;
70
87
  /**