@voidable/ui 0.8.1 → 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/README.md +8 -0
- 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-D_YVy2vg.js → modal-CgGp_fCs.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-hLJ7IQHx.js} +2 -2
- package/dist/chunks/{parts-D30c8OoG.js → parts-DI_3VpSy.js} +25 -18
- package/dist/chunks/{base-CMruMbxC.js → projection-SnR79EHI.js} +105 -389
- package/dist/chunks/secret-value-CmTtVkMg.js +14 -0
- package/dist/chunks/value-list-CH6GjYXM.js +28 -0
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +8 -4
- package/dist/components/action-input.js +61 -49
- 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.d.ts +10 -0
- package/dist/components/checkbox-group.js +36 -23
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.d.ts +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.d.ts +4 -2
- package/dist/components/combobox.js +22 -18
- package/dist/components/compose-input.d.ts +1 -1
- package/dist/components/compose-input.js +15 -10
- 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.d.ts +1 -1
- 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 +90 -85
- 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.d.ts +6 -2
- package/dist/components/input.js +46 -34
- 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.d.ts +9 -0
- package/dist/components/multiselect.js +64 -54
- package/dist/components/nav-bar.js +1 -1
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.d.ts +2 -2
- 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.d.ts +6 -2
- package/dist/components/pin-input.js +39 -27
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +15 -10
- 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.d.ts +1 -1
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.d.ts +67 -16
- package/dist/components/select.js +183 -56
- 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.d.ts +2 -2
- package/dist/components/slider.js +18 -13
- 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.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/components/tags-input.js +25 -19
- package/dist/components/textarea.d.ts +2 -2
- package/dist/components/textarea.js +36 -31
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +5 -2
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +3 -3
- package/dist/custom-elements.json +133 -67
- package/dist/dev/types.d.ts +2 -3
- package/dist/dev.js +81 -55
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +125 -0
- package/dist/parts.d.ts +8 -1
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +4575 -0
- package/dist/secret-value.d.ts +17 -0
- package/dist/types/elements.d.ts +2 -2
- package/dist/value-list.d.ts +14 -0
- package/dist/vscode.html-custom-data.json +46 -26
- package/dist/web-types.json +73 -53
- package/package.json +5 -3
|
@@ -1,9 +1,11 @@
|
|
|
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 {
|
|
4
|
-
import {
|
|
3
|
+
import { r as n } from "../chunks/projection-SnR79EHI.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { property as a } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/stepper.ts
|
|
6
|
-
|
|
7
|
+
n();
|
|
8
|
+
var o = class extends e {
|
|
7
9
|
constructor(...e) {
|
|
8
10
|
super(...e), this.value = 0, this.steps = "";
|
|
9
11
|
}
|
|
@@ -11,15 +13,15 @@ var a = class extends e {
|
|
|
11
13
|
super.connectedCallback(), this.setHostAttribute("role", "navigation"), this.setHostAttribute("aria-label", "Progress");
|
|
12
14
|
}
|
|
13
15
|
render() {
|
|
14
|
-
return
|
|
15
|
-
let
|
|
16
|
-
return
|
|
16
|
+
return r`${this.steps.split(",").map((e) => e.trim()).filter(Boolean).map((e, t) => {
|
|
17
|
+
let n = t < this.value ? "completed" : t === this.value ? "active" : "upcoming";
|
|
18
|
+
return r`${t > 0 ? r`<div class="void-stepper-connector" data-state=${t <= this.value ? "completed" : "upcoming"}></div>` : null}<div
|
|
17
19
|
class="void-stepper-step"
|
|
18
|
-
data-state=${
|
|
19
|
-
aria-current=${t === this.value ? "step" :
|
|
20
|
+
data-state=${n}
|
|
21
|
+
aria-current=${t === this.value ? "step" : i}
|
|
20
22
|
>
|
|
21
23
|
<span class="void-stepper-circle"
|
|
22
|
-
>${
|
|
24
|
+
>${n === "completed" ? r`<svg
|
|
23
25
|
viewBox="0 0 12 12"
|
|
24
26
|
width="1em"
|
|
25
27
|
height="1em"
|
|
@@ -37,9 +39,9 @@ var a = class extends e {
|
|
|
37
39
|
})}`;
|
|
38
40
|
}
|
|
39
41
|
};
|
|
40
|
-
t([
|
|
42
|
+
t([a({
|
|
41
43
|
type: Number,
|
|
42
44
|
reflect: !0
|
|
43
|
-
})],
|
|
45
|
+
})], o.prototype, "value", void 0), t([a({ reflect: !0 })], o.prototype, "steps", void 0), customElements.get("void-stepper") || customElements.define("void-stepper", o);
|
|
44
46
|
//#endregion
|
|
45
|
-
export {
|
|
47
|
+
export { o as VoidStepper };
|
|
@@ -6,7 +6,7 @@ declare const VoidSwitch_base: (new (...args: any[]) => import('../form-control.
|
|
|
6
6
|
export declare class VoidSwitch extends VoidSwitch_base {
|
|
7
7
|
/** Enter and Space fire a real `click`, as on a native button. */
|
|
8
8
|
protected readonly _activation: KeyboardActivation;
|
|
9
|
-
/** Whether the switch is on.
|
|
9
|
+
/** Whether the switch is on. Reflected to the attribute as it changes; the form's reset target stays the state it started with. */
|
|
10
10
|
checked: boolean;
|
|
11
11
|
/**
|
|
12
12
|
* Stop the switch reacting and exclude it from the form submission. Also disabled by an enclosing
|
|
@@ -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/keyboard-activation-CV0m4hkn.js";
|
|
4
4
|
import { t as r } from "../chunks/form-control-C0vH6gii.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { r as i } from "../chunks/projection-SnR79EHI.js";
|
|
6
|
+
import { html as a } from "lit";
|
|
7
|
+
import { property as o } from "lit/decorators.js";
|
|
7
8
|
//#region src/components/switch.ts
|
|
8
|
-
|
|
9
|
+
i();
|
|
10
|
+
var s = class extends r(e) {
|
|
9
11
|
constructor(...e) {
|
|
10
12
|
super(...e), this._activation = new n(this, { disabled: () => this.formDisabled }), this.checked = !1, this.disabled = !1, this.value = "on", this.color = "default", this.size = "md", this._handleClick = () => {
|
|
11
13
|
this.formDisabled || (this.checked = !this.checked, this.dispatchEvent(new CustomEvent("void-change", {
|
|
@@ -40,24 +42,24 @@ var o = class extends r(e) {
|
|
|
40
42
|
this.checked = !!e;
|
|
41
43
|
}
|
|
42
44
|
render() {
|
|
43
|
-
return
|
|
45
|
+
return a`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
|
-
t([
|
|
48
|
+
t([o({
|
|
47
49
|
type: Boolean,
|
|
48
50
|
reflect: !0
|
|
49
|
-
})],
|
|
51
|
+
})], s.prototype, "checked", void 0), t([o({
|
|
50
52
|
type: Boolean,
|
|
51
53
|
reflect: !0
|
|
52
|
-
})],
|
|
54
|
+
})], s.prototype, "disabled", void 0), t([o({
|
|
53
55
|
type: String,
|
|
54
56
|
reflect: !0
|
|
55
|
-
})],
|
|
57
|
+
})], s.prototype, "value", void 0), t([o({
|
|
56
58
|
type: String,
|
|
57
59
|
reflect: !0
|
|
58
|
-
})],
|
|
60
|
+
})], s.prototype, "color", void 0), t([o({
|
|
59
61
|
type: String,
|
|
60
62
|
reflect: !0
|
|
61
|
-
})],
|
|
63
|
+
})], s.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", s);
|
|
62
64
|
//#endregion
|
|
63
|
-
export {
|
|
65
|
+
export { s as VoidSwitch };
|
package/dist/components/table.js
CHANGED
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);
|
|
@@ -12,7 +12,7 @@ export declare class VoidTagsInput extends VoidTagsInput_base {
|
|
|
12
12
|
static labelTarget: string;
|
|
13
13
|
/**
|
|
14
14
|
* The tags, as an array of strings or `{ text, color }` objects. Set it as a property from script, or
|
|
15
|
-
* as a JSON array in the attribute.
|
|
15
|
+
* as a JSON array in the attribute, which follows the tags as they change.
|
|
16
16
|
*/
|
|
17
17
|
value: TagValue[];
|
|
18
18
|
/** Stop the field accepting input and removing tags, and exclude the values from the form submission. */
|
|
@@ -1,10 +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 {
|
|
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";
|
|
6
8
|
//#region src/components/tags-input.ts
|
|
7
|
-
|
|
9
|
+
r();
|
|
10
|
+
var c = class extends n(e) {
|
|
8
11
|
constructor(...e) {
|
|
9
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;
|
|
10
13
|
}
|
|
@@ -26,25 +29,25 @@ var o = class extends n(e) {
|
|
|
26
29
|
}
|
|
27
30
|
render() {
|
|
28
31
|
let e = this.value.length >= this.max;
|
|
29
|
-
return
|
|
32
|
+
return a`
|
|
30
33
|
<div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
|
|
31
34
|
${this.value.map((e, t) => {
|
|
32
35
|
let n = this._tagText(e);
|
|
33
|
-
return
|
|
34
|
-
<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}>
|
|
35
38
|
<span class="void-tags-input-tag-text">${n}</span>
|
|
36
|
-
${!this.disabled && !this.readonly ?
|
|
39
|
+
${!this.disabled && !this.readonly ? a`<button
|
|
37
40
|
type="button"
|
|
38
41
|
class="void-tags-input-tag-remove"
|
|
39
42
|
aria-label="Remove ${n}"
|
|
40
43
|
@click=${(e) => {
|
|
41
44
|
e.stopPropagation(), this._removeTag(t);
|
|
42
45
|
}}
|
|
43
|
-
>×</button>` :
|
|
46
|
+
>×</button>` : o}
|
|
44
47
|
</span>
|
|
45
48
|
`;
|
|
46
49
|
})}
|
|
47
|
-
${!e && !this.readonly ?
|
|
50
|
+
${!e && !this.readonly ? a`<input
|
|
48
51
|
class="void-tags-input-field"
|
|
49
52
|
type="text"
|
|
50
53
|
placeholder=${this.value.length === 0 ? this.placeholder : ""}
|
|
@@ -52,7 +55,7 @@ var o = class extends n(e) {
|
|
|
52
55
|
@keydown=${this._onKeydown}
|
|
53
56
|
@input=${this._onFieldInput}
|
|
54
57
|
@paste=${this._onPaste}
|
|
55
|
-
/>` :
|
|
58
|
+
/>` : o}
|
|
56
59
|
</div>
|
|
57
60
|
`;
|
|
58
61
|
}
|
|
@@ -96,24 +99,27 @@ var o = class extends n(e) {
|
|
|
96
99
|
}));
|
|
97
100
|
}
|
|
98
101
|
};
|
|
99
|
-
t([
|
|
102
|
+
t([s({
|
|
103
|
+
converter: i,
|
|
104
|
+
reflect: !0
|
|
105
|
+
})], c.prototype, "value", void 0), t([s({
|
|
100
106
|
type: Boolean,
|
|
101
107
|
reflect: !0
|
|
102
|
-
})],
|
|
108
|
+
})], c.prototype, "disabled", void 0), t([s({
|
|
103
109
|
type: Boolean,
|
|
104
110
|
reflect: !0
|
|
105
|
-
})],
|
|
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({
|
|
106
112
|
type: String,
|
|
107
113
|
reflect: !0
|
|
108
|
-
})],
|
|
114
|
+
})], c.prototype, "size", void 0), t([s({
|
|
109
115
|
type: String,
|
|
110
116
|
reflect: !0
|
|
111
|
-
})],
|
|
117
|
+
})], c.prototype, "color", void 0), t([s({
|
|
112
118
|
type: String,
|
|
113
119
|
reflect: !0
|
|
114
|
-
})],
|
|
120
|
+
})], c.prototype, "variant", void 0), t([s({
|
|
115
121
|
type: Boolean,
|
|
116
122
|
attribute: "allow-duplicates"
|
|
117
|
-
})],
|
|
123
|
+
})], c.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", c);
|
|
118
124
|
//#endregion
|
|
119
|
-
export {
|
|
125
|
+
export { c as VoidTagsInput };
|
|
@@ -11,8 +11,8 @@ export declare class VoidTextarea extends VoidTextarea_base {
|
|
|
11
11
|
/** While focus is inside, a morph does not apply the server's value over what the user is typing. */
|
|
12
12
|
static editState: string[];
|
|
13
13
|
/**
|
|
14
|
-
* The text in the box.
|
|
15
|
-
*
|
|
14
|
+
* The text in the box. Reflected to the `value` attribute as it changes, and setting the attribute
|
|
15
|
+
* sets it; the form's reset target stays the value the box started with.
|
|
16
16
|
*/
|
|
17
17
|
value: string;
|
|
18
18
|
/**
|
|
@@ -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,45 +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({
|
|
79
|
+
type: String,
|
|
80
|
+
reflect: !0
|
|
81
|
+
})], c.prototype, "placeholder", void 0), t([o({
|
|
77
82
|
type: Boolean,
|
|
78
83
|
reflect: !0
|
|
79
|
-
})],
|
|
84
|
+
})], c.prototype, "disabled", void 0), t([o({
|
|
80
85
|
type: Boolean,
|
|
81
86
|
reflect: !0
|
|
82
|
-
})],
|
|
87
|
+
})], c.prototype, "readonly", void 0), t([o({
|
|
83
88
|
type: Boolean,
|
|
84
89
|
reflect: !0
|
|
85
|
-
})],
|
|
90
|
+
})], c.prototype, "required", void 0), t([o({
|
|
86
91
|
type: String,
|
|
87
92
|
reflect: !0
|
|
88
|
-
})],
|
|
93
|
+
})], c.prototype, "name", void 0), t([o({
|
|
89
94
|
type: Number,
|
|
90
95
|
reflect: !0
|
|
91
|
-
})],
|
|
96
|
+
})], c.prototype, "rows", void 0), t([o({
|
|
92
97
|
type: String,
|
|
93
98
|
reflect: !0
|
|
94
|
-
})],
|
|
99
|
+
})], c.prototype, "resize", void 0), t([o({
|
|
95
100
|
type: String,
|
|
96
101
|
reflect: !0
|
|
97
|
-
})],
|
|
102
|
+
})], c.prototype, "size", void 0), t([o({
|
|
98
103
|
type: String,
|
|
99
104
|
reflect: !0
|
|
100
|
-
})],
|
|
105
|
+
})], c.prototype, "error", void 0), t([o({
|
|
101
106
|
type: String,
|
|
102
107
|
reflect: !0
|
|
103
|
-
})],
|
|
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({
|
|
104
109
|
type: String,
|
|
105
110
|
attribute: "inputmode"
|
|
106
|
-
})],
|
|
111
|
+
})], c.prototype, "inputMode", void 0), t([o({
|
|
107
112
|
type: String,
|
|
108
113
|
attribute: "enterkeyhint"
|
|
109
|
-
})],
|
|
114
|
+
})], c.prototype, "enterKeyHint", void 0), t([o({ type: String })], c.prototype, "autocapitalize", void 0), t([o({
|
|
110
115
|
type: String,
|
|
111
116
|
attribute: "spellcheck"
|
|
112
|
-
})],
|
|
117
|
+
})], c.prototype, "spellcheckAttr", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", c);
|
|
113
118
|
//#endregion
|
|
114
|
-
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;
|