@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,145 @@
|
|
|
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/carousel.ts
|
|
6
|
+
var i = class extends e {
|
|
7
|
+
connectedCallback() {
|
|
8
|
+
super.connectedCallback(), this.setAttribute("role", "group"), this.setAttribute("aria-roledescription", "slide");
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
customElements.get("void-carousel-slide") || customElements.define("void-carousel-slide", i);
|
|
12
|
+
var a = class extends e {
|
|
13
|
+
constructor(...e) {
|
|
14
|
+
super(...e), this.active = 0, this.loop = !1, this.autoplay = !1, this.interval = 5e3, this.size = "md", this.controls = !0, this.indicators = !0, this.orientation = "horizontal", this._slides = [], this._autoplayTimer = null, this._userContent = [], this._didSetup = !1, this._prev = () => {
|
|
15
|
+
this._goTo(this.active - 1);
|
|
16
|
+
}, this._next = () => {
|
|
17
|
+
this._goTo(this.active + 1);
|
|
18
|
+
}, this._onMouseEnter = () => {
|
|
19
|
+
this.autoplay && this._stopAutoplay();
|
|
20
|
+
}, this._onMouseLeave = () => {
|
|
21
|
+
this.autoplay && this._startAutoplay();
|
|
22
|
+
}, this._onKeydown = (e) => {
|
|
23
|
+
let t = this.orientation === "horizontal", n = t ? "ArrowLeft" : "ArrowUp", r = t ? "ArrowRight" : "ArrowDown";
|
|
24
|
+
e.key === n ? (e.preventDefault(), this._prev()) : e.key === r && (e.preventDefault(), this._next());
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback(), this._didSetup || (this._userContent = Array.from(this.childNodes)), this.setAttribute("role", "region"), this.setAttribute("aria-roledescription", "carousel"), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), this.addEventListener("keydown", this._onKeydown);
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
super.disconnectedCallback(), this._stopAutoplay(), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("keydown", this._onKeydown);
|
|
32
|
+
}
|
|
33
|
+
updated(e) {
|
|
34
|
+
super.updated(e);
|
|
35
|
+
let t = !1;
|
|
36
|
+
if (!this._didSetup) {
|
|
37
|
+
this._didSetup = !0;
|
|
38
|
+
let e = this.querySelector(".void-carousel-track");
|
|
39
|
+
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
40
|
+
t = !0;
|
|
41
|
+
}
|
|
42
|
+
this._slides = Array.from(this.querySelectorAll("void-carousel-slide")), this._syncSlides(), (e.has("autoplay") || e.has("interval")) && (this._stopAutoplay(), this.autoplay && this._startAutoplay()), this.style.setProperty("--void-carousel-offset", String(this.active)), t && this.requestUpdate();
|
|
43
|
+
}
|
|
44
|
+
_syncSlides() {
|
|
45
|
+
for (let e = 0; e < this._slides.length; e++) {
|
|
46
|
+
let t = this._slides[e];
|
|
47
|
+
t.setAttribute("aria-label", `Slide ${e + 1} of ${this._slides.length}`), e === this.active ? t.setAttribute("active", "") : t.removeAttribute("active");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_goTo(e) {
|
|
51
|
+
let t = this._slides.length;
|
|
52
|
+
if (t === 0) return;
|
|
53
|
+
let n = this.active;
|
|
54
|
+
e = this.loop ? (e % t + t) % t : Math.max(0, Math.min(e, t - 1)), e !== n && (this.active = e, this.requestUpdate(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
55
|
+
bubbles: !0,
|
|
56
|
+
composed: !0,
|
|
57
|
+
detail: {
|
|
58
|
+
index: this.active,
|
|
59
|
+
previous: n
|
|
60
|
+
}
|
|
61
|
+
})));
|
|
62
|
+
}
|
|
63
|
+
_goToSlide(e) {
|
|
64
|
+
this._goTo(e);
|
|
65
|
+
}
|
|
66
|
+
_startAutoplay() {
|
|
67
|
+
this._autoplayTimer ||= setInterval(() => {
|
|
68
|
+
this._next();
|
|
69
|
+
}, this.interval);
|
|
70
|
+
}
|
|
71
|
+
_stopAutoplay() {
|
|
72
|
+
this._autoplayTimer &&= (clearInterval(this._autoplayTimer), null);
|
|
73
|
+
}
|
|
74
|
+
render() {
|
|
75
|
+
let e = this._slides.length, t = !this.loop && this.active === 0, r = !this.loop && this.active === e - 1;
|
|
76
|
+
return n`
|
|
77
|
+
<div class="void-carousel-viewport">
|
|
78
|
+
<div class="void-carousel-track" aria-live="polite"></div>
|
|
79
|
+
</div>
|
|
80
|
+
${this.controls ? n`
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
class="void-carousel-prev"
|
|
84
|
+
aria-label="Previous slide"
|
|
85
|
+
?disabled=${t}
|
|
86
|
+
@click=${this._prev}
|
|
87
|
+
>
|
|
88
|
+
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
89
|
+
<path d="M10 4L6 8l4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
90
|
+
</svg>
|
|
91
|
+
</button>
|
|
92
|
+
<button
|
|
93
|
+
type="button"
|
|
94
|
+
class="void-carousel-next"
|
|
95
|
+
aria-label="Next slide"
|
|
96
|
+
?disabled=${r}
|
|
97
|
+
@click=${this._next}
|
|
98
|
+
>
|
|
99
|
+
<svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
100
|
+
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
101
|
+
</svg>
|
|
102
|
+
</button>
|
|
103
|
+
` : ""}
|
|
104
|
+
${this.indicators ? n`
|
|
105
|
+
<div class="void-carousel-indicators" role="tablist" aria-label="Slide indicators">
|
|
106
|
+
${this._slides.map((e, t) => n`
|
|
107
|
+
<button
|
|
108
|
+
type="button"
|
|
109
|
+
class="void-carousel-dot"
|
|
110
|
+
role="tab"
|
|
111
|
+
aria-selected=${t === this.active ? "true" : "false"}
|
|
112
|
+
aria-label="Go to slide ${t + 1}"
|
|
113
|
+
?active=${t === this.active}
|
|
114
|
+
@click=${() => this._goToSlide(t)}
|
|
115
|
+
></button>
|
|
116
|
+
`)}
|
|
117
|
+
</div>
|
|
118
|
+
` : ""}
|
|
119
|
+
`;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
t([r({
|
|
123
|
+
type: Number,
|
|
124
|
+
reflect: !0
|
|
125
|
+
})], a.prototype, "active", void 0), t([r({
|
|
126
|
+
type: Boolean,
|
|
127
|
+
reflect: !0
|
|
128
|
+
})], a.prototype, "loop", void 0), t([r({
|
|
129
|
+
type: Boolean,
|
|
130
|
+
reflect: !0
|
|
131
|
+
})], a.prototype, "autoplay", void 0), t([r({ type: Number })], a.prototype, "interval", void 0), t([r({
|
|
132
|
+
type: String,
|
|
133
|
+
reflect: !0
|
|
134
|
+
})], a.prototype, "size", void 0), t([r({
|
|
135
|
+
type: Boolean,
|
|
136
|
+
reflect: !0
|
|
137
|
+
})], a.prototype, "controls", void 0), t([r({
|
|
138
|
+
type: Boolean,
|
|
139
|
+
reflect: !0
|
|
140
|
+
})], a.prototype, "indicators", void 0), t([r({
|
|
141
|
+
type: String,
|
|
142
|
+
reflect: !0
|
|
143
|
+
})], a.prototype, "orientation", void 0), customElements.get("void-carousel") || customElements.define("void-carousel", a);
|
|
144
|
+
//#endregion
|
|
145
|
+
export { a as VoidCarousel, i as VoidCarouselSlide };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Grouped multi-option selection for preference forms, filter panels, and permission editors. */
|
|
3
|
+
export declare class VoidCheckboxGroup extends VoidElement {
|
|
4
|
+
label: string;
|
|
5
|
+
orientation: 'vertical' | 'horizontal';
|
|
6
|
+
private _userContent;
|
|
7
|
+
private _didSetup;
|
|
8
|
+
get value(): string[];
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
12
|
+
render(): import('lit').TemplateResult<1>;
|
|
13
|
+
private _handleChildChange;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'void-checkbox-group': VoidCheckboxGroup;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=checkbox-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox-group.d.ts","sourceRoot":"","sources":["../../src/components/checkbox-group.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,kGAAkG;AAClG,qBAAa,iBAAkB,SAAQ,WAAW;IACL,KAAK,SAAM;IACX,WAAW,EAAE,UAAU,GAAG,YAAY,CAAc;IAE/F,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,SAAS,CAAS;IAE1B,IAAI,KAAK,IAAI,MAAM,EAAE,CAEpB;IAED,iBAAiB,IAAI,IAAI;IAUzB,oBAAoB,IAAI,IAAI;cAKT,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAoB/D,MAAM;IAON,OAAO,CAAC,kBAAkB,CASxB;CACH;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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/checkbox-group.ts
|
|
6
|
+
var a = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.label = "", this.orientation = "vertical", this._userContent = [], this._didSetup = !1, this._handleChildChange = (e) => {
|
|
9
|
+
let t = e.target;
|
|
10
|
+
!t.closest("void-checkbox") || t.closest("void-checkbox")?.closest("void-checkbox-group") !== this || (e.stopImmediatePropagation(), this.dispatchEvent(new CustomEvent("void-change", {
|
|
11
|
+
bubbles: !0,
|
|
12
|
+
composed: !0,
|
|
13
|
+
detail: { values: this.value }
|
|
14
|
+
})));
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
get value() {
|
|
18
|
+
return Array.from(this.querySelectorAll("void-checkbox")).filter((e) => e.checked).map((e) => e.value);
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
super.connectedCallback(), this.setAttribute("role", "group"), this.label && this.setAttribute("aria-label", this.label), this._didSetup || (this._userContent = Array.from(this.childNodes)), this.addEventListener("void-change", this._handleChildChange);
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
super.disconnectedCallback(), this.removeEventListener("void-change", this._handleChildChange);
|
|
25
|
+
}
|
|
26
|
+
updated(e) {
|
|
27
|
+
if (super.updated(e), e.has("label") && (this.label ? this.setAttribute("aria-label", this.label) : this.removeAttribute("aria-label")), !this._didSetup) {
|
|
28
|
+
this._didSetup = !0;
|
|
29
|
+
let e = this.querySelector(".void-checkbox-group-items");
|
|
30
|
+
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return n`
|
|
35
|
+
${this.label ? n`<span class="void-checkbox-group-label">${this.label}</span>` : r}
|
|
36
|
+
<div class="void-checkbox-group-items"></div>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
t([i({
|
|
41
|
+
type: String,
|
|
42
|
+
reflect: !0
|
|
43
|
+
})], a.prototype, "label", void 0), t([i({
|
|
44
|
+
type: String,
|
|
45
|
+
reflect: !0
|
|
46
|
+
})], a.prototype, "orientation", void 0), customElements.get("void-checkbox-group") || customElements.define("void-checkbox-group", a);
|
|
47
|
+
//#endregion
|
|
48
|
+
export { a as VoidCheckboxGroup };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Binary or indeterminate selection for form fields, data table row selection, and toggle-able settings. */
|
|
3
|
+
export declare class VoidCheckbox extends VoidElement {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
indeterminate: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
color: 'default' | 'error' | 'warning' | 'success' | 'info' | 'notice';
|
|
10
|
+
size: 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
11
|
+
private _userContent;
|
|
12
|
+
private _didSetup;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
16
|
+
render(): import('lit').TemplateResult<1>;
|
|
17
|
+
private _handleClick;
|
|
18
|
+
private _handleKeydown;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'void-checkbox': VoidCheckbox;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,6GAA6G;AAC7G,qBAAa,YAAa,SAAQ,WAAW;IACC,OAAO,UAAS;IAChB,QAAQ,UAAS;IACjB,aAAa,UAAS;IACvB,IAAI,SAAM;IACV,KAAK,SAAM;IACX,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAa;IACnF,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;IAYzB,oBAAoB,IAAI,IAAI;cAMT,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAqB/D,MAAM;IAUN,OAAO,CAAC,YAAY,CAUlB;IAEF,OAAO,CAAC,cAAc,CAKpB;CACH;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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/checkbox.ts
|
|
6
|
+
var i = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.checked = !1, this.disabled = !1, this.indeterminate = !1, this.name = "", this.value = "", this.color = "default", this.size = "md", this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
|
|
9
|
+
if (this.disabled) {
|
|
10
|
+
e.stopImmediatePropagation();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
this.indeterminate = !1, this.checked = !this.checked;
|
|
14
|
+
let t = this.querySelector("input[type=\"checkbox\"]");
|
|
15
|
+
t && (t.checked = this.checked), this.dispatchEvent(new CustomEvent("void-change", {
|
|
16
|
+
bubbles: !0,
|
|
17
|
+
composed: !0,
|
|
18
|
+
detail: { checked: this.checked }
|
|
19
|
+
}));
|
|
20
|
+
}, this._handleKeydown = (e) => {
|
|
21
|
+
e.key === " " && !this.disabled && (e.preventDefault(), this._handleClick(e));
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
super.connectedCallback(), this.setAttribute("role", "checkbox"), this.setAttribute("tabindex", "0"), this.setAttribute("aria-checked", String(this.checked)), this._didSetup || (this._userContent = Array.from(this.childNodes)), this.addEventListener("click", this._handleClick), this.addEventListener("keydown", this._handleKeydown);
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
super.disconnectedCallback(), this.removeEventListener("click", this._handleClick), this.removeEventListener("keydown", this._handleKeydown);
|
|
29
|
+
}
|
|
30
|
+
updated(e) {
|
|
31
|
+
if (super.updated(e), (e.has("checked") || e.has("indeterminate")) && (this.indeterminate ? this.setAttribute("aria-checked", "mixed") : this.setAttribute("aria-checked", String(this.checked))), e.has("disabled") && (this.setAttribute("aria-disabled", String(this.disabled)), this.setAttribute("tabindex", this.disabled ? "-1" : "0")), !this._didSetup) {
|
|
32
|
+
this._didSetup = !0;
|
|
33
|
+
for (let e of this._userContent) this.appendChild(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return n`
|
|
38
|
+
<input type="checkbox" .checked=${this.checked} .indeterminate=${this.indeterminate} ?disabled=${this.disabled} name=${this.name} value=${this.value} tabindex="-1" aria-hidden="true" />
|
|
39
|
+
<span class="void-checkbox-box">
|
|
40
|
+
${this.checked ? n`<svg viewBox="0 0 12 12" fill="none"><path d="M2.5 6l2.5 2.5 4.5-5" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/></svg>` : ""}
|
|
41
|
+
${this.indeterminate && !this.checked ? n`<svg viewBox="0 0 12 12" fill="none"><path d="M3 6h6" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round"/></svg>` : ""}
|
|
42
|
+
</span>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
t([r({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], i.prototype, "checked", void 0), t([r({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0
|
|
52
|
+
})], i.prototype, "disabled", void 0), t([r({
|
|
53
|
+
type: Boolean,
|
|
54
|
+
reflect: !0
|
|
55
|
+
})], i.prototype, "indeterminate", void 0), t([r({
|
|
56
|
+
type: String,
|
|
57
|
+
reflect: !0
|
|
58
|
+
})], i.prototype, "name", void 0), t([r({
|
|
59
|
+
type: String,
|
|
60
|
+
reflect: !0
|
|
61
|
+
})], i.prototype, "value", void 0), t([r({
|
|
62
|
+
type: String,
|
|
63
|
+
reflect: !0
|
|
64
|
+
})], i.prototype, "color", void 0), t([r({
|
|
65
|
+
type: String,
|
|
66
|
+
reflect: !0
|
|
67
|
+
})], i.prototype, "size", void 0), customElements.get("void-checkbox") || customElements.define("void-checkbox", i);
|
|
68
|
+
//#endregion
|
|
69
|
+
export { i as VoidCheckbox };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Simple expand/collapse panel for FAQ sections, spoiler text, and progressive disclosure of secondary content. */
|
|
3
|
+
export declare class VoidCollapsible extends VoidElement {
|
|
4
|
+
heading: string;
|
|
5
|
+
open: boolean;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
private _id;
|
|
8
|
+
private _userContent;
|
|
9
|
+
private _didSetup;
|
|
10
|
+
connectedCallback(): void;
|
|
11
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
12
|
+
private _handleClick;
|
|
13
|
+
private _handleKeydown;
|
|
14
|
+
render(): import('lit').TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'void-collapsible': VoidCollapsible;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/components/collapsible.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,oHAAoH;AACpH,qBAAa,eAAgB,SAAQ,WAAW;IAClB,OAAO,SAAM;IACG,IAAI,UAAS;IACb,QAAQ,UAAS;IAE7D,OAAO,CAAC,GAAG,CAAuC;IAClD,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,SAAS,CAAS;IAE1B,iBAAiB,IAAI,IAAI;cAON,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAa/D,OAAO,CAAC,YAAY,CASlB;IAEF,OAAO,CAAC,cAAc,CAKpB;IAEF,MAAM;CAwBP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,eAAe,CAAC;KACrC;CACF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
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/collapsible.ts
|
|
6
|
+
var i = class extends e {
|
|
7
|
+
constructor(...e) {
|
|
8
|
+
super(...e), this.heading = "", this.open = !1, this.disabled = !1, this._id = Math.random().toString(36).slice(2), this._userContent = [], this._didSetup = !1, this._handleClick = (e) => {
|
|
9
|
+
e.preventDefault(), !this.disabled && (this.open = !this.open, this.dispatchEvent(new CustomEvent("void-toggle", {
|
|
10
|
+
bubbles: !0,
|
|
11
|
+
composed: !0,
|
|
12
|
+
detail: { open: this.open }
|
|
13
|
+
})));
|
|
14
|
+
}, this._handleKeydown = (e) => {
|
|
15
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), this._handleClick(e));
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
super.connectedCallback(), this._didSetup || (this._userContent = Array.from(this.childNodes));
|
|
20
|
+
}
|
|
21
|
+
updated(e) {
|
|
22
|
+
if (super.updated(e), !this._didSetup) {
|
|
23
|
+
this._didSetup = !0;
|
|
24
|
+
let e = this.querySelector(".void-collapsible-inner");
|
|
25
|
+
if (e) for (let t of this._userContent) e.appendChild(t);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return n`
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
id="trigger-${this._id}"
|
|
33
|
+
class="void-collapsible-trigger"
|
|
34
|
+
aria-expanded=${String(this.open)}
|
|
35
|
+
aria-controls="content-${this._id}"
|
|
36
|
+
@click=${this._handleClick}
|
|
37
|
+
@keydown=${this._handleKeydown}
|
|
38
|
+
>
|
|
39
|
+
${this.heading}
|
|
40
|
+
<svg class="void-collapsible-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
41
|
+
<path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
42
|
+
</svg>
|
|
43
|
+
</button>
|
|
44
|
+
<div
|
|
45
|
+
id="content-${this._id}"
|
|
46
|
+
class="void-collapsible-content"
|
|
47
|
+
role="region"
|
|
48
|
+
aria-labelledby="trigger-${this._id}"
|
|
49
|
+
><div class="void-collapsible-inner"></div></div>
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
t([r({ type: String })], i.prototype, "heading", void 0), t([r({
|
|
54
|
+
type: Boolean,
|
|
55
|
+
reflect: !0
|
|
56
|
+
})], i.prototype, "open", void 0), t([r({
|
|
57
|
+
type: Boolean,
|
|
58
|
+
reflect: !0
|
|
59
|
+
})], i.prototype, "disabled", void 0), customElements.get("void-collapsible") || customElements.define("void-collapsible", i);
|
|
60
|
+
//#endregion
|
|
61
|
+
export { i as VoidCollapsible };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { VoidElement } from '../base.js';
|
|
2
|
+
/** Color selection control with spectrum area, hue slider, hex input, and preset swatches for theme customization and design tools. */
|
|
3
|
+
export declare class VoidColorPicker extends VoidElement {
|
|
4
|
+
value: string;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
size: 'sm' | 'md' | 'lg';
|
|
7
|
+
swatches: string[];
|
|
8
|
+
showInput: boolean;
|
|
9
|
+
variant: 'default' | 'compact';
|
|
10
|
+
open: boolean;
|
|
11
|
+
private _hue;
|
|
12
|
+
private _saturation;
|
|
13
|
+
private _brightness;
|
|
14
|
+
private _dragging;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
private _boundPointerMove;
|
|
18
|
+
private _boundPointerUp;
|
|
19
|
+
private _applyCustomProperties;
|
|
20
|
+
private _hsvToRgb;
|
|
21
|
+
private _hsvToHex;
|
|
22
|
+
private _hexToRgb;
|
|
23
|
+
private _rgbToHsv;
|
|
24
|
+
private _syncFromHex;
|
|
25
|
+
static isValidHex(hex: string): boolean;
|
|
26
|
+
private _updateValue;
|
|
27
|
+
private _onAreaPointerDown;
|
|
28
|
+
private _onHuePointerDown;
|
|
29
|
+
private _onPointerMove;
|
|
30
|
+
private _onPointerUp;
|
|
31
|
+
private _updateAreaFromPointer;
|
|
32
|
+
private _updateHueFromPointer;
|
|
33
|
+
private _onHexInput;
|
|
34
|
+
private _onSwatchClick;
|
|
35
|
+
private _onCompactTriggerClick;
|
|
36
|
+
private _onCompactHexInput;
|
|
37
|
+
private _onDocumentClick;
|
|
38
|
+
protected updated(changed: Map<string, unknown>): void;
|
|
39
|
+
private _renderPicker;
|
|
40
|
+
render(): import('lit').TemplateResult<1>;
|
|
41
|
+
}
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
'void-color-picker': VoidColorPicker;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=color-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../src/components/color-picker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,uIAAuI;AACvI,qBAAa,eAAgB,SAAQ,WAAW;IACH,KAAK,EAAE,MAAM,CAAa;IACzB,QAAQ,EAAE,OAAO,CAAS;IAC3B,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAChD,QAAQ,EAAE,MAAM,EAAE,CAAM;IACP,SAAS,EAAE,OAAO,CAAQ;IAC3B,OAAO,EAAE,SAAS,GAAG,SAAS,CAAa;IAC1C,IAAI,EAAE,OAAO,CAAS;IAElE,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,SAAS,CAA+B;IAEhD,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAM5B,OAAO,CAAC,iBAAiB,CAA4C;IACrE,OAAO,CAAC,eAAe,CAA4C;IAEnE,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,SAAS;IAsBjB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,SAAS;IAsBjB,OAAO,CAAC,YAAY;IASpB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,sBAAsB;IAW9B,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,WAAW;IAenB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,gBAAgB,CAKtB;cAEiB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAe/D,OAAO,CAAC,aAAa;IAiDrB,MAAM;CAkCP;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|