@voidable/ui 0.11.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +1 -1
  2. package/dist/angular/index.d.ts +2 -2
  3. package/dist/angular/index.js +2 -1
  4. package/dist/chunks/activation-B8aBarKd.js +4 -0
  5. package/dist/chunks/carousel-C9u0bg5l.js +10 -0
  6. package/dist/chunks/choice-BTrsi7OW.js +16 -0
  7. package/dist/chunks/data-Baycjoo4.js +96 -0
  8. package/dist/chunks/fields-MEqz-olE.js +21 -0
  9. package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
  10. package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
  11. package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
  12. package/dist/chunks/menu-CxRRgkJI.js +21 -0
  13. package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
  14. package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
  15. package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
  16. package/dist/chunks/overlay-K1ilWC1p.js +4 -0
  17. package/dist/chunks/pickers-CjlFgNke.js +36 -0
  18. package/dist/chunks/table-BBpqwWEi.js +4 -0
  19. package/dist/chunks/tabs-Buf3EBWq.js +10 -0
  20. package/dist/components/accordion.d.ts +7 -0
  21. package/dist/components/accordion.js +22 -14
  22. package/dist/components/action-input.d.ts +2 -1
  23. package/dist/components/action-input.js +59 -55
  24. package/dist/components/bar-chart.js +41 -40
  25. package/dist/components/breadcrumbs.d.ts +2 -0
  26. package/dist/components/breadcrumbs.js +15 -11
  27. package/dist/components/button.d.ts +7 -0
  28. package/dist/components/button.js +23 -16
  29. package/dist/components/calendar.d.ts +45 -10
  30. package/dist/components/calendar.js +183 -129
  31. package/dist/components/carousel.d.ts +22 -0
  32. package/dist/components/carousel.js +64 -35
  33. package/dist/components/charts/data.d.ts +2 -2
  34. package/dist/components/checkbox-group.js +22 -21
  35. package/dist/components/checkbox.d.ts +7 -0
  36. package/dist/components/checkbox.js +29 -24
  37. package/dist/components/collapsible.d.ts +7 -0
  38. package/dist/components/collapsible.js +19 -11
  39. package/dist/components/color-picker.js +28 -27
  40. package/dist/components/combobox.d.ts +13 -1
  41. package/dist/components/combobox.js +54 -41
  42. package/dist/components/compose-input.d.ts +9 -1
  43. package/dist/components/compose-input.js +28 -16
  44. package/dist/components/dialog.js +1 -1
  45. package/dist/components/donut-chart.js +57 -56
  46. package/dist/components/drawer.js +1 -1
  47. package/dist/components/dropdown-menu.d.ts +22 -0
  48. package/dist/components/dropdown-menu.js +54 -39
  49. package/dist/components/editable.d.ts +11 -1
  50. package/dist/components/editable.js +35 -22
  51. package/dist/components/error-fallback.d.ts +4 -2
  52. package/dist/components/error-fallback.js +34 -28
  53. package/dist/components/file-upload.d.ts +9 -0
  54. package/dist/components/file-upload.js +54 -28
  55. package/dist/components/gauge.js +108 -107
  56. package/dist/components/hamburger.d.ts +7 -0
  57. package/dist/components/hamburger.js +28 -19
  58. package/dist/components/hover-card.d.ts +7 -0
  59. package/dist/components/hover-card.js +22 -14
  60. package/dist/components/indicator.js +15 -14
  61. package/dist/components/input.js +1 -1
  62. package/dist/components/line-chart.js +43 -42
  63. package/dist/components/menu.d.ts +25 -0
  64. package/dist/components/menu.js +55 -33
  65. package/dist/components/multiselect.d.ts +17 -1
  66. package/dist/components/multiselect.js +96 -74
  67. package/dist/components/nav-menu.d.ts +9 -0
  68. package/dist/components/nav-menu.js +30 -23
  69. package/dist/components/number-input.d.ts +15 -1
  70. package/dist/components/number-input.js +71 -37
  71. package/dist/components/pagination.js +25 -24
  72. package/dist/components/pin-input.d.ts +11 -0
  73. package/dist/components/pin-input.js +46 -32
  74. package/dist/components/popover.d.ts +7 -0
  75. package/dist/components/popover.js +21 -13
  76. package/dist/components/radio-group.js +1 -1
  77. package/dist/components/radio.d.ts +10 -1
  78. package/dist/components/radio.js +37 -32
  79. package/dist/components/segmented-control.d.ts +14 -0
  80. package/dist/components/segmented-control.js +40 -28
  81. package/dist/components/sidebar.d.ts +1 -0
  82. package/dist/components/sidebar.js +14 -10
  83. package/dist/components/slider.js +1 -1
  84. package/dist/components/spinner.d.ts +5 -3
  85. package/dist/components/spinner.js +21 -14
  86. package/dist/components/stat.js +1 -1
  87. package/dist/components/status-dot.d.ts +2 -2
  88. package/dist/components/status-dot.js +12 -14
  89. package/dist/components/stepper.d.ts +2 -0
  90. package/dist/components/stepper.js +20 -13
  91. package/dist/components/switch.d.ts +7 -0
  92. package/dist/components/switch.js +24 -16
  93. package/dist/components/table.d.ts +77 -1
  94. package/dist/components/table.js +562 -73
  95. package/dist/components/tabs.d.ts +11 -0
  96. package/dist/components/tabs.js +42 -33
  97. package/dist/components/tag.js +12 -11
  98. package/dist/components/tags-input.d.ts +10 -1
  99. package/dist/components/tags-input.js +42 -30
  100. package/dist/components/textarea.js +1 -1
  101. package/dist/components/toast.d.ts +2 -0
  102. package/dist/components/toast.js +35 -28
  103. package/dist/components/toggle-group.d.ts +8 -0
  104. package/dist/components/toggle-group.js +24 -17
  105. package/dist/components/toggle.d.ts +7 -0
  106. package/dist/components/toggle.js +23 -15
  107. package/dist/components/tooltip.d.ts +7 -0
  108. package/dist/components/tooltip.js +20 -12
  109. package/dist/components.json +96 -74
  110. package/dist/custom-elements.json +4213 -131
  111. package/dist/dev/rules.d.ts +0 -1
  112. package/dist/dev/types.d.ts +3 -1
  113. package/dist/dev.js +244 -113
  114. package/dist/index.d.ts +4 -0
  115. package/dist/index.js +68 -66
  116. package/dist/keyboard-activation.d.ts +9 -9
  117. package/dist/keyboard.d.ts +2 -10
  118. package/dist/keymaps/activation.d.ts +8 -0
  119. package/dist/keymaps/carousel.d.ts +9 -0
  120. package/dist/keymaps/choice.d.ts +21 -0
  121. package/dist/keymaps/fields.d.ts +31 -0
  122. package/dist/keymaps/index.d.ts +2 -0
  123. package/dist/keymaps/menu.d.ts +36 -0
  124. package/dist/keymaps/nav-menu.d.ts +11 -0
  125. package/dist/keymaps/overlay.d.ts +4 -0
  126. package/dist/keymaps/pickers.d.ts +36 -0
  127. package/dist/keymaps/table.d.ts +8 -0
  128. package/dist/keymaps/tabs.d.ts +7 -0
  129. package/dist/keymaps.js +51 -0
  130. package/dist/keys.d.ts +46 -0
  131. package/dist/keys.js +57 -0
  132. package/dist/llms.txt +11 -3
  133. package/dist/messages/ar.d.ts +1 -0
  134. package/dist/messages/ar.js +130 -0
  135. package/dist/messages/fr.d.ts +1 -0
  136. package/dist/messages/fr.js +109 -0
  137. package/dist/messages.d.ts +213 -0
  138. package/dist/messages.js +190 -0
  139. package/dist/modal.d.ts +7 -0
  140. package/dist/reference.md +817 -17
  141. package/dist/testing/index.d.ts +46 -0
  142. package/dist/testing.js +79 -0
  143. package/dist/types/elements.d.ts +89 -73
  144. package/dist/types/react.d.ts +5 -1
  145. package/dist/types/solid.d.ts +5 -1
  146. package/dist/types/solid2.d.ts +4 -0
  147. package/dist/types/svelte.d.ts +5 -1
  148. package/dist/types/vue.d.ts +5 -1
  149. package/dist/vscode.html-custom-data.json +384 -18
  150. package/dist/web-types.json +830 -69
  151. package/package.json +22 -2
  152. package/dist/chunks/data-BpiiNapL.js +0 -95
