@kitlangton/knobs 0.4.0-next.0 → 0.4.0-next.1
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 +288 -43
- package/dist/dev/{chunk-stbcgz1y.js → chunk-1qzffbpa.js} +443 -451
- package/dist/dev/{chunk-7xgkerd2.js → chunk-3ygqgy1x.js} +23 -1
- package/dist/dev/{chunk-pmkvb9ep.js → chunk-8mabjeyk.js} +1920 -507
- package/dist/dev/{chunk-t68smqkc.js → chunk-ayb292zj.js} +13 -11
- package/dist/dev/index.js +10 -5
- package/dist/index.js +25 -1
- package/dist/panel.js +2900 -1320
- package/dist/react.js +294 -6
- package/dist/solid.js +292 -4
- package/dist/themes.js +1509 -7
- package/dist/types/core/adapter.d.ts +6 -2
- package/dist/types/core/appearance.d.ts +44 -0
- package/dist/types/core/glide.d.ts +7 -0
- package/dist/types/core/motion.d.ts +66 -0
- package/dist/types/core/root.d.ts +13 -0
- package/dist/types/core/store.d.ts +18 -5
- package/dist/types/core/theme.d.ts +10 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/panel/gpu/color.d.ts +6 -0
- package/dist/types/panel/motion.d.ts +1 -1
- package/dist/types/panel/styles.d.ts +2 -3
- package/dist/types/themes/define.d.ts +104 -0
- package/dist/types/themes/index.d.ts +11 -0
- package/dist/types/themes/knobs.d.ts +5 -0
- package/dist/types/themes/void.d.ts +8 -0
- package/dist/types/tokens/color.d.ts +42 -0
- package/dist/types/tokens/css.d.ts +13 -0
- package/dist/types/tokens/evaluate.d.ts +8 -0
- package/dist/types/tokens/index.d.ts +4 -0
- package/dist/types/tokens/schema.d.ts +1100 -0
- package/dist/types/ui/bento-css.d.ts +1 -1
- package/dist/types/ui/compare-css.d.ts +1 -1
- package/dist/types/ui/index.d.ts +1 -1
- package/dist/types/ui/look.d.ts +18 -13
- package/dist/types/ui/overlay-css.d.ts +1 -1
- package/dist/types/ui/readout-css.d.ts +1 -1
- package/dist/types/ui/readout-model.d.ts +5 -1
- package/dist/types/ui/rgba.d.ts +11 -0
- package/dist/ui-react.js +2320 -676
- package/dist/ui-solid.js +2320 -676
- package/dist/ui.js +2552 -906
- package/package.json +1 -1
|
@@ -35,12 +35,21 @@ import {
|
|
|
35
35
|
springMotion2,
|
|
36
36
|
springResponse,
|
|
37
37
|
springEasing,
|
|
38
|
+
SPRINGS2,
|
|
39
|
+
FADE,
|
|
40
|
+
MOTION,
|
|
41
|
+
reducedMotion,
|
|
42
|
+
springLinear,
|
|
38
43
|
REFRESHES,
|
|
39
44
|
pushReadout,
|
|
40
45
|
READOUT,
|
|
41
46
|
storageKey
|
|
42
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-3ygqgy1x.js";
|
|
43
48
|
import {
|
|
49
|
+
resolveLook,
|
|
50
|
+
themeOf,
|
|
51
|
+
applyLook,
|
|
52
|
+
panelLook,
|
|
44
53
|
CHECK_POINTS,
|
|
45
54
|
CHECK_PATH,
|
|
46
55
|
iconPath,
|
|
@@ -48,7 +57,6 @@ import {
|
|
|
48
57
|
readSession,
|
|
49
58
|
writeSession,
|
|
50
59
|
rolling_css_default,
|
|
51
|
-
presetCss,
|
|
52
60
|
FILL,
|
|
53
61
|
LEAD,
|
|
54
62
|
trailScale,
|
|
@@ -93,8 +101,11 @@ import {
|
|
|
93
101
|
digitOption,
|
|
94
102
|
digitHints,
|
|
95
103
|
createCrumbs,
|
|
104
|
+
TOKENS,
|
|
105
|
+
knobs,
|
|
106
|
+
aliased,
|
|
107
|
+
injectTokens,
|
|
96
108
|
DELAYED,
|
|
97
|
-
injectPreset,
|
|
98
109
|
injectStyles,
|
|
99
110
|
resolveSound,
|
|
100
111
|
sound,
|
|
@@ -105,7 +116,7 @@ import {
|
|
|
105
116
|
createHintController,
|
|
106
117
|
pageHints,
|
|
107
118
|
toggleLayer
|
|
108
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-8mabjeyk.js";
|
|
109
120
|
|
|
110
121
|
// src/panel/die.ts
|
|
111
122
|
var ROUND = 16 * Math.sqrt(5), DIE = { half: 64 + ROUND, round: ROUND, pip: 12 }, PIPS = {
|
|
@@ -1292,7 +1303,7 @@ function createPresetStrip(doc, controls, showVariants, run, onAfterChange, pres
|
|
|
1292
1303
|
}
|
|
1293
1304
|
|
|
1294
1305
|
// src/panel/spin.ts
|
|
1295
|
-
var TURN = springMotion2(
|
|
1306
|
+
var TURN = springMotion2(SPRINGS2.smooth), BLINK_MS = 180, spins = /* @__PURE__ */ new WeakMap, reducedMotion2 = (el) => el.ownerDocument.defaultView?.matchMedia("(prefers-reduced-motion: reduce)").matches ?? !1, blinkAt = (ms) => ms >= BLINK_MS ? 1 : 1 - 0.55 * Math.sin(Math.PI * ms / BLINK_MS);
|
|
1296
1307
|
function spin(button, wake, rest) {
|
|
1297
1308
|
let icon = button.querySelector(".knobs-icon"), win = button.ownerDocument.defaultView;
|
|
1298
1309
|
if (!icon || !win)
|
|
@@ -1303,7 +1314,7 @@ function spin(button, wake, rest) {
|
|
|
1303
1314
|
let state = s;
|
|
1304
1315
|
state.rest = rest;
|
|
1305
1316
|
let now = win.performance.now();
|
|
1306
|
-
if (
|
|
1317
|
+
if (reducedMotion2(button))
|
|
1307
1318
|
state.blinkAt = now;
|
|
1308
1319
|
else
|
|
1309
1320
|
state.spring.set(state.spring.target - 360);
|
|
@@ -1353,7 +1364,7 @@ function resize(node, from) {
|
|
|
1353
1364
|
return;
|
|
1354
1365
|
}
|
|
1355
1366
|
node.style.overflow = "hidden";
|
|
1356
|
-
let ease = win.getComputedStyle(node).getPropertyValue("--
|
|
1367
|
+
let ease = win.getComputedStyle(node).getPropertyValue("--_k-reveal-ease").trim() || EASE_OUT, animation = node.animate([{ height: `${from}px` }, { height: `${to}px` }], {
|
|
1357
1368
|
duration: 200,
|
|
1358
1369
|
easing: ease
|
|
1359
1370
|
});
|
|
@@ -2179,7 +2190,7 @@ function rollMs(el) {
|
|
|
2179
2190
|
let n = parseFloat(getComputedStyle(el).getPropertyValue("--k-roll"));
|
|
2180
2191
|
return Number.isFinite(n) ? Math.max(0, n) : 320;
|
|
2181
2192
|
}
|
|
2182
|
-
var
|
|
2193
|
+
var reducedMotion3 = (el) => el.ownerDocument.defaultView?.matchMedia("(prefers-reduced-motion: reduce)").matches ?? !1, onCanvas = (el) => el.closest('[data-gpu-active="true"]') !== null, readouts = /* @__PURE__ */ new WeakMap, rollingReadoutOf = (el) => readouts.get(el), settle = (value, decimals) => {
|
|
2183
2194
|
let v = Number(value.toFixed(decimals));
|
|
2184
2195
|
return v === 0 ? 0 : v;
|
|
2185
2196
|
};
|
|
@@ -2197,7 +2208,7 @@ function rollingReadout(host) {
|
|
|
2197
2208
|
return segments.map((s) => s.text).join("");
|
|
2198
2209
|
},
|
|
2199
2210
|
show(parts, ms, delay = 0) {
|
|
2200
|
-
if (ms > 0 &&
|
|
2211
|
+
if (ms > 0 && reducedMotion3(host))
|
|
2201
2212
|
ms = 0;
|
|
2202
2213
|
let next = parts.map((p) => typeof p === "string" ? "t" : `n${p.decimals}`).join("|");
|
|
2203
2214
|
if (next !== shape) {
|
|
@@ -2263,7 +2274,7 @@ function fadeText(el, text, fade) {
|
|
|
2263
2274
|
return;
|
|
2264
2275
|
el.dataset.text = text, el.toggleAttribute("data-fade", fade);
|
|
2265
2276
|
let now = el.ownerDocument.createElement("span");
|
|
2266
|
-
if (now.textContent = text, el.replaceChildren(now), !fade || !was || !el.isConnected || onCanvas(el) ||
|
|
2277
|
+
if (now.textContent = text, el.replaceChildren(now), !fade || !was || !el.isConnected || onCanvas(el) || reducedMotion3(el))
|
|
2267
2278
|
return;
|
|
2268
2279
|
let ghost = el.ownerDocument.createElement("span");
|
|
2269
2280
|
ghost.className = "knobs-ghost", ghost.setAttribute("aria-hidden", "true"), ghost.textContent = was, el.append(ghost), now.animate([{ opacity: 0 }, { opacity: 1 }], {
|
|
@@ -2530,6 +2541,35 @@ var withAlpha = (c, k) => [
|
|
|
2530
2541
|
a[3] + (b[3] - a[3]) * u
|
|
2531
2542
|
];
|
|
2532
2543
|
};
|
|
2544
|
+
function pickScheme(raw, light) {
|
|
2545
|
+
let s = raw;
|
|
2546
|
+
for (let at = s.lastIndexOf("light-dark(");at >= 0; at = s.lastIndexOf("light-dark(")) {
|
|
2547
|
+
let depth = 0, comma = -1, end = -1;
|
|
2548
|
+
for (let i = at + 11;i < s.length; i++) {
|
|
2549
|
+
let ch = s[i];
|
|
2550
|
+
if (ch === "(")
|
|
2551
|
+
depth++;
|
|
2552
|
+
else if (ch === ")") {
|
|
2553
|
+
if (depth === 0) {
|
|
2554
|
+
end = i;
|
|
2555
|
+
break;
|
|
2556
|
+
}
|
|
2557
|
+
depth--;
|
|
2558
|
+
} else if (ch === "," && depth === 0 && comma < 0)
|
|
2559
|
+
comma = i;
|
|
2560
|
+
}
|
|
2561
|
+
if (end < 0 || comma < 0)
|
|
2562
|
+
break;
|
|
2563
|
+
let side = light ? s.slice(at + 11, comma) : s.slice(comma + 1, end);
|
|
2564
|
+
s = s.slice(0, at) + side.trim() + s.slice(end + 1);
|
|
2565
|
+
}
|
|
2566
|
+
return s;
|
|
2567
|
+
}
|
|
2568
|
+
var isLightStyle = (style) => style.getPropertyValue("--_k-light").trim() === "1";
|
|
2569
|
+
function tokenColor(style, name, fallback) {
|
|
2570
|
+
let raw = style.getPropertyValue(name).trim();
|
|
2571
|
+
return raw ? parseCssColor(pickScheme(raw, isLightStyle(style)), fallback) : fallback;
|
|
2572
|
+
}
|
|
2533
2573
|
|
|
2534
2574
|
// src/panel/gpu/color.ts
|
|
2535
2575
|
function cssMix(a, b, p) {
|
|
@@ -2539,7 +2579,7 @@ function cssMix(a, b, p) {
|
|
|
2539
2579
|
let ch = (i) => (a[i] * a[3] * p + b[i] * b[3] * (1 - p)) / alpha;
|
|
2540
2580
|
return [ch(0), ch(1), ch(2), alpha];
|
|
2541
2581
|
}
|
|
2542
|
-
var token = (style, name) => style.getPropertyValue(`--kv-${name}`) || style.getPropertyValue(`--k-${name}`), numProp = (style, name, fallback) => {
|
|
2582
|
+
var token = (style, name) => pickScheme(style.getPropertyValue(`--kv-${name}`) || style.getPropertyValue(`--_k-${name}`) || style.getPropertyValue(`--k-${name}`), isLightStyle(style)), numProp = (style, name, fallback) => {
|
|
2543
2583
|
let raw = parseFloat(token(style, name));
|
|
2544
2584
|
return Number.isFinite(raw) ? raw : fallback;
|
|
2545
2585
|
}, lengthProp = (style, name, em, fallback) => {
|
|
@@ -2549,7 +2589,7 @@ var token = (style, name) => style.getPropertyValue(`--kv-${name}`) || style.get
|
|
|
2549
2589
|
return raw.endsWith("em") ? n * em : n;
|
|
2550
2590
|
}, colorProp = (style, name, fallback) => token(style, name).trim() ? parseCssColor(token(style, name), fallback) : fallback, optColor = (style, name) => {
|
|
2551
2591
|
let raw = style.getPropertyValue(`--k-${name}`).trim();
|
|
2552
|
-
return raw ? parseCssColor(raw, [0, 0, 0, 0]) : null;
|
|
2592
|
+
return raw ? parseCssColor(pickScheme(raw, isLightStyle(style)), [0, 0, 0, 0]) : null;
|
|
2553
2593
|
}, optLength = (style, name, em) => {
|
|
2554
2594
|
let raw = style.getPropertyValue(`--k-${name}`).trim();
|
|
2555
2595
|
if (!raw)
|
|
@@ -2563,7 +2603,7 @@ function readPanelTokens(panel, version = -1) {
|
|
|
2563
2603
|
if (hit && hit.version === version)
|
|
2564
2604
|
return hit.tokens;
|
|
2565
2605
|
}
|
|
2566
|
-
let style = getComputedStyle(panel), bg = parseCssColor(token(style, "bg"),
|
|
2606
|
+
let style = getComputedStyle(panel), light = isLightStyle(style), theme = gpuDefaults(themeOf(panel), light), bg = parseCssColor(token(style, "bg"), theme.bg), isLight = light || bg[0] * 0.2126 + bg[1] * 0.7152 + bg[2] * 0.0722 > 0.55, surface = parseCssColor(token(style, "fill"), theme.fill), surfaceHi = parseCssColor(token(style, "fill-selected"), theme["fill-selected"]), line = parseCssColor(token(style, "border"), theme.border), lineHi = parseCssColor(token(style, "border-strong"), theme["border-strong"]), text = parseCssColor(token(style, "fg"), theme.fg), label = parseCssColor(token(style, "fg-2"), theme["fg-2"]), dim = parseCssColor(token(style, "fg-3"), theme["fg-3"]), accent = parseCssColor(token(style, "accent"), theme.accent), modified = parseCssColor(token(style, "modified"), theme.modified), segBg = parseCssColor(token(style, "segmented-track"), theme["segmented-track"]), segActive = parseCssColor(token(style, "segmented-active"), theme["segmented-active"]), toggleTrack = parseCssColor(token(style, "toggle-track"), theme["toggle-track"]), fillBase = style.getPropertyValue("--k-fill-base").trim() ? parseCssColor(token(style, "fill-base"), surfaceHi) : surfaceHi, toggleThumb = parseCssColor(token(style, "toggle-thumb"), theme["toggle-thumb"]), [duration, bounce] = style.getPropertyValue("--k-spring").trim().split(/\s+/).map(Number), fill = Number.isFinite(duration) && Number.isFinite(bounce) ? springMotion2({ duration, bounce }) : MOTION.default, fontFamily = style.fontFamily || style.getPropertyValue("--_k-font").trim() || 'system-ui, -apple-system, "SF Pro Text", sans-serif', monoFamily = style.getPropertyValue("--_k-mono").trim() || '"SF Mono", SFMono-Regular, ui-monospace, Menlo, monospace', unit = numProp(style, "unit", 4), pad = numProp(style, "pad", 10), inset = numProp(style, "inset", pad), row = numProp(style, "row", 32), gap = numProp(style, "gap", 4), trayPad = numProp(style, "tray-pad", unit * 0.5), radius = numProp(style, "radius", 8), panelRadius = numProp(style, "radius-panel", radius + unit), radiusMd = Math.max(0, radius - trayPad), radiusSm = Math.max(0, radius - trayPad * 2), fontSize = parseFloat(style.fontSize) || numProp(style, "font-size", 12), roundRaw = style.getPropertyValue("--_k-round").trim(), round = /^-?[\d.]+(px)?$/.test(roundRaw) ? Math.max(0, parseFloat(roundRaw)) : radius > 0 ? 1e4 : 0, tokens = {
|
|
2567
2607
|
bg,
|
|
2568
2608
|
surface,
|
|
2569
2609
|
surfaceHi,
|
|
@@ -2578,26 +2618,26 @@ function readPanelTokens(panel, version = -1) {
|
|
|
2578
2618
|
segActive,
|
|
2579
2619
|
toggleTrack,
|
|
2580
2620
|
toggleThumb,
|
|
2581
|
-
rim: parseCssColor(token(style, "rim"),
|
|
2582
|
-
edge: parseCssColor(token(style, "
|
|
2621
|
+
rim: parseCssColor(token(style, "rim"), theme.rim),
|
|
2622
|
+
edge: parseCssColor(token(style, "border-subtle"), theme["border-subtle"]),
|
|
2583
2623
|
rimWidth: lengthProp(style, "rim-width", fontSize, 1),
|
|
2584
|
-
page: parseCssColor(token(style, "page"),
|
|
2624
|
+
page: parseCssColor(token(style, "bg-page"), theme["bg-page"]),
|
|
2585
2625
|
rowHover: withAlpha(surface, 0.5),
|
|
2586
2626
|
rowGap: numProp(style, "row-gap", 0),
|
|
2587
2627
|
hoverIn: numProp(style, "hover-in", 0),
|
|
2588
2628
|
hoverOut: numProp(style, "hover-out", 120),
|
|
2589
2629
|
handleRest: numProp(style, "handle-rest", 0),
|
|
2590
|
-
handle: colorProp(style, "handle", accent),
|
|
2630
|
+
handle: colorProp(style, "slider-handle", accent),
|
|
2591
2631
|
handleInset: lengthProp(style, "handle-inset", fontSize, 0),
|
|
2592
2632
|
groupUpper: style.getPropertyValue("--k-group-transform").trim() !== "none",
|
|
2593
2633
|
groupSize: lengthProp(style, "group-size", fontSize, fontSize - 2),
|
|
2594
|
-
groupColor: colorProp(style, "group-
|
|
2634
|
+
groupColor: colorProp(style, "group-label", dim),
|
|
2595
2635
|
groupTracking: lengthProp(style, "group-tracking", 1, 0.04),
|
|
2596
2636
|
groupDivider: colorProp(style, "group-divider", [0, 0, 0, 0]),
|
|
2597
2637
|
unitGap: lengthProp(style, "unit-gap", fontSize - 0.5, (fontSize - 0.5) * 0.28),
|
|
2598
2638
|
unitColor: /^currentcolor$/i.test(token(style, "unit-color").trim()) ? null : colorProp(style, "unit-color", dim),
|
|
2599
2639
|
readoutMark: numProp(style, "readout-mark", 0),
|
|
2600
|
-
valueFamily: style.getPropertyValue("--
|
|
2640
|
+
valueFamily: style.getPropertyValue("--_k-value-font").trim() || fontFamily,
|
|
2601
2641
|
curveInset: lengthProp(style, "curve-inset", fontSize, 6),
|
|
2602
2642
|
curveDashed: style.getPropertyValue("--k-curve-guide").trim() === "dashed",
|
|
2603
2643
|
curveDot: numProp(style, "curve-dot", 1),
|
|
@@ -2622,7 +2662,7 @@ function readPanelTokens(panel, version = -1) {
|
|
|
2622
2662
|
textControl: fontSize - 0.5,
|
|
2623
2663
|
textMeta: fontSize - 1,
|
|
2624
2664
|
textCap: fontSize - 2,
|
|
2625
|
-
valueSize: parseFloat(style.getPropertyValue("--
|
|
2665
|
+
valueSize: parseFloat(style.getPropertyValue("--_k-value-size")) || fontSize - 0.5,
|
|
2626
2666
|
buttonBg: optColor(style, "button-bg"),
|
|
2627
2667
|
buttonLine: optColor(style, "button-line"),
|
|
2628
2668
|
buttonHoverBg: optColor(style, "button-hover-bg"),
|
|
@@ -2633,7 +2673,7 @@ function readPanelTokens(panel, version = -1) {
|
|
|
2633
2673
|
boxed: Boolean(style.getPropertyValue("--k-button-bg").trim() || style.getPropertyValue("--k-button-line").trim()),
|
|
2634
2674
|
iconSize: numProp(style, "icon-size", 14),
|
|
2635
2675
|
iconSm: numProp(style, "icon-sm", 13),
|
|
2636
|
-
labelWeight: numProp(style, "label
|
|
2676
|
+
labelWeight: numProp(style, "weight-label", 500),
|
|
2637
2677
|
disabledOpacity: numProp(style, "disabled-opacity", 0.32),
|
|
2638
2678
|
hintTypedOpacity: numProp(style, "hint-typed-opacity", 0.42),
|
|
2639
2679
|
blurStrength: numProp(style, "blur", 1),
|
|
@@ -2647,11 +2687,11 @@ function readPanelTokens(panel, version = -1) {
|
|
|
2647
2687
|
fontFamily,
|
|
2648
2688
|
monoFamily,
|
|
2649
2689
|
isLight,
|
|
2650
|
-
fontWeight: numProp(style, "
|
|
2651
|
-
titleWeight: numProp(style, "title
|
|
2690
|
+
fontWeight: numProp(style, "weight", 400),
|
|
2691
|
+
titleWeight: numProp(style, "weight-title", 600),
|
|
2652
2692
|
round,
|
|
2653
2693
|
flat: style.getPropertyValue("--k-frame").trim() === "flat",
|
|
2654
|
-
thumb: colorProp(style, "thumb", [
|
|
2694
|
+
thumb: colorProp(style, "toggle-thumb-off", theme["toggle-thumb-off"]),
|
|
2655
2695
|
lift: Math.max(0, numProp(style, "lift", 1)),
|
|
2656
2696
|
shadowStrength: Math.max(0, numProp(style, "shadow-strength", isLight ? 0.16 : 0.48))
|
|
2657
2697
|
};
|
|
@@ -2659,6 +2699,15 @@ function readPanelTokens(panel, version = -1) {
|
|
|
2659
2699
|
tokenCache.set(panel, { version, tokens });
|
|
2660
2700
|
return tokens;
|
|
2661
2701
|
}
|
|
2702
|
+
var toSrgb = (c) => c <= 0.0031308 ? 12.92 * c : 1.055 * c ** 0.4166666666666667 - 0.055, defaults = /* @__PURE__ */ new WeakMap;
|
|
2703
|
+
function gpuDefaults(theme, light) {
|
|
2704
|
+
let t = theme ?? knobs, hit = defaults.get(t);
|
|
2705
|
+
if (!hit) {
|
|
2706
|
+
let convert = (g) => Object.fromEntries(Object.entries(g).map(([k, [r, gg, b, a]]) => [k, [toSrgb(r), toSrgb(gg), toSrgb(b), a]]));
|
|
2707
|
+
hit = { dark: convert(t.gpu.dark), light: convert(t.gpu.light) }, defaults.set(t, hit);
|
|
2708
|
+
}
|
|
2709
|
+
return light ? hit.light : hit.dark;
|
|
2710
|
+
}
|
|
2662
2711
|
|
|
2663
2712
|
// src/panel/gpu/die.wgsl.ts
|
|
2664
2713
|
var f = (n) => Number.isInteger(n) ? `${n}.0` : String(n), v3 = (v) => `vec3f(${v.map(f).join(", ")})`, pipBranches = FACES.map(({ value }, i) => {
|
|
@@ -3511,7 +3560,7 @@ fn shadeAt(p: Prim, at: vec2f, rect: vec4f, frag: vec2f) -> vec4f {
|
|
|
3511
3560
|
`;
|
|
3512
3561
|
|
|
3513
3562
|
// src/panel/gpu/renderer.ts
|
|
3514
|
-
var LAYOUT_TOKENS = new Set(["width", "pad", "inset", "row", "gap", "font-size", "label
|
|
3563
|
+
var LAYOUT_TOKENS = new Set(["width", "pad", "inset", "row", "gap", "font-size", "weight-label"].map((t) => `--kt-${t}`)), nudge = (r, dx) => dx === 0 ? r : {
|
|
3515
3564
|
left: r.left + dx,
|
|
3516
3565
|
right: r.right + dx,
|
|
3517
3566
|
x: r.x + dx,
|
|
@@ -3719,7 +3768,13 @@ class GpuOverlayManager {
|
|
|
3719
3768
|
});
|
|
3720
3769
|
mo.observe(panel.root, {
|
|
3721
3770
|
attributes: !0,
|
|
3722
|
-
attributeFilter: [
|
|
3771
|
+
attributeFilter: [
|
|
3772
|
+
"data-knobs-theme",
|
|
3773
|
+
"data-appearance",
|
|
3774
|
+
"data-density",
|
|
3775
|
+
"data-preset",
|
|
3776
|
+
"style"
|
|
3777
|
+
]
|
|
3723
3778
|
});
|
|
3724
3779
|
let onTokenEvent = (event) => {
|
|
3725
3780
|
let name = event.propertyName;
|
|
@@ -5364,7 +5419,7 @@ class GpuOverlayManager {
|
|
|
5364
5419
|
let t = this.curTokens, el = cap.chip, text = cap.text.textContent ?? "", key = textKey(text), r = this.rectOf(el, key);
|
|
5365
5420
|
if (r.width <= 0)
|
|
5366
5421
|
return;
|
|
5367
|
-
let still = this.curReduced, capturing = cap.capturing(), on = interactive && (this.isHovered(el) || this.isFocused(el)), w = this.ease(el, "capw", r.width, still ? SNAP_OMEGA :
|
|
5422
|
+
let still = this.curReduced, capturing = cap.capturing(), on = interactive && (this.isHovered(el) || this.isFocused(el)), w = this.ease(el, "capw", r.width, still ? SNAP_OMEGA : MOTION.snappy.omega), texts = this.capTexts.get(el);
|
|
5368
5423
|
if (!texts)
|
|
5369
5424
|
this.capTexts.set(el, texts = { now: text, was: "" });
|
|
5370
5425
|
if (texts.now !== text)
|
|
@@ -5635,7 +5690,7 @@ class GpuOverlayManager {
|
|
|
5635
5690
|
this.curBypassRectCache = opening || leaving || panelRevealing && !bodyRevealing || layoutGliding || pageMoving || presenceRunning;
|
|
5636
5691
|
let tokens = rawTokens;
|
|
5637
5692
|
this.curTokens = tokens, this.curLocks = panel.locks, this.curLens = panel.lens !== void 0;
|
|
5638
|
-
let armedLook = this.armedLook(panel.root), armed = this.ease(panel.root, "armed", panel.root.hasAttribute("data-k-armed") ? 1 : 0, reducedMotion ? SNAP_OMEGA :
|
|
5693
|
+
let armedLook = this.armedLook(panel.root), armed = this.ease(panel.root, "armed", panel.root.hasAttribute("data-k-armed") ? 1 : 0, reducedMotion ? SNAP_OMEGA : MOTION.default.omega);
|
|
5639
5694
|
if (this.curDt = reducedMotion ? 1 : dt, this.curReduced = reducedMotion, opening || leaving)
|
|
5640
5695
|
this.curAlpha = Number(getComputedStyle(panel.root).opacity) || 0, anyMoving = !0;
|
|
5641
5696
|
else
|
|
@@ -6574,36 +6629,26 @@ function getGpuOverlayManager(doc) {
|
|
|
6574
6629
|
}
|
|
6575
6630
|
|
|
6576
6631
|
// src/panel/menu.ts
|
|
6577
|
-
var TOKENS = [
|
|
6632
|
+
var TOKEN_NAMES = TOKENS.map((t) => t.name), BORROWED = TOKEN_NAMES.map((t) => `--_k-${t}`), GLIDES = [
|
|
6578
6633
|
"bg",
|
|
6579
|
-
"
|
|
6580
|
-
"
|
|
6581
|
-
"
|
|
6582
|
-
"
|
|
6583
|
-
"
|
|
6584
|
-
"
|
|
6585
|
-
"
|
|
6634
|
+
"fill",
|
|
6635
|
+
"fill-selected",
|
|
6636
|
+
"segmented-track",
|
|
6637
|
+
"border",
|
|
6638
|
+
"fg",
|
|
6639
|
+
"fg-2",
|
|
6640
|
+
"fg-3",
|
|
6586
6641
|
"accent",
|
|
6587
6642
|
"font-size",
|
|
6588
6643
|
"radius",
|
|
6589
6644
|
"row",
|
|
6590
6645
|
"rim"
|
|
6591
|
-
], reduced = (doc) => doc.defaultView?.matchMedia("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
6646
|
+
].map((t) => `--kv-${t}`), reduced = (doc) => doc.defaultView?.matchMedia("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
6592
6647
|
function openMenu(doc, panel, items, at, options = {}) {
|
|
6593
6648
|
let win = doc.defaultView, previous = options.returnTo ?? doc.activeElement, menu = doc.createElement("div");
|
|
6594
|
-
menu.className = "knobs-menu", menu.setAttribute("role", "menu"), menu.tabIndex = -1;
|
|
6649
|
+
menu.className = "knobs-root knobs-menu", menu.setAttribute("role", "menu"), menu.tabIndex = -1;
|
|
6595
6650
|
let cs = win.getComputedStyle(panel);
|
|
6596
|
-
for (let t of
|
|
6597
|
-
menu.style.setProperty(`--kv-${t}`, cs.getPropertyValue(`--kv-${t}`));
|
|
6598
|
-
for (let t of [
|
|
6599
|
-
"--k-font",
|
|
6600
|
-
"--k-mono",
|
|
6601
|
-
"--k-unit",
|
|
6602
|
-
"--k-shadow",
|
|
6603
|
-
"--k-font-weight",
|
|
6604
|
-
"--k-title-weight",
|
|
6605
|
-
"--k-control-h"
|
|
6606
|
-
])
|
|
6651
|
+
for (let t of [...BORROWED, ...GLIDES])
|
|
6607
6652
|
menu.style.setProperty(t, cs.getPropertyValue(t));
|
|
6608
6653
|
menu.style.colorScheme = cs.colorScheme;
|
|
6609
6654
|
let active = -1, enabled = (i) => !items[i]?.disabled && !nodes[i]?.hidden, list = doc.createElement("div");
|
|
@@ -7068,7 +7113,7 @@ function createPageLayout(doc, host, options) {
|
|
|
7068
7113
|
}
|
|
7069
7114
|
let lit = null, glows = /* @__PURE__ */ new Map, glowing = /* @__PURE__ */ new Set, dimAmount = 0.4, panelSpring = () => {
|
|
7070
7115
|
let [duration, bounce] = getComputedStyle(host).getPropertyValue("--k-spring").trim().split(/\s+/).map(Number);
|
|
7071
|
-
return Number.isFinite(duration) && Number.isFinite(bounce) ? springMotion2({ duration, bounce }) :
|
|
7116
|
+
return Number.isFinite(duration) && Number.isFinite(bounce) ? springMotion2({ duration, bounce }) : MOTION.default;
|
|
7072
7117
|
}, idOf = (tile) => tile.dataset.group ?? tile.dataset.card, focusedIn = (node) => node.contains(doc.activeElement), litTile = (tile) => {
|
|
7073
7118
|
if (!lit)
|
|
7074
7119
|
return { on: !0, own: !1 };
|
|
@@ -7153,7 +7198,7 @@ function createPageLayout(doc, host, options) {
|
|
|
7153
7198
|
let h = Math.max(0, m.h.x);
|
|
7154
7199
|
if (node.style.height = `${h}px`, node.style.overflow = "clip", m.fold !== void 0) {
|
|
7155
7200
|
let f = Math.min(1, m.fold > 0 ? h / m.fold : 0);
|
|
7156
|
-
if (node.style.paddingTop = node.style.paddingBottom = `calc(var(--
|
|
7201
|
+
if (node.style.paddingTop = node.style.paddingBottom = `calc(var(--kv-pad) * ${f})`, node.style.marginBottom = `${-gapPx * (1 - f) - Math.max(0, 2 - h)}px`, !m.o)
|
|
7157
7202
|
node.style.opacity = leaving.has(node) && f < 0.3333333333333333 ? String(f * 3) : "";
|
|
7158
7203
|
}
|
|
7159
7204
|
}
|
|
@@ -8076,7 +8121,7 @@ function createSlider(doc, key, initialField, set, onMotionWake, options = {}) {
|
|
|
8076
8121
|
return r + (ratioOf(pulled) - r) * tokens.resist;
|
|
8077
8122
|
}, gpuActive = () => root.closest('[data-gpu-active="true"]') !== null, reduced = doc.defaultView?.matchMedia("(prefers-reduced-motion: reduce)"), writeFill = (ratio) => {
|
|
8078
8123
|
let p = `${ratio * 100}%`;
|
|
8079
|
-
fill.style.setProperty("--
|
|
8124
|
+
fill.style.setProperty("--_k-fill-at", p), handle.style.setProperty("--_k-fill-at", p), ruler.style.setProperty("--_k-fill-at", p);
|
|
8080
8125
|
}, frame = 0, frameAt = 0, smear = 0, synced = !0, springDriven = () => frame !== 0 || inHand() && stepped() || readTokens().blur > 0, setSmear = (px) => {
|
|
8081
8126
|
let next = px < 0.25 ? 0 : px;
|
|
8082
8127
|
if (next === smear)
|
|
@@ -8094,7 +8139,7 @@ function createSlider(doc, key, initialField, set, onMotionWake, options = {}) {
|
|
|
8094
8139
|
if (frame)
|
|
8095
8140
|
return;
|
|
8096
8141
|
if (!synced) {
|
|
8097
|
-
let shown = parseFloat(getComputedStyle(fill).getPropertyValue("--
|
|
8142
|
+
let shown = parseFloat(getComputedStyle(fill).getPropertyValue("--_k-fill-at"));
|
|
8098
8143
|
if (Number.isFinite(shown))
|
|
8099
8144
|
fillSpring.x = shown / 100, fillSpring.v = 0;
|
|
8100
8145
|
synced = !0;
|
|
@@ -8727,7 +8772,7 @@ function smearFilters(doc, plot) {
|
|
|
8727
8772
|
}
|
|
8728
8773
|
|
|
8729
8774
|
// src/panel/editors.ts
|
|
8730
|
-
var
|
|
8775
|
+
var reducedMotion4 = (doc) => doc.defaultView?.matchMedia("(prefers-reduced-motion: reduce)").matches ?? !1, rgbCss = (rgb) => `rgb(${rgb.map((v) => Math.round(v * 2550) / 10).join(" ")})`, pathOf = (pts) => {
|
|
8731
8776
|
let d = "";
|
|
8732
8777
|
for (let i = 0;i < pts.length; i += 2)
|
|
8733
8778
|
d += `${i ? "L" : "M"}${pts[i].toFixed(2)} ${pts[i + 1].toFixed(2)}`;
|
|
@@ -8982,7 +9027,7 @@ function springRow(c) {
|
|
|
8982
9027
|
}, size = measure2(box, () => {
|
|
8983
9028
|
readLook(), draw(!0);
|
|
8984
9029
|
}), dragging = () => parts.some((p) => p.slider.isDragging()), dotAnimation, play = (delay) => {
|
|
8985
|
-
if (!size.w ||
|
|
9030
|
+
if (!size.w || reducedMotion4(c.doc))
|
|
8986
9031
|
return;
|
|
8987
9032
|
let frames = points(), ms = SPRING_WINDOW * 1000;
|
|
8988
9033
|
dotRun = { at: performance.now() + delay, frames, ms };
|
|
@@ -9534,7 +9579,7 @@ function easingRow(c) {
|
|
|
9534
9579
|
let [x0, y0] = map(0, 0), [x1, y1] = map(1, 1);
|
|
9535
9580
|
guides.setAttribute("d", `M${EASE_PAD.x} ${y0}H${size.w - EASE_PAD.x}M${EASE_PAD.x} ${y1}H${size.w - EASE_PAD.x}M${x0} ${y0}L${x1} ${y1}`);
|
|
9536
9581
|
}
|
|
9537
|
-
let still = instant || !placed ||
|
|
9582
|
+
let still = instant || !placed || reducedMotion4(c.doc);
|
|
9538
9583
|
if (placed = !0, morph.set(unitSamples(), unitHandles(), { instant: still, delay, now: performance.now() }), morph.moving)
|
|
9539
9584
|
strength = curveBlur(x.row), loop.kick();
|
|
9540
9585
|
draw();
|
|
@@ -9732,7 +9777,7 @@ function gradientRow(c) {
|
|
|
9732
9777
|
stop.style.setProperty("--kgs-grow", grow >= 0.999 ? "" : grow.toFixed(3)), tick.style.left = `${d.at[0] * 100}%`, tick.style.setProperty("--kgs-grow", grow >= 0.999 ? "" : grow.toFixed(3)), smears.dot(stop, ...stopSmear(d));
|
|
9733
9778
|
}
|
|
9734
9779
|
}, loop = morphLoop(c, morph, draw), layout = (instant, delay = 0) => {
|
|
9735
|
-
let still = instant || !initialized ||
|
|
9780
|
+
let still = instant || !initialized || reducedMotion4(c.doc);
|
|
9736
9781
|
if (morph.set(gradientSamples(shown, f.space), unitStops(), {
|
|
9737
9782
|
instant: still,
|
|
9738
9783
|
delay,
|
|
@@ -10068,7 +10113,7 @@ function curveRow(c) {
|
|
|
10068
10113
|
}
|
|
10069
10114
|
if (miniSize.h)
|
|
10070
10115
|
mini.setAttribute("viewBox", `0 0 ${MINI_W} ${miniSize.h}`);
|
|
10071
|
-
let still = instant || !initialized ||
|
|
10116
|
+
let still = instant || !initialized || reducedMotion4(c.doc);
|
|
10072
10117
|
if (morph.set(unitSamples(), unitPoints(), { instant: still, delay, now: performance.now() }), morph.moving)
|
|
10073
10118
|
strength = curveBlur(x.row), loop.kick();
|
|
10074
10119
|
draw(), drawHover();
|
|
@@ -10721,7 +10766,7 @@ function angleRow(c) {
|
|
|
10721
10766
|
return f().wrap ? wrapAngle2(q, f().min, f().max) : clamp(q, f().min, f().max);
|
|
10722
10767
|
}, rolling = rollingReadout(read), paint = (instant, delay = 0) => {
|
|
10723
10768
|
let t = mixed ? "—" : `${fmt(value, places())}°`;
|
|
10724
|
-
if (rolling.show(mixed ? ["—"] : [{ value, decimals: places() }, "°"], instant || row.classList.contains("knobs-active") ? 0 : rollMs(row), delay), control.setAttribute("aria-valuenow", String(value)), control.setAttribute("aria-valuetext", t), instant ||
|
|
10769
|
+
if (rolling.show(mixed ? ["—"] : [{ value, decimals: places() }, "°"], instant || row.classList.contains("knobs-active") ? 0 : rollMs(row), delay), control.setAttribute("aria-valuenow", String(value)), control.setAttribute("aria-valuetext", t), instant || reducedMotion4(c.doc))
|
|
10725
10770
|
hand.style.transition = "none";
|
|
10726
10771
|
if (hand.style.rotate = `${turn.toFixed(3)}deg`, instant)
|
|
10727
10772
|
hand.offsetWidth, hand.style.transition = "";
|
|
@@ -10964,14 +11009,14 @@ function seedRow(c) {
|
|
|
10964
11009
|
gpu: [gpu]
|
|
10965
11010
|
};
|
|
10966
11011
|
}
|
|
10967
|
-
var CAP_MORPH =
|
|
11012
|
+
var CAP_MORPH = springLinear(SPRINGS2.snappy);
|
|
10968
11013
|
function keyCap(o) {
|
|
10969
11014
|
let chip = o.doc.createElement("button");
|
|
10970
11015
|
chip.className = "knobs-keys", chip.type = "button";
|
|
10971
11016
|
let text = o.doc.createElement("span");
|
|
10972
11017
|
text.className = "knobs-keys-text", chip.append(text);
|
|
10973
11018
|
let value = "", capturing = !1, preview = "", morph, write = (shown) => {
|
|
10974
|
-
let glide = chip.isConnected && chip.offsetWidth > 0 && !chip.closest('[data-gpu-active="true"]') && !
|
|
11019
|
+
let glide = chip.isConnected && chip.offsetWidth > 0 && !chip.closest('[data-gpu-active="true"]') && !reducedMotion4(o.doc), from = glide ? chip.getBoundingClientRect().width : 0;
|
|
10975
11020
|
if (morph?.cancel(), text.textContent = shown, !glide)
|
|
10976
11021
|
return;
|
|
10977
11022
|
let to = chip.getBoundingClientRect().width;
|
|
@@ -11161,7 +11206,7 @@ function toolbarRow(c, press, keyOf = toolbarShortcut2) {
|
|
|
11161
11206
|
},
|
|
11162
11207
|
press(item) {
|
|
11163
11208
|
let i = field.items.indexOf(item), b = buttons[i];
|
|
11164
|
-
if (b && !
|
|
11209
|
+
if (b && !reducedMotion4(c.doc))
|
|
11165
11210
|
b.classList.add("knobs-pressed"), setTimeout(() => b.classList.remove("knobs-pressed"), 140), c.wake();
|
|
11166
11211
|
press(item);
|
|
11167
11212
|
},
|
|
@@ -11277,34 +11322,33 @@ function markLabel(label, text, span) {
|
|
|
11277
11322
|
}
|
|
11278
11323
|
|
|
11279
11324
|
// src/ui/activity-css.ts
|
|
11280
|
-
var open =
|
|
11325
|
+
var open = springLinear(SPRINGS2.snappy), activityCss = `
|
|
11281
11326
|
:where(.knobs-activity,.knobs-activity *){box-sizing:border-box}
|
|
11282
|
-
:where(.knobs-activity){color-scheme:dark}
|
|
11283
11327
|
.knobs-ui.knobs-activity{position:relative;display:block;height:100%;overflow:auto;overflow-anchor:none;outline:none;scrollbar-width:none;overscroll-behavior:contain;user-select:none;-webkit-user-select:none;
|
|
11284
|
-
font:var(--
|
|
11285
|
-
--ka-gutter:var(--k-activity-gutter,28px);--ka-row:var(--k-activity-row,var(--
|
|
11286
|
-
--ka-line:var(--
|
|
11287
|
-
--ka-you:var(--k-activity-you,
|
|
11288
|
-
--ka-review:var(--k-activity-review,var(--
|
|
11289
|
-
--ka-blocked:var(--k-activity-blocked,var(--
|
|
11328
|
+
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);text-align:left;letter-spacing:normal;-webkit-font-smoothing:antialiased;
|
|
11329
|
+
--ka-gutter:var(--k-activity-gutter,28px);--ka-row:var(--k-activity-row,var(--_k-row));--ka-row-child:var(--k-activity-row-child,calc(var(--ka-row) - 6px));
|
|
11330
|
+
--ka-line:var(--_k-activity-rail);--ka-select:var(--k-activity-select,var(--_ku-wash-hi));--ka-hover:var(--k-activity-hover,var(--_ku-wash));
|
|
11331
|
+
--ka-you:var(--k-activity-you,var(--_k-info));--ka-agent:var(--k-activity-agent,var(--_k-fg-2));--ka-proposal:var(--k-activity-proposal,var(--_k-fg));
|
|
11332
|
+
--ka-review:var(--k-activity-review,var(--_k-fg));--ka-pr:var(--k-activity-pr,var(--_k-series-5));--ka-build:var(--k-activity-build,var(--_k-fg-2));
|
|
11333
|
+
--ka-blocked:var(--k-activity-blocked,var(--_k-warn));--ka-shipped:var(--k-activity-shipped,var(--_k-ok));--ka-open-ease:${open.easing};--ka-open-ms:${open.ms}ms}
|
|
11290
11334
|
.knobs-activity [hidden]{display:none!important}
|
|
11291
11335
|
/* Clipped below: the content grows on a spring, so a new last row shows as the rail makes room. */
|
|
11292
11336
|
.knobs-activity-space{position:relative;width:100%;overflow-x:visible;overflow-y:clip;pointer-events:none}
|
|
11293
|
-
.knobs-activity-line{position:absolute;top:0;left:calc(var(--
|
|
11337
|
+
.knobs-activity-line{position:absolute;top:0;left:calc(var(--_ku-row-x) + var(--ka-gutter) / 2 - 1px);width:2px;height:100%;overflow:visible;pointer-events:none;z-index:1}
|
|
11294
11338
|
.knobs-activity-line path{fill:none;stroke:var(--ka-line);stroke-width:1px}
|
|
11295
11339
|
/* The selection's tint: a wash that glides between rows, shown only once keys move it. It leaves
|
|
11296
11340
|
in 100 ms when the pointer is used, and comes back at once. */
|
|
11297
|
-
.knobs-activity-hl{position:absolute;left:var(--
|
|
11341
|
+
.knobs-activity-hl{position:absolute;left:var(--_ku-row-x);right:var(--_ku-row-x);top:0;height:0;border-radius:var(--_ku-row-radius);background:var(--ka-select);opacity:0;
|
|
11298
11342
|
transition:opacity 100ms ease-out;pointer-events:none;will-change:transform}
|
|
11299
11343
|
.knobs-activity[data-keys] .knobs-activity-hl{opacity:1;transition:none}
|
|
11300
|
-
.knobs-activity-row{position:absolute;left:var(--
|
|
11301
|
-
color:var(--
|
|
11344
|
+
.knobs-activity-row{position:absolute;left:var(--_ku-row-x);right:var(--_ku-row-x);top:0;display:flex;align-items:center;height:var(--ka-row);padding-right:calc(var(--_k-inset) - 4px);
|
|
11345
|
+
color:var(--_k-fg);white-space:nowrap;cursor:default;will-change:transform;transform-origin:calc(var(--ka-gutter) / 2) 50%;pointer-events:auto;--ka-tint:var(--ka-agent)}
|
|
11302
11346
|
.knobs-activity-row[data-leaving]{pointer-events:none}
|
|
11303
11347
|
.knobs-activity-row[data-depth="1"]{height:var(--ka-row-child)}
|
|
11304
11348
|
.knobs-activity-row>*{position:relative}
|
|
11305
11349
|
/* Hover: in at once, out over 100 ms; not while keys drive the selection. */
|
|
11306
|
-
.knobs-activity-row::before{content:"";position:absolute;inset:0;border-radius:var(--
|
|
11307
|
-
.knobs-activity:not([data-keys]) .knobs-activity-row:not([data-leaving]):hover::before{opacity:1;transition-duration:calc(var(--
|
|
11350
|
+
.knobs-activity-row::before{content:"";position:absolute;inset:0;border-radius:var(--_ku-row-radius);background:var(--ka-hover);opacity:0;transition:opacity calc(var(--_k-hover-out,100) * 1ms) ease-out;pointer-events:none}
|
|
11351
|
+
.knobs-activity:not([data-keys]) .knobs-activity-row:not([data-leaving]):hover::before{opacity:1;transition-duration:calc(var(--_k-hover-in,0) * 1ms)}
|
|
11308
11352
|
.knobs-activity-row[data-kind="you"]{--ka-tint:var(--ka-you)}
|
|
11309
11353
|
.knobs-activity-row[data-kind="agent"]{--ka-tint:var(--ka-agent)}
|
|
11310
11354
|
.knobs-activity-row[data-kind="proposal"]{--ka-tint:var(--ka-proposal)}
|
|
@@ -11316,7 +11360,7 @@ var open = springEasing(2 * Math.PI / 0.22, 1), activityCss = `
|
|
|
11316
11360
|
/* The node: the kind's icon on the line (which stops clear of it), or a small dot inside a group. */
|
|
11317
11361
|
.knobs-activity-node{flex:none;display:flex;align-items:center;justify-content:center;width:var(--ka-gutter);height:100%;color:var(--ka-tint)}
|
|
11318
11362
|
.knobs-activity-node svg{display:block;width:14px;height:14px}
|
|
11319
|
-
.knobs-activity-glyph{display:flex;align-items:center;justify-content:center;width:14px;height:14px;font-size:calc(var(--
|
|
11363
|
+
.knobs-activity-glyph{display:flex;align-items:center;justify-content:center;width:14px;height:14px;font-size:calc(var(--_k-font-size) - 1px);line-height:1}
|
|
11320
11364
|
.knobs-activity-node::before{content:"";position:absolute;left:50%;top:50%;width:22px;height:22px;margin:-11px 0 0 -11px;border-radius:50%;background:color-mix(in srgb,var(--ka-tint) 15%,transparent);
|
|
11321
11365
|
opacity:0;scale:.8;transition:opacity .16s ease-out,scale var(--ka-open-ms) var(--ka-open-ease)}
|
|
11322
11366
|
.knobs-activity-row[aria-selected="true"] .knobs-activity-node::before{opacity:1;scale:1}
|
|
@@ -11328,47 +11372,47 @@ var open = springEasing(2 * Math.PI / 0.22, 1), activityCss = `
|
|
|
11328
11372
|
.knobs-activity-row[data-depth="1"] .knobs-activity-node::before,.knobs-activity-row[data-depth="1"] .knobs-activity-node::after{width:13px;height:13px;margin:-6.5px 0 0 -6.5px}
|
|
11329
11373
|
/* The words: who in the text colour, then the title, one line that fades where it's cut off. */
|
|
11330
11374
|
.knobs-activity-main{flex:1;min-width:0;overflow:hidden;white-space:nowrap}
|
|
11331
|
-
.knobs-activity-actor{margin-right:6px;font-weight:var(--
|
|
11375
|
+
.knobs-activity-actor{margin-right:6px;font-weight:var(--_k-weight-label);color:var(--_k-fg)}
|
|
11332
11376
|
.knobs-activity-actor:empty{display:none}
|
|
11333
|
-
.knobs-activity-title{color:var(--
|
|
11334
|
-
.knobs-activity-row[data-depth="1"] .knobs-activity-main{font-size:var(--
|
|
11335
|
-
.knobs-activity-row[data-depth="1"] .knobs-activity-actor{font-weight:var(--
|
|
11336
|
-
.knobs-activity-row[data-depth="1"] .knobs-activity-title{color:var(--
|
|
11337
|
-
.knobs-activity-row[aria-selected="true"] .knobs-activity-title{color:var(--
|
|
11377
|
+
.knobs-activity-title{color:var(--_k-fg-2)}
|
|
11378
|
+
.knobs-activity-row[data-depth="1"] .knobs-activity-main{font-size:var(--_k-text-meta)}
|
|
11379
|
+
.knobs-activity-row[data-depth="1"] .knobs-activity-actor{font-weight:var(--_k-weight);color:var(--_k-fg-2)}
|
|
11380
|
+
.knobs-activity-row[data-depth="1"] .knobs-activity-title{color:var(--_k-fg-3)}
|
|
11381
|
+
.knobs-activity-row[aria-selected="true"] .knobs-activity-title{color:var(--_k-fg)}
|
|
11338
11382
|
.knobs-activity-row[data-dimmed] :is(.knobs-activity-main,.knobs-activity-meta){opacity:.55}
|
|
11339
11383
|
.knobs-activity-row[data-dimmed] .knobs-activity-node{opacity:.6}
|
|
11340
11384
|
/* Trailing: thumbnails, a duration chip, the group's chevron and the time. */
|
|
11341
|
-
.knobs-activity-meta{flex:none;display:flex;align-items:center;gap:6px;margin-left:8px;color:var(--
|
|
11385
|
+
.knobs-activity-meta{flex:none;display:flex;align-items:center;gap:6px;margin-left:8px;color:var(--_k-fg-3);font-size:var(--_k-text-meta);font-variant-numeric:tabular-nums}
|
|
11342
11386
|
.knobs-activity-meta:empty{display:none}
|
|
11343
11387
|
.knobs-activity-thumbs{display:flex;gap:3px}
|
|
11344
|
-
.knobs-activity-thumbs img{display:block;width:18px;height:18px;border-radius:4px;object-fit:cover;background:var(--
|
|
11388
|
+
.knobs-activity-thumbs img{display:block;width:18px;height:18px;border-radius:4px;object-fit:cover;background:var(--_k-fill);box-shadow:inset 0 0 0 .5px var(--_k-border)}
|
|
11345
11389
|
.knobs-activity-row[data-depth="1"] .knobs-activity-thumbs img{width:15px;height:15px}
|
|
11346
11390
|
:where(.knobs-ui) .knobs-activity-chip{all:revert;box-sizing:border-box;display:inline-flex;align-items:center;gap:4px;height:18px;padding:0 6px 0 5px;border:0;margin:0;border-radius:9px;
|
|
11347
|
-
background:var(--
|
|
11391
|
+
background:var(--_k-fill);color:var(--_k-fg-2);font:inherit;font-variant-numeric:tabular-nums;letter-spacing:inherit;outline:none;transition:background calc(var(--_k-hover-out,100) * 1ms) ease-out}
|
|
11348
11392
|
.knobs-activity-chip svg{width:8px;height:8px}
|
|
11349
11393
|
button.knobs-activity-chip{cursor:pointer}
|
|
11350
|
-
button.knobs-activity-chip:hover{background:var(--
|
|
11351
|
-
.knobs-activity-caret{display:flex;width:12px;height:12px;color:var(--
|
|
11394
|
+
button.knobs-activity-chip:hover{background:var(--_k-fill-selected);color:var(--_k-fg);transition-duration:0s}
|
|
11395
|
+
.knobs-activity-caret{display:flex;width:12px;height:12px;color:var(--_k-fg-3);transition:rotate .18s var(--_ku-ease)}
|
|
11352
11396
|
.knobs-activity-caret svg{width:10px;height:10px;margin:1px}
|
|
11353
11397
|
.knobs-activity-row[aria-expanded="true"] .knobs-activity-caret{rotate:90deg;transition:rotate var(--ka-open-ms) var(--ka-open-ease)}
|
|
11354
11398
|
.knobs-activity-time{min-width:2ch;text-align:right;white-space:nowrap}
|
|
11355
11399
|
.knobs-activity-time:empty{display:none}
|
|
11356
|
-
.knobs-activity-empty{padding:10px var(--
|
|
11400
|
+
.knobs-activity-empty{padding:10px var(--_k-inset);color:var(--_k-fg-3)}
|
|
11357
11401
|
@media(prefers-reduced-motion:reduce){.knobs-activity :where(*,::before,::after){transition:none!important;animation:none!important}}
|
|
11358
11402
|
`;
|
|
11359
11403
|
|
|
11360
11404
|
// src/ui/bento-css.ts
|
|
11361
11405
|
var bentoCss = `
|
|
11362
|
-
.knobs-ui.knobs-bento{--
|
|
11363
|
-
position:relative;width:100%;height:100%;overflow:hidden auto;outline:none;background:var(--k-ui-bento-bg,var(--
|
|
11406
|
+
.knobs-ui.knobs-bento{--_ku-bento-radius:var(--k-ui-bento-radius,max(0px,calc(var(--_k-radius) - 5px)));
|
|
11407
|
+
position:relative;width:100%;height:100%;overflow:hidden auto;outline:none;background:var(--k-ui-bento-bg,var(--_k-bg-page));
|
|
11364
11408
|
scrollbar-width:thin;scrollbar-gutter:stable;overscroll-behavior:contain;touch-action:pan-y;user-select:none;-webkit-user-select:none;
|
|
11365
|
-
font:var(--
|
|
11366
|
-
.knobs-bento[data-frame="flat"]{--
|
|
11409
|
+
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);letter-spacing:normal;text-align:left}
|
|
11410
|
+
.knobs-bento[data-frame="flat"]{--_ku-bento-radius:var(--k-ui-bento-radius,0px)}
|
|
11367
11411
|
.knobs-bento[data-pending] .knobs-bento-space{visibility:hidden}
|
|
11368
11412
|
:where(.knobs-bento-space,.knobs-bento-space *){box-sizing:border-box}
|
|
11369
11413
|
.knobs-bento-space{position:relative;width:100%}
|
|
11370
|
-
.knobs-bento-tile{position:absolute;left:0;top:0;transform-origin:0 0;overflow:hidden;border-radius:var(--
|
|
11371
|
-
background:var(--
|
|
11414
|
+
.knobs-bento-tile{position:absolute;left:0;top:0;transform-origin:0 0;overflow:hidden;border-radius:var(--_ku-bento-radius);
|
|
11415
|
+
background:var(--_k-fill);contain:strict;cursor:zoom-in}
|
|
11372
11416
|
.knobs-bento-tile[data-focus]{z-index:2;cursor:zoom-out}
|
|
11373
11417
|
.knobs-bento-tile[data-focus][data-live]{cursor:auto}
|
|
11374
11418
|
.knobs-bento-img{display:block;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .18s cubic-bezier(.2,.8,.2,1);-webkit-user-drag:none}
|
|
@@ -11376,49 +11420,49 @@ var bentoCss = `
|
|
|
11376
11420
|
.knobs-bento-tile[data-instant] .knobs-bento-img{transition:none}
|
|
11377
11421
|
.knobs-bento-body{position:absolute;inset:0;pointer-events:none}
|
|
11378
11422
|
.knobs-bento-tile[data-focus] .knobs-bento-body{pointer-events:auto}
|
|
11379
|
-
.knobs-bento-label{position:absolute;left:9px;right:9px;bottom:7px;color:#fff;font-size:var(--
|
|
11380
|
-
text-shadow:0 0 6px rgba(0,0,0,.55),0 0 1px rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:opacity calc(var(--
|
|
11423
|
+
.knobs-bento-label{position:absolute;left:9px;right:9px;bottom:7px;color:#fff;font-size:var(--_k-text-meta);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
|
|
11424
|
+
text-shadow:0 0 6px rgba(0,0,0,.55),0 0 1px rgba(0,0,0,.5);opacity:0;pointer-events:none;transition:opacity calc(var(--_k-hover-out) * 1ms)}
|
|
11381
11425
|
.knobs-bento:not([data-keyboard]) .knobs-bento-tile:hover .knobs-bento-label,
|
|
11382
11426
|
.knobs-bento[data-keyboard]:focus .knobs-bento-tile[data-active] .knobs-bento-label,
|
|
11383
|
-
.knobs-bento-tile[data-focus] .knobs-bento-label{opacity:1;transition-duration:calc(var(--
|
|
11427
|
+
.knobs-bento-tile[data-focus] .knobs-bento-label{opacity:1;transition-duration:calc(var(--_k-hover-in) * 1ms)}
|
|
11384
11428
|
/* A pick: a small dot in the accent, ringed in the page so it reads on any picture. */
|
|
11385
|
-
.knobs-bento-tile::after{content:"";position:absolute;top:8px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--
|
|
11386
|
-
box-shadow:0 0 0 1.5px color-mix(in srgb,var(--
|
|
11387
|
-
transition:opacity .11s cubic-bezier(.4,0,1,1),scale var(--
|
|
11388
|
-
.knobs-bento-tile[aria-selected="true"]::after{opacity:1;scale:1;transition:opacity .15s cubic-bezier(.2,.8,.2,1),scale var(--
|
|
11389
|
-
.knobs-bento-wash{position:absolute;left:0;top:0;width:100px;height:100px;transform-origin:0 0;z-index:3;pointer-events:none;border-radius:var(--
|
|
11390
|
-
background:color-mix(in srgb,var(--
|
|
11429
|
+
.knobs-bento-tile::after{content:"";position:absolute;top:8px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--_k-accent);
|
|
11430
|
+
box-shadow:0 0 0 1.5px color-mix(in srgb,var(--_k-bg-page) 70%,transparent);opacity:0;scale:.4;pointer-events:none;
|
|
11431
|
+
transition:opacity .11s cubic-bezier(.4,0,1,1),scale var(--_ku-ease-ms) var(--_ku-ease)}
|
|
11432
|
+
.knobs-bento-tile[aria-selected="true"]::after{opacity:1;scale:1;transition:opacity .15s cubic-bezier(.2,.8,.2,1),scale var(--_ku-ease-ms) var(--_ku-ease)}
|
|
11433
|
+
.knobs-bento-wash{position:absolute;left:0;top:0;width:100px;height:100px;transform-origin:0 0;z-index:3;pointer-events:none;border-radius:var(--_ku-bento-radius);
|
|
11434
|
+
background:color-mix(in srgb,var(--_k-accent) 12%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--_k-accent) 45%,transparent);
|
|
11391
11435
|
opacity:0;transition:opacity .15s}
|
|
11392
11436
|
.knobs-bento[data-keyboard]:focus:not([data-zoomed]) .knobs-bento-wash[data-on]{opacity:1}
|
|
11393
|
-
.knobs-bento-scrim{position:absolute;left:0;top:0;width:100%;z-index:1;background:var(--k-ui-scrim,var(--k-ui-bento-bg,var(--
|
|
11437
|
+
.knobs-bento-scrim{position:absolute;left:0;top:0;width:100%;z-index:1;background:var(--k-ui-scrim,var(--k-ui-bento-bg,var(--_k-bg-page)));opacity:0;pointer-events:none;cursor:zoom-out}
|
|
11394
11438
|
.knobs-bento[data-zoomed] .knobs-bento-scrim{pointer-events:auto}
|
|
11395
|
-
.knobs-bento-head{position:absolute;left:0;top:0;display:flex;align-items:flex-end;padding:0 0 6px 2px;color:var(--
|
|
11396
|
-
font-size:var(--
|
|
11439
|
+
.knobs-bento-head{position:absolute;left:0;top:0;display:flex;align-items:flex-end;padding:0 0 6px 2px;color:var(--_k-fg-2);font-weight:var(--_k-weight-label);
|
|
11440
|
+
font-size:var(--_k-text-meta);white-space:nowrap;pointer-events:none}
|
|
11397
11441
|
`;
|
|
11398
11442
|
|
|
11399
11443
|
// src/ui/compare-css.ts
|
|
11400
11444
|
var compareCss = `
|
|
11401
11445
|
:where(.knobs-compare,.knobs-compare *,.knobs-cmp-strip,.knobs-cmp-strip *){box-sizing:border-box}
|
|
11402
|
-
.knobs-ui.knobs-compare{--
|
|
11403
|
-
--
|
|
11446
|
+
.knobs-ui.knobs-compare{--_ku-cmp-diff:var(--k-compare-diff,var(--_k-ok));--_ku-cmp-line:var(--_k-compare-divider);
|
|
11447
|
+
--_ku-cmp-stage:var(--_k-compare-stage);
|
|
11404
11448
|
display:flex;flex-direction:column;gap:6px;width:100%;height:100%;min-height:160px;outline:none;user-select:none;-webkit-user-select:none;
|
|
11405
|
-
font:var(--
|
|
11449
|
+
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);letter-spacing:normal;text-align:left}
|
|
11406
11450
|
:where(.knobs-ui) :is(.knobs-cmp-mode,.knobs-cmp-toggle){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;background:transparent;border:0;margin:0;padding:0;outline:none;box-shadow:none}
|
|
11407
11451
|
.knobs-cmp-bar{flex:none;display:flex;align-items:center;gap:2px;height:24px;padding:0 2px}
|
|
11408
11452
|
.knobs-cmp-modes{display:flex;align-items:center;gap:2px}
|
|
11409
|
-
.knobs-ui .knobs-cmp-mode,.knobs-ui .knobs-cmp-toggle{height:22px;padding:0 7px;border-radius:max(0px,calc(var(--
|
|
11453
|
+
.knobs-ui .knobs-cmp-mode,.knobs-ui .knobs-cmp-toggle{height:22px;padding:0 7px;border-radius:max(0px,calc(var(--_k-radius) - 2px));color:var(--_k-fg-3);cursor:pointer;white-space:nowrap;
|
|
11410
11454
|
transition:color .15s,background .15s}
|
|
11411
|
-
.knobs-ui .knobs-cmp-mode:is(:hover,:focus-visible),.knobs-ui .knobs-cmp-toggle:is(:hover,:focus-visible){color:var(--
|
|
11412
|
-
.knobs-ui .knobs-cmp-mode[aria-checked="true"],.knobs-ui .knobs-cmp-toggle[aria-pressed="true"]{color:var(--
|
|
11455
|
+
.knobs-ui .knobs-cmp-mode:is(:hover,:focus-visible),.knobs-ui .knobs-cmp-toggle:is(:hover,:focus-visible){color:var(--_k-fg);background:var(--_ku-wash)}
|
|
11456
|
+
.knobs-ui .knobs-cmp-mode[aria-checked="true"],.knobs-ui .knobs-cmp-toggle[aria-pressed="true"]{color:var(--_k-fg);font-weight:var(--_k-weight-label)}
|
|
11413
11457
|
.knobs-cmp-fill{flex:1}
|
|
11414
11458
|
.knobs-cmp-toggle[hidden]{display:none}
|
|
11415
11459
|
/* One surface: on a card (a walkthrough's step, a split's pane, anything .knobs-surface) or marked
|
|
11416
11460
|
data-nested, the stage drops its fill and the sides sit on that card. */
|
|
11417
|
-
:where(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-ui.knobs-compare,.knobs-ui.knobs-compare[data-nested]{--
|
|
11461
|
+
:where(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-ui.knobs-compare,.knobs-ui.knobs-compare[data-nested]{--_ku-cmp-stage:var(--k-compare-stage,transparent)}
|
|
11418
11462
|
/* In a page's flow (a container with no height), it takes the height its sides need. */
|
|
11419
11463
|
.knobs-ui.knobs-compare[data-auto]{height:auto}
|
|
11420
11464
|
.knobs-compare[data-auto] .knobs-cmp-stage{flex:none;min-height:0}
|
|
11421
|
-
.knobs-cmp-stage{position:relative;flex:1;min-height:96px;overflow:hidden;border-radius:var(--
|
|
11465
|
+
.knobs-cmp-stage{position:relative;flex:1;min-height:96px;overflow:hidden;border-radius:var(--_k-radius-panel);background:var(--_ku-cmp-stage);touch-action:pan-y;outline:none}
|
|
11422
11466
|
.knobs-compare[data-frame="flat"] .knobs-cmp-stage{border-radius:0}
|
|
11423
11467
|
.knobs-compare[data-mode="wipe"] .knobs-cmp-stage{cursor:ew-resize}
|
|
11424
11468
|
/* Unzoomed, a finger still scrolls the page up and down; zoomed, the stage takes every gesture. */
|
|
@@ -11430,37 +11474,37 @@ var compareCss = `
|
|
|
11430
11474
|
.knobs-cmp-media{position:absolute;left:0;top:0;display:block;max-width:none;margin:0;padding:0;border:0;object-fit:fill;transform-origin:0 0;pointer-events:none;will-change:transform}
|
|
11431
11475
|
.knobs-compare[data-renderer="gpu"] .knobs-cmp-media{opacity:0}
|
|
11432
11476
|
/* Glass: what's behind shows through, blurred, on the knobs tokens. */
|
|
11433
|
-
.knobs-cmp-label,.knobs-cmp-zoom{background:color-mix(in srgb,var(--
|
|
11434
|
-
box-shadow:inset 0 0 0 .5px var(--
|
|
11435
|
-
.knobs-cmp-label{position:absolute;left:0;top:0;padding:1px 7px;border-radius:999px;font-size:var(--
|
|
11436
|
-
.knobs-cmp-label[data-lit]{color:var(--
|
|
11437
|
-
.knobs-cmp-label[data-dim]{color:var(--
|
|
11477
|
+
.knobs-cmp-label,.knobs-cmp-zoom{background:color-mix(in srgb,var(--_k-bg) 52%,transparent);-webkit-backdrop-filter:blur(14px) saturate(1.6);backdrop-filter:blur(14px) saturate(1.6);
|
|
11478
|
+
box-shadow:inset 0 0 0 .5px var(--_k-border),inset 0 1px 0 var(--_k-rim),0 2px 10px rgba(0,0,0,calc(.18 * var(--_k-shadow-k,1)))}
|
|
11479
|
+
.knobs-cmp-label{position:absolute;left:0;top:0;padding:1px 7px;border-radius:999px;font-size:var(--_k-text-meta);line-height:16px;color:var(--_k-fg-2);white-space:nowrap;pointer-events:none;will-change:transform;transition:color .15s}
|
|
11480
|
+
.knobs-cmp-label[data-lit]{color:var(--_k-fg)}
|
|
11481
|
+
.knobs-cmp-label[data-dim]{color:var(--_k-fg-3)}
|
|
11438
11482
|
/* The wipe: a hairline down the line with a grip at its middle; a wider strip takes the hand and
|
|
11439
11483
|
the keys (a slider). It fades with the mode. */
|
|
11440
11484
|
.knobs-cmp-handle{cursor:ew-resize;position:absolute;left:-12px;top:0;width:24px;height:0;opacity:0;pointer-events:none;outline:none;will-change:transform;transition:opacity .18s cubic-bezier(.4,0,1,1)}
|
|
11441
11485
|
.knobs-cmp-handle[data-on]{opacity:1;pointer-events:auto;transition:opacity .22s cubic-bezier(.2,.8,.2,1)}
|
|
11442
|
-
.knobs-cmp-handle::before{content:"";position:absolute;top:0;bottom:0;left:11.5px;width:1px;background:var(--
|
|
11443
|
-
.knobs-cmp-handle::after{content:"";position:absolute;top:50%;left:9px;width:6px;height:28px;margin-top:-14px;border-radius:3px;background:var(--
|
|
11444
|
-
box-shadow:0 1px 3px rgba(0,0,0,.35),0 0 0 .5px rgba(0,0,0,.2);transition:scale .18s var(--
|
|
11486
|
+
.knobs-cmp-handle::before{content:"";position:absolute;top:0;bottom:0;left:11.5px;width:1px;background:var(--_ku-cmp-line);box-shadow:0 0 0 .5px rgba(0,0,0,.28),0 0 6px rgba(0,0,0,.25)}
|
|
11487
|
+
.knobs-cmp-handle::after{content:"";position:absolute;top:50%;left:9px;width:6px;height:28px;margin-top:-14px;border-radius:3px;background:var(--_ku-cmp-line);
|
|
11488
|
+
box-shadow:0 1px 3px rgba(0,0,0,.35),0 0 0 .5px rgba(0,0,0,.2);transition:scale .18s var(--_ku-ease),box-shadow .15s}
|
|
11445
11489
|
.knobs-compare[data-dragging] .knobs-cmp-handle::after{scale:1.12}
|
|
11446
|
-
.knobs-cmp-handle:focus-visible::after,.knobs-compare[data-keyboard] .knobs-cmp-handle:focus::after{box-shadow:0 1px 3px rgba(0,0,0,.35),0 0 0 3px color-mix(in srgb,var(--
|
|
11490
|
+
.knobs-cmp-handle:focus-visible::after,.knobs-compare[data-keyboard] .knobs-cmp-handle:focus::after{box-shadow:0 1px 3px rgba(0,0,0,.35),0 0 0 3px color-mix(in srgb,var(--_k-accent) 40%,transparent)}
|
|
11447
11491
|
/* The split's hairline, down the middle side by side. */
|
|
11448
|
-
.knobs-cmp-split{position:absolute;left:0;top:0;width:1px;height:0;margin-left:-.5px;background:color-mix(in srgb,var(--
|
|
11492
|
+
.knobs-cmp-split{position:absolute;left:0;top:0;width:1px;height:0;margin-left:-.5px;background:color-mix(in srgb,var(--_k-bg) 72%,transparent);pointer-events:none;will-change:transform,opacity}
|
|
11449
11493
|
/* Zoomed: how far, and a way back, in the stage's corner; it fades in and out, nothing shifts. */
|
|
11450
11494
|
.knobs-cmp-zoom{position:absolute;right:8px;bottom:8px;display:flex;align-items:center;gap:4px;height:26px;padding:0 3px 0 10px;border-radius:999px;
|
|
11451
|
-
color:var(--
|
|
11495
|
+
color:var(--_k-fg);font-size:var(--_k-text-meta);font-variant-numeric:tabular-nums;font-feature-settings:"tnum";white-space:nowrap;
|
|
11452
11496
|
opacity:0;scale:.96;pointer-events:none;transition:opacity .16s cubic-bezier(.4,0,1,1),scale .16s cubic-bezier(.4,0,1,1)}
|
|
11453
11497
|
.knobs-cmp-zoom[data-on]{opacity:1;scale:1;pointer-events:auto;transition:opacity .2s cubic-bezier(.2,.8,.2,1),scale .2s cubic-bezier(.2,.8,.2,1)}
|
|
11454
11498
|
:where(.knobs-ui) .knobs-cmp-zoom-reset{all:revert;box-sizing:border-box;font:inherit;letter-spacing:inherit;margin:0;border:0;outline:none;box-shadow:none;
|
|
11455
|
-
height:20px;padding:0 8px;border-radius:999px;background:transparent;color:var(--
|
|
11456
|
-
:where(.knobs-ui) .knobs-cmp-zoom-reset:is(:hover,:focus-visible){color:var(--
|
|
11457
|
-
.knobs-cmp-note{position:absolute;left:50%;top:50%;translate:-50% -50%;color:var(--
|
|
11499
|
+
height:20px;padding:0 8px;border-radius:999px;background:transparent;color:var(--_k-fg-2);cursor:pointer;transition:color .15s,background .15s}
|
|
11500
|
+
:where(.knobs-ui) .knobs-cmp-zoom-reset:is(:hover,:focus-visible){color:var(--_k-fg);background:color-mix(in srgb,var(--_k-fg) 12%,transparent)}
|
|
11501
|
+
.knobs-cmp-note{position:absolute;left:50%;top:50%;translate:-50% -50%;color:var(--_k-fg-3);font-size:var(--_k-text-meta);pointer-events:none}
|
|
11458
11502
|
.knobs-cmp-note:empty{display:none}
|
|
11459
11503
|
.knobs-cmp-strip-host{flex:none;height:60px;min-height:0}
|
|
11460
11504
|
.knobs-cmp-timeline-host{flex:none;height:56px;min-height:0}
|
|
11461
11505
|
/* The frame strip: Before over After per column, a difference bar under them, a dot where it peaks. */
|
|
11462
|
-
.knobs-ui.knobs-cmp-strip{--
|
|
11463
|
-
font:var(--
|
|
11506
|
+
.knobs-ui.knobs-cmp-strip{--_ku-cmp-diff:var(--k-compare-diff,var(--_k-ok));position:relative;width:100%;height:100%;min-height:40px;overflow:hidden;cursor:col-resize;touch-action:none;
|
|
11507
|
+
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg)}
|
|
11464
11508
|
.knobs-cmp-strip>canvas{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none}
|
|
11465
11509
|
@media(prefers-reduced-motion:reduce){:is(.knobs-compare,.knobs-cmp-strip) :where(*,::before,::after){transition-duration:.12s!important}}
|
|
11466
11510
|
`;
|
|
@@ -11469,132 +11513,132 @@ var compareCss = `
|
|
|
11469
11513
|
var overlayCss = `
|
|
11470
11514
|
.knobs-layers{position:fixed;inset:0;z-index:2147480005;pointer-events:none}
|
|
11471
11515
|
.knobs-layers>.knobs-layer,.knobs-ui.knobs-toast{position:fixed;left:0;top:0;box-sizing:border-box;pointer-events:auto;outline:none;
|
|
11472
|
-
font:var(--
|
|
11516
|
+
font:var(--_k-weight) var(--_k-font-size)/1.4 var(--_k-font);color:var(--_k-fg);letter-spacing:normal;text-align:left;text-transform:none;
|
|
11473
11517
|
-webkit-font-smoothing:antialiased;will-change:transform,opacity,filter}
|
|
11474
11518
|
/* The overlays' own elements stop a host's element rules; what you put in a popover is yours. */
|
|
11475
11519
|
:where(.knobs-layers,.knobs-toast) :is(.knobs-kbd,.knobs-mitem,.knobs-menu-sep,.knobs-palette-input,.knobs-palette-label>mark,.knobs-confirm-title,.knobs-confirm-body,.knobs-confirm-btn,.knobs-toast-action){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;
|
|
11476
11520
|
background:transparent;border:0;margin:0;padding:0;outline:none;box-shadow:none}
|
|
11477
11521
|
.knobs-layers .knobs-layer *{box-sizing:border-box}
|
|
11478
11522
|
/* A floating surface: frosted, a hairline rim, a soft shadow. */
|
|
11479
|
-
.knobs-layers>:is(.knobs-popover-layer,.knobs-palette,.knobs-confirm,.knobs-menu-layer){background:color-mix(in srgb,var(--
|
|
11480
|
-
-webkit-backdrop-filter:blur(28px) saturate(1.7);backdrop-filter:blur(28px) saturate(1.7);border-radius:var(--
|
|
11481
|
-
box-shadow:0 0 0 .5px var(--
|
|
11523
|
+
.knobs-layers>:is(.knobs-popover-layer,.knobs-palette,.knobs-confirm,.knobs-menu-layer){background:color-mix(in srgb,var(--_k-bg) 88%,transparent);
|
|
11524
|
+
-webkit-backdrop-filter:blur(28px) saturate(1.7);backdrop-filter:blur(28px) saturate(1.7);border-radius:var(--_k-radius-panel);
|
|
11525
|
+
box-shadow:0 0 0 .5px var(--_k-border-strong),inset 0 1px 0 var(--_k-rim),0 12px 40px rgba(0,0,0,calc(.36 * var(--_k-shadow-k,1))),0 2px 8px rgba(0,0,0,calc(.18 * var(--_k-shadow-k,1)))}
|
|
11482
11526
|
.knobs-layers>.knobs-popover-layer{min-width:120px;max-width:min(420px,calc(100vw - 16px));padding:6px}
|
|
11483
|
-
.knobs-popover-layer .knobs-popover-text{padding:4px 6px;color:var(--
|
|
11527
|
+
.knobs-popover-layer .knobs-popover-text{padding:4px 6px;color:var(--_k-fg-2)}
|
|
11484
11528
|
|
|
11485
11529
|
/* Menus: rows of the panel's control height, a soft wash on the active one (never an outline),
|
|
11486
11530
|
concentric corners inside the surface. */
|
|
11487
11531
|
.knobs-layers>.knobs-menu-layer{display:flex;flex-direction:column;min-width:184px;max-width:min(340px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;padding:5px;
|
|
11488
11532
|
scrollbar-width:thin;overscroll-behavior:contain;user-select:none;-webkit-user-select:none}
|
|
11489
|
-
.knobs-menu-layer .knobs-mitem{position:relative;display:flex;align-items:center;gap:8px;flex:none;height:max(22px,calc(var(--
|
|
11490
|
-
border-radius:max(0px,calc(var(--
|
|
11491
|
-
.knobs-menu-layer .knobs-mitem[data-active],.knobs-menu-layer .knobs-mitem[data-open]{background:var(--
|
|
11492
|
-
.knobs-menu-layer .knobs-mitem[data-destructive]{color:var(--
|
|
11493
|
-
.knobs-menu-layer .knobs-mitem[data-destructive][data-active]{background:color-mix(in srgb,var(--
|
|
11533
|
+
.knobs-menu-layer .knobs-mitem{position:relative;display:flex;align-items:center;gap:8px;flex:none;height:max(22px,calc(var(--_k-row) - 6px));padding:0 8px;
|
|
11534
|
+
border-radius:max(0px,calc(var(--_k-radius-panel) - 5px));color:var(--_k-fg);cursor:default;white-space:nowrap}
|
|
11535
|
+
.knobs-menu-layer .knobs-mitem[data-active],.knobs-menu-layer .knobs-mitem[data-open]{background:var(--_ku-wash-hi)}
|
|
11536
|
+
.knobs-menu-layer .knobs-mitem[data-destructive]{color:var(--_k-danger)}
|
|
11537
|
+
.knobs-menu-layer .knobs-mitem[data-destructive][data-active]{background:color-mix(in srgb,var(--_k-danger) 16%,transparent)}
|
|
11494
11538
|
.knobs-menu-layer .knobs-mitem[aria-disabled="true"]{opacity:.38}
|
|
11495
|
-
.knobs-menu-layer .knobs-menu-lead{flex:none;display:flex;align-items:center;justify-content:center;width:14px;margin-left:-2px;color:var(--
|
|
11539
|
+
.knobs-menu-layer .knobs-menu-lead{flex:none;display:flex;align-items:center;justify-content:center;width:14px;margin-left:-2px;color:var(--_k-fg-2);font-size:calc(var(--_k-font-size) - 1px)}
|
|
11496
11540
|
.knobs-menu-layer .knobs-mitem[data-destructive] .knobs-menu-lead,.knobs-menu-layer .knobs-mitem[aria-checked="true"] .knobs-menu-lead{color:inherit}
|
|
11497
11541
|
.knobs-menu-layer .knobs-menu-lead svg{width:13px;height:13px}
|
|
11498
11542
|
.knobs-menu-layer .knobs-menu-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}
|
|
11499
|
-
.knobs-menu-layer .knobs-menu-hint{flex:none;color:var(--
|
|
11543
|
+
.knobs-menu-layer .knobs-menu-hint{flex:none;color:var(--_k-fg-3)}
|
|
11500
11544
|
.knobs-menu-layer .knobs-menu-keys{display:inline-flex;gap:2px;flex:none;margin-left:12px}
|
|
11501
|
-
.knobs-menu-layer .knobs-mitem[data-active] .knobs-kbd{background:color-mix(in srgb,var(--
|
|
11502
|
-
.knobs-menu-layer .knobs-menu-caret{flex:none;display:flex;margin-left:8px;margin-right:-3px;color:var(--
|
|
11545
|
+
.knobs-menu-layer .knobs-mitem[data-active] .knobs-kbd{background:color-mix(in srgb,var(--_k-fg) 14%,transparent);color:var(--_k-fg)}
|
|
11546
|
+
.knobs-menu-layer .knobs-menu-caret{flex:none;display:flex;margin-left:8px;margin-right:-3px;color:var(--_k-fg-3)}
|
|
11503
11547
|
.knobs-menu-layer .knobs-menu-caret svg{width:10px;height:10px}
|
|
11504
|
-
.knobs-menu-layer .knobs-menu-sep{flex:none;height:1px;margin:4px 8px;background:var(--
|
|
11548
|
+
.knobs-menu-layer .knobs-menu-sep{flex:none;height:1px;margin:4px 8px;background:var(--_k-border)}
|
|
11505
11549
|
|
|
11506
11550
|
.knobs-layers>.knobs-tooltip{display:inline-flex;align-items:center;gap:7px;max-width:300px;padding:4px 8px;pointer-events:none;white-space:nowrap;
|
|
11507
|
-
font-size:calc(var(--
|
|
11508
|
-
box-shadow:0 0 0 .5px var(--
|
|
11551
|
+
font-size:calc(var(--_k-font-size) - .5px);background:var(--_k-bg);color:var(--_k-fg);border-radius:min(var(--_k-radius),6px);
|
|
11552
|
+
box-shadow:0 0 0 .5px var(--_k-border-strong),0 4px 14px rgba(0,0,0,calc(.3 * var(--_k-shadow-k,1)))}
|
|
11509
11553
|
.knobs-tooltip .knobs-tooltip-text{overflow:hidden;text-overflow:ellipsis}
|
|
11510
11554
|
.knobs-layer :is(.knobs-tooltip-keys,.knobs-palette-keys){display:inline-flex;gap:2px;flex:none}
|
|
11511
11555
|
.knobs-layer .knobs-tooltip-keys[hidden]{display:none}
|
|
11512
11556
|
.knobs-layer .knobs-kbd{display:inline-flex;align-items:center;justify-content:center;min-width:17px;height:17px;padding:0 4px;
|
|
11513
|
-
border-radius:min(var(--
|
|
11557
|
+
border-radius:min(var(--_k-radius),4px);background:var(--_k-fill-selected);color:var(--_k-fg-2);font:500 calc(var(--_k-font-size) - 1.5px)/1 var(--_k-font)}
|
|
11514
11558
|
|
|
11515
11559
|
.knobs-layers>.knobs-palette{left:50%;top:max(48px,15vh);translate:-50% 0;transform-origin:50% 0;display:flex;flex-direction:column;
|
|
11516
11560
|
width:min(580px,calc(100vw - 32px));max-height:min(460px,72vh);overflow:hidden}
|
|
11517
|
-
.knobs-palette .knobs-palette-field{display:flex;align-items:center;gap:10px;flex:none;height:46px;padding:0 16px;border-bottom:1px solid var(--
|
|
11561
|
+
.knobs-palette .knobs-palette-field{display:flex;align-items:center;gap:10px;flex:none;height:46px;padding:0 16px;border-bottom:1px solid var(--_k-border);color:var(--_k-fg-3)}
|
|
11518
11562
|
.knobs-palette .knobs-palette-field svg{width:15px;height:15px;flex:none}
|
|
11519
|
-
.knobs-palette .knobs-palette-input{flex:1;min-width:0;height:100%;font-size:calc(var(--
|
|
11520
|
-
.knobs-palette .knobs-palette-input::placeholder{color:var(--
|
|
11563
|
+
.knobs-palette .knobs-palette-input{flex:1;min-width:0;height:100%;font-size:calc(var(--_k-font-size) + 3px);color:var(--_k-fg);caret-color:var(--_k-accent)}
|
|
11564
|
+
.knobs-palette .knobs-palette-input::placeholder{color:var(--_k-fg-3)}
|
|
11521
11565
|
.knobs-palette .knobs-palette-list{position:relative;flex:1;min-height:0;overflow:auto;padding:6px;scrollbar-width:thin;overscroll-behavior:contain}
|
|
11522
|
-
.knobs-palette .knobs-palette-hl{position:absolute;left:6px;right:6px;top:0;border-radius:max(0px,calc(var(--
|
|
11523
|
-
transition:transform var(--
|
|
11524
|
-
.knobs-palette .knobs-palette-section{padding:10px 10px 4px;color:var(--
|
|
11566
|
+
.knobs-palette .knobs-palette-hl{position:absolute;left:6px;right:6px;top:0;border-radius:max(0px,calc(var(--_k-radius-panel) - 6px));background:var(--_ku-wash-hi);opacity:0;pointer-events:none;
|
|
11567
|
+
transition:transform var(--_ku-ease-ms) var(--_ku-ease),height var(--_ku-ease-ms) var(--_ku-ease),opacity .12s}
|
|
11568
|
+
.knobs-palette .knobs-palette-section{padding:10px 10px 4px;color:var(--_k-fg-3);font-size:calc(var(--_k-font-size) - 1px);font-weight:var(--_k-weight-label);user-select:none}
|
|
11525
11569
|
.knobs-palette .knobs-palette-section:first-of-type{padding-top:4px}
|
|
11526
|
-
.knobs-palette .knobs-palette-item{position:relative;display:flex;align-items:center;gap:8px;height:max(32px,var(--
|
|
11527
|
-
color:var(--
|
|
11528
|
-
.knobs-palette .knobs-palette-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--
|
|
11570
|
+
.knobs-palette .knobs-palette-item{position:relative;display:flex;align-items:center;gap:8px;height:max(32px,var(--_k-row));padding:0 10px;
|
|
11571
|
+
color:var(--_k-fg-2);cursor:default;user-select:none}
|
|
11572
|
+
.knobs-palette .knobs-palette-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--_k-fg)}
|
|
11529
11573
|
/* Searching, the label dims and its matched letters light up. */
|
|
11530
|
-
.knobs-palette[data-query] .knobs-palette-label{color:var(--
|
|
11531
|
-
.knobs-palette .knobs-palette-label mark{color:var(--
|
|
11532
|
-
.knobs-palette[data-query] .knobs-palette-item[data-active] .knobs-palette-label{color:var(--
|
|
11533
|
-
.knobs-palette .knobs-palette-hint{flex:none;color:var(--
|
|
11574
|
+
.knobs-palette[data-query] .knobs-palette-label{color:var(--_k-fg-2)}
|
|
11575
|
+
.knobs-palette .knobs-palette-label mark{color:var(--_k-accent);font-weight:var(--_k-weight-title)}
|
|
11576
|
+
.knobs-palette[data-query] .knobs-palette-item[data-active] .knobs-palette-label{color:var(--_k-fg)}
|
|
11577
|
+
.knobs-palette .knobs-palette-hint{flex:none;color:var(--_k-fg-3)}
|
|
11534
11578
|
.knobs-palette .knobs-palette-fill{flex:1}
|
|
11535
|
-
.knobs-palette .knobs-palette-tag{flex:none;color:var(--
|
|
11579
|
+
.knobs-palette .knobs-palette-tag{flex:none;color:var(--_k-fg-3);font-size:calc(var(--_k-font-size) - 1px);white-space:nowrap}
|
|
11536
11580
|
.knobs-palette .knobs-palette-item[aria-disabled="true"]{opacity:.4}
|
|
11537
|
-
.knobs-palette .knobs-palette-empty{padding:18px 10px;color:var(--
|
|
11581
|
+
.knobs-palette .knobs-palette-empty{padding:18px 10px;color:var(--_k-fg-3);text-align:center}
|
|
11538
11582
|
|
|
11539
|
-
.knobs-layers>.knobs-scrim{inset:0;width:100%;height:100%;background:
|
|
11583
|
+
.knobs-layers>.knobs-scrim{inset:0;width:100%;height:100%;background:var(--_k-scrim)}
|
|
11540
11584
|
.knobs-layers>.knobs-confirm{left:50%;top:42%;translate:-50% -50%;width:min(340px,calc(100vw - 32px));padding:18px 18px 14px}
|
|
11541
|
-
.knobs-confirm .knobs-confirm-title{margin:0 0 6px;font-size:calc(var(--
|
|
11542
|
-
.knobs-confirm .knobs-confirm-body{margin:0;color:var(--
|
|
11585
|
+
.knobs-confirm .knobs-confirm-title{margin:0 0 6px;font-size:calc(var(--_k-font-size) + 1.5px);font-weight:var(--_k-weight-title);color:var(--_k-fg);line-height:1.3}
|
|
11586
|
+
.knobs-confirm .knobs-confirm-body{margin:0;color:var(--_k-fg-2);line-height:1.45}
|
|
11543
11587
|
.knobs-confirm .knobs-confirm-buttons{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
|
|
11544
|
-
.knobs-confirm .knobs-confirm-btn{height:28px;padding:0 14px;border-radius:min(var(--
|
|
11545
|
-
font-weight:var(--
|
|
11546
|
-
.knobs-confirm .knobs-confirm-cancel:is(:hover,:focus-visible){background:color-mix(in srgb,var(--
|
|
11547
|
-
.knobs-confirm .knobs-confirm-ok{background:var(--
|
|
11548
|
-
.knobs-confirm .knobs-confirm-ok[data-destructive]{background:var(--
|
|
11588
|
+
.knobs-confirm .knobs-confirm-btn{height:28px;padding:0 14px;border-radius:min(var(--_k-radius),7px);background:var(--_k-fill-selected);color:var(--_k-fg);
|
|
11589
|
+
font-weight:var(--_k-weight-label);cursor:pointer;transition:background .15s,filter .15s}
|
|
11590
|
+
.knobs-confirm .knobs-confirm-cancel:is(:hover,:focus-visible){background:color-mix(in srgb,var(--_k-fg) 18%,transparent)}
|
|
11591
|
+
.knobs-confirm .knobs-confirm-ok{background:var(--_k-accent);color:var(--_k-bg)}
|
|
11592
|
+
.knobs-confirm .knobs-confirm-ok[data-destructive]{background:var(--_k-danger);color:#fff}
|
|
11549
11593
|
.knobs-confirm .knobs-confirm-ok:is(:hover,:focus-visible){filter:brightness(1.14)}
|
|
11550
11594
|
|
|
11551
11595
|
.knobs-ui.knobs-toast{left:50%;top:auto;bottom:24px;z-index:2147480005;translate:-50% 0;display:inline-flex;align-items:center;gap:10px;
|
|
11552
|
-
max-width:min(480px,80vw);padding:8px 16px;background:var(--
|
|
11553
|
-
box-shadow:0 0 0 .5px var(--
|
|
11596
|
+
max-width:min(480px,80vw);padding:8px 16px;background:var(--_k-bg);color:var(--_k-fg);border-radius:calc(var(--_k-radius) * 999);
|
|
11597
|
+
box-shadow:0 0 0 .5px var(--_k-border-strong),0 8px 28px rgba(0,0,0,calc(.32 * var(--_k-shadow-k,1)))}
|
|
11554
11598
|
.knobs-toast .knobs-toast-text{overflow-wrap:anywhere}
|
|
11555
|
-
.knobs-toast[data-tone="warn"]::before,.knobs-toast[data-tone="error"]::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:var(--
|
|
11556
|
-
.knobs-toast[data-tone="error"]::before{background:var(--
|
|
11557
|
-
.knobs-toast .knobs-toast-action{flex:none;color:var(--
|
|
11599
|
+
.knobs-toast[data-tone="warn"]::before,.knobs-toast[data-tone="error"]::before{content:"";flex:none;width:7px;height:7px;border-radius:50%;background:var(--_k-warn)}
|
|
11600
|
+
.knobs-toast[data-tone="error"]::before{background:var(--_k-danger)}
|
|
11601
|
+
.knobs-toast .knobs-toast-action{flex:none;color:var(--_k-accent);font-weight:var(--_k-weight-title);cursor:pointer}
|
|
11558
11602
|
.knobs-toast .knobs-toast-action[hidden]{display:none}
|
|
11559
11603
|
`;
|
|
11560
11604
|
|
|
11561
11605
|
// src/ui/picker-css.ts
|
|
11562
|
-
var snappy =
|
|
11606
|
+
var snappy = springLinear(SPRINGS2.snappy), pickerCss = `
|
|
11563
11607
|
:where(.knobs-picker,.knobs-picker-option,.knobs-picker-head,.knobs-picker-head *,.knobs-picker-card,.knobs-picker-body){box-sizing:border-box}
|
|
11564
11608
|
.knobs-ui.knobs-picker{position:relative;display:flex;flex-direction:column;gap:2px;padding:0;outline:none;
|
|
11565
|
-
font:var(--
|
|
11566
|
-
--kp-card:var(--
|
|
11609
|
+
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);text-align:left;letter-spacing:normal;-webkit-font-smoothing:antialiased;
|
|
11610
|
+
--kp-card:var(--_k-picker-card);--kp-radius:var(--k-picker-radius,var(--_k-radius-panel));--kp-snappy:${snappy.easing};--kp-snappy-ms:${snappy.ms}ms}
|
|
11567
11611
|
.knobs-picker [hidden]{display:none!important}
|
|
11568
11612
|
/* The selection: one card behind the selected option and its parameters, gliding between them. */
|
|
11569
|
-
.knobs-picker-card{position:absolute;left:0;right:0;top:0;height:0;border-radius:var(--kp-radius);background:var(--kp-card);box-shadow:inset 0 0 0 1px var(--
|
|
11613
|
+
.knobs-picker-card{position:absolute;left:0;right:0;top:0;height:0;border-radius:var(--kp-radius);background:var(--kp-card);box-shadow:inset 0 0 0 1px var(--_k-border);pointer-events:none}
|
|
11570
11614
|
.knobs-picker[data-frame="flat"] .knobs-picker-card{box-shadow:none}
|
|
11571
11615
|
.knobs-picker-option{position:relative;flex:none}
|
|
11572
|
-
:where(.knobs-ui) .knobs-picker-head{all:revert;box-sizing:border-box;position:relative;display:flex;align-items:center;gap:8px;width:100%;height:var(--
|
|
11573
|
-
border:0;margin:0;background:transparent;color:var(--
|
|
11616
|
+
:where(.knobs-ui) .knobs-picker-head{all:revert;box-sizing:border-box;position:relative;display:flex;align-items:center;gap:8px;width:100%;height:var(--_k-row);padding:0 calc(var(--_k-inset) - 2px) 0 calc(var(--_k-inset) - 4px);
|
|
11617
|
+
border:0;margin:0;background:transparent;color:var(--_k-fg-2);font:inherit;letter-spacing:inherit;text-align:left;cursor:default;outline:none;user-select:none;-webkit-user-select:none}
|
|
11574
11618
|
/* Hover: in at once, out over 100 ms. Keyboard focus: the same wash, a little firmer. */
|
|
11575
|
-
.knobs-picker-head::before{content:"";position:absolute;inset:0;border-radius:var(--kp-radius);background:var(--
|
|
11576
|
-
.knobs-picker-option:not([data-selected]) .knobs-picker-head:hover::before{opacity:1;transition-duration:calc(var(--
|
|
11577
|
-
.knobs-picker-head:focus-visible::before{opacity:1;background:var(--
|
|
11619
|
+
.knobs-picker-head::before{content:"";position:absolute;inset:0;border-radius:var(--kp-radius);background:var(--_ku-wash);opacity:0;transition:opacity calc(var(--_k-hover-out,100) * 1ms) ease-out;pointer-events:none}
|
|
11620
|
+
.knobs-picker-option:not([data-selected]) .knobs-picker-head:hover::before{opacity:1;transition-duration:calc(var(--_k-hover-in,0) * 1ms)}
|
|
11621
|
+
.knobs-picker-head:focus-visible::before{opacity:1;background:var(--_ku-wash-hi);transition-duration:0s}
|
|
11578
11622
|
.knobs-picker-head>*{position:relative}
|
|
11579
|
-
.knobs-picker-option[data-selected] .knobs-picker-head{color:var(--
|
|
11623
|
+
.knobs-picker-option[data-selected] .knobs-picker-head{color:var(--_k-fg)}
|
|
11580
11624
|
/* Every row is numbered (only 1–9 are keys): tabular digits in a column two digits wide, so the
|
|
11581
11625
|
names line up past the ninth. */
|
|
11582
|
-
.knobs-picker-key{flex:none;display:inline-flex;align-items:center;justify-content:center;width:max(17px,calc(2ch + 6px));height:17px;padding:0;border-radius:5px;background:var(--
|
|
11583
|
-
color:var(--
|
|
11626
|
+
.knobs-picker-key{flex:none;display:inline-flex;align-items:center;justify-content:center;width:max(17px,calc(2ch + 6px));height:17px;padding:0;border-radius:5px;background:var(--_k-fill);
|
|
11627
|
+
color:var(--_k-fg-3);font:var(--_k-weight-label) calc(var(--_k-font-size) - 1.5px)/1 var(--_k-font);font-variant-numeric:tabular-nums;transition:background .15s,color .15s}
|
|
11584
11628
|
.knobs-picker-key:empty{visibility:hidden}
|
|
11585
11629
|
/* An option's picture: cover-fit, the rows' corner language and a hairline drawn over it. Its
|
|
11586
11630
|
space is kept while it loads (nothing drawn), it fades in once loaded, and one that fails
|
|
11587
11631
|
gives its space back on the same ease. */
|
|
11588
|
-
.knobs-picker-thumb{flex:none;display:block;width:var(--k-picker-thumb,min(24px,calc(var(--
|
|
11589
|
-
object-fit:cover;background:none;outline:1px solid var(--
|
|
11632
|
+
.knobs-picker-thumb{flex:none;display:block;width:var(--k-picker-thumb,min(24px,calc(var(--_k-row) - 10px)));aspect-ratio:1;margin:0;border-radius:max(3px,calc(var(--_k-radius) - 2px));
|
|
11633
|
+
object-fit:cover;background:none;outline:1px solid var(--_k-border);outline-offset:-1px;opacity:0;
|
|
11590
11634
|
transition:opacity .2s ease-out,width .18s ease-out,margin .18s ease-out}
|
|
11591
11635
|
.knobs-picker-thumb[data-state="loaded"]{opacity:1}
|
|
11592
11636
|
.knobs-picker-thumb[data-instant]{transition:none}
|
|
11593
11637
|
.knobs-picker-thumb[data-state="failed"]{width:0;margin-right:-8px;outline-color:transparent}
|
|
11594
|
-
.knobs-picker-option[data-selected] .knobs-picker-key{background:var(--
|
|
11595
|
-
.knobs-picker-name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;font-weight:var(--
|
|
11596
|
-
.knobs-picker-suggested{flex:none;color:var(--
|
|
11597
|
-
.knobs-picker-check{flex:none;display:flex;width:14px;height:14px;color:var(--
|
|
11638
|
+
.knobs-picker-option[data-selected] .knobs-picker-key{background:var(--_k-fill-selected);color:var(--_k-fg)}
|
|
11639
|
+
.knobs-picker-name{flex:1;min-width:0;overflow:hidden;white-space:nowrap;font-weight:var(--_k-weight-label)}
|
|
11640
|
+
.knobs-picker-suggested{flex:none;color:var(--_k-fg-3);font-size:var(--_k-text-meta)}
|
|
11641
|
+
.knobs-picker-check{flex:none;display:flex;width:14px;height:14px;color:var(--_k-accent);opacity:0;scale:.6;filter:blur(2px);
|
|
11598
11642
|
transition:opacity .11s ease-in,scale .11s ease-in,filter .11s ease-in}
|
|
11599
11643
|
.knobs-picker-check svg{display:block;width:14px;height:14px}
|
|
11600
11644
|
.knobs-picker-option[data-chosen] .knobs-picker-check{opacity:1;scale:1;filter:none;transition:opacity .15s ease-out,scale var(--kp-snappy-ms) var(--kp-snappy),filter .15s ease-out}
|
|
@@ -11606,7 +11650,7 @@ var snappy = springEasing(2 * Math.PI / 0.25, 1), pickerCss = `
|
|
|
11606
11650
|
.knobs-picker-inner{padding:var(--k-picker-pad,0 8px 8px)}
|
|
11607
11651
|
.knobs-picker-inner:empty{padding:0}
|
|
11608
11652
|
.knobs-picker-inner .knobs-panel.knobs-inline{--k-chrome:0;padding:0}
|
|
11609
|
-
.knobs-picker-empty{padding:8px var(--
|
|
11653
|
+
.knobs-picker-empty{padding:8px var(--_k-inset);color:var(--_k-fg-3)}
|
|
11610
11654
|
@media(prefers-reduced-motion:reduce){.knobs-picker :where(*,::before,::after){transition-duration:.15s!important;scale:none!important;filter:none!important}}
|
|
11611
11655
|
`;
|
|
11612
11656
|
|
|
@@ -11616,25 +11660,25 @@ var readoutCss = `
|
|
|
11616
11660
|
:where(.knobs-ui) :is(.knobs-rd-chip,.knobs-rd-copy,.knobs-rd-jump,.knobs-rd-find,.knobs-rd-match){all:revert;box-sizing:border-box;
|
|
11617
11661
|
font:inherit;color:inherit;letter-spacing:inherit;background:transparent;border:0;border-radius:0;margin:0;padding:0;min-width:0;box-shadow:none;outline:none}
|
|
11618
11662
|
.knobs-ui.knobs-rd,.knobs-rd *{box-sizing:border-box}
|
|
11619
|
-
.knobs-ui.knobs-rd{display:flex;align-items:center;gap:8px;min-width:0;color:var(--
|
|
11620
|
-
.knobs-rd .knobs-rd-v{font:var(--
|
|
11621
|
-
.knobs-rd .knobs-rd-mono{font:400 var(--
|
|
11622
|
-
.knobs-rd .knobs-rd-meta{font:var(--
|
|
11663
|
+
.knobs-ui.knobs-rd{display:flex;align-items:center;gap:8px;min-width:0;color:var(--_k-fg);letter-spacing:normal}
|
|
11664
|
+
.knobs-rd .knobs-rd-v{font:var(--_k-weight) var(--_k-value-size)/1.25 var(--_k-value-font);font-variant-numeric:tabular-nums;font-feature-settings:"tnum";white-space:nowrap}
|
|
11665
|
+
.knobs-rd .knobs-rd-mono{font:400 var(--_k-text-meta)/1.25 var(--_k-mono);font-variant-numeric:tabular-nums;white-space:pre}
|
|
11666
|
+
.knobs-rd .knobs-rd-meta{font:var(--_k-weight) var(--_k-text-meta)/1.25 var(--_k-font);white-space:nowrap}
|
|
11623
11667
|
.knobs-rd .knobs-rd-value{display:inline-flex;justify-content:flex-end;align-items:baseline;flex:none;margin-left:auto;contain:layout paint style}
|
|
11624
|
-
.knobs-rd .knobs-rd-num{color:var(--
|
|
11625
|
-
.knobs-rd .knobs-rd-unit{margin-left:var(--k-unit-gap,.28em);color:var(--
|
|
11668
|
+
.knobs-rd .knobs-rd-num{color:var(--_k-fg);text-align:right;transition:color .15s}
|
|
11669
|
+
.knobs-rd .knobs-rd-unit{margin-left:var(--k-unit-gap,.28em);color:var(--_k-fg-3)}
|
|
11626
11670
|
.knobs-rd .knobs-rd-unit[hidden]{display:none}
|
|
11627
11671
|
.knobs-rd.knobs-rd-watch{flex:1 1 auto;justify-content:flex-end}
|
|
11628
11672
|
.knobs-rd.knobs-rd-spark,.knobs-rd.knobs-rd-meter{flex:0 1 64%;margin-left:auto}
|
|
11629
|
-
.knobs-rd .knobs-rd-plot{display:block;flex:1 1 0;min-width:24px;height:max(12px,calc(var(--
|
|
11673
|
+
.knobs-rd .knobs-rd-plot{display:block;flex:1 1 0;min-width:24px;height:max(12px,calc(var(--_k-control-h) - 2px))}
|
|
11630
11674
|
.knobs-rd.knobs-rd-meter>.knobs-rd-plot{height:8px}
|
|
11631
|
-
.knobs-rd.knobs-rd-spark[data-hover] .knobs-rd-num{color:var(--
|
|
11632
|
-
.knobs-rd .knobs-rd-cap,.knobs-rd .knobs-rd-head>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--
|
|
11675
|
+
.knobs-rd.knobs-rd-spark[data-hover] .knobs-rd-num{color:var(--_k-fg-2)}
|
|
11676
|
+
.knobs-rd .knobs-rd-cap,.knobs-rd .knobs-rd-head>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--_k-fg-2);font-weight:var(--_k-weight-label)}
|
|
11633
11677
|
|
|
11634
11678
|
/* Blocks: a head line (the label and what goes with it) over a body. In a panel the row grows to fit. */
|
|
11635
11679
|
.knobs-panel .knobs-row.knobs-rd-rowblock{display:block;height:auto}
|
|
11636
11680
|
.knobs-rd.knobs-rd-block{display:flex;flex-direction:column;align-items:stretch;gap:2px;width:100%}
|
|
11637
|
-
.knobs-rd .knobs-rd-head{display:flex;align-items:center;gap:0 10px;min-height:var(--
|
|
11681
|
+
.knobs-rd .knobs-rd-head{display:flex;align-items:center;gap:0 10px;min-height:var(--_k-row);min-width:0}
|
|
11638
11682
|
/* The title keeps its words; the legend or tools beside it give way (see fitHead). */
|
|
11639
11683
|
.knobs-rd .knobs-rd-head>span:first-child{flex:0 0 auto;max-width:100%}
|
|
11640
11684
|
.knobs-rd .knobs-rd-legend{display:flex;align-items:center;gap:12px;margin-left:auto;min-width:0;overflow:hidden}
|
|
@@ -11642,16 +11686,16 @@ var readoutCss = `
|
|
|
11642
11686
|
.knobs-rd .knobs-rd-tools>.knobs-rd-find{flex:1 1 56px;min-width:56px;max-width:84px}
|
|
11643
11687
|
.knobs-rd .knobs-rd-head[data-short] .knobs-rd-legend .knobs-rd-unit{display:none}
|
|
11644
11688
|
.knobs-rd .knobs-rd-head[data-wrap]{flex-wrap:wrap;padding-bottom:4px}
|
|
11645
|
-
.knobs-rd .knobs-rd-head[data-wrap]>span:first-child{display:flex;align-items:center;min-height:var(--
|
|
11689
|
+
.knobs-rd .knobs-rd-head[data-wrap]>span:first-child{display:flex;align-items:center;min-height:var(--_k-row)}
|
|
11646
11690
|
.knobs-rd .knobs-rd-head[data-wrap]>:is(.knobs-rd-legend,.knobs-rd-tools){flex:1 0 100%;margin-left:0}
|
|
11647
11691
|
.knobs-rd .knobs-rd-head[data-wrap]>.knobs-rd-tools{flex-wrap:wrap;row-gap:4px}
|
|
11648
11692
|
.knobs-rd .knobs-rd-key{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
|
|
11649
11693
|
.knobs-rd .knobs-rd-swatch{flex:none;width:8px;height:2px;border-radius:1px}
|
|
11650
|
-
.knobs-rd .knobs-rd-name{color:var(--
|
|
11694
|
+
.knobs-rd .knobs-rd-name{color:var(--_k-fg-2)}
|
|
11651
11695
|
.knobs-rd .knobs-rd-key>.knobs-rd-value{margin-left:2px}
|
|
11652
11696
|
.knobs-rd .knobs-rd-plotbox{position:relative;outline:none;margin-bottom:6px}
|
|
11653
11697
|
.knobs-rd .knobs-rd-plotbox>.knobs-rd-plot{position:absolute;inset:0;width:100%;height:100%;min-width:0}
|
|
11654
|
-
.knobs-rd .knobs-rd-tick,.knobs-rd .knobs-rd-mark{position:absolute;color:var(--
|
|
11698
|
+
.knobs-rd .knobs-rd-tick,.knobs-rd .knobs-rd-mark{position:absolute;color:var(--_k-fg-3);pointer-events:none;line-height:14px;height:14px}
|
|
11655
11699
|
.knobs-rd .knobs-rd-tick{left:0}
|
|
11656
11700
|
.knobs-rd .knobs-rd-tick[data-at="top"]{top:-2px}
|
|
11657
11701
|
.knobs-rd .knobs-rd-tick[data-at="bottom"]{bottom:0}
|
|
@@ -11660,36 +11704,36 @@ var readoutCss = `
|
|
|
11660
11704
|
|
|
11661
11705
|
.knobs-rd .knobs-rd-grid{display:grid;column-gap:14px;align-items:center;outline:none;margin-bottom:4px}
|
|
11662
11706
|
.knobs-rd .knobs-rd-tr{display:contents}
|
|
11663
|
-
.knobs-rd .knobs-rd-tr>*{height:calc(var(--
|
|
11664
|
-
.knobs-rd .knobs-rd-thead>*{height:var(--
|
|
11665
|
-
.knobs-rd .knobs-rd-th{color:var(--
|
|
11666
|
-
.knobs-rd .knobs-rd-td{color:var(--
|
|
11667
|
-
.knobs-rd .knobs-rd-td:first-child{color:var(--
|
|
11707
|
+
.knobs-rd .knobs-rd-tr>*{height:calc(var(--_k-row) * .72);line-height:calc(var(--_k-row) * .72);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
11708
|
+
.knobs-rd .knobs-rd-thead>*{height:var(--_k-row);line-height:var(--_k-row)}
|
|
11709
|
+
.knobs-rd .knobs-rd-th{color:var(--_k-fg-3);text-align:right}
|
|
11710
|
+
.knobs-rd .knobs-rd-td{color:var(--_k-fg)}
|
|
11711
|
+
.knobs-rd .knobs-rd-td:first-child{color:var(--_k-fg-2)}
|
|
11668
11712
|
.knobs-rd .knobs-rd-td[data-num]{text-align:right}
|
|
11669
11713
|
|
|
11670
11714
|
.knobs-rd.knobs-rd-log{--rd-lh:18px}
|
|
11671
11715
|
.knobs-rd .knobs-rd-chips{display:inline-flex;align-items:center;gap:2px;margin-right:auto}
|
|
11672
|
-
.knobs-ui .knobs-rd-chip,.knobs-ui .knobs-rd-copy{height:calc(var(--
|
|
11673
|
-
.knobs-ui .knobs-rd-chip:hover,.knobs-ui .knobs-rd-copy:hover{background:var(--
|
|
11674
|
-
.knobs-ui .knobs-rd-chip[aria-checked="true"]{background:var(--
|
|
11675
|
-
.knobs-ui .knobs-rd-find{width:84px;height:calc(var(--
|
|
11676
|
-
background:color-mix(in srgb,var(--
|
|
11677
|
-
.knobs-rd .knobs-rd-find::placeholder{color:var(--
|
|
11716
|
+
.knobs-ui .knobs-rd-chip,.knobs-ui .knobs-rd-copy{height:calc(var(--_k-control-h) - 2px);padding:0 7px;border-radius:min(var(--_k-radius),5px);color:var(--_k-fg-2);cursor:pointer;transition:background .15s,color .15s}
|
|
11717
|
+
.knobs-ui .knobs-rd-chip:hover,.knobs-ui .knobs-rd-copy:hover{background:var(--_ku-wash);color:var(--_k-fg)}
|
|
11718
|
+
.knobs-ui .knobs-rd-chip[aria-checked="true"]{background:var(--_ku-wash-hi);color:var(--_k-fg)}
|
|
11719
|
+
.knobs-ui .knobs-rd-find{width:84px;height:calc(var(--_k-control-h) - 2px);padding:0 7px;border-radius:min(var(--_k-radius),5px);
|
|
11720
|
+
background:color-mix(in srgb,var(--_k-fill-selected) 60%,transparent);color:var(--_k-fg);caret-color:var(--_k-accent)}
|
|
11721
|
+
.knobs-rd .knobs-rd-find::placeholder{color:var(--_k-fg-3)}
|
|
11678
11722
|
.knobs-rd .knobs-rd-find::-webkit-search-cancel-button{display:none}
|
|
11679
11723
|
.knobs-rd .knobs-rd-logbody{position:relative;margin-bottom:6px}
|
|
11680
11724
|
.knobs-rd .knobs-rd-scroll{position:relative;overflow-x:hidden;overflow-y:auto;height:calc(var(--knobs-rd-lines,8) * var(--rd-lh));outline:none;
|
|
11681
|
-
background:color-mix(in srgb,var(--
|
|
11725
|
+
background:color-mix(in srgb,var(--_k-fill-selected) 45%,transparent);border-radius:min(var(--_k-radius),6px);scrollbar-width:thin;overscroll-behavior:contain}
|
|
11682
11726
|
.knobs-rd .knobs-rd-space{position:relative;width:100%}
|
|
11683
11727
|
.knobs-rd .knobs-rd-line{position:absolute;left:0;right:0;top:0;display:flex;gap:10px;height:var(--rd-lh);line-height:var(--rd-lh);padding:0 8px;contain:layout style;will-change:transform}
|
|
11684
11728
|
.knobs-rd .knobs-rd-line[hidden]{display:none}
|
|
11685
|
-
.knobs-rd .knobs-rd-time{flex:none;color:var(--
|
|
11686
|
-
.knobs-rd .knobs-rd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--
|
|
11687
|
-
.knobs-rd .knobs-rd-line[data-level="warn"]>.knobs-rd-text{color:var(--
|
|
11688
|
-
.knobs-rd .knobs-rd-line[data-level="error"]>.knobs-rd-text{color:var(--
|
|
11689
|
-
.knobs-rd .knobs-rd-line[data-level="debug"]>.knobs-rd-text{color:var(--
|
|
11690
|
-
.knobs-ui .knobs-rd-match{color:var(--
|
|
11691
|
-
.knobs-ui .knobs-rd-jump{position:absolute;left:50%;bottom:6px;height:20px;padding:0 10px;border-radius:calc(var(--
|
|
11692
|
-
background:var(--
|
|
11729
|
+
.knobs-rd .knobs-rd-time{flex:none;color:var(--_k-fg-3)}
|
|
11730
|
+
.knobs-rd .knobs-rd-text{min-width:0;overflow:hidden;text-overflow:ellipsis;color:var(--_k-fg)}
|
|
11731
|
+
.knobs-rd .knobs-rd-line[data-level="warn"]>.knobs-rd-text{color:var(--_k-warn)}
|
|
11732
|
+
.knobs-rd .knobs-rd-line[data-level="error"]>.knobs-rd-text{color:var(--_k-danger)}
|
|
11733
|
+
.knobs-rd .knobs-rd-line[data-level="debug"]>.knobs-rd-text{color:var(--_k-fg-3)}
|
|
11734
|
+
.knobs-ui .knobs-rd-match{color:var(--_k-accent)}
|
|
11735
|
+
.knobs-ui .knobs-rd-jump{position:absolute;left:50%;bottom:6px;height:20px;padding:0 10px;border-radius:calc(var(--_k-radius) * 999);
|
|
11736
|
+
background:var(--_k-accent);color:var(--_k-bg);opacity:0;transform:translate(-50%,6px);cursor:pointer;white-space:nowrap}
|
|
11693
11737
|
|
|
11694
11738
|
/* Under the GPU overlay the readouts' DOM stays for focus, hit-testing and screen readers; the
|
|
11695
11739
|
overlay draws them. Their filter field sits above it. */
|
|
@@ -11698,97 +11742,45 @@ var readoutCss = `
|
|
|
11698
11742
|
.knobs-panel[data-gpu-active="true"] .knobs-rd-find{position:relative;z-index:2147480003}
|
|
11699
11743
|
@media(prefers-reduced-motion:reduce){.knobs-rd :where(*){transition:none!important}}
|
|
11700
11744
|
`;
|
|
11701
|
-
|
|
11702
11745
|
// src/ui/look.ts
|
|
11703
|
-
var
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
font: 'system-ui,-apple-system,"SF Pro Text",sans-serif',
|
|
11714
|
-
mono: '"SF Mono",SFMono-Regular,ui-monospace,Menlo,monospace',
|
|
11715
|
-
"font-size": "12px",
|
|
11716
|
-
"font-weight": "400",
|
|
11717
|
-
"label-weight": "500",
|
|
11718
|
-
"title-weight": "600",
|
|
11719
|
-
row: "32px",
|
|
11720
|
-
inset: "10px",
|
|
11721
|
-
radius: "8px",
|
|
11722
|
-
"hover-in": "150",
|
|
11723
|
-
"hover-out": "150",
|
|
11724
|
-
warn: "#ff9f0a",
|
|
11725
|
-
critical: "#ff453a",
|
|
11726
|
-
rim: "rgba(255,255,255,.09)",
|
|
11727
|
-
page: "#101012",
|
|
11728
|
-
"seg-bg": "rgba(0,0,0,.26)",
|
|
11729
|
-
shadow: "0 12px 36px rgba(0,0,0,.52),0 1px 2px rgba(0,0,0,.3)"
|
|
11730
|
-
}, LIGHT = {
|
|
11731
|
-
bg: "#f5f5f7",
|
|
11732
|
-
surface: "rgba(0,0,0,.05)",
|
|
11733
|
-
"surface-hi": "rgba(0,0,0,.095)",
|
|
11734
|
-
line: "rgba(0,0,0,.1)",
|
|
11735
|
-
"line-hi": "rgba(0,0,0,.2)",
|
|
11736
|
-
text: "rgba(0,0,0,.88)",
|
|
11737
|
-
label: "rgba(60,60,67,.68)",
|
|
11738
|
-
dim: "rgba(60,60,67,.5)",
|
|
11739
|
-
accent: "#1c1c1e",
|
|
11740
|
-
warn: "#c56a00",
|
|
11741
|
-
critical: "#e0352b",
|
|
11742
|
-
rim: "rgba(255,255,255,.75)",
|
|
11743
|
-
page: "#e6e6eb",
|
|
11744
|
-
"seg-bg": "rgba(0,0,0,.065)",
|
|
11745
|
-
shadow: "0 10px 32px rgba(0,0,0,.14),0 1px 3px rgba(0,0,0,.08)"
|
|
11746
|
-
}, lightBlock = `${Object.entries(LIGHT).map(([k, v]) => `--k-${k}:${v}`).join(";")};color-scheme:light`, css = `
|
|
11747
|
-
:where(.knobs-ui){${Object.entries(TOKENS2).map(([k, v]) => `--ku-${k}:var(--k-${k},${v})`).join(";")};
|
|
11748
|
-
--ku-control-h:var(--k-control-h,calc(var(--ku-row) - 8px));
|
|
11749
|
-
--ku-value-font:var(--k-value-font,var(--ku-font));
|
|
11750
|
-
--ku-value-size:var(--kc-value-size,calc(var(--ku-font-size) - .5px));
|
|
11751
|
-
--ku-text-meta:var(--k-text-meta,calc(var(--ku-font-size) - 1px));
|
|
11752
|
-
--ku-hit:var(--k-ui-hit,9px);
|
|
11753
|
-
--ku-rail:var(--k-ui-rail,var(--ku-row));
|
|
11754
|
-
--ku-indent:var(--k-ui-indent,14px);
|
|
11755
|
-
--ku-select:var(--k-ui-select,color-mix(in srgb,var(--ku-accent) 13%,transparent));
|
|
11756
|
-
--ku-select-focus:var(--k-ui-select-focus,color-mix(in srgb,var(--ku-accent) 19%,transparent));
|
|
11757
|
-
--ku-wash:var(--k-ui-wash,color-mix(in srgb,var(--ku-surface) 70%,transparent));
|
|
11758
|
-
--ku-wash-hi:var(--k-ui-wash-hi,var(--ku-surface-hi));
|
|
11759
|
-
--ku-ease:${ease.easing};--ku-ease-ms:${ease.ms}ms;
|
|
11746
|
+
var css = `
|
|
11747
|
+
:where(.knobs-ui){
|
|
11748
|
+
--_ku-hit:var(--k-ui-hit,9px);
|
|
11749
|
+
--_ku-rail:var(--k-ui-rail,var(--_k-row));
|
|
11750
|
+
--_ku-indent:var(--k-ui-indent,14px);
|
|
11751
|
+
--_ku-select:var(--k-ui-select,var(--k-selection,color-mix(in srgb,var(--_k-accent) 13%,transparent)));
|
|
11752
|
+
--_ku-select-focus:var(--k-ui-select-focus,color-mix(in srgb,var(--_k-accent) 19%,transparent));
|
|
11753
|
+
--_ku-wash:var(--k-ui-wash,color-mix(in srgb,var(--_k-fill) 70%,transparent));
|
|
11754
|
+
--_ku-wash-hi:var(--k-ui-wash-hi,var(--_k-fill-selected));
|
|
11755
|
+
--_ku-ease:var(--_k-motion-snappy);--_ku-ease-ms:calc(var(--_k-motion-snappy-ms) * 1ms);
|
|
11760
11756
|
/* The card frame (knobs' own look): every leaf pane a rounded card on the page, half a gap
|
|
11761
11757
|
inside its slot, so panes sit a gap apart with the dividers' grips between them; tree rows
|
|
11762
11758
|
inset as soft rounded washes. --k-frame: flat (labPreset) puts panes edge to edge on
|
|
11763
11759
|
hairlines, square, as a dense editor's columns. */
|
|
11764
|
-
--
|
|
11765
|
-
--
|
|
11766
|
-
--
|
|
11767
|
-
--
|
|
11768
|
-
--
|
|
11769
|
-
--
|
|
11770
|
-
--
|
|
11771
|
-
--
|
|
11772
|
-
--ku-row-radius:max(0px,calc(var(--ku-panel-radius) - var(--ku-row-x)));
|
|
11760
|
+
--_ku-gap:var(--k-ui-gap,6px);
|
|
11761
|
+
--_ku-pane-m:calc(var(--_ku-gap) / 2);
|
|
11762
|
+
--_ku-pane-bg:var(--_k-pane-bg);
|
|
11763
|
+
--_ku-pane-radius:var(--_k-radius-panel);
|
|
11764
|
+
--_ku-pane-ring:inset 0 0 0 1px var(--_k-border),inset 0 1px 0 var(--_k-rim);
|
|
11765
|
+
--_ku-divider:var(--k-ui-divider,var(--k-split-gutter,transparent));
|
|
11766
|
+
--_ku-row-x:var(--k-ui-row-x,6px);
|
|
11767
|
+
--_ku-row-radius:max(0px,calc(var(--_ku-pane-radius) - var(--_ku-row-x)));
|
|
11773
11768
|
}
|
|
11774
|
-
:where(.knobs-ui)[data-frame="flat"]{--
|
|
11775
|
-
--
|
|
11776
|
-
--
|
|
11769
|
+
:where(.knobs-ui)[data-frame="flat"]{--_ku-gap:var(--k-ui-gap,0px);--_ku-pane-bg:var(--k-ui-pane,var(--k-pane-bg,transparent));--_ku-pane-radius:0px;--_ku-pane-ring:none;
|
|
11770
|
+
--_ku-divider:var(--_k-split-gutter);--_ku-row-x:var(--k-ui-row-x,0px);--_ku-row-radius:0px;
|
|
11771
|
+
--_ku-select:var(--_k-selection);--_ku-select-focus:var(--k-ui-select-focus,color-mix(in srgb,var(--_k-accent) 34%,transparent))}
|
|
11777
11772
|
/* One surface per thing: a piece on another surface draws no card of its own. Whatever draws a
|
|
11778
11773
|
card (a walkthrough's step, a host's own) carries .knobs-surface, and a split's pane that's a
|
|
11779
11774
|
card (not only a slot for another split) counts as one; any piece inside it, or one
|
|
11780
11775
|
marked data-nested, loses its fill and ring and parts its own panes on hairlines as the flat
|
|
11781
11776
|
frame does, so cards never stack two or three borders deep. Pieces draw their card from
|
|
11782
|
-
--
|
|
11783
|
-
:where(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-ui:not(.knobs-surface),.knobs-ui[data-nested]{--
|
|
11784
|
-
--
|
|
11785
|
-
:where(.knobs-ui)[data-theme="light"],
|
|
11786
|
-
:where(:root[data-theme="light"]) :where(.knobs-ui)[data-theme="auto"]{${lightBlock}}
|
|
11787
|
-
@media(prefers-color-scheme:light){:where(:root:not([data-theme="dark"])) :where(.knobs-ui)[data-theme="auto"]{${lightBlock}}}
|
|
11777
|
+
--_ku-pane-bg and --_ku-pane-ring so this reaches them. */
|
|
11778
|
+
:where(.knobs-surface,.knobs-pane:not([data-nested])>.knobs-pane-clip) .knobs-ui:not(.knobs-surface),.knobs-ui[data-nested]{--_ku-gap:var(--k-ui-gap,0px);--_ku-pane-bg:transparent;--_ku-pane-ring:none;
|
|
11779
|
+
--_ku-divider:var(--_k-split-gutter);--_kd-bg:transparent}
|
|
11788
11780
|
/* Only the pieces' own elements take their type and resets: what you put in a pane is yours. */
|
|
11789
11781
|
.knobs-ui{box-sizing:border-box}
|
|
11790
11782
|
:where(.knobs-split>*,.knobs-pane-clip,.knobs-pane-inner,.knobs-pane-body,.knobs-pane-head,.knobs-pane-head *,.knobs-pane-rail,.knobs-pane-rail *,.knobs-tree,.knobs-tree *,.knobs-tree-ghost){box-sizing:border-box}
|
|
11791
|
-
:is(.knobs-tree,.knobs-pane-head,.knobs-pane-rail,.knobs-tree-ghost){font:var(--
|
|
11783
|
+
:is(.knobs-tree,.knobs-pane-head,.knobs-pane-rail,.knobs-tree-ghost){font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);text-align:left;
|
|
11792
11784
|
letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-shadow:none;font-style:normal;-webkit-font-smoothing:antialiased}
|
|
11793
11785
|
/* A host's element rules (button{padding}, header{margin}, mark{background}) stop at these, as
|
|
11794
11786
|
they do at panels; (0,1,0), so the pieces' own rules after it win. */
|
|
@@ -11826,17 +11818,17 @@ var ease = springEasing(26, 1), TOKENS2 = {
|
|
|
11826
11818
|
:is(.knobs-tree,.knobs-activity)::-webkit-scrollbar{display:none}
|
|
11827
11819
|
.knobs-scrollbar{position:sticky;top:0;z-index:3;height:0;pointer-events:none}
|
|
11828
11820
|
.knobs-scrollbar[hidden]{display:none}
|
|
11829
|
-
.knobs-scrollbar-thumb{position:absolute;top:0;right:2px;width:5px;border-radius:3px;background:color-mix(in srgb,var(--
|
|
11821
|
+
.knobs-scrollbar-thumb{position:absolute;top:0;right:2px;width:5px;border-radius:3px;background:color-mix(in srgb,var(--_k-fg) 30%,transparent);opacity:0;
|
|
11830
11822
|
transition:opacity .3s ease-out,background .15s}
|
|
11831
11823
|
:hover>.knobs-scrollbar>.knobs-scrollbar-thumb,.knobs-scrollbar:is([data-active],[data-dragging])>.knobs-scrollbar-thumb{opacity:1;pointer-events:auto;transition-duration:.12s,.15s}
|
|
11832
|
-
.knobs-scrollbar-thumb:hover,.knobs-scrollbar[data-dragging]>.knobs-scrollbar-thumb{background:color-mix(in srgb,var(--
|
|
11824
|
+
.knobs-scrollbar-thumb:hover,.knobs-scrollbar[data-dragging]>.knobs-scrollbar-thumb{background:color-mix(in srgb,var(--_k-fg) 48%,transparent)}
|
|
11833
11825
|
|
|
11834
11826
|
/* Split: panes along a row or column, hairline dividers with a wider grip. */
|
|
11835
11827
|
.knobs-split{position:relative;display:flex;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden}
|
|
11836
11828
|
.knobs-split[data-direction="column"]{flex-direction:column}
|
|
11837
11829
|
.knobs-pane{position:relative;flex:none;min-width:0;min-height:0;overflow:hidden}
|
|
11838
|
-
.knobs-pane-clip{position:absolute;inset:0;margin:var(--
|
|
11839
|
-
.knobs-pane-clip::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:var(--
|
|
11830
|
+
.knobs-pane-clip{position:absolute;inset:0;margin:var(--_ku-pane-m);overflow:hidden;border-radius:var(--_ku-pane-radius);background:var(--_ku-pane-bg)}
|
|
11831
|
+
.knobs-pane-clip::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:var(--_ku-pane-ring);pointer-events:none}
|
|
11840
11832
|
/* A pane holding another split is only its slot: the split's own panes are the cards. */
|
|
11841
11833
|
.knobs-pane[data-nested]>.knobs-pane-clip{margin:0;background:transparent}
|
|
11842
11834
|
.knobs-pane[data-nested]>.knobs-pane-clip::after{content:none}
|
|
@@ -11844,36 +11836,36 @@ var ease = springEasing(26, 1), TOKENS2 = {
|
|
|
11844
11836
|
.knobs-pane-body{position:relative;flex:1;min-width:0;min-height:0;overflow:hidden}
|
|
11845
11837
|
.knobs-pane[data-scroll] .knobs-pane-body{overflow:auto;scrollbar-width:thin}
|
|
11846
11838
|
.knobs-pane[data-rail][data-collapsed][data-settled]>.knobs-pane-clip>.knobs-pane-inner,.knobs-pane:not([data-rail])[data-collapsed][data-settled]>.knobs-pane-clip>.knobs-pane-inner>.knobs-pane-body{visibility:hidden}
|
|
11847
|
-
.knobs-ui .knobs-pane-head{display:flex;align-items:center;gap:6px;flex:none;height:var(--
|
|
11848
|
-
.knobs-pane-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--
|
|
11849
|
-
.knobs-pane-count{flex:none;color:var(--
|
|
11839
|
+
.knobs-ui .knobs-pane-head{display:flex;align-items:center;gap:6px;flex:none;height:var(--_k-row);padding:0 calc(var(--_k-inset) - 4px) 0 var(--_k-inset);user-select:none;-webkit-user-select:none}
|
|
11840
|
+
.knobs-pane-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:var(--_k-weight-title);color:var(--_k-fg)}
|
|
11841
|
+
.knobs-pane-count{flex:none;color:var(--_k-fg-3);font-variant-numeric:tabular-nums}
|
|
11850
11842
|
.knobs-pane-fill{flex:1}
|
|
11851
|
-
.knobs-ui .knobs-pane-btn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:calc(var(--
|
|
11843
|
+
.knobs-ui .knobs-pane-btn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:calc(var(--_k-radius) * 999);color:var(--_k-fg-3);cursor:pointer;
|
|
11852
11844
|
transition:background var(--hover-t,.15s),color .15s}
|
|
11853
|
-
.knobs-ui .knobs-pane-btn:is(:hover,:focus-visible){background:var(--
|
|
11854
|
-
.knobs-ui .knobs-pane-btn[aria-pressed="true"]{color:var(--
|
|
11845
|
+
.knobs-ui .knobs-pane-btn:is(:hover,:focus-visible){background:var(--_ku-wash-hi);color:var(--_k-fg)}
|
|
11846
|
+
.knobs-ui .knobs-pane-btn[aria-pressed="true"]{color:var(--_k-accent)}
|
|
11855
11847
|
.knobs-pane-btn svg{width:13px;height:13px}
|
|
11856
11848
|
.knobs-pane-head[data-toggles]{cursor:pointer}
|
|
11857
11849
|
/* A collapsed pane's rail: its title along the edge; a click opens it. It holds on to the edge the
|
|
11858
11850
|
pane folds toward, as wide as the rail, over the card (which folds to its size): only its label
|
|
11859
11851
|
and chevron draw, and a nested split's slot, which has no card, gives it one of its own. */
|
|
11860
|
-
.knobs-ui .knobs-pane-rail{position:absolute;margin:var(--
|
|
11861
|
-
font-weight:var(--
|
|
11862
|
-
.knobs-ui .knobs-pane[data-nested]>.knobs-pane-rail{background-color:var(--
|
|
11863
|
-
.knobs-split[data-direction="row"]>.knobs-pane>.knobs-pane-rail{top:0;bottom:0;width:var(--
|
|
11852
|
+
.knobs-ui .knobs-pane-rail{position:absolute;margin:var(--_ku-pane-m);border-radius:var(--_ku-pane-radius);background-color:transparent;display:flex;align-items:center;gap:8px;color:var(--_k-fg-2);cursor:pointer;opacity:0;pointer-events:none;
|
|
11853
|
+
font-weight:var(--_k-weight-title);transition:background .15s,color .15s}
|
|
11854
|
+
.knobs-ui .knobs-pane[data-nested]>.knobs-pane-rail{background-color:var(--_ku-pane-bg);box-shadow:var(--_ku-pane-ring)}
|
|
11855
|
+
.knobs-split[data-direction="row"]>.knobs-pane>.knobs-pane-rail{top:0;bottom:0;width:var(--_ku-rail);writing-mode:vertical-rl;padding:10px 0}
|
|
11864
11856
|
.knobs-split[data-direction="row"]>.knobs-pane[data-edge="start"]>.knobs-pane-rail{right:0}
|
|
11865
11857
|
.knobs-split[data-direction="row"]>.knobs-pane[data-edge="end"]>.knobs-pane-rail{left:0}
|
|
11866
|
-
.knobs-split[data-direction="column"]>.knobs-pane>.knobs-pane-rail{left:0;right:0;height:var(--
|
|
11858
|
+
.knobs-split[data-direction="column"]>.knobs-pane>.knobs-pane-rail{left:0;right:0;height:var(--_ku-rail);padding:0 var(--_k-inset)}
|
|
11867
11859
|
.knobs-split[data-direction="column"]>.knobs-pane[data-edge="start"]>.knobs-pane-rail{bottom:0}
|
|
11868
11860
|
.knobs-split[data-direction="column"]>.knobs-pane[data-edge="end"]>.knobs-pane-rail{top:0}
|
|
11869
11861
|
.knobs-pane[data-collapsed]>.knobs-pane-rail{pointer-events:auto}
|
|
11870
11862
|
/* Its hover wash fades, rather than going in one frame as a click opens the pane. */
|
|
11871
|
-
.knobs-ui .knobs-pane-rail::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--
|
|
11863
|
+
.knobs-ui .knobs-pane-rail::before{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--_ku-wash);opacity:0;transition:opacity .15s;pointer-events:none}
|
|
11872
11864
|
.knobs-pane-rail>*{position:relative}
|
|
11873
|
-
.knobs-ui .knobs-pane[data-collapsed]>.knobs-pane-rail:is(:hover,:focus-visible){color:var(--
|
|
11865
|
+
.knobs-ui .knobs-pane[data-collapsed]>.knobs-pane-rail:is(:hover,:focus-visible){color:var(--_k-fg)}
|
|
11874
11866
|
.knobs-ui .knobs-pane[data-collapsed]>.knobs-pane-rail:is(:hover,:focus-visible)::before{opacity:1}
|
|
11875
11867
|
.knobs-pane-rail-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
11876
|
-
.knobs-pane-chevron{display:flex;flex:none;width:11px;height:11px;writing-mode:horizontal-tb;color:var(--
|
|
11868
|
+
.knobs-pane-chevron{display:flex;flex:none;width:11px;height:11px;writing-mode:horizontal-tb;color:var(--_k-fg-3)}
|
|
11877
11869
|
.knobs-pane-turn{display:flex;width:100%;height:100%;transform-origin:50% 50%}
|
|
11878
11870
|
.knobs-pane-rail svg{width:11px;height:11px}
|
|
11879
11871
|
/* The rail's chevron stands in for the header's collapse icon (it turns into the rail's), so the
|
|
@@ -11881,26 +11873,26 @@ var ease = springEasing(26, 1), TOKENS2 = {
|
|
|
11881
11873
|
.knobs-pane[data-morph]>.knobs-pane-clip>.knobs-pane-inner>.knobs-pane-head>.knobs-pane-collapse>svg{visibility:hidden}
|
|
11882
11874
|
/* So does the rail's label for the title, when it travels (split's fold: { title: "travel" }). */
|
|
11883
11875
|
.knobs-pane[data-travel]>.knobs-pane-clip>.knobs-pane-inner>.knobs-pane-head>.knobs-pane-title{visibility:hidden}
|
|
11884
|
-
.knobs-pane[data-morph]:not([data-collapsed]):has(>.knobs-pane-clip>.knobs-pane-inner>.knobs-pane-head>.knobs-pane-collapse:is(:hover,:focus-visible))>.knobs-pane-rail .knobs-pane-chevron{color:var(--
|
|
11876
|
+
.knobs-pane[data-morph]:not([data-collapsed]):has(>.knobs-pane-clip>.knobs-pane-inner>.knobs-pane-head>.knobs-pane-collapse:is(:hover,:focus-visible))>.knobs-pane-rail .knobs-pane-chevron{color:var(--_k-fg)}
|
|
11885
11877
|
.knobs-pane[data-morph]:not([data-collapsed])>.knobs-pane-rail .knobs-pane-chevron{transition:color .15s}
|
|
11886
11878
|
|
|
11887
|
-
.knobs-divider{position:relative;z-index:2;flex:none;width:1px;background:var(--
|
|
11879
|
+
.knobs-divider{position:relative;z-index:2;flex:none;width:1px;background:var(--_ku-divider);touch-action:none;outline:none}
|
|
11888
11880
|
.knobs-split[data-direction="column"]>.knobs-divider{width:auto;height:1px}
|
|
11889
|
-
.knobs-divider::before{content:"";position:absolute;top:0;bottom:0;left:calc(50% - var(--
|
|
11890
|
-
.knobs-split[data-direction="column"]>.knobs-divider::before{left:0;right:0;top:calc(50% - var(--
|
|
11881
|
+
.knobs-divider::before{content:"";position:absolute;top:0;bottom:0;left:calc(50% - var(--_ku-hit) / 2);width:var(--_ku-hit);cursor:col-resize}
|
|
11882
|
+
.knobs-split[data-direction="column"]>.knobs-divider::before{left:0;right:0;top:calc(50% - var(--_ku-hit) / 2);bottom:auto;width:auto;height:var(--_ku-hit);cursor:row-resize}
|
|
11891
11883
|
/* Hover, focus and drags draw the hairline in the accent, with a soft wash beside it. */
|
|
11892
|
-
.knobs-divider::after{content:"";position:absolute;inset:0 -1px;background:var(--
|
|
11893
|
-
box-shadow:0 0 0 2px color-mix(in srgb,var(--
|
|
11884
|
+
.knobs-divider::after{content:"";position:absolute;inset:0 -1px;background:var(--_k-accent);opacity:0;pointer-events:none;
|
|
11885
|
+
box-shadow:0 0 0 2px color-mix(in srgb,var(--_k-accent) 18%,transparent);transition:opacity .16s}
|
|
11894
11886
|
.knobs-split[data-direction="column"]>.knobs-divider::after{inset:-1px 0}
|
|
11895
11887
|
.knobs-divider:hover::after{opacity:.7;transition-delay:.12s}
|
|
11896
11888
|
.knobs-divider:focus-visible::after,.knobs-divider[data-active]::after{opacity:1;transition-delay:0s}
|
|
11897
11889
|
/* Between cards, the hairline gives way to a grip: a small capsule in the gap that shows on
|
|
11898
11890
|
hover, and lengthens and takes the accent while dragged or focused. */
|
|
11899
|
-
.knobs-split:not([data-frame="flat"])>.knobs-divider::after{inset:auto;left:50%;top:50%;width:4px;height:28px;margin:-14px 0 0 -2px;border-radius:2px;background:var(--
|
|
11900
|
-
transition:opacity .16s,background .16s,scale var(--
|
|
11891
|
+
.knobs-split:not([data-frame="flat"])>.knobs-divider::after{inset:auto;left:50%;top:50%;width:4px;height:28px;margin:-14px 0 0 -2px;border-radius:2px;background:var(--_k-border-strong);box-shadow:none;
|
|
11892
|
+
transition:opacity .16s,background .16s,scale var(--_ku-ease-ms) var(--_ku-ease)}
|
|
11901
11893
|
.knobs-split[data-direction="column"]:not([data-frame="flat"])>.knobs-divider::after{inset:auto;left:50%;top:50%;width:28px;height:4px;margin:-2px 0 0 -14px}
|
|
11902
11894
|
.knobs-split:not([data-frame="flat"])>.knobs-divider:hover::after{opacity:1}
|
|
11903
|
-
.knobs-split:not([data-frame="flat"])>.knobs-divider:is(:focus-visible,[data-active])::after{background:var(--
|
|
11895
|
+
.knobs-split:not([data-frame="flat"])>.knobs-divider:is(:focus-visible,[data-active])::after{background:var(--_k-accent);opacity:.9;scale:1 1.45}
|
|
11904
11896
|
.knobs-split[data-direction="column"]:not([data-frame="flat"])>.knobs-divider:is(:focus-visible,[data-active])::after{scale:1.45 1}
|
|
11905
11897
|
:root[data-knobs-resizing],:root[data-knobs-resizing] *{user-select:none!important;-webkit-user-select:none!important}
|
|
11906
11898
|
:root[data-knobs-resizing="row"] *{cursor:col-resize!important}
|
|
@@ -11910,135 +11902,120 @@ var ease = springEasing(26, 1), TOKENS2 = {
|
|
|
11910
11902
|
/* Tree: one scroller, rows placed by transform, only those near the view in the DOM. */
|
|
11911
11903
|
.knobs-tree{position:relative;overflow:auto;height:100%;outline:none;scrollbar-width:none;overscroll-behavior:contain;user-select:none;-webkit-user-select:none}
|
|
11912
11904
|
.knobs-tree-space{position:relative;width:100%;pointer-events:none}
|
|
11913
|
-
.knobs-tree-row{position:absolute;left:var(--
|
|
11914
|
-
color:var(--
|
|
11915
|
-
.knobs-tree-row::before{content:"";position:absolute;inset:0;border-radius:var(--
|
|
11916
|
-
.knobs-tree:not([data-keyboard]):not([data-dragging]) .knobs-tree-row:hover::before{opacity:1;transition-duration:calc(var(--
|
|
11917
|
-
.knobs-tree-row[aria-selected="true"]::before{opacity:1;background:var(--
|
|
11918
|
-
.knobs-tree:focus-visible .knobs-tree-row[data-active]::before,.knobs-tree[data-keyboard]:focus .knobs-tree-row[data-active]::before{opacity:1;background:var(--
|
|
11919
|
-
.knobs-tree:focus .knobs-tree-row[data-active][aria-selected="true"]::before{background:var(--
|
|
11920
|
-
.knobs-tree-row[data-drop="into"]::before{opacity:1;background:color-mix(in srgb,var(--
|
|
11905
|
+
.knobs-tree-row{position:absolute;left:var(--_ku-row-x);right:var(--_ku-row-x);top:0;display:flex;align-items:center;height:var(--_k-row);padding-right:calc(var(--_k-inset) - 4px);
|
|
11906
|
+
color:var(--_k-fg);white-space:nowrap;cursor:default;will-change:transform;contain:layout style}
|
|
11907
|
+
.knobs-tree-row::before{content:"";position:absolute;inset:0;border-radius:var(--_ku-row-radius);background:var(--_ku-wash);opacity:0;transition:opacity calc(var(--_k-hover-out) * 1ms),background .12s;pointer-events:none}
|
|
11908
|
+
.knobs-tree:not([data-keyboard]):not([data-dragging]) .knobs-tree-row:hover::before{opacity:1;transition-duration:calc(var(--_k-hover-in) * 1ms)}
|
|
11909
|
+
.knobs-tree-row[aria-selected="true"]::before{opacity:1;background:var(--_ku-select)}
|
|
11910
|
+
.knobs-tree:focus-visible .knobs-tree-row[data-active]::before,.knobs-tree[data-keyboard]:focus .knobs-tree-row[data-active]::before{opacity:1;background:var(--_ku-wash-hi)}
|
|
11911
|
+
.knobs-tree:focus .knobs-tree-row[data-active][aria-selected="true"]::before{background:var(--_ku-select-focus)}
|
|
11912
|
+
.knobs-tree-row[data-drop="into"]::before{opacity:1;background:color-mix(in srgb,var(--_k-accent) 30%,transparent)}
|
|
11921
11913
|
.knobs-tree-row[data-dragged]{opacity:.38}
|
|
11922
11914
|
/* glide: one highlight under the selected row that glides between rows (the row's own stays off). */
|
|
11923
|
-
.knobs-tree-cursor{position:absolute;left:var(--
|
|
11915
|
+
.knobs-tree-cursor{position:absolute;left:var(--_ku-row-x);right:var(--_ku-row-x);top:0;height:var(--_k-row);border-radius:var(--_ku-row-radius);background:var(--_ku-select);
|
|
11924
11916
|
opacity:0;pointer-events:none;will-change:transform;transition:opacity .15s ease-out,background .12s}
|
|
11925
11917
|
.knobs-tree-cursor[data-on]{opacity:1}
|
|
11926
|
-
.knobs-tree:focus .knobs-tree-cursor{background:var(--
|
|
11918
|
+
.knobs-tree:focus .knobs-tree-cursor{background:var(--_ku-select-focus)}
|
|
11927
11919
|
.knobs-tree[data-glide] .knobs-tree-row[aria-selected="true"]::before{opacity:0!important}
|
|
11928
11920
|
.knobs-tree-row>*{position:relative}
|
|
11929
|
-
.knobs-tree-caret{flex:none;display:flex;align-items:center;justify-content:center;width:16px;height:100%;color:var(--
|
|
11921
|
+
.knobs-tree-caret{flex:none;display:flex;align-items:center;justify-content:center;width:16px;height:100%;color:var(--_k-fg-3);transition:transform var(--_ku-ease-ms) var(--_ku-ease)}
|
|
11930
11922
|
.knobs-tree-caret svg{width:9px;height:9px}
|
|
11931
11923
|
.knobs-tree-row[aria-expanded="true"]>.knobs-tree-caret{transform:rotate(90deg)}
|
|
11932
11924
|
.knobs-tree-row:not([aria-expanded])>.knobs-tree-caret{visibility:hidden}
|
|
11933
|
-
.knobs-tree-icon{flex:none;display:flex;align-items:center;justify-content:center;width:14px;margin-right:6px;color:var(--
|
|
11934
|
-
.knobs-tree-label{position:relative;flex:1;min-width:0;overflow:hidden;font-weight:var(--
|
|
11935
|
-
.knobs-tree-row[data-ancestor] .knobs-tree-label{color:var(--
|
|
11936
|
-
.knobs-tree-label .knobs-tree-mark{color:var(--
|
|
11925
|
+
.knobs-tree-icon{flex:none;display:flex;align-items:center;justify-content:center;width:14px;margin-right:6px;color:var(--_k-fg-3);font-size:calc(var(--_k-font-size) - 1px)}
|
|
11926
|
+
.knobs-tree-label{position:relative;flex:1;min-width:0;overflow:hidden;font-weight:var(--_k-weight)}
|
|
11927
|
+
.knobs-tree-row[data-ancestor] .knobs-tree-label{color:var(--_k-fg-2)}
|
|
11928
|
+
.knobs-tree-label .knobs-tree-mark{color:var(--_k-accent)}
|
|
11937
11929
|
.knobs-tree-row[data-off~="visible"] :is(.knobs-tree-label,.knobs-tree-icon){opacity:.45}
|
|
11938
|
-
.knobs-tree-row[data-off~="locked"] .knobs-tree-label{color:var(--
|
|
11939
|
-
.knobs-tree-detail{flex:none;margin-left:6px;color:var(--
|
|
11930
|
+
.knobs-tree-row[data-off~="locked"] .knobs-tree-label{color:var(--_k-fg-2)}
|
|
11931
|
+
.knobs-tree-detail{flex:none;margin-left:6px;color:var(--_k-fg-3);font-variant-numeric:tabular-nums}
|
|
11940
11932
|
.knobs-tree-tools{flex:none;display:flex;align-items:center;gap:1px;margin-left:4px}
|
|
11941
|
-
.knobs-ui .knobs-tree-toggle{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:calc(var(--
|
|
11933
|
+
.knobs-ui .knobs-tree-toggle{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:calc(var(--_k-radius) * 999);color:var(--_k-fg-3);cursor:pointer;opacity:0;transition:opacity .12s,color .12s,background .12s}
|
|
11942
11934
|
.knobs-ui .knobs-tree-toggle svg{width:12px;height:12px}
|
|
11943
11935
|
.knobs-tree-row:is(:hover,[data-active],[aria-selected="true"]) .knobs-tree-toggle,.knobs-ui .knobs-tree-toggle[aria-pressed="false"]{opacity:1}
|
|
11944
|
-
.knobs-ui .knobs-tree-toggle:hover{background:var(--
|
|
11945
|
-
.knobs-ui .knobs-tree-toggle[aria-pressed="false"]{color:var(--
|
|
11936
|
+
.knobs-ui .knobs-tree-toggle:hover{background:var(--_ku-wash-hi);color:var(--_k-fg)}
|
|
11937
|
+
.knobs-ui .knobs-tree-toggle[aria-pressed="false"]{color:var(--_k-fg-2)}
|
|
11946
11938
|
/* Renaming in place, as a number is edited in a panel: no box, just the text and an underline. */
|
|
11947
|
-
.knobs-ui .knobs-tree-edit{position:absolute;inset:auto 0 auto 0;top:50%;transform:translateY(-50%);width:100%;height:calc(var(--
|
|
11948
|
-
background:transparent;color:var(--
|
|
11949
|
-
.knobs-tree-edit::selection{background:color-mix(in srgb,var(--
|
|
11939
|
+
.knobs-ui .knobs-tree-edit{position:absolute;inset:auto 0 auto 0;top:50%;transform:translateY(-50%);width:100%;height:calc(var(--_k-font-size) * 1.5);padding:0;
|
|
11940
|
+
background:transparent;color:var(--_k-fg);caret-color:var(--_k-accent);font:inherit;font-weight:var(--_k-weight);border-bottom:1px solid var(--_k-fg)}
|
|
11941
|
+
.knobs-tree-edit::selection{background:color-mix(in srgb,var(--_k-accent) 40%,transparent)}
|
|
11950
11942
|
.knobs-tree-row[data-editing] .knobs-tree-text{visibility:hidden}
|
|
11951
|
-
.knobs-tree-line{position:absolute;left:0;right:6px;top:0;height:2px;margin-top:-1px;border-radius:1px;background:var(--
|
|
11952
|
-
.knobs-tree-line::before{content:"";position:absolute;left:-3px;top:-2px;width:6px;height:6px;border-radius:50%;box-shadow:inset 0 0 0 2px var(--
|
|
11943
|
+
.knobs-tree-line{position:absolute;left:0;right:6px;top:0;height:2px;margin-top:-1px;border-radius:1px;background:var(--_k-accent);pointer-events:none;opacity:0;transition:opacity .1s}
|
|
11944
|
+
.knobs-tree-line::before{content:"";position:absolute;left:-3px;top:-2px;width:6px;height:6px;border-radius:50%;box-shadow:inset 0 0 0 2px var(--_k-accent)}
|
|
11953
11945
|
.knobs-tree[data-dragging] .knobs-tree-line[data-shown]{opacity:1}
|
|
11954
|
-
.knobs-tree-ghost{position:fixed;left:0;top:0;z-index:2147480004;padding:2px 8px;background:var(--
|
|
11955
|
-
box-shadow:0 0 0 1px var(--
|
|
11956
|
-
.knobs-tree-empty{padding:10px var(--
|
|
11946
|
+
.knobs-tree-ghost{position:fixed;left:0;top:0;z-index:2147480004;padding:2px 8px;background:var(--_k-bg);color:var(--_k-fg);border-radius:var(--_k-radius);
|
|
11947
|
+
box-shadow:0 0 0 1px var(--_k-border-strong),0 6px 18px rgba(0,0,0,calc(.35 * var(--_k-shadow-k,1)));pointer-events:none;white-space:nowrap;font:var(--_k-weight) var(--_k-font-size)/1.6 var(--_k-font)}
|
|
11948
|
+
.knobs-tree-empty{padding:10px var(--_k-inset);color:var(--_k-fg-3)}
|
|
11957
11949
|
|
|
11958
11950
|
/* Timeline: a transport (play, the time) beside a track: the ruler's canvas over a lane of
|
|
11959
11951
|
markers, ranges as soft bands, and the playhead, a hairline in the accent with a cap. */
|
|
11960
11952
|
:where(.knobs-timeline,.knobs-timeline *){box-sizing:border-box}
|
|
11961
|
-
.knobs-ui.knobs-timeline{display:flex;align-items:stretch;gap:10px;width:100%;height:100%;min-height:52px;padding:6px var(--
|
|
11962
|
-
font:var(--
|
|
11953
|
+
.knobs-ui.knobs-timeline{display:flex;align-items:stretch;gap:10px;width:100%;height:100%;min-height:52px;padding:6px var(--_k-inset) 8px 8px;outline:none;user-select:none;-webkit-user-select:none;
|
|
11954
|
+
font:var(--_k-weight) var(--_k-font-size)/1.35 var(--_k-font);color:var(--_k-fg);letter-spacing:normal;text-align:left}
|
|
11963
11955
|
:where(.knobs-ui) :is(.knobs-tl-play,.knobs-tl-edit){all:revert;box-sizing:border-box;font:inherit;color:inherit;letter-spacing:inherit;background:transparent;border:0;margin:0;padding:0;outline:none;box-shadow:none}
|
|
11964
11956
|
.knobs-tl-transport{flex:none;display:flex;align-items:center;gap:8px;min-width:96px}
|
|
11965
|
-
.knobs-ui .knobs-tl-play{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--
|
|
11966
|
-
background:var(--
|
|
11967
|
-
.knobs-ui .knobs-tl-play:hover{background:color-mix(in srgb,var(--
|
|
11957
|
+
.knobs-ui .knobs-tl-play{flex:none;display:inline-flex;align-items:center;justify-content:center;width:var(--_k-control-h);height:var(--_k-control-h);min-width:22px;min-height:22px;border-radius:calc(var(--_k-radius) * 999);
|
|
11958
|
+
background:var(--_k-fill-selected);color:var(--_k-fg);cursor:pointer;transition:background .15s,transform .15s var(--_ku-ease)}
|
|
11959
|
+
.knobs-ui .knobs-tl-play:hover{background:color-mix(in srgb,var(--_k-fg) 16%,transparent)}
|
|
11968
11960
|
.knobs-ui .knobs-tl-play:active{transform:scale(.94)}
|
|
11969
11961
|
.knobs-tl-play svg{width:12px;height:12px}
|
|
11970
|
-
.knobs-timeline[data-playing] .knobs-tl-play{background:var(--
|
|
11962
|
+
.knobs-timeline[data-playing] .knobs-tl-play{background:var(--_k-accent);color:var(--_k-bg)}
|
|
11971
11963
|
.knobs-tl-time{display:flex;flex-direction:column;line-height:1.2;font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}
|
|
11972
|
-
.knobs-tl-now{font:var(--
|
|
11973
|
-
.knobs-tl-sub{font-size:var(--
|
|
11974
|
-
.knobs-tl-track{position:relative;flex:1;min-width:0;overflow:hidden;border-radius:var(--
|
|
11975
|
-
transition:background calc(var(--
|
|
11976
|
-
.knobs-timeline:focus-visible .knobs-tl-track,.knobs-timeline[data-keyboard]:focus .knobs-tl-track{background:color-mix(in srgb,var(--
|
|
11964
|
+
.knobs-tl-now{font:var(--_k-weight) var(--_k-value-size)/1.2 var(--_k-value-font);font-variant-numeric:tabular-nums;font-feature-settings:"tnum";color:var(--_k-fg);white-space:nowrap}
|
|
11965
|
+
.knobs-tl-sub{font-size:var(--_k-text-meta);color:var(--_k-fg-3);white-space:nowrap}
|
|
11966
|
+
.knobs-tl-track{position:relative;flex:1;min-width:0;overflow:hidden;border-radius:var(--_k-radius);background:var(--_k-fill);cursor:col-resize;touch-action:none;
|
|
11967
|
+
transition:background calc(var(--_k-hover-out) * 1ms)}
|
|
11968
|
+
.knobs-timeline:focus-visible .knobs-tl-track,.knobs-timeline[data-keyboard]:focus .knobs-tl-track{background:color-mix(in srgb,var(--_k-fill-selected) 80%,transparent)}
|
|
11977
11969
|
.knobs-tl-ruler{position:absolute;left:0;top:0;height:22px;pointer-events:none}
|
|
11978
11970
|
.knobs-tl-lane{position:absolute;left:0;right:0;top:22px;bottom:0;pointer-events:none}
|
|
11979
11971
|
/* Ranges: a soft band through the lane, its edges handles; the loop range in the accent. */
|
|
11980
|
-
.knobs-tl-range{position:absolute;left:0;top:0;bottom:0;width:0;background:color-mix(in srgb,var(--
|
|
11981
|
-
.knobs-tl-range[data-loop]{background:color-mix(in srgb,var(--
|
|
11982
|
-
.knobs-tl-range[data-selected]{background:color-mix(in srgb,var(--
|
|
11972
|
+
.knobs-tl-range{position:absolute;left:0;top:0;bottom:0;width:0;background:color-mix(in srgb,var(--_k-fg) 6%,transparent);will-change:transform}
|
|
11973
|
+
.knobs-tl-range[data-loop]{background:color-mix(in srgb,var(--_k-accent) 11%,transparent)}
|
|
11974
|
+
.knobs-tl-range[data-selected]{background:color-mix(in srgb,var(--_k-accent) 18%,transparent)}
|
|
11983
11975
|
.knobs-tl-edge{position:absolute;top:0;bottom:0;width:9px;cursor:ew-resize}
|
|
11984
11976
|
.knobs-tl-edge[data-edge="start"]{left:-4px}
|
|
11985
11977
|
.knobs-tl-edge[data-edge="end"]{right:-5px}
|
|
11986
|
-
.knobs-tl-edge::after{content:"";position:absolute;top:0;bottom:0;left:4px;width:1px;background:color-mix(in srgb,var(--
|
|
11987
|
-
.knobs-tl-edge:hover::after,.knobs-tl-range[data-selected] .knobs-tl-edge::after{background:var(--
|
|
11988
|
-
.knobs-tl-rlabel{position:absolute;left:5px;bottom:3px;padding:0 5px;border-radius:max(0px,calc(var(--
|
|
11978
|
+
.knobs-tl-edge::after{content:"";position:absolute;top:0;bottom:0;left:4px;width:1px;background:color-mix(in srgb,var(--_k-accent) 55%,transparent);transition:background .15s,box-shadow .15s}
|
|
11979
|
+
.knobs-tl-edge:hover::after,.knobs-tl-range[data-selected] .knobs-tl-edge::after{background:var(--_k-accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--_k-accent) 22%,transparent)}
|
|
11980
|
+
.knobs-tl-rlabel{position:absolute;left:5px;bottom:3px;padding:0 5px;border-radius:max(0px,calc(var(--_k-radius) - 3px));font-size:var(--_k-text-meta);line-height:16px;color:var(--_k-fg-2);cursor:grab;white-space:nowrap}
|
|
11989
11981
|
.knobs-tl-rlabel:empty{display:none}
|
|
11990
|
-
.knobs-tl-rlabel:hover{background:var(--
|
|
11982
|
+
.knobs-tl-rlabel:hover{background:var(--_ku-wash-hi);color:var(--_k-fg)}
|
|
11991
11983
|
/* Markers: a diamond on the ruler's edge and a label chip below it. */
|
|
11992
|
-
.knobs-tl-marker{position:absolute;left:0;top:-22px;bottom:0;width:0;will-change:transform;pointer-events:none;--knobs-tl-c:var(--knobs-tl-color,var(--
|
|
11984
|
+
.knobs-tl-marker{position:absolute;left:0;top:-22px;bottom:0;width:0;will-change:transform;pointer-events:none;--knobs-tl-c:var(--knobs-tl-color,var(--_k-fg-2))}
|
|
11993
11985
|
.knobs-tl-marker::before{content:"";position:absolute;top:22px;bottom:0;left:-.5px;width:1px;background:color-mix(in srgb,var(--knobs-tl-c) 40%,transparent)}
|
|
11994
11986
|
.knobs-tl-pin{position:absolute;top:13px;left:-5px;width:10px;height:10px;pointer-events:auto;cursor:grab}
|
|
11995
|
-
.knobs-tl-pin::after{content:"";position:absolute;inset:1.5px;border-radius:min(2px,var(--
|
|
11996
|
-
.knobs-tl-mlabel{position:absolute;top:26px;left:3px;max-width:140px;padding:0 6px;border-radius:max(0px,calc(var(--
|
|
11997
|
-
font-size:var(--
|
|
11998
|
-
.knobs-tl-marker[data-selected]{--knobs-tl-c:var(--
|
|
11999
|
-
.knobs-tl-marker[data-selected] .knobs-tl-mlabel{background:color-mix(in srgb,var(--
|
|
11987
|
+
.knobs-tl-pin::after{content:"";position:absolute;inset:1.5px;border-radius:min(2px,var(--_k-radius));background:var(--knobs-tl-c);rotate:45deg;transition:background .15s,scale .2s var(--_ku-ease)}
|
|
11988
|
+
.knobs-tl-mlabel{position:absolute;top:26px;left:3px;max-width:140px;padding:0 6px;border-radius:max(0px,calc(var(--_k-radius) - 3px));background:var(--_k-fill-selected);color:var(--_k-fg);
|
|
11989
|
+
font-size:var(--_k-text-meta);line-height:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:auto;cursor:grab;transition:background .15s,color .15s}
|
|
11990
|
+
.knobs-tl-marker[data-selected]{--knobs-tl-c:var(--_k-accent)}
|
|
11991
|
+
.knobs-tl-marker[data-selected] .knobs-tl-mlabel{background:color-mix(in srgb,var(--_k-accent) 24%,var(--_k-fill-selected))}
|
|
12000
11992
|
.knobs-tl-marker[data-selected] .knobs-tl-pin::after{scale:1.2}
|
|
12001
11993
|
.knobs-timeline[data-dragging] .knobs-tl-marker[data-selected] :is(.knobs-tl-pin,.knobs-tl-mlabel){cursor:grabbing}
|
|
12002
11994
|
.knobs-tl-marker[data-editing] .knobs-tl-mlabel{visibility:hidden}
|
|
12003
|
-
.knobs-ui .knobs-tl-edit{position:absolute;top:26px;left:3px;width:120px;height:17px;padding:0 6px;font-size:var(--
|
|
12004
|
-
background:var(--
|
|
11995
|
+
.knobs-ui .knobs-tl-edit{position:absolute;top:26px;left:3px;width:120px;height:17px;padding:0 6px;font-size:var(--_k-text-meta);color:var(--_k-fg);caret-color:var(--_k-accent);
|
|
11996
|
+
background:var(--_k-bg);border-radius:max(0px,calc(var(--_k-radius) - 3px));box-shadow:inset 0 -1px 0 var(--_k-fg);pointer-events:auto}
|
|
12005
11997
|
/* The playhead: an accent hairline with a rounded cap in the ruler; it glows a little while held
|
|
12006
11998
|
on a marker. */
|
|
12007
11999
|
.knobs-tl-head{position:absolute;left:0;top:0;bottom:0;width:0;will-change:transform;pointer-events:none}
|
|
12008
|
-
.knobs-tl-head::before{content:"";position:absolute;top:4px;bottom:0;left:-.75px;width:1.5px;background:var(--
|
|
12009
|
-
.knobs-tl-head::after{content:"";position:absolute;top:3px;left:-4.5px;width:9px;height:13px;border-radius:min(4.5px,var(--
|
|
12010
|
-
background:var(--
|
|
12000
|
+
.knobs-tl-head::before{content:"";position:absolute;top:4px;bottom:0;left:-.75px;width:1.5px;background:var(--_k-accent)}
|
|
12001
|
+
.knobs-tl-head::after{content:"";position:absolute;top:3px;left:-4.5px;width:9px;height:13px;border-radius:min(4.5px,var(--_k-radius)) min(4.5px,var(--_k-radius)) min(4.5px,var(--_k-radius)) min(4.5px,var(--_k-radius));
|
|
12002
|
+
background:var(--_k-accent);box-shadow:0 1px 3px rgba(0,0,0,calc(.3 * var(--k-lift,1)));transition:box-shadow .15s,scale .18s var(--_ku-ease)}
|
|
12011
12003
|
.knobs-timeline[data-scrubbing] .knobs-tl-head::after{scale:1.12}
|
|
12012
|
-
.knobs-timeline[data-stuck] .knobs-tl-head::after{box-shadow:0 0 0 3px color-mix(in srgb,var(--
|
|
12013
|
-
.knobs-tl-hover{position:absolute;left:0;top:0;bottom:0;width:1px;margin-left:-.5px;background:var(--
|
|
12004
|
+
.knobs-timeline[data-stuck] .knobs-tl-head::after{box-shadow:0 0 0 3px color-mix(in srgb,var(--_k-accent) 26%,transparent)}
|
|
12005
|
+
.knobs-tl-hover{position:absolute;left:0;top:0;bottom:0;width:1px;margin-left:-.5px;background:var(--_k-border-strong);transform:translateX(-100px);pointer-events:none;opacity:0;transition:opacity .15s}
|
|
12014
12006
|
.knobs-tl-track:hover .knobs-tl-hover{opacity:1}
|
|
12015
12007
|
.knobs-timeline[data-scrubbing] .knobs-tl-hover{opacity:0}
|
|
12016
12008
|
@media(prefers-reduced-motion:reduce){.knobs-timeline :where(*,::before,::after){transition:none!important}}
|
|
12017
12009
|
@media(prefers-reduced-motion:reduce){:is(.knobs-tree,.knobs-split>.knobs-divider,.knobs-pane-head,.knobs-pane-rail) :where(*,::before,::after){transition:none!important}}
|
|
12018
|
-
|
|
12010
|
+
`, uiCss = () => aliased(css + readoutCss + overlayCss + bentoCss + activityCss + pickerCss + compareCss) + rolling_css_default;
|
|
12019
12011
|
function injectUiStyles(doc) {
|
|
12020
|
-
if (doc.querySelector("style[data-knobs-ui]"))
|
|
12012
|
+
if (injectTokens(doc), doc.querySelector("style[data-knobs-ui]"))
|
|
12021
12013
|
return;
|
|
12022
12014
|
let style = doc.createElement("style");
|
|
12023
|
-
style.dataset.knobsUi = "", style.textContent =
|
|
12024
|
-
}
|
|
12025
|
-
function injectUiPreset(doc, preset) {
|
|
12026
|
-
let content = presetCss({ ...preset, css: void 0 }).replaceAll(".knobs-panel", ".knobs-ui"), existing = doc.querySelector(`style[data-knobs-ui-preset="${preset.name}"]`);
|
|
12027
|
-
if (existing) {
|
|
12028
|
-
if (existing.textContent !== content)
|
|
12029
|
-
existing.textContent = content;
|
|
12030
|
-
return;
|
|
12031
|
-
}
|
|
12032
|
-
let style = doc.createElement("style");
|
|
12033
|
-
style.dataset.knobsUiPreset = preset.name, style.textContent = content, doc.head.append(style);
|
|
12015
|
+
style.dataset.knobsUi = "", style.textContent = uiCss(), doc.head.append(style);
|
|
12034
12016
|
}
|
|
12035
|
-
function
|
|
12036
|
-
|
|
12037
|
-
if (injectUiStyles(doc), root.classList.add("knobs-ui"), look.preset)
|
|
12038
|
-
injectUiPreset(doc, look.preset), root.dataset.preset = look.preset.name;
|
|
12039
|
-
if (look.theme)
|
|
12040
|
-
root.dataset.theme = look.theme;
|
|
12041
|
-
syncFrame(root);
|
|
12017
|
+
function applyLook2(root, look) {
|
|
12018
|
+
injectUiStyles(root.ownerDocument), root.classList.add("knobs-root", "knobs-ui"), applyLook(root, resolveLook(look)), syncFrame(root);
|
|
12042
12019
|
}
|
|
12043
12020
|
function syncFrame(root) {
|
|
12044
12021
|
if (!root.isConnected)
|
|
@@ -12049,7 +12026,6 @@ function syncFrame(root) {
|
|
|
12049
12026
|
delete root.dataset.frame;
|
|
12050
12027
|
}
|
|
12051
12028
|
var lookDefaults = { current: {} };
|
|
12052
|
-
var reducedMotion4 = (win) => win?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
12053
12029
|
function frameLoop(win, step) {
|
|
12054
12030
|
let raf = 0, last = 0, tick = (now) => {
|
|
12055
12031
|
let dt = last ? Math.min(0.064, (now - last) / 1000) : 0.016666666666666666;
|
|
@@ -12081,7 +12057,14 @@ var svg = (body, box = 16) => `<svg viewBox="0 0 ${box} ${box}" aria-hidden="tru
|
|
|
12081
12057
|
};
|
|
12082
12058
|
|
|
12083
12059
|
// src/ui/readout-model.ts
|
|
12084
|
-
var
|
|
12060
|
+
var SERIES_TOKENS = [
|
|
12061
|
+
"--_k-series-1",
|
|
12062
|
+
"--_k-series-2",
|
|
12063
|
+
"--_k-series-3",
|
|
12064
|
+
"--_k-series-4",
|
|
12065
|
+
"--_k-series-5",
|
|
12066
|
+
"--_k-series-6"
|
|
12067
|
+
], SERIES = ["#5ac8fa", "#ff9f0a", "#bf5af2", "#30d158", "#ff6482", "#64d2ff"];
|
|
12085
12068
|
function formatNumber(v, decimals) {
|
|
12086
12069
|
if (!Number.isFinite(v))
|
|
12087
12070
|
return "—";
|
|
@@ -12401,20 +12384,21 @@ function paletteOf(el, now = performance.now()) {
|
|
|
12401
12384
|
let hit = palettes.get(el);
|
|
12402
12385
|
if (hit && now - hit.at < 8)
|
|
12403
12386
|
return hit.p;
|
|
12404
|
-
let s = getComputedStyle(el), c = (name, fallback) =>
|
|
12405
|
-
accent: c("--
|
|
12406
|
-
text: c("--
|
|
12407
|
-
label: c("--
|
|
12408
|
-
dim: c("--
|
|
12409
|
-
line: c("--
|
|
12410
|
-
surfaceHi: c("--
|
|
12411
|
-
warn: c("--
|
|
12412
|
-
critical: c("--
|
|
12413
|
-
|
|
12387
|
+
let s = getComputedStyle(el), c = (name, fallback) => tokenColor(s, name, fallback), p = {
|
|
12388
|
+
accent: c("--kv-accent", [1, 1, 1, 1]),
|
|
12389
|
+
text: c("--kv-fg", [1, 1, 1, 0.92]),
|
|
12390
|
+
label: c("--kv-fg-2", [1, 1, 1, 0.64]),
|
|
12391
|
+
dim: c("--kv-fg-3", [1, 1, 1, 0.42]),
|
|
12392
|
+
line: c("--kv-border", [1, 1, 1, 0.1]),
|
|
12393
|
+
surfaceHi: c("--kv-fill-selected", [1, 1, 1, 0.11]),
|
|
12394
|
+
warn: c("--_k-warn", [0.96, 0.68, 0.2, 1]),
|
|
12395
|
+
critical: c("--_k-danger", [1, 0.37, 0.34, 1]),
|
|
12396
|
+
series: SERIES_TOKENS.map((name, i) => c(name, parseCssColor(SERIES[i % SERIES.length]))),
|
|
12397
|
+
radius: Number.parseFloat(s.getPropertyValue("--kv-radius")) || 0
|
|
12414
12398
|
};
|
|
12415
12399
|
return palettes.set(el, { at: now, p }), p;
|
|
12416
12400
|
}
|
|
12417
|
-
var reduced2 = (doc) =>
|
|
12401
|
+
var reduced2 = (doc) => reducedMotion(doc.defaultView);
|
|
12418
12402
|
function make2(doc) {
|
|
12419
12403
|
return (tag, cls, text) => {
|
|
12420
12404
|
let node = doc.createElement(tag);
|
|
@@ -12605,7 +12589,7 @@ function valueBox(doc, grew) {
|
|
|
12605
12589
|
};
|
|
12606
12590
|
}
|
|
12607
12591
|
function createWatch(env) {
|
|
12608
|
-
let root = make2(env.doc)("span", "knobs-ui knobs-rd knobs-rd-watch"), field = env.field, value = valueBox(env.doc);
|
|
12592
|
+
let root = make2(env.doc)("span", "knobs-root knobs-ui knobs-rd knobs-rd-watch"), field = env.field, value = valueBox(env.doc);
|
|
12609
12593
|
root.append(value.box);
|
|
12610
12594
|
let seq = -1, text = throttle(() => field.hz ?? 4), rt = runtime(env, root, (now) => {
|
|
12611
12595
|
if (env.state.seq === seq)
|
|
@@ -12632,7 +12616,7 @@ function createWatch(env) {
|
|
|
12632
12616
|
};
|
|
12633
12617
|
}
|
|
12634
12618
|
function createSparkline(env) {
|
|
12635
|
-
let root = make2(env.doc)("span", "knobs-ui knobs-rd knobs-rd-spark"), field = env.field, canvas = plot(env.doc, "knobs-rd-plot", () => {
|
|
12619
|
+
let root = make2(env.doc)("span", "knobs-root knobs-ui knobs-rd knobs-rd-spark"), field = env.field, canvas = plot(env.doc, "knobs-rd-plot", () => {
|
|
12636
12620
|
dirty = !0, rt.request();
|
|
12637
12621
|
}), value = valueBox(env.doc);
|
|
12638
12622
|
root.append(canvas.canvas, value.box);
|
|
@@ -12698,7 +12682,7 @@ function createSparkline(env) {
|
|
|
12698
12682
|
};
|
|
12699
12683
|
}
|
|
12700
12684
|
function createGraph(env) {
|
|
12701
|
-
let el = make2(env.doc), root = el("div", "knobs-ui knobs-rd knobs-rd-graph knobs-rd-block"), field = env.field, head = el("div", "knobs-rd-head");
|
|
12685
|
+
let el = make2(env.doc), root = el("div", "knobs-root knobs-ui knobs-rd knobs-rd-graph knobs-rd-block"), field = env.field, head = el("div", "knobs-rd-head");
|
|
12702
12686
|
if (env.label)
|
|
12703
12687
|
head.append(env.label);
|
|
12704
12688
|
let legend = el("span", "knobs-rd-legend");
|
|
@@ -12724,7 +12708,7 @@ function createGraph(env) {
|
|
|
12724
12708
|
build();
|
|
12725
12709
|
let range = new EasedRange, text = throttle(() => field.hz ?? 4), seq = -1, dirty = !0, hoverX = -1, hoverAt = -1, ops = [], ticks = { top: "", bottom: "" }, shownSeq = -1, rings = () => field.series.map((s) => env.state.series.get(s.id)), colorOf = (p, i) => {
|
|
12726
12710
|
let s = field.series[i];
|
|
12727
|
-
return s.color ? parseCssColor(s.color, p.accent) : i === 0 ? p.accent :
|
|
12711
|
+
return s.color ? parseCssColor(s.color, p.accent) : i === 0 ? p.accent : p.series[(i - 1) % p.series.length];
|
|
12728
12712
|
}, rt = runtime(env, root, (now, dt) => {
|
|
12729
12713
|
let rs = rings(), fresh = env.state.seq !== seq;
|
|
12730
12714
|
seq = env.state.seq;
|
|
@@ -12874,7 +12858,7 @@ function createGraph(env) {
|
|
|
12874
12858
|
};
|
|
12875
12859
|
}
|
|
12876
12860
|
function createMeter(env) {
|
|
12877
|
-
let root = make2(env.doc)("span", "knobs-ui knobs-rd knobs-rd-meter"), field = env.field, canvas = plot(env.doc, "knobs-rd-plot", () => {
|
|
12861
|
+
let root = make2(env.doc)("span", "knobs-root knobs-ui knobs-rd knobs-rd-meter"), field = env.field, canvas = plot(env.doc, "knobs-rd-plot", () => {
|
|
12878
12862
|
dirty = !0, rt.request();
|
|
12879
12863
|
}), value = valueBox(env.doc);
|
|
12880
12864
|
root.append(canvas.canvas, value.box), root.setAttribute("role", "meter");
|
|
@@ -12952,7 +12936,7 @@ function createMeter(env) {
|
|
|
12952
12936
|
}
|
|
12953
12937
|
var isNumeric = (v) => typeof v === "number" || typeof v === "string" && /^[-+]?[\d.,]+\s*\S{0,3}$/.test(v);
|
|
12954
12938
|
function createTable(env) {
|
|
12955
|
-
let el = make2(env.doc), root = el("div", "knobs-ui knobs-rd knobs-rd-table knobs-rd-block"), field = env.field, grid = el("div", "knobs-rd-grid");
|
|
12939
|
+
let el = make2(env.doc), root = el("div", "knobs-root knobs-ui knobs-rd knobs-rd-table knobs-rd-block"), field = env.field, grid = el("div", "knobs-rd-grid");
|
|
12956
12940
|
grid.tabIndex = -1, grid.setAttribute("role", "table"), root.append(grid);
|
|
12957
12941
|
let text = throttle(() => field.hz ?? 4), seq = -1, cols = 0, head, body = [], grows = [], header = (n) => {
|
|
12958
12942
|
let names = field.columns ?? [], key = `${n}\x00${names.join("\x00")}`;
|
|
@@ -13061,7 +13045,7 @@ function logTime(t) {
|
|
|
13061
13045
|
}
|
|
13062
13046
|
var levelColor2 = (p, level) => level === "error" ? p.critical : level === "warn" ? p.warn : level === "debug" ? p.dim : p.text;
|
|
13063
13047
|
function createLog(env) {
|
|
13064
|
-
let doc = env.doc, el = make2(doc), root = el("div", "knobs-ui knobs-rd knobs-rd-log knobs-rd-block"), field = env.field, head = el("div", "knobs-rd-head");
|
|
13048
|
+
let doc = env.doc, el = make2(doc), root = el("div", "knobs-root knobs-ui knobs-rd knobs-rd-log knobs-rd-block"), field = env.field, head = el("div", "knobs-rd-head");
|
|
13065
13049
|
if (env.label)
|
|
13066
13050
|
head.append(env.label);
|
|
13067
13051
|
let chips = el("span", "knobs-rd-chips");
|
|
@@ -13357,11 +13341,11 @@ function layerRoot(doc) {
|
|
|
13357
13341
|
}
|
|
13358
13342
|
function layerElement(doc, cls, look) {
|
|
13359
13343
|
let el = doc.createElement("div");
|
|
13360
|
-
return el.className = cls, layerRoot(doc).append(el),
|
|
13344
|
+
return el.className = cls, layerRoot(doc).append(el), applyLook2(el, lookOf(look)), el;
|
|
13361
13345
|
}
|
|
13362
13346
|
function presence(el, o = {}) {
|
|
13363
13347
|
let win = el.ownerDocument.defaultView, spring = new Spring(0, 1, 1, 0.002), dx = o.dx ?? 0, dy = o.dy ?? 0, gone = [], shown = !1, render = () => {
|
|
13364
|
-
let reduced =
|
|
13348
|
+
let reduced = reducedMotion(win), p = spring.x, q = Math.max(0, Math.min(1, p)), scale = reduced ? 1 : (o.scale ?? 0.94) + (1 - (o.scale ?? 0.94)) * p, blur = reduced ? 0 : (1 - q) * (o.blur ?? 6), t = reduced ? 0 : 1 - p;
|
|
13365
13349
|
el.style.opacity = q.toFixed(3), el.style.transform = p === 1 ? "" : `translate(${(dx * t).toFixed(2)}px,${(dy * t).toFixed(2)}px) scale(${scale.toFixed(4)})`, el.style.filter = blur > 0.05 ? `blur(${blur.toFixed(2)}px)` : "", el.style.pointerEvents = shown ? "" : "none", o.onFrame?.(p);
|
|
13366
13350
|
}, loop = frameLoop(win, (dt) => {
|
|
13367
13351
|
if (spring.step(dt), render(), !spring.resting)
|
|
@@ -13375,8 +13359,8 @@ function presence(el, o = {}) {
|
|
|
13375
13359
|
}
|
|
13376
13360
|
return !1;
|
|
13377
13361
|
}), tune = (seconds, zeta) => {
|
|
13378
|
-
let reduced =
|
|
13379
|
-
spring.omega = 2 * Math.PI / (reduced ?
|
|
13362
|
+
let reduced = reducedMotion(win);
|
|
13363
|
+
spring.omega = 2 * Math.PI / (reduced ? FADE.duration : seconds), spring.zeta = reduced ? 1 : zeta;
|
|
13380
13364
|
};
|
|
13381
13365
|
return render(), {
|
|
13382
13366
|
show() {
|
|
@@ -13415,7 +13399,7 @@ var regions = /* @__PURE__ */ new WeakMap;
|
|
|
13415
13399
|
function toast(message, options = {}) {
|
|
13416
13400
|
let doc = options.within?.ownerDocument ?? options.doc ?? document, win = doc.defaultView, key = options.within ?? doc, r = regions.get(key);
|
|
13417
13401
|
if (!r || !r.el.isConnected) {
|
|
13418
|
-
let el = options.within ? Object.assign(doc.createElement("div"), { className: "knobs-ui knobs-toast" }) : layerElement(doc, "knobs-layer knobs-toast", options.look);
|
|
13402
|
+
let el = options.within ? Object.assign(doc.createElement("div"), { className: "knobs-root knobs-ui knobs-toast" }) : layerElement(doc, "knobs-layer knobs-toast", options.look);
|
|
13419
13403
|
if (options.within)
|
|
13420
13404
|
injectUiStyles(doc), options.within.append(el);
|
|
13421
13405
|
el.setAttribute("role", "status"), el.setAttribute("aria-live", "polite");
|
|
@@ -13552,7 +13536,7 @@ function createTabStrip(doc, choose) {
|
|
|
13552
13536
|
}
|
|
13553
13537
|
|
|
13554
13538
|
// src/panel/tab-transition.ts
|
|
13555
|
-
var LAYOUT = springMotion2(
|
|
13539
|
+
var LAYOUT = springMotion2(SPRINGS2.default), IN = springMotion2({ duration: 0.2, bounce: 0 }), OUT = springMotion2({ duration: 0.14, bounce: 0 }), STAGGER = 18, STAGGER_MAX = 6, RISE = 6;
|
|
13556
13540
|
function tabTransition(body, root, wake) {
|
|
13557
13541
|
let win = body.ownerDocument.defaultView, reduced = win.matchMedia("(prefers-reduced-motion: reduce)"), leavers = /* @__PURE__ */ new Map, arrivals = /* @__PURE__ */ new Map, moves = /* @__PURE__ */ new Map, heights = /* @__PURE__ */ new Map, wanted = /* @__PURE__ */ new Map, raf = 0, then = 0, held = 0, spring = (x, m, eps) => new Spring(x, m.omega, m.zeta, eps), opacityOf = (node) => Number(win.getComputedStyle(node).opacity) || 1, outermost = (nodes) => nodes.filter((node) => !nodes.some((other) => other !== node && other.contains(node))), showing = (node) => !node.hidden && !leavers.has(node), units = () => {
|
|
13558
13542
|
let out = [];
|
|
@@ -13887,7 +13871,7 @@ function createLens(o) {
|
|
|
13887
13871
|
}, all = (r) => [r, r, r, r], panelBox = (inset) => {
|
|
13888
13872
|
let r = root.getBoundingClientRect();
|
|
13889
13873
|
if (o.page) {
|
|
13890
|
-
let top = Math.max(r.top, o.header?.getBoundingClientRect().bottom ?? 0), bottom = Math.min(r.bottom, win?.innerHeight ?? r.bottom), pad = 8 + inset, radius = parseFloat(getComputedStyle(root).getPropertyValue("--kt-panel
|
|
13874
|
+
let top = Math.max(r.top, o.header?.getBoundingClientRect().bottom ?? 0), bottom = Math.min(r.bottom, win?.innerHeight ?? r.bottom), pad = 8 + inset, radius = parseFloat(getComputedStyle(root).getPropertyValue("--kt-radius-panel")) || 0;
|
|
13891
13875
|
return {
|
|
13892
13876
|
x: r.left + pad,
|
|
13893
13877
|
y: top + pad,
|
|
@@ -14192,13 +14176,15 @@ function morphFromChip(chip, root, wake, restored) {
|
|
|
14192
14176
|
}, ensureShape = () => {
|
|
14193
14177
|
if (shape)
|
|
14194
14178
|
return shape;
|
|
14195
|
-
let cs = getComputedStyle(root), r = parseFloat(cs.getPropertyValue("--kv-panel
|
|
14179
|
+
let cs = getComputedStyle(root), r = parseFloat(cs.getPropertyValue("--kv-radius-panel"));
|
|
14196
14180
|
if (Number.isFinite(r))
|
|
14197
14181
|
panelRadius = r;
|
|
14198
|
-
shape = doc.createElement("div"), shape.className = "knobs-morph", shape.setAttribute("aria-hidden", "true");
|
|
14199
|
-
for (let t of ["bg", "
|
|
14182
|
+
shape = doc.createElement("div"), shape.className = "knobs-root knobs-morph", shape.setAttribute("aria-hidden", "true");
|
|
14183
|
+
for (let t of ["bg", "border", "rim", "border-subtle", "glass", "glass-tone"])
|
|
14200
14184
|
shape.style.setProperty(`--kv-${t}`, cs.getPropertyValue(`--kv-${t}`));
|
|
14201
|
-
|
|
14185
|
+
for (let t of ["--_k-shadow-overlay", "--_k-shadow-k", "--_k-light"])
|
|
14186
|
+
shape.style.setProperty(t, cs.getPropertyValue(t));
|
|
14187
|
+
return shape.style.colorScheme = cs.colorScheme, root.before(shape), root.style.animation = "none", root.dataset.morphing = "", chip.dataset.morph = "", shape;
|
|
14202
14188
|
}, clear = () => {
|
|
14203
14189
|
shape?.remove(), shape = void 0, delete root.dataset.morphing;
|
|
14204
14190
|
for (let name of [
|
|
@@ -14388,7 +14374,7 @@ function positionPanel(panel, header, anchor, id, storage) {
|
|
|
14388
14374
|
}
|
|
14389
14375
|
|
|
14390
14376
|
// src/panel/presence.ts
|
|
14391
|
-
var EXIT = springMotion2(
|
|
14377
|
+
var EXIT = springMotion2(SPRINGS2.snappy), ENTER = springMotion2(SPRINGS2.default), FADE2 = springMotion2(FADE), BLUR2 = 4, SCALE = 0.96, LEAD2 = 0.4, FOLDED = [
|
|
14392
14378
|
"height",
|
|
14393
14379
|
"min-height",
|
|
14394
14380
|
"flex",
|
|
@@ -14469,7 +14455,7 @@ function createPresence(root, options) {
|
|
|
14469
14455
|
raf = 0, spring.snap(next ? 1 : 0), settle();
|
|
14470
14456
|
return;
|
|
14471
14457
|
}
|
|
14472
|
-
let m = reduced ?
|
|
14458
|
+
let m = reduced ? FADE2 : next ? ENTER : EXIT;
|
|
14473
14459
|
if (spring.omega = m.omega, spring.zeta = m.zeta, spring.set(next ? 1 : 0), root.dataset.presence = next ? "in" : "out", apply(spring.x), !raf)
|
|
14474
14460
|
last = performance.now(), raf = win.requestAnimationFrame(tick);
|
|
14475
14461
|
options.wake();
|
|
@@ -14478,7 +14464,7 @@ function createPresence(root, options) {
|
|
|
14478
14464
|
if (!root.dataset.presence || root.hidden)
|
|
14479
14465
|
return;
|
|
14480
14466
|
let look = presenceLook(spring.x, inline, reduced), r = root.getBoundingClientRect();
|
|
14481
|
-
radius ??= parseFloat(win.getComputedStyle(root).getPropertyValue("--kv-panel
|
|
14467
|
+
radius ??= parseFloat(win.getComputedStyle(root).getPropertyValue("--kv-radius-panel")) || 12;
|
|
14482
14468
|
let s = look.scale, ox = r.left + r.width / 2, oy = inline ? r.top : r.top + r.height / 2;
|
|
14483
14469
|
return {
|
|
14484
14470
|
x: ox + (r.left - ox) * s,
|
|
@@ -14527,10 +14513,9 @@ function buildPanel(controls, host, options) {
|
|
|
14527
14513
|
node.textContent = text;
|
|
14528
14514
|
return node;
|
|
14529
14515
|
}, inline = Boolean(options.inline), page = options.page, close = options.close ?? options.onClose, root = el(page ? "div" : "aside");
|
|
14530
|
-
root.className = page ? "knobs-panel knobs-inline knobs-page" : inline ? "knobs-panel knobs-inline" : "knobs-panel", root.dataset.controls = controls.id;
|
|
14516
|
+
root.className = page ? "knobs-root knobs-panel knobs-inline knobs-page" : inline ? "knobs-root knobs-panel knobs-inline" : "knobs-root knobs-panel", root.dataset.controls = controls.id;
|
|
14531
14517
|
let untrackHas = trackHas(root);
|
|
14532
|
-
|
|
14533
|
-
injectPreset(doc, options.preset), root.dataset.preset = options.preset.name;
|
|
14518
|
+
applyLook(root, panelLook(controls, options)), root.dataset.density = options.density ?? controls.density;
|
|
14534
14519
|
let titleText = options.title === void 0 ? controls.id : options.title, toggleKey = options.toggleKey !== void 0 ? options.toggleKey : page ? !1 : controls.toggleKey;
|
|
14535
14520
|
if (options.restored)
|
|
14536
14521
|
root.dataset.restored = "";
|
|
@@ -17387,7 +17372,14 @@ function buildPanel(controls, host, options) {
|
|
|
17387
17372
|
}, rowsObserver = new MutationObserver(syncRows);
|
|
17388
17373
|
rowsObserver.observe(root, {
|
|
17389
17374
|
attributes: !0,
|
|
17390
|
-
attributeFilter: [
|
|
17375
|
+
attributeFilter: [
|
|
17376
|
+
"style",
|
|
17377
|
+
"class",
|
|
17378
|
+
"data-appearance",
|
|
17379
|
+
"data-knobs-theme",
|
|
17380
|
+
"data-preset",
|
|
17381
|
+
"data-density"
|
|
17382
|
+
]
|
|
17391
17383
|
}), syncRows(), layoutRows(!1);
|
|
17392
17384
|
let unsubscribe = controls.subscribe(update), unlisten = readoutPort?.listen((key) => readouts.get(key)?.notify()), gpuObserver = new MutationObserver(() => {
|
|
17393
17385
|
for (let r of readouts.values())
|
|
@@ -17486,7 +17478,7 @@ function buildPanel(controls, host, options) {
|
|
|
17486
17478
|
});
|
|
17487
17479
|
modeObserver.observe(doc.documentElement, {
|
|
17488
17480
|
attributes: !0,
|
|
17489
|
-
attributeFilter: ["data-knobs-renderer", "data-theme", "style"]
|
|
17481
|
+
attributeFilter: ["data-knobs-renderer", "data-theme", "data-appearance", "class", "style"]
|
|
17490
17482
|
});
|
|
17491
17483
|
let panel = {
|
|
17492
17484
|
element: root,
|