@voidable/ui 0.9.0 → 0.10.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.
- package/dist/base-entry.d.ts +1 -0
- package/dist/base.d.ts +2 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BxmMM3B7.js +298 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-hivQ4YoU.js → modal-CgGp_fCs.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-hLJ7IQHx.js} +2 -2
- package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
- package/dist/chunks/{base-CMruMbxC.js → projection-SnR79EHI.js} +105 -389
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +2 -2
- package/dist/components/action-input.js +56 -54
- package/dist/components/alert.js +2 -2
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +2 -2
- package/dist/components/bar-chart.js +31 -29
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +78 -76
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +18 -17
- package/dist/components/checkbox-group.js +13 -12
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.js +17 -16
- package/dist/components/compose-input.js +13 -11
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +11 -9
- package/dist/components/donut-chart.js +51 -49
- package/dist/components/drawer.d.ts +2 -2
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +4 -4
- package/dist/components/editable.js +13 -12
- package/dist/components/error-fallback.js +2 -2
- package/dist/components/field.js +10 -9
- package/dist/components/file-upload.js +19 -17
- package/dist/components/gauge.js +88 -86
- package/dist/components/hamburger.js +11 -9
- package/dist/components/hover-card.js +3 -3
- package/dist/components/indicator.js +14 -12
- package/dist/components/input.js +41 -39
- package/dist/components/line-chart.js +41 -39
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +3 -3
- package/dist/components/multiselect.js +30 -29
- package/dist/components/nav-bar.js +1 -1
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.js +17 -15
- package/dist/components/pagination.js +22 -20
- package/dist/components/panel.js +2 -2
- package/dist/components/pin-input.js +32 -30
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.js +13 -11
- package/dist/components/radio.d.ts +25 -0
- package/dist/components/radio.js +78 -29
- package/dist/components/scroll-area.js +8 -7
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.js +49 -47
- package/dist/components/sidebar.d.ts +2 -2
- package/dist/components/sidebar.js +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +16 -14
- package/dist/components/spinner.js +11 -9
- package/dist/components/stat.js +19 -17
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +15 -13
- package/dist/components/switch.js +14 -12
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +29 -29
- package/dist/components/tag.js +9 -8
- package/dist/components/tags-input.js +24 -22
- package/dist/components/textarea.js +34 -32
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +1 -1
- package/dist/custom-elements.json +48 -18
- package/dist/dev.js +31 -7
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +1 -1
- package/dist/parts.d.ts +5 -0
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +4 -4
- package/dist/vscode.html-custom-data.json +13 -7
- package/dist/web-types.json +17 -17
- package/package.json +1 -1
package/dist/components/tabs.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/parts-
|
|
4
|
-
import {
|
|
5
|
-
import { property as
|
|
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";
|
|
6
6
|
//#region src/components/tabs.ts
|
|
7
|
-
var
|
|
7
|
+
var s = "void-tabs-list", c = "void-tabs-trigger", l = "void-tabs-content", u = class extends e {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e), this.value = "", this.size = "md", this.activation = "manual", this._parts = new n(this, {
|
|
10
10
|
tags: [
|
|
11
|
-
o,
|
|
12
11
|
s,
|
|
13
|
-
c
|
|
12
|
+
c,
|
|
13
|
+
l
|
|
14
14
|
],
|
|
15
15
|
onChange: () => this._wire()
|
|
16
16
|
}), this._matchedValue = null, this._onClick = (e) => {
|
|
@@ -24,13 +24,13 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
24
24
|
e.preventDefault(), this._select(t);
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
let n = this._triggers(),
|
|
28
|
-
if (e.key ===
|
|
29
|
-
else if (e.key ===
|
|
30
|
-
else if (e.key === "Home")
|
|
31
|
-
else if (e.key === "End")
|
|
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);
|
|
32
32
|
else return;
|
|
33
|
-
e.preventDefault(), !(
|
|
33
|
+
e.preventDefault(), !(c < 0) && (n[c].focus(), this.activation === "auto" && this._select(n[c]));
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
connectedCallback() {
|
|
@@ -43,7 +43,7 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
43
43
|
super.updated(e), e.has("value") && this._wire();
|
|
44
44
|
}
|
|
45
45
|
_triggers() {
|
|
46
|
-
return this._parts.within(this._parts.one(
|
|
46
|
+
return this._parts.within(this._parts.one(s), c);
|
|
47
47
|
}
|
|
48
48
|
_disabled(e) {
|
|
49
49
|
return e.hasAttribute("disabled");
|
|
@@ -61,22 +61,22 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
61
61
|
this._matchedValue = null, t && (this.value = this._valueOf(t), this._matchedValue = this.value);
|
|
62
62
|
}
|
|
63
63
|
_wire() {
|
|
64
|
-
let e = this._parts.one(
|
|
64
|
+
let e = this._parts.one(s), t = this._triggers(), n = this._parts.all(l);
|
|
65
65
|
this._reconcileRemovedSelection(t), e && this._parts.set(e, "role", "tablist");
|
|
66
66
|
let r = t.map((e) => this._disabled(e)), a = t.findIndex((e, t) => this._valueOf(e) === this.value && !r[t]);
|
|
67
67
|
a < 0 && (a = i(r, 1));
|
|
68
|
-
let
|
|
69
|
-
for (let e of n)
|
|
70
|
-
let
|
|
68
|
+
let o = /* @__PURE__ */ new Map();
|
|
69
|
+
for (let e of n) o.has(this._valueOf(e)) || o.set(this._valueOf(e), e);
|
|
70
|
+
let c = /* @__PURE__ */ new Map();
|
|
71
71
|
t.forEach((e, t) => {
|
|
72
|
-
let n = this._valueOf(e), i = n === this.value,
|
|
73
|
-
|
|
74
|
-
let
|
|
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",
|
|
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);
|
|
74
|
+
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);
|
|
76
76
|
});
|
|
77
77
|
for (let e of n) {
|
|
78
78
|
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",
|
|
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);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
_select(e) {
|
|
@@ -89,19 +89,19 @@ var o = "void-tabs-list", s = "void-tabs-trigger", c = "void-tabs-content", l =
|
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
91
91
|
_triggerOf(e) {
|
|
92
|
-
let t = e instanceof Element ? e.closest(
|
|
92
|
+
let t = e instanceof Element ? e.closest(c) : null;
|
|
93
93
|
return t && this._parts.owns(t) ? t : null;
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
t([
|
|
96
|
+
t([o({
|
|
97
97
|
type: String,
|
|
98
98
|
reflect: !0
|
|
99
|
-
})],
|
|
99
|
+
})], u.prototype, "value", void 0), t([o({
|
|
100
100
|
type: String,
|
|
101
101
|
reflect: !0
|
|
102
|
-
})],
|
|
102
|
+
})], u.prototype, "size", void 0), t([o({
|
|
103
103
|
type: String,
|
|
104
104
|
reflect: !0
|
|
105
|
-
})],
|
|
105
|
+
})], u.prototype, "activation", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", u);
|
|
106
106
|
//#endregion
|
|
107
|
-
export {
|
|
107
|
+
export { u as VoidTabs };
|
package/dist/components/tag.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
+
import { t as n } from "../chunks/projection-SnR79EHI.js";
|
|
3
4
|
import { html as r, nothing as i } from "lit";
|
|
4
5
|
import { property as a } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/tag.ts
|
|
6
|
-
var o = class extends
|
|
7
|
-
constructor(...
|
|
8
|
-
super(...
|
|
7
|
+
var o = class extends e {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.color = "default", this.removable = !1, this.size = "md", this._projection = new n(this, { regions: [{
|
|
9
10
|
name: "label",
|
|
10
11
|
target: "before"
|
|
11
12
|
}] });
|
|
@@ -25,13 +26,13 @@ var o = class extends t {
|
|
|
25
26
|
})), this.remove();
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
|
-
|
|
29
|
+
t([a({
|
|
29
30
|
type: String,
|
|
30
31
|
reflect: !0
|
|
31
|
-
})], o.prototype, "color", void 0),
|
|
32
|
+
})], o.prototype, "color", void 0), t([a({
|
|
32
33
|
type: Boolean,
|
|
33
34
|
reflect: !0
|
|
34
|
-
})], o.prototype, "removable", void 0),
|
|
35
|
+
})], o.prototype, "removable", void 0), t([a({
|
|
35
36
|
type: String,
|
|
36
37
|
reflect: !0
|
|
37
38
|
})], o.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", o);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-SnR79EHI.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";
|
|
7
8
|
//#region src/components/tags-input.ts
|
|
8
|
-
|
|
9
|
+
r();
|
|
10
|
+
var c = class extends n(e) {
|
|
9
11
|
constructor(...e) {
|
|
10
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;
|
|
11
13
|
}
|
|
@@ -27,25 +29,25 @@ var s = class extends n(e) {
|
|
|
27
29
|
}
|
|
28
30
|
render() {
|
|
29
31
|
let e = this.value.length >= this.max;
|
|
30
|
-
return
|
|
32
|
+
return a`
|
|
31
33
|
<div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
|
|
32
34
|
${this.value.map((e, t) => {
|
|
33
35
|
let n = this._tagText(e);
|
|
34
|
-
return
|
|
35
|
-
<span class="void-tags-input-tag" data-color=${this._tagColor(e) ||
|
|
36
|
+
return a`
|
|
37
|
+
<span class="void-tags-input-tag" data-color=${this._tagColor(e) || o}>
|
|
36
38
|
<span class="void-tags-input-tag-text">${n}</span>
|
|
37
|
-
${!this.disabled && !this.readonly ?
|
|
39
|
+
${!this.disabled && !this.readonly ? a`<button
|
|
38
40
|
type="button"
|
|
39
41
|
class="void-tags-input-tag-remove"
|
|
40
42
|
aria-label="Remove ${n}"
|
|
41
43
|
@click=${(e) => {
|
|
42
44
|
e.stopPropagation(), this._removeTag(t);
|
|
43
45
|
}}
|
|
44
|
-
>×</button>` :
|
|
46
|
+
>×</button>` : o}
|
|
45
47
|
</span>
|
|
46
48
|
`;
|
|
47
49
|
})}
|
|
48
|
-
${!e && !this.readonly ?
|
|
50
|
+
${!e && !this.readonly ? a`<input
|
|
49
51
|
class="void-tags-input-field"
|
|
50
52
|
type="text"
|
|
51
53
|
placeholder=${this.value.length === 0 ? this.placeholder : ""}
|
|
@@ -53,7 +55,7 @@ var s = class extends n(e) {
|
|
|
53
55
|
@keydown=${this._onKeydown}
|
|
54
56
|
@input=${this._onFieldInput}
|
|
55
57
|
@paste=${this._onPaste}
|
|
56
|
-
/>` :
|
|
58
|
+
/>` : o}
|
|
57
59
|
</div>
|
|
58
60
|
`;
|
|
59
61
|
}
|
|
@@ -97,27 +99,27 @@ var s = class extends n(e) {
|
|
|
97
99
|
}));
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
|
-
t([
|
|
101
|
-
converter:
|
|
102
|
+
t([s({
|
|
103
|
+
converter: i,
|
|
102
104
|
reflect: !0
|
|
103
|
-
})],
|
|
105
|
+
})], c.prototype, "value", void 0), t([s({
|
|
104
106
|
type: Boolean,
|
|
105
107
|
reflect: !0
|
|
106
|
-
})],
|
|
108
|
+
})], c.prototype, "disabled", void 0), t([s({
|
|
107
109
|
type: Boolean,
|
|
108
110
|
reflect: !0
|
|
109
|
-
})],
|
|
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({
|
|
110
112
|
type: String,
|
|
111
113
|
reflect: !0
|
|
112
|
-
})],
|
|
114
|
+
})], c.prototype, "size", void 0), t([s({
|
|
113
115
|
type: String,
|
|
114
116
|
reflect: !0
|
|
115
|
-
})],
|
|
117
|
+
})], c.prototype, "color", void 0), t([s({
|
|
116
118
|
type: String,
|
|
117
119
|
reflect: !0
|
|
118
|
-
})],
|
|
120
|
+
})], c.prototype, "variant", void 0), t([s({
|
|
119
121
|
type: Boolean,
|
|
120
122
|
attribute: "allow-duplicates"
|
|
121
|
-
})],
|
|
123
|
+
})], c.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", c);
|
|
122
124
|
//#endregion
|
|
123
|
-
export {
|
|
125
|
+
export { c as VoidTagsInput };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-SnR79EHI.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";
|
|
7
8
|
//#region src/components/textarea.ts
|
|
8
|
-
|
|
9
|
+
r();
|
|
10
|
+
var c = class extends n(e) {
|
|
9
11
|
constructor(...e) {
|
|
10
12
|
super(...e), this.value = "", this.placeholder = "", this.disabled = !1, this.readonly = !1, this.required = !1, this.name = "", this.rows = 3, this.resize = "vertical", this.size = "md", this.error = "", this.autocomplete = "", this.minlength = void 0, this.maxlength = void 0, this.inputMode = "", this.enterKeyHint = "", this.autocapitalize = "", this.spellcheckAttr = null;
|
|
11
13
|
}
|
|
@@ -16,29 +18,29 @@ var s = class extends n(e) {
|
|
|
16
18
|
this.editState = ["value"];
|
|
17
19
|
}
|
|
18
20
|
render() {
|
|
19
|
-
return
|
|
21
|
+
return i`
|
|
20
22
|
<textarea
|
|
21
|
-
.value=${
|
|
23
|
+
.value=${s(this.value)}
|
|
22
24
|
placeholder=${this.placeholder}
|
|
23
25
|
?disabled=${this.disabled}
|
|
24
26
|
?readonly=${this.readonly}
|
|
25
27
|
?required=${this.required}
|
|
26
28
|
name=${this.name}
|
|
27
|
-
autocomplete=${this.autocomplete ||
|
|
28
|
-
minlength=${this.minlength ??
|
|
29
|
-
maxlength=${this.maxlength ??
|
|
30
|
-
inputmode=${this.inputMode ||
|
|
31
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
32
|
-
autocapitalize=${this.autocapitalize ||
|
|
33
|
-
spellcheck=${this.spellcheckAttr ??
|
|
34
|
-
form=${this.formAttr ??
|
|
29
|
+
autocomplete=${this.autocomplete || a}
|
|
30
|
+
minlength=${this.minlength ?? a}
|
|
31
|
+
maxlength=${this.maxlength ?? a}
|
|
32
|
+
inputmode=${this.inputMode || a}
|
|
33
|
+
enterkeyhint=${this.enterKeyHint || a}
|
|
34
|
+
autocapitalize=${this.autocapitalize || a}
|
|
35
|
+
spellcheck=${this.spellcheckAttr ?? a}
|
|
36
|
+
form=${this.formAttr ?? a}
|
|
35
37
|
rows=${this.rows}
|
|
36
38
|
style="--void-textarea-resize: ${this.resize}"
|
|
37
39
|
aria-invalid=${this.error ? "true" : "false"}
|
|
38
40
|
@input=${this._onInput}
|
|
39
41
|
@change=${this._onChange}
|
|
40
42
|
></textarea>
|
|
41
|
-
${this.error ?
|
|
43
|
+
${this.error ? i`<span class="void-textarea-error">${this.error}</span>` : ""}
|
|
42
44
|
`;
|
|
43
45
|
}
|
|
44
46
|
formWriteNativeDefault(e) {
|
|
@@ -70,48 +72,48 @@ var s = class extends n(e) {
|
|
|
70
72
|
}));
|
|
71
73
|
}
|
|
72
74
|
};
|
|
73
|
-
t([
|
|
75
|
+
t([o({
|
|
74
76
|
type: String,
|
|
75
77
|
reflect: !0
|
|
76
|
-
})],
|
|
78
|
+
})], c.prototype, "value", void 0), t([o({
|
|
77
79
|
type: String,
|
|
78
80
|
reflect: !0
|
|
79
|
-
})],
|
|
81
|
+
})], c.prototype, "placeholder", void 0), t([o({
|
|
80
82
|
type: Boolean,
|
|
81
83
|
reflect: !0
|
|
82
|
-
})],
|
|
84
|
+
})], c.prototype, "disabled", void 0), t([o({
|
|
83
85
|
type: Boolean,
|
|
84
86
|
reflect: !0
|
|
85
|
-
})],
|
|
87
|
+
})], c.prototype, "readonly", void 0), t([o({
|
|
86
88
|
type: Boolean,
|
|
87
89
|
reflect: !0
|
|
88
|
-
})],
|
|
90
|
+
})], c.prototype, "required", void 0), t([o({
|
|
89
91
|
type: String,
|
|
90
92
|
reflect: !0
|
|
91
|
-
})],
|
|
93
|
+
})], c.prototype, "name", void 0), t([o({
|
|
92
94
|
type: Number,
|
|
93
95
|
reflect: !0
|
|
94
|
-
})],
|
|
96
|
+
})], c.prototype, "rows", void 0), t([o({
|
|
95
97
|
type: String,
|
|
96
98
|
reflect: !0
|
|
97
|
-
})],
|
|
99
|
+
})], c.prototype, "resize", void 0), t([o({
|
|
98
100
|
type: String,
|
|
99
101
|
reflect: !0
|
|
100
|
-
})],
|
|
102
|
+
})], c.prototype, "size", void 0), t([o({
|
|
101
103
|
type: String,
|
|
102
104
|
reflect: !0
|
|
103
|
-
})],
|
|
105
|
+
})], c.prototype, "error", void 0), t([o({
|
|
104
106
|
type: String,
|
|
105
107
|
reflect: !0
|
|
106
|
-
})],
|
|
108
|
+
})], c.prototype, "autocomplete", void 0), t([o({ type: Number })], c.prototype, "minlength", void 0), t([o({ type: Number })], c.prototype, "maxlength", void 0), t([o({
|
|
107
109
|
type: String,
|
|
108
110
|
attribute: "inputmode"
|
|
109
|
-
})],
|
|
111
|
+
})], c.prototype, "inputMode", void 0), t([o({
|
|
110
112
|
type: String,
|
|
111
113
|
attribute: "enterkeyhint"
|
|
112
|
-
})],
|
|
114
|
+
})], c.prototype, "enterKeyHint", void 0), t([o({ type: String })], c.prototype, "autocapitalize", void 0), t([o({
|
|
113
115
|
type: String,
|
|
114
116
|
attribute: "spellcheck"
|
|
115
|
-
})],
|
|
117
|
+
})], c.prototype, "spellcheckAttr", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", c);
|
|
116
118
|
//#endregion
|
|
117
|
-
export {
|
|
119
|
+
export { c as VoidTextarea };
|
|
@@ -31,9 +31,16 @@ export declare class VoidToast extends VoidElement {
|
|
|
31
31
|
private _focused;
|
|
32
32
|
connectedCallback(): void;
|
|
33
33
|
disconnectedCallback(): void;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The toast is a plain group, reachable by a screen reader but not a live region itself: a live region inserted
|
|
36
|
+
* together with its text is commonly not announced. The container announces it instead, through its own
|
|
37
|
+
* announcer elements, which exist before any toast does.
|
|
38
|
+
*/
|
|
36
39
|
private _syncRole;
|
|
40
|
+
/** The `aria-labelledby` this toast wrote itself, so an author's own name is never replaced. */
|
|
41
|
+
private _labelledBy;
|
|
42
|
+
/** What a screen reader should say for this toast: its title, then its message (or, without parts, its text). */
|
|
43
|
+
announcement(): string;
|
|
37
44
|
private _startTimer;
|
|
38
45
|
private _pause;
|
|
39
46
|
private _resume;
|
|
@@ -63,8 +70,18 @@ export declare class VoidToastContainer extends VoidElement {
|
|
|
63
70
|
/** Where the container sits. The corner and centre values overlay the page at a fixed position; `inline` keeps the container in normal flow so toasts push content instead of covering it. */
|
|
64
71
|
placement: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center' | 'inline';
|
|
65
72
|
private _observer;
|
|
73
|
+
private _announceTimers;
|
|
66
74
|
connectedCallback(): void;
|
|
67
75
|
disconnectedCallback(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Two persistent, visually hidden live regions that exist from the container's connection: a polite one
|
|
78
|
+
* (`role="status"`) and an assertive one (`role="alert"`). A screen reader announces text that changes inside a
|
|
79
|
+
* region it already knows, so a toast's words are written here after the toast is in, never together with it.
|
|
80
|
+
*/
|
|
81
|
+
private _ensureAnnouncers;
|
|
82
|
+
private _region;
|
|
83
|
+
/** Writes a toast's text into the matching announcer on a later task, after clearing it so a repeat is spoken again. */
|
|
84
|
+
private _announce;
|
|
68
85
|
/** Shown while it holds a toast; raised to the top of the top layer when one is added. */
|
|
69
86
|
private _syncShown;
|
|
70
87
|
/**
|
package/dist/components/toast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { n } from "../chunks/parts-
|
|
3
|
+
import { n } from "../chunks/parts-DI_3VpSy.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/toast.ts
|
|
@@ -13,8 +13,8 @@ var o = class extends e {
|
|
|
13
13
|
"void-toast-actions",
|
|
14
14
|
"void-toast-close"
|
|
15
15
|
],
|
|
16
|
-
onChange: () =>
|
|
17
|
-
}), this._remaining = 0, this._timerStart = 0, this._hovered = !1, this._focused = !1, this._onEnter = () => {
|
|
16
|
+
onChange: () => this._syncRole()
|
|
17
|
+
}), this._remaining = 0, this._timerStart = 0, this._hovered = !1, this._focused = !1, this._labelledBy = null, this._onEnter = () => {
|
|
18
18
|
this._hovered = !0, this._pause();
|
|
19
19
|
}, this._onLeave = () => {
|
|
20
20
|
this._hovered = !1, this._resume();
|
|
@@ -32,11 +32,16 @@ var o = class extends e {
|
|
|
32
32
|
disconnectedCallback() {
|
|
33
33
|
super.disconnectedCallback(), clearTimeout(this._timer), this._timer = void 0, this.removeEventListener("mouseenter", this._onEnter), this.removeEventListener("mouseleave", this._onLeave), this.removeEventListener("focusin", this._onFocusIn), this.removeEventListener("focusout", this._onFocusOut), this.removeEventListener("click", this._onClick);
|
|
34
34
|
}
|
|
35
|
-
updated(e) {
|
|
36
|
-
super.updated(e), e.has("color") && this._syncRole();
|
|
37
|
-
}
|
|
38
35
|
_syncRole() {
|
|
39
|
-
this.setHostAttribute("role",
|
|
36
|
+
this.setHostAttribute("role", "group");
|
|
37
|
+
let e = this._parts.one("void-toast-title") ?? this._parts.one("void-toast-description"), t = this.getAttribute("aria-labelledby"), n = this._labelledBy !== null && t === this._labelledBy;
|
|
38
|
+
e && !this.hasAttribute("aria-label") && (t === null || n) ? (this._labelledBy = this._parts.id(e, e.localName), this.setHostAttribute("aria-labelledby", this._labelledBy)) : n && (this._labelledBy = null, this.setHostAttribute("aria-labelledby", null));
|
|
39
|
+
}
|
|
40
|
+
announcement() {
|
|
41
|
+
let e = (e) => e?.textContent?.replace(/\s+/g, " ").trim() ?? "", t = e(this._parts.one("void-toast-title")), n = e(this._parts.one("void-toast-description"));
|
|
42
|
+
if (t || n) return [t, n].filter(Boolean).join(". ");
|
|
43
|
+
let r = this.cloneNode(!0);
|
|
44
|
+
return r.querySelectorAll("void-toast-close, void-toast-actions").forEach((e) => e.remove()), e(r);
|
|
40
45
|
}
|
|
41
46
|
_startTimer() {
|
|
42
47
|
this._timerStart = Date.now(), this._timer = setTimeout(() => this._close("timeout"), this._remaining);
|
|
@@ -64,13 +69,41 @@ t([a({
|
|
|
64
69
|
})], o.prototype, "color", void 0), t([a({ type: Number })], o.prototype, "duration", void 0), customElements.get("void-toast") || customElements.define("void-toast", o);
|
|
65
70
|
var s = class extends e {
|
|
66
71
|
constructor(...e) {
|
|
67
|
-
super(...e), this.placement = "bottom-right", this._observer = null;
|
|
72
|
+
super(...e), this.placement = "bottom-right", this._observer = null, this._announceTimers = /* @__PURE__ */ new Map();
|
|
68
73
|
}
|
|
69
74
|
connectedCallback() {
|
|
70
|
-
super.connectedCallback(), this.setHostAttribute("role", "region"), this.setHostAttribute("aria-label", "Notifications"),
|
|
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
|
+
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
|
+
}), this._observer.observe(this, { childList: !0 }), this._syncShown(!0);
|
|
79
|
+
for (let e of this.querySelectorAll(":scope > void-toast")) this._announce(e);
|
|
71
80
|
}
|
|
72
81
|
disconnectedCallback() {
|
|
73
82
|
super.disconnectedCallback(), this._observer?.disconnect();
|
|
83
|
+
for (let e of this._announceTimers.values()) clearTimeout(e);
|
|
84
|
+
this._announceTimers.clear();
|
|
85
|
+
}
|
|
86
|
+
_ensureAnnouncers() {
|
|
87
|
+
let e = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
88
|
+
if (e.querySelector("slot")) return;
|
|
89
|
+
let t = this.ownerDocument, n = t.createElement("style");
|
|
90
|
+
n.textContent = "[data-void-announcer]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;pointer-events:none}", e.append(n);
|
|
91
|
+
for (let [n, r] of [["polite", "status"], ["assertive", "alert"]]) {
|
|
92
|
+
let i = t.createElement("div");
|
|
93
|
+
i.setAttribute("data-void-announcer", n), i.setAttribute("role", r), i.setAttribute("aria-live", n), i.setAttribute("aria-atomic", "true"), e.append(i);
|
|
94
|
+
}
|
|
95
|
+
e.append(t.createElement("slot"));
|
|
96
|
+
}
|
|
97
|
+
_region(e) {
|
|
98
|
+
return this.shadowRoot?.querySelector(`[data-void-announcer="${e}"]`) ?? null;
|
|
99
|
+
}
|
|
100
|
+
_announce(e) {
|
|
101
|
+
let t = e.color === "error" || e.color === "warning" ? "assertive" : "polite", n = this._region(t);
|
|
102
|
+
n && (clearTimeout(this._announceTimers.get(n)), n.textContent = "", this._announceTimers.set(n, setTimeout(() => {
|
|
103
|
+
this._announceTimers.delete(n), e.isConnected && (n.textContent = e.announcement(), this._announceTimers.set(n, setTimeout(() => {
|
|
104
|
+
this._announceTimers.delete(n), n.textContent = "";
|
|
105
|
+
}, 5e3)));
|
|
106
|
+
}, 150)));
|
|
74
107
|
}
|
|
75
108
|
_syncShown(e) {
|
|
76
109
|
if (typeof this.showPopover != "function" || !this.isConnected) return;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/form-control-C0vH6gii.js";
|
|
4
|
-
import {
|
|
4
|
+
import { r } from "../chunks/keyboard-CEhMSkws.js";
|
|
5
|
+
import { property as i } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/toggle-group.ts
|
|
6
|
-
var
|
|
7
|
+
var a = class extends n(e) {
|
|
7
8
|
constructor(...e) {
|
|
8
9
|
super(...e), this.value = "", this.multiple = !1, this.disabled = !1, this.size = "md", this.color = "default", this.orientation = "horizontal", this._handleChildChange = (e) => {
|
|
9
10
|
let t = e.target.closest("void-toggle");
|
|
@@ -31,11 +32,11 @@ var i = class extends n(e) {
|
|
|
31
32
|
}, this._handleKeydown = (e) => {
|
|
32
33
|
let t = this._toggles().filter((e) => !e.disabled);
|
|
33
34
|
if (!t.length) return;
|
|
34
|
-
let n = this.orientation === "horizontal", r = n ?
|
|
35
|
-
if (e.key !==
|
|
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
37
|
e.preventDefault();
|
|
37
|
-
let
|
|
38
|
-
|
|
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
40
|
};
|
|
40
41
|
}
|
|
41
42
|
connectedCallback() {
|
|
@@ -84,24 +85,24 @@ var i = class extends n(e) {
|
|
|
84
85
|
e.pressed = t.includes(n), this.disabled && (e.disabled = !0), e.size = this.size, this.color !== "default" && (e.color = this.color);
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
t([
|
|
88
|
+
t([i({
|
|
88
89
|
type: String,
|
|
89
90
|
reflect: !0
|
|
90
|
-
})],
|
|
91
|
+
})], a.prototype, "value", void 0), t([i({
|
|
91
92
|
type: Boolean,
|
|
92
93
|
reflect: !0
|
|
93
|
-
})],
|
|
94
|
+
})], a.prototype, "multiple", void 0), t([i({
|
|
94
95
|
type: Boolean,
|
|
95
96
|
reflect: !0
|
|
96
|
-
})],
|
|
97
|
+
})], a.prototype, "disabled", void 0), t([i({
|
|
97
98
|
type: String,
|
|
98
99
|
reflect: !0
|
|
99
|
-
})],
|
|
100
|
+
})], a.prototype, "size", void 0), t([i({
|
|
100
101
|
type: String,
|
|
101
102
|
reflect: !0
|
|
102
|
-
})],
|
|
103
|
+
})], a.prototype, "color", void 0), t([i({
|
|
103
104
|
type: String,
|
|
104
105
|
reflect: !0
|
|
105
|
-
})],
|
|
106
|
+
})], a.prototype, "orientation", void 0), customElements.get("void-toggle-group") || customElements.define("void-toggle-group", a);
|
|
106
107
|
//#endregion
|
|
107
|
-
export {
|
|
108
|
+
export { a as VoidToggleGroup };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { t as n } from "../chunks/keyboard-activation-CV0m4hkn.js";
|
|
4
4
|
import { i as r, r as i } from "../chunks/form-control-C0vH6gii.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BxmMM3B7.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import { i as n, n as r } from "../chunks/parts-
|
|
4
|
-
import { t as i } from "../chunks/overlay-
|
|
3
|
+
import { i as n, n as r } from "../chunks/parts-DI_3VpSy.js";
|
|
4
|
+
import { t as i } from "../chunks/overlay-hLJ7IQHx.js";
|
|
5
5
|
import { property as a } from "lit/decorators.js";
|
|
6
6
|
//#region src/components/tooltip.ts
|
|
7
7
|
var o = class extends e {
|
package/dist/components.json
CHANGED