@floegence/floe-webapp-core 0.50.5 → 0.51.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/dist/components/chat/input/ChatInput.js +8 -8
- package/dist/components/ui/Button.js +16 -13
- package/dist/components/ui/Card.js +125 -119
- package/dist/components/ui/Checkbox.js +178 -132
- package/dist/components/ui/CommandPalette.js +10 -10
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/DirectoryInput.js +5 -5
- package/dist/components/ui/Dropdown.d.ts +2 -0
- package/dist/components/ui/Dropdown.js +119 -114
- package/dist/components/ui/FloatingWindow.js +211 -199
- package/dist/components/ui/HighlightBlock.js +8 -8
- package/dist/components/ui/Input.js +40 -40
- package/dist/components/ui/Pagination.js +90 -88
- package/dist/components/ui/ProcessingIndicator.js +1 -1
- package/dist/components/ui/Progress.js +99 -88
- package/dist/components/ui/QuoteBlock.js +9 -9
- package/dist/components/ui/Radio.js +151 -127
- package/dist/components/ui/SegmentedControl.js +26 -25
- package/dist/components/ui/Stepper.js +114 -112
- package/dist/components/ui/Switch.js +34 -33
- package/dist/components/ui/Tabs.js +153 -150
- package/dist/components/ui/Tag.js +24 -21
- package/dist/components/ui/Tooltip.js +10 -10
- package/dist/components/ui/floatingPresence.js +40 -30
- package/dist/components/workbench/WorkbenchHud.js +9 -9
- package/dist/components/workbench/WorkbenchLockButton.js +4 -4
- package/dist/components/workbench/WorkbenchWidget.js +46 -43
- package/dist/context/FloeConfigContext.d.ts +5 -1
- package/dist/context/FloeConfigContext.js +10 -9
- package/dist/context/ThemeContext.d.ts +3 -1
- package/dist/context/ThemeContext.js +78 -71
- package/dist/floe.css +2 -37
- package/dist/full.js +839 -836
- package/dist/index.js +150 -147
- package/dist/input-focus.css +36 -0
- package/dist/styles/themes/index.d.ts +3 -0
- package/dist/styles/themes/index.js +40 -31
- package/dist/styles/tokens.d.ts +36 -0
- package/dist/styles/tokens.js +12 -5
- package/dist/styles.css +1 -1
- package/dist/surface.css +467 -0
- package/dist/themes.d.ts +1 -1
- package/dist/ui.css +9 -0
- package/package.json +3 -2
|
@@ -1,100 +1,107 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import { createSimpleContext as
|
|
3
|
-
import { useResolvedFloeConfig as
|
|
4
|
-
import { isThemeType as
|
|
5
|
-
import { normalizeShellThemeSelection as
|
|
6
|
-
function
|
|
7
|
-
if (
|
|
8
|
-
return s &&
|
|
1
|
+
import { createSignal as h, createEffect as S, createMemo as Q, onCleanup as R } from "solid-js";
|
|
2
|
+
import { createSimpleContext as te } from "./createSimpleContext.js";
|
|
3
|
+
import { useResolvedFloeConfig as se } from "./FloeConfigContext.js";
|
|
4
|
+
import { isFloeSurfaceStyle as k, applySurfaceStyleAttribute as V, isThemeType as re, getSystemTheme as ne, applyTheme as oe, applyShellThemeAttribute as j, syncThemeTokenOverrides as q, resolveThemeTokens as ce } from "../styles/themes/index.js";
|
|
5
|
+
import { normalizeShellThemeSelection as B, presetSupportsMode as D } from "../styles/themes/presets.js";
|
|
6
|
+
function d(s, n, c) {
|
|
7
|
+
if (n.length !== 0)
|
|
8
|
+
return s && n.some((l) => l.name === s) ? s : c && n.some((l) => l.name === c) ? c : n[0]?.name;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const s =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
function le() {
|
|
11
|
+
const s = se(), n = () => s.config.theme.storageKey, c = () => s.config.theme.defaultTheme, l = () => s.config.theme.surfaceStyleStorageKey ?? `${n()}-surface-style`, K = s.config.theme.defaultSurfaceStyle, g = k(K) ? K : "standard", x = s.persist.load(l(), g), [b, G] = h(k(x) ? x : g), H = (e) => {
|
|
12
|
+
const t = k(e) ? e : g;
|
|
13
|
+
G(t), s.persist.debouncedSave(l(), t);
|
|
14
|
+
};
|
|
15
|
+
S(() => V(b()));
|
|
16
|
+
const I = () => s.config.theme.tokens, o = () => s.config.theme.presets ?? [], p = () => s.config.theme.presetStorageKey ?? `${n()}-preset`, m = () => d(s.config.theme.defaultPreset, o()), i = () => s.config.theme.shellPresets ?? [], C = () => s.config.theme.shellPresetStorageKey ?? `${n()}-shell-preset`, M = () => s.config.theme.defaultShellPreset ?? {}, w = s.persist.load(n(), c()), J = re(w) ? w : c(), [T, U] = h(J), W = s.persist.load(p(), m()), [y, E] = h(d(W, o(), m())), X = s.persist.load(C(), void 0), [v, F] = h(B(X, i(), M())), [Y, Z] = h(ne());
|
|
17
|
+
let f = [];
|
|
18
|
+
const N = Q(() => {
|
|
19
|
+
const e = d(y(), o(), m());
|
|
15
20
|
if (e)
|
|
16
21
|
return o().find((t) => t.name === e);
|
|
17
|
-
}),
|
|
22
|
+
}), a = () => {
|
|
18
23
|
const e = T();
|
|
19
|
-
return e === "system" ?
|
|
20
|
-
},
|
|
21
|
-
const t =
|
|
24
|
+
return e === "system" ? Y() : e;
|
|
25
|
+
}, $ = (e) => {
|
|
26
|
+
const t = v()[e];
|
|
22
27
|
if (t)
|
|
23
|
-
return
|
|
24
|
-
},
|
|
25
|
-
if (
|
|
26
|
-
const e =
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
const e =
|
|
30
|
-
(e.light !== t.light || e.dark !== t.dark) &&
|
|
28
|
+
return i().find((r) => r.name === t && D(r, e));
|
|
29
|
+
}, A = Q(() => $(a()));
|
|
30
|
+
if (S(() => {
|
|
31
|
+
const e = d(y(), o(), m());
|
|
32
|
+
y() !== e && E(e);
|
|
33
|
+
}), S(() => {
|
|
34
|
+
const e = v(), t = B(e, i(), M());
|
|
35
|
+
(e.light !== t.light || e.dark !== t.dark) && F(t);
|
|
31
36
|
}), typeof window < "u") {
|
|
32
|
-
const e = window.matchMedia("(prefers-color-scheme: dark)"), t = (
|
|
33
|
-
|
|
37
|
+
const e = window.matchMedia("(prefers-color-scheme: dark)"), t = (r) => {
|
|
38
|
+
Z(r.matches ? "dark" : "light");
|
|
34
39
|
};
|
|
35
|
-
e.addEventListener("change", t),
|
|
40
|
+
e.addEventListener("change", t), R(() => e.removeEventListener("change", t));
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
const e = T(), t =
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
+
S(() => {
|
|
43
|
+
const e = T(), t = a(), r = A();
|
|
44
|
+
oe(e), j(r?.name), f = q(ce(t, I(), r?.tokens, N()?.tokens), f);
|
|
45
|
+
}), R(() => {
|
|
46
|
+
V(void 0), j(void 0), f = q(void 0, f);
|
|
42
47
|
});
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
const e =
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
const t =
|
|
50
|
-
if (
|
|
51
|
-
s.persist.remove(
|
|
48
|
+
const P = (e) => {
|
|
49
|
+
U(e), s.persist.debouncedSave(n(), e);
|
|
50
|
+
}, _ = () => {
|
|
51
|
+
const e = a();
|
|
52
|
+
P(e === "light" ? "dark" : "light");
|
|
53
|
+
}, ee = (e) => {
|
|
54
|
+
const t = d(e, o(), m());
|
|
55
|
+
if (E(t), !t) {
|
|
56
|
+
s.persist.remove(p());
|
|
52
57
|
return;
|
|
53
58
|
}
|
|
54
|
-
s.persist.debouncedSave(
|
|
55
|
-
},
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
const
|
|
61
|
-
...
|
|
59
|
+
s.persist.debouncedSave(p(), t);
|
|
60
|
+
}, L = (e, t) => {
|
|
61
|
+
const r = i().find((O) => O.name === t && D(O, e));
|
|
62
|
+
if (!r) return !1;
|
|
63
|
+
const u = v();
|
|
64
|
+
if (u[e] === r.name) return !0;
|
|
65
|
+
const z = {
|
|
66
|
+
...u,
|
|
62
67
|
version: 1,
|
|
63
|
-
[e]:
|
|
68
|
+
[e]: r.name
|
|
64
69
|
};
|
|
65
|
-
return
|
|
70
|
+
return F(z), s.persist.debouncedSave(C(), z), !0;
|
|
66
71
|
};
|
|
67
72
|
return {
|
|
73
|
+
surfaceStyle: b,
|
|
74
|
+
setSurfaceStyle: H,
|
|
68
75
|
theme: T,
|
|
69
|
-
resolvedTheme:
|
|
70
|
-
setTheme:
|
|
71
|
-
toggleTheme:
|
|
76
|
+
resolvedTheme: a,
|
|
77
|
+
setTheme: P,
|
|
78
|
+
toggleTheme: _,
|
|
72
79
|
themePresets: o,
|
|
73
|
-
themePreset:
|
|
74
|
-
setThemePreset:
|
|
75
|
-
shellPresets:
|
|
76
|
-
shellPreset:
|
|
77
|
-
shellPresetForMode:
|
|
80
|
+
themePreset: N,
|
|
81
|
+
setThemePreset: ee,
|
|
82
|
+
shellPresets: i,
|
|
83
|
+
shellPreset: A,
|
|
84
|
+
shellPresetForMode: $,
|
|
78
85
|
setShellPreset: (e) => {
|
|
79
|
-
const t =
|
|
86
|
+
const t = i().find((u) => u.name === e);
|
|
80
87
|
if (!t) return;
|
|
81
|
-
const
|
|
82
|
-
|
|
88
|
+
const r = t.mode === "light" || t.mode === "dark" ? t.mode : a();
|
|
89
|
+
L(r, e);
|
|
83
90
|
},
|
|
84
91
|
selectShellTheme: (e, t) => {
|
|
85
|
-
|
|
92
|
+
L(e, t) && P(e);
|
|
86
93
|
}
|
|
87
94
|
};
|
|
88
95
|
}
|
|
89
96
|
const {
|
|
90
|
-
Provider:
|
|
91
|
-
use:
|
|
92
|
-
} =
|
|
97
|
+
Provider: Se,
|
|
98
|
+
use: ge
|
|
99
|
+
} = te({
|
|
93
100
|
name: "Theme",
|
|
94
|
-
init:
|
|
101
|
+
init: le
|
|
95
102
|
});
|
|
96
103
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
Se as ThemeProvider,
|
|
105
|
+
le as createThemeService,
|
|
106
|
+
ge as useTheme
|
|
100
107
|
};
|
package/dist/floe.css
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import './input-focus.css';
|
|
2
|
+
@import './surface.css';
|
|
1
3
|
/*
|
|
2
4
|
* Floe design tokens + base styles + custom utilities.
|
|
3
5
|
*
|
|
@@ -431,43 +433,6 @@
|
|
|
431
433
|
}
|
|
432
434
|
}
|
|
433
435
|
|
|
434
|
-
/* A field has one visible border. Compound controls mark the element that owns it.
|
|
435
|
-
* Keep the contract unlayered so host base borders cannot silently hide focus.
|
|
436
|
-
* It changes color only and never replaces an existing decorative shadow.
|
|
437
|
-
*/
|
|
438
|
-
:is(
|
|
439
|
-
input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
|
|
440
|
-
textarea, select, [data-floe-input-surface]
|
|
441
|
-
) {
|
|
442
|
-
outline: none;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
:is(
|
|
446
|
-
input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
|
|
447
|
-
textarea, select, [data-floe-input-surface]
|
|
448
|
-
):focus:not(:disabled):not([aria-disabled='true']):not([data-floe-input-surface] :is(input, textarea, select)),
|
|
449
|
-
[data-floe-input-surface]:focus-within:not(:disabled):not([aria-disabled='true']) {
|
|
450
|
-
border-color: var(--floe-input-focus-color, var(--ring));
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
:is(input, textarea, select, [data-floe-input-surface])[aria-invalid='true'] {
|
|
454
|
-
--floe-input-focus-color: var(--error);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/* Internal buttons use a local fill to identify keyboard focus without a second frame. */
|
|
458
|
-
[data-floe-input-surface] button:focus-visible {
|
|
459
|
-
outline: none;
|
|
460
|
-
background-color: var(--accent);
|
|
461
|
-
color: var(--accent-foreground);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
@media (forced-colors: active) {
|
|
465
|
-
:is(input, textarea, select, [data-floe-input-surface]),
|
|
466
|
-
:is(input, textarea, select, [data-floe-input-surface])[aria-invalid='true'] {
|
|
467
|
-
--floe-input-focus-color: Highlight;
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
436
|
/* Animation utilities */
|
|
472
437
|
@layer utilities {
|
|
473
438
|
.floe-floating-presence {
|