@nonoun/native-ui 0.2.9 → 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.
Files changed (41) hide show
  1. package/dist/{ui-layout-inspector-element.js → components.js} +2279 -386
  2. package/dist/{register-all2.js → core.js} +78 -35
  3. package/dist/custom-elements.json +1999 -1999
  4. package/dist/kernel.js +175 -174
  5. package/dist/native-ui.js +4 -49
  6. package/dist/register-all.js +4 -4
  7. package/dist/traits.js +3 -5
  8. package/dist/ui-icon.js +56 -0
  9. package/package.json +6 -9
  10. package/dist/dialog-controller.js +0 -391
  11. package/dist/inspector/build-inspector.d.ts +0 -8
  12. package/dist/inspector/build-inspector.d.ts.map +0 -1
  13. package/dist/inspector/ds-color-swatch-element.d.ts +0 -15
  14. package/dist/inspector/ds-color-swatch-element.d.ts.map +0 -1
  15. package/dist/inspector/ds-color-swatch.d.ts +0 -3
  16. package/dist/inspector/ds-color-swatch.d.ts.map +0 -1
  17. package/dist/inspector/ds-colors-element.d.ts +0 -14
  18. package/dist/inspector/ds-colors-element.d.ts.map +0 -1
  19. package/dist/inspector/ds-colors.d.ts +0 -4
  20. package/dist/inspector/ds-colors.d.ts.map +0 -1
  21. package/dist/inspector/ds-inspector-element.d.ts +0 -15
  22. package/dist/inspector/ds-inspector-element.d.ts.map +0 -1
  23. package/dist/inspector/ds-inspector.d.ts +0 -3
  24. package/dist/inspector/ds-inspector.d.ts.map +0 -1
  25. package/dist/inspector/ds-themes-element.d.ts +0 -13
  26. package/dist/inspector/ds-themes-element.d.ts.map +0 -1
  27. package/dist/inspector/ds-themes.d.ts +0 -4
  28. package/dist/inspector/ds-themes.d.ts.map +0 -1
  29. package/dist/inspector/ds-variable-element.d.ts +0 -19
  30. package/dist/inspector/ds-variable-element.d.ts.map +0 -1
  31. package/dist/inspector/ds-variable.d.ts +0 -4
  32. package/dist/inspector/ds-variable.d.ts.map +0 -1
  33. package/dist/inspector/index.d.ts +0 -10
  34. package/dist/inspector/index.d.ts.map +0 -1
  35. package/dist/inspector.css +0 -231
  36. package/dist/inspector.d.ts +0 -11
  37. package/dist/inspector.d.ts.map +0 -1
  38. package/dist/inspector.js +0 -610
  39. package/dist/list-navigate-controller.js +0 -457
  40. package/dist/ui-icon-element.js +0 -986
  41. package/dist/uid.js +0 -147
