@voidable/ui 0.10.0 → 0.12.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 (177) hide show
  1. package/dist/angular/index.d.ts +2 -2
  2. package/dist/angular/index.js +2 -1
  3. package/dist/base.d.ts +6 -0
  4. package/dist/base.js +2 -2
  5. package/dist/chunks/activation-B8aBarKd.js +4 -0
  6. package/dist/chunks/{base-BxmMM3B7.js → base-BGrS4eIl.js} +9 -0
  7. package/dist/chunks/carousel-C9u0bg5l.js +10 -0
  8. package/dist/chunks/choice-BTrsi7OW.js +16 -0
  9. package/dist/chunks/data-Baycjoo4.js +96 -0
  10. package/dist/chunks/fields-MEqz-olE.js +21 -0
  11. package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
  12. package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
  13. package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
  14. package/dist/chunks/menu-CxRRgkJI.js +21 -0
  15. package/dist/chunks/{modal-CgGp_fCs.js → modal-Cz2-Ov76.js} +24 -16
  16. package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
  17. package/dist/chunks/{overlay-hLJ7IQHx.js → overlay-BuV-4Yvt.js} +76 -69
  18. package/dist/chunks/overlay-K1ilWC1p.js +4 -0
  19. package/dist/chunks/pickers-CjlFgNke.js +36 -0
  20. package/dist/chunks/{projection-SnR79EHI.js → projection-oPe6ipjL.js} +1 -1
  21. package/dist/chunks/table-BBpqwWEi.js +4 -0
  22. package/dist/chunks/tabs-Buf3EBWq.js +10 -0
  23. package/dist/components/accordion.d.ts +7 -0
  24. package/dist/components/accordion.js +23 -15
  25. package/dist/components/action-input.d.ts +2 -1
  26. package/dist/components/action-input.js +60 -56
  27. package/dist/components/alert.d.ts +11 -0
  28. package/dist/components/alert.js +10 -3
  29. package/dist/components/avatar.js +2 -2
  30. package/dist/components/badge.d.ts +8 -2
  31. package/dist/components/badge.js +1 -4
  32. package/dist/components/banner.d.ts +9 -0
  33. package/dist/components/banner.js +10 -3
  34. package/dist/components/bar-chart.d.ts +21 -7
  35. package/dist/components/bar-chart.js +68 -45
  36. package/dist/components/breadcrumbs.d.ts +2 -0
  37. package/dist/components/breadcrumbs.js +16 -12
  38. package/dist/components/button.d.ts +7 -0
  39. package/dist/components/button.js +24 -17
  40. package/dist/components/calendar.d.ts +85 -12
  41. package/dist/components/calendar.js +263 -120
  42. package/dist/components/card.js +1 -1
  43. package/dist/components/carousel.d.ts +22 -0
  44. package/dist/components/carousel.js +66 -37
  45. package/dist/components/charts/data.d.ts +72 -0
  46. package/dist/components/checkbox-group.js +23 -22
  47. package/dist/components/checkbox.d.ts +7 -0
  48. package/dist/components/checkbox.js +30 -25
  49. package/dist/components/collapsible.d.ts +7 -0
  50. package/dist/components/collapsible.js +20 -12
  51. package/dist/components/color-picker.js +29 -28
  52. package/dist/components/combobox.d.ts +13 -1
  53. package/dist/components/combobox.js +55 -42
  54. package/dist/components/compose-input.d.ts +9 -1
  55. package/dist/components/compose-input.js +29 -17
  56. package/dist/components/dialog.js +1 -1
  57. package/dist/components/divider.js +2 -2
  58. package/dist/components/donut-chart.d.ts +22 -6
  59. package/dist/components/donut-chart.js +97 -70
  60. package/dist/components/drawer.js +1 -1
  61. package/dist/components/dropdown-menu.d.ts +22 -0
  62. package/dist/components/dropdown-menu.js +55 -40
  63. package/dist/components/editable.d.ts +11 -1
  64. package/dist/components/editable.js +36 -23
  65. package/dist/components/error-fallback.d.ts +4 -2
  66. package/dist/components/error-fallback.js +35 -29
  67. package/dist/components/field.js +2 -2
  68. package/dist/components/file-upload.d.ts +29 -5
  69. package/dist/components/file-upload.js +84 -28
  70. package/dist/components/gauge.d.ts +32 -8
  71. package/dist/components/gauge.js +206 -133
  72. package/dist/components/hamburger.d.ts +19 -1
  73. package/dist/components/hamburger.js +45 -25
  74. package/dist/components/hover-card.d.ts +7 -0
  75. package/dist/components/hover-card.js +23 -15
  76. package/dist/components/indicator.js +16 -15
  77. package/dist/components/input.js +3 -3
  78. package/dist/components/line-chart.d.ts +22 -7
  79. package/dist/components/line-chart.js +80 -57
  80. package/dist/components/list.js +1 -1
  81. package/dist/components/menu.d.ts +25 -0
  82. package/dist/components/menu.js +56 -34
  83. package/dist/components/multiselect.d.ts +17 -1
  84. package/dist/components/multiselect.js +97 -75
  85. package/dist/components/nav-bar.d.ts +9 -0
  86. package/dist/components/nav-bar.js +16 -3
  87. package/dist/components/nav-menu.d.ts +9 -0
  88. package/dist/components/nav-menu.js +31 -24
  89. package/dist/components/number-input.d.ts +15 -1
  90. package/dist/components/number-input.js +72 -38
  91. package/dist/components/pagination.js +26 -25
  92. package/dist/components/panel.js +1 -1
  93. package/dist/components/pin-input.d.ts +11 -0
  94. package/dist/components/pin-input.js +47 -33
  95. package/dist/components/popover.d.ts +7 -0
  96. package/dist/components/popover.js +22 -14
  97. package/dist/components/progress.js +2 -2
  98. package/dist/components/radio-group.js +3 -3
  99. package/dist/components/radio.d.ts +10 -1
  100. package/dist/components/radio.js +38 -33
  101. package/dist/components/scroll-area.js +2 -2
  102. package/dist/components/segmented-control.d.ts +14 -0
  103. package/dist/components/segmented-control.js +41 -29
  104. package/dist/components/select.js +2 -2
  105. package/dist/components/sidebar.d.ts +1 -0
  106. package/dist/components/sidebar.js +15 -11
  107. package/dist/components/skeleton.js +1 -1
  108. package/dist/components/slider.js +3 -3
  109. package/dist/components/spinner.d.ts +5 -3
  110. package/dist/components/spinner.js +22 -15
  111. package/dist/components/stat.d.ts +13 -1
  112. package/dist/components/stat.js +28 -20
  113. package/dist/components/status-dot.d.ts +2 -2
  114. package/dist/components/status-dot.js +13 -15
  115. package/dist/components/stepper.d.ts +2 -0
  116. package/dist/components/stepper.js +21 -14
  117. package/dist/components/switch.d.ts +7 -0
  118. package/dist/components/switch.js +25 -17
  119. package/dist/components/table.d.ts +81 -1
  120. package/dist/components/table.js +571 -69
  121. package/dist/components/tabs.d.ts +11 -0
  122. package/dist/components/tabs.js +43 -34
  123. package/dist/components/tag.js +13 -12
  124. package/dist/components/tags-input.d.ts +10 -1
  125. package/dist/components/tags-input.js +43 -31
  126. package/dist/components/textarea.js +3 -3
  127. package/dist/components/toast.d.ts +2 -0
  128. package/dist/components/toast.js +36 -29
  129. package/dist/components/toggle-group.d.ts +8 -0
  130. package/dist/components/toggle-group.js +25 -18
  131. package/dist/components/toggle.d.ts +7 -0
  132. package/dist/components/toggle.js +24 -16
  133. package/dist/components/tooltip.d.ts +7 -0
  134. package/dist/components/tooltip.js +21 -13
  135. package/dist/components.json +108 -84
  136. package/dist/custom-elements.json +4520 -236
  137. package/dist/dev/rules.d.ts +0 -1
  138. package/dist/dev/types.d.ts +5 -1
  139. package/dist/dev.js +298 -122
  140. package/dist/index.d.ts +4 -0
  141. package/dist/index.js +69 -67
  142. package/dist/keyboard-activation.d.ts +9 -9
  143. package/dist/keyboard.d.ts +2 -10
  144. package/dist/keymaps/activation.d.ts +8 -0
  145. package/dist/keymaps/carousel.d.ts +9 -0
  146. package/dist/keymaps/choice.d.ts +21 -0
  147. package/dist/keymaps/fields.d.ts +31 -0
  148. package/dist/keymaps/index.d.ts +2 -0
  149. package/dist/keymaps/menu.d.ts +36 -0
  150. package/dist/keymaps/nav-menu.d.ts +11 -0
  151. package/dist/keymaps/overlay.d.ts +4 -0
  152. package/dist/keymaps/pickers.d.ts +36 -0
  153. package/dist/keymaps/table.d.ts +8 -0
  154. package/dist/keymaps/tabs.d.ts +7 -0
  155. package/dist/keymaps.js +51 -0
  156. package/dist/keys.d.ts +46 -0
  157. package/dist/keys.js +57 -0
  158. package/dist/llms.txt +11 -3
  159. package/dist/messages/ar.d.ts +1 -0
  160. package/dist/messages/ar.js +130 -0
  161. package/dist/messages/fr.d.ts +1 -0
  162. package/dist/messages/fr.js +109 -0
  163. package/dist/messages.d.ts +213 -0
  164. package/dist/messages.js +190 -0
  165. package/dist/modal.d.ts +7 -0
  166. package/dist/reference.md +885 -60
  167. package/dist/testing/index.d.ts +46 -0
  168. package/dist/testing.js +79 -0
  169. package/dist/types/elements.d.ts +100 -84
  170. package/dist/types/react.d.ts +7 -3
  171. package/dist/types/solid.d.ts +7 -3
  172. package/dist/types/solid2.d.ts +4 -0
  173. package/dist/types/svelte.d.ts +7 -3
  174. package/dist/types/vue.d.ts +7 -3
  175. package/dist/vscode.html-custom-data.json +478 -38
  176. package/dist/web-types.json +1001 -111
  177. package/package.json +22 -2
