@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
@@ -3,12 +3,16 @@ import { KeyboardActivation } from '../keyboard-activation.js';
3
3
  /**
4
4
  * Animated open/close toggle for mobile navigation menus and collapsible sidebars.
5
5
  *
6
- * @fires {CustomEvent<{ reason: 'trigger' }>} void-open - The user opened it (click, Enter or Space). Does not bubble.
6
+ * Name it by what it opens: `aria-label="Main navigation"` (or `aria-labelledby`). Without one it is called "Menu" ("Close menu" while open).
7
+ *
8
+ * @fires {CustomEvent<{ reason: 'trigger' | 'keyboard' }>} void-open - The user opened it: `trigger` for a click, `keyboard` for Enter or Space. Does not bubble.
7
9
  * @fires {CustomEvent<{ reason: 'trigger' }>} void-close - The user closed it. Does not bubble.
8
10
  */
9
11
  export declare class VoidHamburger extends VoidElement {
10
12
  /** Enter and Space fire a real `click`, as on a native button. */
11
13
  protected readonly _activation: KeyboardActivation;
14
+ /** A key (Enter, Space) is activating it, so the click it fires reports reason `keyboard`. */
15
+ private _byKey;
12
16
  /**
13
17
  * Whether the menu it controls is open: draws the lines as a close cross and sets `aria-expanded`. It
14
18
  * flips on every click and Enter or Space, firing `void-open` or `void-close`; set it yourself when the
@@ -24,6 +28,13 @@ export declare class VoidHamburger extends VoidElement {
24
28
  disconnectedCallback(): void;
25
29
  updated(changed: Map<string, unknown>): void;
26
30
  private _handleClick;
31
+ /** The label this component wrote itself, so a name the author wrote is told apart from it. */
32
+ private _writtenLabel;
33
+ /**
34
+ * The name is the author's `aria-label` or `aria-labelledby` (say what it opens: "Main navigation"; it stays the
35
+ * same while open, `aria-expanded` says the rest). Without one it is "Menu", or "Close menu" while open.
36
+ */
37
+ private _syncLabel;
27
38
  render(): import('lit').TemplateResult<1>;
28
39
  }
