@floegence/floe-webapp-core 0.86.62 → 0.86.64
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/Dialog.js +101 -95
- package/dist/components/ui/Tabs.js +172 -159
- package/dist/components/ui/dialogHeightMotion.d.ts +9 -0
- package/dist/components/ui/dialogHeightMotion.js +49 -0
- package/dist/components/ui/index.d.ts +1 -0
- 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 +693 -683
- 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/dist/ui.js +33 -31
- 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 {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { createComponent as r, use as
|
|
2
|
-
import { createSignal as T, onMount as le, onCleanup as
|
|
1
|
+
import { createComponent as r, use as q, setAttribute as c, style as ne, Portal as ae, spread as E, mergeProps as M, memo as x, insert as s, effect as P, className as K, template as m } from "solid-js/web";
|
|
2
|
+
import { createSignal as T, onMount as le, onCleanup as B, createUniqueId as ie, createEffect as j, createMemo as U, Show as u, untrack as V } from "solid-js";
|
|
3
3
|
import { cn as g } from "../../utils/cn.js";
|
|
4
|
-
import { Button as
|
|
4
|
+
import { Button as H } from "./Button.js";
|
|
5
5
|
import { X as de } from "../icons/index.js";
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
7
|
-
import { useOverlayMask as
|
|
8
|
-
import { resolveSurfacePortalHost as ce, DIALOG_SURFACE_BOUNDARY_ATTR as
|
|
6
|
+
import { useResolvedFloeConfig as se } from "../../context/FloeConfigContext.js";
|
|
7
|
+
import { useOverlayMask as fe } from "../../hooks/useOverlayMask.js";
|
|
8
|
+
import { resolveSurfacePortalHost as ce, DIALOG_SURFACE_BOUNDARY_ATTR as S, SURFACE_PORTAL_LAYER_ATTR as ue, DIALOG_SURFACE_HOST_ATTR as ge, isSurfacePortalMode as z, projectSurfacePortalRect as me, resolveSurfacePortalBoundaryRect as he, resolveSurfacePortalMount as ve } from "./dialogSurfaceScope.js";
|
|
9
9
|
import { LOCAL_INTERACTION_SURFACE_ATTR as ye } from "./localInteractionSurface.js";
|
|
10
|
-
import { createFloatingPresence as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
import { createFloatingPresence as be } from "./floatingPresence.js";
|
|
11
|
+
import { observeDialogHeight as we } from "./dialogHeightMotion.js";
|
|
12
|
+
import { useDialogPlacement as pe } from "./DialogPlacementContext.js";
|
|
13
|
+
import { observeViewport as xe, viewportStyle as $e } from "../../viewport.js";
|
|
14
|
+
import { resolveFloatingBoundary as Ae } from "./surfaceFloatingBoundary.js";
|
|
15
|
+
var Ce = /* @__PURE__ */ m("<span aria-hidden=true>"), _e = /* @__PURE__ */ m('<h2 class="text-[length:var(--floe-type-heading-sm)] font-semibold leading-[var(--floe-line-heading)] tracking-[var(--floe-tracking-tight)] text-[var(--floe-ink)]">'), ke = /* @__PURE__ */ m('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-b border-[var(--floe-line)]"><div>'), Se = /* @__PURE__ */ m('<p class="mb-3 shrink-0 text-[length:var(--floe-type-body)] leading-[var(--floe-line-body)] text-[var(--floe-ink-soft)] last:mb-0">'), Oe = /* @__PURE__ */ m('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-[var(--floe-gap-control)] px-[var(--floe-pad-group)] py-[var(--floe-pad-control)] border-t border-[var(--floe-line)]">'), Re = /* @__PURE__ */ m("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), De = /* @__PURE__ */ m("<h2 class=sr-only>");
|
|
16
|
+
const Pe = {
|
|
16
17
|
display: "none"
|
|
17
18
|
};
|
|
18
|
-
function
|
|
19
|
+
function Te(e) {
|
|
19
20
|
if (typeof queueMicrotask == "function") {
|
|
20
21
|
queueMicrotask(e);
|
|
21
22
|
return;
|
|
@@ -25,59 +26,64 @@ function Pe(e) {
|
|
|
25
26
|
function Z(e) {
|
|
26
27
|
return `${e.left}|${e.top}|${e.right}|${e.bottom}|${e.width}|${e.height}`;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function Be(e) {
|
|
29
30
|
return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : window.setTimeout(() => e(Date.now()), 16);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
+
function Fe(e) {
|
|
32
33
|
if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
|
|
33
34
|
window.cancelAnimationFrame(e);
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
window.clearTimeout(e);
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
le(() =>
|
|
41
|
-
const
|
|
42
|
-
let
|
|
43
|
-
const [O, Y] = T(null), [
|
|
44
|
-
open: () => e.open && !!O() &&
|
|
45
|
-
element: () =>
|
|
46
|
-
}),
|
|
47
|
-
|
|
39
|
+
function Ie(e) {
|
|
40
|
+
const $ = pe(), [n, W] = T();
|
|
41
|
+
le(() => B(xe(window, W)));
|
|
42
|
+
const f = ie(), F = () => `dialog-${f}-title`, L = () => `dialog-${f}-description`;
|
|
43
|
+
let A;
|
|
44
|
+
const [O, Y] = T(null), [N, X] = T(0), [J, Q] = T(0), C = () => e.presentation === "side-drawer", h = () => e.presentation === "bottom-drawer", i = be({
|
|
45
|
+
open: () => e.open && !!O() && N() > 0,
|
|
46
|
+
element: () => A
|
|
47
|
+
}), v = () => i.mounted() && !!O() && N() > 0;
|
|
48
|
+
j(() => {
|
|
49
|
+
const t = A, l = i.state();
|
|
50
|
+
!t || l !== "open" || !v() || B(we(t, {
|
|
51
|
+
isSettled: () => i.state() === "open"
|
|
52
|
+
}));
|
|
53
|
+
}), j(() => e.onPresenceChange?.(v())), B(() => e.onPresenceChange?.(!1));
|
|
48
54
|
const ee = (t) => {
|
|
49
|
-
Y(t),
|
|
50
|
-
V(O) === t && X((
|
|
55
|
+
Y(t), Te(() => {
|
|
56
|
+
V(O) === t && X((l) => l + 1);
|
|
51
57
|
});
|
|
52
|
-
}, R = U(() =>
|
|
58
|
+
}, R = U(() => v() ? ce({
|
|
53
59
|
owner: O()
|
|
54
60
|
}) : {
|
|
55
61
|
host: null,
|
|
56
62
|
boundaryHost: null,
|
|
57
63
|
mountHost: null,
|
|
58
64
|
mode: "global"
|
|
59
|
-
}),
|
|
60
|
-
return
|
|
65
|
+
}), _ = () => `dialog-boundary-${f}`, a = () => $.mode() === "auto" && z(R()), te = () => a() ? ve(R()) : void 0, G = () => e.globalZIndex ?? $.globalZIndex(), I = (t) => me(Ae(t, void 0, V(n)?.safeArea) ?? he(t), t), oe = () => I(R()), D = U(() => (J(), n(), oe())), re = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${S}="${_()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${S}="${_()}"]`) : !1;
|
|
66
|
+
return j(() => {
|
|
61
67
|
const t = R();
|
|
62
|
-
if (!
|
|
68
|
+
if (!v() || !a() || typeof window > "u")
|
|
63
69
|
return;
|
|
64
|
-
let
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
70
|
+
let l = !1, y = null, d = Z(I(t));
|
|
71
|
+
const b = () => {
|
|
72
|
+
if (l || !z(t))
|
|
67
73
|
return;
|
|
68
|
-
const o = Z(
|
|
69
|
-
o !==
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
const o = Z(I(t));
|
|
75
|
+
o !== d && (d = o, Q((w) => w + 1));
|
|
76
|
+
}, k = () => {
|
|
77
|
+
l || (y = Be(() => {
|
|
78
|
+
b(), k();
|
|
73
79
|
}));
|
|
74
80
|
};
|
|
75
|
-
|
|
76
|
-
|
|
81
|
+
k(), B(() => {
|
|
82
|
+
l = !0, y !== null && Fe(y);
|
|
77
83
|
});
|
|
78
|
-
}),
|
|
79
|
-
open:
|
|
80
|
-
root: () =>
|
|
84
|
+
}), fe({
|
|
85
|
+
open: v,
|
|
86
|
+
root: () => A,
|
|
81
87
|
containsTarget: re,
|
|
82
88
|
onClose: () => e.onOpenChange(!1),
|
|
83
89
|
lockBodyScroll: () => !a(),
|
|
@@ -90,11 +96,11 @@ function Fe(e) {
|
|
|
90
96
|
blockTouchMove: () => a() ? "none" : "outside",
|
|
91
97
|
restoreFocus: !0
|
|
92
98
|
}), [(() => {
|
|
93
|
-
var t =
|
|
94
|
-
return
|
|
99
|
+
var t = Ce();
|
|
100
|
+
return q(ee, t), c(t, "data-floe-dialog-owner-anchor", f), ne(t, Pe), t;
|
|
95
101
|
})(), r(u, {
|
|
96
102
|
get when() {
|
|
97
|
-
return
|
|
103
|
+
return v();
|
|
98
104
|
},
|
|
99
105
|
get children() {
|
|
100
106
|
return r(ae, {
|
|
@@ -102,8 +108,8 @@ function Fe(e) {
|
|
|
102
108
|
return te();
|
|
103
109
|
},
|
|
104
110
|
get children() {
|
|
105
|
-
var t =
|
|
106
|
-
c(t, "data-floe-dialog-overlay-root",
|
|
111
|
+
var t = Re(), l = t.firstChild, y = l.nextSibling, d = y.firstChild, b = d.firstChild;
|
|
112
|
+
c(t, "data-floe-dialog-overlay-root", f), E(t, M({
|
|
107
113
|
get "data-floe-dialog-mode"() {
|
|
108
114
|
return a() ? "surface" : "global";
|
|
109
115
|
},
|
|
@@ -111,28 +117,28 @@ function Fe(e) {
|
|
|
111
117
|
return e.presentation ?? "dialog";
|
|
112
118
|
},
|
|
113
119
|
get "data-floating-presence"() {
|
|
114
|
-
return
|
|
120
|
+
return i.state();
|
|
115
121
|
},
|
|
116
122
|
get "aria-hidden"() {
|
|
117
|
-
return
|
|
123
|
+
return i.exiting() ? "true" : void 0;
|
|
118
124
|
}
|
|
119
125
|
}, {
|
|
120
126
|
[ye]: "true"
|
|
121
127
|
}, () => ({
|
|
122
128
|
[ue]: "true",
|
|
123
|
-
[
|
|
129
|
+
[S]: _()
|
|
124
130
|
}), {
|
|
125
131
|
get class() {
|
|
126
|
-
return g(a() ? g("absolute z-20 box-border",
|
|
132
|
+
return g(a() ? g("absolute z-20 box-border", !C() && "p-3") : g("fixed box-border p-4", G() === void 0 && "z-50"), h() && "floe-bottom-drawer-overlay", C() && "floe-side-drawer-overlay", i.exiting() && !h() && "pointer-events-none");
|
|
127
133
|
},
|
|
128
134
|
get style() {
|
|
129
|
-
return
|
|
135
|
+
return x(() => !!a())() ? {
|
|
130
136
|
left: `${D().left}px`,
|
|
131
137
|
top: `${D().top}px`,
|
|
132
138
|
width: `${D().width}px`,
|
|
133
139
|
height: `${D().height}px`
|
|
134
140
|
} : {
|
|
135
|
-
...n() ?
|
|
141
|
+
...n() ? $e(n()) : {
|
|
136
142
|
inset: "0"
|
|
137
143
|
},
|
|
138
144
|
"--floe-dialog-safe-top": `${(n()?.safeArea.top ?? 0) / (n()?.fixedScale ?? 1)}px`,
|
|
@@ -143,33 +149,33 @@ function Fe(e) {
|
|
|
143
149
|
"padding-right": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-right))",
|
|
144
150
|
"padding-bottom": "max(var(--floe-dialog-gap-y, 1rem), var(--floe-dialog-safe-bottom))",
|
|
145
151
|
"padding-left": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-left))",
|
|
146
|
-
"z-index":
|
|
152
|
+
"z-index": G()
|
|
147
153
|
};
|
|
148
154
|
}
|
|
149
|
-
}), !1, !0), c(
|
|
150
|
-
[
|
|
155
|
+
}), !1, !0), c(l, "data-floe-dialog-backdrop", f), E(l, M(() => ({
|
|
156
|
+
[S]: _()
|
|
151
157
|
}), {
|
|
152
158
|
get "data-floating-presence"() {
|
|
153
|
-
return
|
|
159
|
+
return i.state();
|
|
154
160
|
},
|
|
155
161
|
get class() {
|
|
156
162
|
return g("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", h() ? "floe-bottom-drawer-backdrop" : a() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
|
|
157
163
|
},
|
|
158
164
|
onClick: () => {
|
|
159
|
-
!
|
|
165
|
+
!i.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
|
|
160
166
|
}
|
|
161
167
|
}), !1, !1);
|
|
162
|
-
var
|
|
163
|
-
return typeof
|
|
168
|
+
var k = A;
|
|
169
|
+
return typeof k == "function" ? q(k, d) : A = d, c(d, "data-floe-dialog-panel", f), E(d, M({
|
|
164
170
|
get "data-floe-drawer-side"() {
|
|
165
|
-
return
|
|
171
|
+
return x(() => !!C())() ? e.drawerSide ?? "right" : void 0;
|
|
166
172
|
}
|
|
167
173
|
}, () => ({
|
|
168
|
-
[
|
|
174
|
+
[S]: _(),
|
|
169
175
|
[ge]: "true"
|
|
170
176
|
}), {
|
|
171
177
|
get class() {
|
|
172
|
-
return g(a() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-popover text-popover-foreground rounded-panel shadow-[var(--floe-elevation-float-strong)]", "border border-[var(--floe-line)]", "floe-floating-presence", h() ? "floe-bottom-drawer-panel" :
|
|
178
|
+
return g(a() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-popover text-popover-foreground rounded-panel shadow-[var(--floe-elevation-float-strong)]", "border border-[var(--floe-line)]", "floe-floating-presence", h() ? "floe-bottom-drawer-panel" : C() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
|
|
173
179
|
},
|
|
174
180
|
style: {
|
|
175
181
|
"max-height": "100%",
|
|
@@ -177,24 +183,24 @@ function Fe(e) {
|
|
|
177
183
|
"min-width": "0"
|
|
178
184
|
},
|
|
179
185
|
get "data-floating-presence"() {
|
|
180
|
-
return
|
|
186
|
+
return i.state();
|
|
181
187
|
},
|
|
182
188
|
get inert() {
|
|
183
|
-
return
|
|
189
|
+
return x(() => !!h())() && i.exiting();
|
|
184
190
|
},
|
|
185
191
|
role: "dialog",
|
|
186
192
|
get "aria-modal"() {
|
|
187
193
|
return a() ? void 0 : "true";
|
|
188
194
|
},
|
|
189
195
|
get "aria-labelledby"() {
|
|
190
|
-
return
|
|
196
|
+
return x(() => !!e.title)() ? F() : void 0;
|
|
191
197
|
},
|
|
192
198
|
get "aria-describedby"() {
|
|
193
|
-
return
|
|
199
|
+
return x(() => !!e.bodyDescription)() ? L() : void 0;
|
|
194
200
|
},
|
|
195
201
|
onKeyDown: (o) => e.onKeyDown?.(o),
|
|
196
202
|
tabIndex: -1
|
|
197
|
-
}), !1, !0),
|
|
203
|
+
}), !1, !0), s(d, r(u, {
|
|
198
204
|
get when() {
|
|
199
205
|
return e.header === void 0;
|
|
200
206
|
},
|
|
@@ -204,10 +210,10 @@ function Fe(e) {
|
|
|
204
210
|
return e.title;
|
|
205
211
|
},
|
|
206
212
|
get children() {
|
|
207
|
-
var o =
|
|
208
|
-
return
|
|
213
|
+
var o = De();
|
|
214
|
+
return s(o, () => e.title), P(() => c(o, "id", F())), o;
|
|
209
215
|
}
|
|
210
|
-
}),
|
|
216
|
+
}), x(() => e.header)];
|
|
211
217
|
},
|
|
212
218
|
get children() {
|
|
213
219
|
return r(u, {
|
|
@@ -215,16 +221,16 @@ function Fe(e) {
|
|
|
215
221
|
return e.title;
|
|
216
222
|
},
|
|
217
223
|
get children() {
|
|
218
|
-
var o =
|
|
219
|
-
return
|
|
224
|
+
var o = ke(), w = o.firstChild;
|
|
225
|
+
return s(w, r(u, {
|
|
220
226
|
get when() {
|
|
221
227
|
return e.title;
|
|
222
228
|
},
|
|
223
229
|
get children() {
|
|
224
|
-
var
|
|
225
|
-
return
|
|
230
|
+
var p = _e();
|
|
231
|
+
return s(p, () => e.title), P(() => c(p, "id", F())), p;
|
|
226
232
|
}
|
|
227
|
-
})),
|
|
233
|
+
})), s(o, r(H, {
|
|
228
234
|
variant: "ghost-destructive",
|
|
229
235
|
size: "icon",
|
|
230
236
|
class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
|
|
@@ -241,25 +247,25 @@ function Fe(e) {
|
|
|
241
247
|
}
|
|
242
248
|
});
|
|
243
249
|
}
|
|
244
|
-
}),
|
|
250
|
+
}), b), s(b, r(u, {
|
|
245
251
|
get when() {
|
|
246
252
|
return e.bodyDescription;
|
|
247
253
|
},
|
|
248
254
|
get children() {
|
|
249
|
-
var o =
|
|
250
|
-
return
|
|
255
|
+
var o = Se();
|
|
256
|
+
return s(o, () => e.bodyDescription), P(() => c(o, "id", L())), o;
|
|
251
257
|
}
|
|
252
|
-
}), null),
|
|
258
|
+
}), null), s(b, () => e.children, null), s(d, r(u, {
|
|
253
259
|
get when() {
|
|
254
260
|
return e.footer;
|
|
255
261
|
},
|
|
256
262
|
get children() {
|
|
257
|
-
var o =
|
|
258
|
-
return
|
|
263
|
+
var o = Oe();
|
|
264
|
+
return s(o, () => e.footer), o;
|
|
259
265
|
}
|
|
260
266
|
}), null), P((o) => {
|
|
261
|
-
var w = g("pointer-events-none relative z-[1] flex h-full w-full",
|
|
262
|
-
return w !== o.e &&
|
|
267
|
+
var w = g("pointer-events-none relative z-[1] flex h-full w-full", C() ? e.drawerSide === "left" ? "items-stretch justify-start" : "items-stretch justify-end" : h() ? "items-end justify-center" : "items-center justify-center"), p = g("min-h-0 flex-1 overflow-auto overscroll-contain px-[var(--floe-pad-group)] py-[var(--floe-pad-group)]", e.contentClass);
|
|
268
|
+
return w !== o.e && K(y, o.e = w), p !== o.t && K(b, o.t = p), o;
|
|
263
269
|
}, {
|
|
264
270
|
e: void 0,
|
|
265
271
|
t: void 0
|
|
@@ -269,9 +275,9 @@ function Fe(e) {
|
|
|
269
275
|
}
|
|
270
276
|
})];
|
|
271
277
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
274
|
-
return r(
|
|
278
|
+
function Xe(e) {
|
|
279
|
+
const $ = se();
|
|
280
|
+
return r(Ie, {
|
|
275
281
|
get open() {
|
|
276
282
|
return e.open;
|
|
277
283
|
},
|
|
@@ -288,16 +294,16 @@ function We(e) {
|
|
|
288
294
|
return e.globalZIndex;
|
|
289
295
|
},
|
|
290
296
|
get footer() {
|
|
291
|
-
return [r(
|
|
297
|
+
return [r(H, {
|
|
292
298
|
variant: "ghost",
|
|
293
299
|
onClick: () => e.onOpenChange(!1),
|
|
294
300
|
get disabled() {
|
|
295
301
|
return e.loading;
|
|
296
302
|
},
|
|
297
303
|
get children() {
|
|
298
|
-
return e.cancelText ??
|
|
304
|
+
return e.cancelText ?? $.config.strings.confirmDialog.cancel;
|
|
299
305
|
}
|
|
300
|
-
}), r(
|
|
306
|
+
}), r(H, {
|
|
301
307
|
get variant() {
|
|
302
308
|
return e.variant === "destructive" ? "destructive" : "primary";
|
|
303
309
|
},
|
|
@@ -308,7 +314,7 @@ function We(e) {
|
|
|
308
314
|
return e.loading;
|
|
309
315
|
},
|
|
310
316
|
get children() {
|
|
311
|
-
return e.confirmText ??
|
|
317
|
+
return e.confirmText ?? $.config.strings.confirmDialog.confirm;
|
|
312
318
|
}
|
|
313
319
|
})];
|
|
314
320
|
},
|
|
@@ -318,6 +324,6 @@ function We(e) {
|
|
|
318
324
|
});
|
|
319
325
|
}
|
|
320
326
|
export {
|
|
321
|
-
|
|
322
|
-
|
|
327
|
+
Xe as ConfirmDialog,
|
|
328
|
+
Ie as Dialog
|
|
323
329
|
};
|