@voidable/ui 0.8.0 → 0.9.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 (69) hide show
  1. package/README.md +8 -0
  2. package/dist/chunks/{modal-D_YVy2vg.js → modal-hivQ4YoU.js} +1 -1
  3. package/dist/chunks/{parts-D30c8OoG.js → parts-CMQQop0D.js} +4 -1
  4. package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
  5. package/dist/chunks/value-list-CH6GjYXM.js +28 -0
  6. package/dist/components/accordion.js +1 -1
  7. package/dist/components/action-input.d.ts +6 -2
  8. package/dist/components/action-input.js +55 -45
  9. package/dist/components/alert.js +1 -1
  10. package/dist/components/banner.js +1 -1
  11. package/dist/components/breadcrumbs.js +1 -1
  12. package/dist/components/carousel.js +1 -1
  13. package/dist/components/checkbox-group.d.ts +10 -0
  14. package/dist/components/checkbox-group.js +30 -18
  15. package/dist/components/checkbox.d.ts +2 -2
  16. package/dist/components/collapsible.js +1 -1
  17. package/dist/components/color-picker.d.ts +2 -2
  18. package/dist/components/combobox.d.ts +4 -2
  19. package/dist/components/combobox.js +8 -5
  20. package/dist/components/compose-input.d.ts +1 -1
  21. package/dist/components/compose-input.js +4 -1
  22. package/dist/components/dialog.js +1 -1
  23. package/dist/components/drawer.js +1 -1
  24. package/dist/components/dropdown-menu.js +1 -1
  25. package/dist/components/editable.d.ts +1 -1
  26. package/dist/components/error-fallback.js +1 -1
  27. package/dist/components/gauge.js +4 -1
  28. package/dist/components/hover-card.js +1 -1
  29. package/dist/components/input.d.ts +6 -2
  30. package/dist/components/input.js +43 -33
  31. package/dist/components/menu.js +1 -1
  32. package/dist/components/multiselect.d.ts +9 -0
  33. package/dist/components/multiselect.js +47 -38
  34. package/dist/components/nav-menu.js +1 -1
  35. package/dist/components/number-input.d.ts +2 -2
  36. package/dist/components/panel.js +1 -1
  37. package/dist/components/pin-input.d.ts +6 -2
  38. package/dist/components/pin-input.js +27 -17
  39. package/dist/components/popover.js +1 -1
  40. package/dist/components/radio-group.d.ts +2 -2
  41. package/dist/components/radio-group.js +4 -1
  42. package/dist/components/segmented-control.d.ts +1 -1
  43. package/dist/components/select.d.ts +67 -16
  44. package/dist/components/select.js +172 -47
  45. package/dist/components/slider.d.ts +2 -2
  46. package/dist/components/slider.js +4 -1
  47. package/dist/components/switch.d.ts +1 -1
  48. package/dist/components/tabs.js +1 -1
  49. package/dist/components/tags-input.d.ts +1 -1
  50. package/dist/components/tags-input.js +22 -18
  51. package/dist/components/textarea.d.ts +2 -2
  52. package/dist/components/textarea.js +4 -1
  53. package/dist/components/toast.js +1 -1
  54. package/dist/components/toggle-group.d.ts +2 -2
  55. package/dist/components/toggle.js +4 -1
  56. package/dist/components/tooltip.js +1 -1
  57. package/dist/components.json +3 -3
  58. package/dist/custom-elements.json +85 -49
  59. package/dist/dev/types.d.ts +2 -3
  60. package/dist/dev.js +50 -48
  61. package/dist/llms.txt +125 -0
  62. package/dist/parts.d.ts +3 -1
  63. package/dist/reference.md +4575 -0
  64. package/dist/secret-value.d.ts +17 -0
  65. package/dist/types/elements.d.ts +2 -2
  66. package/dist/value-list.d.ts +14 -0
  67. package/dist/vscode.html-custom-data.json +33 -19
  68. package/dist/web-types.json +57 -37
  69. package/package.json +5 -3
package/README.md CHANGED
@@ -185,6 +185,14 @@ Dialog and drawer are native `<dialog>` elements opened with `showModal()`, so t
185
185
 
