@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,13 +1,14 @@
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 { html as i, nothing as a } from "lit";
6
- import { property as o } from "lit/decorators.js";
7
- import { live as s } from "lit/directives/live.js";
3
+ import { msg as n } from "../messages.js";
4
+ import { t as r } from "../chunks/form-control-fL-Hhy91.js";
5
+ import { r as i } from "../chunks/projection-oPe6ipjL.js";
6
+ import { html as a, nothing as o } from "lit";
7
+ import { property as s } from "lit/decorators.js";
8
+ import { live as c } from "lit/directives/live.js";
8
9
  //#region src/components/color-picker.ts
9
- r();
10
- var c = class t extends n(e) {
10
+ i();
11
+ var l = class t extends r(e) {
11
12
  constructor(...e) {
12
13
  super(...e), this.value = "#000000", this.disabled = !1, this.size = "md", this.swatches = [], this.hideInput = !1, this.compact = !1, this.open = !1, this._hue = 0, this._saturation = 0, this._brightness = 0, this._dragging = null, this._boundPointerMove = null, this._boundPointerUp = null, this._onDocumentClick = (e) => {
13
14
  this.open && (this.contains(e.target) || (this.open = !1));
@@ -122,7 +123,7 @@ var c = class t extends n(e) {
122
123
  e.has("value") && !this._dragging && this._syncFromHex(this.value), this._applyCustomProperties(), e.has("open") && (this.open ? document.addEventListener("click", this._onDocumentClick, !0) : document.removeEventListener("click", this._onDocumentClick, !0));
123
124
  }
124
125
  _renderPicker() {
125
- return i`
126
+ return a`
126
127
  <div class="void-color-picker">
127
128
  <div
128
129
  class="void-color-picker-area"
@@ -136,25 +137,25 @@ var c = class t extends n(e) {
136
137
  >
137
138
  <div class="void-color-picker-hue-thumb"></div>
138
139
  </div>
139
- ${this.hideInput ? i`
140
+ ${this.hideInput ? a`
140
141
  <div class="void-color-picker-preview"></div>
141
- ` : i`
142
+ ` : a`
142
143
  <div class="void-color-picker-field">
143
144
  <span class="void-color-picker-field-swatch"></span>
144
145
  <span class="void-color-picker-field-separator"></span>
145
146
  <input
146
147
  class="void-color-picker-input"
147
148
  type="text"
148
- .value=${s(this.value)}
149
+ .value=${c(this.value)}
149
150
  ?disabled=${this.disabled}
150
151
  maxlength="7"
151
152
  @change=${this._onHexInput}
152
153
  />
153
154
  </div>
154
155
  `}
155
- ${this.swatches.length > 0 ? i`
156
+ ${this.swatches.length > 0 ? a`
156
157
  <div class="void-color-picker-swatches">
157
- ${this.swatches.map((e) => i`
158
+ ${this.swatches.map((e) => a`
158
159
  <button
159
160
  type="button"
160
161
  class="void-color-picker-swatch"
@@ -165,12 +166,12 @@ var c = class t extends n(e) {
165
166
  ></button>
166
167
  `)}
167
168
  </div>
168
- ` : a}
169
+ ` : o}
169
170
  </div>
170
171
  `;
171
172
  }
172
173
  render() {
173
- return this.compact ? i`
174
+ return this.compact ? a`
174
175
  <div class="void-color-picker-compact">
175
176
  <button
176
177
  type="button"
@@ -185,41 +186,41 @@ var c = class t extends n(e) {
185
186
  <input
186
187
  class="void-color-picker-compact-input"
187
188
  type="text"
188
- .value=${s(this.value)}
189
+ .value=${c(this.value)}
189
190
  ?disabled=${this.disabled}
190
191
  maxlength="7"
191
192
  @click=${(e) => e.stopPropagation()}
192
193
  @change=${this._onCompactHexInput}
193
194
  />
194
195
  </button>
195
- ${this.open ? i`
196
- <div class="void-color-picker-compact-dropdown" role="dialog" aria-label="Color picker">
196
+ ${this.open ? a`
197
+ <div class="void-color-picker-compact-dropdown" role="dialog" aria-label=${n(this, "colorPicker.label")}>
197
198
  ${this._renderPicker()}
198
199
  </div>
199
- ` : a}
200
+ ` : o}
200
201
  </div>
201
202
  ` : this._renderPicker();
202
203
  }
203
204
  };
204
- t([o({
205
+ t([s({
205
206
  type: String,
206
207
  reflect: !0
207
- })], c.prototype, "value", void 0), t([o({
208
+ })], l.prototype, "value", void 0), t([s({
208
209
  type: Boolean,
209
210
  reflect: !0
210
- })], c.prototype, "disabled", void 0), t([o({
211
+ })], l.prototype, "disabled", void 0), t([s({
211
212
  type: String,
212
213
  reflect: !0
213
- })], c.prototype, "size", void 0), t([o({ type: Array })], c.prototype, "swatches", void 0), t([o({
214
+ })], l.prototype, "size", void 0), t([s({ type: Array })], l.prototype, "swatches", void 0), t([s({
214
215
  type: Boolean,
215
216
  attribute: "hide-input",
216
217
  reflect: !0
217
- })], c.prototype, "hideInput", void 0), t([o({
218
+ })], l.prototype, "hideInput", void 0), t([s({
218
219
  type: Boolean,
219
220
  reflect: !0
220
- })], c.prototype, "compact", void 0), t([o({
221
+ })], l.prototype, "compact", void 0), t([s({
221
222
  type: Boolean,
222
223
  reflect: !0
223
- })], c.prototype, "open", void 0), customElements.get("void-color-picker") || customElements.define("void-color-picker", c);
224
+ })], l.prototype, "open", void 0), customElements.get("void-color-picker") || customElements.define("void-color-picker", l);
224
225
  //#endregion
225
- export { c as VoidColorPicker };
226
+ export { l as VoidColorPicker };
@@ -2,6 +2,7 @@ import { VoidElement } from '../base.js';
2
2
  import { OverlayController } from '../overlay.js';
3
3
  import { PartsController } from '../parts.js';
4
4
  import { ProjectionController } from '../projection.js';
5
+ import { KeyOverrides } from '../keys.js';
5
6
  declare const VoidCombobox_base: (new (...args: any[]) => import('../form-control.js').VoidInternalsFormControl) & typeof VoidElement;
6
7
  /**
7
8
  * Filterable dropdown for long option lists like country selectors, user assignment fields, and tag pickers.
@@ -30,6 +31,16 @@ declare const VoidCombobox_base: (new (...args: any[]) => import('../form-contro
30
31
  * @fires {CustomEvent<{ reason: 'escape' | 'outside' | 'blur' | 'select' | 'parent' | 'api' }>} void-close - The option list is closing.
31
32
  */
32
33
  export declare class VoidCombobox extends VoidCombobox_base {
34
+ /** Key bindings for this element's actions, as JSON (`{"close":["Escape"]}`); `[]` switches an action off. See the keyboard guide. */
35
+ keys: KeyOverrides | null;
36
+ /** @internal The actions of this element and their default keys. */
37
+ static readonly keyMap: {
38
+ next: string[];
39
+ previous: string[];
40
+ open: string[];
41
+ activate: string[];
42
+ close: string[];
43
+ };
33
44
  /** The host's `aria-label` / `aria-labelledby` name the inner control. */
34
45
  static labelTarget: string;
35
46
  /**
@@ -38,10 +49,11 @@ export declare class VoidCombobox extends VoidCombobox_base {
38
49
  */
39
50
  value: string;
40
51
  /**
41
- * Hint shown in the search field while it is empty. Defaults to `Search...`. It is also the field's
52
+ * Hint shown in the search field while it is empty. Defaults to the `combobox.placeholder` message (English: `Search...`). It is also the field's
42
53
  * accessible name when no `void-field` label names it.
43
54
  */
44
55
  placeholder: string;
56
+ private get _hint();
45
57
  /** Stop the field opening and exclude the value from the form submission. */
46
58
  disabled: boolean;
47
59
  /** Size step: `sm`, `md` (default) or `lg`. */
@@ -1,23 +1,26 @@
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 { n as r, t as i } from "../chunks/projection-oPe6ipjL.js";
5
- import { n as a } from "../chunks/parts-DI_3VpSy.js";
6
- import { a as o, n as s } from "../chunks/keyboard-CEhMSkws.js";
7
- import { t as c } from "../chunks/overlay-CH7L4N-h.js";
8
- import { optionLabel as l } from "./multiselect.js";
9
- import { html as u, nothing as d } from "lit";
10
- import { property as f } from "lit/decorators.js";
11
- import { live as p } from "lit/directives/live.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 { n as o, t as s } from "../chunks/projection-oPe6ipjL.js";
7
+ import { n as c } from "../chunks/parts-DI_3VpSy.js";
8
+ import { n as l, r as u } from "../chunks/keyboard-ChtDvhB_.js";
9
+ import { n as d } from "../chunks/pickers-CjlFgNke.js";
10
+ import { t as f } from "../chunks/overlay-BuV-4Yvt.js";
11
+ import { optionLabel as p } from "./multiselect.js";
12
+ import { html as m, nothing as h } from "lit";
13
+ import { property as g } from "lit/decorators.js";
14
+ import { live as _ } from "lit/directives/live.js";
12
15
  //#region src/components/combobox.ts
13
- var m = class extends n(e) {
16
+ var v = class extends a(e) {
14
17
  constructor(...e) {
15
- super(...e), this.value = "", this.placeholder = "Search...", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this.open = !1, this._query = "", this._active = null, this._wiring = !1, this._projection = new i(this, { placement: "start" }), this._parts = new a(this, {
18
+ super(...e), this.keys = null, this.value = "", this.placeholder = "", this.disabled = !1, this.size = "md", this.error = "", this.name = "", this.open = !1, this._query = "", this._active = null, this._wiring = !1, this._projection = new s(this, { placement: "start" }), this._parts = new c(this, {
16
19
  tags: ["void-combobox-content", "void-option"],
17
20
  onChange: () => {
18
21
  this._wire(), this._wiring || this.requestUpdate();
19
22
  }
20
- }), this._overlay = new c(this, {
23
+ }), this._overlay = new f(this, {
21
24
  kind: "listbox",
22
25
  surface: () => this._content(),
23
26
  isOpen: () => this.open && !this.disabled,
@@ -35,29 +38,36 @@ var m = class extends n(e) {
35
38
  let n = e.target.closest("void-option");
36
39
  n && !n.disabled && this._options.includes(n) && this._selectOption(n);
37
40
  }, this._onInputFocus = () => {
38
- this.disabled || r(this) || (this._overlay.requestOpen("focus"), this._query = "", this._active = null);
41
+ this.disabled || o(this) || (this._overlay.requestOpen("focus"), this._query = "", this._active = null);
39
42
  }, this._onInput = (e) => {
40
43
  this._query = e.target.value, this.open = !0, this._active = null, this.requestUpdate();
41
44
  }, this._onInputKeydown = (e) => {
42
45
  if (this.disabled || e.isComposing) return;
43
- let t = e.key;
44
- if (t === "ArrowDown" || t === "ArrowUp") {
45
- if (e.preventDefault(), this.open) e.altKey ? t === "ArrowUp" && this._close("escape") : this._moveActive(t === "ArrowDown" ? "next" : "prev");
46
- else if (this._query = "", this._overlay.requestOpen("keyboard"), !e.altKey) {
46
+ let t = e.key, r = n(this, e);
47
+ if (r === "next" || r === "previous") {
48
+ if (e.preventDefault(), this.open) this._moveActive(r === "next" ? "next" : "prev");
49
+ else {
50
+ this._query = "", this._overlay.requestOpen("keyboard");
47
51
  let e = this._visible.find((e) => e.value === this.value && !e.disabled);
48
- e ? this._active = e : this._moveActive(t === "ArrowDown" ? "next" : "prev");
52
+ e ? this._active = e : this._moveActive(r === "next" ? "next" : "prev");
49
53
  }
50
54
  this.requestUpdate();
51
- } else t === "Enter" ? this.open && this._active && !this._active.disabled ? (e.preventDefault(), this._selectOption(this._active)) : this.open && this._close("escape") : t === "Escape" ? this.open && (e.preventDefault(), e.stopPropagation(), this._close("escape")) : (t === "ArrowLeft" || t === "ArrowRight" || t === "Home" || t === "End") && this._active && (this._active = null, this.requestUpdate());
55
+ } else r === "open" ? (e.preventDefault(), this.open || (this._query = "", this._overlay.requestOpen("keyboard")), this.requestUpdate()) : r === "activate" ? this.open && this._active && !this._active.disabled ? (e.preventDefault(), this._selectOption(this._active)) : this.open && this._close("escape") : r === "close" ? this.open && (e.preventDefault(), e.stopPropagation(), this._close("escape")) : !e.defaultPrevented && (t === "ArrowLeft" || t === "ArrowRight" || t === "Home" || t === "End") && this._active && (this._active = null, this.requestUpdate());
52
56
  }, this._onInputBlur = () => {
53
57
  setTimeout(() => {
54
58
  this.contains(document.activeElement) && document.activeElement?.tagName === "INPUT" || this._close("blur");
55
59
  }, 150);
56
60
  };
57
61
  }
62
+ static {
63
+ this.keyMap = d;
64
+ }
58
65
  static {
59
66
  this.labelTarget = "input[role=combobox]";
60
67
  }
68
+ get _hint() {
69
+ return this.placeholder || i(this, "combobox.placeholder");
70
+ }
61
71
  _content() {
62
72
  return this._parts.one("void-combobox-content");
63
73
  }
@@ -71,7 +81,7 @@ var m = class extends n(e) {
71
81
  get _visible() {
72
82
  if (!this._query) return this._options;
73
83
  let e = this._query.toLowerCase();
74
- return this._options.filter((t) => l(t).toLowerCase().includes(e));
84
+ return this._options.filter((t) => p(t).toLowerCase().includes(e));
75
85
  }
76
86
  connectedCallback() {
77
87
  this._authoredValue ??= this.hasAttribute("value"), super.connectedCallback(), this.addEventListener("mousedown", this._onPointerDown);
@@ -98,47 +108,47 @@ var m = class extends n(e) {
98
108
  this.open && this._active?.scrollIntoView?.({ block: "nearest" });
99
109
  }
100
110
  _wire() {
101
- let e = this._content(), t = this._input(), n = this._options, r = this.open && !this.disabled, i = r ? this._query.toLowerCase() : "";
111
+ let e = this._content(), t = this._input(), n = this._options, r = this.open && !this.disabled, a = r ? this._query.toLowerCase() : "";
102
112
  this._adoptSelected(n), this._active && (!n.includes(this._active) || this._active.disabled) && (this._active = null);
103
- let a = 0;
113
+ let o = 0;
104
114
  for (let e of n) {
105
115
  this._parts.set(e, "role", "option"), this._parts.id(e, "void-option"), this._parts.set(e, "aria-selected", e.value === this.value ? "true" : null), this._parts.set(e, "aria-disabled", e.disabled ? "true" : null);
106
- let t = !i || l(e).toLowerCase().includes(i);
107
- this._parts.set(e, "hidden", !t), t ? a++ : e === this._active && (this._active = null), this._parts.set(e, "active", e === this._active);
116
+ let t = !a || p(e).toLowerCase().includes(a);
117
+ this._parts.set(e, "hidden", !t), t ? o++ : e === this._active && (this._active = null), this._parts.set(e, "active", e === this._active);
108
118
  }
109
119
  if (e) {
110
120
  this._parts.set(e, "popover", "manual"), this._parts.set(e, "role", "listbox"), this._parts.id(e, "void-combobox-content");
111
121
  let n = r ? t?.getAttribute("aria-labelledby") ?? null : null;
112
- this._parts.set(e, "aria-labelledby", n), this._parts.set(e, "aria-label", r && !n && (t?.getAttribute("aria-label") || this.placeholder) || null), this._parts.set(e, "empty", a === 0), t && this._parts.set(t, "aria-activedescendant", r && this._active ? this._parts.id(this._active, "void-option") : null);
122
+ this._parts.set(e, "aria-labelledby", n), this._parts.set(e, "aria-label", r && !n && (t?.getAttribute("aria-label") || this._hint) || null), this.setHostStyle("--_void-combobox-empty", JSON.stringify(i(this, "combobox.empty"))), this._parts.set(e, "empty", o === 0), t && this._parts.set(t, "aria-activedescendant", r && this._active ? this._parts.id(this._active, "void-option") : null);
113
123
  }
114
124
  }
115
125
  _controls(e) {
116
126
  let t = e ? this._content() : null;
117
- return t ? this._parts.id(t, "void-combobox-content") : d;
127
+ return t ? this._parts.id(t, "void-combobox-content") : h;
118
128
  }
119
129
  render() {
120
130
  let e = this._options.find((e) => e.value === this.value), t = this.open && !this.disabled;
121
- return u`
131
+ return m`
122
132
  <input
123
133
  class="void-combobox-input"
124
134
  role="combobox"
125
- .value=${p(t ? this._query : e ? l(e) : this.value || "")}
126
- placeholder=${this.placeholder}
127
- aria-label=${this.placeholder}
135
+ .value=${_(t ? this._query : e ? p(e) : this.value || "")}
136
+ placeholder=${this._hint}
137
+ aria-label=${this._hint}
128
138
  ?disabled=${this.disabled}
129
139
  autocomplete="off"
130
140
  aria-autocomplete="list"
131
141
  aria-haspopup="listbox"
132
142
  aria-expanded=${String(t)}
133
143
  aria-controls=${this._controls(t)}
134
- aria-required=${this.required ? "true" : d}
144
+ aria-required=${this.required ? "true" : h}
135
145
  aria-invalid=${this.error ? "true" : "false"}
136
146
  @focus=${this._onInputFocus}
137
147
  @input=${this._onInput}
138
148
  @keydown=${this._onInputKeydown}
139
149
  @blur=${this._onInputBlur}
140
150
  />
141
- ${this.error ? u`<span class="void-combobox-error">${this.error}</span>` : d}
151
+ ${this.error ? m`<span class="void-combobox-error">${this.error}</span>` : h}
142
152
  `;
143
153
  }
144
154
  disconnectedCallback() {
@@ -157,7 +167,7 @@ var m = class extends n(e) {
157
167
  }
158
168
  }
159
169
  let i;
160
- i = e === "next" ? o(n, r, 1) : r < 0 ? s(n, -1) : o(n, r, -1), this._active = i >= 0 ? t[i] : null;
170
+ i = e === "next" ? u(n, r, 1) : r < 0 ? l(n, -1) : u(n, r, -1), this._active = i >= 0 ? t[i] : null;
161
171
  }
162
172
  _selectOption(e) {
163
173
  this._initial = !0, this.value = e.value, this._close("select"), this.dispatchEvent(new CustomEvent("void-change", {
@@ -167,24 +177,27 @@ var m = class extends n(e) {
167
177
  }));
168
178
  }
169
179
  };
170
- t([f({
180
+ t([g({
181
+ attribute: "keys",
182
+ converter: r
183
+ })], v.prototype, "keys", void 0), t([g({
171
184
  type: String,
172
185
  reflect: !0
173
- })], m.prototype, "value", void 0), t([f({ type: String })], m.prototype, "placeholder", void 0), t([f({
186
+ })], v.prototype, "value", void 0), t([g({ type: String })], v.prototype, "placeholder", void 0), t([g({
174
187
  type: Boolean,
175
188
  reflect: !0
176
- })], m.prototype, "disabled", void 0), t([f({
189
+ })], v.prototype, "disabled", void 0), t([g({
177
190
  type: String,
178
191
  reflect: !0
179
- })], m.prototype, "size", void 0), t([f({
192
+ })], v.prototype, "size", void 0), t([g({
180
193
  type: String,
181
194
  reflect: !0
182
- })], m.prototype, "error", void 0), t([f({
195
+ })], v.prototype, "error", void 0), t([g({
183
196
  type: String,
184
197
  reflect: !0
185
- })], m.prototype, "name", void 0), t([f({
198
+ })], v.prototype, "name", void 0), t([g({
186
199
  type: Boolean,
187
200
  reflect: !0
188
- })], m.prototype, "open", void 0), customElements.get("void-combobox") || customElements.define("void-combobox", m);
201
+ })], v.prototype, "open", void 0), customElements.get("void-combobox") || customElements.define("void-combobox", v);
189
202
  //#endregion
190
- export { m as VoidCombobox };
203
+ export { v as VoidCombobox };
@@ -1,14 +1,22 @@
1
1
  import { VoidElement } from '../base.js';
2
+ import { KeyOverrides } from '../keys.js';
2
3
  /** Rich text entry area for messaging UIs, comment boxes, and social post composers. */
3
4
  export declare class VoidComposeInput extends VoidElement {
5
+ /** Key bindings for this element's actions, as JSON (`{"send":["Control+Enter"]}`); `[]` switches an action off. See the keyboard guide. */
6
+ keys: KeyOverrides | null;
7
+ /** @internal The actions of this element and their default keys. */
8
+ static readonly keyMap: {
9
+ send: string[];
10
+ };
4
11
  /** The host's `aria-label` / `aria-labelledby` name the inner control. */
5
12
  static labelTarget: string;
6
13
  /** While focus is inside, a morph does not apply the server's value over what the user is typing. */
7
14
  static editState: string[];
8
15
  /** The draft text, reflected to the `value` attribute as it changes. It is cleared after each send. */
9
16
  value: string;
10
- /** Hint shown while the box is empty. Defaults to `Type a message...`. */
17
+ /** Hint shown while the box is empty. Defaults to the `composeInput.placeholder` message (English: `Type a message...`). */
11
18
  placeholder: string;
19
+ private get _hint();
12
20
  /** Stop the box and the send button reacting. */
13
21
  disabled: boolean;
14
22
  /** Maximum number of characters. 0 (the default) means no limit. */
@@ -1,13 +1,19 @@
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, query as a } 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 { r as a } from "../chunks/projection-oPe6ipjL.js";
6
+ import { t as o } from "../chunks/fields-MEqz-olE.js";
7
+ import { html as s } from "lit";
8
+ import { property as c, query as l } from "lit/decorators.js";
6
9
  //#region src/components/compose-input.ts
7
- n();
8
- var o = class extends e {
10
+ a();
11
+ var u = class extends e {
9
12
  constructor(...e) {
10
- super(...e), this.value = "", this.placeholder = "Type a message...", this.disabled = !1, this.maxlength = 0;
13
+ super(...e), this.keys = null, this.value = "", this.placeholder = "", this.disabled = !1, this.maxlength = 0;
14
+ }
15
+ static {
16
+ this.keyMap = o;
11
17
  }
12
18
  static {
13
19
  this.labelTarget = "textarea";
@@ -15,13 +21,16 @@ var o = class extends e {
15
21
  static {
16
22
  this.editState = ["value"];
17
23
  }
24
+ get _hint() {
25
+ return this.placeholder || i(this, "composeInput.placeholder");
26
+ }
18
27
  render() {
19
- return r`
28
+ return s`
20
29
  <div class="void-compose-input-wrapper">
21
30
  <textarea
22
31
  class="void-compose-input-textarea"
23
32
  .value=${this.value}
24
- placeholder=${this.placeholder}
33
+ placeholder=${this._hint}
25
34
  ?disabled=${this.disabled}
26
35
  maxlength=${this.maxlength > 0 ? this.maxlength : ""}
27
36
  rows="1"
@@ -33,7 +42,7 @@ var o = class extends e {
33
42
  type="button"
34
43
  ?disabled=${this.disabled || !this.value}
35
44
  @click=${this._onSend}
36
- aria-label="Send"
45
+ aria-label=${i(this, "composeInput.send")}
37
46
  >
38
47
  <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
39
48
  <path d="M2 8L14 8M14 8L9 3M14 8L9 13" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
@@ -53,7 +62,7 @@ var o = class extends e {
53
62
  }));
54
63
  }
55
64
  _onKeydown(e) {
56
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), this._onSend());
65
+ n(this, e) === "send" && (e.preventDefault(), this._onSend());
57
66
  }
58
67
  _onSend() {
59
68
  if (this.disabled || !this.value) return;
@@ -65,18 +74,21 @@ var o = class extends e {
65
74
  }));
66
75
  }
67
76
  };
68
- t([i({
77
+ t([c({
78
+ attribute: "keys",
79
+ converter: r
80
+ })], u.prototype, "keys", void 0), t([c({
69
81
  type: String,
70
82
  reflect: !0
71
- })], o.prototype, "value", void 0), t([i({
83
+ })], u.prototype, "value", void 0), t([c({
72
84
  type: String,
73
85
  reflect: !0
74
- })], o.prototype, "placeholder", void 0), t([i({
86
+ })], u.prototype, "placeholder", void 0), t([c({
75
87
  type: Boolean,
76
88
  reflect: !0
77
- })], o.prototype, "disabled", void 0), t([i({
89
+ })], u.prototype, "disabled", void 0), t([c({
78
90
  type: Number,
79
91
  reflect: !0
80
- })], o.prototype, "maxlength", void 0), t([a(".void-compose-input-textarea")], o.prototype, "_textarea", void 0), customElements.get("void-compose-input") || customElements.define("void-compose-input", o);
92
+ })], u.prototype, "maxlength", void 0), t([l(".void-compose-input-textarea")], u.prototype, "_textarea", void 0), customElements.get("void-compose-input") || customElements.define("void-compose-input", u);
81
93
  //#endregion
82
- export { o as VoidComposeInput };
94
+ export { u as VoidComposeInput };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../chunks/decorate-CaYbmmmm.js";
2
- import { t } from "../chunks/modal-DWGkNdNG.js";
2
+ import { t } from "../chunks/modal-Cz2-Ov76.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  //#region src/components/dialog.ts
5
5
  var r = class extends t {