@threadlabs/looma 0.26.15 → 0.26.17
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/components/ui-meter/ui-meter.html +59 -8
- package/components/ui-text/ui-text.html +15 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/styles/ui-meter.css +34 -0
- package/styles/ui-text.css +16 -0
- package/vanilla/UiMeter.d.ts +2 -0
- package/vanilla/UiMeter.js +136 -38
- package/vanilla/UiText.d.ts +1 -0
- package/vanilla/UiText.js +25 -25
- package/vue/UiMeter.d.ts +27 -0
- package/vue/UiMeter.vue +514 -77
- package/vue/UiText.d.ts +9 -0
- package/vue/UiText.vue +41 -0
- package/vue/chunks/UiMeter.js +271 -57
- package/vue/chunks/UiText.js +43 -1
- package/vue/components.css +86 -49
package/package.json
CHANGED
package/styles/ui-meter.css
CHANGED
|
@@ -122,6 +122,34 @@
|
|
|
122
122
|
--_meter-gap: var(--ui-space-0-5);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
/* A categorical distribution uses flex ratios, avoiding rounded percentages and retaining
|
|
126
|
+
identical geometry before hydration. It has no progress mask or growing-value animation. */
|
|
127
|
+
:scope[data-ui-meter-state~="variant=distribution"] {
|
|
128
|
+
display: flex;
|
|
129
|
+
inline-size: 100%;
|
|
130
|
+
block-size: var(--ui-space-4);
|
|
131
|
+
gap: var(--ui-space-0-5);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:scope[data-ui-meter-state~="variant=distribution"][size="sm"] {
|
|
135
|
+
block-size: var(--ui-space-2);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.part {
|
|
139
|
+
flex-basis: 0;
|
|
140
|
+
min-inline-size: 0;
|
|
141
|
+
block-size: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@media (forced-colors: active) {
|
|
145
|
+
.part {
|
|
146
|
+
forced-color-adjust: none;
|
|
147
|
+
background: CanvasText !important;
|
|
148
|
+
outline: var(--ui-border-width) solid Canvas;
|
|
149
|
+
outline-offset: calc(-1 * var(--ui-border-width));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
125
153
|
/* Forced colours drop backgrounds: draw the fill in the text colour inside the outlined track. */
|
|
126
154
|
@media (forced-colors: active) {
|
|
127
155
|
.fill {
|
|
@@ -163,6 +191,12 @@
|
|
|
163
191
|
attribute to every meter), so a continuous meter renders exactly as before, and the rules below
|
|
164
192
|
turn it into a number. That caps it at 12, until attr() with a type reads any count in every engine. */
|
|
165
193
|
|
|
194
|
+
/* A categorical distribution uses flex ratios, avoiding rounded percentages and retaining
|
|
195
|
+
identical geometry before hydration. It has no progress mask or growing-value animation. */
|
|
196
|
+
|
|
197
|
+
@media (forced-colors: active) {
|
|
198
|
+
}
|
|
199
|
+
|
|
166
200
|
/* Forced colours drop backgrounds: draw the fill in the text colour inside the outlined track. */
|
|
167
201
|
@media (forced-colors: active) {
|
|
168
202
|
|
package/styles/ui-text.css
CHANGED
|
@@ -38,6 +38,12 @@
|
|
|
38
38
|
line-height: var(--ui-line-height-relaxed);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/* Opt in at the text owner; trimming does not inherit from a surrounding layout. */
|
|
42
|
+
:scope[data-ui-text-state~="trim"] {
|
|
43
|
+
text-box-trim: trim-both;
|
|
44
|
+
text-box-edge: cap alphabetic;
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
:scope[data-ui-text-state~="tone=secondary"] {
|
|
42
48
|
color: var(--ui-text-secondary);
|
|
43
49
|
}
|
|
@@ -91,6 +97,12 @@
|
|
|
91
97
|
white-space: nowrap;
|
|
92
98
|
}
|
|
93
99
|
|
|
100
|
+
/* Trim ends the layout box at the baseline; preserve descending ink while clipping long labels. */
|
|
101
|
+
:scope[data-ui-text-state~="trim"][data-ui-text-state~="truncate"] {
|
|
102
|
+
overflow-x: clip;
|
|
103
|
+
overflow-y: visible;
|
|
104
|
+
}
|
|
105
|
+
|
|
94
106
|
:scope[data-ui-text-state~="align=center"] {
|
|
95
107
|
text-align: center;
|
|
96
108
|
}
|
|
@@ -115,6 +127,8 @@
|
|
|
115
127
|
|
|
116
128
|
/* A heading drops the browser's heading size and weight, so size and weight set it as they set
|
|
117
129
|
any text, and inherit keeps the text around it. */
|
|
130
|
+
|
|
131
|
+
/* Opt in at the text owner; trimming does not inherit from a surrounding layout. */
|
|
118
132
|
/* Every status tone uses the text-safe token a subtle badge sets its words in, so text and badges
|
|
119
133
|
in one tone match, and each holds 4.5:1 on sunken surfaces where some base colours fall short. */
|
|
120
134
|
|
|
@@ -127,5 +141,7 @@
|
|
|
127
141
|
text-underline-offset: 0.18em;
|
|
128
142
|
}
|
|
129
143
|
|
|
144
|
+
/* Trim ends the layout box at the baseline; preserve descending ink while clipping long labels. */
|
|
145
|
+
|
|
130
146
|
/* A component that sets its display still honours the hidden attribute on its root. */
|
|
131
147
|
}
|
package/vanilla/UiMeter.d.ts
CHANGED
|
@@ -8,11 +8,13 @@ export interface UiMeterElement extends HTMLSpanElement {
|
|
|
8
8
|
export interface UiMeterProps {
|
|
9
9
|
label?: string | null;
|
|
10
10
|
max?: number | null;
|
|
11
|
+
parts?: readonly ({ readonly value: number; readonly color: string })[] | null;
|
|
11
12
|
segments?: number | null;
|
|
12
13
|
size?: "sm" | "md" | null;
|
|
13
14
|
tone?: "neutral" | "accent" | "info" | "success" | "warning" | "danger" | null;
|
|
14
15
|
value?: number | null;
|
|
15
16
|
valueText?: string | null;
|
|
17
|
+
variant?: "progress" | "distribution" | null;
|
|
16
18
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
17
19
|
children?: readonly (string | Node)[];
|
|
18
20
|
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
package/vanilla/UiMeter.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.35 for Vanilla DOM. Do not edit.
|
|
2
|
-
import { attachGeneratedController, binaryValue, buildTemplate, formatCall, mathCall, NONCONFORMING, readIndex, recordValue, textCall, toAttribute, toText, writeAttribute, computedCycle, formatOf, keywordFormat, hostState, acceptProps, manageProps, readonlyView, checkFormat, checkNumber, checkString } from "@nextwebwg/html-next/generated-runtime";
|
|
2
|
+
import { attachGeneratedController, binaryValue, buildTemplate, clearRegion, formatCall, mathCall, NONCONFORMING, readIndex, readMember, readsChanged, rec, recordValue, textCall, toAttribute, toText, trackContainer, truthy, writeAttribute, computedCycle, formatOf, keywordFormat, hostState, acceptProps, manageProps, RangedIndexedList, readonlyView, checkFormat, checkList, checkNumber, checkObject, checkString } from "@nextwebwg/html-next/generated-runtime";
|
|
3
3
|
import "../styles/ui-meter.css";
|
|
4
4
|
|
|
5
|
-
const T0 = ["",[],
|
|
6
|
-
|
|
5
|
+
const T0 = ["",[],1,1];
|
|
6
|
+
const T1 = ["span",["class","fill"]];
|
|
7
|
+
const T2 = ["",[],2];
|
|
8
|
+
const T3 = ["",[],1];
|
|
9
|
+
const T4 = ["span",["class","part","aria-hidden","true"]];
|
|
10
|
+
let P0, P1, P2, P3, P4;
|
|
11
|
+
const E = new Map();
|
|
7
12
|
const S = { n: ["amount","percent"], t: ["?","?"], f: import.meta.url, g: "ui-meter", k: 0, r: readonlyView };
|
|
8
|
-
const D = { props: { "label": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "max": { "required":false,"default":1, c: checkNumber, t: "number", j: 0, m: "n" }, "segments": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "size": { "required":false,"values":["sm","md"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "tone": { "required":false,"values":["neutral","accent","info","success","warning","danger"],"default":"neutral", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "value": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "valueText": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" } } };
|
|
13
|
+
const D = { props: { "label": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "max": { "required":false,"default":1, c: checkNumber, t: "number", j: 0, m: "n" }, "parts": { "required":false,"default":[], c: checkList(checkObject([["value", checkNumber, false], ["color", checkString, false]], false)), j: 1, m: ["l",["o",["value","n","color","s"]]] }, "segments": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "size": { "required":false,"values":["sm","md"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "tone": { "required":false,"values":["neutral","accent","info","success","warning","danger"],"default":"neutral", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "value": { "required":false,"default":0, c: checkNumber, t: "number", j: 0, m: "n" }, "valueText": { "required":false,"default":"", c: checkString, t: "string", j: 0, m: "s" }, "variant": { "required":false,"values":["progress","distribution"],"default":"progress", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] } } };
|
|
9
14
|
|
|
10
15
|
export function createUiMeter(options = {}, html) {
|
|
11
16
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -14,15 +19,13 @@ export function createUiMeter(options = {}, html) {
|
|
|
14
19
|
if (value === null || value === undefined || value === false) continue;
|
|
15
20
|
element.setAttribute(name, value === true ? "" : String(value));
|
|
16
21
|
}
|
|
17
|
-
if (!element.hasAttribute("role")) element.setAttribute("role", "meter");
|
|
18
|
-
if (!element.hasAttribute("aria-valuemin")) element.setAttribute("aria-valuemin", "0");
|
|
19
22
|
element.setAttribute("data-component", "ui-meter");
|
|
20
23
|
element.append((P0 ??= buildTemplate(T0)).cloneNode(true));
|
|
21
|
-
const v = [undefined, undefined, null, null, null, null, null, null, null];
|
|
24
|
+
const v = [undefined, undefined, null, null, null, null, null, null, null, null, null];
|
|
22
25
|
const B = acceptProps(element, D, S.n, v, componentProps, [], html);
|
|
23
26
|
const X = { e: 0, g: (j) => g(j), w: new Set() };
|
|
24
27
|
const ke = [];
|
|
25
|
-
const K = [() => mathCall("clamp", [0, v[
|
|
28
|
+
const K = [() => mathCall("clamp", [0, v[8], v[3]], undefined, []), () => readIndex(recordValue(["true","false"], [binaryValue("*", binaryValue("/", g(0), v[3]), 100), 0]), textCall("concat", [binaryValue(">", v[3], 0)]))];
|
|
26
29
|
const g = (j) => {
|
|
27
30
|
const i = j - 0;
|
|
28
31
|
if (ke[i] === X.e) return v[j];
|
|
@@ -35,55 +38,150 @@ export function createUiMeter(options = {}, html) {
|
|
|
35
38
|
if (!Object.is(previous, next)) { v[j] = next; X.n?.(j, previous, next); }
|
|
36
39
|
return next;
|
|
37
40
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const m1 = (d) => {
|
|
42
|
+
const n = (P1 ??= buildTemplate(T1)).cloneNode(true);
|
|
43
|
+
const r = { n, v0: undefined };
|
|
44
|
+
p1(r, -1, d);
|
|
45
|
+
return r;
|
|
46
|
+
};
|
|
47
|
+
const p1 = (r, c, d) => {
|
|
48
|
+
if (c & 1073742088) {
|
|
49
|
+
const x0 = textCall("concat", [g(1), "%"]);
|
|
50
|
+
if (x0 !== NONCONFORMING) {
|
|
51
|
+
const s0 = toText(x0);
|
|
52
|
+
if (s0 !== r.v0) r.n.style.setProperty("inline-size", r.v0 = s0);
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
};
|
|
56
|
+
const m2 = (d) => {
|
|
57
|
+
const n = (P2 ??= buildTemplate(T2)).cloneNode(true);
|
|
58
|
+
const t0 = n.firstChild;
|
|
59
|
+
const r = { n, L0: new RangedIndexedList(t0, t0.nextSibling, m3, p3, undefined, "part") };
|
|
60
|
+
p2(r, -1, d);
|
|
61
|
+
return r;
|
|
62
|
+
};
|
|
63
|
+
const p2 = (r, c, d) => {
|
|
64
|
+
if (c & 1073741840) r.L0.update(v[4], d, c);
|
|
65
|
+
};
|
|
66
|
+
const m3 = (o, j, l) => {
|
|
67
|
+
const n = (P3 ??= buildTemplate(T3)).cloneNode(true);
|
|
68
|
+
const t0 = n.firstChild;
|
|
69
|
+
const s = document.createComment("html-next:item-start"), t = document.createComment("html-next:item-end");
|
|
70
|
+
n.prepend(s);
|
|
71
|
+
n.append(t);
|
|
72
|
+
const r = { k: undefined, i: o, n: s, t, x: 0, y: 0, a0: t0, e0: t0.nextSibling, b0: undefined, q0: undefined };
|
|
73
|
+
p3(r, -1, E);
|
|
74
|
+
return r;
|
|
75
|
+
};
|
|
76
|
+
const p3 = (r, c, d) => {
|
|
77
|
+
const o = r.i;
|
|
78
|
+
if (c & 1073741824) {
|
|
79
|
+
const f0 = [];
|
|
80
|
+
const t0 = (truthy(binaryValue(">", rec(f0, readMember(rec(f0, o), "value")), 0)) && (binaryValue("-", rec(f0, readMember(rec(f0, o), "value")), rec(f0, readMember(rec(f0, o), "value"))) === 0));
|
|
81
|
+
if (c === -1 || readsChanged(r.q0, f0)) {
|
|
82
|
+
r.q0 = f0;
|
|
83
|
+
{
|
|
84
|
+
r.b0 = undefined;
|
|
85
|
+
clearRegion(r.a0, r.e0);
|
|
86
|
+
if (t0) { r.b0 = m4(d, undefined, r); r.e0.before(r.b0.n); }
|
|
87
|
+
}
|
|
88
|
+
} else if (r.b0 !== undefined) p4(r.b0, c, d);
|
|
89
|
+
} else if (r.b0 !== undefined) p4(r.b0, c, d);
|
|
90
|
+
};
|
|
91
|
+
const m4 = (d, o, u) => {
|
|
92
|
+
const n = (P4 ??= buildTemplate(T4)).cloneNode(true);
|
|
93
|
+
const r = { n, u, w: 0, v0: undefined, v1: undefined };
|
|
94
|
+
p4(r, -1, d);
|
|
95
|
+
return r;
|
|
96
|
+
};
|
|
97
|
+
const p4 = (r, c, d) => {
|
|
98
|
+
if (c & 1073741824) {
|
|
99
|
+
r.w = 0;
|
|
100
|
+
const x0 = trackContainer(r, readMember(r.u.i, "value"));
|
|
101
|
+
const s0 = toText(x0);
|
|
102
|
+
if (s0 !== r.v0) r.n.style.setProperty("flex-grow", r.v0 = s0);
|
|
103
|
+
const x1 = trackContainer(r, readMember(r.u.i, "color"));
|
|
104
|
+
const s1 = toText(x1);
|
|
105
|
+
if (s1 !== r.v1) r.n.style.setProperty("background-color", r.v1 = s1);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const p0 = (r, c, d) => {
|
|
109
|
+
if (c & 1073742848) {
|
|
110
|
+
const x0 = readIndex({ "true": "img", "false": "meter" }, textCall("concat", [(v[10] === "distribution")]));
|
|
111
|
+
if (x0 !== NONCONFORMING) {
|
|
112
|
+
const s0 = toAttribute(x0, "role");
|
|
113
|
+
if (s0 !== r.v0) writeAttribute(r.n, "role", r.v0 = s0);
|
|
114
|
+
}
|
|
115
|
+
const x1 = readIndex({ "true": null, "false": 0 }, textCall("concat", [(v[10] === "distribution")]));
|
|
46
116
|
if (x1 !== NONCONFORMING) {
|
|
47
|
-
const s1 = toAttribute(x1, "aria-
|
|
48
|
-
if (s1 !== r.v1) writeAttribute(r.n, "aria-
|
|
117
|
+
const s1 = toAttribute(x1, "aria-valuemin");
|
|
118
|
+
if (s1 !== r.v1) writeAttribute(r.n, "aria-valuemin", r.v1 = s1);
|
|
49
119
|
}
|
|
50
120
|
}
|
|
51
|
-
if (c &
|
|
52
|
-
const x2 = readIndex(
|
|
121
|
+
if (c & 1073742856) {
|
|
122
|
+
const x2 = readIndex({ "true": null, "false": v[3] }, textCall("concat", [(v[10] === "distribution")]));
|
|
53
123
|
if (x2 !== NONCONFORMING) {
|
|
54
|
-
const s2 = toAttribute(x2, "aria-
|
|
55
|
-
if (s2 !== r.v2) writeAttribute(r.n, "aria-
|
|
124
|
+
const s2 = toAttribute(x2, "aria-valuemax");
|
|
125
|
+
if (s2 !== r.v2) writeAttribute(r.n, "aria-valuemax", r.v2 = s2);
|
|
56
126
|
}
|
|
57
127
|
}
|
|
58
|
-
if (c &
|
|
59
|
-
const x3 = readIndex(
|
|
128
|
+
if (c & 1073743112) {
|
|
129
|
+
const x3 = readIndex(recordValue(["true","false"], [null, g(0)]), textCall("concat", [(v[10] === "distribution")]));
|
|
60
130
|
if (x3 !== NONCONFORMING) {
|
|
61
|
-
const s3 = toAttribute(x3, "aria-
|
|
62
|
-
if (s3 !== r.v3) writeAttribute(r.n, "aria-
|
|
131
|
+
const s3 = toAttribute(x3, "aria-valuenow");
|
|
132
|
+
if (s3 !== r.v3) writeAttribute(r.n, "aria-valuenow", r.v3 = s3);
|
|
63
133
|
}
|
|
64
134
|
}
|
|
65
|
-
if (c &
|
|
66
|
-
const x4 = readIndex(
|
|
135
|
+
if (c & 1073743624) {
|
|
136
|
+
const x4 = readIndex(recordValue(["true","false"], [null, readIndex(recordValue(["true","false"], [v[9], formatCall("format", [binaryValue("/", g(1), 100), "percent", { "maximumFractionDigits": 0 }], "number")]), textCall("concat", [(v[9] !== "")]))]), textCall("concat", [(v[10] === "distribution")]));
|
|
67
137
|
if (x4 !== NONCONFORMING) {
|
|
68
|
-
const s4 = toAttribute(x4, "
|
|
69
|
-
if (s4 !== r.v4) writeAttribute(r.n, "
|
|
138
|
+
const s4 = toAttribute(x4, "aria-valuetext");
|
|
139
|
+
if (s4 !== r.v4) writeAttribute(r.n, "aria-valuetext", r.v4 = s4);
|
|
70
140
|
}
|
|
71
141
|
}
|
|
72
|
-
if (c &
|
|
73
|
-
const x5 = textCall("concat", [
|
|
142
|
+
if (c & 1073743364) {
|
|
143
|
+
const x5 = readIndex(recordValue(["true","false"], [readIndex(recordValue(["true","false"], [textCall("concat", [v[2], ": ", v[9]]), v[2]]), textCall("concat", [((v[10] === "distribution") && (v[9] !== ""))])), null]), textCall("concat", [(v[2] !== "")]));
|
|
74
144
|
if (x5 !== NONCONFORMING) {
|
|
75
|
-
const s5 =
|
|
76
|
-
if (s5 !== r.v5) r.
|
|
145
|
+
const s5 = toAttribute(x5, "aria-label");
|
|
146
|
+
if (s5 !== r.v5) writeAttribute(r.n, "aria-label", r.v5 = s5);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (c & 1073742880) {
|
|
150
|
+
const x6 = readIndex({ "true": v[5], "false": null }, textCall("concat", [((v[10] === "progress") && truthy(binaryValue(">", v[5], 1)))]));
|
|
151
|
+
if (x6 !== NONCONFORMING) {
|
|
152
|
+
const s6 = toAttribute(x6, "data-ui-meter-segments");
|
|
153
|
+
if (s6 !== r.v6) writeAttribute(r.n, "data-ui-meter-segments", r.v6 = s6);
|
|
77
154
|
}
|
|
78
155
|
}
|
|
79
|
-
if (c &
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
156
|
+
if (c & 1216) {
|
|
157
|
+
const x7 = hostState(["size","tone","variant"], [v[6], v[7], v[10]]);
|
|
158
|
+
const s7 = x7;
|
|
159
|
+
if (s7 !== r.v7) writeAttribute(r.n, "data-ui-meter-state", (r.v7 = s7) === "" ? null : s7);
|
|
83
160
|
}
|
|
161
|
+
if (c & 1024) {
|
|
162
|
+
const t0 = (v[10] === "progress");
|
|
163
|
+
if (true) {
|
|
164
|
+
{
|
|
165
|
+
r.b0 = undefined;
|
|
166
|
+
clearRegion(r.a1, r.e0);
|
|
167
|
+
if (t0) { r.b0 = m1(d); r.e0.before(r.b0.n); }
|
|
168
|
+
}
|
|
169
|
+
} else if (r.b0 !== undefined) p1(r.b0, c, d);
|
|
170
|
+
} else if (r.b0 !== undefined) p1(r.b0, c, d);
|
|
171
|
+
if (c & 1024) {
|
|
172
|
+
const t1 = (v[10] === "distribution");
|
|
173
|
+
if (true) {
|
|
174
|
+
{
|
|
175
|
+
r.b1 = undefined;
|
|
176
|
+
clearRegion(r.a2, r.e1);
|
|
177
|
+
if (t1) { r.b1 = m2(d); r.e1.before(r.b1.n); }
|
|
178
|
+
}
|
|
179
|
+
} else if (r.b1 !== undefined) p2(r.b1, c, d);
|
|
180
|
+
} else if (r.b1 !== undefined) p2(r.b1, c, d);
|
|
84
181
|
};
|
|
85
182
|
const t0 = element.firstChild;
|
|
86
|
-
const
|
|
183
|
+
const t1 = t0.nextSibling.nextSibling;
|
|
184
|
+
const R = { n: element, v0: undefined, v1: undefined, v2: undefined, v3: undefined, v4: undefined, v5: undefined, v6: undefined, v7: undefined, a1: t0, e0: t0.nextSibling, b0: undefined, a2: t1, e1: t1.nextSibling, b1: undefined };
|
|
87
185
|
const I = { B };
|
|
88
186
|
attachGeneratedController(element, S, v, ((c, d) => p0(R, c, d)), undefined, X, I);
|
|
89
187
|
manageProps(I);
|
package/vanilla/UiText.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface UiTextProps {
|
|
|
12
12
|
grow?: boolean | null;
|
|
13
13
|
size?: "inherit" | "xs" | "sm" | "md" | "lg" | null;
|
|
14
14
|
tone?: "default" | "secondary" | "muted" | "accent" | "danger" | "success" | "info" | "warning" | null;
|
|
15
|
+
trim?: boolean | null;
|
|
15
16
|
truncate?: boolean | null;
|
|
16
17
|
variant?: "body" | "eyebrow" | "code" | null;
|
|
17
18
|
weight?: "inherit" | "normal" | "medium" | "semibold" | null;
|
package/vanilla/UiText.js
CHANGED
|
@@ -26,13 +26,13 @@ const T20 = ["",[],4];
|
|
|
26
26
|
const T21 = ["",[]];
|
|
27
27
|
let P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21;
|
|
28
28
|
const S = { n: [], t: [], f: import.meta.url, g: "ui-text" };
|
|
29
|
-
const A = [["span",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["div",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["small",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["strong",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["label",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["h2",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["h3",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["h4",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["h5",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["h6",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]],["p",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-truncate","data-variant","data-weight","data-wrap"]]];
|
|
29
|
+
const A = [["span",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["div",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["small",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["strong",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["label",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["h2",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["h3",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["h4",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["h5",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["h6",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]],["p",{},[],"",[],["data-ui-text-state","data-align","data-as","data-font","data-grow","data-size","data-tone","data-trim","data-truncate","data-variant","data-weight","data-wrap"]]];
|
|
30
30
|
const Q = [[],[],[],[],[],[],[],[],[],[],[]];
|
|
31
|
-
const D = { props: { "align": { "required":false,"values":["start","center"],"default":"start", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "as": { "required":false,"values":["p","span","div","small","strong","label","h2","h3","h4","h5","h6"],"default":"p", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "font": { "required":false,"values":["inherit","sans"],"default":"inherit", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "grow": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "size": { "required":false,"values":["inherit","xs","sm","md","lg"],"default":"inherit", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "tone": { "required":false,"values":["default","secondary","muted","accent","danger","success","info","warning"],"default":"default", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "truncate": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "variant": { "required":false,"values":["body","eyebrow","code"],"default":"body", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "weight": { "required":false,"values":["inherit","normal","medium","semibold"],"default":"inherit", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "wrap": { "required":false,"values":["normal","anywhere"],"default":"normal", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] } } };
|
|
31
|
+
const D = { props: { "align": { "required":false,"values":["start","center"],"default":"start", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "as": { "required":false,"values":["p","span","div","small","strong","label","h2","h3","h4","h5","h6"],"default":"p", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "font": { "required":false,"values":["inherit","sans"],"default":"inherit", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "grow": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "size": { "required":false,"values":["inherit","xs","sm","md","lg"],"default":"inherit", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "tone": { "required":false,"values":["default","secondary","muted","accent","danger","success","info","warning"],"default":"default", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "trim": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "truncate": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "variant": { "required":false,"values":["body","eyebrow","code"],"default":"body", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "weight": { "required":false,"values":["inherit","normal","medium","semibold"],"default":"inherit", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] }, "wrap": { "required":false,"values":["normal","anywhere"],"default":"normal", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat),false] } } };
|
|
32
32
|
|
|
33
33
|
export function createUiText(options = {}, html) {
|
|
34
34
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
35
|
-
const v = [null, null, null, null, null, null, null, null, null, null];
|
|
35
|
+
const v = [null, null, null, null, null, null, null, null, null, null, null];
|
|
36
36
|
acceptProps(undefined, D, S.n, v, componentProps, [], html);
|
|
37
37
|
let a = ((v[1] === "span") ? 0 : (v[1] === "div") ? 1 : (v[1] === "small") ? 2 : (v[1] === "strong") ? 3 : (v[1] === "label") ? 4 : (v[1] === "h2") ? 5 : (v[1] === "h3") ? 6 : (v[1] === "h4") ? 7 : (v[1] === "h5") ? 8 : (v[1] === "h6") ? 9 : 10);
|
|
38
38
|
let element;
|
|
@@ -211,8 +211,8 @@ export function createUiText(options = {}, html) {
|
|
|
211
211
|
return r;
|
|
212
212
|
};
|
|
213
213
|
const p0 = (r, c, d) => {
|
|
214
|
-
if (c &
|
|
215
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
214
|
+
if (c & 2045) {
|
|
215
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
216
216
|
const s0 = x0;
|
|
217
217
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
218
218
|
}
|
|
@@ -228,8 +228,8 @@ export function createUiText(options = {}, html) {
|
|
|
228
228
|
return r;
|
|
229
229
|
};
|
|
230
230
|
const p2 = (r, c, d) => {
|
|
231
|
-
if (c &
|
|
232
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
231
|
+
if (c & 2045) {
|
|
232
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
233
233
|
const s0 = x0;
|
|
234
234
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
235
235
|
}
|
|
@@ -245,8 +245,8 @@ export function createUiText(options = {}, html) {
|
|
|
245
245
|
return r;
|
|
246
246
|
};
|
|
247
247
|
const p4 = (r, c, d) => {
|
|
248
|
-
if (c &
|
|
249
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
248
|
+
if (c & 2045) {
|
|
249
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
250
250
|
const s0 = x0;
|
|
251
251
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
252
252
|
}
|
|
@@ -262,8 +262,8 @@ export function createUiText(options = {}, html) {
|
|
|
262
262
|
return r;
|
|
263
263
|
};
|
|
264
264
|
const p6 = (r, c, d) => {
|
|
265
|
-
if (c &
|
|
266
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
265
|
+
if (c & 2045) {
|
|
266
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
267
267
|
const s0 = x0;
|
|
268
268
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
269
269
|
}
|
|
@@ -279,8 +279,8 @@ export function createUiText(options = {}, html) {
|
|
|
279
279
|
return r;
|
|
280
280
|
};
|
|
281
281
|
const p8 = (r, c, d) => {
|
|
282
|
-
if (c &
|
|
283
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
282
|
+
if (c & 2045) {
|
|
283
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
284
284
|
const s0 = x0;
|
|
285
285
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
286
286
|
}
|
|
@@ -296,8 +296,8 @@ export function createUiText(options = {}, html) {
|
|
|
296
296
|
return r;
|
|
297
297
|
};
|
|
298
298
|
const p10 = (r, c, d) => {
|
|
299
|
-
if (c &
|
|
300
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
299
|
+
if (c & 2045) {
|
|
300
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
301
301
|
const s0 = x0;
|
|
302
302
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
303
303
|
}
|
|
@@ -313,8 +313,8 @@ export function createUiText(options = {}, html) {
|
|
|
313
313
|
return r;
|
|
314
314
|
};
|
|
315
315
|
const p12 = (r, c, d) => {
|
|
316
|
-
if (c &
|
|
317
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
316
|
+
if (c & 2045) {
|
|
317
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
318
318
|
const s0 = x0;
|
|
319
319
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
320
320
|
}
|
|
@@ -330,8 +330,8 @@ export function createUiText(options = {}, html) {
|
|
|
330
330
|
return r;
|
|
331
331
|
};
|
|
332
332
|
const p14 = (r, c, d) => {
|
|
333
|
-
if (c &
|
|
334
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
333
|
+
if (c & 2045) {
|
|
334
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
335
335
|
const s0 = x0;
|
|
336
336
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
337
337
|
}
|
|
@@ -347,8 +347,8 @@ export function createUiText(options = {}, html) {
|
|
|
347
347
|
return r;
|
|
348
348
|
};
|
|
349
349
|
const p16 = (r, c, d) => {
|
|
350
|
-
if (c &
|
|
351
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
350
|
+
if (c & 2045) {
|
|
351
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
352
352
|
const s0 = x0;
|
|
353
353
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
354
354
|
}
|
|
@@ -364,8 +364,8 @@ export function createUiText(options = {}, html) {
|
|
|
364
364
|
return r;
|
|
365
365
|
};
|
|
366
366
|
const p18 = (r, c, d) => {
|
|
367
|
-
if (c &
|
|
368
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
367
|
+
if (c & 2045) {
|
|
368
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
369
369
|
const s0 = x0;
|
|
370
370
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
371
371
|
}
|
|
@@ -381,8 +381,8 @@ export function createUiText(options = {}, html) {
|
|
|
381
381
|
return r;
|
|
382
382
|
};
|
|
383
383
|
const p20 = (r, c, d) => {
|
|
384
|
-
if (c &
|
|
385
|
-
const x0 = hostState(["grow","size","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[5], v[
|
|
384
|
+
if (c & 2045) {
|
|
385
|
+
const x0 = hostState(["grow","size","trim","tone","weight","variant","truncate","align","font","wrap"], [v[3], v[4], v[6], v[5], v[9], v[8], v[7], v[0], v[2], v[10]]);
|
|
386
386
|
const s0 = x0;
|
|
387
387
|
if (s0 !== r.v0) writeAttribute(r.n, "data-ui-text-state", (r.v0 = s0) === "" ? null : s0);
|
|
388
388
|
}
|
package/vue/UiMeter.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
10
10
|
type: PropType<number | null>;
|
|
11
11
|
default: number;
|
|
12
12
|
};
|
|
13
|
+
parts: {
|
|
14
|
+
type: PropType<readonly ({
|
|
15
|
+
readonly value: number;
|
|
16
|
+
readonly color: string;
|
|
17
|
+
})[] | null>;
|
|
18
|
+
default: () => never[];
|
|
19
|
+
};
|
|
13
20
|
segments: {
|
|
14
21
|
type: PropType<number | null>;
|
|
15
22
|
default: number;
|
|
@@ -30,6 +37,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
30
37
|
type: PropType<string | null>;
|
|
31
38
|
default: string;
|
|
32
39
|
};
|
|
40
|
+
variant: {
|
|
41
|
+
type: PropType<"progress" | "distribution" | null>;
|
|
42
|
+
default: string;
|
|
43
|
+
};
|
|
33
44
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
45
|
label: {
|
|
35
46
|
type: PropType<string | null>;
|
|
@@ -39,6 +50,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
39
50
|
type: PropType<number | null>;
|
|
40
51
|
default: number;
|
|
41
52
|
};
|
|
53
|
+
parts: {
|
|
54
|
+
type: PropType<readonly ({
|
|
55
|
+
readonly value: number;
|
|
56
|
+
readonly color: string;
|
|
57
|
+
})[] | null>;
|
|
58
|
+
default: () => never[];
|
|
59
|
+
};
|
|
42
60
|
segments: {
|
|
43
61
|
type: PropType<number | null>;
|
|
44
62
|
default: number;
|
|
@@ -59,12 +77,21 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
77
|
type: PropType<string | null>;
|
|
60
78
|
default: string;
|
|
61
79
|
};
|
|
80
|
+
variant: {
|
|
81
|
+
type: PropType<"progress" | "distribution" | null>;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
62
84
|
}>> & Readonly<{}>, {
|
|
63
85
|
label: string | null;
|
|
64
86
|
value: number | null;
|
|
65
87
|
size: "sm" | "md" | null;
|
|
66
88
|
max: number | null;
|
|
67
89
|
tone: "info" | "neutral" | "accent" | "success" | "warning" | "danger" | null;
|
|
90
|
+
variant: "progress" | "distribution" | null;
|
|
91
|
+
parts: readonly {
|
|
92
|
+
readonly value: number;
|
|
93
|
+
readonly color: string;
|
|
94
|
+
}[] | null;
|
|
68
95
|
segments: number | null;
|
|
69
96
|
valueText: string | null;
|
|
70
97
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|