@floegence/floe-webapp-core 0.86.62 → 0.86.63
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/app/FloeRegistryContributions.js +0 -3
- package/dist/components/icons/ActivityRailIcons.d.ts +30 -0
- package/dist/components/icons/ActivityRailIcons.js +68 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +55 -54
- package/dist/components/layout/DisplayModeSwitcher.d.ts +10 -0
- package/dist/components/layout/DisplayModeSwitcher.js +102 -33
- package/dist/components/layout/Shell.d.ts +0 -6
- package/dist/components/layout/Shell.js +212 -258
- package/dist/components/layout/ThemeToggle.d.ts +19 -0
- package/dist/components/layout/ThemeToggle.js +39 -0
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/ui/Button.js +22 -14
- package/dist/components/ui/Tabs.js +172 -159
- package/dist/context/ComponentRegistry.d.ts +0 -8
- package/dist/context/ComponentRegistry.js +61 -67
- package/dist/context/FloeConfigContext.d.ts +0 -6
- package/dist/context/FloeConfigContext.js +9 -15
- package/dist/context/index.d.ts +1 -1
- package/dist/display-mode.css +2 -45
- package/dist/full.js +681 -673
- package/dist/icons.js +112 -102
- package/dist/layout.js +33 -35
- package/dist/styles.css +1 -1
- package/dist/surface.css +53 -1
- package/package.json +1 -1
- package/dist/components/layout/BottomBar.d.ts +0 -29
- package/dist/components/layout/BottomBar.js +0 -70
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ThemeToggleProps {
|
|
2
|
+
/** Box class for the button; defaults to the 32px icon control. */
|
|
3
|
+
class?: string;
|
|
4
|
+
/** Box class for the 16px icon frame. */
|
|
5
|
+
glyphClass?: string;
|
|
6
|
+
/** Overrides the accessible name. Defaults to the action the click performs. */
|
|
7
|
+
label?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Light/dark toggle.
|
|
12
|
+
*
|
|
13
|
+
* The two states are one control, so the icon performs the change rather than
|
|
14
|
+
* being swapped between frames: the outgoing glyph rotates a quarter turn and
|
|
15
|
+
* leaves upward while the incoming one arrives from below. Both live in the
|
|
16
|
+
* same 16px frame, so the button never changes size and nothing else on the
|
|
17
|
+
* bar moves. Reduced-motion users get the instant swap.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ThemeToggle(props: ThemeToggleProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { insert as k, createComponent as w, effect as T, setAttribute as x, className as a, template as p, delegateEvents as C } from "solid-js/web";
|
|
2
|
+
import { cn as r } from "../../utils/cn.js";
|
|
3
|
+
import { useTheme as S } from "../../context/ThemeContext.js";
|
|
4
|
+
import { Sun as j, Moon as A } from "../icons/index.js";
|
|
5
|
+
var D = /* @__PURE__ */ p("<button type=button data-floe-interactive=icon><span aria-hidden=true><span></span><span>");
|
|
6
|
+
function q(o) {
|
|
7
|
+
const s = S(), n = () => s.resolvedTheme() === "dark", c = () => o.label ?? (n() ? "Switch to light theme" : "Switch to dark theme"), f = (t, i) => r(
|
|
8
|
+
"absolute inset-0 flex items-center justify-center",
|
|
9
|
+
/* Tailwind's rotate/translate utilities write the individual properties,
|
|
10
|
+
* so the transition list has to name them; `transform` alone would leave
|
|
11
|
+
* the glyphs swapping instead of gliding. */
|
|
12
|
+
"transition-[opacity,rotate,translate] duration-[var(--floe-duration-base)] ease-[var(--floe-ease-out)]",
|
|
13
|
+
"motion-reduce:transition-none",
|
|
14
|
+
t ? "opacity-100 rotate-0 translate-y-0" : r("opacity-0", i === "up" ? "-translate-y-2 rotate-90" : "translate-y-2 -rotate-90")
|
|
15
|
+
);
|
|
16
|
+
return (() => {
|
|
17
|
+
var t = D(), i = t.firstChild, l = i.firstChild, v = l.nextSibling;
|
|
18
|
+
return t.$$click = () => s.toggleTheme(), k(l, w(j, {
|
|
19
|
+
class: "h-full w-full"
|
|
20
|
+
})), k(v, w(A, {
|
|
21
|
+
class: "h-full w-full"
|
|
22
|
+
})), T((e) => {
|
|
23
|
+
var d = o.disabled, u = c(), h = c(), m = r("inline-flex h-[var(--floe-control-height-md)] w-[var(--floe-control-height-md)] shrink-0 items-center justify-center rounded-control cursor-pointer", "text-[var(--floe-ink-soft)] hover:bg-[var(--floe-state-hover)] hover:text-foreground", "transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-[var(--floe-plane)]", "disabled:pointer-events-none disabled:opacity-50", o.class), b = r("relative block h-4 w-4 overflow-hidden", o.glyphClass), g = f(!n(), "up"), y = f(n(), "down");
|
|
24
|
+
return d !== e.e && (t.disabled = e.e = d), u !== e.t && x(t, "aria-label", e.t = u), h !== e.a && x(t, "title", e.a = h), m !== e.o && a(t, e.o = m), b !== e.i && a(i, e.i = b), g !== e.n && a(l, e.n = g), y !== e.s && a(v, e.s = y), e;
|
|
25
|
+
}, {
|
|
26
|
+
e: void 0,
|
|
27
|
+
t: void 0,
|
|
28
|
+
a: void 0,
|
|
29
|
+
o: void 0,
|
|
30
|
+
i: void 0,
|
|
31
|
+
n: void 0,
|
|
32
|
+
s: void 0
|
|
33
|
+
}), t;
|
|
34
|
+
})();
|
|
35
|
+
}
|
|
36
|
+
C(["click"]);
|
|
37
|
+
export {
|
|
38
|
+
q as ThemeToggle
|
|
39
|
+
};
|
|
@@ -5,7 +5,6 @@ export type { BarItemContextMenuHandler, BarItemContextMenuRequest, BarItemConte
|
|
|
5
5
|
export { Sidebar, SidebarContent, SidebarItemList, SidebarSection, SidebarItem, type SidebarProps, type SidebarContentProps, type SidebarItemListProps, type SidebarSectionProps, type SidebarItemProps, } from './Sidebar';
|
|
6
6
|
export { TopBar, type TopBarProps } from './TopBar';
|
|
7
7
|
export { TopBarIconButton, type TopBarIconButtonProps } from './TopBarIconButton';
|
|
8
|
-
export { BottomBar, BottomBarItem, StatusIndicator, type BottomBarProps, type BottomBarItemProps, type StatusIndicatorProps, } from './BottomBar';
|
|
9
8
|
export { BottomBarCompanion, type BottomBarCompanionDismissReason, type BottomBarCompanionPhase, type BottomBarCompanionProps, } from './BottomBarCompanion';
|
|
10
9
|
export { MobileTabBar, type MobileTabBarItem, type MobileTabBarProps } from './MobileTabBar';
|
|
11
10
|
export { ResizeHandle, type ResizeHandleProps } from './ResizeHandle';
|
|
@@ -14,4 +13,5 @@ export { Panel, PanelHeader, PanelContent, type PanelProps, type PanelHeaderProp
|
|
|
14
13
|
export { KeepAliveStack, type KeepAliveStackProps, type KeepAliveView } from './KeepAliveStack';
|
|
15
14
|
export { DisplayModeSwitcher, sanitizeDisplayMode, type DisplayMode, type DisplayModeSwitcherProps, } from './DisplayModeSwitcher';
|
|
16
15
|
export { DisplayModePageShell, type DisplayModePageShellProps } from './DisplayModePageShell';
|
|
16
|
+
export { ThemeToggle, type ThemeToggleProps } from './ThemeToggle';
|
|
17
17
|
export { AppViewport, type AppViewportProps } from './AppViewport';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { splitProps as
|
|
1
|
+
import { spread as h, mergeProps as m, insert as n, createComponent as t, memo as c, Dynamic as p, effect as d, className as g, template as u } from "solid-js/web";
|
|
2
|
+
import { splitProps as b, Show as l } from "solid-js";
|
|
3
3
|
import { cn as i } from "../../utils/cn.js";
|
|
4
|
-
import { Loader2 as
|
|
5
|
-
var
|
|
4
|
+
import { Loader2 as x } from "../icons/index.js";
|
|
5
|
+
var f = /* @__PURE__ */ u("<span aria-hidden=true>"), y = /* @__PURE__ */ u("<button type=button data-floe-control=button data-floe-surface-part=action>");
|
|
6
6
|
const w = {
|
|
7
7
|
default: "bg-primary text-primary-foreground hover:bg-[color-mix(in_srgb,var(--primary)_92%,var(--primary-foreground))]",
|
|
8
8
|
primary: "bg-primary text-primary-foreground hover:bg-[color-mix(in_srgb,var(--primary)_92%,var(--primary-foreground))]",
|
|
@@ -25,10 +25,10 @@ const w = {
|
|
|
25
25
|
icon: "w-4 h-4"
|
|
26
26
|
};
|
|
27
27
|
function P(a) {
|
|
28
|
-
const [r,
|
|
28
|
+
const [r, v] = b(a, ["variant", "size", "loading", "icon", "class", "children", "disabled"]), s = () => k[r.size ?? "md"];
|
|
29
29
|
return (() => {
|
|
30
|
-
var
|
|
31
|
-
return
|
|
30
|
+
var o = y();
|
|
31
|
+
return h(o, m({
|
|
32
32
|
get "data-floe-surface"() {
|
|
33
33
|
return r.variant === "ghost" || r.variant === "ghost-destructive" || r.variant === "outline" ? void 0 : "flat";
|
|
34
34
|
},
|
|
@@ -41,18 +41,18 @@ function P(a) {
|
|
|
41
41
|
get "aria-busy"() {
|
|
42
42
|
return r.loading || void 0;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, v), !1, !0), n(o, t(l, {
|
|
45
45
|
get when() {
|
|
46
46
|
return r.icon || "loading" in a;
|
|
47
47
|
},
|
|
48
48
|
get children() {
|
|
49
|
-
var
|
|
50
|
-
return n(
|
|
49
|
+
var e = f();
|
|
50
|
+
return n(e, t(l, {
|
|
51
51
|
get when() {
|
|
52
52
|
return r.loading;
|
|
53
53
|
},
|
|
54
54
|
get fallback() {
|
|
55
|
-
return
|
|
55
|
+
return c(() => !!r.icon)() && t(p, {
|
|
56
56
|
get component() {
|
|
57
57
|
return r.icon;
|
|
58
58
|
},
|
|
@@ -60,13 +60,21 @@ function P(a) {
|
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
get children() {
|
|
63
|
-
return
|
|
63
|
+
return t(x, {
|
|
64
64
|
class: "h-full w-full animate-spin"
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
})),
|
|
67
|
+
})), d(() => g(e, i("inline-flex shrink-0 items-center justify-center", s()))), e;
|
|
68
68
|
}
|
|
69
|
-
}), null), n(
|
|
69
|
+
}), null), n(o, () => r.children, null), n(o, t(l, {
|
|
70
|
+
get when() {
|
|
71
|
+
return c(() => !r.icon)() && "loading" in a;
|
|
72
|
+
},
|
|
73
|
+
get children() {
|
|
74
|
+
var e = f();
|
|
75
|
+
return d(() => g(e, i("inline-flex shrink-0", s()))), e;
|
|
76
|
+
}
|
|
77
|
+
}), null), o;
|
|
70
78
|
})();
|
|
71
79
|
}
|
|
72
80
|
export {
|