package/dist/inspector.js DELETED
@@ -1,610 +0,0 @@
1
- import { n as e, t } from "./uid.js";
2
- import { u as n } from "./list-navigate-controller.js";
3
- import { a as r, c as i, l as a, o, t as s, u as c } from "./ui-icon-element.js";
4
- var l = class extends n {
5
- static observedAttributes = ["data"];
6
- #e = null;
7
- #t = null;
8
- #n = null;
9
- attributeChangedCallback(e, t, n) {
10
- if (t !== n && e === "data" && n) {
11
- try {
12
- this.#e = JSON.parse(n);
13
- } catch {}
14
- this.#t && this.#a();
15
- }
16
- }
17
- setup() {
18
- super.setup();
19
- let e = this.getAttribute("data");
20
- if (e) try {
21
- this.#e = JSON.parse(e);
22
- } catch {}
23
- this.#a(), this.addEventListener("ds-theme-change", this.#r);
24
- }
25
- teardown() {
26
- this.removeEventListener("ds-theme-change", this.#r), this.innerHTML = "", this.#t = null, this.#n = null, super.teardown();
27
- }
28
- #r = () => {
29
- requestAnimationFrame(() => this.#i());
30
- };
31
- sync() {
32
- this.#i();
33
- }
34
- #i() {
35
- if (!this.#e || !this.#t || !this.#n) return;
36
- let e = getComputedStyle(document.documentElement).getPropertyValue(this.#e.token).trim();
37
- if (e) {
38
- this.#t.value = parseFloat(e);
39
- let t = this.#e.step ?? .01;
40
- this.#n.textContent = parseFloat(e).toFixed(t < .01 ? 3 : 2);
41
- }
42
- }
43
- #a() {
44
- if (!this.#e) return;
45
- let e = this.#e;
46
- this.innerHTML = "";
47
- let t = document.createElement("div");
48
- t.className = "ds-variable-row";
49
- let n = document.createElement("label");
50
- n.className = "ds-variable-label", n.textContent = e.name;
51
- let r = document.createElement("ui-range");
52
- r.setAttribute("min", String(e.min ?? 0)), r.setAttribute("max", String(e.max ?? 1)), r.setAttribute("step", String(e.step ?? .01)), r.setAttribute("size", "xs");
53
- let i = getComputedStyle(document.documentElement).getPropertyValue(e.token).trim(), a = i ? parseFloat(i) : e.value;
54
- r.setAttribute("value", String(a));
55
- let o = e.step ?? .01, s = document.createElement("span");
56
- s.className = "ds-variable-value", s.textContent = a.toFixed(o < .01 ? 3 : 2), r.addEventListener("ui-input", ((t) => {
57
- let n = t.detail.value;
58
- document.documentElement.style.setProperty(e.token, String(n)), s.textContent = n.toFixed(o < .01 ? 3 : 2), this.dispatchEvent(new CustomEvent("ds-change", {
59
- bubbles: !0,
60
- detail: {
61
- token: e.token,
62
- value: n
63
- }
64
- }));
65
- })), this.#t = r, this.#n = s, t.append(n, r, s), this.appendChild(t);
66
- }
67
- }, u = class extends n {
68
- static observedAttributes = ["data"];
69
- #e = [];
70
- attributeChangedCallback(e, t, n) {
71
- if (t !== n && e === "data" && n) {
72
- try {
73
- this.#e = JSON.parse(n);
74
- } catch {}
75
- this.isConnected && this.#n();
76
- }
77
- }
78
- setup() {
79
- super.setup();
80
- let e = this.getAttribute("data");
81
- if (e) try {
82
- this.#e = JSON.parse(e);
83
- } catch {}
84
- this.#n(), this.addEventListener("ds-change", this.#t), this.addEventListener("ds-theme-change", this.#t);
85
- }
86
- teardown() {
87
- this.removeEventListener("ds-change", this.#t), this.removeEventListener("ds-theme-change", this.#t), this.innerHTML = "", super.teardown();
88
- }
89
- #t = () => {
90
- requestAnimationFrame(() => this.#r());
91
- };
92
- refresh() {
93
- this.#r();
94
- }
95
- #n() {
96
- this.innerHTML = "";
97
- let e = document.createElement("div");
98
- e.className = "ds-colors-strip";
99
- for (let t of this.#e) {
100
- let n = document.createElement("ds-color-swatch");
101
- n.setAttribute("token", t.token), n.setAttribute("name", t.name), e.appendChild(n);
102
- }
103
- this.appendChild(e);
104
- }
105
- #r() {
106
- this.querySelectorAll("ds-color-swatch").forEach((e) => e.refresh());
107
- }
108
- };
109
- /** Parse a computed `rgb(...)` / `rgba(...)` string into [r, g, b, a] (0–255, 0–1). */
110
- function d(e) {
111
- let t = e.match(/[\d.]+/g);
112
- return !t || t.length < 3 ? [
113
- 0,
114
- 0,
115
- 0,
116
- 1
117
- ] : [
118
- Number(t[0]),
119
- Number(t[1]),
120
- Number(t[2]),
121
- t[3] === void 0 ? 1 : Number(t[3])
122
- ];
123
- }
124
- /** Relative luminance (ITU-R BT.709). Returns true if light. */
125
- function f(e, t, n) {
126
- let r = [
127
- e,
128
- t,
129
- n
130
- ].map((e) => (e /= 255, e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4));
131
- return .2126 * r[0] + .7152 * r[1] + .0722 * r[2] > .4;
132
- }
133
- /** Convert 0–255 component to 2-digit hex. */
134
- function p(e) {
135
- return Math.round(e).toString(16).padStart(2, "0");
136
- }
137
- /** sRGB → linear. */
138
- function m(e) {
139
- return e /= 255, e <= .04045 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
140
- }
141
- /** linear → sRGB (0–1 range). */
142
- /** sRGB (0–255) → OKLCH via OKLab. Returns [L (0–1), C, H (degrees)]. */
143
- function h(e, t, n) {
144
- let r = m(e), i = m(t), a = m(n), o = .4122214708 * r + .5363325363 * i + .0514459929 * a, s = .2119034982 * r + .6806995451 * i + .1073969566 * a, c = .0883024619 * r + .2817188376 * i + .6299787005 * a, l = Math.cbrt(o), u = Math.cbrt(s), d = Math.cbrt(c), f = .2104542553 * l + .793617785 * u - .0040720468 * d, p = 1.9779984951 * l - 2.428592205 * u + .4505937099 * d, h = .0259040371 * l + .7827717662 * u - .808675766 * d, g = Math.sqrt(p * p + h * h), _ = Math.atan2(h, p) * (180 / Math.PI);
145
- return _ < 0 && (_ += 360), [
146
- f,
147
- g,
148
- _
149
- ];
150
- }
151
- /** sRGB (0–255) → HSL. Returns [H (0–360), S (0–100), L (0–100)]. */
152
- function g(e, t, n) {
153
- e /= 255, t /= 255, n /= 255;
154
- let r = Math.max(e, t, n), i = Math.min(e, t, n), a = r - i, o = (r + i) / 2;
155
- if (a === 0) return [
156
- 0,
157
- 0,
158
- o * 100
159
- ];
160
- let s = a / (1 - Math.abs(2 * o - 1)), c = 0;
161
- return c = r === e ? ((t - n) / a + 6) % 6 : r === t ? (n - e) / a + 2 : (e - t) / a + 4, [
162
- c * 60,
163
- s * 100,
164
- o * 100
165
- ];
166
- }
167
- /** sRGB (0–255) → HSB/HSV. Returns [H (0–360), S (0–100), B (0–100)]. */
168
- function _(e, t, n) {
169
- e /= 255, t /= 255, n /= 255;
170
- let r = Math.max(e, t, n), i = r - Math.min(e, t, n), a = r * 100;
171
- if (r === 0) return [
172
- 0,
173
- 0,
174
- a
175
- ];
176
- let o = i / r * 100, s = 0;
177
- return i !== 0 && (s = r === e ? ((t - n) / i + 6) % 6 : r === t ? (n - e) / i + 2 : (e - t) / i + 4, s *= 60), [
178
- s,
179
- o,
180
- a
181
- ];
182
- }
183
- function v(e, t, n, r) {
184
- let [i, a, o] = h(e, t, n), s = `oklch(${(i * 100).toFixed(1)}% ${a.toFixed(4)} ${o.toFixed(1)})`;
185
- return r < 1 ? `oklch(${(i * 100).toFixed(1)}% ${a.toFixed(4)} ${o.toFixed(1)} / ${r.toFixed(2)})` : s;
186
- }
187
- function y(e, t, n, r) {
188
- let i = `#${p(e)}${p(t)}${p(n)}`;
189
- return r < 1 ? `${i}${p(Math.round(r * 255))}` : i;
190
- }
191
- function b(e, t, n, r) {
192
- return r < 1 ? `rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${r.toFixed(2)})` : `rgb(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)})`;
193
- }
194
- function x(e, t, n, r) {
195
- let [i, a, o] = g(e, t, n);
196
- return r < 1 ? `hsla(${i.toFixed(0)}, ${a.toFixed(1)}%, ${o.toFixed(1)}%, ${r.toFixed(2)})` : `hsl(${i.toFixed(0)}, ${a.toFixed(1)}%, ${o.toFixed(1)}%)`;
197
- }
198
- function S(e, t, n, r) {
199
- let [i, a, o] = _(e, t, n);
200
- return `hsb(${i.toFixed(0)}, ${a.toFixed(1)}%, ${o.toFixed(1)}%)`;
201
- }
202
- var C = [
203
- {
204
- label: "OKLCH",
205
- fn: v
206
- },
207
- {
208
- label: "HEX",
209
- fn: y
210
- },
211
- {
212
- label: "RGB",
213
- fn: b
214
- },
215
- {
216
- label: "HSL",
217
- fn: x
218
- },
219
- {
220
- label: "HSB",
221
- fn: S
222
- }
223
- ], w = class extends n {
224
- static observedAttributes = ["token", "name"];
225
- #e = null;
226
- #t = null;
227
- #n = "";
228
- get token() {
229
- return this.getAttribute("token") ?? "";
230
- }
231
- set token(e) {
232
- this.setAttribute("token", e);
233
- }
234
- get name() {
235
- return this.getAttribute("name") ?? "";
236
- }
237
- set name(e) {
238
- this.setAttribute("name", e);
239
- }
240
- attributeChangedCallback(e, t, n) {
241
- t !== n && (e === "token" && this.isConnected && (this.style.background = n ? `var(${n})` : "", this.title = `${this.name}\n${n}`, requestAnimationFrame(() => this.#a())), e === "name" && this.#t && (this.#t.textContent = n ?? "", this.title = `${n}\n${this.token}`));
242
- }
243
- setup() {
244
- super.setup(), this.token && (this.style.background = `var(${this.token})`, this.title = `${this.name}\n${this.token}`);
245
- let e = document.createElement("span");
246
- e.className = "ds-swatch-label", e.textContent = this.name, this.#t = e, this.appendChild(e), this.#n = t("swatch"), this.style.setProperty("anchor-name", `--${this.#n}`);
247
- let n = document.createElement("div");
248
- n.className = "ds-swatch-popover", n.setAttribute("popover", "auto"), n.style.setProperty("position-anchor", `--${this.#n}`), this.#e = n, this.appendChild(n), this.addEventListener("click", this.#i), this.addEventListener("ds-change", this.#r), this.addEventListener("ds-theme-change", this.#r), requestAnimationFrame(() => this.#a());
249
- }
250
- teardown() {
251
- this.removeEventListener("click", this.#i), this.removeEventListener("ds-change", this.#r), this.removeEventListener("ds-theme-change", this.#r), this.#e = null, this.#t = null, this.innerHTML = "", super.teardown();
252
- }
253
- /** Refresh background and contrast from current token value. */
254
- refresh() {
255
- this.token && (this.style.background = `var(${this.token})`), this.#a();
256
- }
257
- #r = () => {
258
- requestAnimationFrame(() => this.refresh());
259
- };
260
- #i = (e) => {
261
- if (!(this.#e && e.target.closest(".ds-swatch-popover")) && this.#e) {
262
- this.#o();
263
- try {
264
- this.#e.showPopover();
265
- } catch {}
266
- }
267
- };
268
- #a() {
269
- let e = getComputedStyle(this).backgroundColor, [t, n, r] = d(e);
270
- this.#t && (this.#t.style.color = f(t, n, r) ? "rgba(0,0,0,0.55)" : "rgba(255,255,255,0.7)");
271
- }
272
- #o() {
273
- if (!this.#e) return;
274
- this.#e.innerHTML = "";
275
- let e = getComputedStyle(this).backgroundColor, [t, n, r, i] = d(e), a = document.createElement("div");
276
- a.className = "ds-swatch-popover-header", a.textContent = this.token, this.#e.appendChild(a);
277
- for (let e of C) {
278
- let a = e.fn(t, n, r, i), o = document.createElement("button");
279
- o.className = "ds-swatch-popover-row", o.type = "button";
280
- let s = document.createElement("span");
281
- s.className = "ds-swatch-popover-label", s.textContent = e.label;
282
- let c = document.createElement("span");
283
- c.className = "ds-swatch-popover-value", c.textContent = a, o.append(s, c), o.addEventListener("click", (e) => {
284
- e.stopPropagation(), navigator.clipboard.writeText(a).then(() => {
285
- c.textContent = "Copied!", setTimeout(() => {
286
- c.textContent = a;
287
- }, 1200);
288
- });
289
- }), this.#e.appendChild(o);
290
- }
291
- }
292
- }, T = /* @__PURE__ */ "color-env-lightness-min.color-env-lightness-max.color-env-lightness-delta.color-env-chroma.color-env-chroma-k-muted.color-env-chroma-k-vivid.color-env-chroma-k-edge.color-env-alpha.color-env-alpha-delta.color-env-hue-neutral.color-env-chroma-neutral.color-env-lightness-neutral.color-env-hue-accent.color-env-chroma-accent.color-env-lightness-accent.color-env-hue-info.color-env-chroma-info.color-env-lightness-info.color-env-hue-success.color-env-chroma-success.color-env-lightness-success.color-env-hue-warning.color-env-chroma-warning.color-env-lightness-warning.color-env-hue-danger.color-env-chroma-danger.color-env-lightness-danger".split("."), E = class extends n {
293
- static observedAttributes = ["data"];
294
- #e = [];
295
- attributeChangedCallback(e, t, n) {
296
- if (t !== n && e === "data" && n) {
297
- try {
298
- this.#e = JSON.parse(n);
299
- } catch {}
300
- this.isConnected && this.#t();
301
- }
302
- }
303
- setup() {
304
- super.setup();
305
- let e = this.getAttribute("data");
306
- if (e) try {
307
- this.#e = JSON.parse(e);
308
- } catch {}
309
- this.#t();
310
- }
311
- teardown() {
312
- this.innerHTML = "", super.teardown();
313
- }
314
- #t() {
315
- this.innerHTML = "";
316
- let e = document.documentElement.getAttribute("theme") ?? "", t = document.createElement("ui-select");
317
- t.setAttribute("size", "xs"), t.setAttribute("placeholder", "Theme..."), t.setAttribute("options", JSON.stringify(this.#e.map((e) => ({
318
- value: e.value,
319
- label: e.name
320
- })))), t.setAttribute("value", e), t.addEventListener("ui-change", ((e) => {
321
- this.#n(e.detail.value);
322
- })), this.appendChild(t);
323
- }
324
- #n(e) {
325
- let t = document.documentElement;
326
- for (let e of T) t.style.removeProperty("--" + e);
327
- e ? t.setAttribute("theme", e) : t.removeAttribute("theme"), this.dispatchEvent(new CustomEvent("ds-theme-change", {
328
- bubbles: !0,
329
- detail: { theme: e }
330
- }));
331
- }
332
- }, D = [
333
- {
334
- name: "Default",
335
- value: ""
336
- },
337
- {
338
- name: "Forest",
339
- value: "forest"
340
- },
341
- {
342
- name: "Rose",
343
- value: "rose"
344
- },
345
- {
346
- name: "Zinc",
347
- value: "zinc"
348
- }
349
- ], O = [
350
- {
351
- name: "L min",
352
- token: "--color-env-lightness-min",
353
- value: .15,
354
- step: .01,
355
- min: 0,
356
- max: 1,
357
- group: "Lightness"
358
- },
359
- {
360
- name: "L max",
361
- token: "--color-env-lightness-max",
362
- value: 1,
363
- step: .01,
364
- min: 0,
365
- max: 1,
366
- group: "Lightness"
367
- },
368
- {
369
- name: "L delta",
370
- token: "--color-env-lightness-delta",
371
- value: .015,
372
- step: .005,
373
- min: 0,
374
- max: .15,
375
- group: "Lightness"
376
- },
377
- {
378
- name: "Chroma",
379
- token: "--color-env-chroma",
380
- value: .2,
381
- step: .005,
382
- min: 0,
383
- max: .5,
384
- group: "Chroma"
385
- },
386
- {
387
- name: "C muted",
388
- token: "--color-env-chroma-k-muted",
389
- value: .125,
390
- step: .01,
391
- min: 0,
392
- max: 1,
393
- group: "Chroma"
394
- },
395
- {
396
- name: "C vivid",
397
- token: "--color-env-chroma-k-vivid",
398
- value: 1,
399
- step: .01,
400
- min: 0,
401
- max: 1,
402
- group: "Chroma"
403
- },
404
- {
405
- name: "C edge",
406
- token: "--color-env-chroma-k-edge",
407
- value: .05,
408
- step: .01,
409
- min: 0,
410
- max: 1,
411
- group: "Chroma"
412
- },
413
- {
414
- name: "Alpha",
415
- token: "--color-env-alpha",
416
- value: .85,
417
- step: .01,
418
- min: 0,
419
- max: 1,
420
- group: "Alpha"
421
- },
422
- {
423
- name: "A delta",
424
- token: "--color-env-alpha-delta",
425
- value: .02,
426
- step: .005,
427
- min: 0,
428
- max: .15,
429
- group: "Alpha"
430
- }
431
- ], k = [
432
- "neutral",
433
- "accent",
434
- "info",
435
- "success",
436
- "warning",
437
- "danger"
438
- ], A = [
439
- "lowest",
440
- "lower",
441
- "low",
442
- "base",
443
- "high",
444
- "higher",
445
- "highest"
446
- ], j = [
447
- "brightest",
448
- "brighter",
449
- "bright",
450
- "base",
451
- "dim",
452
- "dimmer",
453
- "dimmest"
454
- ], M = [
455
- "1",
456
- "2",
457
- "3",
458
- "4",
459
- "5",
460
- "6",
461
- "7",
462
- "8",
463
- "9",
464
- "10",
465
- "11"
466
- ], N = [
467
- "050",
468
- "100",
469
- "200",
470
- "300",
471
- "400",
472
- "500",
473
- "600",
474
- "700",
475
- "800",
476
- "900",
477
- "950"
478
- ], P = [
479
- "strongest",
480
- "stronger",
481
- "strong",
482
- "base",
483
- "weak",
484
- "weaker",
485
- "weakest"
486
- ];
487
- function F(e, t) {
488
- let n = document.createElement("div");
489
- n.className = "ds-inspector-section", t && (n.dataset.family = t);
490
- let r = document.createElement("h3");
491
- return r.className = "ds-inspector-heading", r.textContent = e, n.appendChild(r), n;
492
- }
493
- function I(e) {
494
- let t = document.createElement("h4");
495
- return t.className = "ds-inspector-subheading", t.textContent = e, t;
496
- }
497
- function L(e) {
498
- let t = document.createElement("ds-colors");
499
- return t.setAttribute("data", JSON.stringify(e)), t;
500
- }
501
- function R(e) {
502
- let t = document.createElement("ds-variable");
503
- return t.setAttribute("data", JSON.stringify({
504
- name: e.name,
505
- type: "number",
506
- token: e.token,
507
- value: e.value,
508
- step: e.step,
509
- min: e.min,
510
- max: e.max
511
- })), t;
512
- }
513
- function z(e) {
514
- let t = document.createElement("div");
515
- t.className = "ds-inspector-toolbar";
516
- let n = document.createElement("ds-themes");
517
- n.setAttribute("data", JSON.stringify(D)), t.appendChild(n);
518
- let r = [{
519
- value: "all",
520
- label: "All Families"
521
- }, ...k.map((e) => ({
522
- value: e,
523
- label: e.charAt(0).toUpperCase() + e.slice(1)
524
- }))], i = document.createElement("ui-select");
525
- i.setAttribute("size", "xs"), i.setAttribute("placeholder", "Family..."), i.setAttribute("options", JSON.stringify(r)), i.setAttribute("value", "all"), t.appendChild(i), e.appendChild(t);
526
- let a = "", o = null;
527
- for (let t of O) t.group !== a && (a = t.group, o = F(t.group, "env"), e.appendChild(o)), o.appendChild(R(t));
528
- for (let t of k) {
529
- let n = F(t.charAt(0).toUpperCase() + t.slice(1), t);
530
- n.appendChild(R({
531
- name: "Hue",
532
- token: `--color-env-hue-${t}`,
533
- value: 230,
534
- step: 1,
535
- min: 0,
536
- max: 360
537
- })), n.appendChild(R({
538
- name: "Chroma",
539
- token: `--color-env-chroma-${t}`,
540
- value: .5,
541
- step: .01,
542
- min: 0,
543
- max: 1
544
- })), n.appendChild(R({
545
- name: "Lightness",
546
- token: `--color-env-lightness-${t}`,
547
- value: .5,
548
- step: .01,
549
- min: 0,
550
- max: 1
551
- })), n.appendChild(I("Elevation")), n.appendChild(L(A.map((e) => ({
552
- name: e,
553
- token: `--${t}-${e}`
554
- })))), n.appendChild(I("Brightness")), n.appendChild(L(j.map((e) => ({
555
- name: e,
556
- token: `--${t}-${e}`
557
- })))), n.appendChild(I("Solid")), n.appendChild(L(M.map((e) => ({
558
- name: e,
559
- token: `--${t}-${e}`
560
- })))), n.appendChild(I("Scrim")), n.appendChild(L(M.map((e) => ({
561
- name: e,
562
- token: `--${t}-${e}-scrim`
563
- })))), n.appendChild(I("Semantic")), n.appendChild(L(N.map((e) => ({
564
- name: e,
565
- token: `--${t}-${e}`
566
- })))), n.appendChild(I("Semantic Scrim")), n.appendChild(L(N.map((e) => ({
567
- name: e,
568
- token: `--${t}-${e}-scrim`
569
- })))), n.appendChild(I("Tint")), n.appendChild(L(P.map((e) => ({
570
- name: e,
571
- token: `--${t}-scrim-tint-${e}`
572
- })))), n.appendChild(I("Shade")), n.appendChild(L(P.map((e) => ({
573
- name: e,
574
- token: `--${t}-scrim-shade-${e}`
575
- })))), e.appendChild(n);
576
- }
577
- i.addEventListener("ui-change", ((t) => {
578
- let n = t.detail.value, r = e.querySelectorAll(".ds-inspector-section[data-family]");
579
- for (let e of r) {
580
- let t = e.dataset.family;
581
- n === "all" || t === "env" ? e.hidden = !1 : e.hidden = t !== n;
582
- }
583
- requestAnimationFrame(() => {
584
- e.querySelectorAll("ds-colors").forEach((e) => e.refresh());
585
- });
586
- })), e.addEventListener("ds-theme-change", () => {
587
- requestAnimationFrame(() => {
588
- e.querySelectorAll("ds-variable").forEach((e) => e.sync());
589
- });
590
- });
591
- }
592
- /**
593
- * Self-contained design system inspector.
594
- *
595
- * Stamps the full color/variable inspector UI on connection.
596
- * Consumer usage: `<ds-inspector></ds-inspector>`.
597
- *
598
- * All `ds-*` sub-elements are registered by the `@nonoun/native-ui/inspector`
599
- * entry point as a side effect of import.
600
- */
601
- var B = class extends n {
602
- setup() {
603
- super.setup(), z(this);
604
- }
605
- teardown() {
606
- this.innerHTML = "", super.teardown();
607
- }
608
- };
609
- e("ds-variable", l), e("ds-colors", u), e("ds-color-swatch", w), e("ds-themes", E), e("ds-inspector", B), e("ui-range", r), e("ui-select", o), e("ui-button", c), e("ui-icon", s), e("ui-listbox", a), e("ui-option", i);
610
- export { w as DSColorSwatch, u as DSColors, B as DSInspector, E as DSThemes, l as DSVariable, z as buildInspector };