@voidable/ui 0.11.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 (151) hide show
  1. package/dist/angular/index.d.ts +2 -2
  2. package/dist/angular/index.js +2 -1
  3. package/dist/chunks/activation-B8aBarKd.js +4 -0
  4. package/dist/chunks/carousel-C9u0bg5l.js +10 -0
  5. package/dist/chunks/choice-BTrsi7OW.js +16 -0
  6. package/dist/chunks/data-Baycjoo4.js +96 -0
  7. package/dist/chunks/fields-MEqz-olE.js +21 -0
  8. package/dist/chunks/{form-control-C0vH6gii.js → form-control-fL-Hhy91.js} +49 -48
  9. package/dist/chunks/{keyboard-CEhMSkws.js → keyboard-ChtDvhB_.js} +4 -23
  10. package/dist/chunks/{keyboard-activation-CV0m4hkn.js → keyboard-activation-BfEyoaMT.js} +4 -6
  11. package/dist/chunks/menu-CxRRgkJI.js +21 -0
  12. package/dist/chunks/{modal-DWGkNdNG.js → modal-Cz2-Ov76.js} +23 -15
  13. package/dist/chunks/nav-menu-Bx284Dk6.js +12 -0
  14. package/dist/chunks/{overlay-CH7L4N-h.js → overlay-BuV-4Yvt.js} +75 -68
  15. package/dist/chunks/overlay-K1ilWC1p.js +4 -0
  16. package/dist/chunks/pickers-CjlFgNke.js +36 -0
  17. package/dist/chunks/table-BBpqwWEi.js +4 -0
  18. package/dist/chunks/tabs-Buf3EBWq.js +10 -0
  19. package/dist/components/accordion.d.ts +7 -0
  20. package/dist/components/accordion.js +22 -14
  21. package/dist/components/action-input.d.ts +2 -1
  22. package/dist/components/action-input.js +59 -55
  23. package/dist/components/bar-chart.js +41 -40
  24. package/dist/components/breadcrumbs.d.ts +2 -0
  25. package/dist/components/breadcrumbs.js +15 -11
  26. package/dist/components/button.d.ts +7 -0
  27. package/dist/components/button.js +23 -16
  28. package/dist/components/calendar.d.ts +45 -10
  29. package/dist/components/calendar.js +183 -129
  30. package/dist/components/carousel.d.ts +22 -0
  31. package/dist/components/carousel.js +64 -35
  32. package/dist/components/charts/data.d.ts +2 -2
  33. package/dist/components/checkbox-group.js +22 -21
  34. package/dist/components/checkbox.d.ts +7 -0
  35. package/dist/components/checkbox.js +29 -24
  36. package/dist/components/collapsible.d.ts +7 -0
  37. package/dist/components/collapsible.js +19 -11
  38. package/dist/components/color-picker.js +28 -27
  39. package/dist/components/combobox.d.ts +13 -1
  40. package/dist/components/combobox.js +54 -41
  41. package/dist/components/compose-input.d.ts +9 -1
  42. package/dist/components/compose-input.js +28 -16
  43. package/dist/components/dialog.js +1 -1
  44. package/dist/components/donut-chart.js +57 -56
  45. package/dist/components/drawer.js +1 -1
  46. package/dist/components/dropdown-menu.d.ts +22 -0
  47. package/dist/components/dropdown-menu.js +54 -39
  48. package/dist/components/editable.d.ts +11 -1
  49. package/dist/components/editable.js +35 -22
  50. package/dist/components/error-fallback.d.ts +4 -2
  51. package/dist/components/error-fallback.js +34 -28
  52. package/dist/components/file-upload.d.ts +9 -0
  53. package/dist/components/file-upload.js +54 -28
  54. package/dist/components/gauge.js +108 -107
  55. package/dist/components/hamburger.d.ts +7 -0
  56. package/dist/components/hamburger.js +28 -19
  57. package/dist/components/hover-card.d.ts +7 -0
  58. package/dist/components/hover-card.js +22 -14
  59. package/dist/components/indicator.js +15 -14
  60. package/dist/components/input.js +1 -1
  61. package/dist/components/line-chart.js +43 -42
  62. package/dist/components/menu.d.ts +25 -0
  63. package/dist/components/menu.js +55 -33
  64. package/dist/components/multiselect.d.ts +17 -1
  65. package/dist/components/multiselect.js +96 -74
  66. package/dist/components/nav-menu.d.ts +9 -0
  67. package/dist/components/nav-menu.js +30 -23
  68. package/dist/components/number-input.d.ts +15 -1
  69. package/dist/components/number-input.js +71 -37
  70. package/dist/components/pagination.js +25 -24
  71. package/dist/components/pin-input.d.ts +11 -0
  72. package/dist/components/pin-input.js +46 -32
  73. package/dist/components/popover.d.ts +7 -0
  74. package/dist/components/popover.js +21 -13
  75. package/dist/components/radio-group.js +1 -1
  76. package/dist/components/radio.d.ts +10 -1
  77. package/dist/components/radio.js +37 -32
  78. package/dist/components/segmented-control.d.ts +14 -0
  79. package/dist/components/segmented-control.js +40 -28
  80. package/dist/components/sidebar.d.ts +1 -0
  81. package/dist/components/sidebar.js +14 -10
  82. package/dist/components/slider.js +1 -1
  83. package/dist/components/spinner.d.ts +5 -3
  84. package/dist/components/spinner.js +21 -14
  85. package/dist/components/stat.js +1 -1
  86. package/dist/components/status-dot.d.ts +2 -2
  87. package/dist/components/status-dot.js +12 -14
  88. package/dist/components/stepper.d.ts +2 -0
  89. package/dist/components/stepper.js +20 -13
  90. package/dist/components/switch.d.ts +7 -0
  91. package/dist/components/switch.js +24 -16
  92. package/dist/components/table.d.ts +77 -1
  93. package/dist/components/table.js +562 -73
  94. package/dist/components/tabs.d.ts +11 -0
  95. package/dist/components/tabs.js +42 -33
  96. package/dist/components/tag.js +12 -11
  97. package/dist/components/tags-input.d.ts +10 -1
  98. package/dist/components/tags-input.js +42 -30
  99. package/dist/components/textarea.js +1 -1
  100. package/dist/components/toast.d.ts +2 -0
  101. package/dist/components/toast.js +35 -28
  102. package/dist/components/toggle-group.d.ts +8 -0
  103. package/dist/components/toggle-group.js +24 -17
  104. package/dist/components/toggle.d.ts +7 -0
  105. package/dist/components/toggle.js +23 -15
  106. package/dist/components/tooltip.d.ts +7 -0
  107. package/dist/components/tooltip.js +20 -12
  108. package/dist/components.json +96 -74
  109. package/dist/custom-elements.json +4213 -131
  110. package/dist/dev/rules.d.ts +0 -1
  111. package/dist/dev/types.d.ts +3 -1
  112. package/dist/dev.js +244 -113
  113. package/dist/index.d.ts +4 -0
  114. package/dist/index.js +68 -66
  115. package/dist/keyboard-activation.d.ts +9 -9
  116. package/dist/keyboard.d.ts +2 -10
  117. package/dist/keymaps/activation.d.ts +8 -0
  118. package/dist/keymaps/carousel.d.ts +9 -0
  119. package/dist/keymaps/choice.d.ts +21 -0
  120. package/dist/keymaps/fields.d.ts +31 -0
  121. package/dist/keymaps/index.d.ts +2 -0
  122. package/dist/keymaps/menu.d.ts +36 -0
  123. package/dist/keymaps/nav-menu.d.ts +11 -0
  124. package/dist/keymaps/overlay.d.ts +4 -0
  125. package/dist/keymaps/pickers.d.ts +36 -0
  126. package/dist/keymaps/table.d.ts +8 -0
  127. package/dist/keymaps/tabs.d.ts +7 -0
  128. package/dist/keymaps.js +51 -0
  129. package/dist/keys.d.ts +46 -0
  130. package/dist/keys.js +57 -0
  131. package/dist/llms.txt +11 -3
  132. package/dist/messages/ar.d.ts +1 -0
  133. package/dist/messages/ar.js +130 -0
  134. package/dist/messages/fr.d.ts +1 -0
  135. package/dist/messages/fr.js +109 -0
  136. package/dist/messages.d.ts +213 -0
  137. package/dist/messages.js +190 -0
  138. package/dist/modal.d.ts +7 -0
  139. package/dist/reference.md +817 -17
  140. package/dist/testing/index.d.ts +46 -0
  141. package/dist/testing.js +79 -0
  142. package/dist/types/elements.d.ts +89 -73
  143. package/dist/types/react.d.ts +5 -1
  144. package/dist/types/solid.d.ts +5 -1
  145. package/dist/types/solid2.d.ts +4 -0
  146. package/dist/types/svelte.d.ts +5 -1
  147. package/dist/types/vue.d.ts +5 -1
  148. package/dist/vscode.html-custom-data.json +384 -18
  149. package/dist/web-types.json +830 -69
  150. package/package.json +22 -2
  151. package/dist/chunks/data-BpiiNapL.js +0 -95