@@ -1,36 +1,35 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
4
- import { n as r } from "../chunks/form-control-C0vH6gii.js";
5
- import { t as i } from "../chunks/projection-oPe6ipjL.js";
6
- import { a, r as o } from "../chunks/keyboard-CEhMSkws.js";
7
- import { html as s, nothing as c } from "lit";
8
- import { property as l } from "lit/decorators.js";
3
+ import { actionFor as n, keysConverter as r } from "../keys.js";
4
+ import { t as i } from "../chunks/keyboard-activation-BfEyoaMT.js";
5
+ import { n as a } from "../chunks/form-control-fL-Hhy91.js";
6
+ import { t as o } from "../chunks/projection-oPe6ipjL.js";
7
+ import { r as s } from "../chunks/keyboard-ChtDvhB_.js";
8
+ import { n as c } from "../chunks/choice-BTrsi7OW.js";
9
+ import { html as l, nothing as u } from "lit";
10
+ import { property as d } from "lit/decorators.js";
9
11
  //#region src/components/radio.ts
10
- var u = !1;
12
+ var f = !1;
11
13
  typeof document < "u" && (document.addEventListener("keydown", (e) => {
12
- u = e.key === "Tab" && e.shiftKey;
14
+ f = e.key === "Tab" && e.shiftKey;
13
15
  }, !0), document.addEventListener("pointerdown", () => {
14
- u = !1;
16
+ f = !1;
15
17
  }, !0));
