@floegence/floe-webapp-core 0.39.7 → 0.39.8
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/Dialog.js +22 -22
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ import { Button as B } from "./Button.js";
|
|
|
5
5
|
import { X as te } from "../icons/index.js";
|
|
6
6
|
import { useResolvedFloeConfig as re } from "../../context/FloeConfigContext.js";
|
|
7
7
|
import { useOverlayMask as ne } from "../../hooks/useOverlayMask.js";
|
|
8
|
-
import { resolveSurfacePortalHost as oe, isSurfacePortalMode as F, DIALOG_SURFACE_BOUNDARY_ATTR as
|
|
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 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">'),
|
|
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">'), we = /* @__PURE__ */ u("<div>");
|
|
12
|
+
const ve = {
|
|
13
13
|
display: "none"
|
|
14
14
|
};
|
|
15
15
|
function be(e) {
|
|
@@ -32,26 +32,26 @@ function pe(e) {
|
|
|
32
32
|
}
|
|
33
33
|
window.clearTimeout(e);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function xe(e) {
|
|
36
36
|
const o = J(), T = () => `dialog-${o}-title`, D = () => `dialog-${o}-description`;
|
|
37
37
|
let _;
|
|
38
|
-
const [
|
|
38
|
+
const [w, q] = P(null), [M, G] = P(0), [L, z] = P(0), E = () => e.open && !!w() && M() > 0, s = ce({
|
|
39
39
|
open: E,
|
|
40
40
|
exitDurationMs: 120
|
|
41
|
-
}), C = () => s.mounted() && !!
|
|
41
|
+
}), C = () => s.mounted() && !!w() && M() > 0, U = (t) => {
|
|
42
42
|
q(t), be(() => {
|
|
43
|
-
ee(
|
|
43
|
+
ee(w) === t && G((l) => l + 1);
|
|
44
44
|
});
|
|
45
|
-
},
|
|
46
|
-
owner:
|
|
45
|
+
}, v = N(() => C() ? oe({
|
|
46
|
+
owner: w()
|
|
47
47
|
}) : {
|
|
48
48
|
host: null,
|
|
49
49
|
boundaryHost: null,
|
|
50
50
|
mountHost: null,
|
|
51
51
|
mode: "global"
|
|
52
|
-
}), b = () => `dialog-boundary-${o}`, r = () => F(
|
|
52
|
+
}), b = () => `dialog-boundary-${o}`, r = () => F(v()), V = () => ae(v()), A = (t) => ie(le(t), t), K = () => A(v()), y = N(() => (L(), K())), W = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${$}="${b()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${$}="${b()}"]`) : !1;
|
|
53
53
|
return Q(() => {
|
|
54
|
-
const t =
|
|
54
|
+
const t = v();
|
|
55
55
|
if (!C() || !F(t) || typeof window > "u")
|
|
56
56
|
return;
|
|
57
57
|
let l = !1, g = null, i = j(A(t));
|
|
@@ -59,7 +59,7 @@ function $e(e) {
|
|
|
59
59
|
if (l || !F(t))
|
|
60
60
|
return;
|
|
61
61
|
const a = j(A(t));
|
|
62
|
-
a !== i && (i = a, z((
|
|
62
|
+
a !== i && (i = a, z((x) => x + 1));
|
|
63
63
|
}, m = () => {
|
|
64
64
|
l || (g = ye(() => {
|
|
65
65
|
p(), m();
|
|
@@ -83,7 +83,7 @@ function $e(e) {
|
|
|
83
83
|
restoreFocus: !0
|
|
84
84
|
}), [(() => {
|
|
85
85
|
var t = ue();
|
|
86
|
-
return I(U, t), f(t, "data-floe-dialog-owner-anchor", o), Y(t,
|
|
86
|
+
return I(U, t), f(t, "data-floe-dialog-owner-anchor", o), Y(t, ve), t;
|
|
87
87
|
})(), n(h, {
|
|
88
88
|
get when() {
|
|
89
89
|
return C();
|
|
@@ -120,7 +120,7 @@ function $e(e) {
|
|
|
120
120
|
} : void 0;
|
|
121
121
|
}
|
|
122
122
|
}), !1, !0), f(l, "data-floe-dialog-backdrop", o), O(l, R(() => ({
|
|
123
|
-
[
|
|
123
|
+
[$]: b()
|
|
124
124
|
}), {
|
|
125
125
|
get "data-floating-presence"() {
|
|
126
126
|
return s.state();
|
|
@@ -132,7 +132,7 @@ function $e(e) {
|
|
|
132
132
|
}), !1, !1);
|
|
133
133
|
var m = _;
|
|
134
134
|
return typeof m == "function" ? I(m, i) : _ = i, f(i, "data-floe-dialog-panel", o), O(i, R(() => ({
|
|
135
|
-
[
|
|
135
|
+
[$]: b()
|
|
136
136
|
}), {
|
|
137
137
|
get class() {
|
|
138
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);
|
|
@@ -156,8 +156,8 @@ function $e(e) {
|
|
|
156
156
|
return e.title || e.description;
|
|
157
157
|
},
|
|
158
158
|
get children() {
|
|
159
|
-
var a = ge(),
|
|
160
|
-
return d(
|
|
159
|
+
var a = ge(), x = a.firstChild;
|
|
160
|
+
return d(x, n(h, {
|
|
161
161
|
get when() {
|
|
162
162
|
return e.title;
|
|
163
163
|
},
|
|
@@ -165,7 +165,7 @@ function $e(e) {
|
|
|
165
165
|
var c = se();
|
|
166
166
|
return d(c, () => e.title), H(() => f(c, "id", T())), c;
|
|
167
167
|
}
|
|
168
|
-
}), null), d(
|
|
168
|
+
}), null), d(x, n(h, {
|
|
169
169
|
get when() {
|
|
170
170
|
return e.description;
|
|
171
171
|
},
|
|
@@ -176,7 +176,7 @@ function $e(e) {
|
|
|
176
176
|
}), null), d(a, n(B, {
|
|
177
177
|
variant: "ghost-destructive",
|
|
178
178
|
size: "icon",
|
|
179
|
-
class: "h-
|
|
179
|
+
class: "-my-2 -mr-2 h-[46px] w-[46px] sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
|
|
180
180
|
onClick: () => e.onOpenChange(!1),
|
|
181
181
|
"aria-label": "Close",
|
|
182
182
|
get children() {
|
|
@@ -202,7 +202,7 @@ function $e(e) {
|
|
|
202
202
|
}
|
|
203
203
|
function Be(e) {
|
|
204
204
|
const o = re();
|
|
205
|
-
return n(
|
|
205
|
+
return n(xe, {
|
|
206
206
|
get open() {
|
|
207
207
|
return e.open;
|
|
208
208
|
},
|
|
@@ -241,11 +241,11 @@ function Be(e) {
|
|
|
241
241
|
})];
|
|
242
242
|
},
|
|
243
243
|
get children() {
|
|
244
|
-
return e.children ??
|
|
244
|
+
return e.children ?? we();
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
248
|
export {
|
|
249
249
|
Be as ConfirmDialog,
|
|
250
|
-
|
|
250
|
+
xe as Dialog
|
|
251
251
|
};
|