@kubed.io/cdn 0.0.3 → 0.0.5
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/README.md +33 -5
- package/dist/chunks/define-BSZoKakE.js +10 -0
- package/dist/chunks/define-BSZoKakE.js.map +1 -0
- package/dist/chunks/element-ChNBLJ5X.js +632 -0
- package/dist/chunks/element-ChNBLJ5X.js.map +1 -0
- package/dist/chunks/kd-BeZbw7cp.js +1149 -0
- package/dist/chunks/kd-BeZbw7cp.js.map +1 -0
- package/dist/chunks/scene-CUr0fSXC.js +240 -0
- package/dist/chunks/scene-CUr0fSXC.js.map +1 -0
- package/dist/k8s/elements/events.d.ts +54 -0
- package/dist/k8s/elements/object.d.ts +47 -0
- package/dist/k8s/elements/ref.d.ts +45 -0
- package/dist/k8s/events.d.ts +63 -0
- package/dist/k8s/icons.d.ts +18 -0
- package/dist/k8s/index.d.ts +13 -0
- package/dist/k8s/links.d.ts +72 -0
- package/dist/k8s/map.d.ts +114 -0
- package/dist/k8s.js +909 -0
- package/dist/k8s.js.map +1 -0
- package/dist/kd/cell.d.ts +45 -0
- package/dist/kd/element.d.ts +32 -0
- package/dist/kd/elements/bar.d.ts +33 -0
- package/dist/kd/elements/data.d.ts +27 -0
- package/dist/kd/elements/groups.d.ts +32 -0
- package/dist/kd/elements/link.d.ts +67 -0
- package/dist/kd/elements/mask.d.ts +22 -0
- package/dist/kd/elements/meter.d.ts +37 -0
- package/dist/kd/elements/pill.d.ts +15 -0
- package/dist/kd/elements/sheet.d.ts +28 -0
- package/dist/kd/elements/steps.d.ts +30 -0
- package/dist/kd/elements/table.d.ts +38 -0
- package/dist/kd/elements/tabs.d.ts +27 -0
- package/dist/kd/elements/tile.d.ts +19 -0
- package/dist/kd/helpers.d.ts +12 -0
- package/dist/kd/index.d.ts +30 -0
- package/dist/kd/parts.d.ts +15 -0
- package/dist/kd/scene.d.ts +178 -0
- package/dist/kd/theme.d.ts +2 -0
- package/dist/kd/yaml.d.ts +17 -0
- package/dist/kd.js +5 -64
- package/dist/n8n/config.d.ts +58 -0
- package/dist/n8n/fetch.d.ts +35 -0
- package/dist/n8n/history.d.ts +8 -0
- package/dist/n8n/index.d.ts +8 -0
- package/dist/n8n/metadata.d.ts +10 -0
- package/dist/n8n/mount.d.ts +29 -0
- package/dist/n8n/state.d.ts +44 -0
- package/dist/n8n/stream.d.ts +17 -0
- package/dist/n8n/styles.d.ts +1 -0
- package/dist/n8n.js +384 -0
- package/dist/n8n.js.map +1 -0
- package/dist/openapi/describe.d.ts +20 -0
- package/dist/openapi/index.d.ts +6 -0
- package/dist/openapi/model.d.ts +154 -0
- package/dist/openapi/schema.d.ts +52 -0
- package/dist/openapi.js +504 -0
- package/dist/openapi.js.map +1 -0
- package/package.json +26 -2
- package/dist/kd.js.map +0 -1
|
@@ -0,0 +1,1149 @@
|
|
|
1
|
+
import { a as e, c as t, l as n, n as r, o as i, r as a, s as o, t as s } from "./element-ChNBLJ5X.js";
|
|
2
|
+
import { n as c } from "./define-BSZoKakE.js";
|
|
3
|
+
//#region src/kd/helpers.ts
|
|
4
|
+
function l(e) {
|
|
5
|
+
return JSON.stringify(e ?? null);
|
|
6
|
+
}
|
|
7
|
+
function u(e) {
|
|
8
|
+
e.registerHelper("kdjson", (e) => l(e));
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region node_modules/lit-html/directives/if-defined.js
|
|
12
|
+
var d = (e) => e ?? i, ee = /^(~|null|true|false|yes|no|on|off|y|n)$/i, te = /^([-+]?(\.\d+|\d[\d_]*(\.\d*)?)([eE][-+]?\d+)?|0x[0-9a-f]+|0o[0-7]+|[-+]?\.(inf|nan)|[-+]?\d+(:[0-5]?\d)+(\.\d*)?)$/i, ne = /^\d{4}-\d\d?-\d\d?([Tt ]|$)/, re = /^([,[\]{}#&*!|>'"%@`]|[-?:](\s|$))/, f = /[\u0000-\u0008\u000b-\u001f\u007f]/;
|
|
13
|
+
function p(e) {
|
|
14
|
+
return e === "" || ee.test(e) || te.test(e) || ne.test(e) || re.test(e) || /^\s|\s$/.test(e) || e.includes(": ") || e.includes(" #") || e.endsWith(":") || e.includes("\n") || e.includes(" ") || f.test(e);
|
|
15
|
+
}
|
|
16
|
+
function m(e) {
|
|
17
|
+
return p(e) ? JSON.stringify(e) : e;
|
|
18
|
+
}
|
|
19
|
+
var h = (e, t) => ({
|
|
20
|
+
kind: e,
|
|
21
|
+
text: t
|
|
22
|
+
});
|
|
23
|
+
function g(e) {
|
|
24
|
+
return Array.isArray(e) ? e.length > 0 : typeof e == "object" && !!e && Object.values(e).some((e) => e !== void 0);
|
|
25
|
+
}
|
|
26
|
+
function ie(e) {
|
|
27
|
+
return typeof e == "string" && e.includes("\n") && !f.test(e);
|
|
28
|
+
}
|
|
29
|
+
function ae(e) {
|
|
30
|
+
return e == null ? h("null", "null") : typeof e == "boolean" ? h("bool", String(e)) : typeof e == "number" || typeof e == "bigint" ? h("num", String(e)) : Array.isArray(e) ? h("plain", "[]") : typeof e == "object" ? h("plain", "{}") : h("str", m(String(e)));
|
|
31
|
+
}
|
|
32
|
+
function oe(e) {
|
|
33
|
+
let t = e.endsWith("\n") ? e.endsWith("\n\n") ? "+" : "" : "-", n = (t === "-" ? e : e.slice(0, -1)).split("\n");
|
|
34
|
+
return {
|
|
35
|
+
header: `|${n.find((e) => e !== "")?.startsWith(" ") ? "2" : ""}${t}`,
|
|
36
|
+
lines: n
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function _(e, t, n, r) {
|
|
40
|
+
let i = t.length ? [h("plain", " ")] : [];
|
|
41
|
+
if (ie(n)) {
|
|
42
|
+
let { header: a, lines: o } = oe(n);
|
|
43
|
+
return [{
|
|
44
|
+
prefix: e,
|
|
45
|
+
tokens: [
|
|
46
|
+
...t,
|
|
47
|
+
...i,
|
|
48
|
+
h("plain", a)
|
|
49
|
+
]
|
|
50
|
+
}, ...o.map((e) => ({
|
|
51
|
+
prefix: e ? r : "",
|
|
52
|
+
tokens: [h("str", e)]
|
|
53
|
+
}))];
|
|
54
|
+
}
|
|
55
|
+
return [{
|
|
56
|
+
prefix: e,
|
|
57
|
+
tokens: [
|
|
58
|
+
...t,
|
|
59
|
+
...i,
|
|
60
|
+
ae(n)
|
|
61
|
+
]
|
|
62
|
+
}];
|
|
63
|
+
}
|
|
64
|
+
function v(e, t, n) {
|
|
65
|
+
if (Array.isArray(e)) for (let r of e) if (g(r)) {
|
|
66
|
+
let e = [];
|
|
67
|
+
v(r, `${t} `, e), e[0].prefix = `${t}- ${e[0].prefix.slice(t.length + 2)}`, n.push(...e);
|
|
68
|
+
} else n.push(..._(`${t}- `, [], r, `${t} `));
|
|
69
|
+
else for (let [r, i] of Object.entries(e)) {
|
|
70
|
+
if (i === void 0) continue;
|
|
71
|
+
let e = [h("key", m(r)), h("plain", ":")];
|
|
72
|
+
g(i) ? (n.push({
|
|
73
|
+
prefix: t,
|
|
74
|
+
tokens: e
|
|
75
|
+
}), v(i, Array.isArray(i) ? t : `${t} `, n)) : n.push(..._(t, e, i, `${t} `));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function y(e) {
|
|
79
|
+
let t = [];
|
|
80
|
+
return g(e) ? v(e, "", t) : t.push(..._("", [], e, " ")), t;
|
|
81
|
+
}
|
|
82
|
+
function b(e) {
|
|
83
|
+
return y(e).map((e) => e.prefix + e.tokens.map((e) => e.text).join("")).join("\n");
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/kd/elements/data.ts
|
|
87
|
+
var x = class extends s {
|
|
88
|
+
static properties = {
|
|
89
|
+
data: {
|
|
90
|
+
attribute: "data",
|
|
91
|
+
converter: a
|
|
92
|
+
},
|
|
93
|
+
fold: { type: Number }
|
|
94
|
+
};
|
|
95
|
+
static styles = [r, n`
|
|
96
|
+
pre {
|
|
97
|
+
margin: 0;
|
|
98
|
+
font-family: var(--kd-font-mono, monospace);
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
line-height: 1.5;
|
|
101
|
+
white-space: pre-wrap;
|
|
102
|
+
overflow-wrap: anywhere;
|
|
103
|
+
}
|
|
104
|
+
.key {
|
|
105
|
+
color: color-mix(in srgb, var(--kd-info, currentColor) 75%, var(--kd-text, currentColor));
|
|
106
|
+
}
|
|
107
|
+
.str {
|
|
108
|
+
color: color-mix(in srgb, var(--kd-success, currentColor) 70%, var(--kd-text, currentColor));
|
|
109
|
+
}
|
|
110
|
+
.num {
|
|
111
|
+
color: color-mix(in srgb, var(--kd-warning, currentColor) 55%, var(--kd-text, currentColor));
|
|
112
|
+
}
|
|
113
|
+
.bool,
|
|
114
|
+
.null {
|
|
115
|
+
color: color-mix(in srgb, var(--kd-primary, currentColor) 70%, var(--kd-text, currentColor));
|
|
116
|
+
}
|
|
117
|
+
summary {
|
|
118
|
+
width: max-content;
|
|
119
|
+
color: var(--kd-text-2, inherit);
|
|
120
|
+
font-family: var(--kd-font-mono, monospace);
|
|
121
|
+
font-size: 12px;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
list-style: none;
|
|
124
|
+
}
|
|
125
|
+
summary::-webkit-details-marker {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
summary::before {
|
|
129
|
+
content: '▸ ';
|
|
130
|
+
}
|
|
131
|
+
details[open] > summary::before {
|
|
132
|
+
content: '▾ ';
|
|
133
|
+
}
|
|
134
|
+
details > pre {
|
|
135
|
+
margin-top: 2px;
|
|
136
|
+
}
|
|
137
|
+
`];
|
|
138
|
+
constructor() {
|
|
139
|
+
super(), this.fold = 10;
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
let e = this.data;
|
|
143
|
+
if (e === void 0) return i;
|
|
144
|
+
let n = y(e), r = t`<pre>${n.map((e, n) => t`${n ? "\n" : ""}${e.prefix}${e.tokens.map((e) => e.kind === "plain" ? e.text : t`<span class=${e.kind}>${e.text}</span>`)}`)}</pre>`;
|
|
145
|
+
if (!(this.fold > 0 && n.length > this.fold && typeof e == "object" && e)) return r;
|
|
146
|
+
let a = Object.keys(e).length, o = Array.isArray(e) ? `[ ] ${a} item${a === 1 ? "" : "s"}` : `{ } ${a} key${a === 1 ? "" : "s"}`;
|
|
147
|
+
return t`<details><summary>${o}</summary>${r}</details>`;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
c("kd-data", x);
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/kd/parts.ts
|
|
153
|
+
var se = /* @__PURE__ */ new Set([
|
|
154
|
+
"primary",
|
|
155
|
+
"success",
|
|
156
|
+
"warning",
|
|
157
|
+
"error",
|
|
158
|
+
"info",
|
|
159
|
+
"neutral"
|
|
160
|
+
]);
|
|
161
|
+
function S(e, t = "neutral") {
|
|
162
|
+
return typeof e == "string" && se.has(e) ? e : t;
|
|
163
|
+
}
|
|
164
|
+
var C = n`
|
|
165
|
+
.primary {
|
|
166
|
+
--tone: var(--kd-primary, currentColor);
|
|
167
|
+
}
|
|
168
|
+
.success {
|
|
169
|
+
--tone: var(--kd-success, currentColor);
|
|
170
|
+
}
|
|
171
|
+
.warning {
|
|
172
|
+
--tone: var(--kd-warning, currentColor);
|
|
173
|
+
}
|
|
174
|
+
.error {
|
|
175
|
+
--tone: var(--kd-error, currentColor);
|
|
176
|
+
}
|
|
177
|
+
.info {
|
|
178
|
+
--tone: var(--kd-info, currentColor);
|
|
179
|
+
}
|
|
180
|
+
.primary,
|
|
181
|
+
.success,
|
|
182
|
+
.warning,
|
|
183
|
+
.error,
|
|
184
|
+
.info {
|
|
185
|
+
--tone-ink: color-mix(in srgb, var(--tone) 75%, var(--kd-text, currentColor));
|
|
186
|
+
--tone-line: color-mix(in srgb, var(--tone) 50%, transparent);
|
|
187
|
+
}
|
|
188
|
+
.neutral {
|
|
189
|
+
--tone: var(--kd-text-2, currentColor);
|
|
190
|
+
--tone-ink: var(--kd-text-2, currentColor);
|
|
191
|
+
--tone-line: var(--kd-border-strong, currentColor);
|
|
192
|
+
}
|
|
193
|
+
`, ce = /^(https?:|data:image\/|\/|\.\.?\/)/i;
|
|
194
|
+
function w(e, n = "icon") {
|
|
195
|
+
return e ? ce.test(e) ? t`<img class=${n} src=${e} alt="" />` : t`<span class=${n}>${e}</span>` : i;
|
|
196
|
+
}
|
|
197
|
+
function T(e) {
|
|
198
|
+
if (e != null && e !== "") return /^\s*(javascript|vbscript|data):/i.test(e) ? void 0 : e;
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/kd/elements/link.ts
|
|
202
|
+
function E(e) {
|
|
203
|
+
try {
|
|
204
|
+
let t = e?.location, n = /^(.*?)\/d\/([^/?#]+)/.exec(t?.pathname ?? "");
|
|
205
|
+
return {
|
|
206
|
+
prefix: n?.[1] ?? "",
|
|
207
|
+
uid: n ? decodeURIComponent(n[2]) : void 0,
|
|
208
|
+
params: new URLSearchParams(t?.search ?? "")
|
|
209
|
+
};
|
|
210
|
+
} catch {
|
|
211
|
+
return {
|
|
212
|
+
prefix: "",
|
|
213
|
+
params: new URLSearchParams()
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
function D(e, t) {
|
|
218
|
+
if (!e.dashboard) return T(e.href);
|
|
219
|
+
let n = E(t), r = e.dashboard.indexOf("?"), i = r < 0 ? e.dashboard : e.dashboard.slice(0, r), a = new URLSearchParams(r < 0 ? "" : e.dashboard.slice(r + 1));
|
|
220
|
+
for (let [t, n] of Object.entries(e.vars ?? {})) {
|
|
221
|
+
if (n == null) continue;
|
|
222
|
+
let e = t.startsWith("var-") ? t : `var-${t}`;
|
|
223
|
+
a.delete(e);
|
|
224
|
+
for (let t of Array.isArray(n) ? n : [n]) a.append(e, String(t));
|
|
225
|
+
}
|
|
226
|
+
for (let e of ["from", "to"]) {
|
|
227
|
+
let t = n.params.get(e);
|
|
228
|
+
t !== null && !a.has(e) && a.set(e, t);
|
|
229
|
+
}
|
|
230
|
+
if (e.back && n.uid) {
|
|
231
|
+
let e = new URLSearchParams([...n.params].filter(([e]) => e.startsWith("var-"))).toString();
|
|
232
|
+
a.set("var-back", e ? `${n.uid}?${e}` : n.uid);
|
|
233
|
+
}
|
|
234
|
+
let o = a.toString();
|
|
235
|
+
return `${n.prefix}/d/${i}${o ? `?${o}` : ""}`;
|
|
236
|
+
}
|
|
237
|
+
var O = /* @__PURE__ */ new WeakMap();
|
|
238
|
+
function k(e) {
|
|
239
|
+
e && !O.has(e) && e.System?.import && (O.set(e, null), e.System.import("@grafana/runtime").then((t) => O.set(e, t), () => {}));
|
|
240
|
+
}
|
|
241
|
+
function A(e, t, n) {
|
|
242
|
+
if (!e || n.defaultPrevented || n.button !== 0 || n.metaKey || n.ctrlKey || n.shiftKey || n.altKey) return;
|
|
243
|
+
let r = O.get(e)?.locationService;
|
|
244
|
+
if (!r) return;
|
|
245
|
+
let i = new URL(t, e.location.href);
|
|
246
|
+
if (i.origin !== e.location.origin) return;
|
|
247
|
+
let { prefix: a } = E(e), o = a && i.pathname.startsWith(a) ? i.pathname.slice(a.length) : i.pathname;
|
|
248
|
+
n.preventDefault(), r.push(o + i.search + i.hash);
|
|
249
|
+
}
|
|
250
|
+
var j = class extends s {
|
|
251
|
+
static properties = {
|
|
252
|
+
data: {
|
|
253
|
+
attribute: "data",
|
|
254
|
+
converter: a
|
|
255
|
+
},
|
|
256
|
+
dashboard: {},
|
|
257
|
+
href: {},
|
|
258
|
+
vars: { converter: a },
|
|
259
|
+
text: {},
|
|
260
|
+
icon: {},
|
|
261
|
+
back: { type: Boolean }
|
|
262
|
+
};
|
|
263
|
+
static styles = [r, n`
|
|
264
|
+
:host {
|
|
265
|
+
display: inline;
|
|
266
|
+
}
|
|
267
|
+
/* One line: a long name ends in an ellipsis with the full text on hover.
|
|
268
|
+
A table caps links with --kd-link-max, since 100% means nothing to an
|
|
269
|
+
auto-layout column. */
|
|
270
|
+
a,
|
|
271
|
+
span.link {
|
|
272
|
+
display: inline-flex;
|
|
273
|
+
align-items: baseline;
|
|
274
|
+
max-width: var(--kd-link-max, 100%);
|
|
275
|
+
min-width: 0;
|
|
276
|
+
vertical-align: bottom;
|
|
277
|
+
}
|
|
278
|
+
.text {
|
|
279
|
+
min-width: 0;
|
|
280
|
+
overflow: hidden;
|
|
281
|
+
text-overflow: ellipsis;
|
|
282
|
+
white-space: nowrap;
|
|
283
|
+
}
|
|
284
|
+
a {
|
|
285
|
+
color: var(--kd-link, inherit);
|
|
286
|
+
text-decoration: none;
|
|
287
|
+
}
|
|
288
|
+
a:hover {
|
|
289
|
+
text-decoration: underline;
|
|
290
|
+
}
|
|
291
|
+
.icon {
|
|
292
|
+
width: 16px;
|
|
293
|
+
height: 16px;
|
|
294
|
+
margin-right: 4px;
|
|
295
|
+
vertical-align: -3px;
|
|
296
|
+
}
|
|
297
|
+
`];
|
|
298
|
+
get link() {
|
|
299
|
+
let e = this.data ?? {};
|
|
300
|
+
return {
|
|
301
|
+
dashboard: e.dashboard ?? this.dashboard,
|
|
302
|
+
href: e.href ?? this.href,
|
|
303
|
+
vars: e.vars ?? this.vars,
|
|
304
|
+
text: e.text ?? this.text,
|
|
305
|
+
icon: e.icon ?? this.icon,
|
|
306
|
+
title: e.title,
|
|
307
|
+
back: e.back ?? this.back
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
connectedCallback() {
|
|
311
|
+
super.connectedCallback(), k(this.ownerDocument?.defaultView);
|
|
312
|
+
}
|
|
313
|
+
#e = () => this.requestUpdate();
|
|
314
|
+
#t = (e) => {
|
|
315
|
+
let t = this.ownerDocument?.defaultView, n = D(this.link, t);
|
|
316
|
+
n !== void 0 && (e.currentTarget.setAttribute("href", n), A(t, n, e));
|
|
317
|
+
};
|
|
318
|
+
render() {
|
|
319
|
+
let e = this.link, n = D(e, this.ownerDocument?.defaultView), r = t`${w(e.icon)}<span class="text" title=${d(e.text)}
|
|
320
|
+
><slot>${e.text ?? ""}</slot></span
|
|
321
|
+
>`, i = e.title ?? e.text;
|
|
322
|
+
return n === void 0 ? t`<span class="link" title=${d(i)}>${r}</span>` : t`<a
|
|
323
|
+
href=${n}
|
|
324
|
+
title=${d(i)}
|
|
325
|
+
@click=${this.#t}
|
|
326
|
+
@mouseenter=${this.#e}
|
|
327
|
+
@focus=${this.#e}
|
|
328
|
+
>${r}</a
|
|
329
|
+
>`;
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
c("kd-link", j);
|
|
333
|
+
//#endregion
|
|
334
|
+
//#region src/kd/elements/pill.ts
|
|
335
|
+
var M = class extends s {
|
|
336
|
+
static properties = { tone: {} };
|
|
337
|
+
static styles = [
|
|
338
|
+
r,
|
|
339
|
+
C,
|
|
340
|
+
n`
|
|
341
|
+
:host {
|
|
342
|
+
display: inline-block;
|
|
343
|
+
margin: 1px 4px 1px 0;
|
|
344
|
+
vertical-align: baseline;
|
|
345
|
+
}
|
|
346
|
+
span {
|
|
347
|
+
display: inline-block;
|
|
348
|
+
padding: 0 8px;
|
|
349
|
+
border: 1px solid var(--tone-line);
|
|
350
|
+
border-radius: 10px;
|
|
351
|
+
background: color-mix(in srgb, var(--tone) 14%, transparent);
|
|
352
|
+
color: var(--tone-ink);
|
|
353
|
+
font-size: 11px;
|
|
354
|
+
line-height: 18px;
|
|
355
|
+
white-space: nowrap;
|
|
356
|
+
}
|
|
357
|
+
`
|
|
358
|
+
];
|
|
359
|
+
render() {
|
|
360
|
+
return t`<span class=${S(this.tone)}><slot></slot></span>`;
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
c("kd-pill", M);
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/kd/cell.ts
|
|
366
|
+
function N(e) {
|
|
367
|
+
return e == null || e === "" || Array.isArray(e) && e.every(N);
|
|
368
|
+
}
|
|
369
|
+
function P(e) {
|
|
370
|
+
return e == null ? i : Array.isArray(e) ? t`<span class="cells">${e.filter((e) => !N(e)).map((e) => t`<span>${P(e)}</span>`)}</span>` : typeof e == "object" ? "dashboard" in e || "href" in e ? t`<kd-link .data=${e}></kd-link>` : "data" in e ? t`<kd-data .data=${e.data}></kd-data>` : "code" in e ? t`<code>${String(e.code)}</code>` : "text" in e ? t`<kd-pill tone=${d(e.tone)} title=${d(e.title)}>${String(e.text)}</kd-pill>` : t`<kd-data .data=${e}></kd-data>` : String(e);
|
|
371
|
+
}
|
|
372
|
+
var F = n`
|
|
373
|
+
.cells {
|
|
374
|
+
display: inline-flex;
|
|
375
|
+
flex-wrap: wrap;
|
|
376
|
+
align-items: baseline;
|
|
377
|
+
gap: 2px 6px;
|
|
378
|
+
}
|
|
379
|
+
code {
|
|
380
|
+
font-family: var(--kd-font-mono, monospace);
|
|
381
|
+
font-size: 12px;
|
|
382
|
+
overflow-wrap: anywhere;
|
|
383
|
+
}
|
|
384
|
+
`, I = class extends s {
|
|
385
|
+
static properties = { data: {
|
|
386
|
+
attribute: "data",
|
|
387
|
+
converter: a
|
|
388
|
+
} };
|
|
389
|
+
static styles = [
|
|
390
|
+
r,
|
|
391
|
+
F,
|
|
392
|
+
n`
|
|
393
|
+
.bar {
|
|
394
|
+
display: flex;
|
|
395
|
+
flex-wrap: wrap;
|
|
396
|
+
align-items: center;
|
|
397
|
+
gap: 8px 16px;
|
|
398
|
+
padding: 0 4px;
|
|
399
|
+
}
|
|
400
|
+
img.icon {
|
|
401
|
+
width: 42px;
|
|
402
|
+
height: 42px;
|
|
403
|
+
}
|
|
404
|
+
span.icon {
|
|
405
|
+
font-size: 34px;
|
|
406
|
+
line-height: 1;
|
|
407
|
+
}
|
|
408
|
+
.eyebrow {
|
|
409
|
+
color: var(--kd-text-2, inherit);
|
|
410
|
+
font-size: 11px;
|
|
411
|
+
letter-spacing: 0.1em;
|
|
412
|
+
text-transform: uppercase;
|
|
413
|
+
}
|
|
414
|
+
.title {
|
|
415
|
+
font-size: 22px;
|
|
416
|
+
font-weight: 500;
|
|
417
|
+
line-height: 1.2;
|
|
418
|
+
overflow-wrap: anywhere;
|
|
419
|
+
}
|
|
420
|
+
.grow {
|
|
421
|
+
flex: 1;
|
|
422
|
+
}
|
|
423
|
+
.chain {
|
|
424
|
+
font-size: 13px;
|
|
425
|
+
}
|
|
426
|
+
.sep {
|
|
427
|
+
margin: 0 6px;
|
|
428
|
+
color: var(--kd-text-dim, inherit);
|
|
429
|
+
}
|
|
430
|
+
`
|
|
431
|
+
];
|
|
432
|
+
render() {
|
|
433
|
+
let e = this.data;
|
|
434
|
+
if (!e) return i;
|
|
435
|
+
let n = (e.chips ?? []).filter((e) => !N(e)), r = (e.chain ?? []).filter((e) => !N(e));
|
|
436
|
+
return t`<div class="bar">
|
|
437
|
+
${w(e.icon)}
|
|
438
|
+
<div class="id">
|
|
439
|
+
${N(e.eyebrow) ? i : t`<div class="eyebrow">${P(e.eyebrow)}</div>`}
|
|
440
|
+
<div class="title">${e.title ?? ""}</div>
|
|
441
|
+
</div>
|
|
442
|
+
${n.length ? t`<div class="chips">${n.map((e) => P(e))}</div>` : i}
|
|
443
|
+
<div class="grow"></div>
|
|
444
|
+
${r.length ? t`<nav class="chain">
|
|
445
|
+
${r.map((e, n) => t`${n ? t`<span class="sep">›</span>` : i}${P(e)}`)}
|
|
446
|
+
</nav>` : i}
|
|
447
|
+
</div>`;
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
c("kd-bar", I);
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region src/kd/elements/groups.ts
|
|
453
|
+
function le(e) {
|
|
454
|
+
let t = /* @__PURE__ */ new Map();
|
|
455
|
+
for (let [n, r] of Object.entries(e)) {
|
|
456
|
+
let e = n.indexOf("/"), i = e < 0 ? "" : n.slice(0, e), a = r == null ? "" : typeof r == "string" ? r : JSON.stringify(r), o = t.get(i);
|
|
457
|
+
o || t.set(i, o = {
|
|
458
|
+
prefix: i,
|
|
459
|
+
entries: []
|
|
460
|
+
}), o.entries.push({
|
|
461
|
+
key: n,
|
|
462
|
+
name: n.slice(e + 1),
|
|
463
|
+
value: a
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
return [...t.values()].sort((e, t) => e.prefix < t.prefix ? -1 : +(e.prefix > t.prefix));
|
|
467
|
+
}
|
|
468
|
+
function L(e) {
|
|
469
|
+
if (/^\s*[[{]/.test(e)) try {
|
|
470
|
+
let t = JSON.parse(e);
|
|
471
|
+
return typeof t == "object" && t ? t : void 0;
|
|
472
|
+
} catch {
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
var R = 600, z = class extends s {
|
|
477
|
+
static properties = {
|
|
478
|
+
data: {
|
|
479
|
+
attribute: "data",
|
|
480
|
+
converter: a
|
|
481
|
+
},
|
|
482
|
+
mode: {}
|
|
483
|
+
};
|
|
484
|
+
static styles = [r, n`
|
|
485
|
+
.group + .group {
|
|
486
|
+
margin-top: 12px;
|
|
487
|
+
}
|
|
488
|
+
div.head,
|
|
489
|
+
tr.head td {
|
|
490
|
+
padding-bottom: 3px;
|
|
491
|
+
border-bottom: 1px solid var(--kd-border, transparent);
|
|
492
|
+
color: var(--kd-text-2, inherit);
|
|
493
|
+
font-family: var(--kd-font-mono, monospace);
|
|
494
|
+
font-size: 11px;
|
|
495
|
+
}
|
|
496
|
+
div.head {
|
|
497
|
+
margin-bottom: 6px;
|
|
498
|
+
}
|
|
499
|
+
table {
|
|
500
|
+
width: 100%;
|
|
501
|
+
border-collapse: collapse;
|
|
502
|
+
font-size: 13px;
|
|
503
|
+
}
|
|
504
|
+
td {
|
|
505
|
+
padding: 2px 12px 2px 0;
|
|
506
|
+
vertical-align: top;
|
|
507
|
+
}
|
|
508
|
+
tr.head td {
|
|
509
|
+
padding-top: 12px;
|
|
510
|
+
}
|
|
511
|
+
tr.head:first-child td {
|
|
512
|
+
padding-top: 0;
|
|
513
|
+
}
|
|
514
|
+
tr.head + tr td {
|
|
515
|
+
padding-top: 6px;
|
|
516
|
+
}
|
|
517
|
+
.k {
|
|
518
|
+
white-space: nowrap;
|
|
519
|
+
}
|
|
520
|
+
code {
|
|
521
|
+
font-family: var(--kd-font-mono, monospace);
|
|
522
|
+
font-size: 12px;
|
|
523
|
+
}
|
|
524
|
+
.twig {
|
|
525
|
+
margin: 0 8px 0 4px;
|
|
526
|
+
color: var(--kd-text-dim, inherit);
|
|
527
|
+
font-family: var(--kd-font-mono, monospace);
|
|
528
|
+
}
|
|
529
|
+
.v {
|
|
530
|
+
width: 100%;
|
|
531
|
+
color: color-mix(in srgb, var(--kd-success, currentColor) 70%, var(--kd-text, currentColor));
|
|
532
|
+
font-family: var(--kd-font-mono, monospace);
|
|
533
|
+
font-size: 12px;
|
|
534
|
+
overflow-wrap: anywhere;
|
|
535
|
+
word-break: break-word;
|
|
536
|
+
}
|
|
537
|
+
.none {
|
|
538
|
+
padding: 8px 0;
|
|
539
|
+
color: var(--kd-text-dim, inherit);
|
|
540
|
+
}
|
|
541
|
+
`];
|
|
542
|
+
render() {
|
|
543
|
+
let e = this.data;
|
|
544
|
+
if (!e || typeof e != "object") return i;
|
|
545
|
+
let n = le(e);
|
|
546
|
+
return n.length ? this.mode === "tree" ? this.#t(n) : this.#e(n) : t`<div class="none">none</div>`;
|
|
547
|
+
}
|
|
548
|
+
#e(e) {
|
|
549
|
+
return e.map((e) => t`<div class="group">
|
|
550
|
+
${e.prefix ? t`<div class="head">${e.prefix}</div>` : i}
|
|
551
|
+
<div>
|
|
552
|
+
${e.entries.map((e) => t`<kd-pill tone="info" title=${e.key}>${e.value === "" ? e.name : `${e.name}=${e.value}`}</kd-pill>`)}
|
|
553
|
+
</div>
|
|
554
|
+
</div>`);
|
|
555
|
+
}
|
|
556
|
+
#t(e) {
|
|
557
|
+
return t`<table>
|
|
558
|
+
<tbody>
|
|
559
|
+
${e.map((e) => t`${e.prefix ? t`<tr class="head"><td colspan="2">${e.prefix}</td></tr>` : i}
|
|
560
|
+
${e.entries.map((n, r) => {
|
|
561
|
+
let a = L(n.value);
|
|
562
|
+
return t`<tr>
|
|
563
|
+
<td class="k">
|
|
564
|
+
${e.prefix ? t`<span class="twig">${r === e.entries.length - 1 ? "└" : "├"}</span>` : i}<code
|
|
565
|
+
>${n.name}</code
|
|
566
|
+
>
|
|
567
|
+
</td>
|
|
568
|
+
<td class="v">
|
|
569
|
+
${a ? t`<kd-data .data=${a}></kd-data>` : n.value.length > R ? `${n.value.slice(0, R)} …` : n.value}
|
|
570
|
+
</td>
|
|
571
|
+
</tr>`;
|
|
572
|
+
})}`)}
|
|
573
|
+
</tbody>
|
|
574
|
+
</table>`;
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
c("kd-groups", z);
|
|
578
|
+
//#endregion
|
|
579
|
+
//#region src/kd/elements/mask.ts
|
|
580
|
+
var B = class extends s {
|
|
581
|
+
static properties = {
|
|
582
|
+
value: {},
|
|
583
|
+
shown: { state: !0 }
|
|
584
|
+
};
|
|
585
|
+
static styles = [r, n`
|
|
586
|
+
:host {
|
|
587
|
+
display: inline-block;
|
|
588
|
+
}
|
|
589
|
+
button {
|
|
590
|
+
padding: 0;
|
|
591
|
+
border: none;
|
|
592
|
+
background: none;
|
|
593
|
+
color: inherit;
|
|
594
|
+
font: inherit;
|
|
595
|
+
cursor: pointer;
|
|
596
|
+
}
|
|
597
|
+
.dots {
|
|
598
|
+
color: var(--kd-text-2, inherit);
|
|
599
|
+
letter-spacing: 0.1em;
|
|
600
|
+
}
|
|
601
|
+
code {
|
|
602
|
+
font-family: var(--kd-font-mono, monospace);
|
|
603
|
+
font-size: 12px;
|
|
604
|
+
overflow-wrap: anywhere;
|
|
605
|
+
white-space: pre-wrap;
|
|
606
|
+
user-select: all;
|
|
607
|
+
}
|
|
608
|
+
.hide {
|
|
609
|
+
margin-left: 6px;
|
|
610
|
+
color: var(--kd-text-dim, inherit);
|
|
611
|
+
}
|
|
612
|
+
`];
|
|
613
|
+
constructor() {
|
|
614
|
+
super(), this.shown = !1;
|
|
615
|
+
}
|
|
616
|
+
willUpdate(e) {
|
|
617
|
+
e.has("value") && e.get("value") !== void 0 && (this.shown = !1);
|
|
618
|
+
}
|
|
619
|
+
render() {
|
|
620
|
+
return this.shown ? t`<code>${this.value ?? ""}</code
|
|
621
|
+
><button type="button" class="hide" aria-label="hide" @click=${() => this.shown = !1}>×</button>` : t`<button type="button" aria-label="show" @click=${() => this.shown = !0}>
|
|
622
|
+
<span class="dots">••••••••</span>
|
|
623
|
+
</button>`;
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
c("kd-mask", B);
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region node_modules/lit-html/directive.js
|
|
629
|
+
var V = {
|
|
630
|
+
ATTRIBUTE: 1,
|
|
631
|
+
CHILD: 2,
|
|
632
|
+
PROPERTY: 3,
|
|
633
|
+
BOOLEAN_ATTRIBUTE: 4,
|
|
634
|
+
EVENT: 5,
|
|
635
|
+
ELEMENT: 6
|
|
636
|
+
}, H = (e) => (...t) => ({
|
|
637
|
+
_$litDirective$: e,
|
|
638
|
+
values: t
|
|
639
|
+
}), U = class {
|
|
640
|
+
constructor(e) {}
|
|
641
|
+
get _$AU() {
|
|
642
|
+
return this._$AM._$AU;
|
|
643
|
+
}
|
|
644
|
+
_$AT(e, t, n) {
|
|
645
|
+
this._$Ct = e, this._$AM = t, this._$Ci = n;
|
|
646
|
+
}
|
|
647
|
+
_$AS(e, t) {
|
|
648
|
+
return this.update(e, t);
|
|
649
|
+
}
|
|
650
|
+
update(e, t) {
|
|
651
|
+
return this.render(...t);
|
|
652
|
+
}
|
|
653
|
+
}, W = "important", ue = " !" + W, G = H(class extends U {
|
|
654
|
+
constructor(e) {
|
|
655
|
+
if (super(e), e.type !== V.ATTRIBUTE || e.name !== "style" || e.strings?.length > 2) throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.");
|
|
656
|
+
}
|
|
657
|
+
render(e) {
|
|
658
|
+
return Object.keys(e).reduce((t, n) => {
|
|
659
|
+
let r = e[n];
|
|
660
|
+
return r == null ? t : t + `${n = n.includes("-") ? n : n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, "-$&").toLowerCase()}:${r};`;
|
|
661
|
+
}, "");
|
|
662
|
+
}
|
|
663
|
+
update(e, [t]) {
|
|
664
|
+
let { style: n } = e.element;
|
|
665
|
+
if (this.ft === void 0) return this.ft = new Set(Object.keys(t)), this.render(t);
|
|
666
|
+
for (let e of this.ft) t[e] ?? (this.ft.delete(e), e.includes("-") ? n.removeProperty(e) : n[e] = null);
|
|
667
|
+
for (let e in t) {
|
|
668
|
+
let r = t[e];
|
|
669
|
+
if (r != null) {
|
|
670
|
+
this.ft.add(e);
|
|
671
|
+
let t = typeof r == "string" && r.endsWith(ue);
|
|
672
|
+
e.includes("-") || t ? n.setProperty(e, t ? r.slice(0, -11) : r, t ? W : "") : n[e] = r;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return o;
|
|
676
|
+
}
|
|
677
|
+
}), K = (e) => new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(e), q = class extends s {
|
|
678
|
+
static properties = { data: {
|
|
679
|
+
attribute: "data",
|
|
680
|
+
converter: a
|
|
681
|
+
} };
|
|
682
|
+
static styles = [
|
|
683
|
+
r,
|
|
684
|
+
C,
|
|
685
|
+
n`
|
|
686
|
+
.track {
|
|
687
|
+
position: relative;
|
|
688
|
+
height: 8px;
|
|
689
|
+
margin: 6px 0;
|
|
690
|
+
border-radius: 4px;
|
|
691
|
+
background: color-mix(in srgb, var(--kd-border-strong, currentColor) 35%, transparent);
|
|
692
|
+
}
|
|
693
|
+
.fill {
|
|
694
|
+
height: 100%;
|
|
695
|
+
border-radius: 4px;
|
|
696
|
+
background: var(--tone);
|
|
697
|
+
}
|
|
698
|
+
.mark {
|
|
699
|
+
position: absolute;
|
|
700
|
+
top: -3px;
|
|
701
|
+
bottom: -3px;
|
|
702
|
+
width: 2px;
|
|
703
|
+
background: var(--tone);
|
|
704
|
+
box-shadow: 0 0 0 1px var(--kd-bg, transparent);
|
|
705
|
+
}
|
|
706
|
+
.legend {
|
|
707
|
+
display: flex;
|
|
708
|
+
flex-wrap: wrap;
|
|
709
|
+
gap: 2px 20px;
|
|
710
|
+
font-size: 12px;
|
|
711
|
+
}
|
|
712
|
+
.value {
|
|
713
|
+
font-family: var(--kd-font-mono, monospace);
|
|
714
|
+
font-size: 14px;
|
|
715
|
+
}
|
|
716
|
+
.legend .mark-label {
|
|
717
|
+
color: var(--kd-text-2, inherit);
|
|
718
|
+
}
|
|
719
|
+
.legend .num {
|
|
720
|
+
color: var(--tone-ink);
|
|
721
|
+
font-family: var(--kd-font-mono, monospace);
|
|
722
|
+
}
|
|
723
|
+
.none {
|
|
724
|
+
color: var(--kd-text-dim, inherit);
|
|
725
|
+
}
|
|
726
|
+
`
|
|
727
|
+
];
|
|
728
|
+
render() {
|
|
729
|
+
let e = this.data;
|
|
730
|
+
if (!e || typeof e != "object") return i;
|
|
731
|
+
let n = typeof e.value == "number" && Number.isFinite(e.value) ? e.value : void 0, r = (e.marks ?? []).filter((e) => e && Number.isFinite(e.value)), a = e.unit ?? "", o = Math.max(n ?? 0, ...r.map((e) => e.value)), s = typeof e.max == "number" && e.max > 0 ? e.max : o > 0 ? o : 1, c = (e) => Math.min(1, Math.max(0, e)), l = (e) => `${Math.min(100, Math.max(0, e / s * 100))}%`, u = S((n === void 0 ? [] : r.filter((e) => e.tone && n >= e.value)).sort((e, t) => t.value - e.value)[0]?.tone, "primary");
|
|
732
|
+
return t`<div
|
|
733
|
+
role="meter"
|
|
734
|
+
aria-valuemin="0"
|
|
735
|
+
aria-valuemax=${s}
|
|
736
|
+
aria-valuenow=${n ?? i}
|
|
737
|
+
>
|
|
738
|
+
<div class="track">
|
|
739
|
+
${n === void 0 ? i : t`<div class="fill ${u}" style=${G({ width: l(n) })}></div>`}
|
|
740
|
+
${r.map((e) => t`<div
|
|
741
|
+
class="mark ${S(e.tone)}"
|
|
742
|
+
style=${G({ left: `calc(${l(e.value)} - ${c(e.value / s) * 2}px)` })}
|
|
743
|
+
title="${e.label} ${K(e.value)}${a}"
|
|
744
|
+
></div>`)}
|
|
745
|
+
</div>
|
|
746
|
+
<div class="legend">
|
|
747
|
+
<span class="value ${n === void 0 ? "none" : ""}">${n === void 0 ? "–" : `${K(n)}${a}`}</span>
|
|
748
|
+
${r.map((e) => t`<span class=${S(e.tone)}
|
|
749
|
+
><span class="mark-label">${e.label}</span> <span class="num">${K(e.value)}${a}</span></span
|
|
750
|
+
>`)}
|
|
751
|
+
</div>
|
|
752
|
+
</div>`;
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
c("kd-meter", q);
|
|
756
|
+
//#endregion
|
|
757
|
+
//#region src/kd/elements/sheet.ts
|
|
758
|
+
var J = class extends s {
|
|
759
|
+
static properties = { data: {
|
|
760
|
+
attribute: "data",
|
|
761
|
+
converter: a
|
|
762
|
+
} };
|
|
763
|
+
static styles = [
|
|
764
|
+
r,
|
|
765
|
+
F,
|
|
766
|
+
n`
|
|
767
|
+
dl {
|
|
768
|
+
display: grid;
|
|
769
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
770
|
+
margin: 0;
|
|
771
|
+
font-size: 13px;
|
|
772
|
+
}
|
|
773
|
+
dt,
|
|
774
|
+
dd {
|
|
775
|
+
margin: 0;
|
|
776
|
+
padding: 5px 12px 5px 0;
|
|
777
|
+
border-bottom: 1px solid var(--kd-border, transparent);
|
|
778
|
+
}
|
|
779
|
+
dt {
|
|
780
|
+
color: var(--kd-text-2, inherit);
|
|
781
|
+
}
|
|
782
|
+
dd {
|
|
783
|
+
overflow-wrap: anywhere;
|
|
784
|
+
}
|
|
785
|
+
`
|
|
786
|
+
];
|
|
787
|
+
render() {
|
|
788
|
+
let e = this.data;
|
|
789
|
+
if (!e || typeof e != "object") return i;
|
|
790
|
+
let n = Array.isArray(e) ? e : Object.entries(e).map(([e, t]) => ({
|
|
791
|
+
key: e,
|
|
792
|
+
value: t
|
|
793
|
+
}));
|
|
794
|
+
return t`<dl>
|
|
795
|
+
${n.filter((e) => e && !N(e.value)).map((e) => t`<dt>${e.key}</dt><dd>${P(e.value)}</dd>`)}
|
|
796
|
+
</dl>`;
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
c("kd-sheet", J);
|
|
800
|
+
//#endregion
|
|
801
|
+
//#region src/kd/elements/steps.ts
|
|
802
|
+
var de = {
|
|
803
|
+
done: "success",
|
|
804
|
+
active: "primary",
|
|
805
|
+
failed: "error",
|
|
806
|
+
pending: "neutral"
|
|
807
|
+
};
|
|
808
|
+
function fe(e, t) {
|
|
809
|
+
return e === "success" ? "✓" : e === "error" ? "✗" : e === "warning" ? "!" : String(t);
|
|
810
|
+
}
|
|
811
|
+
var Y = class extends s {
|
|
812
|
+
static properties = { data: {
|
|
813
|
+
attribute: "data",
|
|
814
|
+
converter: a
|
|
815
|
+
} };
|
|
816
|
+
static styles = [
|
|
817
|
+
r,
|
|
818
|
+
C,
|
|
819
|
+
n`
|
|
820
|
+
ol {
|
|
821
|
+
display: flex;
|
|
822
|
+
margin: 0;
|
|
823
|
+
padding: 0;
|
|
824
|
+
list-style: none;
|
|
825
|
+
}
|
|
826
|
+
li {
|
|
827
|
+
position: relative;
|
|
828
|
+
flex: 1;
|
|
829
|
+
min-width: 0;
|
|
830
|
+
text-align: center;
|
|
831
|
+
}
|
|
832
|
+
li + li::before {
|
|
833
|
+
content: '';
|
|
834
|
+
position: absolute;
|
|
835
|
+
top: 12px;
|
|
836
|
+
right: 50%;
|
|
837
|
+
width: 100%;
|
|
838
|
+
height: 2px;
|
|
839
|
+
background: var(--kd-border-strong, currentColor);
|
|
840
|
+
opacity: 0.6;
|
|
841
|
+
}
|
|
842
|
+
li.reached::before {
|
|
843
|
+
background: var(--tone);
|
|
844
|
+
opacity: 1;
|
|
845
|
+
}
|
|
846
|
+
.dot {
|
|
847
|
+
position: relative;
|
|
848
|
+
z-index: 1;
|
|
849
|
+
width: 26px;
|
|
850
|
+
height: 26px;
|
|
851
|
+
margin: 0 auto;
|
|
852
|
+
border-radius: 50%;
|
|
853
|
+
background: var(--tone);
|
|
854
|
+
color: var(--kd-bg, inherit);
|
|
855
|
+
font-size: 13px;
|
|
856
|
+
font-weight: 700;
|
|
857
|
+
line-height: 26px;
|
|
858
|
+
}
|
|
859
|
+
.neutral .dot {
|
|
860
|
+
border: 2px solid var(--tone-line);
|
|
861
|
+
background: var(--kd-bg, transparent);
|
|
862
|
+
color: var(--kd-text-2, inherit);
|
|
863
|
+
line-height: 22px;
|
|
864
|
+
}
|
|
865
|
+
.active .dot {
|
|
866
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 30%, transparent);
|
|
867
|
+
}
|
|
868
|
+
.label {
|
|
869
|
+
margin-top: 4px;
|
|
870
|
+
font-size: 12px;
|
|
871
|
+
}
|
|
872
|
+
.time,
|
|
873
|
+
.detail {
|
|
874
|
+
color: var(--kd-text-2, inherit);
|
|
875
|
+
font-size: 11px;
|
|
876
|
+
}
|
|
877
|
+
.detail {
|
|
878
|
+
display: -webkit-box;
|
|
879
|
+
overflow: hidden;
|
|
880
|
+
-webkit-box-orient: vertical;
|
|
881
|
+
-webkit-line-clamp: 2;
|
|
882
|
+
overflow-wrap: anywhere;
|
|
883
|
+
}
|
|
884
|
+
`
|
|
885
|
+
];
|
|
886
|
+
render() {
|
|
887
|
+
let e = Array.isArray(this.data) ? this.data : [];
|
|
888
|
+
return e.length ? t`<ol>
|
|
889
|
+
${e.map((e, n) => {
|
|
890
|
+
let r = S(de[e.status] ?? e.status), a = `${r}${e.status === "done" || e.status === "success" ? " reached" : ""}${e.status === "active" ? " active" : ""}`;
|
|
891
|
+
return t`<li class=${a} title=${d(e.detail)}>
|
|
892
|
+
<div class="dot">${fe(r, n + 1)}</div>
|
|
893
|
+
<div class="label">${e.label}</div>
|
|
894
|
+
${e.time ? t`<div class="time">${e.time}</div>` : i}
|
|
895
|
+
${e.detail ? t`<div class="detail">${e.detail}</div>` : i}
|
|
896
|
+
</li>`;
|
|
897
|
+
})}
|
|
898
|
+
</ol>` : i;
|
|
899
|
+
}
|
|
900
|
+
};
|
|
901
|
+
c("kd-steps", Y);
|
|
902
|
+
//#endregion
|
|
903
|
+
//#region src/kd/elements/table.ts
|
|
904
|
+
var X = class extends s {
|
|
905
|
+
static properties = {
|
|
906
|
+
data: {
|
|
907
|
+
attribute: "data",
|
|
908
|
+
converter: a
|
|
909
|
+
},
|
|
910
|
+
empty: {}
|
|
911
|
+
};
|
|
912
|
+
static styles = [
|
|
913
|
+
r,
|
|
914
|
+
F,
|
|
915
|
+
n`
|
|
916
|
+
table {
|
|
917
|
+
width: 100%;
|
|
918
|
+
border-collapse: collapse;
|
|
919
|
+
font-size: 13px;
|
|
920
|
+
}
|
|
921
|
+
th,
|
|
922
|
+
td {
|
|
923
|
+
padding: 6px 12px 6px 0;
|
|
924
|
+
border-bottom: 1px solid var(--kd-border, transparent);
|
|
925
|
+
text-align: left;
|
|
926
|
+
vertical-align: top;
|
|
927
|
+
}
|
|
928
|
+
th {
|
|
929
|
+
color: var(--kd-text-2, inherit);
|
|
930
|
+
font-size: 10px;
|
|
931
|
+
font-weight: 500;
|
|
932
|
+
letter-spacing: 0.08em;
|
|
933
|
+
text-transform: uppercase;
|
|
934
|
+
}
|
|
935
|
+
.center {
|
|
936
|
+
text-align: center;
|
|
937
|
+
}
|
|
938
|
+
.right {
|
|
939
|
+
text-align: right;
|
|
940
|
+
}
|
|
941
|
+
/* Prose breaks anywhere so one hash in a message cannot widen the table;
|
|
942
|
+
links keep whole words and stop at 40ch with an ellipsis instead. */
|
|
943
|
+
td {
|
|
944
|
+
--kd-link-max: 40ch;
|
|
945
|
+
overflow-wrap: anywhere;
|
|
946
|
+
}
|
|
947
|
+
.nowrap {
|
|
948
|
+
white-space: nowrap;
|
|
949
|
+
}
|
|
950
|
+
.nowrap .cells {
|
|
951
|
+
flex-wrap: nowrap;
|
|
952
|
+
}
|
|
953
|
+
.none {
|
|
954
|
+
padding: 8px 0;
|
|
955
|
+
color: var(--kd-text-dim, inherit);
|
|
956
|
+
}
|
|
957
|
+
`
|
|
958
|
+
];
|
|
959
|
+
render() {
|
|
960
|
+
let e = this.data;
|
|
961
|
+
if (!e || typeof e != "object") return i;
|
|
962
|
+
let { columns: n, rows: r = [] } = Array.isArray(e) ? {
|
|
963
|
+
columns: void 0,
|
|
964
|
+
rows: e
|
|
965
|
+
} : e;
|
|
966
|
+
if (!r.length) return t`<div class="none">${this.empty ?? "none"}</div>`;
|
|
967
|
+
let a = n ?? [...new Set(r.flatMap((e) => Object.keys(e ?? {})))].map((e) => ({ key: e })), o = (e) => e.align === "right" || e.align === "center" ? e.align : "", s = (e) => [o(e), e.nowrap ? "nowrap" : ""].filter(Boolean).join(" ");
|
|
968
|
+
return t`<table>
|
|
969
|
+
<thead>
|
|
970
|
+
<tr>
|
|
971
|
+
${a.map((e) => t`<th class=${o(e)}>${e.label ?? e.key}</th>`)}
|
|
972
|
+
</tr>
|
|
973
|
+
</thead>
|
|
974
|
+
<tbody>
|
|
975
|
+
${r.map((e) => t`<tr>
|
|
976
|
+
${a.map((n) => t`<td class=${s(n)}>${P(e?.[n.key])}</td>`)}
|
|
977
|
+
</tr>`)}
|
|
978
|
+
</tbody>
|
|
979
|
+
</table>`;
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
c("kd-table", X);
|
|
983
|
+
//#endregion
|
|
984
|
+
//#region src/kd/elements/tabs.ts
|
|
985
|
+
var Z = (e, t) => e.getAttribute("label") || `Tab ${t + 1}`, Q = class extends s {
|
|
986
|
+
static properties = {
|
|
987
|
+
selected: {},
|
|
988
|
+
key: {}
|
|
989
|
+
};
|
|
990
|
+
static shadowRootOptions = {
|
|
991
|
+
...e.shadowRootOptions,
|
|
992
|
+
slotAssignment: "manual"
|
|
993
|
+
};
|
|
994
|
+
static styles = [r, n`
|
|
995
|
+
[role='tablist'] {
|
|
996
|
+
display: flex;
|
|
997
|
+
flex-wrap: wrap;
|
|
998
|
+
gap: 0 22px;
|
|
999
|
+
margin-bottom: 10px;
|
|
1000
|
+
border-bottom: 1px solid var(--kd-border, transparent);
|
|
1001
|
+
}
|
|
1002
|
+
button {
|
|
1003
|
+
margin: 0 0 -1px;
|
|
1004
|
+
padding: 6px 1px;
|
|
1005
|
+
border: none;
|
|
1006
|
+
border-bottom: 2px solid transparent;
|
|
1007
|
+
background: none;
|
|
1008
|
+
color: var(--kd-text-2, inherit);
|
|
1009
|
+
font: inherit;
|
|
1010
|
+
font-size: 13px;
|
|
1011
|
+
cursor: pointer;
|
|
1012
|
+
}
|
|
1013
|
+
button:hover {
|
|
1014
|
+
color: var(--kd-text, inherit);
|
|
1015
|
+
}
|
|
1016
|
+
/* Grafana's own active tab is underlined in this orange. */
|
|
1017
|
+
button[aria-selected='true'] {
|
|
1018
|
+
border-bottom-color: var(--kd-warning, currentColor);
|
|
1019
|
+
color: var(--kd-text, inherit);
|
|
1020
|
+
}
|
|
1021
|
+
.count {
|
|
1022
|
+
margin-left: 2px;
|
|
1023
|
+
color: var(--kd-text-dim, inherit);
|
|
1024
|
+
font-size: 11px;
|
|
1025
|
+
}
|
|
1026
|
+
`];
|
|
1027
|
+
#e;
|
|
1028
|
+
connectedCallback() {
|
|
1029
|
+
super.connectedCallback(), this.#e ??= new MutationObserver(() => this.requestUpdate()), this.#e.observe(this, {
|
|
1030
|
+
childList: !0,
|
|
1031
|
+
subtree: !0,
|
|
1032
|
+
attributes: !0,
|
|
1033
|
+
attributeFilter: ["label", "count"]
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
disconnectedCallback() {
|
|
1037
|
+
super.disconnectedCallback(), this.#e?.disconnect();
|
|
1038
|
+
}
|
|
1039
|
+
get #t() {
|
|
1040
|
+
try {
|
|
1041
|
+
return this.ownerDocument?.defaultView?.sessionStorage ?? void 0;
|
|
1042
|
+
} catch {
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
willUpdate(e) {
|
|
1047
|
+
if (e.has("key") && this.key) try {
|
|
1048
|
+
let e = this.#t?.getItem(`kd-tabs:${this.key}`);
|
|
1049
|
+
e != null && (this.selected = e);
|
|
1050
|
+
} catch {}
|
|
1051
|
+
}
|
|
1052
|
+
#n() {
|
|
1053
|
+
return [...this.children];
|
|
1054
|
+
}
|
|
1055
|
+
#r(e) {
|
|
1056
|
+
let t = this.selected;
|
|
1057
|
+
if (t == null || t === "") return 0;
|
|
1058
|
+
let n = e.findIndex((e, n) => Z(e, n) === t);
|
|
1059
|
+
if (n >= 0) return n;
|
|
1060
|
+
let r = Number(t);
|
|
1061
|
+
return Number.isInteger(r) && r >= 0 && r < e.length ? r : 0;
|
|
1062
|
+
}
|
|
1063
|
+
#i(e, t) {
|
|
1064
|
+
let n = Z(e[t], t);
|
|
1065
|
+
if (this.key) try {
|
|
1066
|
+
this.#t?.setItem(`kd-tabs:${this.key}`, n);
|
|
1067
|
+
} catch {}
|
|
1068
|
+
n !== this.selected && (this.selected = n, this.dispatchEvent(new CustomEvent("change", {
|
|
1069
|
+
detail: {
|
|
1070
|
+
label: n,
|
|
1071
|
+
index: t
|
|
1072
|
+
},
|
|
1073
|
+
bubbles: !0,
|
|
1074
|
+
composed: !0
|
|
1075
|
+
})));
|
|
1076
|
+
}
|
|
1077
|
+
render() {
|
|
1078
|
+
let e = this.#n();
|
|
1079
|
+
if (!e.length) return i;
|
|
1080
|
+
let n = this.#r(e);
|
|
1081
|
+
return t`<div role="tablist">
|
|
1082
|
+
${e.map((r, a) => {
|
|
1083
|
+
let o = r.getAttribute("count");
|
|
1084
|
+
return t`<button
|
|
1085
|
+
type="button"
|
|
1086
|
+
role="tab"
|
|
1087
|
+
aria-selected=${a === n ? "true" : "false"}
|
|
1088
|
+
@click=${() => this.#i(e, a)}
|
|
1089
|
+
>
|
|
1090
|
+
${Z(r, a)}${o ? t`<span class="count">${o}</span>` : i}
|
|
1091
|
+
</button>`;
|
|
1092
|
+
})}
|
|
1093
|
+
</div>
|
|
1094
|
+
${e.map((e, r) => t`<div role="tabpanel" ?hidden=${r !== n}><slot></slot></div>`)}`;
|
|
1095
|
+
}
|
|
1096
|
+
updated() {
|
|
1097
|
+
let e = this.renderRoot.querySelectorAll("slot");
|
|
1098
|
+
this.#n().forEach((t, n) => e[n]?.assign(t));
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
c("kd-tabs", Q);
|
|
1102
|
+
//#endregion
|
|
1103
|
+
//#region src/kd/elements/tile.ts
|
|
1104
|
+
var $ = class extends s {
|
|
1105
|
+
static properties = {
|
|
1106
|
+
icon: {},
|
|
1107
|
+
label: {},
|
|
1108
|
+
href: {}
|
|
1109
|
+
};
|
|
1110
|
+
static styles = [r, n`
|
|
1111
|
+
a,
|
|
1112
|
+
div {
|
|
1113
|
+
display: block;
|
|
1114
|
+
padding-top: 6px;
|
|
1115
|
+
color: inherit;
|
|
1116
|
+
text-align: center;
|
|
1117
|
+
text-decoration: none;
|
|
1118
|
+
}
|
|
1119
|
+
.icon {
|
|
1120
|
+
display: block;
|
|
1121
|
+
height: 30px;
|
|
1122
|
+
margin: 0 auto;
|
|
1123
|
+
font-size: 30px;
|
|
1124
|
+
line-height: 1;
|
|
1125
|
+
}
|
|
1126
|
+
.label {
|
|
1127
|
+
display: block;
|
|
1128
|
+
margin-top: 6px;
|
|
1129
|
+
color: var(--kd-text-2, inherit);
|
|
1130
|
+
font-size: 12px;
|
|
1131
|
+
}
|
|
1132
|
+
`];
|
|
1133
|
+
render() {
|
|
1134
|
+
let e = t`${w(this.icon)}<span class="label">${this.label ?? ""}</span>`, n = T(this.href);
|
|
1135
|
+
if (!n) return t`<div>${e}</div>`;
|
|
1136
|
+
let r = /^https?:/i.test(n);
|
|
1137
|
+
return t`<a
|
|
1138
|
+
href=${n}
|
|
1139
|
+
target=${d(r ? "_blank" : void 0)}
|
|
1140
|
+
rel=${d(r ? "noopener" : void 0)}
|
|
1141
|
+
>${e}</a
|
|
1142
|
+
>`;
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
c("kd-tile", $);
|
|
1146
|
+
//#endregion
|
|
1147
|
+
export { b as C, u as E, m as S, l as T, w as _, J as a, C as b, z as c, F as d, N as f, D as g, j as h, Y as i, L as l, M as m, Q as n, q as o, P as p, X as r, B as s, $ as t, I as u, T as v, y as w, x, S as y };
|
|
1148
|
+
|
|
1149
|
+
//# sourceMappingURL=kd-BeZbw7cp.js.map
|