@@ -1,4 +1,5 @@
1
1
  import { VoidElement } from '../base.js';
2
+ import { KeyOverrides } from '../keys.js';
2
3
  import { PartsController } from '../parts.js';
3
4
  /**
4
5
  * Tabbed section navigation for settings pages, detail views, and parallel content categories.
@@ -17,6 +18,16 @@ import { PartsController } from '../parts.js';
17
18
  * @fires {CustomEvent<{ value: string }>} void-change - The user selected a tab.
18
19
  */
19
20
  export declare class VoidTabs extends VoidElement {
21
+ /** Key bindings for this element's actions, as JSON (`{"next":["ArrowRight","l"]}`); `[]` switches an action off. See the keyboard guide. */
22
+ keys: KeyOverrides | null;
23
+ /** @internal The actions of this element and their default keys. */
24
+ static readonly keyMap: {
25
+ next: string[];
26
+ previous: string[];
27
+ first: string[];
28
+ last: string[];
29
+ activate: string[];
30
+ };
20
31
  /**
21
32
  * The `value` of the selected tab. As an attribute it is the initial tab; selecting a tab updates it (it
22
33
  * reflects) and fires `void-change`.
@@ -1,38 +1,44 @@
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/parts-DI_3VpSy.js";
4
- import { a as r, n as i, r as a } from "../chunks/keyboard-CEhMSkws.js";
5
- import { property as o } from "lit/decorators.js";
3
+ import { actionFor as n, keysConverter as r } from "../keys.js";
4
+ import { n as i } from "../chunks/parts-DI_3VpSy.js";
5
+ import { n as a, r as o } from "../chunks/keyboard-ChtDvhB_.js";
6
+ import { t as s } from "../chunks/tabs-Buf3EBWq.js";
7
+ import { property as c } from "lit/decorators.js";
6
8
  //#region src/components/tabs.ts
7
- var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u = class extends e {
9
+ var l = "void-tabs-list", u = "void-tabs-trigger", d = "void-tabs-content", f = class extends e {
8
10
  constructor(...e) {
9
- super(...e), this.value = "", this.size = "md", this.activation = "manual", this._parts = new n(this, {
11
+ super(...e), this.keys = null, this.value = "", this.size = "md", this.activation = "manual", this._parts = new i(this, {
10
12
  tags: [
11
- s,
12
- c,
13
- l
13
+ l,
14
+ u,
15
+ d
14
16
  ],
15
17
  onChange: () => this._wire()
16
18
  }), this._matchedValue = null, this._onClick = (e) => {
17
19
  let t = this._triggerOf(e.target);
18
20
  t && this._select(t);
19
21
  }, this._onKeydown = (e) => {
20
- if (e.altKey || e.ctrlKey || e.metaKey || e.defaultPrevented) return;
21
- let t = this._triggerOf(e.target);
22
+ let t = n(this, e);
22
23
  if (!t) return;
23
- if (e.key === "Enter" || e.key === " ") {
24
- e.preventDefault(), this._select(t);
24
+ let r = this._triggerOf(e.target);
25
+ if (!r) return;
26
+ if (t === "activate") {
27
+ e.preventDefault(), this._select(r);
25
28
  return;
26
29
  }
27
- let n = this._triggers(), o = n.indexOf(t), s = n.map((e) => this._disabled(e)), c = -1, l = a(this);
28
- if (e.key === l.next) c = r(s, o, 1);
29
- else if (e.key === l.prev) c = r(s, o, -1);
30
- else if (e.key === "Home") c = i(s, 1);
31
- else if (e.key === "End") c = i(s, -1);
30
+ let i = this._triggers(), s = i.indexOf(r), c = i.map((e) => this._disabled(e)), l = -1;
31
+ if (t === "next") l = o(c, s, 1);
32
+ else if (t === "previous") l = o(c, s, -1);
33
+ else if (t === "first") l = a(c, 1);
34
+ else if (t === "last") l = a(c, -1);
32
35
  else return;
33
- e.preventDefault(), !(c < 0) && (n[c].focus(), this.activation === "auto" && this._select(n[c]));
36
+ e.preventDefault(), !(l < 0) && (i[l].focus(), this.activation === "auto" && this._select(i[l]));
34
37
  };
35
38
  }
39
+ static {
40
+ this.keyMap = s;
41
+ }
36
42
  connectedCallback() {
37
43
  super.connectedCallback(), this.addEventListener("click", this._onClick), this.addEventListener("keydown", this._onKeydown);
38
44
  }
@@ -43,7 +49,7 @@ var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u =
43
49
  super.updated(e), e.has("value") && this._wire();
44
50
  }
45
51
  _triggers() {
46
- return this._parts.within(this._parts.one(s), c);
52
+ return this._parts.within(this._parts.one(l), u);
47
53
  }
48
54
  _disabled(e) {
49
55
  return e.hasAttribute("disabled");
@@ -61,22 +67,22 @@ var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u =
61
67
  this._matchedValue = null, t && (this.value = this._valueOf(t), this._matchedValue = this.value);
62
68
  }
63
69
  _wire() {
64
- let e = this._parts.one(s), t = this._triggers(), n = this._parts.all(l);
70
+ let e = this._parts.one(l), t = this._triggers(), n = this._parts.all(d);
65
71
  this._reconcileRemovedSelection(t), e && this._parts.set(e, "role", "tablist");
66
- let r = t.map((e) => this._disabled(e)), a = t.findIndex((e, t) => this._valueOf(e) === this.value && !r[t]);
67
- a < 0 && (a = i(r, 1));
72
+ let r = t.map((e) => this._disabled(e)), i = t.findIndex((e, t) => this._valueOf(e) === this.value && !r[t]);
73
+ i < 0 && (i = a(r, 1));
68
74
  let o = /* @__PURE__ */ new Map();
69
75
  for (let e of n) o.has(this._valueOf(e)) || o.set(this._valueOf(e), e);
70
- let c = /* @__PURE__ */ new Map();
76
+ let s = /* @__PURE__ */ new Map();
71
77
  t.forEach((e, t) => {
72
- let n = this._valueOf(e), i = n === this.value, s = this._parts.id(e, "void-tabs-trigger");
73
- c.has(n) || c.set(n, s);
78
+ let n = this._valueOf(e), a = n === this.value, c = this._parts.id(e, "void-tabs-trigger");
79
+ s.has(n) || s.set(n, c);
74
80
  let l = o.get(n);
75
- this._parts.set(e, "role", "tab"), this._parts.set(e, "aria-selected", i ? "true" : "false"), this._parts.set(e, "active", i), this._parts.set(e, "tabindex", t === a ? "0" : "-1"), this._parts.set(e, "aria-disabled", r[t] ? "true" : null), this._parts.set(e, "aria-controls", l ? this._parts.id(l, "void-tabs-content") : null);
81
+ this._parts.set(e, "role", "tab"), this._parts.set(e, "aria-selected", a ? "true" : "false"), this._parts.set(e, "active", a), this._parts.set(e, "tabindex", t === i ? "0" : "-1"), this._parts.set(e, "aria-disabled", r[t] ? "true" : null), this._parts.set(e, "aria-controls", l ? this._parts.id(l, "void-tabs-content") : null);
76
82
  });
77
83
  for (let e of n) {
78
84
  let t = this._valueOf(e), n = t === this.value;
79
- this._parts.id(e, "void-tabs-content"), this._parts.set(e, "role", "tabpanel"), this._parts.set(e, "active", n), this._parts.set(e, "tabindex", n ? "0" : null), this._parts.set(e, "aria-labelledby", c.get(t) ?? null);
85
+ this._parts.id(e, "void-tabs-content"), this._parts.set(e, "role", "tabpanel"), this._parts.set(e, "active", n), this._parts.set(e, "tabindex", n ? "0" : null), this._parts.set(e, "aria-labelledby", s.get(t) ?? null);
80
86
  }
81
87
  }
