@nonoun/native-ui 0.2.1 → 0.2.3

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 (37) hide show
  1. package/dist/custom-elements.json +1354 -1354
  2. package/dist/define.js +62 -0
  3. package/dist/dialog-controller.js +48 -169
  4. package/dist/inspector.css +231 -0
  5. package/dist/inspector.d.ts +7 -0
  6. package/dist/inspector.d.ts.map +1 -0
  7. package/dist/inspector.js +591 -0
  8. package/dist/kernel.js +182 -181
  9. package/dist/native-ui.js +7 -5
  10. package/dist/nav/inspector/build-inspector.d.ts +8 -0
  11. package/dist/nav/inspector/build-inspector.d.ts.map +1 -0
  12. package/dist/nav/inspector/ds-color-swatch-element.d.ts +15 -0
  13. package/dist/nav/inspector/ds-color-swatch-element.d.ts.map +1 -0
  14. package/dist/nav/inspector/ds-color-swatch.d.ts +3 -0
  15. package/dist/nav/inspector/ds-color-swatch.d.ts.map +1 -0
  16. package/dist/nav/inspector/ds-colors-element.d.ts +14 -0
  17. package/dist/nav/inspector/ds-colors-element.d.ts.map +1 -0
  18. package/dist/nav/inspector/ds-colors.d.ts +4 -0
  19. package/dist/nav/inspector/ds-colors.d.ts.map +1 -0
  20. package/dist/nav/inspector/ds-themes-element.d.ts +13 -0
  21. package/dist/nav/inspector/ds-themes-element.d.ts.map +1 -0
  22. package/dist/nav/inspector/ds-themes.d.ts +4 -0
  23. package/dist/nav/inspector/ds-themes.d.ts.map +1 -0
  24. package/dist/nav/inspector/ds-variable-element.d.ts +19 -0
  25. package/dist/nav/inspector/ds-variable-element.d.ts.map +1 -0
  26. package/dist/nav/inspector/ds-variable.d.ts +4 -0
  27. package/dist/nav/inspector/ds-variable.d.ts.map +1 -0
  28. package/dist/nav/inspector/index.d.ts +9 -0
  29. package/dist/nav/inspector/index.d.ts.map +1 -0
  30. package/dist/register-all.js +1 -1
  31. package/dist/register-all2.js +25 -24
  32. package/dist/traits/drag-controller.d.ts.map +1 -1
  33. package/dist/traits.js +5 -3
  34. package/dist/ui-element.js +128 -0
  35. package/dist/ui-icon-element.js +158 -156
  36. package/dist/uid.js +3 -63
  37. package/package.json +9 -3
