@nonoun/native-ui 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components-lean.css +53 -0
- package/dist/components.css +53 -0
- package/dist/custom-elements.json +5013 -5013
- package/dist/define.js +62 -0
- package/dist/dialog-controller.js +30 -154
- package/dist/inspector.css +231 -0
- package/dist/inspector.d.ts +7 -0
- package/dist/inspector.d.ts.map +1 -0
- package/dist/inspector.js +591 -0
- package/dist/kernel.js +182 -181
- package/dist/native-ui-lean.css +53 -0
- package/dist/native-ui.css +53 -0
- package/dist/native-ui.js +7 -5
- package/dist/nav/inspector/build-inspector.d.ts +8 -0
- package/dist/nav/inspector/build-inspector.d.ts.map +1 -0
- package/dist/nav/inspector/ds-color-swatch-element.d.ts +15 -0
- package/dist/nav/inspector/ds-color-swatch-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-color-swatch.d.ts +3 -0
- package/dist/nav/inspector/ds-color-swatch.d.ts.map +1 -0
- package/dist/nav/inspector/ds-colors-element.d.ts +14 -0
- package/dist/nav/inspector/ds-colors-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-colors.d.ts +4 -0
- package/dist/nav/inspector/ds-colors.d.ts.map +1 -0
- package/dist/nav/inspector/ds-themes-element.d.ts +13 -0
- package/dist/nav/inspector/ds-themes-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-themes.d.ts +4 -0
- package/dist/nav/inspector/ds-themes.d.ts.map +1 -0
- package/dist/nav/inspector/ds-variable-element.d.ts +19 -0
- package/dist/nav/inspector/ds-variable-element.d.ts.map +1 -0
- package/dist/nav/inspector/ds-variable.d.ts +4 -0
- package/dist/nav/inspector/ds-variable.d.ts.map +1 -0
- package/dist/nav/inspector/index.d.ts +9 -0
- package/dist/nav/inspector/index.d.ts.map +1 -0
- package/dist/register-all.js +1 -1
- package/dist/register-all2.js +25 -24
- package/dist/traits.js +5 -3
- package/dist/ui-element.js +128 -0
- package/dist/ui-icon-element.js +158 -156
- package/dist/uid.js +3 -63
- 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 {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
240
|
-
function
|
|
241
|
-
return
|
|
242
|
-
dismissStack: new
|
|
243
|
-
toastManager: new
|
|
244
|
-
gestureRouter: new
|
|
245
|
-
},
|
|
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
|
|
124
|
+
var s = class {
|
|
249
125
|
host;
|
|
250
126
|
selector;
|
|
251
127
|
dropZoneSelector;
|
|
@@ -488,7 +364,7 @@ var _ = class {
|
|
|
488
364
|
else for (let t of e) t.removeAttribute("drag-over"), t.style.removeProperty("outline"), t.style.removeProperty("outline-offset");
|
|
489
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);
|
|
490
366
|
}
|
|
491
|
-
},
|
|
367
|
+
}, c = class {
|
|
492
368
|
host;
|
|
493
369
|
handleSelector;
|
|
494
370
|
axis;
|
|
@@ -571,7 +447,7 @@ var _ = class {
|
|
|
571
447
|
#d() {
|
|
572
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);
|
|
573
449
|
}
|
|
574
|
-
},
|
|
450
|
+
}, l = class {
|
|
575
451
|
host;
|
|
576
452
|
disabled;
|
|
577
453
|
#e = !1;
|
|
@@ -618,7 +494,7 @@ var _ = class {
|
|
|
618
494
|
detail: { pointerType: "keyboard" }
|
|
619
495
|
})));
|
|
620
496
|
};
|
|
621
|
-
},
|
|
497
|
+
}, u = class {
|
|
622
498
|
host;
|
|
623
499
|
selector;
|
|
624
500
|
orientation;
|
|
@@ -672,7 +548,7 @@ var _ = class {
|
|
|
672
548
|
let r = e[t];
|
|
673
549
|
r && (r.setAttribute("tabindex", "0"), r.focus());
|
|
674
550
|
}
|
|
675
|
-
},
|
|
551
|
+
}, d = class {
|
|
676
552
|
host;
|
|
677
553
|
#e = 0;
|
|
678
554
|
constructor(e) {
|
|
@@ -680,26 +556,26 @@ var _ = class {
|
|
|
680
556
|
}
|
|
681
557
|
enable() {
|
|
682
558
|
this.#e = requestAnimationFrame(() => {
|
|
683
|
-
this.#e = 0,
|
|
559
|
+
this.#e = 0, o().dismissStack.push(this.host);
|
|
684
560
|
});
|
|
685
561
|
}
|
|
686
562
|
disable() {
|
|
687
|
-
this.#e &&= (cancelAnimationFrame(this.#e), 0),
|
|
563
|
+
this.#e &&= (cancelAnimationFrame(this.#e), 0), o().dismissStack.remove(this.host);
|
|
688
564
|
}
|
|
689
565
|
destroy() {
|
|
690
|
-
this.#e &&= (cancelAnimationFrame(this.#e), 0),
|
|
566
|
+
this.#e &&= (cancelAnimationFrame(this.#e), 0), o().dismissStack.remove(this.host);
|
|
691
567
|
}
|
|
692
|
-
},
|
|
568
|
+
}, f = class {
|
|
693
569
|
host;
|
|
694
570
|
#e;
|
|
695
571
|
#t = null;
|
|
696
572
|
constructor(e) {
|
|
697
|
-
this.host = e, this.#e = new
|
|
573
|
+
this.host = e, this.#e = new d(e);
|
|
698
574
|
}
|
|
699
|
-
wirePopover(
|
|
700
|
-
this.#t =
|
|
701
|
-
let r =
|
|
702
|
-
|
|
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}`);
|
|
703
579
|
}
|
|
704
580
|
syncPopover(e) {
|
|
705
581
|
if (e) {
|
|
@@ -717,7 +593,7 @@ var _ = class {
|
|
|
717
593
|
destroy() {
|
|
718
594
|
this.#e.destroy(), this.#t = null;
|
|
719
595
|
}
|
|
720
|
-
},
|
|
596
|
+
}, p = class {
|
|
721
597
|
host;
|
|
722
598
|
listValue = t(null);
|
|
723
599
|
itemSelector;
|
|
@@ -734,7 +610,7 @@ var _ = class {
|
|
|
734
610
|
cancelable: !0,
|
|
735
611
|
detail: t
|
|
736
612
|
}));
|
|
737
|
-
}), this.#e = new
|
|
613
|
+
}), this.#e = new u(e, {
|
|
738
614
|
selector: this.itemSelector,
|
|
739
615
|
orientation: t.orientation ?? "vertical",
|
|
740
616
|
wrap: t.wrap ?? !0,
|
|
@@ -773,7 +649,7 @@ var _ = class {
|
|
|
773
649
|
let t = e.detail;
|
|
774
650
|
this.onChildSelect(t);
|
|
775
651
|
};
|
|
776
|
-
},
|
|
652
|
+
}, m = class {
|
|
777
653
|
host;
|
|
778
654
|
#e = null;
|
|
779
655
|
#t;
|
|
@@ -807,4 +683,4 @@ var _ = class {
|
|
|
807
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);
|
|
808
684
|
}
|
|
809
685
|
};
|
|
810
|
-
export {
|
|
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"}
|