@floegence/floe-webapp-core 0.52.1 → 0.52.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/FloatingWindow.js +42 -35
- package/dist/floe.css +39 -44
- package/dist/styles/themes/classicSemanticTokens.js +8 -5
- package/dist/styles/themes/presets.d.ts +1 -1
- package/dist/styles/themes/presets.js +35 -27
- package/dist/styles/themes/windowTokens.d.ts +17 -0
- package/dist/styles/themes/windowTokens.js +19 -0
- package/dist/styles.css +1 -1
- package/dist/surface.css +87 -0
- package/dist/themes/dark.css +9 -0
- package/dist/themes/light.css +9 -0
- package/dist/themes/shell-presets.generated.css +132 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createComponent as a, Portal as
|
|
1
|
+
import { createComponent as a, Portal as Te, spread as ce, mergeProps as fe, memo as we, insert as g, effect as c, setAttribute as De, addEventListener as m, className as f, template as u, use as We, delegateEvents as Oe } from "solid-js/web";
|
|
2
2
|
import { createUniqueId as He, createSignal as p, onCleanup as L, onMount as Ye, createEffect as b, Show as S, batch as Ne, untrack as Xe } from "solid-js";
|
|
3
3
|
import { cn as M } from "../../utils/cn.js";
|
|
4
4
|
import { useLayout as Ue } from "../../context/LayoutContext.js";
|
|
@@ -10,21 +10,21 @@ import { resolveFloatingWindowViewport as ge, normalizeFloatingWindowRect as me,
|
|
|
10
10
|
import { createFloatingPresence as Je } from "./floatingPresence.js";
|
|
11
11
|
import { LOCAL_INTERACTION_SURFACE_ATTR as ve } from "./localInteractionSurface.js";
|
|
12
12
|
import { SURFACE_PORTAL_LAYER_ATTR as Ke, SURFACE_FLOATING_LAYER_ATTR as Qe } from "./dialogSurfaceScope.js";
|
|
13
|
-
var et = /* @__PURE__ */
|
|
13
|
+
var et = /* @__PURE__ */ u('<h2 class="text-xs leading-none font-medium truncate select-none">'), tt = /* @__PURE__ */ u('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), nt = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), it = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), ot = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), rt = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), lt = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), st = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), at = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), dt = /* @__PURE__ */ u("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), ut = /* @__PURE__ */ u('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="flex-1 overflow-auto p-3">');
|
|
14
14
|
function St(i) {
|
|
15
|
-
const B = () => i.resizable ?? !0, G = () => i.draggable ?? !0,
|
|
15
|
+
const B = () => i.resizable ?? !0, G = () => i.draggable ?? !0, k = () => i.minSize ?? {
|
|
16
16
|
width: 200,
|
|
17
17
|
height: 150
|
|
18
|
-
},
|
|
18
|
+
}, T = () => i.maxSize ?? {
|
|
19
19
|
width: 1 / 0,
|
|
20
20
|
height: 1 / 0
|
|
21
|
-
}, x = () => i.viewportInsets ?? {}, pe = () => i.zIndex ?? 100, xe = He(), ze = Ue(), $ = () => ze.isMobile(),
|
|
21
|
+
}, x = () => i.viewportInsets ?? {}, pe = () => i.zIndex ?? 100, xe = He(), ze = Ue(), $ = () => ze.isMobile(), D = 16, j = () => `floating-window-${xe}-title`, [W, ye] = p(i.defaultPosition ?? {
|
|
22
22
|
x: 0,
|
|
23
23
|
y: 0
|
|
24
24
|
}), [O, be] = p(i.defaultSize ?? {
|
|
25
25
|
width: 400,
|
|
26
26
|
height: 300
|
|
27
|
-
}), [
|
|
27
|
+
}), [d, V] = p(!1), [R, Z] = p(!1), [E, J] = p(!1), [Se, H] = p(!1), _ = Je({
|
|
28
28
|
open: () => i.open,
|
|
29
29
|
exitDurationMs: 120
|
|
30
30
|
}), [$e, _e] = p(null);
|
|
@@ -75,7 +75,7 @@ function St(i) {
|
|
|
75
75
|
}, ie = (e) => {
|
|
76
76
|
y = e, l && (l.style.transform = `translate3d(${e.x}px, ${e.y}px, 0)`, l.style.width = `${e.width}px`, l.style.height = `${e.height}px`);
|
|
77
77
|
}, X = () => {
|
|
78
|
-
const e =
|
|
78
|
+
const e = W(), t = O();
|
|
79
79
|
return {
|
|
80
80
|
x: e.x,
|
|
81
81
|
y: e.y,
|
|
@@ -121,15 +121,15 @@ function St(i) {
|
|
|
121
121
|
resizeStartPos: ee,
|
|
122
122
|
resizeStartRect: te,
|
|
123
123
|
resizeHandle: ne,
|
|
124
|
-
minSize:
|
|
125
|
-
maxSize:
|
|
124
|
+
minSize: k(),
|
|
125
|
+
maxSize: T(),
|
|
126
126
|
viewport: {
|
|
127
127
|
width: window.innerWidth,
|
|
128
128
|
height: window.innerHeight
|
|
129
129
|
},
|
|
130
130
|
viewportInsets: x(),
|
|
131
131
|
mobile: $(),
|
|
132
|
-
mobilePadding:
|
|
132
|
+
mobilePadding: D
|
|
133
133
|
})));
|
|
134
134
|
}, F = (e) => {
|
|
135
135
|
if (typeof window > "u") return;
|
|
@@ -137,18 +137,18 @@ function St(i) {
|
|
|
137
137
|
width: window.innerWidth,
|
|
138
138
|
height: window.innerHeight
|
|
139
139
|
};
|
|
140
|
-
if (
|
|
140
|
+
if (d()) {
|
|
141
141
|
P(ge(t, x()));
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
P(me({
|
|
145
145
|
rect: X(),
|
|
146
|
-
minSize:
|
|
147
|
-
maxSize:
|
|
146
|
+
minSize: k(),
|
|
147
|
+
maxSize: T(),
|
|
148
148
|
viewport: t,
|
|
149
149
|
viewportInsets: x(),
|
|
150
150
|
mobile: $(),
|
|
151
|
-
mobilePadding:
|
|
151
|
+
mobilePadding: D,
|
|
152
152
|
center: e?.center ?? !1
|
|
153
153
|
}));
|
|
154
154
|
}, re = (e) => {
|
|
@@ -221,7 +221,7 @@ function St(i) {
|
|
|
221
221
|
s === null ? ie(e) : y = e;
|
|
222
222
|
});
|
|
223
223
|
const Ae = (e) => {
|
|
224
|
-
!G() ||
|
|
224
|
+
!G() || d() || s !== null || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"]') || (e.preventDefault(), s = e.pointerId, v = "drag", Z(!0), K = {
|
|
225
225
|
x: e.clientX,
|
|
226
226
|
y: e.clientY
|
|
227
227
|
}, Q = {
|
|
@@ -231,7 +231,7 @@ function St(i) {
|
|
|
231
231
|
y: e.clientY
|
|
232
232
|
}, N(!0, "grabbing"), se(e));
|
|
233
233
|
}, w = (e) => (t) => {
|
|
234
|
-
!B() ||
|
|
234
|
+
!B() || d() || s !== null || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), t.stopPropagation(), s = t.pointerId, v = "resize", J(!0), ne = e, ee = {
|
|
235
235
|
x: t.clientX,
|
|
236
236
|
y: t.clientY
|
|
237
237
|
}, te = {
|
|
@@ -270,7 +270,7 @@ function St(i) {
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
}, ae = () => {
|
|
273
|
-
if (s !== null && q(!0),
|
|
273
|
+
if (s !== null && q(!0), d()) {
|
|
274
274
|
const t = $e();
|
|
275
275
|
t && P(me({
|
|
276
276
|
rect: {
|
|
@@ -279,15 +279,15 @@ function St(i) {
|
|
|
279
279
|
width: t.size.width,
|
|
280
280
|
height: t.size.height
|
|
281
281
|
},
|
|
282
|
-
minSize:
|
|
283
|
-
maxSize:
|
|
282
|
+
minSize: k(),
|
|
283
|
+
maxSize: T(),
|
|
284
284
|
viewport: {
|
|
285
285
|
width: window.innerWidth,
|
|
286
286
|
height: window.innerHeight
|
|
287
287
|
},
|
|
288
288
|
viewportInsets: x(),
|
|
289
289
|
mobile: $(),
|
|
290
|
-
mobilePadding:
|
|
290
|
+
mobilePadding: D,
|
|
291
291
|
center: !1
|
|
292
292
|
})), V(!1);
|
|
293
293
|
return;
|
|
@@ -306,8 +306,8 @@ function St(i) {
|
|
|
306
306
|
width: window.innerWidth,
|
|
307
307
|
height: window.innerHeight
|
|
308
308
|
}, x())), V(!0);
|
|
309
|
-
}, Le = () => {
|
|
310
|
-
ae();
|
|
309
|
+
}, Le = (e) => {
|
|
310
|
+
e.target?.closest("button") || ae();
|
|
311
311
|
}, Me = (e) => {
|
|
312
312
|
Re(e.target) && Pe();
|
|
313
313
|
}, h = (e) => M("absolute z-10", {
|
|
@@ -325,10 +325,10 @@ function St(i) {
|
|
|
325
325
|
return _.mounted();
|
|
326
326
|
},
|
|
327
327
|
get children() {
|
|
328
|
-
return a(
|
|
328
|
+
return a(Te, {
|
|
329
329
|
get children() {
|
|
330
|
-
var e = ut(), t = e.firstChild, o = t.firstChild, r = o.firstChild, de = r.nextSibling,
|
|
331
|
-
return typeof ue == "function" ?
|
|
330
|
+
var e = ut(), t = e.firstChild, o = t.firstChild, r = o.firstChild, de = r.nextSibling, ke = o.nextSibling, ue = l;
|
|
331
|
+
return typeof ue == "function" ? We(ue, e) : l = e, ce(e, fe({
|
|
332
332
|
get "data-floating-presence"() {
|
|
333
333
|
return _.state();
|
|
334
334
|
},
|
|
@@ -345,7 +345,7 @@ function St(i) {
|
|
|
345
345
|
return {
|
|
346
346
|
width: `${O().width}px`,
|
|
347
347
|
height: `${O().height}px`,
|
|
348
|
-
transform: `translate3d(${
|
|
348
|
+
transform: `translate3d(${W().x}px, ${W().y}px, 0)`,
|
|
349
349
|
"z-index": pe(),
|
|
350
350
|
"will-change": R() ? "transform" : E() ? "transform, width, height" : void 0
|
|
351
351
|
};
|
|
@@ -371,7 +371,12 @@ function St(i) {
|
|
|
371
371
|
[ve]: "true"
|
|
372
372
|
}, {
|
|
373
373
|
get class() {
|
|
374
|
-
return M("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (R() || E()) && "floe-floating-presence--suspended",
|
|
374
|
+
return M("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (R() || E()) && "floe-floating-presence--suspended", d() && "rounded-none", i.class);
|
|
375
|
+
},
|
|
376
|
+
get style() {
|
|
377
|
+
return {
|
|
378
|
+
"border-radius": d() ? "0" : "10px"
|
|
379
|
+
};
|
|
375
380
|
},
|
|
376
381
|
get "data-floating-presence"() {
|
|
377
382
|
return _.state();
|
|
@@ -382,22 +387,23 @@ function St(i) {
|
|
|
382
387
|
},
|
|
383
388
|
get children() {
|
|
384
389
|
var n = et();
|
|
385
|
-
return g(n, () => i.title), c(() =>
|
|
390
|
+
return g(n, () => i.title), c(() => De(n, "id", j())), n;
|
|
386
391
|
}
|
|
387
392
|
})), g(de, a(he, {
|
|
388
393
|
variant: "ghost",
|
|
389
394
|
size: "icon",
|
|
390
|
-
|
|
395
|
+
"data-floe-floating-window-control": "maximize",
|
|
396
|
+
class: "h-full w-9 shrink-0 rounded-none border-0 px-0 active:scale-100",
|
|
391
397
|
onClick: (n) => {
|
|
392
398
|
n.stopPropagation(), ae();
|
|
393
399
|
},
|
|
394
400
|
get "aria-label"() {
|
|
395
|
-
return
|
|
401
|
+
return d() ? "Restore" : "Maximize";
|
|
396
402
|
},
|
|
397
403
|
get children() {
|
|
398
404
|
return a(S, {
|
|
399
405
|
get when() {
|
|
400
|
-
return
|
|
406
|
+
return d();
|
|
401
407
|
},
|
|
402
408
|
get fallback() {
|
|
403
409
|
return a(Be, {
|
|
@@ -414,7 +420,8 @@ function St(i) {
|
|
|
414
420
|
}), null), g(de, a(he, {
|
|
415
421
|
variant: "ghost-destructive",
|
|
416
422
|
size: "icon",
|
|
417
|
-
|
|
423
|
+
"data-floe-floating-window-control": "close",
|
|
424
|
+
class: "h-full w-10 shrink-0 rounded-none border-0 px-0 active:scale-100",
|
|
418
425
|
onClick: (n) => {
|
|
419
426
|
n.stopPropagation(), i.onOpenChange(!1);
|
|
420
427
|
},
|
|
@@ -424,7 +431,7 @@ function St(i) {
|
|
|
424
431
|
class: "w-3.5 h-3.5"
|
|
425
432
|
});
|
|
426
433
|
}
|
|
427
|
-
}), null), g(
|
|
434
|
+
}), null), g(ke, () => i.children), g(t, a(S, {
|
|
428
435
|
get when() {
|
|
429
436
|
return i.footer;
|
|
430
437
|
},
|
|
@@ -434,7 +441,7 @@ function St(i) {
|
|
|
434
441
|
}
|
|
435
442
|
}), null), g(t, a(S, {
|
|
436
443
|
get when() {
|
|
437
|
-
return we(() => !!B())() && !
|
|
444
|
+
return we(() => !!B())() && !d();
|
|
438
445
|
},
|
|
439
446
|
get children() {
|
|
440
447
|
return [(() => {
|
|
@@ -470,7 +477,7 @@ function St(i) {
|
|
|
470
477
|
}
|
|
471
478
|
})];
|
|
472
479
|
}
|
|
473
|
-
}), null), c(() => f(o, M("flex items-center justify-between h-
|
|
480
|
+
}), null), c(() => f(o, M("flex shrink-0 items-center justify-between h-8", "border-b", d() ? "rounded-none" : "rounded-t-md", G() && !d() && "cursor-move"))), e;
|
|
474
481
|
}
|
|
475
482
|
});
|
|
476
483
|
}
|
package/dist/floe.css
CHANGED
|
@@ -357,67 +357,49 @@
|
|
|
357
357
|
contain: layout paint style;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
[data-floe-floating-window-surface='true'] {
|
|
361
|
-
|
|
362
|
-
|
|
360
|
+
[data-floe-floating-window-surface='true'].floe-floating-window-motion {
|
|
361
|
+
/* Floating windows use an opaque Mica-like stack in every surface mode.
|
|
362
|
+
* Keeping this on the component boundary makes the default (standard)
|
|
363
|
+
* path match the opt-in material without changing other controls. */
|
|
364
|
+
background-color: var(--card);
|
|
365
|
+
border-color: color-mix(in srgb, var(--border) 78%, var(--background) 22%);
|
|
366
|
+
border-radius: 10px;
|
|
363
367
|
box-shadow:
|
|
364
|
-
0
|
|
365
|
-
0 3px
|
|
366
|
-
|
|
367
|
-
border-color 140ms ease,
|
|
368
|
-
box-shadow 140ms ease,
|
|
369
|
-
background-color 140ms ease;
|
|
368
|
+
0 12px 28px -8px color-mix(in srgb, var(--foreground) 18%, transparent),
|
|
369
|
+
0 3px 8px -2px color-mix(in srgb, var(--foreground) 12%, transparent),
|
|
370
|
+
inset 0 1px 0 rgb(255 255 255 / 45%);
|
|
370
371
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
[data-floe-floating-window-surface='true'] {
|
|
374
|
-
backdrop-filter: blur(12px);
|
|
375
|
-
background-color: color-mix(in srgb, var(--card) 90%, transparent);
|
|
376
|
-
}
|
|
372
|
+
[data-floe-floating-window-surface='true'] {
|
|
373
|
+
border-radius: 10px;
|
|
377
374
|
}
|
|
378
375
|
|
|
379
376
|
[data-floe-floating-window-surface='true'][data-floe-floating-window-state='active'] {
|
|
380
|
-
border-color: color-mix(in srgb, var(--border)
|
|
381
|
-
box-shadow:
|
|
382
|
-
0 22px 48px color-mix(in srgb, var(--foreground) 16%, transparent),
|
|
383
|
-
0 5px 14px color-mix(in srgb, var(--foreground) 12%, transparent),
|
|
384
|
-
0 0 0 1px color-mix(in srgb, var(--ring) 22%, transparent);
|
|
377
|
+
border-color: color-mix(in srgb, var(--border) 60%, var(--ring) 40%);
|
|
385
378
|
}
|
|
386
379
|
|
|
387
380
|
[data-floe-floating-window-surface='true'][data-floe-floating-window-state='inactive'] {
|
|
388
|
-
border-color: color-mix(in srgb, var(--border)
|
|
389
|
-
box-shadow:
|
|
390
|
-
0 12px 28px color-mix(in srgb, var(--foreground) 10%, transparent),
|
|
391
|
-
0 2px 6px color-mix(in srgb, var(--foreground) 8%, transparent);
|
|
381
|
+
border-color: color-mix(in srgb, var(--border) 88%, var(--background) 12%);
|
|
392
382
|
}
|
|
393
383
|
|
|
394
384
|
[data-floe-floating-window-titlebar='true'] {
|
|
395
|
-
background:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
385
|
+
background-color: color-mix(in srgb, var(--muted) 70%, var(--card) 30%);
|
|
386
|
+
border-bottom-color: color-mix(in srgb, var(--border) 70%, var(--background) 30%);
|
|
387
|
+
transition: none;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
:root.dark [data-floe-floating-window-surface='true'] {
|
|
391
|
+
box-shadow:
|
|
392
|
+
0 12px 28px -8px color-mix(in srgb, var(--foreground) 24%, transparent),
|
|
393
|
+
0 3px 8px -2px color-mix(in srgb, var(--foreground) 18%, transparent),
|
|
394
|
+
inset 0 1px 0 rgb(255 255 255 / 8%);
|
|
403
395
|
}
|
|
404
396
|
|
|
405
397
|
[data-floe-floating-window-surface='true'][data-floe-floating-window-state='active'] [data-floe-floating-window-titlebar='true'] {
|
|
406
|
-
background:
|
|
407
|
-
linear-gradient(
|
|
408
|
-
180deg,
|
|
409
|
-
color-mix(in srgb, var(--accent) 62%, var(--muted) 38%),
|
|
410
|
-
color-mix(in srgb, var(--muted) 52%, var(--card) 48%)
|
|
411
|
-
);
|
|
398
|
+
background-color: color-mix(in srgb, var(--accent) 24%, var(--muted) 76%);
|
|
412
399
|
}
|
|
413
400
|
|
|
414
401
|
[data-floe-floating-window-surface='true'][data-floe-floating-window-state='inactive'] [data-floe-floating-window-titlebar='true'] {
|
|
415
|
-
background:
|
|
416
|
-
linear-gradient(
|
|
417
|
-
180deg,
|
|
418
|
-
color-mix(in srgb, var(--muted) 80%, var(--card) 20%),
|
|
419
|
-
color-mix(in srgb, var(--muted) 64%, var(--card) 36%)
|
|
420
|
-
);
|
|
402
|
+
background-color: color-mix(in srgb, var(--muted) 56%, var(--card) 44%);
|
|
421
403
|
}
|
|
422
404
|
|
|
423
405
|
[data-floe-hot-interaction~='resize'] [data-floe-geometry-surface='shell-sidebar'],
|
|
@@ -433,6 +415,19 @@
|
|
|
433
415
|
}
|
|
434
416
|
}
|
|
435
417
|
|
|
418
|
+
/* Edge-aligned window controls keep their keyboard indicator inside the
|
|
419
|
+
* clipped panel. The outer resize perimeter keeps its existing hit targets. */
|
|
420
|
+
[data-floe-floating-window-control]:focus-visible {
|
|
421
|
+
box-shadow: none;
|
|
422
|
+
outline: 2px solid var(--ring);
|
|
423
|
+
outline-offset: -3px;
|
|
424
|
+
}
|
|
425
|
+
@media (forced-colors: active) {
|
|
426
|
+
[data-floe-floating-window-control]:focus-visible {
|
|
427
|
+
outline-color: Highlight;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
436
431
|
/* Animation utilities */
|
|
437
432
|
@layer utilities {
|
|
438
433
|
.floe-floating-presence {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LIGHT_WINDOW_TOKENS as n, DARK_WINDOW_TOKENS as i } from "./windowTokens.js";
|
|
1
2
|
function a(h) {
|
|
2
3
|
const l = {}, c = (r, e = /* @__PURE__ */ new Set()) => {
|
|
3
4
|
const o = h[r];
|
|
@@ -9,7 +10,8 @@ function a(h) {
|
|
|
9
10
|
l[r] = c(r);
|
|
10
11
|
return Object.freeze(l);
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
+
const t = {
|
|
14
|
+
...n,
|
|
13
15
|
"--background": "hsl(34 24% 94%)",
|
|
14
16
|
"--foreground": "hsl(214 26% 17%)",
|
|
15
17
|
"--primary": "hsl(214 26% 17%)",
|
|
@@ -73,7 +75,8 @@ const n = {
|
|
|
73
75
|
"--selection-code-bg": "hsl(212 100% 67%)",
|
|
74
76
|
"--selection-code-fg": "hsl(220 20% 8%)",
|
|
75
77
|
"--glow": "hsl(214 26% 17%)"
|
|
76
|
-
},
|
|
78
|
+
}, d = {
|
|
79
|
+
...i,
|
|
77
80
|
"--background": "hsl(222 30% 8%)",
|
|
78
81
|
"--foreground": "hsl(210 20% 98%)",
|
|
79
82
|
"--primary": "hsl(210 20% 98%)",
|
|
@@ -137,8 +140,8 @@ const n = {
|
|
|
137
140
|
"--selection-code-bg": "hsl(212 100% 67%)",
|
|
138
141
|
"--selection-code-fg": "hsl(220 20% 8%)",
|
|
139
142
|
"--glow": "hsl(217 65% 52%)"
|
|
140
|
-
},
|
|
143
|
+
}, b = a(t), u = a(d);
|
|
141
144
|
export {
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
u as CLASSIC_DARK_SEMANTIC_TOKENS,
|
|
146
|
+
b as CLASSIC_LIGHT_SEMANTIC_TOKENS
|
|
144
147
|
};
|
|
@@ -6,7 +6,7 @@ export interface FloeShellThemeSelection {
|
|
|
6
6
|
dark?: string;
|
|
7
7
|
}
|
|
8
8
|
export type FloeShellThemeDefaults = Partial<Record<FloeShellThemeMode, string>>;
|
|
9
|
-
type ShellThemeTokenName = '--background' | '--foreground' | '--primary' | '--primary-foreground' | '--secondary' | '--secondary-foreground' | '--muted' | '--muted-foreground' | '--accent' | '--accent-foreground' | '--border' | '--input' | '--ring' | '--chrome-border' | '--top-bar-border' | '--activity-bar-border' | '--bottom-bar-border' | '--terminal-panel-border' | '--card' | '--card-foreground' | '--popover' | '--popover-foreground' | '--success' | '--success-foreground' | '--warning' | '--warning-foreground' | '--error' | '--error-foreground' | '--info' | '--info-foreground' | '--highlight-block-info-accent' | '--highlight-block-warning-accent' | '--highlight-block-success-accent' | '--highlight-block-error-accent' | '--highlight-block-note-accent' | '--highlight-block-tip-accent' | '--sidebar' | '--sidebar-foreground' | '--sidebar-primary' | '--sidebar-primary-foreground' | '--sidebar-accent' | '--sidebar-accent-foreground' | '--sidebar-border' | '--sidebar-ring' | '--activity-bar' | '--activity-bar-foreground' | '--activity-bar-foreground-active' | '--activity-bar-badge' | '--activity-bar-badge-foreground' | '--terminal-background' | '--terminal-foreground' | '--chart-1' | '--chart-2' | '--chart-3' | '--chart-4' | '--chart-5' | '--selection-bg' | '--selection-fg' | '--selection-on-primary-bg' | '--selection-on-primary-fg' | '--selection-code-bg' | '--selection-code-fg' | '--glow';
|
|
9
|
+
type ShellThemeTokenName = '--floe-window-background' | '--floe-window-foreground' | '--floe-window-muted-foreground' | '--floe-window-titlebar-background' | '--floe-window-border' | '--floe-window-shadow' | '--background' | '--foreground' | '--primary' | '--primary-foreground' | '--secondary' | '--secondary-foreground' | '--muted' | '--muted-foreground' | '--accent' | '--accent-foreground' | '--border' | '--input' | '--ring' | '--chrome-border' | '--top-bar-border' | '--activity-bar-border' | '--bottom-bar-border' | '--terminal-panel-border' | '--card' | '--card-foreground' | '--popover' | '--popover-foreground' | '--success' | '--success-foreground' | '--warning' | '--warning-foreground' | '--error' | '--error-foreground' | '--info' | '--info-foreground' | '--highlight-block-info-accent' | '--highlight-block-warning-accent' | '--highlight-block-success-accent' | '--highlight-block-error-accent' | '--highlight-block-note-accent' | '--highlight-block-tip-accent' | '--sidebar' | '--sidebar-foreground' | '--sidebar-primary' | '--sidebar-primary-foreground' | '--sidebar-accent' | '--sidebar-accent-foreground' | '--sidebar-border' | '--sidebar-ring' | '--activity-bar' | '--activity-bar-foreground' | '--activity-bar-foreground-active' | '--activity-bar-badge' | '--activity-bar-badge-foreground' | '--terminal-background' | '--terminal-foreground' | '--chart-1' | '--chart-2' | '--chart-3' | '--chart-4' | '--chart-5' | '--selection-bg' | '--selection-fg' | '--selection-on-primary-bg' | '--selection-on-primary-fg' | '--selection-code-bg' | '--selection-code-fg' | '--glow';
|
|
10
10
|
export declare const REQUIRED_SHELL_THEME_TOKENS: readonly ShellThemeTokenName[];
|
|
11
11
|
interface ShellThemePaletteDefinition {
|
|
12
12
|
name: string;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DARK_WINDOW_TOKENS as s, LIGHT_WINDOW_TOKENS as m } from "./windowTokens.js";
|
|
2
|
+
import { CLASSIC_LIGHT_SEMANTIC_TOKENS as l, CLASSIC_DARK_SEMANTIC_TOKENS as b } from "./classicSemanticTokens.js";
|
|
3
|
+
const w = [
|
|
4
|
+
"--floe-window-background",
|
|
5
|
+
"--floe-window-foreground",
|
|
6
|
+
"--floe-window-muted-foreground",
|
|
7
|
+
"--floe-window-titlebar-background",
|
|
8
|
+
"--floe-window-border",
|
|
9
|
+
"--floe-window-shadow",
|
|
3
10
|
"--background",
|
|
4
11
|
"--foreground",
|
|
5
12
|
"--primary",
|
|
@@ -63,7 +70,7 @@ const C = [
|
|
|
63
70
|
"--selection-code-bg",
|
|
64
71
|
"--selection-code-fg",
|
|
65
72
|
"--glow"
|
|
66
|
-
],
|
|
73
|
+
], p = {
|
|
67
74
|
success: "#287A4B",
|
|
68
75
|
successForeground: "#FFFFFF",
|
|
69
76
|
warning: "#835800",
|
|
@@ -74,7 +81,7 @@ const C = [
|
|
|
74
81
|
infoForeground: "#FFFFFF",
|
|
75
82
|
note: "#6847A0",
|
|
76
83
|
tip: "#1E6F73"
|
|
77
|
-
},
|
|
84
|
+
}, B = {
|
|
78
85
|
success: "#72D39C",
|
|
79
86
|
successForeground: "#07160E",
|
|
80
87
|
warning: "#F0C36A",
|
|
@@ -87,7 +94,7 @@ const C = [
|
|
|
87
94
|
tip: "#71C8C0"
|
|
88
95
|
};
|
|
89
96
|
function o(r) {
|
|
90
|
-
const e = r.mode === "light" ?
|
|
97
|
+
const e = r.mode === "light" ? p : B, n = r.mode === "light" ? { background: "#F4C95D", foreground: "#243447" } : {
|
|
91
98
|
background: r.background,
|
|
92
99
|
foreground: r.foreground
|
|
93
100
|
}, [t, d, F, c, g] = r.chart, a = r.syntax ?? {
|
|
@@ -99,6 +106,7 @@ function o(r) {
|
|
|
99
106
|
function: g,
|
|
100
107
|
constant: c
|
|
101
108
|
}, u = {
|
|
109
|
+
...r.mode === "dark" ? s : m,
|
|
102
110
|
"--background": r.background,
|
|
103
111
|
"--foreground": r.foreground,
|
|
104
112
|
"--primary": r.primary,
|
|
@@ -241,7 +249,7 @@ function o(r) {
|
|
|
241
249
|
tokens: r.mode === "light" ? { light: u } : { dark: u }
|
|
242
250
|
};
|
|
243
251
|
}
|
|
244
|
-
const
|
|
252
|
+
const E = {
|
|
245
253
|
...o({
|
|
246
254
|
name: "classic-light",
|
|
247
255
|
displayName: "Classic Light",
|
|
@@ -273,9 +281,9 @@ const p = {
|
|
|
273
281
|
}
|
|
274
282
|
}),
|
|
275
283
|
inheritsBaseTokens: !0,
|
|
276
|
-
semanticTokens:
|
|
284
|
+
semanticTokens: l,
|
|
277
285
|
tokens: void 0
|
|
278
|
-
},
|
|
286
|
+
}, k = {
|
|
279
287
|
...o({
|
|
280
288
|
name: "classic-dark",
|
|
281
289
|
displayName: "Classic Dark",
|
|
@@ -307,10 +315,10 @@ const p = {
|
|
|
307
315
|
}
|
|
308
316
|
}),
|
|
309
317
|
inheritsBaseTokens: !0,
|
|
310
|
-
semanticTokens:
|
|
318
|
+
semanticTokens: b,
|
|
311
319
|
tokens: void 0
|
|
312
|
-
},
|
|
313
|
-
|
|
320
|
+
}, A = [
|
|
321
|
+
E,
|
|
314
322
|
o({
|
|
315
323
|
name: "paper",
|
|
316
324
|
displayName: "Paper",
|
|
@@ -566,7 +574,7 @@ const p = {
|
|
|
566
574
|
constant: "#745500"
|
|
567
575
|
}
|
|
568
576
|
}),
|
|
569
|
-
|
|
577
|
+
k,
|
|
570
578
|
o({
|
|
571
579
|
name: "ink",
|
|
572
580
|
displayName: "Ink",
|
|
@@ -882,18 +890,18 @@ const p = {
|
|
|
882
890
|
constant: "#BF5AF2"
|
|
883
891
|
}
|
|
884
892
|
})
|
|
885
|
-
],
|
|
893
|
+
], v = {
|
|
886
894
|
light: "classic-light",
|
|
887
895
|
dark: "classic-dark"
|
|
888
896
|
};
|
|
889
|
-
function
|
|
897
|
+
function y(r, e) {
|
|
890
898
|
const n = r.mode ?? "both";
|
|
891
899
|
return n === "both" || n === e;
|
|
892
900
|
}
|
|
893
|
-
function
|
|
894
|
-
return r.filter((n) =>
|
|
901
|
+
function h(r, e) {
|
|
902
|
+
return r.filter((n) => y(n, e));
|
|
895
903
|
}
|
|
896
|
-
function
|
|
904
|
+
function C(r) {
|
|
897
905
|
const e = /* @__PURE__ */ new Set();
|
|
898
906
|
for (const n of r) {
|
|
899
907
|
if (e.has(n.name))
|
|
@@ -902,10 +910,10 @@ function y(r) {
|
|
|
902
910
|
}
|
|
903
911
|
}
|
|
904
912
|
function i(r, e, n, t) {
|
|
905
|
-
const d =
|
|
913
|
+
const d = h(r, e);
|
|
906
914
|
return n && d.some((F) => F.name === n) ? n : t && d.some((F) => F.name === t) ? t : d[0]?.name;
|
|
907
915
|
}
|
|
908
|
-
function
|
|
916
|
+
function S(r, e, n = {}) {
|
|
909
917
|
const t = typeof r == "object" && r !== null && !Array.isArray(r) ? r : void 0, d = t?.version === 1, F = d && typeof t.light == "string" ? t.light : void 0, c = d && typeof t.dark == "string" ? t.dark : void 0;
|
|
910
918
|
return {
|
|
911
919
|
version: 1,
|
|
@@ -913,15 +921,15 @@ function f(r, e, n = {}) {
|
|
|
913
921
|
dark: i(e, "dark", c, n.dark)
|
|
914
922
|
};
|
|
915
923
|
}
|
|
916
|
-
|
|
924
|
+
C(A);
|
|
917
925
|
export {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
926
|
+
v as BUILT_IN_SHELL_THEME_DEFAULTS,
|
|
927
|
+
w as REQUIRED_SHELL_THEME_TOKENS,
|
|
928
|
+
C as assertUniqueThemePresetNames,
|
|
929
|
+
A as builtInShellThemePresets,
|
|
922
930
|
o as createShellThemePreset,
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
931
|
+
h as getShellThemePresetsForMode,
|
|
932
|
+
S as normalizeShellThemeSelection,
|
|
933
|
+
y as presetSupportsMode,
|
|
926
934
|
i as resolveShellThemePresetName
|
|
927
935
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Palette-relative, opaque window material; resolved by CSS only when the theme changes. */
|
|
2
|
+
export declare const LIGHT_WINDOW_TOKENS: {
|
|
3
|
+
readonly '--floe-window-background': "color-mix(in srgb, var(--card) 35%, white)";
|
|
4
|
+
readonly '--floe-window-foreground': "var(--foreground)";
|
|
5
|
+
readonly '--floe-window-muted-foreground': "var(--muted-foreground)";
|
|
6
|
+
readonly '--floe-window-titlebar-background': "color-mix(in srgb, var(--floe-window-background) 92%, var(--foreground))";
|
|
7
|
+
readonly '--floe-window-border': "color-mix(in srgb, var(--floe-window-background) 88%, var(--foreground))";
|
|
8
|
+
readonly '--floe-window-shadow': "0 1px 3px rgb(0 0 0 / 14%), 0 12px 28px -8px rgb(0 0 0 / 18%)";
|
|
9
|
+
};
|
|
10
|
+
export declare const DARK_WINDOW_TOKENS: {
|
|
11
|
+
readonly '--floe-window-background': "color-mix(in srgb, var(--card) 90%, white)";
|
|
12
|
+
readonly '--floe-window-foreground': "var(--foreground)";
|
|
13
|
+
readonly '--floe-window-muted-foreground': "color-mix(in srgb, var(--muted-foreground) 72%, var(--foreground))";
|
|
14
|
+
readonly '--floe-window-titlebar-background': "color-mix(in srgb, var(--floe-window-background) 95%, white)";
|
|
15
|
+
readonly '--floe-window-border': "color-mix(in srgb, var(--floe-window-background) 88%, var(--foreground))";
|
|
16
|
+
readonly '--floe-window-shadow': "0 1px 3px rgb(0 0 0 / 30%), 0 12px 28px -8px rgb(0 0 0 / 32%)";
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const o = {
|
|
2
|
+
"--floe-window-background": "color-mix(in srgb, var(--card) 35%, white)",
|
|
3
|
+
"--floe-window-foreground": "var(--foreground)",
|
|
4
|
+
"--floe-window-muted-foreground": "var(--muted-foreground)",
|
|
5
|
+
"--floe-window-titlebar-background": "color-mix(in srgb, var(--floe-window-background) 92%, var(--foreground))",
|
|
6
|
+
"--floe-window-border": "color-mix(in srgb, var(--floe-window-background) 88%, var(--foreground))",
|
|
7
|
+
"--floe-window-shadow": "0 1px 3px rgb(0 0 0 / 14%), 0 12px 28px -8px rgb(0 0 0 / 18%)"
|
|
8
|
+
}, r = {
|
|
9
|
+
"--floe-window-background": "color-mix(in srgb, var(--card) 90%, white)",
|
|
10
|
+
"--floe-window-foreground": "var(--foreground)",
|
|
11
|
+
"--floe-window-muted-foreground": "color-mix(in srgb, var(--muted-foreground) 72%, var(--foreground))",
|
|
12
|
+
"--floe-window-titlebar-background": "color-mix(in srgb, var(--floe-window-background) 95%, white)",
|
|
13
|
+
"--floe-window-border": "color-mix(in srgb, var(--floe-window-background) 88%, var(--foreground))",
|
|
14
|
+
"--floe-window-shadow": "0 1px 3px rgb(0 0 0 / 30%), 0 12px 28px -8px rgb(0 0 0 / 32%)"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
r as DARK_WINDOW_TOKENS,
|
|
18
|
+
o as LIGHT_WINDOW_TOKENS
|
|
19
|
+
};
|