@voidable/ui 0.12.2 → 0.12.3

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.
@@ -83,6 +83,13 @@ export declare class VoidMultiselect extends VoidMultiselect_base {
83
83
  */
84
84
  placeholder: string;
85
85
  private get _hint();
86
+ /**
87
+ * What the trigger is described by once options are chosen. The chips are drawn, not read (they are
88
+ * `aria-hidden`, so a reader's cursor never rests on one), so the names of the chosen options are in the
89
+ * description: all of them up to three ("CSS and JavaScript"), else the first three and how many in all
90
+ * ("CSS, JavaScript, HTML, 5 selected").
91
+ */
92
+ private _chosenText;
86
93
  /** Stop the trigger opening and exclude the values from the form submission. */
87
94
  disabled: boolean;
88
95
  /** Size step: `sm`, `md` (default) or `lg`. */
@@ -136,6 +136,19 @@ var x = class extends a(e) {
136
136
  get _hint() {
137
137
  return this.placeholder || i(this, "multiselect.placeholder");
138
138
  }
139
+ _chosenText(e) {
140
+ let t = this.closest("[lang]")?.getAttribute("lang") || void 0, n = e.slice(0, 3).map(b);
141
+ return e.length <= 3 ? (() => {
142
+ try {
143
+ return new Intl.ListFormat(t, {
144
+ type: "conjunction",
145
+ style: "long"
146
+ }).format(n);
147
+ } catch {
148
+ return n.join(", ");
149
+ }
150
+ })() : `${n.join(", ")}, ${i(this, "multiselect.selected", { count: e.length })}`;
151
+ }
139
152
  _content() {
140
153
  return this._parts.one("void-multiselect-content");
141
154
  }
@@ -207,14 +220,14 @@ var x = class extends a(e) {
207
220
  aria-haspopup="listbox"
208
221
  aria-expanded=${String(t)}
209
222
  aria-controls=${this._controls(t)}
210
- aria-description=${n ? i(this, "multiselect.selected", { count: n }) : h}
223
+ aria-description=${n ? this._chosenText(e) : h}
211
224
  aria-disabled=${this.formDisabled ? "true" : h}
212
225
  aria-required=${this.required ? "true" : h}
213
226
  aria-invalid=${this.error ? "true" : h}
214
227
  @keydown=${this._onTriggerKeydown}
215
228
  >
216
229
  ${n > 0 ? e.map((e) => m`
217
- <span class="void-multiselect-pill">
230
+ <span class="void-multiselect-pill" aria-hidden="true">
218
231
  <span class="void-multiselect-pill-label">${b(e)}</span>
219
232
  <button
220
233
  type="button"
@@ -224,7 +237,7 @@ var x = class extends a(e) {
224
237
  data-value=${e.value}
225
238
  >×</button>
226
239
  </span>
227
- `) : m`<span class="void-multiselect-placeholder">${this._hint}</span>`}
240
+ `) : m`<span class="void-multiselect-placeholder" aria-hidden="true">${this._hint}</span>`}
228
241
  </div>
229
242
  ${this.error ? m`<span class="void-multiselect-error">${this.error}</span>` : h}
230
243
  `;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated from custom-elements.json by packages/ui/cem/generate.js. Do not edit.",
3
3
  "package": "@voidable/ui",
4
- "version": "0.12.2",
4
+ "version": "0.12.3",
5
5
  "componentCount": 66,
6
6
  "tagCount": 78,
7
7
  "eventNames": [
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # Voidable UI (@voidable/ui 0.12.2)
1
+ # Voidable UI (@voidable/ui 0.12.3)
2
2
 
3
3
  > Lit 3 web components in the light DOM, `<void-*>` tags with no visual CSS of their own: `@voidable/theme` supplies every look through `--void-*` custom properties. They work in plain HTML, React, Vue, Svelte, Solid, Angular, Rails/Hotwire, Phoenix LiveView and Laravel/Livewire.
4
4
 
package/dist/reference.md CHANGED
@@ -1,4 +1,4 @@
1
- # @voidable/ui 0.12.2: element reference
1
+ # @voidable/ui 0.12.3: element reference
2
2
 
3
3
  Generated from the package's Custom Elements Manifest. 168 elements (78 registered by JavaScript, 90 CSS-only parts and patterns). Each section gives the parts, attributes with their allowed values, events with their `detail`, where the element may sit and a correct example. Start at `llms.txt` for the rules that apply to all of them.
4
4
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@voidable/ui",
4
- "version": "0.12.2",
4
+ "version": "0.12.3",
5
5
  "js-types-syntax": "typescript",
6
6
  "description-markup": "markdown",
7
7
  "contributions": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidable/ui",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Lit 3 web components for Voidable UI: light DOM, no visual CSS until a theme is loaded",
5
5
  "keywords": [
6
6
  "web-components",