@voidable/ui 0.2.0 → 0.3.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/index.d.ts +1 -0
- package/dist/ui.js +21 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare class VoidAvatar extends VoidElement {
|
|
|
44
44
|
|
|
45
45
|
export declare class VoidBadge extends VoidElement {
|
|
46
46
|
color: 'default' | 'error' | 'warning' | 'success' | 'info' | 'notice' | 'highlight';
|
|
47
|
+
variant: 'filled' | 'outline';
|
|
47
48
|
size: 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
48
49
|
connectedCallback(): void;
|
|
49
50
|
}
|
package/dist/ui.js
CHANGED
|
@@ -18,7 +18,7 @@ function s(e, t, n, r) {
|
|
|
18
18
|
//#region src/components/badge.ts
|
|
19
19
|
var c = class extends o {
|
|
20
20
|
constructor(...e) {
|
|
21
|
-
super(...e), this.color = "default", this.size = "md";
|
|
21
|
+
super(...e), this.color = "default", this.variant = "filled", this.size = "md";
|
|
22
22
|
}
|
|
23
23
|
connectedCallback() {
|
|
24
24
|
super.connectedCallback(), this.setAttribute("role", "status");
|
|
@@ -30,6 +30,9 @@ s([r({
|
|
|
30
30
|
})], c.prototype, "color", void 0), s([r({
|
|
31
31
|
type: String,
|
|
32
32
|
reflect: !0
|
|
33
|
+
})], c.prototype, "variant", void 0), s([r({
|
|
34
|
+
type: String,
|
|
35
|
+
reflect: !0
|
|
33
36
|
})], c.prototype, "size", void 0), customElements.get("void-badge") || customElements.define("void-badge", c);
|
|
34
37
|
//#endregion
|
|
35
38
|
//#region src/components/button.ts
|
|
@@ -323,7 +326,7 @@ var h = class extends o {
|
|
|
323
326
|
}
|
|
324
327
|
render() {
|
|
325
328
|
let e = Math.min(100, Math.max(0, this.value / this.max * 100));
|
|
326
|
-
return t`<div class="void-progress-track"><div class="void-progress-fill" style="
|
|
329
|
+
return t`<div class="void-progress-track"><div class="void-progress-fill" style="--void-progress-fill: ${this.indeterminate ? "0%" : e + "%"}"></div></div>`;
|
|
327
330
|
}
|
|
328
331
|
};
|
|
329
332
|
s([r({
|
|
@@ -455,7 +458,7 @@ var v = class extends o {
|
|
|
455
458
|
?required=${this.required}
|
|
456
459
|
name=${this.name}
|
|
457
460
|
rows=${this.rows}
|
|
458
|
-
style="resize: ${this.resize}"
|
|
461
|
+
style="--void-textarea-resize: ${this.resize}"
|
|
459
462
|
aria-invalid=${this.error ? "true" : "false"}
|
|
460
463
|
@input=${this._onInput}
|
|
461
464
|
@change=${this._onChange}
|
|
@@ -603,8 +606,8 @@ var b = class extends o {
|
|
|
603
606
|
return t`
|
|
604
607
|
<input type="checkbox" .checked=${this.checked} .indeterminate=${this.indeterminate} ?disabled=${this.disabled} name=${this.name} value=${this.value} tabindex="-1" aria-hidden="true" />
|
|
605
608
|
<span class="void-checkbox-box">
|
|
606
|
-
${this.checked ? t`<svg viewBox="0 0 12 12" fill="none"><path d="M2.5 6l2.5 2.5 4.5-5" stroke="currentColor" stroke-width="
|
|
607
|
-
${this.indeterminate && !this.checked ? t`<svg viewBox="0 0 12 12" fill="none"><path d="M3 6h6" stroke="currentColor" stroke-width="
|
|
609
|
+
${this.checked ? t`<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>` : ""}
|
|
610
|
+
${this.indeterminate && !this.checked ? t`<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>` : ""}
|
|
608
611
|
</span>
|
|
609
612
|
`;
|
|
610
613
|
}
|
|
@@ -856,7 +859,7 @@ var T = class extends o {
|
|
|
856
859
|
}}
|
|
857
860
|
>
|
|
858
861
|
<span class="void-multiselect-checkbox">
|
|
859
|
-
${e.selected ? t`<svg viewBox="0 0 12 12" fill="none"><path d="M2.5 6l2.5 2.5 4.5-5" stroke="currentColor" stroke-width="
|
|
862
|
+
${e.selected ? t`<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>` : n}
|
|
860
863
|
</span>
|
|
861
864
|
<span class="void-multiselect-option-label">${e.textContent?.trim() || e.value}</span>
|
|
862
865
|
</div>
|
|
@@ -1072,7 +1075,7 @@ var A = class extends o {
|
|
|
1072
1075
|
>
|
|
1073
1076
|
${this.heading}
|
|
1074
1077
|
<svg class="void-accordion-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
1075
|
-
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="
|
|
1078
|
+
<path d="M6 4l4 4-4 4" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1076
1079
|
</svg>
|
|
1077
1080
|
</button>
|
|
1078
1081
|
<div
|
|
@@ -1227,11 +1230,11 @@ var N = class extends o {
|
|
|
1227
1230
|
<span class="void-stepper-circle"
|
|
1228
1231
|
>${i === "completed" ? t`<svg
|
|
1229
1232
|
viewBox="0 0 12 12"
|
|
1230
|
-
width="
|
|
1231
|
-
height="
|
|
1233
|
+
width="1em"
|
|
1234
|
+
height="1em"
|
|
1232
1235
|
fill="none"
|
|
1233
1236
|
stroke="currentColor"
|
|
1234
|
-
stroke-width="
|
|
1237
|
+
stroke-width="var(--void-icon-stroke-width)"
|
|
1235
1238
|
stroke-linecap="round"
|
|
1236
1239
|
stroke-linejoin="round"
|
|
1237
1240
|
>
|
|
@@ -1396,7 +1399,7 @@ var L = class extends o {
|
|
|
1396
1399
|
};
|
|
1397
1400
|
}
|
|
1398
1401
|
connectedCallback() {
|
|
1399
|
-
this._userContent = Array.from(this.childNodes), super.connectedCallback(), this.
|
|
1402
|
+
this._userContent = Array.from(this.childNodes), super.connectedCallback(), this.addEventListener("mouseenter", this._onMouseEnter), this.addEventListener("mouseleave", this._onMouseLeave), this.addEventListener("focusin", this._onFocusIn), this.addEventListener("focusout", this._onFocusOut);
|
|
1400
1403
|
}
|
|
1401
1404
|
disconnectedCallback() {
|
|
1402
1405
|
super.disconnectedCallback(), clearTimeout(this._timerId), this.removeEventListener("mouseenter", this._onMouseEnter), this.removeEventListener("mouseleave", this._onMouseLeave), this.removeEventListener("focusin", this._onFocusIn), this.removeEventListener("focusout", this._onFocusOut);
|
|
@@ -1469,8 +1472,7 @@ var z = class extends o {
|
|
|
1469
1472
|
let e = this.querySelector(".void-scroll-area-viewport");
|
|
1470
1473
|
for (let t of this._userContent) e.appendChild(t);
|
|
1471
1474
|
}
|
|
1472
|
-
|
|
1473
|
-
t && (t.style.maxHeight = this.maxHeight || "");
|
|
1475
|
+
this.style.setProperty("--void-scroll-area-max-height", this.maxHeight || "");
|
|
1474
1476
|
}
|
|
1475
1477
|
render() {
|
|
1476
1478
|
return t`<div class="void-scroll-area-viewport"></div>`;
|
|
@@ -1964,7 +1966,7 @@ var J = class extends o {
|
|
|
1964
1966
|
aria-label="Send"
|
|
1965
1967
|
>
|
|
1966
1968
|
<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1967
|
-
<path d="M2 8L14 8M14 8L9 3M14 8L9 13" stroke="currentColor" stroke-width="
|
|
1969
|
+
<path d="M2 8L14 8M14 8L9 3M14 8L9 13" stroke="currentColor" stroke-width="var(--void-icon-stroke-width)" stroke-linecap="round" stroke-linejoin="round"/>
|
|
1968
1970
|
</svg>
|
|
1969
1971
|
</button>
|
|
1970
1972
|
</div>
|
|
@@ -1972,7 +1974,9 @@ var J = class extends o {
|
|
|
1972
1974
|
}
|
|
1973
1975
|
_onInput(e) {
|
|
1974
1976
|
let t = e.target;
|
|
1975
|
-
this.value = t.value, t.style.height = "auto"
|
|
1977
|
+
this.value = t.value, t.style.height = "auto";
|
|
1978
|
+
let n = t.scrollHeight;
|
|
1979
|
+
t.style.height = "", this.style.setProperty("--void-compose-input-height", `${n}px`), this.dispatchEvent(new CustomEvent("void-input", {
|
|
1976
1980
|
bubbles: !0,
|
|
1977
1981
|
composed: !0,
|
|
1978
1982
|
detail: { value: this.value }
|
|
@@ -1984,7 +1988,7 @@ var J = class extends o {
|
|
|
1984
1988
|
_onSend() {
|
|
1985
1989
|
if (this.disabled || !this.value) return;
|
|
1986
1990
|
let e = this.value;
|
|
1987
|
-
this.value = "", this._textarea && (this._textarea.style.height = "
|
|
1991
|
+
this.value = "", this._textarea && (this._textarea.style.height = "", this.style.removeProperty("--void-compose-input-height")), this.dispatchEvent(new CustomEvent("void-submit", {
|
|
1988
1992
|
bubbles: !0,
|
|
1989
1993
|
composed: !0,
|
|
1990
1994
|
detail: { value: e }
|
|
@@ -2005,7 +2009,7 @@ s([r({ type: String })], J.prototype, "value", void 0), s([r({
|
|
|
2005
2009
|
//#region src/components/sidebar.ts
|
|
2006
2010
|
var Y = class extends o {
|
|
2007
2011
|
constructor(...e) {
|
|
2008
|
-
super(...e), this.collapsed = !1, this.width = "
|
|
2012
|
+
super(...e), this.collapsed = !1, this.width = "var(--void-sidebar-width)", this.collapsedWidth = "var(--void-sidebar-collapsed-width)", this.position = "left";
|
|
2009
2013
|
}
|
|
2010
2014
|
connectedCallback() {
|
|
2011
2015
|
super.connectedCallback(), this.setAttribute("role", "navigation"), this.setAttribute("aria-label", "Sidebar navigation"), this._updateWidth();
|