@voidable/ui 0.9.0 → 0.11.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 +8 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BGrS4eIl.js +307 -0
- package/dist/chunks/data-BpiiNapL.js +95 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-hivQ4YoU.js → modal-DWGkNdNG.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-CH7L4N-h.js} +2 -2
- package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
- package/dist/chunks/{base-CMruMbxC.js → projection-oPe6ipjL.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.d.ts +11 -0
- package/dist/components/alert.js +11 -4
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.d.ts +8 -2
- package/dist/components/badge.js +1 -4
- package/dist/components/banner.d.ts +9 -0
- package/dist/components/banner.js +11 -4
- package/dist/components/bar-chart.d.ts +21 -7
- package/dist/components/bar-chart.js +67 -43
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +40 -2
- package/dist/components/calendar.js +170 -79
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +20 -19
- package/dist/components/charts/data.d.ts +72 -0
- 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.d.ts +22 -6
- package/dist/components/donut-chart.js +96 -68
- 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.d.ts +20 -5
- package/dist/components/file-upload.js +52 -20
- package/dist/components/gauge.d.ts +32 -8
- package/dist/components/gauge.js +209 -135
- package/dist/components/hamburger.d.ts +12 -1
- package/dist/components/hamburger.js +33 -20
- 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.d.ts +22 -7
- package/dist/components/line-chart.js +80 -56
- 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.d.ts +9 -0
- package/dist/components/nav-bar.js +16 -3
- 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.d.ts +13 -1
- package/dist/components/stat.js +29 -19
- 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.d.ts +4 -0
- package/dist/components/table.js +42 -29
- 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 +15 -13
- package/dist/custom-elements.json +320 -88
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +85 -16
- 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 +84 -59
- package/dist/types/elements.d.ts +13 -13
- package/dist/types/react.d.ts +2 -2
- package/dist/types/solid.d.ts +2 -2
- package/dist/types/svelte.d.ts +2 -2
- package/dist/types/vue.d.ts +2 -2
- package/dist/vscode.html-custom-data.json +108 -28
- package/dist/web-types.json +189 -60
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.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 { 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
|
|
@@ -67,8 +67,8 @@ export declare class VoidActionInput extends VoidActionInput_base {
|
|
|
67
67
|
icon: string;
|
|
68
68
|
/** Accessible name of the button and its tooltip. Defaults to `Action`; say what it does (`Copy link`). */
|
|
69
69
|
actionLabel: string;
|
|
70
|
-
/** Which side of the field the button sits on: `
|
|
71
|
-
iconSide: '
|
|
70
|
+
/** Which side of the field the button sits on, in the reading direction: `end` (default) or `start`. */
|
|
71
|
+
iconSide: 'start' | 'end';
|
|
72
72
|
/** Where the button's tooltip appears: `top` (default), `bottom`, `left` or `right`. */
|
|
73
73
|
tooltipSide: 'top' | 'bottom' | 'left' | 'right';
|
|
74
74
|
private _renderIcon;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.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 {
|
|
7
|
-
import {
|
|
4
|
+
import { r } from "../chunks/projection-oPe6ipjL.js";
|
|
5
|
+
import { n as i, t as a } from "../chunks/secret-value-CmTtVkMg.js";
|
|
6
|
+
import { html as o, nothing as s } from "lit";
|
|
7
|
+
import { property as c } from "lit/decorators.js";
|
|
8
|
+
import { live as l } from "lit/directives/live.js";
|
|
8
9
|
//#region src/components/action-input.ts
|
|
9
|
-
|
|
10
|
+
r();
|
|
11
|
+
var u = class t extends n(e) {
|
|
10
12
|
constructor(...e) {
|
|
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 = "
|
|
13
|
+
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 = "end", this.tooltipSide = "top";
|
|
12
14
|
}
|
|
13
15
|
static {
|
|
14
16
|
this.labelTarget = ".void-action-input-field";
|
|
@@ -18,23 +20,23 @@ var l = class t extends n(e) {
|
|
|
18
20
|
}
|
|
19
21
|
_renderIcon() {
|
|
20
22
|
switch (this.icon) {
|
|
21
|
-
case "copy": return
|
|
22
|
-
case "search": return
|
|
23
|
-
case "send": return
|
|
24
|
-
case "eye": return
|
|
25
|
-
case "eye-off": return
|
|
26
|
-
case "check": return
|
|
27
|
-
case "x": return
|
|
28
|
-
case "arrow-right": return
|
|
29
|
-
case "clipboard": return
|
|
30
|
-
default: return
|
|
23
|
+
case "copy": return o`<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>`;
|
|
24
|
+
case "search": return o`<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>`;
|
|
25
|
+
case "send": return o`<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>`;
|
|
26
|
+
case "eye": return o`<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>`;
|
|
27
|
+
case "eye-off": return o`<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>`;
|
|
28
|
+
case "check": return o`<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>`;
|
|
29
|
+
case "x": return o`<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>`;
|
|
30
|
+
case "arrow-right": return o`<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>`;
|
|
31
|
+
case "clipboard": return o`<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>`;
|
|
32
|
+
default: return o`<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>`;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
requestUpdate(e, n,
|
|
34
|
-
super.requestUpdate(e, n,
|
|
35
|
+
requestUpdate(e, n, r) {
|
|
36
|
+
super.requestUpdate(e, n, i(this.type === "password", e, r, () => t.getPropertyOptions("value")));
|
|
35
37
|
}
|
|
36
38
|
updated(e) {
|
|
37
|
-
super.updated(e), this.type === "password" && e.get("type") !== void 0 &&
|
|
39
|
+
super.updated(e), this.type === "password" && e.get("type") !== void 0 && a(this);
|
|
38
40
|
}
|
|
39
41
|
formWriteNativeDefault(e) {
|
|
40
42
|
let t = this.querySelector(".void-action-input-field");
|
|
@@ -72,7 +74,7 @@ var l = class t extends n(e) {
|
|
|
72
74
|
}));
|
|
73
75
|
}
|
|
74
76
|
render() {
|
|
75
|
-
let e =
|
|
77
|
+
let e = o`
|
|
76
78
|
<void-tooltip side=${this.tooltipSide}>
|
|
77
79
|
<void-tooltip-trigger><button
|
|
78
80
|
class="void-action-input-btn"
|
|
@@ -84,87 +86,87 @@ var l = class t extends n(e) {
|
|
|
84
86
|
<void-tooltip-content>${this.actionLabel}</void-tooltip-content>
|
|
85
87
|
</void-tooltip>
|
|
86
88
|
`;
|
|
87
|
-
return
|
|
88
|
-
${this.iconSide === "
|
|
89
|
+
return o`
|
|
90
|
+
${this.iconSide === "start" ? e : ""}
|
|
89
91
|
<input
|
|
90
92
|
class="void-action-input-field"
|
|
91
93
|
type=${this.type}
|
|
92
|
-
.value=${
|
|
94
|
+
.value=${l(this.value)}
|
|
93
95
|
placeholder=${this.placeholder}
|
|
94
96
|
?disabled=${this.disabled}
|
|
95
97
|
?readonly=${this.readonly}
|
|
96
98
|
?required=${this.required}
|
|
97
99
|
name=${this.name}
|
|
98
|
-
form=${this.formAttr ??
|
|
99
|
-
autocomplete=${this.autocomplete ||
|
|
100
|
-
minlength=${this.minlength ??
|
|
101
|
-
maxlength=${this.maxlength ??
|
|
102
|
-
pattern=${this.pattern ||
|
|
103
|
-
inputmode=${this.inputMode ||
|
|
104
|
-
enterkeyhint=${this.enterKeyHint ||
|
|
105
|
-
autocapitalize=${this.autocapitalize ||
|
|
106
|
-
spellcheck=${this.spellcheckAttr ??
|
|
107
|
-
aria-label=${this.placeholder ||
|
|
100
|
+
form=${this.formAttr ?? s}
|
|
101
|
+
autocomplete=${this.autocomplete || s}
|
|
102
|
+
minlength=${this.minlength ?? s}
|
|
103
|
+
maxlength=${this.maxlength ?? s}
|
|
104
|
+
pattern=${this.pattern || s}
|
|
105
|
+
inputmode=${this.inputMode || s}
|
|
106
|
+
enterkeyhint=${this.enterKeyHint || s}
|
|
107
|
+
autocapitalize=${this.autocapitalize || s}
|
|
108
|
+
spellcheck=${this.spellcheckAttr ?? s}
|
|
109
|
+
aria-label=${this.placeholder || s}
|
|
108
110
|
@input=${this._onInput}
|
|
109
111
|
@change=${this._onChange}
|
|
110
112
|
/>
|
|
111
|
-
${this.iconSide === "
|
|
113
|
+
${this.iconSide === "end" ? e : ""}
|
|
112
114
|
`;
|
|
113
115
|
}
|
|
114
116
|
};
|
|
115
|
-
t([
|
|
117
|
+
t([c({
|
|
116
118
|
type: String,
|
|
117
119
|
reflect: !0
|
|
118
|
-
})],
|
|
120
|
+
})], u.prototype, "value", void 0), t([c({
|
|
119
121
|
type: String,
|
|
120
122
|
reflect: !0
|
|
121
|
-
})],
|
|
123
|
+
})], u.prototype, "placeholder", void 0), t([c({
|
|
122
124
|
type: Boolean,
|
|
123
125
|
reflect: !0
|
|
124
|
-
})],
|
|
126
|
+
})], u.prototype, "disabled", void 0), t([c({
|
|
125
127
|
type: Boolean,
|
|
126
128
|
reflect: !0
|
|
127
|
-
})],
|
|
129
|
+
})], u.prototype, "readonly", void 0), t([c({
|
|
128
130
|
type: Boolean,
|
|
129
131
|
reflect: !0
|
|
130
|
-
})],
|
|
132
|
+
})], u.prototype, "required", void 0), t([c({
|
|
131
133
|
type: String,
|
|
132
134
|
reflect: !0
|
|
133
|
-
})],
|
|
135
|
+
})], u.prototype, "name", void 0), t([c({
|
|
134
136
|
type: String,
|
|
135
137
|
reflect: !0
|
|
136
|
-
})],
|
|
138
|
+
})], u.prototype, "autocomplete", void 0), t([c({ type: Number })], u.prototype, "minlength", void 0), t([c({ type: Number })], u.prototype, "maxlength", void 0), t([c({ type: String })], u.prototype, "pattern", void 0), t([c({
|
|
137
139
|
type: String,
|
|
138
140
|
attribute: "inputmode"
|
|
139
|
-
})],
|
|
141
|
+
})], u.prototype, "inputMode", void 0), t([c({
|
|
140
142
|
type: String,
|
|
141
143
|
attribute: "enterkeyhint"
|
|
142
|
-
})],
|
|
144
|
+
})], u.prototype, "enterKeyHint", void 0), t([c({ type: String })], u.prototype, "autocapitalize", void 0), t([c({
|
|
143
145
|
type: String,
|
|
144
146
|
attribute: "spellcheck"
|
|
145
|
-
})],
|
|
147
|
+
})], u.prototype, "spellcheckAttr", void 0), t([c({
|
|
146
148
|
type: String,
|
|
147
149
|
reflect: !0
|
|
148
|
-
})],
|
|
150
|
+
})], u.prototype, "size", void 0), t([c({
|
|
149
151
|
type: String,
|
|
150
152
|
reflect: !0
|
|
151
|
-
})],
|
|
153
|
+
})], u.prototype, "color", void 0), t([c({
|
|
152
154
|
type: String,
|
|
153
155
|
reflect: !0
|
|
154
|
-
})],
|
|
156
|
+
})], u.prototype, "type", void 0), t([c({
|
|
155
157
|
type: String,
|
|
156
158
|
reflect: !0
|
|
157
|
-
})],
|
|
159
|
+
})], u.prototype, "icon", void 0), t([c({
|
|
158
160
|
type: String,
|
|
159
161
|
attribute: "action-label"
|
|
160
|
-
})],
|
|
162
|
+
})], u.prototype, "actionLabel", void 0), t([c({
|
|
161
163
|
type: String,
|
|
162
164
|
reflect: !0,
|
|
163
165
|
attribute: "icon-side"
|
|
164
|
-
})],
|
|
166
|
+
})], u.prototype, "iconSide", void 0), t([c({
|
|
165
167
|
type: String,
|
|
166
168
|
reflect: !0,
|
|
167
169
|
attribute: "tooltip-side"
|
|
168
|
-
})],
|
|
170
|
+
})], u.prototype, "tooltipSide", void 0), customElements.get("void-action-input") || customElements.define("void-action-input", u);
|
|
169
171
|
//#endregion
|
|
170
|
-
export {
|
|
172
|
+
export { u as VoidActionInput };
|
|
@@ -3,6 +3,9 @@ import { PartsController } from '../parts.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Inline contextual message for form validation feedback, permission warnings, and system status notices.
|
|
5
5
|
*
|
|
6
|
+
* Its role follows the colour: `error` and `warning` are `role="alert"` (announced at once, interrupting), every
|
|
7
|
+
* other colour is `role="status"` (announced politely). A role you write on it is kept.
|
|
8
|
+
*
|
|
6
9
|
* Its text is written as parts: an optional `<void-alert-title>`, the `<void-alert-description>` and an optional
|
|
7
10
|
* `<void-alert-close>`. The parts are never moved. The close part wraps the one control the author writes (a
|
|
8
11
|
* `<button type="button" aria-label="Dismiss">`); pressing it fires `void-close` and, unless that is cancelled, removes the alert (focus inside
|
|
@@ -24,6 +27,14 @@ export declare class VoidAlert extends VoidElement {
|
|
|
24
27
|
variant: 'subtle' | 'filled';
|
|
25
28
|
protected readonly _parts: PartsController;
|
|
26
29
|
connectedCallback(): void;
|
|
30
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
31
|
+
/**
|
|
32
|
+
* `alert` (assertive: it interrupts) only for the urgent colours, `error` and `warning`; every other
|
|
33
|
+
* alert is `status` (polite). A role the author wrote is left alone.
|
|
34
|
+
*/
|
|
35
|
+
private _syncRole;
|
|
36
|
+
/** The role this alert wrote itself, so one the author wrote is told apart from it. */
|
|
37
|
+
private _writtenRole;
|
|
27
38
|
disconnectedCallback(): void;
|
|
28
39
|
private _onClick;
|
|
29
40
|
}
|
package/dist/components/alert.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.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/alert.ts
|
|
@@ -13,7 +13,7 @@ var o = class extends e {
|
|
|
13
13
|
"void-alert-close"
|
|
14
14
|
],
|
|
15
15
|
onChange: () => void 0
|
|
16
|
-
}), this._onClick = (e) => {
|
|
16
|
+
}), this._writtenRole = null, this._onClick = (e) => {
|
|
17
17
|
i(this._parts.one("void-alert-close"), e) && this.dispatchEvent(new CustomEvent("void-close", {
|
|
18
18
|
bubbles: !1,
|
|
19
19
|
cancelable: !0,
|
|
@@ -22,7 +22,14 @@ var o = class extends e {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
connectedCallback() {
|
|
25
|
-
super.connectedCallback(), this.
|
|
25
|
+
super.connectedCallback(), this._syncRole(), this.addEventListener("click", this._onClick);
|
|
26
|
+
}
|
|
27
|
+
updated(e) {
|
|
28
|
+
super.updated(e), e.has("color") && this._syncRole();
|
|
29
|
+
}
|
|
30
|
+
_syncRole() {
|
|
31
|
+
let e = this.getAttribute("role");
|
|
32
|
+
e !== null && e !== this._writtenRole || (this._writtenRole = this.color === "error" || this.color === "warning" ? "alert" : "status", this.setHostAttribute("role", this._writtenRole));
|
|
26
33
|
}
|
|
27
34
|
disconnectedCallback() {
|
|
28
35
|
super.disconnectedCallback(), this.removeEventListener("click", this._onClick);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { r as n } from "../chunks/projection-oPe6ipjL.js";
|
|
4
|
+
import { html as r } from "lit";
|
|
5
|
+
import { property as i } from "lit/decorators.js";
|
|
5
6
|
//#region src/components/avatar.ts
|
|
6
|
-
|
|
7
|
+
n();
|
|
8
|
+
var a = class extends e {
|
|
7
9
|
constructor(...e) {
|
|
8
10
|
super(...e), this.src = "", this.alt = "", this.initials = "", this.size = "md", this._onImgError = () => {
|
|
9
11
|
this.src = "";
|
|
@@ -16,21 +18,21 @@ var i = class extends e {
|
|
|
16
18
|
(e.has("alt") || e.has("initials")) && this.setHostAttribute("aria-label", this.alt || this.initials);
|
|
17
19
|
}
|
|
18
20
|
render() {
|
|
19
|
-
return this.src ?
|
|
21
|
+
return this.src ? r`<img src="${this.src}" alt="${this.alt}" @error="${this._onImgError}" />` : this.initials ? r`<span class="void-avatar-initials">${this.initials}</span>` : r``;
|
|
20
22
|
}
|
|
21
23
|
};
|
|
22
|
-
t([
|
|
24
|
+
t([i({
|
|
23
25
|
type: String,
|
|
24
26
|
reflect: !0
|
|
25
|
-
})],
|
|
27
|
+
})], a.prototype, "src", void 0), t([i({
|
|
26
28
|
type: String,
|
|
27
29
|
reflect: !0
|
|
28
|
-
})],
|
|
30
|
+
})], a.prototype, "alt", void 0), t([i({
|
|
29
31
|
type: String,
|
|
30
32
|
reflect: !0
|
|
31
|
-
})],
|
|
33
|
+
})], a.prototype, "initials", void 0), t([i({
|
|
32
34
|
type: String,
|
|
33
35
|
reflect: !0
|
|
34
|
-
})],
|
|
36
|
+
})], a.prototype, "size", void 0), customElements.get("void-avatar") || customElements.define("void-avatar", a);
|
|
35
37
|
//#endregion
|
|
36
|
-
export {
|
|
38
|
+
export { a as VoidAvatar };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { VoidElement } from '../base.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Small status chip for issue trackers, tag systems, and categorization UIs where color conveys state at a glance.
|
|
4
|
+
*
|
|
5
|
+
* A badge has no role: it is text beside other text, and a screen reader reads it where it sits. It is not
|
|
6
|
+
* a live region, because a table of status badges would announce every one as it is inserted. For the one
|
|
7
|
+
* badge whose change must be heard (a count that updates while the user works), write `role="status"` on it
|
|
8
|
+
* yourself; the component leaves it alone.
|
|
9
|
+
*/
|
|
3
10
|
export declare class VoidBadge extends VoidElement {
|
|
4
11
|
/**
|
|
5
12
|
* Status colour: `default`, `error`, `warning`, `caution`, `success`, `info`, `notice` or `highlight`.
|
|
@@ -10,7 +17,6 @@ export declare class VoidBadge extends VoidElement {
|
|
|
10
17
|
variant: 'filled' | 'outline';
|
|
11
18
|
/** Size step: `sm`, `md` (default) or `lg`. */
|
|
12
19
|
size: 'sm' | 'md' | 'lg';
|
|
13
|
-
connectedCallback(): void;
|
|
14
20
|
}
|
|
15
21
|
declare global {
|
|
16
22
|
interface HTMLElementTagNameMap {
|
package/dist/components/badge.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.js";
|
|
2
2
|
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { property as n } from "lit/decorators.js";
|
|
4
4
|
//#region src/components/badge.ts
|
|
@@ -6,9 +6,6 @@ var r = class extends e {
|
|
|
6
6
|
constructor(...e) {
|
|
7
7
|
super(...e), this.color = "default", this.variant = "filled", this.size = "md";
|
|
8
8
|
}
|
|
9
|
-
connectedCallback() {
|
|
10
|
-
super.connectedCallback(), this.setHostAttribute("role", "status");
|
|
11
|
-
}
|
|
12
9
|
};
|
|
13
10
|
t([n({
|
|
14
11
|
type: String,
|
|
@@ -3,6 +3,11 @@ import { PartsController } from '../parts.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Full-width site-level announcement for maintenance windows, cookie consent, and promotional messaging.
|
|
5
5
|
*
|
|
6
|
+
* It never has the `banner` role: that is the page header landmark (at most one per page, never inside
|
|
7
|
+
* `<main>`), which an announcement is not. Like the alert it carries an announcement, so its role follows its
|
|
8
|
+
* `color`: `alert` for `error` and `warning`, `status` for the rest. To make it a landmark users can jump to,
|
|
9
|
+
* write `role="region"` and an `aria-label`; the component leaves a role you write alone.
|
|
10
|
+
*
|
|
6
11
|
* Its text is written as parts: an optional `<void-banner-title>`, the `<void-banner-description>`, an optional
|
|
7
12
|
* `<void-banner-actions>` (buttons or links) and an optional `<void-banner-close>`. The parts are never moved. The
|
|
8
13
|
* close part wraps the one control the author writes (a `<void-button aria-label="Dismiss">`); pressing it fires
|
|
@@ -21,6 +26,10 @@ export declare class VoidBanner extends VoidElement {
|
|
|
21
26
|
variant: 'subtle' | 'filled';
|
|
22
27
|
protected readonly _parts: PartsController;
|
|
23
28
|
connectedCallback(): void;
|
|
29
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
30
|
+
/** `alert` for the urgent colours, `status` otherwise; a role the author wrote is left alone. */
|
|
31
|
+
private _syncRole;
|
|
32
|
+
private _writtenRole;
|
|
24
33
|
disconnectedCallback(): void;
|
|
25
34
|
private _onClick;
|
|
26
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as e } from "../chunks/base-
|
|
1
|
+
import { t as e } from "../chunks/base-BGrS4eIl.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/banner.ts
|
|
@@ -14,7 +14,7 @@ var o = class extends e {
|
|
|
14
14
|
"void-banner-close"
|
|
15
15
|
],
|
|
16
16
|
onChange: () => void 0
|
|
17
|
-
}), this._onClick = (e) => {
|
|
17
|
+
}), this._writtenRole = null, this._onClick = (e) => {
|
|
18
18
|
i(this._parts.one("void-banner-close"), e) && this.dispatchEvent(new CustomEvent("void-close", {
|
|
19
19
|
bubbles: !1,
|
|
20
20
|
cancelable: !0,
|
|
@@ -23,7 +23,14 @@ var o = class extends e {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
connectedCallback() {
|
|
26
|
-
super.connectedCallback(), this.
|
|
26
|
+
super.connectedCallback(), this._syncRole(), this.addEventListener("click", this._onClick);
|
|
27
|
+
}
|
|
28
|
+
updated(e) {
|
|
29
|
+
super.updated(e), e.has("color") && this._syncRole();
|
|
30
|
+
}
|
|
31
|
+
_syncRole() {
|
|
32
|
+
let e = this.getAttribute("role");
|
|
33
|
+
e !== null && e !== this._writtenRole || (this._writtenRole = this.color === "error" || this.color === "warning" ? "alert" : "status", this.setHostAttribute("role", this._writtenRole));
|
|
27
34
|
}
|
|
28
35
|
disconnectedCallback() {
|
|
29
36
|
super.disconnectedCallback(), this.removeEventListener("click", this._onClick);
|
|
@@ -15,8 +15,10 @@ export interface BarChartData {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Bar chart for comparing categories and series, drawn in SVG with animated bars. Give it `data`
|
|
18
|
-
* (`{ series: [{ name, values }], labels }`)
|
|
19
|
-
*
|
|
18
|
+
* (`{ series: [{ name, values }], labels }`) as the `data` property or as JSON in the `data` attribute, so
|
|
19
|
+
* server-rendered markup draws it with no script; it has no children. The drawing is hidden from assistive
|
|
20
|
+
* technology and a visually hidden data table (captioned with `aria-label`) carries the values instead; add
|
|
21
|
+
* `show-table` to show the table below the chart too.
|
|
20
22
|
*/
|
|
21
23
|
export declare class VoidBarChart extends VoidElement {
|
|
22
24
|
/** Height of the chart in pixels. Defaults to 220. The width fills the container. */
|
|
@@ -29,25 +31,35 @@ export declare class VoidBarChart extends VoidElement {
|
|
|
29
31
|
*/
|
|
30
32
|
variant: 'filled' | 'outline' | 'wireframe';
|
|
31
33
|
/**
|
|
32
|
-
* Accessible name of the chart, such as `Revenue by quarter
|
|
33
|
-
*
|
|
34
|
+
* Accessible name of the chart, such as `Revenue by quarter`; it is also the caption of the data table.
|
|
35
|
+
* Set it: the drawing itself is hidden from assistive technology.
|
|
34
36
|
*/
|
|
35
37
|
ariaLabel: string;
|
|
38
|
+
/**
|
|
39
|
+
* Show the data table (one row per category, one column per series) below the chart. The table is always
|
|
40
|
+
* there for assistive technology; this makes it visible too.
|
|
41
|
+
*/
|
|
42
|
+
showTable: boolean;
|
|
36
43
|
/**
|
|
37
44
|
* Delay in milliseconds between the bars as they animate in, one after another. Without it the theme's
|
|
38
45
|
* `--void-stagger-chart-bars` applies; `stagger="0"` animates them together.
|
|
39
46
|
*/
|
|
40
47
|
stagger: number | null;
|
|
41
48
|
private _data;
|
|
49
|
+
private _source;
|
|
50
|
+
private _entered;
|
|
42
51
|
/**
|
|
43
52
|
* The chart's data: `{ series: [{ name, values, color?, colors? }], labels? }`. `values` are aligned with
|
|
44
53
|
* `labels` (the category names along the axis); `color` colours a whole series and `colors` overrides single
|
|
45
54
|
* bars. Negative values are bars below a zero baseline: the value axis then spans the lowest value as
|
|
46
|
-
* well, and a baseline is drawn at zero.
|
|
47
|
-
* animate to it
|
|
55
|
+
* well, and a baseline is drawn at zero. Give it as a property (assign a new object to update the chart
|
|
56
|
+
* and animate to it) or as JSON in the `data` attribute: `<void-bar-chart data='{"series":[{"name":"Sales","values":[3,5]}],"labels":["Mon","Tue"]}'>`.
|
|
57
|
+
* Invalid JSON draws nothing and is reported by `@voidable/ui/dev`. The property is not reflected to the
|
|
58
|
+
* attribute (the data can be large), and an attribute a server morph leaves unchanged does not animate again.
|
|
59
|
+
* @default { series: [] }
|
|
48
60
|
*/
|
|
49
61
|
get data(): BarChartData;
|
|
50
|
-
set data(
|
|
62
|
+
set data(input: BarChartData);
|
|
51
63
|
private _phase;
|
|
52
64
|
private _display;
|
|
53
65
|
private _targets;
|
|
@@ -63,6 +75,8 @@ export declare class VoidBarChart extends VoidElement {
|
|
|
63
75
|
private _startAnimation;
|
|
64
76
|
private _tick;
|
|
65
77
|
render(): import('lit').TemplateResult<1>;
|
|
78
|
+
/** The data table for assistive technology (and `show-table`), from the data as given, not the animated state. */
|
|
79
|
+
private _table;
|
|
66
80
|
}
|
|
67
81
|
declare global {
|
|
68
82
|
interface HTMLElementTagNameMap {
|