82
88
  _select(e) {
@@ -89,19 +95,22 @@ var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u =
89
95
  }));
90
96
  }
91
97
  _triggerOf(e) {
92
- let t = e instanceof Element ? e.closest(c) : null;
98
+ let t = e instanceof Element ? e.closest(u) : null;
93
99
  return t && this._parts.owns(t) ? t : null;
94
100
  }
95
101
  };
96
- t([o({
102
+ t([c({
103
+ attribute: "keys",
104
+ converter: r
105
+ })], f.prototype, "keys", void 0), t([c({
97
106
  type: String,
98
107
  reflect: !0
99
- })], u.prototype, "value", void 0), t([o({
108
+ })], f.prototype, "value", void 0), t([c({
100
109
  type: String,
101
110
  reflect: !0
102
- })], u.prototype, "size", void 0), t([o({
111
+ })], f.prototype, "size", void 0), t([c({
103
112
  type: String,
104
113
  reflect: !0
105
- })], u.prototype, "activation", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", u);
114
+ })], f.prototype, "activation", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", f);
106
115
  //#endregion
107
- export { u as VoidTabs };
116
+ export { f as VoidTabs };
@@ -1,12 +1,13 @@
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/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 } from "../messages.js";
4
+ import { t as r } from "../chunks/projection-oPe6ipjL.js";
5
+ import { html as i, nothing as a } from "lit";
6
+ import { property as o } from "lit/decorators.js";
6
7
  //#region src/components/tag.ts
7
- var o = class extends e {
8
+ var s = class extends e {
8
9
  constructor(...e) {
9
- super(...e), this.color = "default", this.removable = !1, this.size = "md", this._projection = new n(this, { regions: [{
10
+ super(...e), this.color = "default", this.removable = !1, this.size = "md", this._projection = new r(this, { regions: [{
10
11
  name: "label",
11
12
  target: "before"
12
13
  }] });
@@ -17,7 +18,7 @@ var o = class extends e {
17
18
  this.setHostAttribute("role", t ? "listitem" : null);
18
19
  }
19
20
  render() {
20
- return this.removable ? r`<button type="button" class="void-tag-close" aria-label="Remove" @click="${this._remove}">×</button>` : i;
21
+ return this.removable ? i`<button type="button" class="void-tag-close" aria-label=${n(this, "remove")} @click="${this._remove}">×</button>` : a;
21
22
  }
22
23
  _remove() {
23
24
  this.dispatchEvent(new CustomEvent("void-remove", {
@@ -26,15 +27,15 @@ var o = class extends e {
26
27
  })), this.remove();
27
28
  }
28
29
  };
29
- t([a({
30
+ t([o({
30
31
  type: String,
31
32
  reflect: !0
32
- })], o.prototype, "color", void 0), t([a({
33
+ })], s.prototype, "color", void 0), t([o({
33
34
  type: Boolean,
34
35
  reflect: !0
35
- })], o.prototype, "removable", void 0), t([a({
36
+ })], s.prototype, "removable", void 0), t([o({
36
37
  type: String,
37
38
  reflect: !0
38
- })], o.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", o);
39
+ })], s.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", s);
39
40
  //#endregion
40
- export { o as VoidTag };
41
+ export { s as VoidTag };
@@ -1,5 +1,6 @@
1
1
  import { PropertyValues } from 'lit';
2
2
  import { VoidElement } from '../base.js';
3
+ import { KeyOverrides } from '../keys.js';
3
4
  import { FormSubmission } from '../form-control.js';
4
5
  export type TagValue = string | {
5
6
  text: string;
@@ -8,6 +9,13 @@ export type TagValue = string | {
8
9
  declare const VoidTagsInput_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
9
10
  /** Multi-tag input field for email recipients, category labels, keyword tagging, and comma-separated value entry. */
10
11
  export declare class VoidTagsInput extends VoidTagsInput_base {
12
+ /** Key bindings for this element's actions, as JSON (`{"add":["Enter",";"]}`); `[]` switches an action off. See the keyboard guide. */
13
+ keys: KeyOverrides | null;
14
+ /** @internal The actions of this element and their default keys. */
15
+ static readonly keyMap: {
16
+ add: string[];
17
+ removeLast: string[];
18
+ };
11
19
  /** The host's `aria-label` / `aria-labelledby` name the inner control. */
12
20
  static labelTarget: string;
13
21
  /**
@@ -21,8 +29,9 @@ export declare class VoidTagsInput extends VoidTagsInput_base {
21
29
  readonly: boolean;
22
30
  /** Maximum number of tags. Once reached, the entry field is hidden. Unlimited by default. */
23
31
  max: number;
24
- /** Hint in the entry field. Defaults to `Add tag...`. */
32
+ /** Hint in the entry field. Defaults to the `tagsInput.placeholder` message (English: `Add tag...`). */
25
33
  placeholder: string;
34
+ private get _hint();
26
35
  /** Size step: `sm`, `md` (default) or `lg`. */
27
36
  size: 'sm' | 'md' | 'lg';
28
37
  /** Status colour of the tags: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`. */
@@ -1,19 +1,28 @@
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/form-control-C0vH6gii.js";
4
- import { r } from "../chunks/projection-oPe6ipjL.js";
5
- import { t as i } from "../chunks/value-list-CH6GjYXM.js";
6
- import { html as a, nothing as o } from "lit";
7
- import { property as s } from "lit/decorators.js";
3
+ import { actionFor as n, keysConverter as r } from "../keys.js";
4
+ import { msg as i } from "../messages.js";
5
+ import { t as a } from "../chunks/form-control-fL-Hhy91.js";
6
+ import { r as o } from "../chunks/projection-oPe6ipjL.js";
7
+ import { t as s } from "../chunks/value-list-CH6GjYXM.js";
8
+ import { s as c } from "../chunks/fields-MEqz-olE.js";
9
+ import { html as l, nothing as u } from "lit";
10
+ import { property as d } from "lit/decorators.js";
8
11
  //#region src/components/tags-input.ts
9
- r();
10
- var c = class extends n(e) {
12
+ o();
13
+ var f = class extends a(e) {
11
14
  constructor(...e) {
12
- super(...e), this.value = [], this.disabled = !1, this.readonly = !1, this.max = Infinity, this.placeholder = "Add tag...", this.size = "md", this.color = "default", this.variant = "outline", this.allowDuplicates = !1;
15
+ super(...e), this.keys = null, this.value = [], this.disabled = !1, this.readonly = !1, this.max = Infinity, this.placeholder = "", this.size = "md", this.color = "default", this.variant = "outline", this.allowDuplicates = !1;
16
+ }
17
+ static {
18
+ this.keyMap = c;
13
19
  }
14
20
  static {
15
21
  this.labelTarget = ".void-tags-input-field";
16
22
  }
23
+ get _hint() {
24
+ return this.placeholder || i(this, "tagsInput.placeholder");
25
+ }
17
26
  _tagText(e) {
18
27
  return typeof e == "string" ? e : e.text;
19
28
  }
@@ -29,33 +38,33 @@ var c = class extends n(e) {
29
38
  }
30
39
  render() {
31
40
  let e = this.value.length >= this.max;
32
- return a`
41
+ return l`
33
42
  <div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
34
43
  ${this.value.map((e, t) => {
35
44
  let n = this._tagText(e);
36
- return a`
37
- <span class="void-tags-input-tag" data-color=${this._tagColor(e) || o}>
45
+ return l`
46
+ <span class="void-tags-input-tag" data-color=${this._tagColor(e) || u}>
38
47
  <span class="void-tags-input-tag-text">${n}</span>
39
- ${!this.disabled && !this.readonly ? a`<button
48
+ ${!this.disabled && !this.readonly ? l`<button
40
49
  type="button"
41
50
  class="void-tags-input-tag-remove"
42
- aria-label="Remove ${n}"
51
+ aria-label=${i(this, "removeItem", { name: n })}
43
52
  @click=${(e) => {
44
53
  e.stopPropagation(), this._removeTag(t);
45
54
  }}
46
- >×</button>` : o}
55
+ >×</button>` : u}
47
56
  </span>
48
57
  `;
49
58
  })}
50
- ${!e && !this.readonly ? a`<input
59
+ ${!e && !this.readonly ? l`<input
51
60
  class="void-tags-input-field"
52
61
  type="text"
53
- placeholder=${this.value.length === 0 ? this.placeholder : ""}
62
+ placeholder=${this.value.length === 0 ? this._hint : ""}
54
63
  ?disabled=${this.disabled}
55
64
  @keydown=${this._onKeydown}
56
65
  @input=${this._onFieldInput}
57
66
  @paste=${this._onPaste}
58
- />` : o}
67
+ />` : u}
59
68
  </div>
60
69
  `;
61
70
  }
@@ -73,12 +82,12 @@ var c = class extends n(e) {
73
82
  this.disabled || this.readonly || (this.value = this.value.filter((t, n) => n !== e), this._dispatchChange());
74
83
  }
75
84
  _onKeydown(e) {
76
- let t = e.target;
77
- if (e.key === "Enter" || e.key === ",") {
85
+ let t = e.target, r = n(this, e);
86
+ if (r === "add") {
78
87
  e.preventDefault();
79
88
  let n = t.value;
80
89
  t.value = "", this._addTag(n), this.formSync();
81
- } else e.key === "Backspace" && t.value === "" && this.value.length > 0 && this._removeTag(this.value.length - 1);
90
+ } else r === "removeLast" && t.value === "" && this.value.length > 0 && this._removeTag(this.value.length - 1);
82
91
  }
83
92
  _onFieldInput() {
84
93
  this.formSync();
@@ -99,27 +108,30 @@ var c = class extends n(e) {
99
108
  }));
100
109
  }
101
110
  };
102
- t([s({
103
- converter: i,
111
+ t([d({
112
+ attribute: "keys",
113
+ converter: r
114
+ })], f.prototype, "keys", void 0), t([d({
115
+ converter: s,
104
116
  reflect: !0
105
- })], c.prototype, "value", void 0), t([s({
117
+ })], f.prototype, "value", void 0), t([d({
106
118
  type: Boolean,
107
119
  reflect: !0
108
- })], c.prototype, "disabled", void 0), t([s({
120
+ })], f.prototype, "disabled", void 0), t([d({
109
121
  type: Boolean,
110
122
  reflect: !0
111
- })], c.prototype, "readonly", void 0), t([s({ type: Number })], c.prototype, "max", void 0), t([s({ type: String })], c.prototype, "placeholder", void 0), t([s({
123
+ })], f.prototype, "readonly", void 0), t([d({ type: Number })], f.prototype, "max", void 0), t([d({ type: String })], f.prototype, "placeholder", void 0), t([d({
112
124
  type: String,
113
125
  reflect: !0
114
- })], c.prototype, "size", void 0), t([s({
126
+ })], f.prototype, "size", void 0), t([d({
115
127
  type: String,
116
128
  reflect: !0
117
- })], c.prototype, "color", void 0), t([s({
129
+ })], f.prototype, "color", void 0), t([d({
118
130
  type: String,
119
131
  reflect: !0
120
- })], c.prototype, "variant", void 0), t([s({
132
+ })], f.prototype, "variant", void 0), t([d({
121
133
  type: Boolean,
122
134
  attribute: "allow-duplicates"
123
- })], c.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", c);
135
+ })], f.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", f);
124
136
  //#endregion
125
- export { c as VoidTagsInput };
137
+ export { f as VoidTagsInput };
@@ -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";
@@ -72,6 +72,8 @@ export declare class VoidToastContainer extends VoidElement {
72
72
  private _observer;
73
73
  private _announceTimers;
74
74
  connectedCallback(): void;
75
+ private _name;
76
+ protected updated(changed: Map<string, unknown>): void;
75
77
  disconnectedCallback(): void;
76
78
  /**
77
79
  * Two persistent, visually hidden live regions that exist from the container's connection: a polite one
@@ -1,12 +1,13 @@
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/parts-DI_3VpSy.js";
4
- import { n as r, t as i } from "../chunks/dismiss-Drsy_dE5.js";
5
- import { property as a } from "lit/decorators.js";
3
+ import { msg as n, nameHost as r } from "../messages.js";
4
+ import { n as i } from "../chunks/parts-DI_3VpSy.js";
5
+ import { n as a, t as o } from "../chunks/dismiss-Drsy_dE5.js";
6
+ import { property as s } from "lit/decorators.js";
6
7
  //#region src/components/toast.ts
7
- var o = class extends e {
8
+ var c = class extends e {
8
9
  constructor(...e) {
9
- super(...e), this.color = "default", this.duration = 5e3, this._parts = new n(this, {
10
+ super(...e), this.color = "default", this.duration = 5e3, this._parts = new i(this, {
10
11
  tags: [
11
12
  "void-toast-title",
12
13
  "void-toast-description",
@@ -23,7 +24,7 @@ var o = class extends e {
23
24
  }, this._onFocusOut = (e) => {
24
25
  e.relatedTarget instanceof Node && this.contains(e.relatedTarget) || (this._focused = !1, this._resume());
25
26
  }, this._onClick = (e) => {
26
- i(this._parts.one("void-toast-close"), e) && this._close("close-button");
27
+ o(this._parts.one("void-toast-close"), e) && this._close("close-button");
27
28
  };
28
29
  }
29
30
  connectedCallback() {
@@ -60,24 +61,30 @@ var o = class extends e {
60
61
  bubbles: !1,
61
62
  cancelable: e === "close-button",
62
63
  detail: { reason: e }
63
- })) && r(this);
64
+ })) && a(this);
64
65
  }
65
66
  };
66
- t([a({
67
+ t([s({
67
68
  type: String,
68
69
  reflect: !0
69
- })], o.prototype, "color", void 0), t([a({ type: Number })], o.prototype, "duration", void 0), customElements.get("void-toast") || customElements.define("void-toast", o);
70
- var s = class extends e {
70
+ })], c.prototype, "color", void 0), t([s({ type: Number })], c.prototype, "duration", void 0), customElements.get("void-toast") || customElements.define("void-toast", c);
71
+ var l = class extends e {
71
72
  constructor(...e) {
72
73
  super(...e), this.placement = "bottom-right", this._observer = null, this._announceTimers = /* @__PURE__ */ new Map();
73
74
  }
74
75
  connectedCallback() {
75
- super.connectedCallback(), this.setHostAttribute("role", "region"), this.setHostAttribute("aria-label", "Notifications"), typeof this.showPopover == "function" && this.setHostAttribute("popover", "manual"), this._ensureAnnouncers(), this._observer ??= new MutationObserver((e) => {
76
+ super.connectedCallback(), this.setHostAttribute("role", "region"), this._name(), typeof this.showPopover == "function" && this.setHostAttribute("popover", "manual"), this._ensureAnnouncers(), this._observer ??= new MutationObserver((e) => {
76
77
  this._syncShown(e.some((e) => e.addedNodes.length > 0));
77
- for (let t of e) for (let e of t.addedNodes) e instanceof o && this._announce(e);
78
+ for (let t of e) for (let e of t.addedNodes) e instanceof c && this._announce(e);
78
79
  }), this._observer.observe(this, { childList: !0 }), this._syncShown(!0);
79
80
  for (let e of this.querySelectorAll(":scope > void-toast")) this._announce(e);
80
81
  }
82
+ _name() {
83
+ r(this, n(this, "toast.region"), (e, t) => this.setHostAttribute(e, t));
84
+ }
85
+ updated(e) {
86
+ super.updated(e), this._name();
87
+ }
81
88
  disconnectedCallback() {
82
89
  super.disconnectedCallback(), this._observer?.disconnect();
83
90
  for (let e of this._announceTimers.values()) clearTimeout(e);
@@ -126,38 +133,38 @@ var s = class extends e {
126
133
  static show(e) {
127
134
  let t = document.querySelector("void-toast-container");
128
135
  t || (t = document.createElement("void-toast-container"), document.body.appendChild(t));
129
- let n = c(e);
136
+ let n = u(e);
130
137
  return t.appendChild(n), n;
131
138
  }
132
139
  };
133
- t([a({
140
+ t([s({
134
141
  type: String,
135
142
  reflect: !0
136
- })], s.prototype, "placement", void 0);
137
- function c(e) {
143
+ })], l.prototype, "placement", void 0);
144
+ function u(e) {
138
145
  let t = document.createElement("void-toast");
139
146
  e.color !== void 0 && (t.color = e.color), e.duration !== void 0 && (t.duration = e.duration);
140
- let n = (e, t) => {
147
+ let r = (e, t) => {
141
148
  let n = document.createElement(`void-toast-${e}`);
142
149
  return t !== void 0 && (n.textContent = t), n;
143
150
  };
144
- if (e.title && t.append(n("title", e.title)), t.append(n("description", e.description)), e.actions?.length) {
145
- let r = n("actions");
146
- for (let n of e.actions) {
151
+ if (e.title && t.append(r("title", e.title)), t.append(r("description", e.description)), e.actions?.length) {
152
+ let n = r("actions");
153
+ for (let r of e.actions) {
147
154
  let e = document.createElement("void-button");
148
- e.setAttribute("size", "sm"), e.textContent = n.label, e.addEventListener("click", (e) => n.onClick?.(e, t)), r.append(e);
155
+ e.setAttribute("size", "sm"), e.textContent = r.label, e.addEventListener("click", (e) => r.onClick?.(e, t)), n.append(e);
149
156
  }
150
- t.append(r);
157
+ t.append(n);
151
158
  }
152
159
  if (e.dismissable !== !1) {
153
- let e = n("close"), r = document.createElement("button");
154
- r.type = "button", r.setAttribute("aria-label", "Dismiss"), r.innerHTML = "&times;", e.append(r), t.append(e);
160
+ let e = r("close"), i = document.createElement("button");
161
+ i.type = "button", i.setAttribute("aria-label", n(document.querySelector("void-toast-container") ?? document.documentElement, "dismiss")), i.innerHTML = "&times;", e.append(i), t.append(e);
155
162
  }
156
163
  return t;
157
164
  }
158
- function l(e) {
159
- return s.show(e);
165
+ function d(e) {
166
+ return l.show(e);
160
167
  }
161
- customElements.get("void-toast-container") || customElements.define("void-toast-container", s);
168
+ customElements.get("void-toast-container") || customElements.define("void-toast-container", l);
162
169
  //#endregion
163
- export { o as VoidToast, s as VoidToastContainer, l as toast };
170
+ export { c as VoidToast, l as VoidToastContainer, d as toast };
@@ -1,9 +1,17 @@
1
1
  import { VoidElement } from '../base.js';
2
+ import { KeyOverrides } from '../keys.js';
2
3
  import { FormSubmission } from '../form-control.js';
3
4
  import { VoidToggle } from './toggle.js';
4
5
  declare const VoidToggleGroup_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
5
6
  /** Multi-button toggle set for text editor toolbars and filter chips where one or many options can be active. */
6
7
  export declare class VoidToggleGroup extends VoidToggleGroup_base {
8
+ /** Key bindings for this element's actions, as JSON (`{"next":["ArrowRight"]}`); `[]` switches an action off. See the keyboard guide. */
9
+ keys: KeyOverrides | null;
10
+ /** @internal The actions of this element and their default keys (horizontal; a vertical group starts with ArrowDown and ArrowUp). */
11
+ static readonly keyMap: {
12
+ next: string[];
13
+ previous: string[];
14
+ };
7
15
  /**
8
16
  * Comma-separated `value`s of the pressed toggles (`bold,italic`), or the single pressed value. Reflected to the
9
17
  * attribute as the pressed toggles change; the form's reset target stays the state it started with. Without it (or with an empty one) the
@@ -1,12 +1,13 @@
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/form-control-C0vH6gii.js";
4
- import { r } from "../chunks/keyboard-CEhMSkws.js";
5
- import { property as i } from "lit/decorators.js";
3
+ import { actionFor as n, keysConverter as r } from "../keys.js";
4
+ import { t as i } from "../chunks/form-control-fL-Hhy91.js";
5
+ import { i as a, r as o } from "../chunks/choice-BTrsi7OW.js";
6
+ import { property as s } from "lit/decorators.js";
6
7
  //#region src/components/toggle-group.ts
7
- var a = class extends n(e) {
8
+ var c = class extends i(e) {
8
9
  constructor(...e) {
9
- super(...e), this.value = "", this.multiple = !1, this.disabled = !1, this.size = "md", this.color = "default", this.orientation = "horizontal", this._handleChildChange = (e) => {
10
+ super(...e), this.keys = null, this.value = "", this.multiple = !1, this.disabled = !1, this.size = "md", this.color = "default", this.orientation = "horizontal", this._handleChildChange = (e) => {
10
11
  let t = e.target.closest("void-toggle");
11
12
  if (!t || t.closest("void-toggle-group") !== this) return;
12
13
  if (e.stopImmediatePropagation(), this.formDisabled) {
@@ -32,13 +33,16 @@ var a = class extends n(e) {
32
33
  }, this._handleKeydown = (e) => {
33
34
  let t = this._toggles().filter((e) => !e.disabled);
34
35
  if (!t.length) return;
35
- let n = this.orientation === "horizontal", i = r(this), a = n ? i.next : "ArrowDown", o = n ? i.prev : "ArrowUp";
36
- if (e.key !== a && e.key !== o) return;
36
+ let r = n(this, e, this.orientation === "horizontal" ? o : a);
37
+ if (r !== "next" && r !== "previous") return;
37
38
  e.preventDefault();
38
- let s = t.indexOf(e.target), c;
39
- c = e.key === a ? s < 0 ? 0 : (s + 1) % t.length : s < 0 ? t.length - 1 : (s - 1 + t.length) % t.length, t[c].focus();
39
+ let i = t.indexOf(e.target), s;
40
+ s = r === "next" ? i < 0 ? 0 : (i + 1) % t.length : i < 0 ? t.length - 1 : (i - 1 + t.length) % t.length, t[s].focus();
40
41
  };
41
42
  }
43
+ static {
44
+ this.keyMap = o;
45
+ }
42
46
  connectedCallback() {
43
47
  super.connectedCallback(), this.hasUpdated || this._adoptPressed(this._toggles()), this.setHostAttribute("role", "group"), this.addEventListener("void-change", this._handleChildChange), this.addEventListener("keydown", this._handleKeydown), this._syncToggles();
44
48
  }
@@ -85,24 +89,27 @@ var a = class extends n(e) {
85
89
  e.pressed = t.includes(n), this.disabled && (e.disabled = !0), e.size = this.size, this.color !== "default" && (e.color = this.color);
86
90
  }
87
91
  };
88
- t([i({
92
+ t([s({
93
+ attribute: "keys",
94
+ converter: r
95
+ })], c.prototype, "keys", void 0), t([s({
89
96
  type: String,
90
97
  reflect: !0
91
- })], a.prototype, "value", void 0), t([i({
98
+ })], c.prototype, "value", void 0), t([s({
92
99
  type: Boolean,
93
100
  reflect: !0
94
- })], a.prototype, "multiple", void 0), t([i({
101
+ })], c.prototype, "multiple", void 0), t([s({
95
102
  type: Boolean,
96
103
  reflect: !0
97
- })], a.prototype, "disabled", void 0), t([i({
104
+ })], c.prototype, "disabled", void 0), t([s({
98
105
  type: String,
99
106
  reflect: !0
100
- })], a.prototype, "size", void 0), t([i({
107
+ })], c.prototype, "size", void 0), t([s({
101
108
  type: String,
102
109
  reflect: !0
103
- })], a.prototype, "color", void 0), t([i({
110
+ })], c.prototype, "color", void 0), t([s({
104
111
  type: String,
105
112
  reflect: !0
106
- })], a.prototype, "orientation", void 0), customElements.get("void-toggle-group") || customElements.define("void-toggle-group", a);
113
+ })], c.prototype, "orientation", void 0), customElements.get("void-toggle-group") || customElements.define("void-toggle-group", c);
107
114
  //#endregion
108
- export { a as VoidToggleGroup };
115
+ export { c as VoidToggleGroup };
@@ -1,7 +1,14 @@
1
1
  import { VoidElement } from '../base.js';
2
2
  import { KeyboardActivation } from '../keyboard-activation.js';
3
+ import { KeyOverrides } from '../keys.js';
3
4
  /** Pressable toggle button for toolbar actions and editor formatting controls with binary active/inactive state. */
4
5
  export declare class VoidToggle extends VoidElement {
6
+ /** Key bindings for this element's actions, as JSON (`{"activate":["Enter"]}`); `[]` switches an action off. See the keyboard guide. */
7
+ keys: KeyOverrides | null;
8
+ /** @internal The actions of this element and their default keys. */
9
+ static readonly keyMap: {
10
+ activate: string[];
11
+ };
5
12
  /** Enter and Space fire a real `click`, as on a native button. */
6
13
  protected readonly _activation: KeyboardActivation;
7
14
  /**