@floegence/floe-webapp-core 0.40.2 → 0.40.4
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.
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Command palette / search modal
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
4
|
+
export interface CommandPaletteProps {
|
|
5
|
+
/** Optional global stacking layer shared by the backdrop and palette panel. */
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function CommandPalette(props?: CommandPaletteProps): import("solid-js").JSX.Element;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useCommand as
|
|
5
|
-
import { Search as
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
7
|
-
import { useOverlayMask as
|
|
8
|
-
import { matchKeybind as
|
|
9
|
-
import { createFloatingPresence as
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
const n =
|
|
13
|
-
let
|
|
14
|
-
const [
|
|
1
|
+
import { createComponent as c, Portal as R, effect as C, className as _, setStyleProperty as E, setAttribute as x, insert as i, Dynamic as T, template as m, use as F, delegateEvents as j } from "solid-js/web";
|
|
2
|
+
import { createSignal as B, createEffect as H, createMemo as L, Show as h, For as I } from "solid-js";
|
|
3
|
+
import { cn as D } from "../../utils/cn.js";
|
|
4
|
+
import { useCommand as N } from "../../context/CommandContext.js";
|
|
5
|
+
import { Search as U } from "../icons/index.js";
|
|
6
|
+
import { useResolvedFloeConfig as W } from "../../context/FloeConfigContext.js";
|
|
7
|
+
import { useOverlayMask as q } from "../../hooks/useOverlayMask.js";
|
|
8
|
+
import { matchKeybind as G } from "../../utils/keybind.js";
|
|
9
|
+
import { createFloatingPresence as J } from "./floatingPresence.js";
|
|
10
|
+
var Q = /* @__PURE__ */ m("<div>"), V = /* @__PURE__ */ m('<div><div class="flex items-center gap-3 px-4 pt-1 border-b border-border"><input type=text><kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono"></kbd></div><div class="max-h-80 overflow-y-auto overscroll-contain py-2">'), X = /* @__PURE__ */ m('<div class="px-4 py-8 text-center text-sm text-muted-foreground">'), Y = /* @__PURE__ */ m('<div><div class="px-4 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider">'), Z = /* @__PURE__ */ m('<span class="w-5 h-5 flex items-center justify-center text-muted-foreground">'), ee = /* @__PURE__ */ m('<span class="ml-2 text-muted-foreground text-xs">'), te = /* @__PURE__ */ m('<kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono">'), re = /* @__PURE__ */ m('<button type=button><div class="flex-1 text-left"><span>');
|
|
11
|
+
function me(b = {}) {
|
|
12
|
+
const n = N(), k = W();
|
|
13
|
+
let z, M;
|
|
14
|
+
const [S, w] = B(0), v = J({
|
|
15
15
|
open: n.isOpen,
|
|
16
16
|
exitDurationMs: 120
|
|
17
17
|
});
|
|
18
|
-
|
|
18
|
+
q({
|
|
19
19
|
open: n.isOpen,
|
|
20
|
-
root: () =>
|
|
20
|
+
root: () => M,
|
|
21
21
|
onClose: () => n.close(),
|
|
22
22
|
lockBodyScroll: !0,
|
|
23
23
|
trapFocus: !0,
|
|
@@ -30,144 +30,147 @@ function de() {
|
|
|
30
30
|
selector: "input"
|
|
31
31
|
},
|
|
32
32
|
restoreFocus: !0
|
|
33
|
-
}),
|
|
34
|
-
n.isOpen() && (n.search(),
|
|
33
|
+
}), H(() => {
|
|
34
|
+
n.isOpen() && (n.search(), w(0));
|
|
35
35
|
});
|
|
36
36
|
const O = (e) => {
|
|
37
|
-
if (
|
|
37
|
+
if (G(e, k.config.commands.palette.keybind)) {
|
|
38
38
|
e.preventDefault(), n.close();
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const t = n.filteredCommands();
|
|
42
42
|
switch (e.key) {
|
|
43
43
|
case "ArrowDown": {
|
|
44
44
|
e.preventDefault();
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
45
|
+
const r = t.length;
|
|
46
|
+
if (r <= 0) return;
|
|
47
|
+
w((a) => Math.max(0, Math.min(a + 1, r - 1)));
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
case "ArrowUp": {
|
|
51
51
|
e.preventDefault();
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
|
|
52
|
+
const r = t.length;
|
|
53
|
+
if (r <= 0) return;
|
|
54
|
+
w((a) => Math.max(0, Math.min(a - 1, r - 1)));
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
case "Enter":
|
|
58
|
-
e.preventDefault(),
|
|
58
|
+
e.preventDefault(), t[S()] && n.execute(t[S()].id);
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
|
-
}, A =
|
|
62
|
-
const e = n.filteredCommands(),
|
|
63
|
-
return e.forEach((
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
cmd:
|
|
61
|
+
}, A = L(() => {
|
|
62
|
+
const e = n.filteredCommands(), t = /* @__PURE__ */ new Map();
|
|
63
|
+
return e.forEach((r, a) => {
|
|
64
|
+
const f = r.category ?? "Commands", s = t.get(f);
|
|
65
|
+
s ? s.push({
|
|
66
|
+
cmd: r,
|
|
67
67
|
index: a
|
|
68
|
-
}) :
|
|
69
|
-
cmd:
|
|
68
|
+
}) : t.set(f, [{
|
|
69
|
+
cmd: r,
|
|
70
70
|
index: a
|
|
71
71
|
}]);
|
|
72
|
-
}), Array.from(
|
|
72
|
+
}), Array.from(t.entries());
|
|
73
73
|
});
|
|
74
|
-
return
|
|
74
|
+
return c(h, {
|
|
75
75
|
get when() {
|
|
76
|
-
return
|
|
76
|
+
return v.mounted();
|
|
77
77
|
},
|
|
78
78
|
get children() {
|
|
79
|
-
return
|
|
79
|
+
return c(R, {
|
|
80
80
|
get children() {
|
|
81
81
|
return [(() => {
|
|
82
|
-
var e =
|
|
83
|
-
return e.$$click = () => n.close(),
|
|
84
|
-
var
|
|
85
|
-
return t !==
|
|
82
|
+
var e = Q();
|
|
83
|
+
return e.$$click = () => n.close(), C((t) => {
|
|
84
|
+
var r = D("fixed inset-0 bg-background/60 backdrop-blur-sm floe-floating-presence floe-floating-backdrop", b.zIndex === void 0 && "z-50"), a = b.zIndex, f = v.state(), s = v.exiting() ? "true" : void 0;
|
|
85
|
+
return r !== t.e && _(e, t.e = r), a !== t.t && E(e, "z-index", t.t = a), f !== t.a && x(e, "data-floating-presence", t.a = f), s !== t.o && x(e, "aria-hidden", t.o = s), t;
|
|
86
86
|
}, {
|
|
87
87
|
e: void 0,
|
|
88
|
-
t: void 0
|
|
88
|
+
t: void 0,
|
|
89
|
+
a: void 0,
|
|
90
|
+
o: void 0
|
|
89
91
|
}), e;
|
|
90
92
|
})(), (() => {
|
|
91
|
-
var e =
|
|
93
|
+
var e = V(), t = e.firstChild, r = t.firstChild, a = r.nextSibling, f = t.nextSibling;
|
|
92
94
|
e.$$keydown = O;
|
|
93
|
-
var
|
|
94
|
-
typeof
|
|
95
|
+
var s = M;
|
|
96
|
+
typeof s == "function" ? F(s, e) : M = e, i(t, c(U, {
|
|
95
97
|
class: "w-5 h-5 text-muted-foreground flex-shrink-0"
|
|
96
|
-
}),
|
|
97
|
-
var P =
|
|
98
|
-
return typeof P == "function" ?
|
|
98
|
+
}), r), r.$$input = (o) => n.setSearch(o.currentTarget.value);
|
|
99
|
+
var P = z;
|
|
100
|
+
return typeof P == "function" ? F(P, r) : z = r, i(a, () => k.config.strings.commandPalette.esc), i(f, c(h, {
|
|
99
101
|
get when() {
|
|
100
102
|
return n.filteredCommands().length > 0;
|
|
101
103
|
},
|
|
102
104
|
get fallback() {
|
|
103
105
|
return (() => {
|
|
104
|
-
var o =
|
|
105
|
-
return i(o, () =>
|
|
106
|
+
var o = X();
|
|
107
|
+
return i(o, () => k.config.strings.commandPalette.empty), o;
|
|
106
108
|
})();
|
|
107
109
|
},
|
|
108
110
|
get children() {
|
|
109
|
-
return
|
|
111
|
+
return c(I, {
|
|
110
112
|
get each() {
|
|
111
113
|
return A();
|
|
112
114
|
},
|
|
113
|
-
children: ([o,
|
|
114
|
-
var
|
|
115
|
-
return i($, o), i(
|
|
116
|
-
each:
|
|
115
|
+
children: ([o, y]) => (() => {
|
|
116
|
+
var g = Y(), $ = g.firstChild;
|
|
117
|
+
return i($, o), i(g, c(I, {
|
|
118
|
+
each: y,
|
|
117
119
|
children: (l) => (() => {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
120
|
+
var d = re(), p = d.firstChild, K = p.firstChild;
|
|
121
|
+
return d.addEventListener("mouseenter", () => w(l.index)), d.$$click = () => n.execute(l.cmd.id), i(d, c(h, {
|
|
120
122
|
get when() {
|
|
121
123
|
return l.cmd.icon;
|
|
122
124
|
},
|
|
123
125
|
get children() {
|
|
124
|
-
var
|
|
125
|
-
return i(
|
|
126
|
+
var u = Z();
|
|
127
|
+
return i(u, c(T, {
|
|
126
128
|
get component() {
|
|
127
129
|
return l.cmd.icon;
|
|
128
130
|
},
|
|
129
131
|
class: "w-5 h-5"
|
|
130
|
-
})),
|
|
132
|
+
})), u;
|
|
131
133
|
}
|
|
132
|
-
}),
|
|
134
|
+
}), p), i(K, () => l.cmd.title), i(p, c(h, {
|
|
133
135
|
get when() {
|
|
134
136
|
return l.cmd.description;
|
|
135
137
|
},
|
|
136
138
|
get children() {
|
|
137
|
-
var
|
|
138
|
-
return i(
|
|
139
|
+
var u = ee();
|
|
140
|
+
return i(u, () => l.cmd.description), u;
|
|
139
141
|
}
|
|
140
|
-
}), null), i(
|
|
142
|
+
}), null), i(d, c(h, {
|
|
141
143
|
get when() {
|
|
142
144
|
return l.cmd.keybind;
|
|
143
145
|
},
|
|
144
146
|
get children() {
|
|
145
|
-
var
|
|
146
|
-
return i(
|
|
147
|
+
var u = te();
|
|
148
|
+
return i(u, () => n.getKeybindDisplay(l.cmd.keybind)), u;
|
|
147
149
|
}
|
|
148
|
-
}), null),
|
|
150
|
+
}), null), C(() => _(d, D("w-full flex items-center gap-3 px-4 py-2 text-sm cursor-pointer", "transition-colors duration-75", "focus:outline-none", S() === l.index ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"))), d;
|
|
149
151
|
})()
|
|
150
|
-
}), null),
|
|
152
|
+
}), null), g;
|
|
151
153
|
})()
|
|
152
154
|
});
|
|
153
155
|
}
|
|
154
|
-
})),
|
|
155
|
-
var
|
|
156
|
-
return
|
|
156
|
+
})), C((o) => {
|
|
157
|
+
var y = D("fixed left-1/2 top-[20%] -translate-x-1/2", b.zIndex === void 0 && "z-50", "w-full max-w-xl", "bg-popover text-popover-foreground rounded-lg shadow-2xl", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "overflow-hidden"), g = b.zIndex, $ = v.state(), l = v.exiting() ? "true" : void 0, d = k.config.strings.commandPalette.placeholder, p = D("flex-1 h-12 bg-transparent text-sm", "placeholder:text-muted-foreground", "focus:outline-none");
|
|
158
|
+
return y !== o.e && _(e, o.e = y), g !== o.t && E(e, "z-index", o.t = g), $ !== o.a && x(e, "data-floating-presence", o.a = $), l !== o.o && x(e, "aria-hidden", o.o = l), d !== o.i && x(r, "placeholder", o.i = d), p !== o.n && _(r, o.n = p), o;
|
|
157
159
|
}, {
|
|
158
160
|
e: void 0,
|
|
159
161
|
t: void 0,
|
|
160
162
|
a: void 0,
|
|
161
163
|
o: void 0,
|
|
162
|
-
i: void 0
|
|
163
|
-
|
|
164
|
+
i: void 0,
|
|
165
|
+
n: void 0
|
|
166
|
+
}), C(() => r.value = n.search()), e;
|
|
164
167
|
})()];
|
|
165
168
|
}
|
|
166
169
|
});
|
|
167
170
|
}
|
|
168
171
|
});
|
|
169
172
|
}
|
|
170
|
-
|
|
173
|
+
j(["click", "keydown", "input"]);
|
|
171
174
|
export {
|
|
172
|
-
|
|
175
|
+
me as CommandPalette
|
|
173
176
|
};
|
|
@@ -8,6 +8,8 @@ export interface DialogProps {
|
|
|
8
8
|
children: JSX.Element;
|
|
9
9
|
footer?: JSX.Element;
|
|
10
10
|
class?: string;
|
|
11
|
+
/** Optional stacking layer for global dialogs. Surface-scoped dialogs remain locally layered. */
|
|
12
|
+
globalZIndex?: number;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Modal dialog component
|
|
@@ -29,5 +31,7 @@ export interface ConfirmDialogProps {
|
|
|
29
31
|
variant?: 'default' | 'destructive';
|
|
30
32
|
onConfirm: () => void | Promise<void>;
|
|
31
33
|
loading?: boolean;
|
|
34
|
+
/** Optional stacking layer for the underlying global dialog. */
|
|
35
|
+
globalZIndex?: number;
|
|
32
36
|
}
|
|
33
37
|
export declare function ConfirmDialog(props: ConfirmDialogProps): JSX.Element;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { createUniqueId as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
1
|
+
import { createComponent as r, use as E, setAttribute as f, style as W, Portal as Y, spread as R, mergeProps as k, memo as P, insert as d, effect as H, template as u } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as X, createSignal as S, createMemo as N, createEffect as J, onCleanup as Q, Show as h, untrack as ee } from "solid-js";
|
|
3
|
+
import { cn as p } from "../../utils/cn.js";
|
|
4
|
+
import { Button as I } from "./Button.js";
|
|
5
5
|
import { X as te } from "../icons/index.js";
|
|
6
|
-
import { useResolvedFloeConfig as
|
|
7
|
-
import { useOverlayMask as
|
|
8
|
-
import { resolveSurfacePortalHost as oe, isSurfacePortalMode as F, DIALOG_SURFACE_BOUNDARY_ATTR as
|
|
6
|
+
import { useResolvedFloeConfig as ne } from "../../context/FloeConfigContext.js";
|
|
7
|
+
import { useOverlayMask as re } from "../../hooks/useOverlayMask.js";
|
|
8
|
+
import { resolveSurfacePortalHost as oe, isSurfacePortalMode as F, DIALOG_SURFACE_BOUNDARY_ATTR as _, projectSurfacePortalRect as ie, resolveSurfacePortalBoundaryRect as le, resolveSurfacePortalMount as ae } from "./dialogSurfaceScope.js";
|
|
9
9
|
import { LOCAL_INTERACTION_SURFACE_ATTR as de } from "./localInteractionSurface.js";
|
|
10
10
|
import { createFloatingPresence as ce } from "./floatingPresence.js";
|
|
11
|
-
var
|
|
12
|
-
const
|
|
11
|
+
var ue = /* @__PURE__ */ u("<span aria-hidden=true>"), se = /* @__PURE__ */ u('<h2 class="text-sm font-semibold">'), fe = /* @__PURE__ */ u('<p class="mt-0.5 text-xs text-muted-foreground">'), ge = /* @__PURE__ */ u('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), me = /* @__PURE__ */ u('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), he = /* @__PURE__ */ u('<div><div></div><div class="relative z-[1] flex h-full w-full items-center justify-center"><div><div class="flex-1 overflow-auto overscroll-contain p-3">'), be = /* @__PURE__ */ u("<div>");
|
|
12
|
+
const we = {
|
|
13
13
|
display: "none"
|
|
14
14
|
};
|
|
15
|
-
function
|
|
15
|
+
function ve(e) {
|
|
16
16
|
if (typeof queueMicrotask == "function") {
|
|
17
17
|
queueMicrotask(e);
|
|
18
18
|
return;
|
|
@@ -25,168 +25,170 @@ function j(e) {
|
|
|
25
25
|
function ye(e) {
|
|
26
26
|
return typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(e) : window.setTimeout(() => e(Date.now()), 16);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function xe(e) {
|
|
29
29
|
if (typeof window < "u" && typeof window.cancelAnimationFrame == "function") {
|
|
30
30
|
window.cancelAnimationFrame(e);
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
window.clearTimeout(e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
const o =
|
|
37
|
-
let
|
|
38
|
-
const [
|
|
39
|
-
open:
|
|
35
|
+
function $e(e) {
|
|
36
|
+
const o = X(), B = () => `dialog-${o}-title`, T = () => `dialog-${o}-description`;
|
|
37
|
+
let C;
|
|
38
|
+
const [b, q] = S(null), [D, G] = S(0), [z, L] = S(0), M = () => e.open && !!b() && D() > 0, s = ce({
|
|
39
|
+
open: M,
|
|
40
40
|
exitDurationMs: 120
|
|
41
|
-
}),
|
|
42
|
-
q(t),
|
|
43
|
-
ee(
|
|
41
|
+
}), A = () => s.mounted() && !!b() && D() > 0, U = (t) => {
|
|
42
|
+
q(t), ve(() => {
|
|
43
|
+
ee(b) === t && G((l) => l + 1);
|
|
44
44
|
});
|
|
45
|
-
},
|
|
46
|
-
owner:
|
|
45
|
+
}, w = N(() => A() ? oe({
|
|
46
|
+
owner: b()
|
|
47
47
|
}) : {
|
|
48
48
|
host: null,
|
|
49
49
|
boundaryHost: null,
|
|
50
50
|
mountHost: null,
|
|
51
51
|
mode: "global"
|
|
52
|
-
}),
|
|
53
|
-
return
|
|
54
|
-
const t =
|
|
55
|
-
if (!
|
|
52
|
+
}), v = () => `dialog-boundary-${o}`, n = () => F(w()), V = () => ae(w()), O = (t) => ie(le(t), t), Z = () => O(w()), y = N(() => (z(), Z())), K = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${_}="${v()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${_}="${v()}"]`) : !1;
|
|
53
|
+
return J(() => {
|
|
54
|
+
const t = w();
|
|
55
|
+
if (!A() || !F(t) || typeof window > "u")
|
|
56
56
|
return;
|
|
57
|
-
let l = !1, g = null, i = j(
|
|
58
|
-
const
|
|
57
|
+
let l = !1, g = null, i = j(O(t));
|
|
58
|
+
const x = () => {
|
|
59
59
|
if (l || !F(t))
|
|
60
60
|
return;
|
|
61
|
-
const a = j(
|
|
62
|
-
a !== i && (i = a,
|
|
61
|
+
const a = j(O(t));
|
|
62
|
+
a !== i && (i = a, L(($) => $ + 1));
|
|
63
63
|
}, m = () => {
|
|
64
64
|
l || (g = ye(() => {
|
|
65
|
-
|
|
65
|
+
x(), m();
|
|
66
66
|
}));
|
|
67
67
|
};
|
|
68
|
-
m(),
|
|
69
|
-
l = !0, g !== null &&
|
|
68
|
+
m(), Q(() => {
|
|
69
|
+
l = !0, g !== null && xe(g);
|
|
70
70
|
});
|
|
71
|
-
}),
|
|
72
|
-
open:
|
|
73
|
-
root: () =>
|
|
74
|
-
containsTarget:
|
|
71
|
+
}), re({
|
|
72
|
+
open: M,
|
|
73
|
+
root: () => C,
|
|
74
|
+
containsTarget: n() ? (t) => K(t) : void 0,
|
|
75
75
|
onClose: () => e.onOpenChange(!1),
|
|
76
|
-
lockBodyScroll: () => !
|
|
76
|
+
lockBodyScroll: () => !n(),
|
|
77
77
|
trapFocus: !0,
|
|
78
|
-
closeOnEscape: () =>
|
|
78
|
+
closeOnEscape: () => n() ? "inside" : !0,
|
|
79
79
|
blockHotkeys: !0,
|
|
80
80
|
// Block scroll bleed outside the dialog while keeping the dialog content scrollable.
|
|
81
|
-
blockWheel: () =>
|
|
82
|
-
blockTouchMove: () =>
|
|
81
|
+
blockWheel: () => n() ? "none" : "outside",
|
|
82
|
+
blockTouchMove: () => n() ? "none" : "outside",
|
|
83
83
|
restoreFocus: !0
|
|
84
84
|
}), [(() => {
|
|
85
|
-
var t =
|
|
86
|
-
return
|
|
87
|
-
})(),
|
|
85
|
+
var t = ue();
|
|
86
|
+
return E(U, t), f(t, "data-floe-dialog-owner-anchor", o), W(t, we), t;
|
|
87
|
+
})(), r(h, {
|
|
88
88
|
get when() {
|
|
89
|
-
return
|
|
89
|
+
return A();
|
|
90
90
|
},
|
|
91
91
|
get children() {
|
|
92
|
-
return
|
|
92
|
+
return r(Y, {
|
|
93
93
|
get mount() {
|
|
94
94
|
return V();
|
|
95
95
|
},
|
|
96
96
|
get children() {
|
|
97
|
-
var t = he(), l = t.firstChild, g = l.nextSibling, i = g.firstChild,
|
|
98
|
-
f(t, "data-floe-dialog-overlay-root", o),
|
|
97
|
+
var t = he(), l = t.firstChild, g = l.nextSibling, i = g.firstChild, x = i.firstChild;
|
|
98
|
+
f(t, "data-floe-dialog-overlay-root", o), R(t, k({
|
|
99
99
|
get "data-floe-dialog-mode"() {
|
|
100
|
-
return
|
|
100
|
+
return n() ? "surface" : "global";
|
|
101
101
|
},
|
|
102
102
|
get "data-floating-presence"() {
|
|
103
|
-
return
|
|
103
|
+
return s.state();
|
|
104
104
|
},
|
|
105
105
|
get "aria-hidden"() {
|
|
106
|
-
return
|
|
106
|
+
return s.exiting() ? "true" : void 0;
|
|
107
107
|
}
|
|
108
108
|
}, () => ({
|
|
109
|
-
[de]:
|
|
109
|
+
[de]: n() ? "true" : void 0
|
|
110
110
|
}), {
|
|
111
111
|
get class() {
|
|
112
|
-
return
|
|
112
|
+
return p(n() ? "absolute z-20 box-border p-3" : p("fixed inset-0 box-border p-4", e.globalZIndex === void 0 && "z-50"), s.exiting() && "pointer-events-none");
|
|
113
113
|
},
|
|
114
114
|
get style() {
|
|
115
|
-
return
|
|
115
|
+
return P(() => !!n())() ? {
|
|
116
116
|
left: `${y().left}px`,
|
|
117
117
|
top: `${y().top}px`,
|
|
118
118
|
width: `${y().width}px`,
|
|
119
119
|
height: `${y().height}px`
|
|
120
|
-
} :
|
|
120
|
+
} : {
|
|
121
|
+
"z-index": e.globalZIndex
|
|
122
|
+
};
|
|
121
123
|
}
|
|
122
|
-
}), !1, !0), f(l, "data-floe-dialog-backdrop", o),
|
|
123
|
-
[
|
|
124
|
+
}), !1, !0), f(l, "data-floe-dialog-backdrop", o), R(l, k(() => ({
|
|
125
|
+
[_]: v()
|
|
124
126
|
}), {
|
|
125
127
|
get "data-floating-presence"() {
|
|
126
|
-
return
|
|
128
|
+
return s.state();
|
|
127
129
|
},
|
|
128
130
|
get class() {
|
|
129
|
-
return
|
|
131
|
+
return p("absolute inset-0 cursor-pointer floe-floating-presence floe-floating-backdrop", n() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
|
|
130
132
|
},
|
|
131
133
|
onClick: () => e.onOpenChange(!1)
|
|
132
134
|
}), !1, !1);
|
|
133
|
-
var m =
|
|
134
|
-
return typeof m == "function" ?
|
|
135
|
-
[
|
|
135
|
+
var m = C;
|
|
136
|
+
return typeof m == "function" ? E(m, i) : C = i, f(i, "data-floe-dialog-panel", o), R(i, k(() => ({
|
|
137
|
+
[_]: v()
|
|
136
138
|
}), {
|
|
137
139
|
get class() {
|
|
138
|
-
return
|
|
140
|
+
return p(n() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md max-h-[85vh]", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "flex flex-col", e.class);
|
|
139
141
|
},
|
|
140
142
|
get "data-floating-presence"() {
|
|
141
|
-
return
|
|
143
|
+
return s.state();
|
|
142
144
|
},
|
|
143
145
|
role: "dialog",
|
|
144
146
|
get "aria-modal"() {
|
|
145
|
-
return
|
|
147
|
+
return n() ? void 0 : "true";
|
|
146
148
|
},
|
|
147
149
|
get "aria-labelledby"() {
|
|
148
|
-
return
|
|
150
|
+
return P(() => !!e.title)() ? B() : void 0;
|
|
149
151
|
},
|
|
150
152
|
get "aria-describedby"() {
|
|
151
|
-
return
|
|
153
|
+
return P(() => !!e.description)() ? T() : void 0;
|
|
152
154
|
},
|
|
153
155
|
tabIndex: -1
|
|
154
|
-
}), !1, !0), d(i,
|
|
156
|
+
}), !1, !0), d(i, r(h, {
|
|
155
157
|
get when() {
|
|
156
158
|
return e.title || e.description;
|
|
157
159
|
},
|
|
158
160
|
get children() {
|
|
159
|
-
var a = ge(),
|
|
160
|
-
return d(
|
|
161
|
+
var a = ge(), $ = a.firstChild;
|
|
162
|
+
return d($, r(h, {
|
|
161
163
|
get when() {
|
|
162
164
|
return e.title;
|
|
163
165
|
},
|
|
164
166
|
get children() {
|
|
165
|
-
var c =
|
|
166
|
-
return d(c, () => e.title), H(() => f(c, "id",
|
|
167
|
+
var c = se();
|
|
168
|
+
return d(c, () => e.title), H(() => f(c, "id", B())), c;
|
|
167
169
|
}
|
|
168
|
-
}), null), d(
|
|
170
|
+
}), null), d($, r(h, {
|
|
169
171
|
get when() {
|
|
170
172
|
return e.description;
|
|
171
173
|
},
|
|
172
174
|
get children() {
|
|
173
175
|
var c = fe();
|
|
174
|
-
return d(c, () => e.description), H(() => f(c, "id",
|
|
176
|
+
return d(c, () => e.description), H(() => f(c, "id", T())), c;
|
|
175
177
|
}
|
|
176
|
-
}), null), d(a,
|
|
178
|
+
}), null), d(a, r(I, {
|
|
177
179
|
variant: "ghost-destructive",
|
|
178
180
|
size: "icon",
|
|
179
181
|
class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
|
|
180
182
|
onClick: () => e.onOpenChange(!1),
|
|
181
183
|
"aria-label": "Close",
|
|
182
184
|
get children() {
|
|
183
|
-
return
|
|
185
|
+
return r(te, {
|
|
184
186
|
class: "w-3.5 h-3.5"
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
189
|
}), null), a;
|
|
188
190
|
}
|
|
189
|
-
}),
|
|
191
|
+
}), x), d(x, () => e.children), d(i, r(h, {
|
|
190
192
|
get when() {
|
|
191
193
|
return e.footer;
|
|
192
194
|
},
|
|
@@ -200,9 +202,9 @@ function xe(e) {
|
|
|
200
202
|
}
|
|
201
203
|
})];
|
|
202
204
|
}
|
|
203
|
-
function
|
|
204
|
-
const o =
|
|
205
|
-
return
|
|
205
|
+
function Ie(e) {
|
|
206
|
+
const o = ne();
|
|
207
|
+
return r($e, {
|
|
206
208
|
get open() {
|
|
207
209
|
return e.open;
|
|
208
210
|
},
|
|
@@ -215,8 +217,11 @@ function Be(e) {
|
|
|
215
217
|
get description() {
|
|
216
218
|
return e.description;
|
|
217
219
|
},
|
|
220
|
+
get globalZIndex() {
|
|
221
|
+
return e.globalZIndex;
|
|
222
|
+
},
|
|
218
223
|
get footer() {
|
|
219
|
-
return [
|
|
224
|
+
return [r(I, {
|
|
220
225
|
variant: "ghost",
|
|
221
226
|
onClick: () => e.onOpenChange(!1),
|
|
222
227
|
get disabled() {
|
|
@@ -225,7 +230,7 @@ function Be(e) {
|
|
|
225
230
|
get children() {
|
|
226
231
|
return e.cancelText ?? o.config.strings.confirmDialog.cancel;
|
|
227
232
|
}
|
|
228
|
-
}),
|
|
233
|
+
}), r(I, {
|
|
229
234
|
get variant() {
|
|
230
235
|
return e.variant === "destructive" ? "destructive" : "primary";
|
|
231
236
|
},
|
|
@@ -241,11 +246,11 @@ function Be(e) {
|
|
|
241
246
|
})];
|
|
242
247
|
},
|
|
243
248
|
get children() {
|
|
244
|
-
return e.children ??
|
|
249
|
+
return e.children ?? be();
|
|
245
250
|
}
|
|
246
251
|
});
|
|
247
252
|
}
|
|
248
253
|
export {
|
|
249
|
-
|
|
250
|
-
|
|
254
|
+
Ie as ConfirmDialog,
|
|
255
|
+
$e as Dialog
|
|
251
256
|
};
|