16
- var d = class t extends r(e) {
18
+ var p = class t extends a(e) {
17
19
  constructor(...e) {
18
- super(...e), this._activation = new n(this, {
19
- enter: !1,
20
- disabled: () => this.formDisabled
21
- }), this.checked = !1, this.disabled = !1, this.name = "", this.value = "on", this.required = !1, this.color = "default", this.size = "md", this._projection = new i(this, { regions: [{
20
+ super(...e), this.keys = null, this._activation = new i(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.name = "", this.value = "on", this.required = !1, this.color = "default", this.size = "md", this._projection = new o(this, { regions: [{
22
21
  name: "label",
23
22
  target: "after"
24
23
  }] }), this._anchor = null, this._hasFocus = !1, this._handleKeydown = (e) => {
25
- if (e.altKey || e.ctrlKey || e.metaKey || e.defaultPrevented || e.target !== this) return;
26
- let t = o(this), n = e.key === t.next || e.key === "ArrowDown";
27
- if (!n && e.key !== t.prev && e.key !== "ArrowUp") return;
24
+ let t = n(this, e);
25
+ if (t !== "next" && t !== "previous" || e.target !== this) return;
26
+ let r = t === "next";
28
27
  e.preventDefault();
29
- let r = this._peers(), i = r[a(r.map((e) => e.formDisabled), r.indexOf(this), n ? 1 : -1)];
30
- i && (i.focus(), i.click());
28
+ let i = this._peers(), a = i[s(i.map((e) => e.formDisabled), i.indexOf(this), r ? 1 : -1)];
29
+ a && (a.focus(), a.click());
31
30
  }, this._handleFocus = (e) => {
32
31
  let t = this._peers(), n = e.relatedTarget;
33
- if (u && n && !t.some((e) => e.contains(n)) && !t.some((e) => !e.formDisabled && e._isOn()) && this.compareDocumentPosition(n) & Node.DOCUMENT_POSITION_FOLLOWING) {
32
+ if (f && n && !t.some((e) => e.contains(n)) && !t.some((e) => !e.formDisabled && e._isOn()) && this.compareDocumentPosition(n) & Node.DOCUMENT_POSITION_FOLLOWING) {
34
33
  let e = t.filter((e) => !e.formDisabled).pop();
35
34
  if (e && e !== this) {
36
35
  e.focus();
@@ -67,6 +66,9 @@ var d = class t extends r(e) {
67
66
  }));
68
67
  };
69
68
  }
69
+ static {
70
+ this.keyMap = c;
71
+ }
70
72
  connectedCallback() {
71
73
  super.connectedCallback(), this.setHostAttribute("role", "radio"), this.setHostAttribute("aria-checked", String(this._isOn())), this._anchor = this.closest("void-radio-group") ?? this.form ?? this.getRootNode(), this.setHostAttribute("tabindex", "-1"), this._syncTabStops(), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown), this.addEventListener("focus", this._handleFocus), this.addEventListener("blur", this._handleBlur);
72
74
  }
@@ -100,10 +102,10 @@ var d = class t extends r(e) {
100
102
  for (let t of e) t.setHostAttribute("tabindex", t === n ? "0" : "-1");
101
103
  }
102
104
  render() {
103
- return s`
104
- <input type="radio" .checked=${this.checked} ?disabled=${this.formDisabled} ?required=${this.required} name=${this.name} value=${this.value} form=${this.formAttr ?? c} tabindex="-1" aria-hidden="true" inert @invalid=${this._onNativeInvalid} @focus=${this._onNativeFocus} />
105
+ return l`
106
+ <input type="radio" .checked=${this.checked} ?disabled=${this.formDisabled} ?required=${this.required} name=${this.name} value=${this.value} form=${this.formAttr ?? u} tabindex="-1" aria-hidden="true" inert @invalid=${this._onNativeInvalid} @focus=${this._onNativeFocus} />
105
107
  <span class="void-radio-circle">
106
- ${this.checked ? s`<span class="void-radio-dot"></span>` : ""}
108
+ ${this.checked ? l`<span class="void-radio-dot"></span>` : ""}
107
109
  </span>
108
110
  `;
109
111
  }
@@ -130,27 +132,30 @@ var d = class t extends r(e) {
130
132
  }
131
133
  }
132
134
  };
133
- t([l({
135
+ t([d({
136
+ attribute: "keys",
137
+ converter: r
138
+ })], p.prototype, "keys", void 0), t([d({
134
139
  type: Boolean,
135
140
  reflect: !0
136
- })], d.prototype, "checked", void 0), t([l({
141
+ })], p.prototype, "checked", void 0), t([d({
137
142
  type: Boolean,
138
143
  reflect: !0
139
- })], d.prototype, "disabled", void 0), t([l({
144
+ })], p.prototype, "disabled", void 0), t([d({
140
145
  type: String,
141
146
  reflect: !0
142
- })], d.prototype, "name", void 0), t([l({
147
+ })], p.prototype, "name", void 0), t([d({
143
148
  type: String,
144
149
  reflect: !0
145
- })], d.prototype, "value", void 0), t([l({
150
+ })], p.prototype, "value", void 0), t([d({
146
151
  type: Boolean,
147
152
  reflect: !0
148
- })], d.prototype, "required", void 0), t([l({
153
+ })], p.prototype, "required", void 0), t([d({
149
154
  type: String,
150
155
  reflect: !0
151
- })], d.prototype, "color", void 0), t([l({
156
+ })], p.prototype, "color", void 0), t([d({
152
157
  type: String,
153
158
  reflect: !0
154
- })], d.prototype, "size", void 0), customElements.get("void-radio") || customElements.define("void-radio", d);
159
+ })], p.prototype, "size", void 0), customElements.get("void-radio") || customElements.define("void-radio", p);
155
160
  //#endregion
156
- export { d as VoidRadio };
161
+ export { p as VoidRadio };
@@ -1,8 +1,15 @@
1
1
  import { VoidElement } from '../base.js';
2
2
  import { KeyboardActivation } from '../keyboard-activation.js';
3
3
  import { FormSubmission } from '../form-control.js';
4
+ import { KeyOverrides } from '../keys.js';
4
5
  /** Individual option within a VoidSegmentedControl button group. */
5
6
  export declare class VoidSegmentedControlItem extends VoidElement {
7
+ /** Key bindings for this element's actions, as JSON (`{"activate":["Space"]}`); `[]` switches an action off. See the keyboard guide. */
8
+ keys: KeyOverrides | null;
9
+ /** @internal The actions of this element and their default keys. */
10
+ static readonly keyMap: {
11
+ activate: string[];
12
+ };
6
13
  /** Space fires a real `click`, which the control turns into a selection. */
7
14
  protected readonly _activation: KeyboardActivation;
8
15
  /**
@@ -32,6 +39,13 @@ declare const VoidSegmentedControl_base: (new (...args: any[]) => import('../for
32
39
  * items; with nothing selected, the first or the last); Space selects the focused item.
33
40
  */
34
41
  export declare class VoidSegmentedControl extends VoidSegmentedControl_base {
42
+ /** Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. */
43
+ keys: KeyOverrides | null;
44
+ /** @internal The actions of this element and their default keys. */
45
+ static readonly keyMap: {
46
+ next: string[];
47
+ previous: string[];
48
+ };
35
49
  /**
36
50
  * `value` of the selected item. Selection follows focus, so each arrow key changes it and fires
37
51
  * `void-change`. Reflected to the attribute as it changes; the form's reset target stays the value it started with.
@@ -1,16 +1,19 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
4
- import { t as r } from "../chunks/form-control-C0vH6gii.js";
5
- import { a as i, n as a, r as o } from "../chunks/keyboard-CEhMSkws.js";
6
- import { property as s } from "lit/decorators.js";
3
+ import { actionFor as n, keysConverter as r } from "../keys.js";
4
+ import { t as i } from "../chunks/keyboard-activation-BfEyoaMT.js";
5
+ import { n as a } from "../chunks/activation-B8aBarKd.js";
6
+ import { t as o } from "../chunks/form-control-fL-Hhy91.js";
7
+ import { n as s, r as c } from "../chunks/keyboard-ChtDvhB_.js";
8
+ import { t as l } from "../chunks/choice-BTrsi7OW.js";
9
+ import { property as u } from "lit/decorators.js";
7
10
  //#region src/components/segmented-control.ts
8
- var c = class extends e {
11
+ var d = class extends e {
9
12
  constructor(...e) {
10
- super(...e), this._activation = new n(this, {
11
- enter: !1,
12
- disabled: () => this.disabled
13
- }), this.value = "", this.disabled = !1;
13
+ super(...e), this.keys = null, this._activation = new i(this, { disabled: () => this.disabled }), this.value = "", this.disabled = !1;
14
+ }
15
+ static {
16
+ this.keyMap = a;
14
17
  }
15
18
  connectedCallback() {
16
19
  super.connectedCallback(), this.setHostAttribute("role", "radio");
@@ -27,29 +30,35 @@ var c = class extends e {
27
30
  this.setHostAttribute("aria-checked", String(e)), this.setHostAttribute("tabindex", t && !n ? "0" : "-1"), this.setHostAttribute("aria-disabled", n ? "true" : null);
28
31
  }
29
32
  };
30
- t([s({
33
+ t([u({
34
+ attribute: "keys",
35
+ converter: r
36
+ })], d.prototype, "keys", void 0), t([u({
31
37
  type: String,
32
38
  reflect: !0
33
- })], c.prototype, "value", void 0), t([s({
39
+ })], d.prototype, "value", void 0), t([u({
34
40
  type: Boolean,
35
41
  reflect: !0
36
- })], c.prototype, "disabled", void 0), customElements.get("void-segmented-control-item") || customElements.define("void-segmented-control-item", c);
37
- var l = class extends r(e) {
42
+ })], d.prototype, "disabled", void 0), customElements.get("void-segmented-control-item") || customElements.define("void-segmented-control-item", d);
43
+ var f = class extends o(e) {
38
44
  constructor(...e) {
39
- super(...e), this.value = "", this.disabled = !1, this.size = "md", this.color = "default", this._observer = null, this._itemsSynced = !1, this._handleClick = (e) => {
45
+ super(...e), this.keys = null, this.value = "", this.disabled = !1, this.size = "md", this.color = "default", this._observer = null, this._itemsSynced = !1, this._handleClick = (e) => {
40
46
  let t = e.target.closest("void-segmented-control-item");
41
47
  t && this._select(t);
42
48
  }, this._handleKeydown = (e) => {
43
- if (e.altKey || e.ctrlKey || e.metaKey || this.formDisabled) return;
44
- let t = this._items, n = e.target?.closest?.("void-segmented-control-item"), r = o(this), s = e.key === r.next || e.key === "ArrowDown";
45
- if (!s && e.key !== r.prev && e.key !== "ArrowUp") return;
49
+ let t = n(this, e);
50
+ if (t !== "next" && t !== "previous" || this.formDisabled) return;
51
+ let r = this._items, i = e.target?.closest?.("void-segmented-control-item"), a = t === "next";
46
52
  e.preventDefault();
47
- let c = t.map((e) => e.disabled), l = n ? t.indexOf(n) : t.findIndex((e) => e.value === this.value), u;
48
- u = l < 0 ? a(c, s ? 1 : -1) : i(c, l, s ? 1 : -1);
49
- let d = t[u];
53
+ let o = r.map((e) => e.disabled), l = i ? r.indexOf(i) : r.findIndex((e) => e.value === this.value), u;
54
+ u = l < 0 ? s(o, a ? 1 : -1) : c(o, l, a ? 1 : -1);
55
+ let d = r[u];
50
56
  d && (d.focus(), this._select(d));
51
57
  };
52
58
  }
59
+ static {
60
+ this.keyMap = l;
61
+ }
53
62
  connectedCallback() {
54
63
  super.connectedCallback(), this.setHostAttribute("role", "radiogroup"), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown), this._observer ??= new MutationObserver(() => this._syncItems()), this._observer.observe(this, {
55
64
  childList: !0,
@@ -69,11 +78,11 @@ var l = class extends r(e) {
69
78
  return this.value || null;
70
79
  }
71
80
  get _items() {
72
- return Array.from(this.querySelectorAll("void-segmented-control-item")).filter((e) => e instanceof c);
81
+ return Array.from(this.querySelectorAll("void-segmented-control-item")).filter((e) => e instanceof d);
73
82
  }
74
83
  _syncItems() {
75
84
  let e = this._items, t = this.formDisabled, n = e.findIndex((e) => e.value === this.value), r = n >= 0 && !e[n].disabled ? n : -1;
76
- r < 0 && (r = a(e.map((e) => e.disabled), 1)), e.forEach((e, i) => e._apply(i === n, i === r, t || e.disabled));
85
+ r < 0 && (r = s(e.map((e) => e.disabled), 1)), e.forEach((e, i) => e._apply(i === n, i === r, t || e.disabled));
77
86
  }
78
87
  _select(e) {
79
88
  e.disabled || this.formDisabled || e.value === this.value || (this.value = e.value, this._syncItems(), this.dispatchEvent(new CustomEvent("void-change", {
@@ -83,18 +92,21 @@ var l = class extends r(e) {
83
92
  })));
84
93
  }
85
94
  };
86
- t([s({
95
+ t([u({
96
+ attribute: "keys",
97
+ converter: r
98
+ })], f.prototype, "keys", void 0), t([u({
87
99
  type: String,
88
100
  reflect: !0
89
- })], l.prototype, "value", void 0), t([s({
101
+ })], f.prototype, "value", void 0), t([u({
90
102
  type: Boolean,
91
103
  reflect: !0
92
- })], l.prototype, "disabled", void 0), t([s({
104
+ })], f.prototype, "disabled", void 0), t([u({
93
105
  type: String,
94
106
  reflect: !0
95
- })], l.prototype, "size", void 0), t([s({
107
+ })], f.prototype, "size", void 0), t([u({
96
108
  type: String,
97
109
  reflect: !0
98
- })], l.prototype, "color", void 0), customElements.get("void-segmented-control") || customElements.define("void-segmented-control", l);
110
+ })], f.prototype, "color", void 0), customElements.get("void-segmented-control") || customElements.define("void-segmented-control", f);
99
111
  //#endregion
100
- export { l as VoidSegmentedControl, c as VoidSegmentedControlItem };
112
+ export { f as VoidSegmentedControl, d as VoidSegmentedControlItem };
@@ -27,6 +27,7 @@ export declare class VoidSidebar extends VoidElement {
27
27
  toggle(force?: boolean): void;
28
28
  connectedCallback(): void;
29
29
  disconnectedCallback(): void;
30
+ private _name;
30
31
  updated(changed: Map<string, unknown>): void;
31
32
  private _updateWidth;
32
33
  }
@@ -1,8 +1,9 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { property as n } from "lit/decorators.js";
3
+ import { msg as n, nameHost as r } from "../messages.js";
4
+ import { property as i } from "lit/decorators.js";
4
5
  //#region src/components/sidebar.ts
5
- var r = class extends e {
6
+ var a = class extends e {
6
7
  constructor(...e) {
7
8
  super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.side = "start";
8
9
  }
@@ -20,31 +21,34 @@ var r = class extends e {
20
21
  }));
21
22
  }
22
23
  connectedCallback() {
23
- super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.setHostAttribute("aria-label", "Sidebar navigation"), this._updateWidth();
24
+ super.connectedCallback(), this.setHostAttribute("role", "navigation"), this._name(), this._updateWidth();
24
25
  }
25
26
  disconnectedCallback() {
26
27
  super.disconnectedCallback();
27
28
  }
29
+ _name() {
30
+ r(this, n(this, "sidebar.label"), (e, t) => this.setHostAttribute(e, t));
31
+ }
28
32
  updated(e) {
29
- (e.has("collapsed") || e.has("width") || e.has("collapsedWidth")) && this._updateWidth();
33
+ this._name(), (e.has("collapsed") || e.has("width") || e.has("collapsedWidth")) && this._updateWidth();
30
34
  }
31
35
  _updateWidth() {
32
36
  this.setHostStyle("--void-sidebar-width", this.collapsed ? this.collapsedWidth : this.width);
33
37
  }
34
38
  };
35
- t([n({
39
+ t([i({
36
40
  type: Boolean,
37
41
  reflect: !0
38
- })], r.prototype, "collapsed", void 0), t([n({
42
+ })], a.prototype, "collapsed", void 0), t([i({
39
43
  type: String,
40
44
  reflect: !0
41
- })], r.prototype, "width", void 0), t([n({
45
+ })], a.prototype, "width", void 0), t([i({
42
46
  type: String,
43
47
  attribute: "collapsed-width",
44
48
  reflect: !0
45
- })], r.prototype, "collapsedWidth", void 0), t([n({
49
+ })], a.prototype, "collapsedWidth", void 0), t([i({
46
50
  type: String,
47
51
  reflect: !0
48
- })], r.prototype, "side", void 0), customElements.get("void-sidebar") || customElements.define("void-sidebar", r);
52
+ })], a.prototype, "side", void 0), customElements.get("void-sidebar") || customElements.define("void-sidebar", a);
49
53
  //#endregion
50
- export { r as VoidSidebar };
54
+ export { a as VoidSidebar };
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/form-control-C0vH6gii.js";
3
+ import { n } from "../chunks/form-control-fL-Hhy91.js";
4
4
  import { r } from "../chunks/projection-oPe6ipjL.js";
5
5
  import { html as i, nothing as a } from "lit";
6
6
  import { property as o } from "lit/decorators.js";
@@ -4,12 +4,14 @@ export declare class VoidSpinner extends VoidElement {
4
4
  /** Size step: `sm`, `md` (default) or `lg`. */
5
5
  size: 'sm' | 'md' | 'lg';
6
6
  /**
7
- * Text announced to screen readers while loading, and the spinner's accessible name. Defaults to
8
- * `Loading`; say what is loading (`Loading orders`).
7
+ * Text announced to screen readers while loading, and the spinner's accessible name. Defaults to the `spinner.label` message (English:
8
+ * `Loading`); say what is loading (`Loading orders`).
9
9
  */
10
10
  label: string;
11
11
  connectedCallback(): void;
12
- updated(changed: Map<string, unknown>): void;
12
+ private _text;
13
+ private _name;
14
+ updated(): void;
13
15
  render(): import('lit').TemplateResult<1>;
14
16
  }
15
17
  declare global {
@@ -1,30 +1,37 @@
1
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-oPe6ipjL.js";
4
- import { html as r } from "lit";
5
- import { property as i } from "lit/decorators.js";
3
+ import { msg as n, nameHost as r } from "../messages.js";
4
+ import { r as i } from "../chunks/projection-oPe6ipjL.js";
5
+ import { html as a } from "lit";
6
+ import { property as o } from "lit/decorators.js";
6
7
  //#region src/components/spinner.ts
7
- n();
8
- var a = class extends e {
8
+ i();
9
+ var s = class extends e {
9
10
  constructor(...e) {
10
- super(...e), this.size = "md", this.label = "Loading";
11
+ super(...e), this.size = "md", this.label = "";
11
12
  }
12
13
  connectedCallback() {
13
- super.connectedCallback(), this.setHostAttribute("role", "status"), this.setHostAttribute("aria-label", this.label);
14
+ super.connectedCallback(), this.setHostAttribute("role", "status"), this._name();
14
15
  }
15
- updated(e) {
16
- e.has("label") && this.setHostAttribute("aria-label", this.label);
16
+ _text() {
17
+ return this.label || n(this, "spinner.label");
18
+ }
19
+ _name() {
20
+ r(this, this._text(), (e, t) => this.setHostAttribute(e, t));
21
+ }
22
+ updated() {
23
+ this._name();
17
24
  }
18
25
  render() {
19
- return r`<span data-void-sr>${this.label}</span>`;
26
+ return a`<span data-void-sr>${this._text()}</span>`;
20
27
  }
21
28
  };
22
- t([i({
29
+ t([o({
23
30
  type: String,
24
31
  reflect: !0
25
- })], a.prototype, "size", void 0), t([i({
32
+ })], s.prototype, "size", void 0), t([o({
26
33
  type: String,
27
34
  reflect: !0
28
- })], a.prototype, "label", void 0), customElements.get("void-spinner") || customElements.define("void-spinner", a);
35
+ })], s.prototype, "label", void 0), customElements.get("void-spinner") || customElements.define("void-spinner", s);
29
36
  //#endregion
30
- export { a as VoidSpinner };
37
+ export { s as VoidSpinner };
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { r as n } from "../chunks/projection-oPe6ipjL.js";
4
- import { o as r } from "../chunks/keyboard-CEhMSkws.js";
4
+ import { i as r } from "../chunks/keyboard-ChtDvhB_.js";
5
5
  import { html as i } from "lit";
6
6
  import { property as a } from "lit/decorators.js";
7
7
  //#region src/components/stat.ts
@@ -7,8 +7,8 @@ export declare class VoidStatusDot extends VoidElement {
7
7
  */
8
8
  status: 'online' | 'away' | 'offline';
9
9
  connectedCallback(): void;
10
- updated(changed: Map<string, unknown>): void;
11
- private _ariaLabel;
10
+ updated(): void;
11
+ private _name;
12
12
  }
13
13
  declare global {
14
14
  interface HTMLElementTagNameMap {
@@ -1,28 +1,26 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { property as n } from "lit/decorators.js";
3
+ import { msg as n, nameHost as r } from "../messages.js";
4
+ import { property as i } from "lit/decorators.js";
4
5
  //#region src/components/status-dot.ts
5
- var r = class extends e {
6
+ var a = class extends e {
6
7
  constructor(...e) {
7
8
  super(...e), this.status = "offline";
8
9
  }
9
10
  connectedCallback() {
10
- super.connectedCallback(), this.setHostAttribute("role", "status"), this.setHostAttribute("aria-label", this._ariaLabel());
11
+ super.connectedCallback(), this.setHostAttribute("role", "status"), this._name();
11
12
  }
12
- updated(e) {
13
- e.has("status") && this.setHostAttribute("aria-label", this._ariaLabel());
13
+ updated() {
14
+ this._name();
14
15
  }
15
- _ariaLabel() {
16
- switch (this.status) {
17
- case "online": return "Online";
18
- case "away": return "Away";
19
- default: return "Offline";
20
- }
16
+ _name() {
17
+ let e = n(this, this.status === "online" ? "statusDot.online" : this.status === "away" ? "statusDot.away" : "statusDot.offline");
18
+ r(this, e, (e, t) => this.setHostAttribute(e, t));
21
19
  }
22
20
  };
23
- t([n({
21
+ t([i({
24
22
  type: String,
25
23
  reflect: !0
26
- })], r.prototype, "status", void 0), customElements.get("void-status-dot") || customElements.define("void-status-dot", r);
24
+ })], a.prototype, "status", void 0), customElements.get("void-status-dot") || customElements.define("void-status-dot", a);
27
25
  //#endregion
28
- export { r as VoidStatusDot };
26
+ export { a as VoidStatusDot };
@@ -9,6 +9,8 @@ export declare class VoidStepper extends VoidElement {
9
9
  */
10
10
  steps: string;
11
11
  connectedCallback(): void;
12
+ private _name;
13
+ protected updated(changed: Map<string, unknown>): void;
12
14
  render(): import('lit').TemplateResult<1>;
13
15
  }
14
16
  declare global {
@@ -1,27 +1,34 @@
1
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-oPe6ipjL.js";
4
- import { html as r, nothing as i } from "lit";
5
- import { property as a } from "lit/decorators.js";
3
+ import { msg as n, nameHost as r } from "../messages.js";
4
+ import { r as i } from "../chunks/projection-oPe6ipjL.js";
5
+ import { html as a, nothing as o } from "lit";
6
+ import { property as s } from "lit/decorators.js";
6
7
  //#region src/components/stepper.ts
7
- n();
8
- var o = class extends e {
8
+ i();
9
+ var c = class extends e {
9
10
  constructor(...e) {
10
11
  super(...e), this.value = 0, this.steps = "";
11
12
  }
12
13
  connectedCallback() {
13
- super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.setHostAttribute("aria-label", "Progress");
14
+ super.connectedCallback(), this.setHostAttribute("role", "navigation"), this._name();
15
+ }
16
+ _name() {
17
+ r(this, n(this, "stepper.label"), (e, t) => this.setHostAttribute(e, t));
18
+ }
19
+ updated(e) {
20
+ super.updated(e), this._name();
14
21
  }
15
22
  render() {
16
- return r`${this.steps.split(",").map((e) => e.trim()).filter(Boolean).map((e, t) => {
23
+ return a`${this.steps.split(",").map((e) => e.trim()).filter(Boolean).map((e, t) => {
17
24
  let n = t < this.value ? "completed" : t === this.value ? "active" : "upcoming";
18
- return r`${t > 0 ? r`<div class="void-stepper-connector" data-state=${t <= this.value ? "completed" : "upcoming"}></div>` : null}<div
25
+ return a`${t > 0 ? a`<div class="void-stepper-connector" data-state=${t <= this.value ? "completed" : "upcoming"}></div>` : null}<div
19
26
  class="void-stepper-step"
20
27
  data-state=${n}
21
- aria-current=${t === this.value ? "step" : i}
28
+ aria-current=${t === this.value ? "step" : o}
22
29
  >
23
30
  <span class="void-stepper-circle"
24
- >${n === "completed" ? r`<svg
31
+ >${n === "completed" ? a`<svg
25
32
  viewBox="0 0 12 12"
26
33
  width="1em"
27
34
  height="1em"
@@ -39,9 +46,9 @@ var o = class extends e {
39
46
  })}`;
40
47
  }
41
48
  };
42
- t([a({
49
+ t([s({
43
50
  type: Number,
44
51
  reflect: !0
45
- })], o.prototype, "value", void 0), t([a({ reflect: !0 })], o.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", o);
52
+ })], c.prototype, "value", void 0), t([s({ reflect: !0 })], c.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", c);
46
53
  //#endregion
47
- export { o as VoidStepper };
54
+ export { c as VoidStepper };
@@ -1,9 +1,16 @@
1
1
  import { VoidElement } from '../base.js';
2
2
  import { KeyboardActivation } from '../keyboard-activation.js';
3
+ import { KeyOverrides } from '../keys.js';
3
4
  import { FormSubmission } from '../form-control.js';
4
5
  declare const VoidSwitch_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
5
6
  /** On/off toggle for feature flags, notification preferences, and settings that take immediate effect. */
6
7
  export declare class VoidSwitch extends VoidSwitch_base {
8
+ /** Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. */
9
+ keys: KeyOverrides | null;
10
+ /** @internal The actions of this element and their default keys. */
11
+ static readonly keyMap: {
12
+ activate: string[];
13
+ };
7
14
  /** Enter and Space fire a real `click`, as on a native button. */
8
15
  protected readonly _activation: KeyboardActivation;
9
16
  /** Whether the switch is on. Reflected to the attribute as it changes; the form's reset target stays the state it started with. */
@@ -1,15 +1,17 @@
1
1
  import { t as e } from "../chunks/base-BGrS4eIl.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
4
- import { t as r } from "../chunks/form-control-C0vH6gii.js";
5
- import { r as i } from "../chunks/projection-oPe6ipjL.js";
6
- import { html as a } from "lit";
7
- import { property as o } from "lit/decorators.js";
3
+ import { keysConverter as n } from "../keys.js";
4
+ import { t as r } from "../chunks/keyboard-activation-BfEyoaMT.js";
5
+ import { t as i } from "../chunks/activation-B8aBarKd.js";
6
+ import { t as a } from "../chunks/form-control-fL-Hhy91.js";
7
+ import { r as o } from "../chunks/projection-oPe6ipjL.js";
8
+ import { html as s } from "lit";
9
+ import { property as c } from "lit/decorators.js";
8
10
  //#region src/components/switch.ts
9
- i();
10
- var s = class extends r(e) {
11
+ o();
12
+ var l = class extends a(e) {
11
13
  constructor(...e) {
12
- super(...e), this._activation = new n(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.value = "on", this.color = "default", this.size = "md", this._handleClick = () => {
14
+ super(...e), this.keys = null, this._activation = new r(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.value = "on", this.color = "default", this.size = "md", this._handleClick = () => {
13
15
  this.formDisabled || (this.checked = !this.checked, this.dispatchEvent(new CustomEvent("void-change", {
14
16
  bubbles: !0,
15
17
  composed: !0,
@@ -20,6 +22,9 @@ var s = class extends r(e) {
20
22
  })));
21
23
  };
22
24
  }
25
+ static {
26
+ this.keyMap = i;
27
+ }
23
28
  connectedCallback() {
24
29
  super.connectedCallback(), this.setHostAttribute("role", "switch"), this.setHostAttribute("tabindex", this.disabled ? "-1" : "0"), this.setHostAttribute("aria-checked", String(this.checked)), this.addEventListener("click", this._handleClick);
25
30
  }
@@ -42,24 +47,27 @@ var s = class extends r(e) {
42
47
  this.checked = !!e;
43
48
  }
44
49
  render() {
45
- return a`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
50
+ return s`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
46
51
  }
47
52
  };
48
- t([o({
53
+ t([c({
54
+ attribute: "keys",
55
+ converter: n
56
+ })], l.prototype, "keys", void 0), t([c({
49
57
  type: Boolean,
50
58
  reflect: !0
51
- })], s.prototype, "checked", void 0), t([o({
59
+ })], l.prototype, "checked", void 0), t([c({
52
60
  type: Boolean,
53
61
  reflect: !0
54
- })], s.prototype, "disabled", void 0), t([o({
62
+ })], l.prototype, "disabled", void 0), t([c({
55
63
  type: String,
56
64
  reflect: !0
57
- })], s.prototype, "value", void 0), t([o({
65
+ })], l.prototype, "value", void 0), t([c({
58
66
  type: String,
59
67
  reflect: !0
60
- })], s.prototype, "color", void 0), t([o({
68
+ })], l.prototype, "color", void 0), t([c({
61
69
  type: String,
62
70
  reflect: !0
63
- })], s.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", s);
71
+ })], l.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", l);
64
72
  //#endregion
65
- export { s as VoidSwitch };
73
+ export { l as VoidSwitch };