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