186
186
  Every overlay takes `open`, `side` and `align` where it is anchored, and fires `void-open` and `void-close` with a `reason` (`escape`, `outside`, `select`, `api`, ...). These two events do not bubble, and `void-close` can be cancelled when the user caused it. Browser baseline: the Popover API (Chrome 114, Firefox 125, Safari 17). Details on the [docs site](https://voidable.dev/components/overlays/).
187
187
 
188
+ ## For AI agents
189
+
190
+ The package carries its own reference, generated from the Custom Elements Manifest at build time, so an agent with only `node_modules/@voidable/ui` has it:
191
+
192
+ - `@voidable/ui/llms.txt` (`dist/llms.txt`): what the library is, install, the composition rules and conventions, one line per element.
193
+ - `@voidable/ui/reference.md` (`dist/reference.md`): every element in full, with its parts, attributes and allowed values, events and their `detail`, and a correct example.
194
+ - `@voidable/ui/custom-elements.json`: the manifest both are generated from.
195
+
188
196
  ## Documentation
189
197
 
190
198
  - [Docs](https://voidable.dev)
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./base-CMruMbxC.js";
2
2
  import { t } from "./decorate-CaYbmmmm.js";
3
- import { n, r } from "./parts-D30c8OoG.js";
3
+ import { n, r } from "./parts-CMQQop0D.js";
4
4
  import { t as i } from "./overlay-BywGMcDW.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/modal.ts
@@ -13,6 +13,8 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
13
13
  }
14
14
  let e = t.target;
15
15
  if (e.localName?.endsWith("-trigger") && this._tags.has(e.localName)) return this.requestSync();
16
+ let n = e.localName === "void-button" ? e.parentElement : null;
17
+ if (n && n.localName.endsWith("-trigger") && this._tags.has(n.localName)) return this.requestSync();
16
18
  for (let e of [t.addedNodes, t.removedNodes]) for (let t = 0; t < e.length; t++) {
17
19
  let n = e[t];
18
20
  if (n.nodeType !== 1) continue;
@@ -219,7 +221,8 @@ var r = (e) => (e ?? "").split(/\s+/).filter(Boolean), i = class {
219
221
  }
220
222
  };
221
223
  function a(e) {
222
- return e?.firstElementChild ?? null;
224
+ let t = e?.firstElementChild ?? null;
225
+ return t?.localName === "void-button" ? t.querySelector(":scope > a[href], :scope > button") ?? t : t;
223
226
  }
224
227
  function o(e, t) {
225
228
  let n = e.shadowRoot ?? e.attachShadow({ mode: "open" });
@@ -0,0 +1,14 @@
1
+ //#region src/secret-value.ts
2
+ function e(e, t, n, r) {
3
+ return t !== "value" || !e ? n : {
4
+ ...n ?? r(),
5
+ reflect: !1
6
+ };
7
+ }
8
+ function t(e) {
9
+ if (!e.hasAttribute("value")) return;
10
+ let t = e.value;
11
+ e.removeAttribute("value"), e.value = t;
12
+ }
13
+ //#endregion
14
+ export { e as n, t };
@@ -0,0 +1,28 @@
1
+ //#region src/value-list.ts
2
+ var e = {
3
+ fromAttribute(e) {
4
+ if (e === null || e.trim() === "") return [];
5
+ try {
6
+ let t = JSON.parse(e);
7
+ if (Array.isArray(t)) return t;
8
+ } catch {}
9
+ return [];
10
+ },
11
+ toAttribute(e) {
12
+ return JSON.stringify(e ?? []);
13
+ }
14
+ }, t = {
15
+ fromAttribute(e) {
16
+ if (e === null || e.trim() === "") return [];
17
+ try {
18
+ let t = JSON.parse(e);
19
+ if (Array.isArray(t)) return t.map(String);
20
+ } catch {}
21
+ return [e];
22
+ },
23
+ toAttribute(e) {
24
+ return JSON.stringify(e ?? []);
25
+ }
26
+ };
27
+ //#endregion
28
+ export { t as n, e as t };
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { t as r } from "../chunks/disclosure-Bj_49GcC.js";
5
5
  import { property as i } from "lit/decorators.js";
6
6
  //#region src/components/accordion.ts
@@ -1,3 +1,4 @@
1
+ import { PropertyDeclaration, PropertyValues } from 'lit';
1
2
  import { VoidElement } from '../base.js';
2
3
  declare const VoidActionInput_base: (new (...args: any[]) => import('../form-control.js').VoidNativeFormControl) & typeof VoidElement;
3
4
  /** Input field with an attached icon button — used for copy-to-clipboard inputs, search boxes, and similar patterns. */
@@ -7,8 +8,9 @@ export declare class VoidActionInput extends VoidActionInput_base {
7
8
  /** While focus is inside, a morph does not apply the server's value over what the user is typing. */
8
9
  static editState: string[];
9
10
  /**
10
- * The text in the field. As an attribute it is the initial value; read or set the `value` property for
11
- * the current text.
11
+ * The text in the field. Reflected to the `value` attribute as it changes, and setting the attribute
12
+ * sets it; the form's reset target stays the value the field started with. A `type="password"` field
13
+ * does not reflect: its attribute is only ever the initial value.
12
14
  */
13
15
  value: string;
14
16
  /**
@@ -70,6 +72,8 @@ export declare class VoidActionInput extends VoidActionInput_base {
70
72
  /** Where the button's tooltip appears: `top` (default), `bottom`, `left` or `right`. */
71
73
  tooltipSide: 'top' | 'bottom' | 'left' | 'right';
72
74
  private _renderIcon;
75
+ requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration): void;
76
+ protected updated(changed: PropertyValues): void;
73
77
  protected formWriteNativeDefault(state: unknown): void;
74
78
  protected formReadNative(): void;
75
79
  protected formSyncNative(): void;
@@ -1,11 +1,12 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { n } from "../chunks/form-control-C0vH6gii.js";
4
- import { html as r, nothing as i } from "lit";
5
- import { property as a } from "lit/decorators.js";
6
- import { live as o } from "lit/directives/live.js";
4
+ import { n as r, t as i } from "../chunks/secret-value-CmTtVkMg.js";
5
+ import { html as a, nothing as o } from "lit";
6
+ import { property as s } from "lit/decorators.js";
7
+ import { live as c } from "lit/directives/live.js";
7
8
  //#region src/components/action-input.ts
8
- var s = class extends n(e) {
9
+ var l = class t extends n(e) {
9
10
  constructor(...e) {
10
11
  super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.pattern = "", this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null, this.size = "md", this.color = "default", this.type = "text", this.icon = "search", this.actionLabel = "Action", this.iconSide = "right", this.tooltipSide = "top";
11
12
  }
@@ -17,18 +18,24 @@ var s = class extends n(e) {
17
18
  }
18
19
  _renderIcon() {
19
20
  switch (this.icon) {
20
- case "copy": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666"/><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"/></svg>`;
21
- case "search": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
22
- case "send": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 14l11 -11"/><path d="M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5"/></svg>`;
23
- case "eye": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>`;
24
- case "eye-off": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>`;
25
- case "check": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>`;
26
- case "x": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12"/><path d="M6 6l12 12"/></svg>`;
27
- case "arrow-right": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0"/><path d="M13 18l6 -6"/><path d="M13 6l6 6"/></svg>`;
28
- case "clipboard": return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"/><path d="M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2"/></svg>`;
29
- default: return r`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
21
+ case "copy": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666"/><path d="M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1"/></svg>`;
22
+ case "search": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
23
+ case "send": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 14l11 -11"/><path d="M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5"/></svg>`;
24
+ case "eye": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>`;
25
+ case "eye-off": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>`;
26
+ case "check": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l5 5l10 -10"/></svg>`;
27
+ case "x": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12"/><path d="M6 6l12 12"/></svg>`;
28
+ case "arrow-right": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0"/><path d="M13 18l6 -6"/><path d="M13 6l6 6"/></svg>`;
29
+ case "clipboard": return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2"/><path d="M9 5a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2"/></svg>`;
30
+ default: return a`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/><path d="M21 21l-6 -6"/></svg>`;
30
31
  }
31
32
  }
33
+ requestUpdate(e, n, i) {
34
+ super.requestUpdate(e, n, r(this.type === "password", e, i, () => t.getPropertyOptions("value")));
35
+ }
36
+ updated(e) {
37
+ super.updated(e), this.type === "password" && e.get("type") !== void 0 && i(this);
38
+ }
32
39
  formWriteNativeDefault(e) {
33
40
  let t = this.querySelector(".void-action-input-field");
34
41
  t && (t.defaultValue = String(e ?? ""));
@@ -65,7 +72,7 @@ var s = class extends n(e) {
65
72
  }));
66
73
  }
67
74
  render() {
68
- let e = r`
75
+ let e = a`
69
76
  <void-tooltip side=${this.tooltipSide}>
70
77
  <void-tooltip-trigger><button
71
78
  class="void-action-input-btn"
@@ -77,27 +84,27 @@ var s = class extends n(e) {
77
84
  <void-tooltip-content>${this.actionLabel}</void-tooltip-content>
78
85
  </void-tooltip>
79
86
  `;
80
- return r`
87
+ return a`
81
88
  ${this.iconSide === "left" ? e : ""}
82
89
  <input
83
90
  class="void-action-input-field"
84
91
  type=${this.type}
85
- .value=${o(this.value)}
92
+ .value=${c(this.value)}
86
93
  placeholder=${this.placeholder}
87
94
  ?disabled=${this.disabled}
88
95
  ?readonly=${this.readonly}
89
96
  ?required=${this.required}
90
97
  name=${this.name}
91
- form=${this.formAttr ?? i}
92
- autocomplete=${this.autocomplete || i}
93
- minlength=${this.minlength ?? i}
94
- maxlength=${this.maxlength ?? i}
95
- pattern=${this.pattern || i}
96
- inputmode=${this.inputMode || i}
97
- enterkeyhint=${this.enterKeyHint || i}
98
- autocapitalize=${this.autocapitalize || i}
99
- spellcheck=${this.spellcheckAttr ?? i}
100
- aria-label=${this.placeholder || i}
98
+ form=${this.formAttr ?? o}
99
+ autocomplete=${this.autocomplete || o}
100
+ minlength=${this.minlength ?? o}
101
+ maxlength=${this.maxlength ?? o}
102
+ pattern=${this.pattern || o}
103
+ inputmode=${this.inputMode || o}
104
+ enterkeyhint=${this.enterKeyHint || o}
105
+ autocapitalize=${this.autocapitalize || o}
106
+ spellcheck=${this.spellcheckAttr ?? o}
107
+ aria-label=${this.placeholder || o}
101
108
  @input=${this._onInput}
102
109
  @change=${this._onChange}
103
110
  />
@@ -105,56 +112,59 @@ var s = class extends n(e) {
105
112
  `;
106
113
  }
107
114
  };
108
- t([a({ type: String })], s.prototype, "value", void 0), t([a({
115
+ t([s({
116
+ type: String,
117
+ reflect: !0
118
+ })], l.prototype, "value", void 0), t([s({
109
119
  type: String,
110
120
  reflect: !0
111
- })], s.prototype, "placeholder", void 0), t([a({
121
+ })], l.prototype, "placeholder", void 0), t([s({
112
122
  type: Boolean,
113
123
  reflect: !0
114
- })], s.prototype, "disabled", void 0), t([a({
124
+ })], l.prototype, "disabled", void 0), t([s({
115
125
  type: Boolean,
116
126
  reflect: !0
117
- })], s.prototype, "readonly", void 0), t([a({
127
+ })], l.prototype, "readonly", void 0), t([s({
118
128
  type: Boolean,
119
129
  reflect: !0
120
- })], s.prototype, "required", void 0), t([a({
130
+ })], l.prototype, "required", void 0), t([s({
121
131
  type: String,
122
132
  reflect: !0
123
- })], s.prototype, "name", void 0), t([a({
133
+ })], l.prototype, "name", void 0), t([s({
124
134
  type: String,
125
135
  reflect: !0
126
- })], s.prototype, "autocomplete", void 0), t([a({ type: Number })], s.prototype, "minlength", void 0), t([a({ type: Number })], s.prototype, "maxlength", void 0), t([a({ type: String })], s.prototype, "pattern", void 0), t([a({
136
+ })], l.prototype, "autocomplete", void 0), t([s({ type: Number })], l.prototype, "minlength", void 0), t([s({ type: Number })], l.prototype, "maxlength", void 0), t([s({ type: String })], l.prototype, "pattern", void 0), t([s({
127
137
  type: String,
128
138
  attribute: "inputmode"
129
- })], s.prototype, "inputMode", void 0), t([a({
139
+ })], l.prototype, "inputMode", void 0), t([s({
130
140
  type: String,
131
141
  attribute: "enterkeyhint"
132
- })], s.prototype, "enterKeyHint", void 0), t([a({ type: String })], s.prototype, "autocapitalize", void 0), t([a({
142
+ })], l.prototype, "enterKeyHint", void 0), t([s({ type: String })], l.prototype, "autocapitalize", void 0), t([s({
133
143
  type: String,
134
144
  attribute: "spellcheck"
135
- })], s.prototype, "spellcheckAttr", void 0), t([a({
145
+ })], l.prototype, "spellcheckAttr", void 0), t([s({
136
146
  type: String,
137
147
  reflect: !0
138
- })], s.prototype, "size", void 0), t([a({
148
+ })], l.prototype, "size", void 0), t([s({
139
149
  type: String,
140
150
  reflect: !0
141
- })], s.prototype, "color", void 0), t([a({
151
+ })], l.prototype, "color", void 0), t([s({
142
152
  type: String,
143
153
  reflect: !0
144
- })], s.prototype, "type", void 0), t([a({
154
+ })], l.prototype, "type", void 0), t([s({
145
155
  type: String,
146
156
  reflect: !0
147
- })], s.prototype, "icon", void 0), t([a({
157
+ })], l.prototype, "icon", void 0), t([s({
148
158
  type: String,
149
159
  attribute: "action-label"
150
- })], s.prototype, "actionLabel", void 0), t([a({
160
+ })], l.prototype, "actionLabel", void 0), t([s({
151
161
  type: String,
152
162
  reflect: !0,
153
163
  attribute: "icon-side"
154
- })], s.prototype, "iconSide", void 0), t([a({
164
+ })], l.prototype, "iconSide", void 0), t([s({
155
165
  type: String,
156
166
  reflect: !0,
157
167
  attribute: "tooltip-side"
158
- })], s.prototype, "tooltipSide", void 0), customElements.get("void-action-input") || customElements.define("void-action-input", s);
168
+ })], l.prototype, "tooltipSide", void 0), customElements.get("void-action-input") || customElements.define("void-action-input", l);
159
169
  //#endregion
160
- export { s as VoidActionInput };
170
+ export { l as VoidActionInput };
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { n as r, t as i } from "../chunks/dismiss-Drsy_dE5.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/alert.ts
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { n as r, t as i } from "../chunks/dismiss-Drsy_dE5.js";
5
5
  import { property as a } from "lit/decorators.js";
6
6
  //#region src/components/banner.ts
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { property as r } from "lit/decorators.js";
5
5
  //#region src/components/breadcrumbs.ts
6
6
  var i = "void-breadcrumbs-list", a = "void-breadcrumbs-item", o = class extends e {
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
4
- import { n as r } from "../chunks/parts-D30c8OoG.js";
4
+ import { n as r } from "../chunks/parts-CMQQop0D.js";
5
5
  import { property as i } from "lit/decorators.js";
6
6
  //#region src/components/carousel.ts
7
7
  var a = class extends e {
@@ -25,9 +25,19 @@ export declare class VoidCheckboxGroup extends VoidCheckboxGroup_base {
25
25
  /** Disables every checkbox in the group (like a fieldset). */
26
26
  disabled: boolean;
27
27
  protected readonly _projection: ProjectionController;
28
+ /** Values asked for while no checkbox exists yet (an attribute parsed ahead of its children), applied when they arrive. */
29
+ private _wanted;
30
+ /** The serialised value last handed to Lit, to notice a choice made on the checkboxes (the user, a morph). */
31
+ private _reflected;
32
+ /**
33
+ * The values of the checked checkboxes, as a list. The `value` attribute is the same list as a JSON array
34
+ * (`value='["a","b"]'`), kept in step as the boxes change; setting it checks those boxes.
35
+ * @default []
36
+ */
28
37
  get value(): string[];
29
38
  /** Check exactly the child checkboxes whose value is listed. Does not fire void-change. */
30
39
  set value(values: string[]);
40
+ protected willUpdate(changed: Map<string, unknown>): void;
31
41
  /** The checkboxes reset themselves; the group has no state of its own. */
32
42
  protected formSnapshot(): unknown;
33
43
  /** "At least one" validity, carried by the first enabled native checkbox. */
@@ -1,10 +1,11 @@
1
1
  import { n as e, t } from "../chunks/base-CMruMbxC.js";
2
2
  import { t as n } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { n as r } from "../chunks/form-control-C0vH6gii.js";
4
- import { html as i, nothing as a } from "lit";
5
- import { property as o } from "lit/decorators.js";
4
+ import { n as i } from "../chunks/value-list-CH6GjYXM.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/checkbox-group.ts
7
- var s = class extends r(t) {
8
+ var c = (e) => e.value ?? e.getAttribute("value") ?? "on", l = class extends r(t) {
8
9
  constructor(...t) {
9
10
  super(...t), this.label = "", this.orientation = "vertical", this.name = "", this.required = !1, this.disabled = !1, this._projection = new e(this, {
10
11
  regions: [{
@@ -12,9 +13,9 @@ var s = class extends r(t) {
12
13
  target: () => this.querySelector(":scope > .void-checkbox-group-items")
13
14
  }],
14
15
  onChange: () => {
15
- this._syncNames(), this._syncFormAttr(), this._syncRequiredValidity();
16
+ this._wanted && this._boxes().length > 0 && (this.value = this._wanted), this._syncNames(), this._syncFormAttr(), this._syncRequiredValidity();
16
17
  }
17
- }), this._handleChildChange = (e) => {
18
+ }), this._wanted = null, this._reflected = null, this._handleChildChange = (e) => {
18
19
  let t = e.target;
19
20
  !t.closest("void-checkbox") || t.closest("void-checkbox")?.closest("void-checkbox-group") !== this || (e.stopImmediatePropagation(), this.dispatchEvent(new CustomEvent("void-change", {
20
21
  bubbles: !0,
@@ -24,12 +25,20 @@ var s = class extends r(t) {
24
25
  };
25
26
  }
26
27
  get value() {
27
- return Array.from(this.querySelectorAll("void-checkbox")).filter((e) => e.checked).map((e) => e.value);
28
+ let e = this._boxes();
29
+ return this._wanted && e.length === 0 ? [...this._wanted] : e.filter((e) => e.checked).map(c);
28
30
  }
29
31
  set value(e) {
30
- let t = new Set(e ?? []);
31
- for (let e of Array.from(this.querySelectorAll("void-checkbox"))) e.checked = t.has(e.value);
32
- this.formSync();
32
+ let t = this._boxes(), n = Array.isArray(e) ? e : [];
33
+ this._wanted = t.length === 0 ? [...n] : null;
34
+ let r = new Set(n);
35
+ for (let e of t) e.checked = r.has(c(e));
36
+ this.requestUpdate("value", void 0), this.formSync();
37
+ }
38
+ willUpdate(e) {
39
+ super.willUpdate(e);
40
+ let t = JSON.stringify(this.value);
41
+ t !== this._reflected && (this._reflected = t, e.has("value") || this.requestUpdate("value", void 0));
33
42
  }
34
43
  formSnapshot() {
35
44
  return null;
@@ -63,27 +72,30 @@ var s = class extends r(t) {
63
72
  if (this.name) for (let e of this._boxes()) e.name = this.name;
64
73
  }
65
74
  render() {
66
- return i`
67
- ${this.label ? i`<span class="void-checkbox-group-label">${this.label}</span>` : a}
75
+ return a`
76
+ ${this.label ? a`<span class="void-checkbox-group-label">${this.label}</span>` : o}
68
77
  <div class="void-checkbox-group-items"></div>
69
78
  `;
70
79
  }
71
80
  };
72
- n([o({
81
+ n([s({
73
82
  type: String,
74
83
  reflect: !0
75
- })], s.prototype, "label", void 0), n([o({
84
+ })], l.prototype, "label", void 0), n([s({
76
85
  type: String,
77
86
  reflect: !0
78
- })], s.prototype, "orientation", void 0), n([o({
87
+ })], l.prototype, "orientation", void 0), n([s({
79
88
  type: String,
80
89
  reflect: !0
81
- })], s.prototype, "name", void 0), n([o({
90
+ })], l.prototype, "name", void 0), n([s({
82
91
  type: Boolean,
83
92
  reflect: !0
84
- })], s.prototype, "required", void 0), n([o({
93
+ })], l.prototype, "required", void 0), n([s({
85
94
  type: Boolean,
86
95
  reflect: !0
87
- })], s.prototype, "disabled", void 0), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", s);
96
+ })], l.prototype, "disabled", void 0), n([s({
97
+ converter: i,
98
+ reflect: !0
99
+ })], l.prototype, "value", null), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", l);
88
100
  //#endregion
89
- export { s as VoidCheckboxGroup };
101
+ export { l as VoidCheckboxGroup };
@@ -7,8 +7,8 @@ export declare class VoidCheckbox extends VoidCheckbox_base {
7
7
  /** Enter and Space fire a real `click`, as on a native button. */
8
8
  protected readonly _activation: KeyboardActivation;
9
9
  /**
10
- * Whether the box is checked. Updated when the user toggles it; the attribute is the initial state and
11
- * the form's reset target.
10
+ * Whether the box is checked. Reflected to the attribute as the user toggles it or a script sets it;
11
+ * the form's reset target stays the state it started with.
12
12
  */
13
13
  checked: boolean;
14
14
  /**
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
- import { n } from "../chunks/parts-D30c8OoG.js";
3
+ import { n } from "../chunks/parts-CMQQop0D.js";
4
4
  import { t as r } from "../chunks/disclosure-Bj_49GcC.js";
5
5
  import { property as i } from "lit/decorators.js";
6
6
  //#region src/components/collapsible.ts
@@ -5,8 +5,8 @@ export declare class VoidColorPicker extends VoidColorPicker_base {
5
5
  /** The host's `aria-label` / `aria-labelledby` name the inner control. */
6
6
  static labelTarget: string;
7
7
  /**
8
- * Selected colour as a hex string (six digits after the hash). Defaults to black. As an attribute it is the
9
- * initial value and the form's reset target.
8
+ * Selected colour as a hex string (six digits after the hash). Defaults to black. Reflected to the attribute as it
9
+ * changes; the form's reset target stays the value it started with.
10
10
  */
11
11
  value: string;
12
12
  /** Stop the picker reacting and exclude the value from the form submission. */
@@ -33,8 +33,8 @@ export declare class VoidCombobox extends VoidCombobox_base {
33
33
  /** The host's `aria-label` / `aria-labelledby` name the inner control. */
34
34
  static labelTarget: string;
35
35
  /**
36
- * `value` of the chosen `void-option`. As an attribute it is the initial choice (without it, an option marked
37
- * `selected` is); read the `value` property for the current one.
36
+ * `value` of the chosen `void-option`. Reflected to the attribute as the choice changes. Written in markup
37
+ * it is the initial choice (without it, an option marked `selected` is), which a form reset restores.
38
38
  */
39
39
  value: string;
40
40
  /**
@@ -69,6 +69,8 @@ export declare class VoidCombobox extends VoidCombobox_base {
69
69
  private get _options();
70
70
  /** Options the current query leaves in the list, in document order. */
71
71
  private get _visible();
72
+ /** The markup wrote a `value` attribute (read before the reflected default can add one). */
73
+ private _authoredValue;
72
74
  connectedCallback(): void;
73
75
  /** Whether the initial choice has been settled (a value, or an option marked `selected`). */
74
76
  private _initial;
@@ -1,7 +1,7 @@
1
1
  import { n as e, r as t, t as n } from "../chunks/base-CMruMbxC.js";
2
2
  import { t as r } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { t as i } from "../chunks/form-control-C0vH6gii.js";
4
- import { n as a } from "../chunks/parts-D30c8OoG.js";
4
+ import { n as a } from "../chunks/parts-CMQQop0D.js";
5
5
  import { i as o, n as s } from "../chunks/keyboard-MQpfTX5I.js";
6
6
  import { t as c } from "../chunks/overlay-BywGMcDW.js";
7
7
  import { optionLabel as l } from "./multiselect.js";
@@ -27,7 +27,7 @@ var m = class extends i(n) {
27
27
  attr: (e, t, n) => this._parts.set(e, t, n),
28
28
  style: (e, t, n) => this._parts.style(e, t, n),
29
29
  initialFocus: () => !1
30
- }), this._initial = !1, this._onPointerDown = (e) => {
30
+ }), this._authoredValue = null, this._initial = !1, this._onPointerDown = (e) => {
31
31
  let t = this._content();
32
32
  if (!t || !t.contains(e.target)) return;
33
33
  e.preventDefault();
@@ -73,11 +73,11 @@ var m = class extends i(n) {
73
73
  return this._options.filter((t) => l(t).toLowerCase().includes(e));
74
74
  }
75
75
  connectedCallback() {
76
- super.connectedCallback(), this.addEventListener("mousedown", this._onPointerDown);
76
+ this._authoredValue ??= this.hasAttribute("value"), super.connectedCallback(), this.addEventListener("mousedown", this._onPointerDown);
77
77
  }
78
78
  _adoptSelected(e) {
79
79
  if (this._initial) return;
80
- if (this.value || this.hasAttribute("value")) {
80
+ if (this.value || this._authoredValue) {
81
81
  this._initial = !0;
82
82
  return;
83
83
  }
@@ -166,7 +166,10 @@ var m = class extends i(n) {
166
166
  }));
167
167
  }
168
168
  };
169
- r([f({ type: String })], m.prototype, "value", void 0), r([f({ type: String })], m.prototype, "placeholder", void 0), r([f({
169
+ r([f({
170
+ type: String,
171
+ reflect: !0
172
+ })], m.prototype, "value", void 0), r([f({ type: String })], m.prototype, "placeholder", void 0), r([f({
170
173
  type: Boolean,
171
174
  reflect: !0
172
175
  })], m.prototype, "disabled", void 0), r([f({
@@ -5,7 +5,7 @@ export declare class VoidComposeInput extends VoidElement {
5
5
  static labelTarget: string;
6
6
  /** While focus is inside, a morph does not apply the server's value over what the user is typing. */
7
7
  static editState: string[];
8
- /** The draft text. It is cleared after each send. */
8
+ /** The draft text, reflected to the `value` attribute as it changes. It is cleared after each send. */
9
9
  value: string;
10
10
  /** Hint shown while the box is empty. Defaults to `Type a message...`. */
11
11
  placeholder: string;
@@ -63,7 +63,10 @@ var a = class extends e {
63
63
  }));
64
64
  }
65
65
  };
66
- t([r({ type: String })], a.prototype, "value", void 0), t([r({
66
+ t([r({
67
+ type: String,
68
+ reflect: !0
69
+ })], a.prototype, "value", void 0), t([r({
67
70
  type: String,
68
71
  reflect: !0
69
72
  })], a.prototype, "placeholder", void 0), t([r({
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../chunks/decorate-CaYbmmmm.js";
2
- import { t } from "../chunks/modal-D_YVy2vg.js";
2
+ import { t } from "../chunks/modal-hivQ4YoU.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 {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../chunks/decorate-CaYbmmmm.js";
2
- import { t } from "../chunks/modal-D_YVy2vg.js";
2
+ import { t } from "../chunks/modal-hivQ4YoU.js";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  //#region src/components/drawer.ts
5
5
  var r = class extends t {
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "../chunks/base-CMruMbxC.js";
2
2
  import { t } from "../chunks/decorate-CaYbmmmm.js";
3
3
  import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
4
- import { i as r, n as i } from "../chunks/parts-D30c8OoG.js";
4
+ import { i as r, n as i } from "../chunks/parts-CMQQop0D.js";
5
5
  import { i as a, r as o, t as s } from "../chunks/keyboard-MQpfTX5I.js";
6
6
  import { t as c } from "../chunks/overlay-BywGMcDW.js";
7
7
  import { property as l } from "lit/decorators.js";
@@ -14,7 +14,7 @@ export declare class VoidEditable extends VoidEditable_base {
14
14
  /** While focus is inside, a morph does not apply the server's value over what the user is typing. */
15
15
  static editState: string[];
16
16
  /**
17
- * The committed text. As an attribute it is the initial value and the form's reset target. Text still
17
+ * The committed text. Reflected to the attribute as it changes; the form's reset target stays the value it started with. Text still
18
18
  * being edited is not part of it until committed.
19
19
  */
20
20
  value: string;