29
40
  declare global {
@@ -1,40 +1,53 @@
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 { i as r, r as i } from "../chunks/form-control-C0vH6gii.js";
5
- import { html as a } from "lit";
6
- import { property as o } from "lit/decorators.js";
5
+ import { r as a } from "../chunks/projection-oPe6ipjL.js";
6
+ import { html as o } from "lit";
7
+ import { property as s } from "lit/decorators.js";
7
8
  //#region src/components/hamburger.ts
8
- var s = class extends e {
9
+ a();
10
+ var c = class extends e {
9
11
  constructor(...e) {
10
- super(...e), this._activation = new n(this, { disabled: () => i(this) }), this.open = !1, this.size = "md", this._unwatch = null, this._handleClick = () => {
11
- if (i(this)) return;
12
- this.open = !this.open;
13
- let e = { reason: "trigger" };
14
- this.open ? this.dispatchEvent(new CustomEvent("void-open", {
12
+ super(...e), this._activation = new n(this, {
13
+ disabled: () => i(this),
14
+ activate: () => {
15
+ this._byKey = !0;
16
+ try {
17
+ this.click();
18
+ } finally {
19
+ this._byKey = !1;
20
+ }
21
+ }
22
+ }), this._byKey = !1, this.open = !1, this.size = "md", this._unwatch = null, this._handleClick = () => {
23
+ i(this) || (this.open = !this.open, this.open ? this.dispatchEvent(new CustomEvent("void-open", {
15
24
  bubbles: !1,
16
- detail: e
25
+ detail: { reason: this._byKey ? "keyboard" : "trigger" }
17
26
  })) : this.dispatchEvent(new CustomEvent("void-close", {
18
27
  bubbles: !1,
19
- detail: e
20
- }));
21
- };
28
+ detail: { reason: "trigger" }
29
+ })));
30
+ }, this._writtenLabel = null;
22
31
  }
23
32
  _syncDisabled() {
24
33
  let e = i(this);
25
34
  this.setHostAttribute("aria-disabled", e ? "true" : null), this.setHostAttribute("tabindex", e ? "-1" : "0");
26
35
  }
27
36
  connectedCallback() {
28
- super.connectedCallback(), this.setHostAttribute("role", "button"), this._syncDisabled(), this._unwatch = r(this, () => this._syncDisabled()), this.setHostAttribute("aria-expanded", String(this.open)), this.setHostAttribute("aria-label", this.open ? "Close menu" : "Menu"), this.addEventListener("click", this._handleClick);
37
+ super.connectedCallback(), this.setHostAttribute("role", "button"), this._syncDisabled(), this._unwatch = r(this, () => this._syncDisabled()), this.setHostAttribute("aria-expanded", String(this.open)), this._syncLabel(), this.addEventListener("click", this._handleClick);
29
38
  }
30
39
  disconnectedCallback() {
31
40
  super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this._unwatch?.(), this._unwatch = null;
32
41
  }
33
42
  updated(e) {
34
- e.has("open") && (this.setHostAttribute("aria-expanded", String(this.open)), this.setHostAttribute("aria-label", this.open ? "Close menu" : "Menu"));
43
+ e.has("open") && (this.setHostAttribute("aria-expanded", String(this.open)), this._syncLabel());
44
+ }
45
+ _syncLabel() {
46
+ let e = this.getAttribute("aria-label");
47
+ this.hasAttribute("aria-labelledby") || e !== null && e !== this._writtenLabel || (this._writtenLabel = this.open ? "Close menu" : "Menu", this.setHostAttribute("aria-label", this._writtenLabel));
35
48
  }
36
49
  render() {
37
- return a`
50
+ return o`
38
51
  <span class="void-hamburger-lines">
39
52
  <span class="void-hamburger-line"></span>
40
53
  <span class="void-hamburger-line"></span>
@@ -43,12 +56,12 @@ var s = class extends e {
43
56
  `;
44
57
  }
45
58
  };
46
- t([o({
59
+ t([s({
47
60
  type: Boolean,
48
61
  reflect: !0
49
- })], s.prototype, "open", void 0), t([o({
62
+ })], c.prototype, "open", void 0), t([s({
50
63
  type: String,
51
64
  reflect: !0
52
- })], s.prototype, "size", void 0), customElements.get("void-hamburger") || customElements.define("void-hamburger", s);
65
+ })], c.prototype, "size", void 0), customElements.get("void-hamburger") || customElements.define("void-hamburger", c);
53
66
  //#endregion
54
- export { s as VoidHamburger };
67
+ export { c as VoidHamburger };
@@ -1,7 +1,7 @@
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 { i as n, n as r } from "../chunks/parts-CMQQop0D.js";
4
- import { t as i } from "../chunks/overlay-BywGMcDW.js";
3
+ import { i as n, n as r } from "../chunks/parts-DI_3VpSy.js";
4
+ import { t as i } from "../chunks/overlay-CH7L4N-h.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/hover-card.ts
7
7
  var o = class extends e {
@@ -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/indicator.ts
6
- var i = class extends e {
7
+ n();
8
+ var a = class extends e {
7
9
  constructor(...e) {
8
10
  super(...e), this.color = "default", this.placement = "top-right", this.count = null, this.ping = !1, this.size = "md";
9
11
  }
@@ -14,24 +16,24 @@ var i = class extends e {
14
16
  this.setHostAttribute("aria-label", this.count == null ? "notification" : `${this.count} ${this.count === 1 ? "notification" : "notifications"}`);
15
17
  }
16
18
  render() {
17
- return n`<span class="void-indicator-dot">${this.count == null ? "" : String(this.count)}</span>`;
19
+ return r`<span class="void-indicator-dot">${this.count == null ? "" : String(this.count)}</span>`;
18
20
  }
19
21
  };
20
- t([r({
22
+ t([i({
21
23
  type: String,
22
24
  reflect: !0
23
- })], i.prototype, "color", void 0), t([r({
25
+ })], a.prototype, "color", void 0), t([i({
24
26
  type: String,
25
27
  reflect: !0
26
- })], i.prototype, "placement", void 0), t([r({
28
+ })], a.prototype, "placement", void 0), t([i({
27
29
  type: Number,
28
30
  reflect: !0
29
- })], i.prototype, "count", void 0), t([r({
31
+ })], a.prototype, "count", void 0), t([i({
30
32
  type: Boolean,
31
33
  reflect: !0
32
- })], i.prototype, "ping", void 0), t([r({
34
+ })], a.prototype, "ping", void 0), t([i({
33
35
  type: String,
34
36
  reflect: !0
35
- })], i.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", i);
37
+ })], a.prototype, "size", void 0), customElements.get("void-indicator") || customElements.define("void-indicator", a);
36
38
  //#endregion
37
- export { i as VoidIndicator };
39
+ export { a as VoidIndicator };
@@ -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
3
  import { n } from "../chunks/form-control-C0vH6gii.js";
4
- import { n as r, t as i } from "../chunks/secret-value-CmTtVkMg.js";
5
- import { html as a, nothing as o } from "lit";
6
- import { property as s } from "lit/decorators.js";
7
- import { live as c } from "lit/directives/live.js";
4
+ import { r } from "../chunks/projection-oPe6ipjL.js";
5
+ import { n as i, t as a } from "../chunks/secret-value-CmTtVkMg.js";
6
+ import { html as o, nothing as s } from "lit";
7
+ import { property as c } from "lit/decorators.js";
8
+ import { live as l } from "lit/directives/live.js";
8
9
  //#region src/components/input.ts
9
- var l = class t extends n(e) {
10
+ r();
11
+ var u = class t extends n(e) {
10
12
  constructor(...e) {
11
13
  super(...e), this.type = "text", this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.size = "md", this.error = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.pattern = "", this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null;
12
14
  }
@@ -16,37 +18,37 @@ var l = class t extends n(e) {
16
18
  static {
17
19
  this.editState = ["value"];
18
20
  }
19
- requestUpdate(e, n, i) {
20
- super.requestUpdate(e, n, r(this.type === "password", e, i, () => t.getPropertyOptions("value")));
21
+ requestUpdate(e, n, r) {
22
+ super.requestUpdate(e, n, i(this.type === "password", e, r, () => t.getPropertyOptions("value")));
21
23
  }
22
24
  updated(e) {
23
- super.updated(e), this.type === "password" && e.get("type") !== void 0 && i(this);
25
+ super.updated(e), this.type === "password" && e.get("type") !== void 0 && a(this);
24
26
  }
25
27
  render() {
26
- return a`
28
+ return o`
27
29
  <input
28
30
  type=${this.type}
29
- .value=${c(this.value)}
31
+ .value=${l(this.value)}
30
32
  placeholder=${this.placeholder}
31
33
  ?disabled=${this.disabled}
32
34
  ?readonly=${this.readonly}
33
35
  ?required=${this.required}
34
36
  name=${this.name}
35
- autocomplete=${this.autocomplete || o}
36
- minlength=${this.minlength ?? o}
37
- maxlength=${this.maxlength ?? o}
38
- pattern=${this.pattern || o}
39
- inputmode=${this.inputMode || o}
40
- enterkeyhint=${this.enterKeyHint || o}
41
- autocapitalize=${this.autocapitalize || o}
42
- spellcheck=${this.spellcheckAttr ?? o}
43
- form=${this.formAttr ?? o}
37
+ autocomplete=${this.autocomplete || s}
38
+ minlength=${this.minlength ?? s}
39
+ maxlength=${this.maxlength ?? s}
40
+ pattern=${this.pattern || s}
41
+ inputmode=${this.inputMode || s}
42
+ enterkeyhint=${this.enterKeyHint || s}
43
+ autocapitalize=${this.autocapitalize || s}
44
+ spellcheck=${this.spellcheckAttr ?? s}
45
+ form=${this.formAttr ?? s}
44
46
  aria-invalid=${this.error ? "true" : "false"}
45
47
  @input=${this._onInput}
46
48
  @change=${this._onChange}
47
49
  @keydown=${this._onKeydown}
48
50
  />
49
- ${this.error ? a`<span class="void-input-error">${this.error}</span>` : ""}
51
+ ${this.error ? o`<span class="void-input-error">${this.error}</span>` : ""}
50
52
  `;
51
53
  }
52
54
  formWriteNativeDefault(e) {
@@ -66,7 +68,7 @@ var l = class t extends n(e) {
66
68
  let t = e.target.form;
67
69
  if (!t) return;
68
70
  let n = Array.from(t.elements);
69
- if (n.some((e) => e instanceof HTMLButtonElement && e.type === "submit" || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "image")) || n.filter((e) => e instanceof HTMLInputElement && u.has(e.type)).length <= 1) return;
71
+ if (n.some((e) => e instanceof HTMLButtonElement && e.type === "submit" || e instanceof HTMLInputElement && (e.type === "submit" || e.type === "image")) || n.filter((e) => e instanceof HTMLInputElement && d.has(e.type)).length <= 1) return;
70
72
  let r = [...n, ...Array.from(t.querySelectorAll("void-button"))].find((e) => e.tagName === "VOID-BUTTON" && e.getAttribute("type") === "submit");
71
73
  !r || r.formDisabled || (e.preventDefault(), t.requestSubmit());
72
74
  }
@@ -87,47 +89,47 @@ var l = class t extends n(e) {
87
89
  }));
88
90
  }
89
91
  };
