@voidable/ui 0.5.2 → 0.5.4
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.d.ts +5 -0
- package/dist/base.d.ts.map +1 -0
- package/dist/base.js +9 -0
- package/dist/chunks/decorate-DKuCkHK4.js +9 -0
- package/dist/components/accordion.d.ts +25 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +73 -0
- package/dist/components/action-input.d.ts +28 -0
- package/dist/components/action-input.d.ts.map +1 -0
- package/dist/components/action-input.js +117 -0
- package/dist/components/alert.d.ts +20 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +40 -0
- package/dist/components/avatar.d.ts +18 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +36 -0
- package/dist/components/badge.d.ts +14 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +24 -0
- package/dist/components/banner.d.ts +20 -0
- package/dist/components/banner.d.ts.map +1 -0
- package/dist/components/banner.js +40 -0
- package/dist/components/breadcrumbs.d.ts +16 -0
- package/dist/components/breadcrumbs.d.ts.map +1 -0
- package/dist/components/breadcrumbs.js +33 -0
- package/dist/components/button.d.ts +25 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +56 -0
- package/dist/components/calendar.d.ts +75 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +417 -0
- package/dist/components/card.d.ts +18 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +32 -0
- package/dist/components/carousel.d.ts +41 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +145 -0
- package/dist/components/checkbox-group.d.ts +20 -0
- package/dist/components/checkbox-group.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +48 -0
- package/dist/components/checkbox.d.ts +25 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +69 -0
- package/dist/components/collapsible.d.ts +21 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +61 -0
- package/dist/components/color-picker.d.ts +47 -0
- package/dist/components/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker.js +217 -0
- package/dist/components/combobox.d.ts +30 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +89 -0
- package/dist/components/compose-input.d.ts +19 -0
- package/dist/components/compose-input.d.ts.map +1 -0
- package/dist/components/compose-input.js +71 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +64 -0
- package/dist/components/divider.d.ts +16 -0
- package/dist/components/divider.d.ts.map +1 -0
- package/dist/components/divider.js +28 -0
- package/dist/components/drawer.d.ts +26 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +62 -0
- package/dist/components/dropdown-menu.d.ts +29 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +72 -0
- package/dist/components/editable.d.ts +27 -0
- package/dist/components/editable.d.ts.map +1 -0
- package/dist/components/editable.js +82 -0
- package/dist/components/error-fallback.d.ts +18 -0
- package/dist/components/error-fallback.d.ts.map +1 -0
- package/dist/components/error-fallback.js +35 -0
- package/dist/components/field.d.ts +19 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +42 -0
- package/dist/components/file-upload.d.ts +26 -0
- package/dist/components/file-upload.d.ts.map +1 -0
- package/dist/components/file-upload.js +99 -0
- package/dist/components/hamburger.d.ts +18 -0
- package/dist/components/hamburger.d.ts.map +1 -0
- package/dist/components/hamburger.js +45 -0
- package/dist/components/hover-card.d.ts +31 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +80 -0
- package/dist/components/indicator.d.ts +20 -0
- package/dist/components/indicator.d.ts.map +1 -0
- package/dist/components/indicator.js +39 -0
- package/dist/components/input.d.ts +23 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +73 -0
- package/dist/components/list.d.ts +22 -0
- package/dist/components/list.d.ts.map +1 -0
- package/dist/components/list.js +45 -0
- package/dist/components/menu.d.ts +50 -0
- package/dist/components/menu.d.ts.map +1 -0
- package/dist/components/menu.js +162 -0
- package/dist/components/multiselect.d.ts +35 -0
- package/dist/components/multiselect.d.ts.map +1 -0
- package/dist/components/multiselect.js +118 -0
- package/dist/components/nav-bar.d.ts +18 -0
- package/dist/components/nav-bar.d.ts.map +1 -0
- package/dist/components/nav-bar.js +35 -0
- package/dist/components/nav-menu.d.ts +42 -0
- package/dist/components/nav-menu.d.ts.map +1 -0
- package/dist/components/nav-menu.js +122 -0
- package/dist/components/number-input.d.ts +41 -0
- package/dist/components/number-input.d.ts.map +1 -0
- package/dist/components/number-input.js +143 -0
- package/dist/components/pagination.d.ts +17 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +62 -0
- package/dist/components/panel.d.ts +18 -0
- package/dist/components/panel.d.ts.map +1 -0
- package/dist/components/panel.js +31 -0
- package/dist/components/pin-input.d.ts +33 -0
- package/dist/components/pin-input.d.ts.map +1 -0
- package/dist/components/pin-input.js +132 -0
- package/dist/components/popover.d.ts +24 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +52 -0
- package/dist/components/progress.d.ts +18 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +38 -0
- package/dist/components/radio-group.d.ts +24 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +56 -0
- package/dist/components/radio.d.ts +24 -0
- package/dist/components/radio.d.ts.map +1 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/scroll-area.d.ts +17 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +30 -0
- package/dist/components/segmented-control.d.ts +27 -0
- package/dist/components/segmented-control.d.ts.map +1 -0
- package/dist/components/segmented-control.js +70 -0
- package/dist/components/select.d.ts +23 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +64 -0
- package/dist/components/sidebar.d.ts +18 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +40 -0
- package/dist/components/skeleton.d.ts +12 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +18 -0
- package/dist/components/slider.d.ts +24 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +68 -0
- package/dist/components/spinner.d.ts +15 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +28 -0
- package/dist/components/stat.d.ts +18 -0
- package/dist/components/stat.d.ts.map +1 -0
- package/dist/components/stat.js +41 -0
- package/dist/components/status-dot.d.ts +14 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/status-dot.js +28 -0
- package/dist/components/stepper.d.ts +14 -0
- package/dist/components/stepper.d.ts.map +1 -0
- package/dist/components/stepper.js +45 -0
- package/dist/components/switch.d.ts +20 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +45 -0
- package/dist/components/table.d.ts +14 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +24 -0
- package/dist/components/tabs.d.ts +28 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +76 -0
- package/dist/components/tag.d.ts +20 -0
- package/dist/components/tag.d.ts.map +1 -0
- package/dist/components/tag.js +41 -0
- package/dist/components/tags-input.d.ts +34 -0
- package/dist/components/tags-input.d.ts.map +1 -0
- package/dist/components/tags-input.js +109 -0
- package/dist/components/textarea.d.ts +24 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +77 -0
- package/dist/components/toast.d.ts +36 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +55 -0
- package/dist/components/toggle-group.d.ts +24 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +80 -0
- package/dist/components/toggle.d.ts +15 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +44 -0
- package/dist/components/tooltip.d.ts +26 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +45 -0
- package/dist/index.d.ts +64 -1157
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -4078
- package/package.json +20 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { html as n } from "lit";
|
|
4
|
+
import { property as r } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/switch.ts
|
|
6
|
+
var i = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.checked = !1, this.disabled = !1, this.color = "default", this.size = "md", this._handleClick = () => {
|
|
9
|
+
this.disabled || (this.checked = !this.checked, this.dispatchEvent(new CustomEvent("void-change", {
|
|
10
|
+
bubbles: !0,
|
|
11
|
+
composed: !0,
|
|
12
|
+
detail: { checked: this.checked }
|
|
13
|
+
})));
|
|
14
|
+
}, this._handleKeydown = (e) => {
|
|
15
|
+
(e.key === " " || e.key === "Enter") && !this.disabled && (e.preventDefault(), this._handleClick());
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
super.connectedCallback(), this.setAttribute("role", "switch"), this.setAttribute("tabindex", this.disabled ? "-1" : "0"), this.setAttribute("aria-checked", String(this.checked)), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown);
|
|
20
|
+
}
|
|
21
|
+
disconnectedCallback() {
|
|
22
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("keydown", this._handleKeydown);
|
|
23
|
+
}
|
|
24
|
+
updated(e) {
|
|
25
|
+
e.has("checked") && this.setAttribute("aria-checked", String(this.checked)), e.has("disabled") && (this.setAttribute("aria-disabled", String(this.disabled)), this.setAttribute("tabindex", this.disabled ? "-1" : "0"));
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return n`<span class="void-switch-track"><span class="void-switch-thumb"></span></span>`;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
t([r({
|
|
32
|
+
type: Boolean,
|
|
33
|
+
reflect: !0
|
|
34
|
+
})], i.prototype, "checked", void 0), t([r({
|
|
35
|
+
type: Boolean,
|
|
36
|
+
reflect: !0
|
|
37
|
+
})], i.prototype, "disabled", void 0), t([r({
|
|
38
|
+
type: String,
|
|
39
|
+
reflect: !0
|
|
40
|
+
})], i.prototype, "color", void 0), t([r({
|
|
41
|
+
type: String,
|
|
42
|
+
reflect: !0
|
|
43
|
+
})], i.prototype, "size", void 0), customElements.get("void-switch") || customElements.define("void-switch", i);
|
|
44
|
+
//#endregion
|
|
45
|
+
export { i as VoidSwitch };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Styled data table for admin lists, report grids, and comparison layouts. */
|
|
3
|
+
export declare class VoidTable extends VoidElement {
|
|
4
|
+
striped: boolean;
|
|
5
|
+
hoverable: boolean;
|
|
6
|
+
compact: boolean;
|
|
7
|
+
bordered: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare global {
|
|
10
|
+
interface HTMLElementTagNameMap {
|
|
11
|
+
'void-table': VoidTable;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,+EAA+E;AAC/E,qBAAa,SAAU,SAAQ,WAAW;IACI,OAAO,UAAS;IAChB,SAAS,UAAS;IAClB,OAAO,UAAS;IAChB,QAAQ,UAAS;CAE9D;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { property as n } from "lit/decorators.js";
|
|
4
|
+
//#region src/components/table.ts
|
|
5
|
+
var r = class extends e {
|
|
6
|
+
constructor(...e) {
|
|
7
|
+
super(...e), this.striped = !1, this.hoverable = !1, this.compact = !1, this.bordered = !1;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
t([n({
|
|
11
|
+
type: Boolean,
|
|
12
|
+
reflect: !0
|
|
13
|
+
})], r.prototype, "striped", void 0), t([n({
|
|
14
|
+
type: Boolean,
|
|
15
|
+
reflect: !0
|
|
16
|
+
})], r.prototype, "hoverable", void 0), t([n({
|
|
17
|
+
type: Boolean,
|
|
18
|
+
reflect: !0
|
|
19
|
+
})], r.prototype, "compact", void 0), t([n({
|
|
20
|
+
type: Boolean,
|
|
21
|
+
reflect: !0
|
|
22
|
+
})], r.prototype, "bordered", void 0), customElements.get("void-table") || customElements.define("void-table", r);
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as VoidTable };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Individual tab content panel within a VoidTabs component. */
|
|
3
|
+
export declare class VoidTabPanel extends VoidElement {
|
|
4
|
+
tab: string;
|
|
5
|
+
label: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
protected updated(_changed: Map<string, unknown>): void;
|
|
9
|
+
}
|
|
10
|
+
/** Tabbed section navigation for settings pages, detail views, and parallel content categories. */
|
|
11
|
+
export declare class VoidTabs extends VoidElement {
|
|
12
|
+
value: string;
|
|
13
|
+
size: 'sm' | 'md' | 'lg';
|
|
14
|
+
private _panels;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
private _syncPanels;
|
|
17
|
+
protected updated(_changed: Map<string, unknown>): void;
|
|
18
|
+
render(): import('lit').TemplateResult<1>;
|
|
19
|
+
private _onTabClick;
|
|
20
|
+
private _onTabKeydown;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'void-tab-panel': VoidTabPanel;
|
|
25
|
+
'void-tabs': VoidTabs;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,gEAAgE;AAChE,qBAAa,YAAa,SAAQ,WAAW;IACA,GAAG,SAAM;IACT,KAAK,SAAM;IACV,MAAM,UAAS;IAE3D,iBAAiB,IAAI,IAAI;cAMN,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAMjE;AAMD,mGAAmG;AACnG,qBAAa,QAAS,SAAQ,WAAW;IACX,KAAK,SAAM;IACI,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAE3E,OAAO,CAAC,OAAO,CAAsB;IAErC,iBAAiB,IAAI,IAAI;IAMzB,OAAO,CAAC,WAAW;cAMA,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAOhE,MAAM;IAoBN,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,aAAa;CAYtB;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;QAC/B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { html as n } from "lit";
|
|
4
|
+
import { property as r } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/tabs.ts
|
|
6
|
+
var i = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.tab = "", this.label = "", this.active = !1;
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
super.connectedCallback(), this.setAttribute("role", "tabpanel"), this.tab && (this.id = this.tab);
|
|
12
|
+
}
|
|
13
|
+
updated(e) {
|
|
14
|
+
super.updated(e), this.setAttribute("role", "tabpanel"), e.has("tab") && this.tab && (this.id = this.tab);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
t([r({
|
|
18
|
+
type: String,
|
|
19
|
+
reflect: !0
|
|
20
|
+
})], i.prototype, "tab", void 0), t([r({
|
|
21
|
+
type: String,
|
|
22
|
+
reflect: !0
|
|
23
|
+
})], i.prototype, "label", void 0), t([r({
|
|
24
|
+
type: Boolean,
|
|
25
|
+
reflect: !0
|
|
26
|
+
})], i.prototype, "active", void 0), customElements.get("void-tab-panel") || customElements.define("void-tab-panel", i);
|
|
27
|
+
var a = class extends e {
|
|
28
|
+
constructor(...e) {
|
|
29
|
+
super(...e), this.value = "", this.size = "md", this._panels = [];
|
|
30
|
+
}
|
|
31
|
+
connectedCallback() {
|
|
32
|
+
super.connectedCallback(), this._panels = Array.from(this.querySelectorAll("void-tab-panel")), this._syncPanels();
|
|
33
|
+
}
|
|
34
|
+
_syncPanels() {
|
|
35
|
+
for (let e of this._panels) e.active = e.tab === this.value;
|
|
36
|
+
}
|
|
37
|
+
updated(e) {
|
|
38
|
+
super.updated(e), e.has("value") && this._syncPanels();
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
return n`
|
|
42
|
+
<div class="void-tabs-list" role="tablist">
|
|
43
|
+
${this._panels.map((e, t) => n`
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
class="void-tabs-tab"
|
|
47
|
+
role="tab"
|
|
48
|
+
aria-selected=${e.tab === this.value ? "true" : "false"}
|
|
49
|
+
aria-controls=${e.tab}
|
|
50
|
+
?active=${e.tab === this.value}
|
|
51
|
+
tabindex=${e.tab === this.value ? "0" : "-1"}
|
|
52
|
+
@click=${() => this._onTabClick(e)}
|
|
53
|
+
@keydown=${(e) => this._onTabKeydown(e, t)}
|
|
54
|
+
>${e.label || e.tab}</button>
|
|
55
|
+
`)}
|
|
56
|
+
</div>
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
_onTabClick(e) {
|
|
60
|
+
this.value = e.tab, this.requestUpdate(), this._syncPanels(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
61
|
+
bubbles: !0,
|
|
62
|
+
composed: !0,
|
|
63
|
+
detail: { value: this.value }
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
_onTabKeydown(e, t) {
|
|
67
|
+
let n = Array.from(this.querySelectorAll(".void-tabs-tab"));
|
|
68
|
+
e.key === "ArrowRight" ? (e.preventDefault(), n[(t + 1) % n.length].focus()) : e.key === "ArrowLeft" && (e.preventDefault(), n[(t - 1 + n.length) % n.length].focus());
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
t([r({ type: String })], a.prototype, "value", void 0), t([r({
|
|
72
|
+
type: String,
|
|
73
|
+
reflect: !0
|
|
74
|
+
})], a.prototype, "size", void 0), customElements.get("void-tabs") || customElements.define("void-tabs", a);
|
|
75
|
+
//#endregion
|
|
76
|
+
export { i as VoidTabPanel, a as VoidTabs };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { nothing } from 'lit';
|
|
2
|
+
import { VoidElement } from '../base.js';
|
|
3
|
+
/** Removable label chip for selected filters, applied tags, and multi-value inputs. */
|
|
4
|
+
export declare class VoidTag extends VoidElement {
|
|
5
|
+
color: 'default' | 'error' | 'warning' | 'success' | 'info' | 'notice';
|
|
6
|
+
removable: boolean;
|
|
7
|
+
size: 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
8
|
+
private _userContent;
|
|
9
|
+
private _didSetup;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
protected updated(_changed: Map<string, unknown>): void;
|
|
12
|
+
render(): typeof nothing | import('lit').TemplateResult<1>;
|
|
13
|
+
private _remove;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'void-tag': VoidTag;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/components/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,uFAAuF;AACvF,qBAAa,OAAQ,SAAQ,WAAW;IACK,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAa;IAClF,SAAS,UAAS;IACnB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAQ;IAE1F,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,SAAS,CAAS;IAE1B,iBAAiB,IAAI,IAAI;cAQN,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAehE,MAAM;IAKN,OAAO,CAAC,OAAO;CAIhB;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { html as n, nothing as r } from "lit";
|
|
4
|
+
import { property as i } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/tag.ts
|
|
6
|
+
var a = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.color = "default", this.removable = !1, this.size = "md", this._userContent = [], this._didSetup = !1;
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
super.connectedCallback(), this.setAttribute("role", "listitem"), this._didSetup || (this._userContent = Array.from(this.childNodes));
|
|
12
|
+
}
|
|
13
|
+
updated(e) {
|
|
14
|
+
if (super.updated(e), !this._didSetup) {
|
|
15
|
+
this._didSetup = !0;
|
|
16
|
+
let e = this.querySelector(".void-tag-close");
|
|
17
|
+
for (let t of this._userContent) e ? this.insertBefore(t, e) : this.appendChild(t);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return this.removable ? n`<button type="button" class="void-tag-close" aria-label="Remove" @click="${this._remove}">×</button>` : r;
|
|
22
|
+
}
|
|
23
|
+
_remove() {
|
|
24
|
+
this.dispatchEvent(new CustomEvent("void-remove", {
|
|
25
|
+
bubbles: !0,
|
|
26
|
+
composed: !0
|
|
27
|
+
})), this.remove();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
t([i({
|
|
31
|
+
type: String,
|
|
32
|
+
reflect: !0
|
|
33
|
+
})], a.prototype, "color", void 0), t([i({
|
|
34
|
+
type: Boolean,
|
|
35
|
+
reflect: !0
|
|
36
|
+
})], a.prototype, "removable", void 0), t([i({
|
|
37
|
+
type: String,
|
|
38
|
+
reflect: !0
|
|
39
|
+
})], a.prototype, "size", void 0), customElements.get("void-tag") || customElements.define("void-tag", a);
|
|
40
|
+
//#endregion
|
|
41
|
+
export { a as VoidTag };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
export type TagValue = string | {
|
|
3
|
+
text: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
};
|
|
6
|
+
/** Multi-tag input field for email recipients, category labels, keyword tagging, and comma-separated value entry. */
|
|
7
|
+
export declare class VoidTagsInput extends VoidElement {
|
|
8
|
+
value: TagValue[];
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
readonly: boolean;
|
|
11
|
+
max: number;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
size: 'sm' | 'md' | 'lg';
|
|
14
|
+
color: 'default' | 'error' | 'warning' | 'success' | 'info' | 'notice';
|
|
15
|
+
variant: 'filled' | 'outline';
|
|
16
|
+
allowDuplicates: boolean;
|
|
17
|
+
private _tagText;
|
|
18
|
+
private _tagColor;
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
render(): import('lit').TemplateResult<1>;
|
|
21
|
+
private _focusInput;
|
|
22
|
+
private _onContainerKeydown;
|
|
23
|
+
private _addTag;
|
|
24
|
+
private _removeTag;
|
|
25
|
+
private _onKeydown;
|
|
26
|
+
private _onPaste;
|
|
27
|
+
private _dispatchChange;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
'void-tags-input': VoidTagsInput;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=tags-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags-input.d.ts","sourceRoot":"","sources":["../../src/components/tags-input.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjE,qHAAqH;AACrH,qBAAa,aAAc,SAAQ,WAAW;IACjB,KAAK,EAAE,QAAQ,EAAE,CAAM;IACN,QAAQ,UAAS;IACjB,QAAQ,UAAS;IACjC,GAAG,SAAY;IACf,WAAW,SAAgB;IACZ,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAChC,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAa;IACnF,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAa;IACxD,eAAe,UAAS;IAErD,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,SAAS;IAIjB,iBAAiB,IAAI,IAAI;IAKzB,MAAM;IA2CN,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,eAAe;CASxB;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { html as n, nothing as r } from "lit";
|
|
4
|
+
import { property as i } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/tags-input.ts
|
|
6
|
+
var a = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
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;
|
|
9
|
+
}
|
|
10
|
+
_tagText(e) {
|
|
11
|
+
return typeof e == "string" ? e : e.text;
|
|
12
|
+
}
|
|
13
|
+
_tagColor(e) {
|
|
14
|
+
return typeof e == "string" ? void 0 : e.color;
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
super.connectedCallback(), this.setAttribute("role", "listbox");
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
let e = this.value.length >= this.max;
|
|
21
|
+
return n`
|
|
22
|
+
<div class="void-tags-input" @click=${this._focusInput} @keydown=${this._onContainerKeydown}>
|
|
23
|
+
${this.value.map((e, t) => {
|
|
24
|
+
let i = this._tagText(e);
|
|
25
|
+
return n`
|
|
26
|
+
<span
|
|
27
|
+
class="void-tags-input-tag"
|
|
28
|
+
role="option"
|
|
29
|
+
aria-selected="true"
|
|
30
|
+
data-color=${this._tagColor(e) || r}
|
|
31
|
+
>
|
|
32
|
+
<span class="void-tags-input-tag-text">${i}</span>
|
|
33
|
+
${!this.disabled && !this.readonly ? n`<button
|
|
34
|
+
type="button"
|
|
35
|
+
class="void-tags-input-tag-remove"
|
|
36
|
+
aria-label="Remove ${i}"
|
|
37
|
+
@click=${(e) => {
|
|
38
|
+
e.stopPropagation(), this._removeTag(t);
|
|
39
|
+
}}
|
|
40
|
+
>×</button>` : r}
|
|
41
|
+
</span>
|
|
42
|
+
`;
|
|
43
|
+
})}
|
|
44
|
+
${!e && !this.readonly ? n`<input
|
|
45
|
+
class="void-tags-input-field"
|
|
46
|
+
type="text"
|
|
47
|
+
placeholder=${this.value.length === 0 ? this.placeholder : ""}
|
|
48
|
+
?disabled=${this.disabled}
|
|
49
|
+
@keydown=${this._onKeydown}
|
|
50
|
+
@paste=${this._onPaste}
|
|
51
|
+
/>` : r}
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
_focusInput() {
|
|
56
|
+
this.querySelector(".void-tags-input-field")?.focus();
|
|
57
|
+
}
|
|
58
|
+
_onContainerKeydown(e) {
|
|
59
|
+
e.target === this.querySelector(".void-tags-input") && this._focusInput();
|
|
60
|
+
}
|
|
61
|
+
_addTag(e) {
|
|
62
|
+
let t = e.trim();
|
|
63
|
+
t && (!this.allowDuplicates && this.value.some((e) => this._tagText(e) === t) || this.value.length >= this.max || (this.value = [...this.value, t], this._dispatchChange()));
|
|
64
|
+
}
|
|
65
|
+
_removeTag(e) {
|
|
66
|
+
this.disabled || this.readonly || (this.value = this.value.filter((t, n) => n !== e), this._dispatchChange());
|
|
67
|
+
}
|
|
68
|
+
_onKeydown(e) {
|
|
69
|
+
let t = e.target;
|
|
70
|
+
if (e.key === "Enter" || e.key === ",") {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
let n = (e.key, t.value);
|
|
73
|
+
this._addTag(n), t.value = "";
|
|
74
|
+
} else e.key === "Backspace" && t.value === "" && this.value.length > 0 && this._removeTag(this.value.length - 1);
|
|
75
|
+
}
|
|
76
|
+
_onPaste(e) {
|
|
77
|
+
let t = e.clipboardData?.getData("text") ?? "";
|
|
78
|
+
if (t.includes(",")) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
let n = t.split(",");
|
|
81
|
+
for (let e of n) this._addTag(e);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
_dispatchChange() {
|
|
85
|
+
this.dispatchEvent(new CustomEvent("void-change", {
|
|
86
|
+
bubbles: !0,
|
|
87
|
+
composed: !0,
|
|
88
|
+
detail: { value: this.value }
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
t([i({ type: Array })], a.prototype, "value", void 0), t([i({
|
|
93
|
+
type: Boolean,
|
|
94
|
+
reflect: !0
|
|
95
|
+
})], a.prototype, "disabled", void 0), t([i({
|
|
96
|
+
type: Boolean,
|
|
97
|
+
reflect: !0
|
|
98
|
+
})], a.prototype, "readonly", void 0), t([i({ type: Number })], a.prototype, "max", void 0), t([i({ type: String })], a.prototype, "placeholder", void 0), t([i({
|
|
99
|
+
type: String,
|
|
100
|
+
reflect: !0
|
|
101
|
+
})], a.prototype, "size", void 0), t([i({
|
|
102
|
+
type: String,
|
|
103
|
+
reflect: !0
|
|
104
|
+
})], a.prototype, "color", void 0), t([i({
|
|
105
|
+
type: String,
|
|
106
|
+
reflect: !0
|
|
107
|
+
})], a.prototype, "variant", void 0), t([i({ type: Boolean })], a.prototype, "allowDuplicates", void 0), customElements.get("void-tags-input") || customElements.define("void-tags-input", a);
|
|
108
|
+
//#endregion
|
|
109
|
+
export { a as VoidTagsInput };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Multi-line text entry for comment fields, description inputs, and freeform text that needs more than one line. */
|
|
3
|
+
export declare class VoidTextarea extends VoidElement {
|
|
4
|
+
value: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
readonly: boolean;
|
|
8
|
+
required: boolean;
|
|
9
|
+
name: string;
|
|
10
|
+
rows: number;
|
|
11
|
+
resize: 'none' | 'vertical' | 'both';
|
|
12
|
+
size: 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
13
|
+
error: string;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
render(): import('lit').TemplateResult<1>;
|
|
16
|
+
private _onInput;
|
|
17
|
+
private _onChange;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'void-textarea': VoidTextarea;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/components/textarea.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,qHAAqH;AACrH,qBAAa,YAAa,SAAQ,WAAW;IACf,KAAK,SAAM;IACI,WAAW,SAAM;IAChB,QAAQ,UAAS;IACjB,QAAQ,UAAS;IACjB,QAAQ,UAAS;IAClB,IAAI,SAAM;IACV,IAAI,SAAK;IACT,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAc;IAClD,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAQ;IAC/C,KAAK,SAAM;IAEtD,iBAAiB,IAAI,IAAI;IAMzB,MAAM;IAmBN,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,SAAS;CAKlB;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { html as n } from "lit";
|
|
4
|
+
import { property as r } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/textarea.ts
|
|
6
|
+
var i = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
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 = "";
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
super.connectedCallback(), this.setAttribute("role", "textbox"), this.setAttribute("aria-multiline", "true");
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return n`
|
|
15
|
+
<textarea
|
|
16
|
+
.value=${this.value}
|
|
17
|
+
placeholder=${this.placeholder}
|
|
18
|
+
?disabled=${this.disabled}
|
|
19
|
+
?readonly=${this.readonly}
|
|
20
|
+
?required=${this.required}
|
|
21
|
+
name=${this.name}
|
|
22
|
+
rows=${this.rows}
|
|
23
|
+
style="--void-textarea-resize: ${this.resize}"
|
|
24
|
+
aria-invalid=${this.error ? "true" : "false"}
|
|
25
|
+
@input=${this._onInput}
|
|
26
|
+
@change=${this._onChange}
|
|
27
|
+
></textarea>
|
|
28
|
+
${this.error ? n`<span class="void-textarea-error">${this.error}</span>` : ""}
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
_onInput(e) {
|
|
32
|
+
let t = e.target;
|
|
33
|
+
this.value = t.value, this.dispatchEvent(new CustomEvent("void-input", {
|
|
34
|
+
bubbles: !0,
|
|
35
|
+
composed: !0,
|
|
36
|
+
detail: { value: this.value }
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
_onChange(e) {
|
|
40
|
+
let t = e.target;
|
|
41
|
+
this.value = t.value, this.dispatchEvent(new CustomEvent("void-change", {
|
|
42
|
+
bubbles: !0,
|
|
43
|
+
composed: !0,
|
|
44
|
+
detail: { value: this.value }
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
t([r({ type: String })], i.prototype, "value", void 0), t([r({
|
|
49
|
+
type: String,
|
|
50
|
+
reflect: !0
|
|
51
|
+
})], i.prototype, "placeholder", void 0), t([r({
|
|
52
|
+
type: Boolean,
|
|
53
|
+
reflect: !0
|
|
54
|
+
})], i.prototype, "disabled", void 0), t([r({
|
|
55
|
+
type: Boolean,
|
|
56
|
+
reflect: !0
|
|
57
|
+
})], i.prototype, "readonly", void 0), t([r({
|
|
58
|
+
type: Boolean,
|
|
59
|
+
reflect: !0
|
|
60
|
+
})], i.prototype, "required", void 0), t([r({
|
|
61
|
+
type: String,
|
|
62
|
+
reflect: !0
|
|
63
|
+
})], i.prototype, "name", void 0), t([r({
|
|
64
|
+
type: Number,
|
|
65
|
+
reflect: !0
|
|
66
|
+
})], i.prototype, "rows", void 0), t([r({
|
|
67
|
+
type: String,
|
|
68
|
+
reflect: !0
|
|
69
|
+
})], i.prototype, "resize", void 0), t([r({
|
|
70
|
+
type: String,
|
|
71
|
+
reflect: !0
|
|
72
|
+
})], i.prototype, "size", void 0), t([r({
|
|
73
|
+
type: String,
|
|
74
|
+
reflect: !0
|
|
75
|
+
})], i.prototype, "error", void 0), customElements.get("void-textarea") || customElements.define("void-textarea", i);
|
|
76
|
+
//#endregion
|
|
77
|
+
export { i as VoidTextarea };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Temporary notification for action confirmations, error alerts, and copy-to-clipboard feedback. */
|
|
3
|
+
export declare class VoidToast extends VoidElement {
|
|
4
|
+
color: 'default' | 'error' | 'warning' | 'success' | 'info';
|
|
5
|
+
duration: number;
|
|
6
|
+
dismissable: boolean;
|
|
7
|
+
heading: string;
|
|
8
|
+
private _timer;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
private _close;
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'void-toast': VoidToast;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Container that manages toast positioning and provides a static show() helper for programmatic toast display. */
|
|
20
|
+
export declare class VoidToastContainer extends VoidElement {
|
|
21
|
+
position: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
static show(options: {
|
|
24
|
+
message: string;
|
|
25
|
+
heading?: string;
|
|
26
|
+
color?: VoidToast['color'];
|
|
27
|
+
duration?: number;
|
|
28
|
+
dismissable?: boolean;
|
|
29
|
+
}): VoidToast;
|
|
30
|
+
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
'void-toast-container': VoidToastContainer;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/components/toast.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,qGAAqG;AACrG,qBAAa,SAAU,SAAQ,WAAW;IAExC,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAa;IAGxE,QAAQ,SAAQ;IAGhB,WAAW,UAAQ;IAGnB,OAAO,SAAM;IAEb,OAAO,CAAC,MAAM,CAA4C;IAE1D,iBAAiB;IAQjB,oBAAoB;IAKpB,OAAO,CAAC,MAAM;IAKd,MAAM;CAMP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF;AAED,mHAAmH;AACnH,qBAAa,kBAAmB,SAAQ,WAAW;IAEjD,QAAQ,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,GAAG,eAAe,CAAkB;IAEtH,iBAAiB;IAOjB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,GAAG,SAAS;CAed;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { VoidElement as e } from "../base.js";
|
|
2
|
+
import { t } from "../chunks/decorate-DKuCkHK4.js";
|
|
3
|
+
import { html as n, nothing as r } from "lit";
|
|
4
|
+
import { property as i } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/toast.ts
|
|
6
|
+
var a = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.color = "default", this.duration = 5e3, this.dismissable = !0, this.heading = "";
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
super.connectedCallback(), this.setAttribute("role", "status"), this.duration > 0 && (this._timer = setTimeout(() => this._close(), this.duration));
|
|
12
|
+
}
|
|
13
|
+
disconnectedCallback() {
|
|
14
|
+
super.disconnectedCallback(), clearTimeout(this._timer);
|
|
15
|
+
}
|
|
16
|
+
_close() {
|
|
17
|
+
this.dispatchEvent(new CustomEvent("void-close", {
|
|
18
|
+
bubbles: !0,
|
|
19
|
+
composed: !0
|
|
20
|
+
})), this.remove();
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return n`
|
|
24
|
+
${this.heading ? n`<span class='void-toast-heading'>${this.heading}</span>` : r}
|
|
25
|
+
${this.dismissable ? n`<button type="button" class='void-toast-close' aria-label='Close' @click='${this._close}'>×</button>` : r}
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
t([i({
|
|
30
|
+
type: String,
|
|
31
|
+
reflect: !0
|
|
32
|
+
})], a.prototype, "color", void 0), t([i({ type: Number })], a.prototype, "duration", void 0), t([i({
|
|
33
|
+
type: Boolean,
|
|
34
|
+
reflect: !0
|
|
35
|
+
})], a.prototype, "dismissable", void 0), t([i({ type: String })], a.prototype, "heading", void 0), customElements.get("void-toast") || customElements.define("void-toast", a);
|
|
36
|
+
var o = class extends e {
|
|
37
|
+
constructor(...e) {
|
|
38
|
+
super(...e), this.position = "bottom-right";
|
|
39
|
+
}
|
|
40
|
+
connectedCallback() {
|
|
41
|
+
super.connectedCallback(), this.setAttribute("role", "region"), this.setAttribute("aria-label", "Notifications"), this.setAttribute("aria-live", "polite");
|
|
42
|
+
}
|
|
43
|
+
static show(e) {
|
|
44
|
+
let t = document.querySelector("void-toast-container");
|
|
45
|
+
t || (t = document.createElement("void-toast-container"), document.body.appendChild(t));
|
|
46
|
+
let n = document.createElement("void-toast");
|
|
47
|
+
return e.color !== void 0 && (n.color = e.color), e.heading !== void 0 && (n.heading = e.heading), e.duration !== void 0 && (n.duration = e.duration), e.dismissable !== void 0 && (n.dismissable = e.dismissable), n.textContent = e.message, t.appendChild(n), n;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
t([i({
|
|
51
|
+
type: String,
|
|
52
|
+
reflect: !0
|
|
53
|
+
})], o.prototype, "position", void 0), customElements.get("void-toast-container") || customElements.define("void-toast-container", o);
|
|
54
|
+
//#endregion
|
|
55
|
+
export { a as VoidToast, o as VoidToastContainer };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Multi-button toggle set for text editor toolbars and filter chips where one or many options can be active. */
|
|
3
|
+
export declare class VoidToggleGroup extends VoidElement {
|
|
4
|
+
value: string;
|
|
5
|
+
multiple: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
size: 'sm' | 'md' | 'lg';
|
|
8
|
+
color: 'default' | 'error' | 'warning' | 'success' | 'info' | 'notice';
|
|
9
|
+
orientation: 'horizontal' | 'vertical';
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
updated(changed: Map<string, unknown>): void;
|
|
13
|
+
private _toggles;
|
|
14
|
+
private _selectedValues;
|
|
15
|
+
private _syncToggles;
|
|
16
|
+
private _handleChildChange;
|
|
17
|
+
private _handleKeydown;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'void-toggle-group': VoidToggleGroup;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../src/components/toggle-group.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,iHAAiH;AACjH,qBAAa,eAAgB,SAAQ,WAAW;IACH,KAAK,SAAM;IACV,QAAQ,UAAS;IACjB,QAAQ,UAAS;IAClB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAChC,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAa;IACnF,WAAW,EAAE,YAAY,GAAG,UAAU,CAAgB;IAEjG,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;IAM5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM5C,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,kBAAkB,CA0CxB;IAEF,OAAO,CAAC,cAAc,CAmBpB;CACH;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|