package/dist/define.js ADDED
@@ -0,0 +1,62 @@
1
+ import { a as e, c as t, d as n, f as r, h as i, i as a, l as o, m as s, o as c, p as l, r as u, s as d, u as f } from "./uid.js";
2
+ var p = class {
3
+ [Symbol.toStringTag] = "Signal";
4
+ #e;
5
+ constructor(e) {
6
+ this.#e = e;
7
+ }
8
+ get value() {
9
+ return i(this.#e), this.#e._value;
10
+ }
11
+ set value(e) {
12
+ Object.is(this.#e._value, e) || (this.#e._value = e, l(this.#e));
13
+ }
14
+ peek() {
15
+ return this.#e._value;
16
+ }
17
+ };
18
+ function m(e) {
19
+ let t = new a(e), n = new p(t);
20
+ return r.set(n, t), n;
21
+ }
22
+ var h = class {
23
+ [Symbol.toStringTag] = "Computed";
24
+ #e;
25
+ constructor(e) {
26
+ this.#e = e;
27
+ }
28
+ get value() {
29
+ return i(this.#e), this.#e._dirty && this.#t(), this.#e._value;
30
+ }
31
+ peek() {
32
+ return this.#e._dirty && this.#t(), this.#e._value;
33
+ }
34
+ #t() {
35
+ let t = this.#e;
36
+ if (c.has(t)) throw Error("Circular computed dependency detected.");
37
+ e(t), c.add(t);
38
+ let n = o();
39
+ s(t);
40
+ try {
41
+ t._value = t._fn();
42
+ } finally {
43
+ s(n), c.delete(t), t._dirty = !1;
44
+ }
45
+ }
46
+ };
47
+ function g(e) {
48
+ let t = new u(e), n = new h(t);
49
+ return r.set(n, t), n;
50
+ }
51
+ function _(e) {
52
+ n();
53
+ try {
54
+ e();
55
+ } finally {
56
+ d(), f() === 0 && t();
57
+ }
58
+ }
59
+ function v(e, t) {
60
+ customElements.get(e) || customElements.define(e, t);
61
+ }
62
+ export { m as i, _ as n, g as r, v as t };
@@ -1,130 +1,6 @@
1
- import { i as e, o as t, t as n } from "./uid.js";
2
- var r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
3
- function a(e) {
4
- if (r.has(e.name)) {
5
- console.warn(`[native-ui] Trait "${e.name}" is already registered.`);
6
- return;
7
- }
8
- r.set(e.name, e);
9
- for (let t of i) t(e.name);
10
- }
11
- /** Subscribe to trait registration events. Returns unsubscribe function. */
12
- function o(e) {
13
- return i.add(e), () => i.delete(e);
14
- }
15
- function s(e) {
16
- return r.get(e);
17
- }
18
- function c() {
19
- return new Set(r.keys());
20
- }
21
- /**
22
- * Parse a namespaced trait attribute like "draggable-axis" into
23
- * { trait: "draggable", key: "axis" }. Returns null if the attribute
24
- * doesn't match any registered trait name prefix.
25
- */
26
- function l(e) {
27
- let t = c();
28
- for (let n of t) if (e.startsWith(n + "-")) return {
29
- trait: n,
30
- key: e.slice(n.length + 1)
31
- };
32
- return null;
33
- }
34
- /**
35
- * Collect all `{traitName}-*` attributes from an element for a given trait.
36
- * Returns a plain object mapping option keys to string values.
37
- *
38
- * Example: element has `draggable-axis="x"` and `draggable-mode="slot"`
39
- * → collectTraitOptions(el, 'draggable') returns { axis: 'x', mode: 'slot' }
40
- */
41
- function u(e, t) {
42
- let n = t + "-", r = {};
43
- for (let t of e.attributes) t.name.startsWith(n) && (r[t.name.slice(n.length)] = t.value);
44
- return r;
45
- }
46
- /** Base custom element class with reactive effect lifecycle, child deferral, and trait protocol. */
47
- var d = class extends HTMLElement {
48
- #e = [];
49
- #t = /* @__PURE__ */ new Map();
50
- #n = null;
51
- #r = /* @__PURE__ */ new Set();
52
- #i = null;
53
- #a = !1;
54
- addEffect(t) {
55
- this.#e.push(e(t));
56
- }
57
- connectedCallback() {
58
- if (this.#a) return;
59
- this.#a = !0, this.setup();
60
- let e = this.getAttribute("traits");
61
- e !== null && this.#o(e);
62
- }
63
- disconnectedCallback() {
64
- this.#a = !1, this.#c(), this.#n?.disconnect(), this.#n = null, this.#i?.(), this.#i = null, this.#r.clear(), this.teardown();
65
- for (let e of this.#e) e();
66
- this.#e = [];
67
- }
68
- setup() {}
69
- teardown() {}
70
- deferChildren(e) {
71
- this.firstChild ? e() : queueMicrotask(() => {
72
- this.isConnected && e();
73
- });
74
- }
75
- attributeChangedCallback(e, t, n) {}
76
- /**
77
- * Get a trait controller instance by name.
78
- * Returns null if no controller with that name is active.
79
- */
80
- getTraitController(e) {
81
- return this.#t.get(e) ?? null;
82
- }
83
- #o(e) {
84
- this.#s(e), this.#n = new MutationObserver((e) => {
85
- for (let t of e) if (t.attributeName === "traits") this.#s(this.getAttribute("traits") ?? "");
86
- else if (t.attributeName) {
87
- let e = l(t.attributeName);
88
- if (e) {
89
- let t = s(e.trait), n = this.#t.get(e.trait);
90
- t && n && t.update && t.update(n, u(this, e.trait));
91
- }
92
- }
93
- }), this.#n.observe(this, { attributes: !0 });
94
- }
95
- #s(e) {
96
- let t = new Set(e.split(/\s+/).filter(Boolean));
97
- for (let [e, n] of this.#t) if (!t.has(e)) {
98
- let t = s(e);
99
- t && t.destroy(n), this.#t.delete(e);
100
- }
101
- this.#r.clear();
102
- for (let e of t) {
103
- if (this.#t.has(e)) continue;
104
- let t = s(e);
105
- if (!t) {
106
- this.#r.add(e);
107
- continue;
108
- }
109
- for (let [n] of this.#t) if (s(n)?.conflicts?.includes(e) || t.conflicts?.includes(n)) {
110
- let t = `[native-ui] Trait conflict: "${e}" and "${n}" are incompatible.`;
111
- console.warn(t);
112
- }
113
- let n = u(this, e), r = t.create(this, n);
114
- this.#t.set(e, r);
115
- }
116
- this.#r.size > 0 && !this.#i ? this.#i = o((e) => {
117
- this.#r.has(e) && (this.#r.delete(e), this.#s(this.getAttribute("traits") ?? ""), this.#r.size === 0 && (this.#i?.(), this.#i = null));
118
- }) : this.#r.size === 0 && this.#i && (this.#i(), this.#i = null);
119
- }
120
- #c() {
121
- for (let [e, t] of this.#t) {
122
- let n = s(e);
123
- n && n.destroy(t);
124
- }
125
- this.#t.clear();
126
- }
127
- }, f = class {
1
+ import { t as e } from "./uid.js";
2
+ import { i as t } from "./define.js";
3
+ var n = class {
128
4
  #e = /* @__PURE__ */ new Set();
129
5
  #t = null;
130
6
  #n = !1;
@@ -164,7 +40,7 @@ var d = class extends HTMLElement {
164
40
  #o() {
165
41
  this.#n &&= (document.removeEventListener("pointerdown", this.#r, !0), document.removeEventListener("pointerup", this.#i, !0), document.removeEventListener("pointercancel", this.#i, !0), !1);
166
42
  }
167
- }, p = class {
43
+ }, r = class {
168
44
  #e = [];
169
45
  #t = !1;
170
46
  #n = (e) => {
@@ -196,7 +72,7 @@ var d = class extends HTMLElement {
196
72
  #a() {
197
73
  this.#e.length > 0 || (document.removeEventListener("pointerdown", this.#n, !0), document.removeEventListener("keydown", this.#r), this.#t = !1);
198
74
  }
199
- }, m = class {
75
+ }, i = class {
200
76
  #e = null;
201
77
  #t = 0;
202
78
  #n = [];
@@ -236,16 +112,16 @@ var d = class extends HTMLElement {
236
112
  dismissAll() {
237
113
  for (let e of [...this.#n]) this.dismiss(e.id);
238
114
  }
239
- }, h = null;
240
- function g() {
241
- return h ||= {
242
- dismissStack: new p(),
243
- toastManager: new m(),
244
- gestureRouter: new f()
245
- }, h;
115
+ }, a = null;
116
+ function o() {
117
+ return a ||= {
118
+ dismissStack: new r(),
119
+ toastManager: new i(),
120
+ gestureRouter: new n()
121
+ }, a;
246
122
  }
247
123
  /** Enables pointer-driven drag-and-drop with drop, slot, or preview reordering. */
248
- var _ = class {
124
+ var s = class {
249
125
  host;
250
126
  selector;
251
127
  dropZoneSelector;
@@ -332,7 +208,7 @@ var _ = class {
332
208
  y: e.clientY
333
209
  }
334
210
  }));
335
- let r = this.#m();
211
+ let r = this.#m().filter((e) => e !== this.#t);
336
212
  if (this.mode === "slot") {
337
213
  let t = e.clientX + this.#a, n = e.clientY + this.#o, i = r.filter((e) => e !== this.#e), a = 0;
338
214
  for (let e = 0; e < i.length; e++) {
@@ -390,27 +266,30 @@ var _ = class {
390
266
  #S(e, t, n) {
391
267
  let r = e.filter((e) => e !== this.#e);
392
268
  if (r.length === 0) return;
393
- let i = 0, a = Infinity;
394
- for (let e = 0; e < r.length; e++) {
395
- let o = r[e].getBoundingClientRect(), s = o.left + o.width / 2, c = o.top + o.height / 2, l = Math.hypot(t - s, n - c);
396
- l < a && (a = l, i = e);
397
- }
398
- let o = r[i].getBoundingClientRect(), s = o.left + o.width / 2, c = o.top + o.height / 2, l = o.height * .5, u = Math.abs(n - c) < l ? t < s ? i : i + 1 : n < c ? i : i + 1;
399
- if (u === this.#f) return;
400
- this.#f = u;
401
- let d = u < r.length ? r[u] : null;
402
- d ? d.before(this.#e) : r[r.length - 1].after(this.#e), this.host.dispatchEvent(new CustomEvent("ui-drag-over", {
269
+ let i = e[0].getBoundingClientRect(), a = 1;
270
+ for (let t = 1; t < e.length && Math.abs(e[t].getBoundingClientRect().top - i.top) < i.height * .5; t++) a = t + 1;
271
+ let o = a > 1 ? e[1].getBoundingClientRect().left - i.left : i.width, s = a < e.length ? e[a].getBoundingClientRect().top - i.top : i.height, c = Math.round((t - (i.left + i.width / 2)) / o), l = Math.round((n - (i.top + i.height / 2)) / s), u = Math.ceil(r.length / a) - 1, d = Math.max(0, Math.min(c, a - 1)), f = Math.max(0, Math.min(l, u)) * a + d;
272
+ if (f = Math.max(0, Math.min(f, r.length)), f === this.#f) return;
273
+ this.#f = f;
274
+ let p = f < r.length ? r[f] : null, m = () => {
275
+ p ? p.before(this.#e) : r[r.length - 1].after(this.#e);
276
+ };
277
+ typeof document.startViewTransition == "function" ? document.startViewTransition(m) : m(), this.host.dispatchEvent(new CustomEvent("ui-drag-over", {
403
278
  bubbles: !0,
404
279
  composed: !0,
405
280
  detail: {
406
281
  item: this.#e,
407
- index: u,
408
- insertBefore: d
282
+ index: f,
283
+ insertBefore: p
409
284
  }
410
285
  }));
411
286
  }
412
287
  #C() {
413
- this.mode !== "preview" || !this.#e || !this.#u || (this.#d && this.#d.isConnected ? this.#d.before(this.#e) : this.#u.appendChild(this.#e));
288
+ if (this.mode !== "preview" || !this.#e || !this.#u) return;
289
+ let e = this.#e, t = this.#d, n = this.#u, r = () => {
290
+ t && t.isConnected ? t.before(e) : n.appendChild(e);
291
+ };
292
+ typeof document.startViewTransition == "function" ? document.startViewTransition(r) : r();
414
293
  }
415
294
  #w = (e) => {
416
295
  if (this.#e) {
@@ -470,7 +349,7 @@ var _ = class {
470
349
  #D(e) {
471
350
  if (!this.#e) return;
472
351
  let t = this.#e.getBoundingClientRect(), n = this.#e.cloneNode(!0);
473
- n.setAttribute("popover", "manual"), n.setAttribute("aria-hidden", "true"), this.host.appendChild(n), n.showPopover(), n.style.position = "fixed", n.style.inset = "unset", n.style.left = `${t.left}px`, n.style.top = `${t.top}px`, n.style.width = `${t.width}px`, n.style.height = `${t.height}px`, n.style.margin = "0", n.style.pointerEvents = "none", n.style.opacity = "0.8", n.style.transformOrigin = "center center", n.style.border = "none", n.style.outline = "none", this.#t = n, this.#r = e.clientX, this.#i = e.clientY;
352
+ n.setAttribute("popover", "manual"), n.setAttribute("aria-hidden", "true"), document.body.appendChild(n), n.showPopover(), n.style.position = "fixed", n.style.inset = "unset", n.style.left = `${t.left}px`, n.style.top = `${t.top}px`, n.style.width = `${t.width}px`, n.style.height = `${t.height}px`, n.style.margin = "0", n.style.pointerEvents = "none", n.style.opacity = "0.8", n.style.transformOrigin = "center center", n.style.border = "none", n.style.outline = "none", this.#t = n, this.#r = e.clientX, this.#i = e.clientY;
474
353
  }
475
354
  #O() {
476
355
  if (this.#t) {
@@ -485,7 +364,7 @@ var _ = class {
485
364
  else for (let t of e) t.removeAttribute("drag-over"), t.style.removeProperty("outline"), t.style.removeProperty("outline-offset");
486
365
  this.#n &&= (this.#n.remove(), null), this.#e = null, this.#s = -1, this.#c = -1, this.#u = null, this.#d = null, this.#f = -1, document.removeEventListener("pointermove", this.#v), document.removeEventListener("pointerup", this.#w), document.removeEventListener("pointercancel", this.#T), document.removeEventListener("keydown", this.#E);
487
366
  }
488
- }, v = class {
367
+ }, c = class {
489
368
  host;
490
369
  handleSelector;
491
370
  axis;
@@ -568,7 +447,7 @@ var _ = class {
568
447
  #d() {
569
448
  this.#i = !1, this.host.removeAttribute("resizing"), document.removeEventListener("pointermove", this.#s), document.removeEventListener("pointerup", this.#c), document.removeEventListener("pointercancel", this.#l), document.removeEventListener("keydown", this.#u);
570
449
  }
571
- }, y = class {
450
+ }, l = class {
572
451
  host;
573
452
  disabled;
574
453
  #e = !1;
@@ -615,7 +494,7 @@ var _ = class {
615
494
  detail: { pointerType: "keyboard" }
616
495
  })));
617
496
  };
618
- }, b = class {
497
+ }, u = class {
619
498
  host;
620
499
  selector;
621
500
  orientation;
@@ -669,7 +548,7 @@ var _ = class {
669
548
  let r = e[t];
670
549
  r && (r.setAttribute("tabindex", "0"), r.focus());
671
550
  }
672
- }, x = class {
551
+ }, d = class {
673
552
  host;
674
553
  #e = 0;
675
554
  constructor(e) {
@@ -677,26 +556,26 @@ var _ = class {
677
556
  }
678
557
  enable() {
679
558
  this.#e = requestAnimationFrame(() => {
680
- this.#e = 0, g().dismissStack.push(this.host);
559
+ this.#e = 0, o().dismissStack.push(this.host);
681
560
  });
682
561
  }
683
562
  disable() {
684
- this.#e &&= (cancelAnimationFrame(this.#e), 0), g().dismissStack.remove(this.host);
563
+ this.#e &&= (cancelAnimationFrame(this.#e), 0), o().dismissStack.remove(this.host);
685
564
  }
686
565
  destroy() {
687
- this.#e &&= (cancelAnimationFrame(this.#e), 0), g().dismissStack.remove(this.host);
566
+ this.#e &&= (cancelAnimationFrame(this.#e), 0), o().dismissStack.remove(this.host);
688
567
  }
689
- }, S = class {
568
+ }, f = class {
690
569
  host;
691
570
  #e;
692
571
  #t = null;
693
572
  constructor(e) {
694
- this.host = e, this.#e = new x(e);
573
+ this.host = e, this.#e = new d(e);
695
574
  }
696
- wirePopover(e, t) {
697
- this.#t = t;
698
- let r = n("anchor");
699
- e.style.setProperty("anchor-name", `--${r}`), t.style.setProperty("position-anchor", `--${r}`);
575
+ wirePopover(t, n) {
576
+ this.#t = n;
577
+ let r = e("anchor");
578
+ t.style.setProperty("anchor-name", `--${r}`), n.style.setProperty("position-anchor", `--${r}`);
700
579
  }
701
580
  syncPopover(e) {
702
581
  if (e) {
@@ -714,7 +593,7 @@ var _ = class {
714
593
  destroy() {
715
594
  this.#e.destroy(), this.#t = null;
716
595
  }
717
- }, C = class {
596
+ }, p = class {
718
597
  host;
719
598
  listValue = t(null);
720
599
  itemSelector;
@@ -731,7 +610,7 @@ var _ = class {
731
610
  cancelable: !0,
732
611
  detail: t
733
612
  }));
734
- }), this.#e = new b(e, {
613
+ }), this.#e = new u(e, {
735
614
  selector: this.itemSelector,
736
615
  orientation: t.orientation ?? "vertical",
737
616
  wrap: t.wrap ?? !0,
@@ -770,7 +649,7 @@ var _ = class {
770
649
  let t = e.detail;
771
650
  this.onChildSelect(t);
772
651
  };
773
- }, w = class {
652
+ }, m = class {
774
653
  host;
775
654
  #e = null;
776
655
  #t;
@@ -804,4 +683,4 @@ var _ = class {
804
683
  t !== e && e.appendChild(t), this.host.appendChild(e), this.#e = e, e.addEventListener("cancel", this.#n), e.addEventListener("click", this.#r), this.host.addEventListener("ui-dismiss", this.#i);
805
684
  }
806
685
  };
807
- export { s as _, b as a, _ as c, g as d, f, c as g, l as h, x as i, p as l, u as m, C as n, y as o, d as p, S as r, v as s, w as t, m as u, o as v, a as y };
686
+ export { u as a, s as c, o as d, n as f, d as i, r as l, p as n, l as o, f as r, c as s, m as t, i as u };
@@ -0,0 +1,231 @@
1
+ /* ──────────────────────────────────────────────────────────────────────────────
2
+ ds-inspector — Design system inspector component styles.
3
+ Opt-in via: @import '@nonoun/native-ui/css/inspector';
4
+ ────────────────────────────────────────────────────────────────────────────── */
5
+
6
+ @layer ui {
7
+
8
+ /* ── Toolbar ── */
9
+
10
+ .ds-inspector-toolbar {
11
+ position: sticky;
12
+ top: 0;
13
+ z-index: 1;
14
+ display: flex;
15
+ gap: 0.5rem;
16
+ padding-block: 0.5rem;
17
+ margin-block-end: 0.5rem;
18
+ background: var(--_ground, var(--_panel));
19
+ }
20
+
21
+ .ds-inspector-toolbar > * {
22
+ flex: 1;
23
+ min-width: 0;
24
+ }
25
+
26
+ /* ── Section Structure ── */
27
+
28
+ .ds-inspector-section {
29
+ margin-block-end: 1rem;
30
+ }
31
+
32
+ .ds-inspector-section[hidden] {
33
+ display: none;
34
+ }
35
+
36
+ .ds-inspector-section + .ds-inspector-section:not([hidden]) {
37
+ padding-block-start: 0.5rem;
38
+ border-block-start: 1px solid var(--neutral-border-muted);
39
+ }
40
+
41
+ .ds-inspector-heading {
42
+ font-size: 0.6875rem;
43
+ font-weight: 600;
44
+ text-transform: uppercase;
45
+ letter-spacing: 0.05em;
46
+ color: var(--neutral-ink-muted);
47
+ margin: 0 0 0.5rem;
48
+ }
49
+
50
+ .ds-inspector-subheading {
51
+ font-size: 0.625rem;
52
+ font-weight: 500;
53
+ color: var(--neutral-ink-placeholder);
54
+ margin: 0.5rem 0 0.25rem;
55
+ }
56
+
57
+ /* ── ds-variable ── */
58
+
59
+ :where(ds-variable) {
60
+ display: block;
61
+ }
62
+
63
+ .ds-variable-row {
64
+ display: grid;
65
+ grid-template-columns: auto 1fr auto;
66
+ align-items: center;
67
+ gap: 0.5rem;
68
+ padding-block: 0.125rem;
69
+ }
70
+
71
+ .ds-variable-label {
72
+ font-size: 0.6875rem;
73
+ color: var(--neutral-ink);
74
+ white-space: nowrap;
75
+ overflow: hidden;
76
+ text-overflow: ellipsis;
77
+ min-width: 3rem;
78
+ max-width: 5rem;
79
+ }
80
+
81
+ .ds-variable-value {
82
+ font-size: 0.625rem;
83
+ font-family: ui-monospace, monospace;
84
+ color: var(--neutral-ink-muted);
85
+ text-align: right;
86
+ white-space: nowrap;
87
+ overflow: hidden;
88
+ text-overflow: ellipsis;
89
+ min-width: 3rem;
90
+ max-width: 5rem;
91
+ }
92
+
93
+ /* ── ds-colors ── */
94
+
95
+ :where(ds-colors) {
96
+ display: block;
97
+ }
98
+
99
+ .ds-colors-strip {
100
+ display: flex;
101
+ gap: 2px;
102
+ border-radius: 0.375rem;
103
+ overflow: hidden;
104
+ }
105
+
106
+ /* ── ds-color-swatch ── */
107
+
108
+ :where(ds-color-swatch) {
109
+ flex: 1;
110
+ aspect-ratio: 1;
111
+ min-width: 0;
112
+ position: relative;
113
+ display: flex;
114
+ align-items: flex-end;
115
+ justify-content: center;
116
+ cursor: pointer;
117
+ }
118
+
119
+ .ds-swatch-label {
120
+ font-size: 0.5rem;
121
+ line-height: 1;
122
+ text-align: center;
123
+ padding: 2px 1px;
124
+ white-space: nowrap;
125
+ overflow: hidden;
126
+ text-overflow: ellipsis;
127
+ max-width: 100%;
128
+ pointer-events: none;
129
+ }
130
+
131
+ /* ── Swatch Popover ── */
132
+
133
+ .ds-swatch-popover {
134
+ position: fixed;
135
+ position-area: block-end;
136
+ position-try-fallbacks: flip-block;
137
+ margin: 0.25rem 0 0;
138
+
139
+ min-width: 12rem;
140
+ padding: 0.375rem;
141
+
142
+ font-size: 0.6875rem;
143
+ color: var(--neutral-ink);
144
+ background: var(--neutral-modal);
145
+ border: 1px solid var(--neutral-border-muted);
146
+ border-radius: 0.375rem;
147
+ box-shadow: var(--ui-shadow-md);
148
+
149
+ /* Override UA popover styles */
150
+ inset: unset;
151
+ overflow: visible;
152
+
153
+ opacity: 0;
154
+ transform: scale(0.96);
155
+ transition:
156
+ opacity 150ms ease,
157
+ transform 150ms ease,
158
+ display 150ms ease allow-discrete,
159
+ overlay 150ms ease allow-discrete;
160
+ }
161
+
162
+ .ds-swatch-popover:popover-open {
163
+ opacity: 1;
164
+ transform: scale(1);
165
+ }
166
+
167
+ @starting-style {
168
+ .ds-swatch-popover:popover-open {
169
+ opacity: 0;
170
+ transform: scale(0.96);
171
+ }
172
+ }
173
+
174
+ .ds-swatch-popover[popover]:not(:popover-open) {
175
+ display: none;
176
+ }
177
+
178
+ .ds-swatch-popover-header {
179
+ font-size: 0.5625rem;
180
+ font-family: ui-monospace, monospace;
181
+ color: var(--neutral-ink-muted);
182
+ padding: 0.125rem 0.25rem 0.375rem;
183
+ border-bottom: 1px solid var(--neutral-border-muted);
184
+ margin-bottom: 0.25rem;
185
+ white-space: nowrap;
186
+ overflow: hidden;
187
+ text-overflow: ellipsis;
188
+ }
189
+
190
+ .ds-swatch-popover-row {
191
+ display: flex;
192
+ align-items: center;
193
+ gap: 0.5rem;
194
+ width: 100%;
195
+ padding: 0.25rem;
196
+ border: none;
197
+ border-radius: 0.25rem;
198
+ background: transparent;
199
+ color: inherit;
200
+ font: inherit;
201
+ cursor: pointer;
202
+ text-align: left;
203
+ }
204
+
205
+ .ds-swatch-popover-row:hover {
206
+ background: var(--neutral-control);
207
+ }
208
+
209
+ .ds-swatch-popover-label {
210
+ font-size: 0.5625rem;
211
+ font-weight: 600;
212
+ color: var(--neutral-ink-muted);
213
+ min-width: 2.5rem;
214
+ }
215
+
216
+ .ds-swatch-popover-value {
217
+ font-size: 0.5625rem;
218
+ font-family: ui-monospace, monospace;
219
+ color: var(--neutral-ink);
220
+ white-space: nowrap;
221
+ overflow: hidden;
222
+ text-overflow: ellipsis;
223
+ }
224
+
225
+ /* ── ds-themes ── */
226
+
227
+ :where(ds-themes) {
228
+ display: block;
229
+ }
230
+
231
+ } /* @layer ui */
@@ -0,0 +1,7 @@
1
+ import './nav/inspector/ds-variable.ts';
2
+ import './nav/inspector/ds-colors.ts';
3
+ import './nav/inspector/ds-color-swatch.ts';
4
+ import './nav/inspector/ds-themes.ts';
5
+ export { DSColorSwatch, DSColors, DSVariable, DSThemes, buildInspector, } from './nav/inspector/index.ts';
6
+ export type { DSColorEntry, DSVariableData, DSThemeEntry } from './nav/inspector/index.ts';
7
+ //# sourceMappingURL=inspector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../src/inspector.ts"],"names":[],"mappings":"AACA,OAAO,gCAAgC,CAAC;AACxC,OAAO,8BAA8B,CAAC;AACtC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,8BAA8B,CAAC;AAGtC,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}