@floegence/floe-webapp-core 0.39.7 → 0.39.9

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,15 +1,15 @@
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";
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 s } from "solid-js/web";
2
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
4
  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 x, projectSurfacePortalRect as ie, resolveSurfacePortalBoundaryRect as le, resolveSurfacePortalMount as ae } from "./dialogSurfaceScope.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 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 = {
11
+ var se = /* @__PURE__ */ s("<span aria-hidden=true>"), ue = /* @__PURE__ */ s('<h2 class="text-sm font-semibold">'), fe = /* @__PURE__ */ s('<p class="mt-0.5 text-xs text-muted-foreground">'), ge = /* @__PURE__ */ s('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), me = /* @__PURE__ */ s('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), he = /* @__PURE__ */ s('<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__ */ s("<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 $e(e) {
35
+ function xe(e) {
36
36
  const o = J(), T = () => `dialog-${o}-title`, D = () => `dialog-${o}-description`;
37
37
  let _;
38
- const [v, q] = P(null), [M, G] = P(0), [L, z] = P(0), E = () => e.open && !!v() && M() > 0, s = ce({
38
+ const [w, q] = P(null), [M, G] = P(0), [L, z] = P(0), E = () => e.open && !!w() && M() > 0, u = ce({
39
39
  open: E,
40
40
  exitDurationMs: 120
41
- }), C = () => s.mounted() && !!v() && M() > 0, U = (t) => {
41
+ }), C = () => u.mounted() && !!w() && M() > 0, U = (t) => {
42
42
  q(t), be(() => {
43
- ee(v) === t && G((l) => l + 1);
43
+ ee(w) === t && G((l) => l + 1);
44
44
  });
45
- }, w = N(() => C() ? oe({
46
- owner: v()
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(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;
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 = w();
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(($) => $ + 1));
62
+ a !== i && (i = a, z((x) => x + 1));
63
63
  }, m = () => {
64
64
  l || (g = ye(() => {
65
65
  p(), m();
@@ -82,8 +82,8 @@ function $e(e) {
82
82
  blockTouchMove: () => r() ? "none" : "outside",
83
83
  restoreFocus: !0
84
84
  }), [(() => {
85
- var t = ue();
86
- return I(U, t), f(t, "data-floe-dialog-owner-anchor", o), Y(t, we), t;
85
+ var t = se();
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();
@@ -100,16 +100,16 @@ function $e(e) {
100
100
  return r() ? "surface" : "global";
101
101
  },
102
102
  get "data-floating-presence"() {
103
- return s.state();
103
+ return u.state();
104
104
  },
105
105
  get "aria-hidden"() {
106
- return s.exiting() ? "true" : void 0;
106
+ return u.exiting() ? "true" : void 0;
107
107
  }
108
108
  }, () => ({
109
109
  [de]: r() ? "true" : void 0
110
110
  }), {
111
111
  get class() {
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");
112
+ return S(r() ? "absolute z-20 box-border p-3" : "fixed inset-0 box-border z-50 p-4", u.exiting() && "pointer-events-none");
113
113
  },
114
114
  get style() {
115
115
  return k(() => !!r())() ? {
@@ -120,10 +120,10 @@ function $e(e) {
120
120
  } : void 0;
121
121
  }
122
122
  }), !1, !0), f(l, "data-floe-dialog-backdrop", o), O(l, R(() => ({
123
- [x]: b()
123
+ [$]: b()
124
124
  }), {
125
125
  get "data-floating-presence"() {
126
- return s.state();
126
+ return u.state();
127
127
  },
128
128
  get class() {
129
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");
@@ -132,13 +132,13 @@ 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
- [x]: b()
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);
139
139
  },
140
140
  get "data-floating-presence"() {
141
- return s.state();
141
+ return u.state();
142
142
  },
143
143
  role: "dialog",
144
144
  get "aria-modal"() {
@@ -156,16 +156,16 @@ function $e(e) {
156
156
  return e.title || e.description;
157
157
  },
158
158
  get children() {
159
- var a = ge(), $ = a.firstChild;
160
- return d($, n(h, {
159
+ var a = ge(), x = a.firstChild;
160
+ return d(x, n(h, {
161
161
  get when() {
162
162
  return e.title;
163
163
  },
164
164
  get children() {
165
- var c = se();
165
+ var c = ue();
166
166
  return d(c, () => e.title), H(() => f(c, "id", T())), c;
167
167
  }
168
- }), null), d($, n(h, {
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-6 w-6 -mr-1",
179
+ class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 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($e, {
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 ?? ve();
244
+ return e.children ?? we();
245
245
  }
246
246
  });
247
247
  }
248
248
  export {
249
249
  Be as ConfirmDialog,
250
- $e as Dialog
250
+ xe as Dialog
251
251
  };