90
- t([s({
92
+ t([c({
91
93
  type: String,
92
94
  reflect: !0
93
- })], l.prototype, "type", void 0), t([s({
95
+ })], u.prototype, "type", void 0), t([c({
94
96
  type: String,
95
97
  reflect: !0
96
- })], l.prototype, "value", void 0), t([s({
98
+ })], u.prototype, "value", void 0), t([c({
97
99
  type: String,
98
100
  reflect: !0
99
- })], l.prototype, "placeholder", void 0), t([s({
101
+ })], u.prototype, "placeholder", void 0), t([c({
100
102
  type: Boolean,
101
103
  reflect: !0
102
- })], l.prototype, "disabled", void 0), t([s({
104
+ })], u.prototype, "disabled", void 0), t([c({
103
105
  type: Boolean,
104
106
  reflect: !0
105
- })], l.prototype, "readonly", void 0), t([s({
107
+ })], u.prototype, "readonly", void 0), t([c({
106
108
  type: Boolean,
107
109
  reflect: !0
108
- })], l.prototype, "required", void 0), t([s({
110
+ })], u.prototype, "required", void 0), t([c({
109
111
  type: String,
110
112
  reflect: !0
111
- })], l.prototype, "name", void 0), t([s({
113
+ })], u.prototype, "name", void 0), t([c({
112
114
  type: String,
113
115
  reflect: !0
114
- })], l.prototype, "size", void 0), t([s({
116
+ })], u.prototype, "size", void 0), t([c({
115
117
  type: String,
116
118
  reflect: !0
117
- })], l.prototype, "error", void 0), t([s({
119
+ })], u.prototype, "error", void 0), t([c({
118
120
  type: String,
119
121
  reflect: !0
120
- })], l.prototype, "autocomplete", void 0), t([s({ type: Number })], l.prototype, "minlength", void 0), t([s({ type: Number })], l.prototype, "maxlength", void 0), t([s({ type: String })], l.prototype, "pattern", void 0), t([s({
122
+ })], u.prototype, "autocomplete", void 0), t([c({ type: Number })], u.prototype, "minlength", void 0), t([c({ type: Number })], u.prototype, "maxlength", void 0), t([c({ type: String })], u.prototype, "pattern", void 0), t([c({
121
123
  type: String,
122
124
  attribute: "inputmode"
123
- })], l.prototype, "inputMode", void 0), t([s({
125
+ })], u.prototype, "inputMode", void 0), t([c({
124
126
  type: String,
125
127
  attribute: "enterkeyhint"
126
- })], l.prototype, "enterKeyHint", void 0), t([s({ type: String })], l.prototype, "autocapitalize", void 0), t([s({
128
+ })], u.prototype, "enterKeyHint", void 0), t([c({ type: String })], u.prototype, "autocapitalize", void 0), t([c({
127
129
  type: String,
128
130
  attribute: "spellcheck"
129
- })], l.prototype, "spellcheckAttr", void 0);
130
- var u = new Set([
131
+ })], u.prototype, "spellcheckAttr", void 0);
132
+ var d = new Set([
131
133
  "text",
132
134
  "search",
133
135
  "url",
@@ -141,6 +143,6 @@ var u = new Set([
141
143
  "datetime-local",
142
144
  "number"
143
145
  ]);
144
- customElements.get("void-input") || customElements.define("void-input", l);
146
+ customElements.get("void-input") || customElements.define("void-input", u);
145
147
  //#endregion
146
- export { l as VoidInput };
148
+ export { u as VoidInput };
@@ -10,8 +10,10 @@ export interface LineChartData {
10
10
  }
11
11
  /**
12
12
  * Line chart for trends over time with one or more series, linear or stepped, drawn in SVG with an animated
13
- * entry. Give it `data` (`{ series: [{ name, values }], labels }`) from script; it has no children. The chart
14
- * is an image to assistive technology, so set `aria-label` and state the key figures in the surrounding text.
13
+ * entry. Give it `data` (`{ series: [{ name, values }], labels }`) as the `data` property or as JSON in the
14
+ * `data` attribute, so server-rendered markup draws it with no script; it has no children. The drawing is
15
+ * hidden from assistive technology and a visually hidden data table (captioned with `aria-label`) carries
16
+ * the values instead; add `show-table` to show the table below the chart too.
15
17
  */
16
18
  export declare class VoidLineChart extends VoidElement {
17
19
  /** Height of the chart in pixels. Defaults to 220. The width fills the container. */
@@ -29,18 +31,29 @@ export declare class VoidLineChart extends VoidElement {
29
31
  */
30
32
  interpolation: 'linear' | 'step';
31
33
  /**
32
- * Accessible name of the chart, such as `Visitors per day`. The chart is an image to assistive
33
- * technology, so set it and put the key figures in the text around it.
34
+ * Accessible name of the chart, such as `Visitors per day`; it is also the caption of the data table.
35
+ * Set it: the drawing itself is hidden from assistive technology.
34
36
  */
35
37
  ariaLabel: string;
38
+ /**
39
+ * Show the data table (one row per point, one column per series) below the chart. The table is always
40
+ * there for assistive technology; this makes it visible too.
41
+ */
42
+ showTable: boolean;
36
43
  private _data;
44
+ private _source;
45
+ private _entered;
37
46
  /**
38
47
  * The chart's data: `{ series: [{ name, values, color? }], labels? }`. `values` are aligned with `labels`
39
- * (the names along the horizontal axis); `color` overrides a series' colour. Property only: assign a new
40
- * object to update the chart and animate to it.
48
+ * (the names along the horizontal axis); `color` overrides a series' colour. Give it as a property
49
+ * (assign a new object to update the chart and animate to it) or as JSON in the `data` attribute:
50
+ * `<void-line-chart data='{"series":[{"name":"Visitors","values":[3,5,4]}],"labels":["Mon","Tue","Wed"]}'>`.
51
+ * Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the
52
+ * attribute (the data can be large), and an attribute a server morph leaves unchanged does not animate again.
53
+ * @default { series: [] }
41
54
  */
42
55
  get data(): LineChartData;
43
- set data(next: LineChartData);
56
+ set data(input: LineChartData);
44
57
  private _phase;
45
58
  private _display;
46
59
  private _targets;
@@ -60,6 +73,8 @@ export declare class VoidLineChart extends VoidElement {
60
73
  private _onMouseMove;
61
74
  private _onMouseLeave;
62
75
  render(): import('lit').TemplateResult<1>;
76
+ /** The data table for assistive technology (and `show-table`), from the data as given, not the animated state. */
77
+ private _table;
63
78
  private _renderHover;
64
79
  }
65
80
  declare global {