@@ -1,30 +1,33 @@
1
- import { t as e } from "../chunks/base-BxmMM3B7.js";
1
+ import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { r as n } from "../chunks/projection-SnR79EHI.js";
4
- import { html as r, nothing as i, svg as a } from "lit";
5
- import { property as o, state as s } from "lit/decorators.js";
3
+ import { msg as n } from "../messages.js";
4
+ import { r } from "../chunks/projection-oPe6ipjL.js";
5
+ import { i, l as a, n as o, o as s, r as c, s as l, t as u } from "../chunks/data-Baycjoo4.js";
6
+ import { html as d, nothing as f, svg as p } from "lit";
7
+ import { property as m, state as h } from "lit/decorators.js";
8
+ import { guard as g } from "lit/directives/guard.js";
6
9
  //#region src/components/gauge.ts
7
- n();
8
- function c(e) {
10
+ r();
11
+ function _(e) {
9
12
  return 1 - (1 - e) ** 3;
10
13
  }
11
- function l(e) {
14
+ function v(e) {
12
15
  return Math.abs(e) >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
13
16
  }
14
- function u(e, t, n, r, i) {
17
+ function y(e, t, n, r, i) {
15
18
  let a = i - r, o = Math.abs(a) >= 2 * Math.PI ? r + Math.sign(a) * (2 * Math.PI - 1e-4) : i, s = e + n * Math.cos(r), c = t + n * Math.sin(r), l = e + n * Math.cos(o), u = t + n * Math.sin(o), d = +(Math.abs(o - r) > Math.PI), f = +(o - r >= 0);
16
19
  return `M ${s.toFixed(2)} ${c.toFixed(2)} A ${n} ${n} 0 ${d} ${f} ${l.toFixed(2)} ${u.toFixed(2)}`;
17
20
  }
18
- function d(e, t, n, r, i, a) {
21
+ function b(e, t, n, r, i, a) {
19
22
  let o = n + r / 2, s = Math.max(0, n - r / 2), c = r / 2, l = a - i, u = Math.abs(l) >= 2 * Math.PI ? i + Math.sign(l) * (2 * Math.PI - 1e-4) : a, d = e + o * Math.cos(i), f = t + o * Math.sin(i), p = e + o * Math.cos(u), m = t + o * Math.sin(u), h = e + s * Math.cos(i), g = t + s * Math.sin(i), _ = e + s * Math.cos(u), v = t + s * Math.sin(u), y = +(Math.abs(u - i) > Math.PI);
20
23
  return `M ${d.toFixed(2)} ${f.toFixed(2)} A ${o} ${o} 0 ${y} 1 ${p.toFixed(2)} ${m.toFixed(2)} A ${c} ${c} 0 0 1 ${_.toFixed(2)} ${v.toFixed(2)} A ${s} ${s} 0 ${y} 0 ${h.toFixed(2)} ${g.toFixed(2)} A ${c} ${c} 0 0 1 ${d.toFixed(2)} ${f.toFixed(2)} Z`;
21
24
  }
22
- function f(e, t, n, r, i, a, o, s) {
25
+ function x(e, t, n, r, i, a, o, s) {
23
26
  let c = n + r / 2, l = Math.max(0, n - r / 2), u = r / 2, d = a - i, f = Math.abs(d) >= 2 * Math.PI ? i + Math.sign(d) * (2 * Math.PI - 1e-4) : a, p = e + c * Math.cos(i), m = t + c * Math.sin(i), h = e + c * Math.cos(f), g = t + c * Math.sin(f), _ = e + l * Math.cos(i), v = t + l * Math.sin(i), y = e + l * Math.cos(f), b = t + l * Math.sin(f), x = +(Math.abs(f - i) > Math.PI), S = `M ${p.toFixed(2)} ${m.toFixed(2)} `;
24
27
  return S += `A ${c} ${c} 0 ${x} 1 ${h.toFixed(2)} ${g.toFixed(2)} `, s === "round" ? S += `A ${u} ${u} 0 0 1 ${y.toFixed(2)} ${b.toFixed(2)} ` : S += `L ${y.toFixed(2)} ${b.toFixed(2)} `, S += `A ${l} ${l} 0 ${x} 0 ${_.toFixed(2)} ${v.toFixed(2)} `, o === "round" ? S += `A ${u} ${u} 0 0 1 ${p.toFixed(2)} ${m.toFixed(2)} ` : o === "cup" ? S += `A ${u} ${u} 0 0 0 ${p.toFixed(2)} ${m.toFixed(2)} ` : S += `L ${p.toFixed(2)} ${m.toFixed(2)} `, S += "Z", S;
25
28
  }
26
- var p = 1.5 * 5;
27
- function m(e) {
29
+ var S = 1.5 * 5;
30
+ function C(e) {
28
31
  let t = Math.PI;
29
32
  return e === "full" ? {
30
33
  startAngle: -t / 2,
@@ -40,9 +43,9 @@ function m(e) {
40
43
  totalSweep: 3 * t / 2
41
44
  };
42
45
  }
43
- var h = class extends e {
46
+ var w = class extends e {
44
47
  constructor(...e) {
45
- super(...e), this.unit = "", this.value = 0, this.min = 0, this.max = 100, this.size = 220, this.thickness = 14, this.circular = "triple", this.variant = "filled", this.hideValue = !1, this.unitInline = !1, this.tickMajor = 0, this.tickMinor = 0, this.hideTickMin = !1, this.hideTickMax = !1, this.segmentsSort = "value", this.gaps = !1, this.ariaLabel = "", this.zones = [], this._data = {}, this._phase = "pre", this._hoverSegment = null, this._hoverX = 0, this._hoverY = 0, this._displayValue = 0, this._displayValueFrom = 0, this._targetValue = 0, this._displaySegments = /* @__PURE__ */ new Map(), this._segmentsFrom = /* @__PURE__ */ new Map(), this._targetSegments = /* @__PURE__ */ new Map(), this._animStart = 0, this._animDuration = 0, this._rafHandle = 0, this._hasAnimated = !1, this._onMouseMove = (e) => {
48
+ super(...e), this.unit = "", this.value = 0, this.min = 0, this.max = 100, this.size = 220, this.thickness = 14, this.circular = "triple", this.variant = "filled", this.hideValue = !1, this.unitInline = !1, this.tickMajor = 0, this.tickMinor = 0, this.hideTickMin = !1, this.hideTickMax = !1, this.segmentsSort = "value", this.gaps = !1, this.ariaLabel = "", this.showTable = !1, this._zones = [], this._zonesSource = { text: null }, this._data = {}, this._source = { text: null }, this._phase = "pre", this._hoverSegment = null, this._hoverX = 0, this._hoverY = 0, this._displayValue = 0, this._displayValueFrom = 0, this._targetValue = 0, this._displaySegments = /* @__PURE__ */ new Map(), this._segmentsFrom = /* @__PURE__ */ new Map(), this._targetSegments = /* @__PURE__ */ new Map(), this._animStart = 0, this._animDuration = 0, this._rafHandle = 0, this._hasAnimated = !1, this._onMouseMove = (e) => {
46
49
  let t = this.querySelector("svg");
47
50
  if (!t) return;
48
51
  let n = this._data.segments;
@@ -57,22 +60,22 @@ var h = class extends e {
57
60
  this._hoverSegment !== null && (this._hoverSegment = null);
58
61
  return;
59
62
  }
60
- let { startAngle: h, totalSweep: g } = m(this.circular), _ = h + g, v = Math.atan2(u, l);
61
- for (; v < h;) v += 2 * Math.PI;
62
- for (; v > h + 2 * Math.PI;) v -= 2 * Math.PI;
63
- if (v > _) {
63
+ let { startAngle: m, totalSweep: h } = C(this.circular), g = m + h, _ = Math.atan2(u, l);
64
+ for (; _ < m;) _ += 2 * Math.PI;
65
+ for (; _ > m + 2 * Math.PI;) _ -= 2 * Math.PI;
66
+ if (_ > g) {
64
67
  this._hoverSegment !== null && (this._hoverSegment = null);
65
68
  return;
66
69
  }
67
- let y = this.max - this.min === 0 ? 0 : (this._displayValue - this.min) / (this.max - this.min), b = h + Math.max(0, Math.min(1, y)) * g;
68
- if (v > b) {
70
+ let v = this.max - this.min === 0 ? 0 : (this._displayValue - this.min) / (this.max - this.min), y = m + Math.max(0, Math.min(1, v)) * h;
71
+ if (_ > y) {
69
72
  this._hoverSegment !== null && (this._hoverSegment = null);
70
73
  return;
71
74
  }
72
- let x = this.segmentsSort === "value" ? [...n].sort((e, t) => t.value - e.value) : n, S = [...this._displaySegments.values()].reduce((e, t) => e + t, 0) || this._displayValue || 1, C = b - h, w = h;
73
- for (let e = 0; e < x.length; e++) {
74
- let t = x[e], r = n.indexOf(t), i = (this._displaySegments.get(r) ?? 0) / S * C;
75
- if (v >= w && v < w + i) {
75
+ let b = this.segmentsSort === "value" ? [...n].sort((e, t) => t.value - e.value) : n, x = [...this._displaySegments.values()].reduce((e, t) => e + t, 0) || this._displayValue || 1, S = y - m, w = m;
76
+ for (let e = 0; e < b.length; e++) {
77
+ let t = b[e], r = n.indexOf(t), i = (this._displaySegments.get(r) ?? 0) / x * S;
78
+ if (_ >= w && _ < w + i) {
76
79
  this._hoverSegment !== r && (this._hoverSegment = r), this._hoverX = a, this._hoverY = o;
77
80
  return;
78
81
  }
@@ -82,7 +85,7 @@ var h = class extends e {
82
85
  }, this._onMouseLeave = () => {
83
86
  this._hoverSegment = null;
84
87
  }, this._tick = (e) => {
85
- let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r = c(n);
88
+ let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r = _(n);
86
89
  this._displayValue = this._displayValueFrom + (this._targetValue - this._displayValueFrom) * r;
87
90
  for (let [e, t] of this._targetSegments) {
88
91
  let n = this._segmentsFrom.get(e) ?? 0;
@@ -91,17 +94,48 @@ var h = class extends e {
91
94
  this.requestUpdate(), n < 1 ? this._rafHandle = requestAnimationFrame(this._tick) : this._phase = "idle";
92
95
  };
93
96
  }
97
+ get zones() {
98
+ return this._zones;
99
+ }
100
+ set zones(e) {
101
+ let t = s(e, this._zonesSource, {
102
+ attr: "zones",
103
+ shape: "[{\"from\":0,\"to\":60,\"color\":\"green\"},{\"from\":60,\"to\":100,\"color\":\"red\"}]",
104
+ empty: () => [],
105
+ normalize: (e) => Array.isArray(e) ? e.filter(c).map((e) => ({
106
+ from: Number(e.from),
107
+ to: Number(e.to),
108
+ color: String(e.color ?? "")
109
+ })) : null,
110
+ warn: (e, t) => this.reportDev("invalid-data", e, t)
111
+ });
112
+ t && (this._zones = t.value);
113
+ }
94
114
  get data() {
95
115
  return this._data;
96
116
  }
97
117
  set data(e) {
98
- let t = this._data, n = this._displayValue, r = new Map(this._displaySegments);
99
- this._data = e, this._refreshTargets(), this.requestUpdate(), this.updateComplete.then(() => {
100
- let i = t.segments ?? [], a = /* @__PURE__ */ new Map();
101
- for (let e = 0; e < i.length; e++) a.set(e, r.get(e) ?? 0);
102
- let o = e.segments ?? [];
103
- for (let e = 0; e < o.length; e++) a.has(e) || a.set(e, 0);
104
- this._startAnimation(a, n, !0);
118
+ let t = s(e, this._source, {
119
+ attr: "data",
120
+ shape: "{\"segments\":[{\"name\":\"Used\",\"value\":40},{\"name\":\"Cache\",\"value\":15}]}",
121
+ empty: () => ({}),
122
+ normalize: (e) => {
123
+ if (!c(e)) return null;
124
+ let t = e.segments === void 0 ? void 0 : i(e.segments);
125
+ if (t === null) return null;
126
+ let n = {};
127
+ return e.value !== void 0 && (n.value = Number(e.value)), t && (n.segments = t), n;
128
+ },
129
+ warn: (e, t) => this.reportDev("invalid-data", e, t)
130
+ });
131
+ if (!t) return;
132
+ let n = t.value, r = this._data, a = this._displayValue, o = new Map(this._displaySegments);
133
+ this._data = n, this._refreshTargets(), this.requestUpdate(), this._hasAnimated && this.updateComplete.then(() => {
134
+ let e = r.segments ?? [], t = /* @__PURE__ */ new Map();
135
+ for (let n = 0; n < e.length; n++) t.set(n, o.get(n) ?? 0);
136
+ let i = n.segments ?? [];
137
+ for (let e = 0; e < i.length; e++) t.has(e) || t.set(e, 0);
138
+ this._startAnimation(t, a, !0);
105
139
  });
106
140
  }
107
141
  willUpdate(e) {
@@ -119,7 +153,7 @@ var h = class extends e {
119
153
  return e && e.length > 0 ? e.reduce((e, t) => e + t.value, 0) : this.value;
120
154
  }
121
155
  connectedCallback() {
122
- super.connectedCallback(), this.setHostAttribute("role", "img"), this._refreshTargets(), requestAnimationFrame(() => {
156
+ super.connectedCallback(), this.setHostAttribute("role", "figure"), this._refreshTargets(), requestAnimationFrame(() => {
123
157
  let e = /* @__PURE__ */ new Map(), t = this._data.segments ?? [];
124
158
  for (let n = 0; n < t.length; n++) e.set(n, 0);
125
159
  this._startAnimation(e, 0, !1);
@@ -141,7 +175,7 @@ var h = class extends e {
141
175
  return this.circular === "semi" ? this.size * .6 : this.circular === "triple" ? this.size * .85 : this.size;
142
176
  }
143
177
  _angleAt(e) {
144
- let { startAngle: t, totalSweep: n } = m(this.circular), r = Math.max(this.min, Math.min(this.max, e));
178
+ let { startAngle: t, totalSweep: n } = C(this.circular), r = Math.max(this.min, Math.min(this.max, e));
145
179
  return t + (this.max - this.min === 0 ? 0 : (r - this.min) / (this.max - this.min)) * n;
146
180
  }
147
181
  _resolveFillColor() {
@@ -155,144 +189,143 @@ var h = class extends e {
155
189
  return (this._data.segments?.length ?? 0) > 0;
156
190
  }
157
191
  _renderZones(e, t, n, r) {
158
- if (this.zones.length === 0 || this._hasSegments()) return i;
192
+ if (this.zones.length === 0 || this._hasSegments()) return f;
159
193
  if (this.variant === "outline") {
160
- let i = r > this._angleAt(this.min) + 1e-6, o = [];
161
- for (let s = 0; s < this.zones.length; s++) {
162
- let c = this.zones[s], l = this._angleAt(c.from), u = this._angleAt(c.to);
163
- if (u <= r + 1e-6) continue;
164
- let d = l <= r + 1e-6, p = d ? r : l, m = "butt";
165
- d && i ? m = "cup" : Math.abs(c.from - this.min) < 1e-6 && (m = "round");
166
- let h = s === this.zones.length - 1 && Math.abs(c.to - this.max) < 1e-6 ? "round" : "butt";
167
- o.push(a`
194
+ let i = r > this._angleAt(this.min) + 1e-6, a = [];
195
+ for (let o = 0; o < this.zones.length; o++) {
196
+ let s = this.zones[o], c = this._angleAt(s.from), l = this._angleAt(s.to);
197
+ if (l <= r + 1e-6) continue;
198
+ let u = c <= r + 1e-6, d = u ? r : c, f = "butt";
199
+ u && i ? f = "cup" : Math.abs(s.from - this.min) < 1e-6 && (f = "round");
200
+ let m = o === this.zones.length - 1 && Math.abs(s.to - this.max) < 1e-6 ? "round" : "butt";
201
+ a.push(p`
168
202
  <path
169
203
  class="void-gauge-zone"
170
- style="--zone-color: ${c.color};"
171
- d=${f(e, t, n, this.thickness, p, u, m, h)}
204
+ style="--zone-color: ${s.color};"
205
+ d=${x(e, t, n, this.thickness, d, l, f, m)}
172
206
  ></path>
173
207
  `);
174
208
  }
175
- return a`<g class="void-gauge-zones">${o}</g>`;
209
+ return p`<g class="void-gauge-zones">${a}</g>`;
176
210
  }
177
- let o = this.variant === "wireframe" ? p : this.thickness, s = [];
178
- for (let r of this.zones) s.push(a`
211
+ let i = this.variant === "wireframe" ? S : this.thickness, a = [];
212
+ for (let r of this.zones) a.push(p`
179
213
  <path
180
214
  class="void-gauge-zone"
181
- style="--zone-color: ${r.color}; --gauge-stroke-width: ${o};"
182
- d=${u(e, t, n, this._angleAt(r.from), this._angleAt(r.to))}
215
+ style="--zone-color: ${r.color}; --gauge-stroke-width: ${i};"
216
+ d=${y(e, t, n, this._angleAt(r.from), this._angleAt(r.to))}
183
217
  ></path>
184
218
  `);
185
- let c = o / 2, l = (r, i) => {
186
- let a = Math.cos(r), o = Math.sin(r);
187
- return `M ${(e + (n - c) * a).toFixed(2)} ${(t + (n - c) * o).toFixed(2)} A ${c} ${c} 0 0 ${i} ${(e + (n + c) * a).toFixed(2)} ${(t + (n + c) * o).toFixed(2)} Z`;
188
- }, d = [], m = this.zones[0];
189
- m && Math.abs(m.from - this.min) < 1e-6 && d.push(a`<path class="void-gauge-zone-cap" d=${l(this._angleAt(m.from), 1)} style="--zone-color: ${m.color};"></path>`);
190
- let h = this.zones[this.zones.length - 1];
191
- return h && Math.abs(h.to - this.max) < 1e-6 && d.push(a`<path class="void-gauge-zone-cap" d=${l(this._angleAt(h.to), 0)} style="--zone-color: ${h.color};"></path>`), a`<g class="void-gauge-zones">${s}${d}</g>`;
219
+ let o = i / 2, s = (r, i) => {
220
+ let a = Math.cos(r), s = Math.sin(r);
221
+ return `M ${(e + (n - o) * a).toFixed(2)} ${(t + (n - o) * s).toFixed(2)} A ${o} ${o} 0 0 ${i} ${(e + (n + o) * a).toFixed(2)} ${(t + (n + o) * s).toFixed(2)} Z`;
222
+ }, c = [], l = this.zones[0];
223
+ l && Math.abs(l.from - this.min) < 1e-6 && c.push(p`<path class="void-gauge-zone-cap" d=${s(this._angleAt(l.from), 1)} style="--zone-color: ${l.color};"></path>`);
224
+ let u = this.zones[this.zones.length - 1];
225
+ return u && Math.abs(u.to - this.max) < 1e-6 && c.push(p`<path class="void-gauge-zone-cap" d=${s(this._angleAt(u.to), 0)} style="--zone-color: ${u.color};"></path>`), p`<g class="void-gauge-zones">${a}${c}</g>`;
192
226
  }
193
- _renderSegments(e, t, n, r, o, s) {
194
- if (!this._hasSegments()) return i;
195
- let c = this._data.segments, l = this.segmentsSort === "value" ? [...c].sort((e, t) => t.value - e.value) : c, f = s - r, p = (this.gaps === !0 ? 1 : this.gaps === !1 ? 0 : this.gaps) / 100 * f, m = l.length, h = (m > 1 ? p / (m - 1) : 0) / 2, g = [], _ = r, v = null, y = null, b = null, x = null;
196
- for (let r = 0; r < l.length; r++) {
197
- let i = l[r], p = c.indexOf(i), S = this._displaySegments.get(p) ?? 0;
198
- if (S <= 0 || o <= 0) {
199
- _ += 0;
227
+ _renderSegments(e, t, n, r, i, a) {
228
+ if (!this._hasSegments()) return f;
229
+ let o = this._data.segments, s = this.segmentsSort === "value" ? [...o].sort((e, t) => t.value - e.value) : o, c = a - r, l = (this.gaps === !0 ? 1 : this.gaps === !1 ? 0 : this.gaps) / 100 * c, u = s.length, d = (u > 1 ? l / (u - 1) : 0) / 2, m = [], h = r, g = null, _ = null, v = null, x = null;
230
+ for (let r = 0; r < s.length; r++) {
231
+ let l = s[r], f = o.indexOf(l), S = this._displaySegments.get(f) ?? 0;
232
+ if (S <= 0 || i <= 0) {
233
+ h += 0;
200
234
  continue;
201
235
  }
202
- let C = S / o * f, w = Math.min(_ + C, s), T = r > 0 ? _ + h : _, E = r < m - 1 ? w - h : w;
236
+ let C = S / i * c, w = Math.min(h + C, a), T = r > 0 ? h + d : h, E = r < u - 1 ? w - d : w;
203
237
  if (E > T + .001) {
204
- let r = i.color ?? "var(--void-color-accent)", o = this.variant === "outline" ? d(e, t, n, this.thickness, T, E) : u(e, t, n, T, E);
205
- g.push(a`
238
+ let r = l.color ?? "var(--void-color-accent)", i = this.variant === "outline" ? b(e, t, n, this.thickness, T, E) : y(e, t, n, T, E);
239
+ m.push(p`
206
240
  <path
207
241
  class="void-gauge-segment"
208
- d=${o}
242
+ d=${i}
209
243
  style="--segment-color: ${r}; --gauge-stroke-width: ${this.thickness};"
210
- data-segment-index=${p}
244
+ data-segment-index=${f}
211
245
  ></path>
212
- `), v === null && (v = r, y = T), b = r, x = E;
246
+ `), g === null && (g = r, _ = T), v = r, x = E;
213
247
  }
214
- _ += C;
248
+ h += C;
215
249
  }
216
- if (g.length === 0) return i;
250
+ if (m.length === 0) return f;
217
251
  let S = this.thickness / 2, C = [];
218
- if (y !== null && v !== null) {
219
- let r = e + n * Math.cos(y), i = t + n * Math.sin(y);
220
- C.push(a`<circle class="void-gauge-segment-cap" cx=${r} cy=${i} r=${S} style="--segment-color: ${v};"></circle>`);
252
+ if (_ !== null && g !== null) {
253
+ let r = e + n * Math.cos(_), i = t + n * Math.sin(_);
254
+ C.push(p`<circle class="void-gauge-segment-cap" cx=${r} cy=${i} r=${S} style="--segment-color: ${g};"></circle>`);
221
255
  }
222
- if (x !== null && b !== null) {
256
+ if (x !== null && v !== null) {
223
257
  let r = e + n * Math.cos(x), i = t + n * Math.sin(x);
224
- C.push(a`<circle class="void-gauge-segment-cap" cx=${r} cy=${i} r=${S} style="--segment-color: ${b};"></circle>`);
258
+ C.push(p`<circle class="void-gauge-segment-cap" cx=${r} cy=${i} r=${S} style="--segment-color: ${v};"></circle>`);
225
259
  }
226
- return a`<g class="void-gauge-segments">${C}${g}</g>`;
260
+ return p`<g class="void-gauge-segments">${C}${m}</g>`;
227
261
  }
228
262
  _renderCenter(e, t) {
229
- let n = this._displayValue, r = l(n), o = this.circular === "semi" ? t * .7 : t, s = o + 20;
230
- return this.unitInline && this.unit ? a`
263
+ let n = this._displayValue, r = v(n), i = this.circular === "semi" ? t * .7 : t, a = i + 20;
264
+ return this.unitInline && this.unit ? p`
231
265
  <text
232
266
  class="void-gauge-center-value"
233
267
  x=${e}
234
- y=${o}
268
+ y=${i}
235
269
  text-anchor="middle"
236
270
  dy="0.32em"
237
271
  >${r}<tspan class="void-gauge-center-unit-inline" dx="6">${this.unit}</tspan></text>
238
- ` : a`
272
+ ` : p`
239
273
  <text
240
274
  class="void-gauge-center-value"
241
275
  x=${e}
242
- y=${o}
276
+ y=${i}
243
277
  text-anchor="middle"
244
278
  dy="0.32em"
245
279
  >${r}</text>
246
- ${this.unit ? a`
280
+ ${this.unit ? p`
247
281
  <text
248
282
  class="void-gauge-center-unit"
249
283
  x=${e}
250
- y=${s}
284
+ y=${a}
251
285
  text-anchor="middle"
252
286
  dy="0.32em"
253
287
  >${this.unit}</text>
254
- ` : i}
288
+ ` : f}
255
289
  `;
256
290
  }
257
291
  _hasTicks() {
258
292
  return this.tickMajor > 0 || this.tickMinor > 0;
259
293
  }
260
294
  _renderTicks(e, t, n) {
261
- if (!this._hasTicks() || this.max - this.min <= 0) return i;
262
- let r = Math.max(0, n - this.thickness / 2), o = Math.max(0, r - 3), s = Math.max(0, o - 5), c = Math.max(0, o - 10), l = [], u = this.tickMinor > 0 ? this.tickMinor : this.tickMajor;
263
- if (u <= 0) return i;
264
- this.hideTickMin || l.push({
295
+ if (!this._hasTicks() || this.max - this.min <= 0) return f;
296
+ let r = Math.max(0, n - this.thickness / 2), i = Math.max(0, r - 3), a = Math.max(0, i - 5), o = Math.max(0, i - 10), s = [], c = this.tickMinor > 0 ? this.tickMinor : this.tickMajor;
297
+ if (c <= 0) return f;
298
+ this.hideTickMin || s.push({
265
299
  v: this.min,
266
300
  major: !0
267
301
  });
268
- let d = u * 1e-6;
269
- for (let e = this.min + u; e < this.max - d; e += u) {
302
+ let l = c * 1e-6;
303
+ for (let e = this.min + c; e < this.max - l; e += c) {
270
304
  let t = this.tickMajor > 0 && Math.abs((e - this.min) / this.tickMajor - Math.round((e - this.min) / this.tickMajor)) < 1e-6;
271
- l.push({
305
+ s.push({
272
306
  v: e,
273
307
  major: t
274
308
  });
275
309
  }
276
- let f = (this.max - this.min) / u, p = Math.abs(f - Math.round(f)) < d;
277
- if (!this.hideTickMax || p) {
310
+ let u = (this.max - this.min) / c, d = Math.abs(u - Math.round(u)) < l;
311
+ if (!this.hideTickMax || d) {
278
312
  let e = this.tickMajor > 0 && Math.abs((this.max - this.min) / this.tickMajor - Math.round((this.max - this.min) / this.tickMajor)) < 1e-6;
279
- l.push({
313
+ s.push({
280
314
  v: this.max,
281
315
  major: !this.hideTickMax || e
282
316
  });
283
317
  }
284
- return l.length === 0 ? i : a`<g class="void-gauge-ticks">${l.map(({ v: n, major: r }) => {
285
- let i = this._angleAt(n), l = r ? c : s, u = (e + o * Math.cos(i)).toFixed(2), d = (t + o * Math.sin(i)).toFixed(2), f = (e + l * Math.cos(i)).toFixed(2), p = (t + l * Math.sin(i)).toFixed(2);
286
- return a`<line class="void-gauge-tick ${r ? "void-gauge-tick-major" : "void-gauge-tick-minor"}" x1=${u} y1=${d} x2=${f} y2=${p}></line>`;
318
+ return s.length === 0 ? f : p`<g class="void-gauge-ticks">${s.map(({ v: n, major: r }) => {
319
+ let s = this._angleAt(n), c = r ? o : a, l = (e + i * Math.cos(s)).toFixed(2), u = (t + i * Math.sin(s)).toFixed(2), d = (e + c * Math.cos(s)).toFixed(2), f = (t + c * Math.sin(s)).toFixed(2);
320
+ return p`<line class="void-gauge-tick ${r ? "void-gauge-tick-major" : "void-gauge-tick-minor"}" x1=${l} y1=${u} x2=${d} y2=${f}></line>`;
287
321
  })}</g>`;
288
322
  }
289
323
  render() {
290
- let { startAngle: e, endAngle: t, totalSweep: n } = m(this.circular), o = this.size / 2, s = this.size / 2, c = Math.max(8, this.thickness / 2), l = this.size / 2 - c, f = this._viewBoxHeight(), p = [...this._displaySegments.values()].reduce((e, t) => e + t, 0), h = Math.max(this.min, Math.min(this.max, this._displayValue)), g = this.max - this.min === 0 ? 0 : (h - this.min) / (this.max - this.min), _ = e + Math.max(0, Math.min(1, g)) * n, v = this._resolveFillColor(), y = _ > e + .001;
291
- return r`
324
+ let { startAngle: e, endAngle: t, totalSweep: n } = C(this.circular), r = this.size / 2, i = this.size / 2, a = Math.max(8, this.thickness / 2), o = this.size / 2 - a, s = this._viewBoxHeight(), c = [...this._displaySegments.values()].reduce((e, t) => e + t, 0), l = Math.max(this.min, Math.min(this.max, this._displayValue)), u = this.max - this.min === 0 ? 0 : (l - this.min) / (this.max - this.min), m = e + Math.max(0, Math.min(1, u)) * n, h = this._resolveFillColor(), g = m > e + .001;
325
+ return d`
292
326
  <svg
293
- viewBox="0 0 ${this.size} ${f}"
294
- role="img"
295
- aria-label=${this.ariaLabel || "Gauge chart"}
327
+ viewBox="0 0 ${this.size} ${s}"
328
+ aria-hidden="true"
296
329
  data-phase=${this._phase}
297
330
  >
298
331
  <!-- Track — full arc, always. Gaps between segments reveal the
@@ -302,95 +335,131 @@ var h = class extends e {
302
335
  <path
303
336
  class="void-gauge-track"
304
337
  style="--gauge-stroke-width: ${this.thickness};"
305
- d=${u(o, s, l, e, t)}
338
+ d=${y(r, i, o, e, t)}
306
339
  ></path>
307
340
 
308
341
  <!-- Zone bands. Filled variant: zones render full-width and are
309
342
  covered by the value's opaque stroke. Outline variant: zones
310
343
  under the fill are clipped so the active-zone color reads
311
344
  contiguously (otherwise the 14% tint composites through). -->
312
- ${this._renderZones(o, s, l, _)}
345
+ ${this._renderZones(r, i, o, m)}
313
346
 
314
347
  <!-- Value fill (skip when segments are present — segments paint
315
348
  their own colors directly). For the 'outline' variant use a
316
349
  closed band shape so SVG fill renders the faint tint AND
317
350
  stroke renders a hairline border. Other variants use a
318
351
  stroked centerline arc. -->
319
- ${y && !this._hasSegments() ? a`
352
+ ${g && !this._hasSegments() ? p`
320
353
  <path
321
354
  class="void-gauge-value"
322
- style="--value-color: ${v}; --gauge-stroke-width: ${this.thickness};"
323
- d=${this.variant === "outline" ? d(o, s, l, this.thickness, e, _) : u(o, s, l, e, _)}
355
+ style="--value-color: ${h}; --gauge-stroke-width: ${this.thickness};"
356
+ d=${this.variant === "outline" ? b(r, i, o, this.thickness, e, m) : y(r, i, o, e, m)}
324
357
  ></path>
325
- ` : i}
358
+ ` : f}
326
359
 
327
360
  <!-- Segment overlays -->
328
- ${this._renderSegments(o, s, l, e, p, _)}
361
+ ${this._renderSegments(r, i, o, e, c, m)}
329
362
 
330
363
  <!-- Tick marks (outside the band) -->
331
- ${this._renderTicks(o, s, l)}
364
+ ${this._renderTicks(r, i, o)}
332
365
 
333
366
  <!-- Center label -->
334
- ${this.hideValue ? i : this._renderCenter(o, s)}
367
+ ${this.hideValue ? f : this._renderCenter(r, i)}
335
368
 
336
369
  <!-- Hover tooltip -->
337
- ${this._hoverSegment !== null && this._data.segments && this._hoverSegment < this._data.segments.length ? this._renderHoverTooltip(this._data.segments, this._hoverSegment) : i}
370
+ ${this._hoverSegment !== null && this._data.segments && this._hoverSegment < this._data.segments.length ? this._renderHoverTooltip(this._data.segments, this._hoverSegment) : f}
338
371
  </svg>
372
+ ${this._table()}
339
373
  `;
340
374
  }
375
+ _table() {
376
+ let { value: e, min: t, max: r, unit: i, segmentsSort: s, _data: c } = this, d = this.ariaLabel || n(this, "chart.gauge");
377
+ return g([
378
+ e,
379
+ t,
380
+ r,
381
+ i,
382
+ s,
383
+ c,
384
+ d,
385
+ u(this)
386
+ ], () => {
387
+ let u, f = c.segments ?? [];
388
+ if (f.length > 0) {
389
+ let e = s === "value" ? [...f].sort((e, t) => t.value - e.value) : f;
390
+ u = l(this, d, e);
391
+ } else {
392
+ let o = a(this), s = c.value ?? e, l = (e) => o.number(e) + (i ? /^[\p{L}]/u.test(i) ? ` ${i}` : i : "");
393
+ u = {
394
+ caption: d,
395
+ head: [
396
+ n(this, "chart.value"),
397
+ n(this, "chart.minimum"),
398
+ n(this, "chart.maximum")
399
+ ],
400
+ rows: [{ cells: [
401
+ l(s),
402
+ l(t),
403
+ l(r)
404
+ ] }]
405
+ };
406
+ }
407
+ return o("void-gauge-table", u);
408
+ });
409
+ }
341
410
  _renderHoverTooltip(e, t) {
342
- let n = e[t], r = this._displaySegments.get(t) ?? n.value, i = [...this._displaySegments.values()].reduce((e, t) => e + t, 0) || this._displayValue || 1, o = Math.round(r / i * 100), s = this._viewBoxHeight(), c = this._hoverX + 12, u = this._hoverY + 12;
343
- return c + 140 > this.size && (c = this._hoverX - 12 - 140), u + 44 > s && (u = this._hoverY - 12 - 44), c < 0 && (c = 0), u < 0 && (u = 0), a`
411
+ let n = e[t], r = this._displaySegments.get(t) ?? n.value, i = [...this._displaySegments.values()].reduce((e, t) => e + t, 0) || this._displayValue || 1, a = Math.round(r / i * 100), o = this._viewBoxHeight(), s = this._hoverX + 12, c = this._hoverY + 12;
412
+ return s + 140 > this.size && (s = this._hoverX - 12 - 140), c + 44 > o && (c = this._hoverY - 12 - 44), s < 0 && (s = 0), c < 0 && (c = 0), p`
344
413
  <g class="void-gauge-hover" pointer-events="none">
345
414
  <rect
346
415
  class="void-gauge-tooltip-bg"
347
- x=${c} y=${u}
416
+ x=${s} y=${c}
348
417
  width=${140} height=${44}
349
418
  rx="6" ry="6"
350
419
  ></rect>
351
420
  <text
352
421
  class="void-gauge-tooltip-name"
353
- x=${c + 8}
354
- y=${u + 8 + 10}
422
+ x=${s + 8}
423
+ y=${c + 8 + 10}
355
424
  >${n.name}</text>
356
425
  <text
357
426
  class="void-gauge-tooltip-value"
358
- x=${c + 8}
359
- y=${u + 8 + 14 + 10}
360
- >${l(r)} <tspan class="void-gauge-tooltip-pct">(${o}%)</tspan></text>
427
+ x=${s + 8}
428
+ y=${c + 8 + 14 + 10}
429
+ >${v(r)} <tspan class="void-gauge-tooltip-pct">(${a}%)</tspan></text>
361
430
  </g>
362
431
  `;
363
432
  }
364
433
  };
365
- t([o()], h.prototype, "unit", void 0), t([o({
434
+ t([m()], w.prototype, "unit", void 0), t([m({
366
435
  type: Number,
367
436
  reflect: !0
368
- })], h.prototype, "value", void 0), t([o({ type: Number })], h.prototype, "min", void 0), t([o({ type: Number })], h.prototype, "max", void 0), t([o({
437
+ })], w.prototype, "value", void 0), t([m({ type: Number })], w.prototype, "min", void 0), t([m({ type: Number })], w.prototype, "max", void 0), t([m({
369
438
  type: Number,
370
439
  reflect: !0
371
- })], h.prototype, "size", void 0), t([o({ type: Number })], h.prototype, "thickness", void 0), t([o({ reflect: !0 })], h.prototype, "circular", void 0), t([o({ reflect: !0 })], h.prototype, "variant", void 0), t([o({
440
+ })], w.prototype, "size", void 0), t([m({ type: Number })], w.prototype, "thickness", void 0), t([m({ reflect: !0 })], w.prototype, "circular", void 0), t([m({ reflect: !0 })], w.prototype, "variant", void 0), t([m({
372
441
  type: Boolean,
373
442
  attribute: "hide-value",
374
443
  reflect: !0
375
- })], h.prototype, "hideValue", void 0), t([o({
444
+ })], w.prototype, "hideValue", void 0), t([m({
376
445
  type: Boolean,
377
446
  attribute: "unit-inline",
378
447
  reflect: !0
379
- })], h.prototype, "unitInline", void 0), t([o({
448
+ })], w.prototype, "unitInline", void 0), t([m({
380
449
  type: Number,
381
450
  attribute: "tick-major"
382
- })], h.prototype, "tickMajor", void 0), t([o({
451
+ })], w.prototype, "tickMajor", void 0), t([m({
383
452
  type: Number,
384
453
  attribute: "tick-minor"
385
- })], h.prototype, "tickMinor", void 0), t([o({
454
+ })], w.prototype, "tickMinor", void 0), t([m({
386
455
  type: Boolean,
387
456
  attribute: "hide-tick-min",
388
457
  reflect: !0
389
- })], h.prototype, "hideTickMin", void 0), t([o({
458
+ })], w.prototype, "hideTickMin", void 0), t([m({
390
459
  type: Boolean,
391
460
  attribute: "hide-tick-max",
392
461
  reflect: !0
393
- })], h.prototype, "hideTickMax", void 0), t([o({ attribute: "segments-sort" })], h.prototype, "segmentsSort", void 0), t([o({ converter: {
462
+ })], w.prototype, "hideTickMax", void 0), t([m({ attribute: "segments-sort" })], w.prototype, "segmentsSort", void 0), t([m({ converter: {
394
463
  fromAttribute(e) {
395
464
  if (e === null || e === "" || e === "true") return !0;
396
465
  if (e === "false") return !1;
@@ -400,6 +469,10 @@ t([o()], h.prototype, "unit", void 0), t([o({
400
469
  toAttribute(e) {
401
470
  return e === !0 ? "" : e === !1 ? "false" : String(e);
402
471
  }
403
- } })], h.prototype, "gaps", void 0), t([o({ attribute: "aria-label" })], h.prototype, "ariaLabel", void 0), t([o({ attribute: !1 })], h.prototype, "zones", void 0), t([s()], h.prototype, "_phase", void 0), t([s()], h.prototype, "_hoverSegment", void 0), t([s()], h.prototype, "_hoverX", void 0), t([s()], h.prototype, "_hoverY", void 0), customElements.get("void-gauge") || customElements.define("void-gauge", h);
472
+ } })], w.prototype, "gaps", void 0), t([m({ attribute: "aria-label" })], w.prototype, "ariaLabel", void 0), t([m({
473
+ type: Boolean,
474
+ attribute: "show-table",
475
+ reflect: !0
476
+ })], w.prototype, "showTable", void 0), t([m({ attribute: "zones" })], w.prototype, "zones", null), t([m({ attribute: "data" })], w.prototype, "data", null), t([h()], w.prototype, "_phase", void 0), t([h()], w.prototype, "_hoverSegment", void 0), t([h()], w.prototype, "_hoverX", void 0), t([h()], w.prototype, "_hoverY", void 0), customElements.get("void-gauge") || customElements.define("void-gauge", w);
404
477
  //#endregion
405
- export { h as VoidGauge };
478
+ export { w as VoidGauge };
@@ -1,14 +1,25 @@
1
1
  import { VoidElement } from '../base.js';
2
2
  import { KeyboardActivation } from '../keyboard-activation.js';
3
+ import { KeyOverrides } from '../keys.js';
3
4
  /**
4
5
  * Animated open/close toggle for mobile navigation menus and collapsible sidebars.
5
6
  *
6
- * @fires {CustomEvent<{ reason: 'trigger' }>} void-open - The user opened it (click, Enter or Space). Does not bubble.
7
+ * Name it by what it opens: `aria-label="Main navigation"` (or `aria-labelledby`). Without one it is called "Menu" ("Close menu" while open).
8
+ *
9
+ * @fires {CustomEvent<{ reason: 'trigger' | 'keyboard' }>} void-open - The user opened it: `trigger` for a click, `keyboard` for Enter or Space. Does not bubble.
7
10
  * @fires {CustomEvent<{ reason: 'trigger' }>} void-close - The user closed it. Does not bubble.
8
11
  */
9
12
  export declare class VoidHamburger extends VoidElement {
13
+ /** Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. */
14
+ keys: KeyOverrides | null;
15
+ /** @internal The actions of this element and their default keys. */
16
+ static readonly keyMap: {
17
+ activate: string[];
18
+ };
10
19
  /** Enter and Space fire a real `click`, as on a native button. */
11
20
  protected readonly _activation: KeyboardActivation;
21
+ /** A key (Enter, Space) is activating it, so the click it fires reports reason `keyboard`. */
22
+ private _byKey;
12
23
  /**
13
24
  * Whether the menu it controls is open: draws the lines as a close cross and sets `aria-expanded`. It
14
25
  * flips on every click and Enter or Space, firing `void-open` or `void-close`; set it yourself when the
@@ -24,6 +35,13 @@ export declare class VoidHamburger extends VoidElement {
24
35
  disconnectedCallback(): void;
25
36
  updated(changed: Map<string, unknown>): void;
26
37
  private _handleClick;
38
+ /** The label this component wrote itself, so a name the author wrote is told apart from it. */
39
+ private _writtenLabel;
40
+ /**
41
+ * The name is the author's `aria-label` or `aria-labelledby` (say what it opens: "Main navigation"; it stays the
42
+ * same while open, `aria-expanded` says the rest). Without one it is "Menu", or "Close menu" while open.
43
+ */
44
+ private _syncLabel;
27
45
  render(): import('lit').TemplateResult<1>;
28
46
  }
29
47
  declare global {