@stnd/lab 1.6.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/Lab.svelte +196 -119
- package/README.md +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @stnd/lab
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Auto-bumped @stnd/lab due to modified code.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @stnd/ui@0.16.2
|
|
12
|
+
|
|
13
|
+
## 1.7.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- Auto-bumped @stnd/lab due to modified code.
|
|
18
|
+
|
|
3
19
|
## 1.6.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/Lab.svelte
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
} from "./color.js";
|
|
25
25
|
|
|
26
26
|
// Sidebar transition parameters (defaults)
|
|
27
|
-
let sidebarDuration = $state(
|
|
27
|
+
let sidebarDuration = $state(220); // milliseconds
|
|
28
28
|
let customEasing = $state(bezier(0.22, 1, 0.36, 1));
|
|
29
29
|
|
|
30
30
|
// =========================================================================
|
|
@@ -157,12 +157,27 @@
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
let openTimer;
|
|
161
|
+
|
|
160
162
|
function openLab() {
|
|
161
163
|
clearTimeout(closeTimer);
|
|
164
|
+
clearTimeout(openTimer);
|
|
162
165
|
view = "open";
|
|
163
166
|
}
|
|
164
167
|
|
|
168
|
+
function hoverOpenLab() {
|
|
169
|
+
if (typeof window !== "undefined" && !window.matchMedia("(hover: hover) and (pointer: fine)").matches) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
clearTimeout(closeTimer);
|
|
173
|
+
clearTimeout(openTimer);
|
|
174
|
+
openTimer = setTimeout(() => {
|
|
175
|
+
view = "open";
|
|
176
|
+
}, 120);
|
|
177
|
+
}
|
|
178
|
+
|
|
165
179
|
function requestCloseLab() {
|
|
180
|
+
clearTimeout(openTimer);
|
|
166
181
|
if (pinned || activePicker || isDraggingPlane) return;
|
|
167
182
|
// Keep open if user is interacting with inputs or popovers inside
|
|
168
183
|
if (
|
|
@@ -177,13 +192,29 @@
|
|
|
177
192
|
clearTimeout(closeTimer);
|
|
178
193
|
closeTimer = setTimeout(() => {
|
|
179
194
|
view = "dormant";
|
|
180
|
-
},
|
|
195
|
+
}, 280);
|
|
181
196
|
}
|
|
182
197
|
|
|
183
198
|
function cancelCloseLab() {
|
|
199
|
+
clearTimeout(openTimer);
|
|
184
200
|
clearTimeout(closeTimer);
|
|
185
201
|
}
|
|
186
202
|
|
|
203
|
+
function togglePinned() {
|
|
204
|
+
pinned = !pinned;
|
|
205
|
+
try {
|
|
206
|
+
sessionStorage.setItem("stnd-pinned", String(pinned));
|
|
207
|
+
} catch {}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function collapseLab() {
|
|
211
|
+
pinned = false;
|
|
212
|
+
try {
|
|
213
|
+
sessionStorage.setItem("stnd-pinned", "false");
|
|
214
|
+
} catch {}
|
|
215
|
+
view = "dormant";
|
|
216
|
+
}
|
|
217
|
+
|
|
187
218
|
let modified = $state(new Set());
|
|
188
219
|
let version = $state("");
|
|
189
220
|
let viewportW = $state(0);
|
|
@@ -461,9 +492,11 @@
|
|
|
461
492
|
"--font-interface",
|
|
462
493
|
"--font-monospace",
|
|
463
494
|
"--font-text-size",
|
|
464
|
-
"--
|
|
495
|
+
"--density",
|
|
496
|
+
"--ratio",
|
|
465
497
|
"--optical-ratio",
|
|
466
498
|
"--page-padding",
|
|
499
|
+
"--reading-width",
|
|
467
500
|
"--rhythm-block-scale",
|
|
468
501
|
"--radius",
|
|
469
502
|
];
|
|
@@ -523,9 +556,11 @@
|
|
|
523
556
|
"--font-interface",
|
|
524
557
|
"--font-monospace",
|
|
525
558
|
"--font-text-size",
|
|
526
|
-
"--
|
|
559
|
+
"--density",
|
|
560
|
+
"--ratio",
|
|
527
561
|
"--optical-ratio",
|
|
528
562
|
"--page-padding",
|
|
563
|
+
"--reading-width",
|
|
529
564
|
"--rhythm-block-scale",
|
|
530
565
|
"--radius",
|
|
531
566
|
];
|
|
@@ -764,6 +799,23 @@
|
|
|
764
799
|
// Keyboard shortcuts
|
|
765
800
|
function onKey(e) {
|
|
766
801
|
const mod = navigator.platform.includes("Mac") ? e.metaKey : e.ctrlKey;
|
|
802
|
+
const el = document.activeElement;
|
|
803
|
+
const typing =
|
|
804
|
+
!!el && (["INPUT", "TEXTAREA", "SELECT"].includes(el.tagName) || el.isContentEditable);
|
|
805
|
+
|
|
806
|
+
// Right-sidebar shortcut `]` when not typing
|
|
807
|
+
if (!typing && !e.metaKey && !e.ctrlKey && !e.altKey && e.key === "]") {
|
|
808
|
+
e.preventDefault();
|
|
809
|
+
if (view === "dormant") {
|
|
810
|
+
view = "open";
|
|
811
|
+
pinned = true;
|
|
812
|
+
} else if (!pinned) {
|
|
813
|
+
pinned = true;
|
|
814
|
+
} else {
|
|
815
|
+
collapseLab();
|
|
816
|
+
}
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
767
819
|
|
|
768
820
|
// Toggle lab with Cmd/Ctrl+S (override default save shortcut)
|
|
769
821
|
if (mod && !e.shiftKey && e.key.toLowerCase() === "s") {
|
|
@@ -811,6 +863,7 @@
|
|
|
811
863
|
if (view !== "open" || pinned) return;
|
|
812
864
|
if (sidebarEl && e.composedPath().includes(sidebarEl)) return;
|
|
813
865
|
if (
|
|
866
|
+
e.target.closest?.(".lab-open-btn") ||
|
|
814
867
|
e.target.closest?.(".lab-handler") ||
|
|
815
868
|
e.target.closest?.(".lab-handler-top")
|
|
816
869
|
)
|
|
@@ -856,13 +909,12 @@
|
|
|
856
909
|
// EFFECTS
|
|
857
910
|
// =========================================================================
|
|
858
911
|
|
|
859
|
-
//
|
|
860
|
-
// Shrink the page when the sidebar is open (like DevTools)
|
|
912
|
+
// Shrink the page only when the Lab is pinned open on wide screens
|
|
861
913
|
$effect(() => {
|
|
862
914
|
if (duplicate) return;
|
|
863
915
|
if (typeof document === "undefined") return;
|
|
864
916
|
const el = document.documentElement;
|
|
865
|
-
if (view === "open") {
|
|
917
|
+
if (view === "open" && pinned) {
|
|
866
918
|
el.classList.add("lab-open");
|
|
867
919
|
} else {
|
|
868
920
|
el.classList.remove("lab-open");
|
|
@@ -938,10 +990,12 @@
|
|
|
938
990
|
"--font-monospace",
|
|
939
991
|
"--font-text-size",
|
|
940
992
|
"--font-size",
|
|
941
|
-
"--
|
|
993
|
+
"--density",
|
|
994
|
+
"--ratio",
|
|
942
995
|
"--line-height",
|
|
943
996
|
"--optical-ratio",
|
|
944
997
|
"--page-padding",
|
|
998
|
+
"--reading-width",
|
|
945
999
|
"--rhythm-block-scale",
|
|
946
1000
|
"--rhythm-gap-new-line",
|
|
947
1001
|
"--radius",
|
|
@@ -1108,11 +1162,13 @@
|
|
|
1108
1162
|
|
|
1109
1163
|
function onLineHeightInput(e) {
|
|
1110
1164
|
lineHeight = parseFloat(e.target.value);
|
|
1111
|
-
writeVar("--
|
|
1165
|
+
writeVar("--density", String(lineHeight));
|
|
1166
|
+
writeVar("--line-height", String(lineHeight));
|
|
1112
1167
|
}
|
|
1113
1168
|
|
|
1114
1169
|
function onRatioInput(e) {
|
|
1115
1170
|
ratio = parseFloat(e.target.value);
|
|
1171
|
+
writeVar("--ratio", String(ratio));
|
|
1116
1172
|
writeVar("--optical-ratio", String(ratio));
|
|
1117
1173
|
}
|
|
1118
1174
|
|
|
@@ -1223,61 +1279,81 @@
|
|
|
1223
1279
|
|
|
1224
1280
|
{#if !duplicate}
|
|
1225
1281
|
<!-- ======================================================================
|
|
1226
|
-
TRIGGER
|
|
1282
|
+
TOP-RIGHT STICKY FLASK TRIGGER (Right Sidebar Minimized Mode)
|
|
1227
1283
|
====================================================================== -->
|
|
1228
|
-
{#if handlerVisible}
|
|
1229
|
-
<
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
tabindex="0"
|
|
1233
|
-
aria-label="Open Design Lab"
|
|
1234
|
-
onmouseenter={openLab}
|
|
1235
|
-
onmouseleave={requestCloseLab}
|
|
1236
|
-
onclick={() => (view = view === "dormant" ? "open" : "dormant")}
|
|
1237
|
-
onkeydown={(e) => e.key === "Enter" && (view = "open")}
|
|
1238
|
-
>
|
|
1239
|
-
<div class="lab-dot"></div>
|
|
1240
|
-
</div>
|
|
1241
|
-
|
|
1242
|
-
<div
|
|
1243
|
-
class="lab-handler m-0"
|
|
1244
|
-
class:scrolling={isScrolling}
|
|
1284
|
+
{#if handlerVisible && view === "dormant"}
|
|
1285
|
+
<button
|
|
1286
|
+
type="button"
|
|
1287
|
+
class="item lab-open-btn m-0"
|
|
1245
1288
|
class:modified={modCount > 0}
|
|
1246
|
-
onmouseenter={openLab}
|
|
1247
|
-
onmouseleave={requestCloseLab}
|
|
1248
|
-
role="button"
|
|
1249
|
-
tabindex="0"
|
|
1250
1289
|
aria-label="Open Design Lab"
|
|
1251
|
-
|
|
1252
|
-
|
|
1290
|
+
title="Open Design Lab ( ] )"
|
|
1291
|
+
onpointerenter={hoverOpenLab}
|
|
1292
|
+
onpointerleave={requestCloseLab}
|
|
1293
|
+
onclick={() => {
|
|
1294
|
+
clearTimeout(openTimer);
|
|
1295
|
+
view = "open";
|
|
1296
|
+
pinned = true;
|
|
1297
|
+
try {
|
|
1298
|
+
sessionStorage.setItem("stnd-pinned", "true");
|
|
1299
|
+
} catch {}
|
|
1300
|
+
}}
|
|
1253
1301
|
>
|
|
1254
|
-
<
|
|
1255
|
-
|
|
1302
|
+
<svg
|
|
1303
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1304
|
+
width="1.25em"
|
|
1305
|
+
height="1.25em"
|
|
1306
|
+
viewBox="0 0 256 256"
|
|
1307
|
+
fill="currentColor"
|
|
1308
|
+
aria-hidden="true"
|
|
1309
|
+
>
|
|
1310
|
+
<path
|
|
1311
|
+
d="M221.6,199.77,160,96.92V40h8a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16h8V96.92L34.4,199.77A16,16,0,0,0,48.13,224H207.87a16,16,0,0,0,13.73-24.23ZM110.86,103.25A7.93,7.93,0,0,0,112,99.14V40h32V99.14a7.93,7.93,0,0,0,1.14,4.11L183.36,167c-12.19,2.31-26.07-.37-41.19-8.19-19-9.82-35.87-12.48-50.25-8.23ZM48.13,208l24.51-40.91c11.79-4.76,25.75-2.66,43.1,6.31,15.65,8.09,30.12,11.66,43.18,10.67a63.36,63.36,0,0,0,15.46-3L207.87,208Z"
|
|
1312
|
+
/>
|
|
1313
|
+
</svg>
|
|
1314
|
+
{#if modCount > 0}
|
|
1315
|
+
<span class="lab-mod-dot" title="{modCount} active override(s)"></span>
|
|
1316
|
+
{/if}
|
|
1317
|
+
</button>
|
|
1256
1318
|
{/if}
|
|
1257
1319
|
|
|
1258
1320
|
<!-- ======================================================================
|
|
1259
|
-
|
|
1321
|
+
RIGHT SIDEBAR PANE
|
|
1260
1322
|
====================================================================== -->
|
|
1261
1323
|
{#if view === "open"}
|
|
1262
1324
|
<div
|
|
1263
1325
|
bind:this={sidebarEl}
|
|
1264
1326
|
transition:fly={{
|
|
1265
|
-
x:
|
|
1327
|
+
x: 340,
|
|
1266
1328
|
duration: sidebarDuration,
|
|
1267
1329
|
easing: customEasing,
|
|
1268
1330
|
opacity: false,
|
|
1269
1331
|
}}
|
|
1270
|
-
class="lab-sidebar no-rhythm mt-0"
|
|
1332
|
+
class="pane lab-sidebar no-rhythm mt-0"
|
|
1333
|
+
data-pinned={pinned ? "" : undefined}
|
|
1271
1334
|
role="dialog"
|
|
1272
1335
|
tabindex="-1"
|
|
1273
1336
|
aria-label="Design Lab"
|
|
1274
|
-
|
|
1275
|
-
|
|
1337
|
+
onpointerenter={cancelCloseLab}
|
|
1338
|
+
onpointerleave={requestCloseLab}
|
|
1276
1339
|
>
|
|
1277
1340
|
<!-- ═══════════ HEADER ═══════════ -->
|
|
1278
1341
|
<header class="lab-header">
|
|
1279
1342
|
<div class="lab-header-title">
|
|
1280
|
-
<
|
|
1343
|
+
<svg
|
|
1344
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1345
|
+
width="1.15em"
|
|
1346
|
+
height="1.15em"
|
|
1347
|
+
viewBox="0 0 256 256"
|
|
1348
|
+
fill="currentColor"
|
|
1349
|
+
class="lab-flask-mark"
|
|
1350
|
+
aria-hidden="true"
|
|
1351
|
+
>
|
|
1352
|
+
<path
|
|
1353
|
+
d="M221.6,199.77,160,96.92V40h8a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16h8V96.92L34.4,199.77A16,16,0,0,0,48.13,224H207.87a16,16,0,0,0,13.73-24.23ZM110.86,103.25A7.93,7.93,0,0,0,112,99.14V40h32V99.14a7.93,7.93,0,0,0,1.14,4.11L183.36,167c-12.19,2.31-26.07-.37-41.19-8.19-19-9.82-35.87-12.48-50.25-8.23ZM48.13,208l24.51-40.91c11.79-4.76,25.75-2.66,43.1,6.31,15.65,8.09,30.12,11.66,43.18,10.67a63.36,63.36,0,0,0,15.46-3L207.87,208Z"
|
|
1354
|
+
/>
|
|
1355
|
+
</svg>
|
|
1356
|
+
<h2>stnd lab</h2>
|
|
1281
1357
|
{#if version}<span class="lab-version">v{version}</span>{/if}
|
|
1282
1358
|
</div>
|
|
1283
1359
|
<div class="lab-header-meta">
|
|
@@ -1300,16 +1376,17 @@
|
|
|
1300
1376
|
|
|
1301
1377
|
<button
|
|
1302
1378
|
class="smaller icon ghost"
|
|
1303
|
-
onclick={
|
|
1304
|
-
aria-label={pinned ? "Unpin Lab" : "Pin Lab"}
|
|
1305
|
-
title={pinned ? "
|
|
1379
|
+
onclick={togglePinned}
|
|
1380
|
+
aria-label={pinned ? "Unpin Lab (hover peek mode)" : "Pin Lab open"}
|
|
1381
|
+
title={pinned ? "Pinned open — click to switch to hover peek" : "Hover peek — click to pin open"}
|
|
1306
1382
|
>
|
|
1307
1383
|
{pinned ? "●" : "○"}
|
|
1308
1384
|
</button>
|
|
1309
1385
|
<button
|
|
1310
1386
|
class="smaller icon ghost"
|
|
1311
|
-
onclick={
|
|
1312
|
-
aria-label="
|
|
1387
|
+
onclick={collapseLab}
|
|
1388
|
+
aria-label="Minimize Lab to top-right icon"
|
|
1389
|
+
title="Collapse Lab ( ] )"
|
|
1313
1390
|
>
|
|
1314
1391
|
✕
|
|
1315
1392
|
</button>
|
|
@@ -1685,11 +1762,11 @@
|
|
|
1685
1762
|
</div>
|
|
1686
1763
|
<div class="lab-field">
|
|
1687
1764
|
<label class="lab-field-label" for="lab-line-height"
|
|
1688
|
-
>
|
|
1765
|
+
>Density</label
|
|
1689
1766
|
>
|
|
1690
1767
|
<div class="lab-slider-wrapper">
|
|
1691
1768
|
<input
|
|
1692
|
-
id="lab-line-height" title="--
|
|
1769
|
+
id="lab-line-height" title="--density: sets vertical cadence and line-height (1.35 to 1.75)"
|
|
1693
1770
|
type="range"
|
|
1694
1771
|
class="lab-range"
|
|
1695
1772
|
value={lineHeight}
|
|
@@ -1703,11 +1780,11 @@
|
|
|
1703
1780
|
</div>
|
|
1704
1781
|
<div class="lab-field">
|
|
1705
1782
|
<label class="lab-field-label" for="lab-ratio"
|
|
1706
|
-
>
|
|
1783
|
+
>Ratio</label
|
|
1707
1784
|
>
|
|
1708
1785
|
<div class="lab-slider-wrapper">
|
|
1709
1786
|
<input
|
|
1710
|
-
id="lab-ratio"
|
|
1787
|
+
id="lab-ratio" title="--ratio: modular scale factor"
|
|
1711
1788
|
type="range"
|
|
1712
1789
|
class="lab-range"
|
|
1713
1790
|
value={ratio}
|
|
@@ -1877,10 +1954,12 @@
|
|
|
1877
1954
|
STYLES — Fully scoped, isolated from design tokens
|
|
1878
1955
|
====================================================================== -->
|
|
1879
1956
|
<style>
|
|
1880
|
-
/* ═══════════ PAGE SHRINK (
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1957
|
+
/* ═══════════ PAGE SHRINK (only when pinned on wide screens) ═══════════ */
|
|
1958
|
+
@media (min-width: 1025px) {
|
|
1959
|
+
:global(html.lab-open) {
|
|
1960
|
+
margin-right: calc(var(--lab-sidebar-w, 304px) + var(--window-inset, 8px) * 2);
|
|
1961
|
+
transition: margin-right var(--transition);
|
|
1962
|
+
}
|
|
1884
1963
|
}
|
|
1885
1964
|
:global(html:not(.lab-open)) {
|
|
1886
1965
|
transition: margin-right var(--transition);
|
|
@@ -1889,89 +1968,82 @@
|
|
|
1889
1968
|
/* ═══════════ DESIGN CONSTANTS ═══════════ */
|
|
1890
1969
|
:root {
|
|
1891
1970
|
--lab-font-size: 12px;
|
|
1892
|
-
--lab-sidebar-w:
|
|
1971
|
+
--lab-sidebar-w: 304px;
|
|
1893
1972
|
}
|
|
1894
1973
|
|
|
1895
|
-
/* ═══════════
|
|
1896
|
-
:global(:root[data-lab-handler="false"]) .lab-
|
|
1897
|
-
:global(:root[data-lab-handler
|
|
1898
|
-
:global(:root[data-lab-no-handler]) .lab-handler,
|
|
1899
|
-
:global(:root[data-lab-no-handler]) .lab-handler-top {
|
|
1974
|
+
/* ═══════════ TOP-RIGHT STICKY FLASK TRIGGER ═══════════ */
|
|
1975
|
+
:global(:root[data-lab-handler="false"]) .lab-open-btn,
|
|
1976
|
+
:global(:root[data-lab-no-handler]) .lab-open-btn {
|
|
1900
1977
|
display: none !important;
|
|
1901
1978
|
pointer-events: none !important;
|
|
1902
1979
|
}
|
|
1903
1980
|
|
|
1904
|
-
.lab-
|
|
1905
|
-
position: fixed;
|
|
1906
|
-
z-index: 200;
|
|
1907
|
-
top: 0;
|
|
1908
|
-
right: 0;
|
|
1909
|
-
padding: var(--space-2);
|
|
1910
|
-
cursor: pointer;
|
|
1911
|
-
opacity: 0.1;
|
|
1912
|
-
transition: opacity var(--transition);
|
|
1913
|
-
display: none;
|
|
1914
|
-
}
|
|
1915
|
-
.lab-handler-top:hover {
|
|
1916
|
-
opacity: 1;
|
|
1917
|
-
}
|
|
1918
|
-
.lab-dot {
|
|
1919
|
-
width: var(--space-d4);
|
|
1920
|
-
height: var(--space-d4);
|
|
1921
|
-
background: var(--color-foreground);
|
|
1922
|
-
border-radius: 50%;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
.lab-handler {
|
|
1981
|
+
.lab-open-btn {
|
|
1926
1982
|
position: fixed;
|
|
1927
|
-
z-index:
|
|
1928
|
-
top:
|
|
1929
|
-
right:
|
|
1930
|
-
|
|
1931
|
-
padding-right: 20px;
|
|
1932
|
-
cursor: normal;
|
|
1933
|
-
display: flex;
|
|
1934
|
-
flex-direction: row;
|
|
1983
|
+
z-index: 9991;
|
|
1984
|
+
top: calc(var(--window-inset, 8px) + env(safe-area-inset-top, 0px));
|
|
1985
|
+
right: calc(var(--window-inset, 8px) + env(safe-area-inset-right, 0px));
|
|
1986
|
+
display: inline-flex;
|
|
1935
1987
|
align-items: center;
|
|
1936
|
-
|
|
1988
|
+
justify-content: center;
|
|
1989
|
+
width: calc(var(--space) * 1.5);
|
|
1990
|
+
height: calc(var(--space) * 1.5);
|
|
1991
|
+
padding: 0;
|
|
1992
|
+
border: none;
|
|
1993
|
+
border-radius: var(--radius-sm);
|
|
1994
|
+
background: var(--color-surface-raised);
|
|
1995
|
+
color: var(--color-muted);
|
|
1996
|
+
box-shadow: var(--shadow), var(--pane-edge);
|
|
1997
|
+
cursor: pointer;
|
|
1998
|
+
transition:
|
|
1999
|
+
color var(--transition-fast),
|
|
2000
|
+
background var(--transition-fast),
|
|
2001
|
+
transform var(--transition-fast),
|
|
2002
|
+
box-shadow var(--transition-fast);
|
|
1937
2003
|
}
|
|
1938
|
-
.lab-
|
|
1939
|
-
|
|
2004
|
+
.lab-open-btn:hover {
|
|
2005
|
+
color: var(--color-foreground);
|
|
2006
|
+
background: var(--color-surface-overlay);
|
|
2007
|
+
box-shadow: var(--shadow-lg), var(--pane-edge);
|
|
1940
2008
|
}
|
|
1941
|
-
.lab-
|
|
1942
|
-
|
|
1943
|
-
height: var(--space-2);
|
|
1944
|
-
background: oklch(from var(--color-foreground) l c h / 0);
|
|
1945
|
-
border-radius: var(--radius);
|
|
1946
|
-
box-shadow: var(--shadow-inset) var(--shadow-ring);
|
|
1947
|
-
transition: all var(--transition);
|
|
1948
|
-
cursor: normal;
|
|
1949
|
-
backdrop-filter: var(--filter-glass);
|
|
2009
|
+
.lab-open-btn.modified {
|
|
2010
|
+
color: var(--color-accent);
|
|
1950
2011
|
}
|
|
1951
|
-
.lab-
|
|
1952
|
-
|
|
2012
|
+
.lab-mod-dot {
|
|
2013
|
+
position: absolute;
|
|
2014
|
+
top: 4px;
|
|
2015
|
+
right: 4px;
|
|
2016
|
+
width: 6px;
|
|
2017
|
+
height: 6px;
|
|
2018
|
+
border-radius: 50%;
|
|
2019
|
+
background: var(--color-accent);
|
|
1953
2020
|
}
|
|
1954
2021
|
|
|
1955
|
-
/* ═══════════ SIDEBAR ═══════════ */
|
|
2022
|
+
/* ═══════════ RIGHT SIDEBAR PANE (Reveal Dev Panel geometry) ═══════════ */
|
|
1956
2023
|
.lab-sidebar {
|
|
1957
2024
|
position: fixed;
|
|
1958
2025
|
z-index: 9992;
|
|
1959
|
-
top:
|
|
1960
|
-
right:
|
|
2026
|
+
top: calc(var(--window-inset, 8px) + env(safe-area-inset-top, 0px));
|
|
2027
|
+
right: calc(var(--window-inset, 8px) + env(safe-area-inset-right, 0px));
|
|
1961
2028
|
width: var(--lab-sidebar-w);
|
|
1962
|
-
height:
|
|
2029
|
+
height: calc(
|
|
2030
|
+
100dvh - 2 * var(--window-inset, 8px) - env(safe-area-inset-top, 0px) -
|
|
2031
|
+
env(safe-area-inset-bottom, 0px)
|
|
2032
|
+
);
|
|
2033
|
+
margin: 0;
|
|
2034
|
+
padding: 0;
|
|
1963
2035
|
|
|
1964
2036
|
color: var(--color-foreground);
|
|
1965
2037
|
font: var(--lab-font-size) / 1.5 var(--font-monospace);
|
|
1966
|
-
border-
|
|
2038
|
+
border-radius: var(--pane-radius, 9px);
|
|
1967
2039
|
display: flex;
|
|
1968
2040
|
flex-direction: column;
|
|
1969
|
-
box-shadow: var(--shadow-
|
|
1970
|
-
background: var(--color-surface);
|
|
1971
|
-
backdrop-filter: var(--filter-
|
|
2041
|
+
box-shadow: var(--shadow-overlay), var(--pane-edge);
|
|
2042
|
+
background: var(--color-surface-raised);
|
|
2043
|
+
backdrop-filter: var(--filter-glass);
|
|
2044
|
+
overflow: hidden;
|
|
1972
2045
|
/* Ensure the sidebar stays fully opaque and never animates opacity */
|
|
1973
2046
|
opacity: 1 !important;
|
|
1974
|
-
/* Explicitly disable opacity animation while preserving other transitions */
|
|
1975
2047
|
transition:
|
|
1976
2048
|
transform var(--transition),
|
|
1977
2049
|
box-shadow var(--transition),
|
|
@@ -1986,8 +2058,6 @@
|
|
|
1986
2058
|
/* Reset children to Lab font, allowing explicit font-family previews to win */
|
|
1987
2059
|
.lab-sidebar * {
|
|
1988
2060
|
box-sizing: border-box;
|
|
1989
|
-
/* Disable opacity transitions on child elements to prevent fading when opening the lab.
|
|
1990
|
-
Other property transitions for children remain allowed outside of opacity. */
|
|
1991
2061
|
transition: opacity 0s !important;
|
|
1992
2062
|
}
|
|
1993
2063
|
.lab-sidebar *:not([style*="font-family"]) {
|
|
@@ -2000,19 +2070,22 @@
|
|
|
2000
2070
|
flex-wrap: wrap;
|
|
2001
2071
|
align-items: center;
|
|
2002
2072
|
gap: 0;
|
|
2003
|
-
padding: var(--space-
|
|
2073
|
+
padding: var(--space-d4) var(--space-d2);
|
|
2004
2074
|
border-bottom: var(--border);
|
|
2005
2075
|
flex-shrink: 0;
|
|
2006
|
-
|
|
2007
2076
|
background: var(--color-surface-raised);
|
|
2008
2077
|
}
|
|
2009
2078
|
.lab-header-title {
|
|
2010
2079
|
display: flex;
|
|
2011
2080
|
align-items: center;
|
|
2012
|
-
gap:
|
|
2081
|
+
gap: var(--space-d5);
|
|
2013
2082
|
flex: 1;
|
|
2014
2083
|
min-width: 0;
|
|
2015
2084
|
}
|
|
2085
|
+
.lab-flask-mark {
|
|
2086
|
+
color: var(--color-accent);
|
|
2087
|
+
flex-shrink: 0;
|
|
2088
|
+
}
|
|
2016
2089
|
.lab-header h2 {
|
|
2017
2090
|
font-size: var(--scale-d2) !important;
|
|
2018
2091
|
line-height: 1 !important;
|
|
@@ -2371,11 +2444,15 @@
|
|
|
2371
2444
|
/* ═══════════ RESPONSIVE ═══════════ */
|
|
2372
2445
|
@media (max-width: 480px) {
|
|
2373
2446
|
.lab-sidebar {
|
|
2447
|
+
top: 0;
|
|
2448
|
+
right: 0;
|
|
2374
2449
|
width: 100vw;
|
|
2450
|
+
height: 100dvh;
|
|
2451
|
+
border-radius: 0;
|
|
2375
2452
|
}
|
|
2376
2453
|
}
|
|
2377
2454
|
@media print {
|
|
2378
|
-
.lab-
|
|
2455
|
+
.lab-open-btn,
|
|
2379
2456
|
.lab-sidebar {
|
|
2380
2457
|
display: none !important;
|
|
2381
2458
|
}
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stnd/lab",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"svelte": "./Lab.svelte",
|
|
6
6
|
"author": "Francis Fontaine",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"bezier-easing": "^3.0.1",
|
|
18
18
|
"svelte": "5.57.2",
|
|
19
|
-
"@stnd/ui": "0.16.
|
|
19
|
+
"@stnd/ui": "0.16.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"astro": ">=5.0.0"
|