@floegence/floe-webapp-core 0.55.0 → 0.55.1
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 +15 -15
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createComponent as r, use as L, setAttribute as s, style as ee, Portal as te, spread as B, mergeProps as F, memo as C, insert as i, effect as A, className as N, template as c } from "solid-js/web";
|
|
2
2
|
import { createUniqueId as ne, createSignal as I, createEffect as G, onCleanup as j, createMemo as q, Show as f, untrack as re } from "solid-js";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as w } from "../../utils/cn.js";
|
|
4
4
|
import { Button as E } from "./Button.js";
|
|
5
5
|
import { X as oe } from "../icons/index.js";
|
|
6
6
|
import { useResolvedFloeConfig as ie } from "../../context/FloeConfigContext.js";
|
|
@@ -9,7 +9,7 @@ import { resolveSurfacePortalHost as ae, DIALOG_SURFACE_BOUNDARY_ATTR as O, SURF
|
|
|
9
9
|
import { LOCAL_INTERACTION_SURFACE_ATTR as ge } from "./localInteractionSurface.js";
|
|
10
10
|
import { createFloatingPresence as me } from "./floatingPresence.js";
|
|
11
11
|
import { useDialogPlacement as he } from "./DialogPlacementContext.js";
|
|
12
|
-
var be = /* @__PURE__ */ c("<span aria-hidden=true>"),
|
|
12
|
+
var be = /* @__PURE__ */ c("<span aria-hidden=true>"), we = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), ve = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), ye = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), xe = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), $e = /* @__PURE__ */ c("<div><div></div><div><div data-floe-surface=floating><div>"), _e = /* @__PURE__ */ c("<h2 class=sr-only>"), Ce = /* @__PURE__ */ c("<p class=sr-only>"), Ae = /* @__PURE__ */ c("<div>");
|
|
13
13
|
const Oe = {
|
|
14
14
|
display: "none"
|
|
15
15
|
};
|
|
@@ -34,7 +34,7 @@ function Pe(e) {
|
|
|
34
34
|
window.clearTimeout(e);
|
|
35
35
|
}
|
|
36
36
|
function pe(e) {
|
|
37
|
-
const
|
|
37
|
+
const v = he(), g = ne(), p = () => `dialog-${g}-title`, S = () => `dialog-${g}-description`;
|
|
38
38
|
let T;
|
|
39
39
|
const [R, z] = I(null), [M, Z] = I(0), [V, W] = I(0), m = () => e.presentation === "bottom-drawer", u = me({
|
|
40
40
|
open: () => e.open && !!R() && M() > 0,
|
|
@@ -54,7 +54,7 @@ function pe(e) {
|
|
|
54
54
|
boundaryHost: null,
|
|
55
55
|
mountHost: null,
|
|
56
56
|
mode: "global"
|
|
57
|
-
}), x = () => `dialog-boundary-${g}`, o = () =>
|
|
57
|
+
}), x = () => `dialog-boundary-${g}`, o = () => v.mode() === "auto" && K(k()), X = () => o() ? fe(k()) : void 0, H = () => e.globalZIndex ?? v.globalZIndex(), D = (n) => ue(se(n), n), J = () => D(k()), P = q(() => (V(), J())), Q = (n) => typeof Element < "u" && n instanceof Element ? !!n.closest(`[${O}="${x()}"]`) : typeof Node < "u" && n instanceof Node ? !!n.parentElement?.closest(`[${O}="${x()}"]`) : !1;
|
|
58
58
|
return G(() => {
|
|
59
59
|
const n = k();
|
|
60
60
|
if (!y() || !o() || typeof window > "u")
|
|
@@ -114,14 +114,14 @@ function pe(e) {
|
|
|
114
114
|
get "aria-hidden"() {
|
|
115
115
|
return u.exiting() ? "true" : void 0;
|
|
116
116
|
}
|
|
117
|
+
}, {
|
|
118
|
+
[ge]: "true"
|
|
117
119
|
}, () => ({
|
|
118
|
-
[ge]: o() ? "true" : void 0
|
|
119
|
-
}), () => ({
|
|
120
120
|
[de]: "true",
|
|
121
121
|
[O]: x()
|
|
122
122
|
}), {
|
|
123
123
|
get class() {
|
|
124
|
-
return
|
|
124
|
+
return w(o() ? "absolute z-20 box-border p-3" : w("fixed inset-0 box-border p-4", H() === void 0 && "z-50"), m() && "floe-bottom-drawer-overlay", u.exiting() && !m() && "pointer-events-none");
|
|
125
125
|
},
|
|
126
126
|
get style() {
|
|
127
127
|
return C(() => !!o())() ? {
|
|
@@ -140,7 +140,7 @@ function pe(e) {
|
|
|
140
140
|
return u.state();
|
|
141
141
|
},
|
|
142
142
|
get class() {
|
|
143
|
-
return
|
|
143
|
+
return w("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", m() ? "floe-bottom-drawer-backdrop" : o() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
|
|
144
144
|
},
|
|
145
145
|
onClick: () => {
|
|
146
146
|
!u.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
|
|
@@ -152,7 +152,7 @@ function pe(e) {
|
|
|
152
152
|
[ce]: "true"
|
|
153
153
|
}), {
|
|
154
154
|
get class() {
|
|
155
|
-
return
|
|
155
|
+
return w(o() ? "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", m() ? "floe-bottom-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
|
|
156
156
|
},
|
|
157
157
|
get "data-floating-presence"() {
|
|
158
158
|
return u.state();
|
|
@@ -207,7 +207,7 @@ function pe(e) {
|
|
|
207
207
|
return e.title;
|
|
208
208
|
},
|
|
209
209
|
get children() {
|
|
210
|
-
var a =
|
|
210
|
+
var a = we();
|
|
211
211
|
return i(a, () => e.title), A(() => s(a, "id", p())), a;
|
|
212
212
|
}
|
|
213
213
|
}), null), i(h, r(f, {
|
|
@@ -215,7 +215,7 @@ function pe(e) {
|
|
|
215
215
|
return e.description;
|
|
216
216
|
},
|
|
217
217
|
get children() {
|
|
218
|
-
var a =
|
|
218
|
+
var a = ve();
|
|
219
219
|
return i(a, () => e.description), A(() => s(a, "id", S())), a;
|
|
220
220
|
}
|
|
221
221
|
}), null), i(t, r(E, {
|
|
@@ -244,7 +244,7 @@ function pe(e) {
|
|
|
244
244
|
return i(t, () => e.footer), t;
|
|
245
245
|
}
|
|
246
246
|
}), null), A((t) => {
|
|
247
|
-
var h =
|
|
247
|
+
var h = w("pointer-events-none relative z-[1] flex h-full w-full justify-center", m() ? "items-end" : "items-center"), a = w("min-h-0 flex-1 overflow-auto overscroll-contain p-3", e.contentClass);
|
|
248
248
|
return h !== t.e && N(b, t.e = h), a !== t.t && N($, t.t = a), t;
|
|
249
249
|
}, {
|
|
250
250
|
e: void 0,
|
|
@@ -256,7 +256,7 @@ function pe(e) {
|
|
|
256
256
|
})];
|
|
257
257
|
}
|
|
258
258
|
function je(e) {
|
|
259
|
-
const
|
|
259
|
+
const v = ie();
|
|
260
260
|
return r(pe, {
|
|
261
261
|
get open() {
|
|
262
262
|
return e.open;
|
|
@@ -281,7 +281,7 @@ function je(e) {
|
|
|
281
281
|
return e.loading;
|
|
282
282
|
},
|
|
283
283
|
get children() {
|
|
284
|
-
return e.cancelText ??
|
|
284
|
+
return e.cancelText ?? v.config.strings.confirmDialog.cancel;
|
|
285
285
|
}
|
|
286
286
|
}), r(E, {
|
|
287
287
|
get variant() {
|
|
@@ -294,7 +294,7 @@ function je(e) {
|
|
|
294
294
|
return e.loading;
|
|
295
295
|
},
|
|
296
296
|
get children() {
|
|
297
|
-
return e.confirmText ??
|
|
297
|
+
return e.confirmText ?? v.config.strings.confirmDialog.confirm;
|
|
298
298
|
}
|
|
299
299
|
})];
|
|
300
300
|
},
|