@floegence/floe-webapp-core 0.34.0 → 0.35.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/layout/ActivityBar.js +32 -32
- package/dist/components/layout/BottomBar.js +19 -19
- package/dist/components/layout/MobileTabBar.js +29 -29
- package/dist/components/layout/Shell.d.ts +14 -0
- package/dist/components/layout/Shell.js +173 -144
- package/dist/components/layout/Sidebar.js +7 -7
- package/dist/components/layout/TopBar.js +18 -18
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/context/FloeConfigContext.d.ts +8 -1
- package/dist/context/ThemeContext.js +32 -27
- package/dist/full.js +601 -599
- package/dist/index.js +113 -111
- package/dist/styles/themes/index.d.ts +20 -1
- package/dist/styles/themes/index.js +34 -7
- package/dist/styles.css +1 -1
- package/dist/themes/dark.css +5 -0
- package/dist/themes/light.css +5 -0
- package/package.json +1 -1
|
@@ -1,43 +1,48 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import { createSimpleContext as
|
|
3
|
-
import { useResolvedFloeConfig as
|
|
4
|
-
import { getSystemTheme as
|
|
5
|
-
function
|
|
6
|
-
const t =
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { createSignal as i, onCleanup as h, createEffect as v } from "solid-js";
|
|
2
|
+
import { createSimpleContext as y } from "./createSimpleContext.js";
|
|
3
|
+
import { useResolvedFloeConfig as k } from "./FloeConfigContext.js";
|
|
4
|
+
import { getSystemTheme as S, applyTheme as C, syncThemeTokenOverrides as a, resolveThemeTokenOverrides as w } from "../styles/themes/index.js";
|
|
5
|
+
function E() {
|
|
6
|
+
const t = k(), m = () => t.config.theme.storageKey, d = () => t.config.theme.defaultTheme, l = () => t.config.theme.tokens, T = t.persist.load(m(), d()), [r, f] = i(T), [g, u] = i(S());
|
|
7
|
+
let o = [];
|
|
8
|
+
const s = () => {
|
|
9
|
+
const e = r();
|
|
10
|
+
return e === "system" ? g() : e;
|
|
9
11
|
};
|
|
10
12
|
if (typeof window < "u") {
|
|
11
|
-
const e = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
12
|
-
|
|
13
|
+
const e = window.matchMedia("(prefers-color-scheme: dark)"), n = (p) => {
|
|
14
|
+
u(p.matches ? "dark" : "light");
|
|
13
15
|
};
|
|
14
|
-
e.addEventListener("change",
|
|
16
|
+
e.addEventListener("change", n), h(() => e.removeEventListener("change", n));
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
v(() => {
|
|
19
|
+
const e = r(), n = s();
|
|
20
|
+
C(e), o = a(w(l(), n), o);
|
|
21
|
+
}), h(() => {
|
|
22
|
+
o = a(void 0, o);
|
|
18
23
|
});
|
|
19
|
-
const
|
|
20
|
-
|
|
24
|
+
const c = (e) => {
|
|
25
|
+
f(e), t.persist.debouncedSave(m(), e);
|
|
21
26
|
};
|
|
22
27
|
return {
|
|
23
|
-
theme:
|
|
24
|
-
resolvedTheme:
|
|
25
|
-
setTheme:
|
|
28
|
+
theme: r,
|
|
29
|
+
resolvedTheme: s,
|
|
30
|
+
setTheme: c,
|
|
26
31
|
toggleTheme: () => {
|
|
27
|
-
const e =
|
|
28
|
-
|
|
32
|
+
const e = s();
|
|
33
|
+
c(e === "light" ? "dark" : "light");
|
|
29
34
|
}
|
|
30
35
|
};
|
|
31
36
|
}
|
|
32
37
|
const {
|
|
33
|
-
Provider:
|
|
34
|
-
use:
|
|
35
|
-
} =
|
|
38
|
+
Provider: b,
|
|
39
|
+
use: F
|
|
40
|
+
} = y({
|
|
36
41
|
name: "Theme",
|
|
37
|
-
init:
|
|
42
|
+
init: E
|
|
38
43
|
});
|
|
39
44
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
b as ThemeProvider,
|
|
46
|
+
E as createThemeService,
|
|
47
|
+
F as useTheme
|
|
43
48
|
};
|