@floegence/floe-webapp-core 0.36.12 → 0.36.15

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,23 +1,25 @@
1
- import { createComponent as n, Portal as R, setAttribute as s, spread as v, mergeProps as C, memo as T, insert as l, effect as A, template as c, use as E } from "solid-js/web";
2
- import { createUniqueId as S, createMemo as p, Show as u } from "solid-js";
3
- import { cn as x } from "../../utils/cn.js";
4
- import { Button as $ } from "./Button.js";
5
- import { X as z } from "../icons/index.js";
6
- import { useResolvedFloeConfig as F } from "../../context/FloeConfigContext.js";
7
- import { useOverlayMask as M } from "../../hooks/useOverlayMask.js";
8
- import { resolveDialogSurfaceHost as N, DIALOG_SURFACE_BOUNDARY_ATTR as g } from "./dialogSurfaceScope.js";
9
- import { LOCAL_INTERACTION_SURFACE_ATTR as U } from "./localInteractionSurface.js";
10
- var j = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), H = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), L = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), P = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), W = /* @__PURE__ */ c('<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">'), q = /* @__PURE__ */ c("<div>");
11
- function G(e) {
12
- const o = S(), _ = () => `dialog-${o}-title`, w = () => `dialog-${o}-description`;
13
- let m;
14
- const h = p(() => e.open ? N() : {
1
+ import { createComponent as n, Portal as D, setAttribute as u, spread as x, mergeProps as $, memo as C, insert as l, effect as S, template as c, use as E } from "solid-js/web";
2
+ import { createUniqueId as M, createMemo as T, Show as s } from "solid-js";
3
+ import { cn as _ } from "../../utils/cn.js";
4
+ import { Button as y } from "./Button.js";
5
+ import { X as P } from "../icons/index.js";
6
+ import { useResolvedFloeConfig as j } from "../../context/FloeConfigContext.js";
7
+ import { useOverlayMask as z } from "../../hooks/useOverlayMask.js";
8
+ import { resolveSurfacePortalHost as F, projectSurfacePortalRect as H, resolveSurfacePortalBoundaryRect as N, DIALOG_SURFACE_BOUNDARY_ATTR as h, isSurfacePortalMode as U, resolveSurfacePortalMount as L } from "./dialogSurfaceScope.js";
9
+ import { LOCAL_INTERACTION_SURFACE_ATTR as W } from "./localInteractionSurface.js";
10
+ var q = /* @__PURE__ */ c('<h2 class="text-sm font-semibold">'), G = /* @__PURE__ */ c('<p class="mt-0.5 text-xs text-muted-foreground">'), X = /* @__PURE__ */ c('<div class="flex items-start justify-between p-3 border-b border-border"><div>'), Y = /* @__PURE__ */ c('<div class="flex items-center justify-end gap-2 p-3 border-t border-border">'), J = /* @__PURE__ */ c('<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">'), K = /* @__PURE__ */ c("<div>");
11
+ function Q(e) {
12
+ const o = M(), w = () => `dialog-${o}-title`, k = () => `dialog-${o}-description`;
13
+ let b;
14
+ const f = T(() => e.open ? F() : {
15
15
  host: null,
16
+ boundaryHost: null,
17
+ mountHost: null,
16
18
  mode: "global"
17
- }), f = () => `dialog-boundary-${o}`, t = () => h().mode === "surface" && !!h().host?.isConnected, I = () => h().host ?? void 0, B = (r) => typeof Element < "u" && r instanceof Element ? !!r.closest(`[${g}="${f()}"]`) : typeof Node < "u" && r instanceof Node ? !!r.parentElement?.closest(`[${g}="${f()}"]`) : !1;
18
- return M({
19
+ }), g = () => `dialog-boundary-${o}`, t = () => U(f()), A = () => L(f()), m = T(() => H(N(f()), f())), B = (r) => typeof Element < "u" && r instanceof Element ? !!r.closest(`[${h}="${g()}"]`) : typeof Node < "u" && r instanceof Node ? !!r.parentElement?.closest(`[${h}="${g()}"]`) : !1;
20
+ return z({
19
21
  open: () => e.open,
20
- root: () => m,
22
+ root: () => b,
21
23
  containsTarget: (r) => t() && B(r),
22
24
  onClose: () => e.onOpenChange(!1),
23
25
  lockBodyScroll: () => !t(),
@@ -28,94 +30,102 @@ function G(e) {
28
30
  blockWheel: () => t() ? "none" : "outside",
29
31
  blockTouchMove: () => t() ? "none" : "outside",
30
32
  restoreFocus: !0
31
- }), n(u, {
33
+ }), n(s, {
32
34
  get when() {
33
35
  return e.open;
34
36
  },
35
37
  get children() {
36
- return n(R, {
38
+ return n(D, {
37
39
  get mount() {
38
- return I();
40
+ return A();
39
41
  },
40
42
  get children() {
41
- var r = W(), b = r.firstChild, D = b.nextSibling, i = D.firstChild, y = i.firstChild;
42
- s(r, "data-floe-dialog-overlay-root", o), v(r, C({
43
+ var r = J(), v = r.firstChild, I = v.nextSibling, i = I.firstChild, p = i.firstChild;
44
+ u(r, "data-floe-dialog-overlay-root", o), x(r, $({
43
45
  get "data-floe-dialog-mode"() {
44
46
  return t() ? "surface" : "global";
45
47
  }
46
48
  }, () => ({
47
- [U]: t() ? "true" : void 0
49
+ [W]: t() ? "true" : void 0
48
50
  }), {
49
51
  get class() {
50
- return x(t() ? "absolute inset-0 z-20 p-3" : "fixed inset-0 z-50 p-4");
52
+ return _(t() ? "absolute z-20 box-border p-3" : "fixed inset-0 box-border z-50 p-4");
53
+ },
54
+ get style() {
55
+ return C(() => !!t())() ? {
56
+ left: `${m().left}px`,
57
+ top: `${m().top}px`,
58
+ width: `${m().width}px`,
59
+ height: `${m().height}px`
60
+ } : void 0;
51
61
  }
52
- }), !1, !0), s(b, "data-floe-dialog-backdrop", o), v(b, C(() => ({
53
- [g]: f()
62
+ }), !1, !0), u(v, "data-floe-dialog-backdrop", o), x(v, $(() => ({
63
+ [h]: g()
54
64
  }), {
55
65
  get class() {
56
- return x("absolute inset-0 cursor-pointer animate-in fade-in", t() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
66
+ return _("absolute inset-0 cursor-pointer animate-in fade-in", t() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
57
67
  },
58
68
  onClick: () => e.onOpenChange(!1)
59
69
  }), !1, !1);
60
- var k = m;
61
- return typeof k == "function" ? E(k, i) : m = i, s(i, "data-floe-dialog-panel", o), v(i, C(() => ({
62
- [g]: f()
70
+ var O = b;
71
+ return typeof O == "function" ? E(O, i) : b = i, u(i, "data-floe-dialog-panel", o), x(i, $(() => ({
72
+ [h]: g()
63
73
  }), {
64
74
  get class() {
65
- return x(t() ? "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", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
75
+ return _(t() ? "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", "animate-in fade-in zoom-in-95", "flex flex-col", e.class);
66
76
  },
67
77
  role: "dialog",
68
78
  get "aria-modal"() {
69
79
  return t() ? void 0 : "true";
70
80
  },
71
81
  get "aria-labelledby"() {
72
- return T(() => !!e.title)() ? _() : void 0;
82
+ return C(() => !!e.title)() ? w() : void 0;
73
83
  },
74
84
  get "aria-describedby"() {
75
- return T(() => !!e.description)() ? w() : void 0;
85
+ return C(() => !!e.description)() ? k() : void 0;
76
86
  },
77
87
  tabIndex: -1
78
- }), !1, !0), l(i, n(u, {
88
+ }), !1, !0), l(i, n(s, {
79
89
  get when() {
80
90
  return e.title || e.description;
81
91
  },
82
92
  get children() {
83
- var d = L(), O = d.firstChild;
84
- return l(O, n(u, {
93
+ var d = X(), R = d.firstChild;
94
+ return l(R, n(s, {
85
95
  get when() {
86
96
  return e.title;
87
97
  },
88
98
  get children() {
89
- var a = j();
90
- return l(a, () => e.title), A(() => s(a, "id", _())), a;
99
+ var a = q();
100
+ return l(a, () => e.title), S(() => u(a, "id", w())), a;
91
101
  }
92
- }), null), l(O, n(u, {
102
+ }), null), l(R, n(s, {
93
103
  get when() {
94
104
  return e.description;
95
105
  },
96
106
  get children() {
97
- var a = H();
98
- return l(a, () => e.description), A(() => s(a, "id", w())), a;
107
+ var a = G();
108
+ return l(a, () => e.description), S(() => u(a, "id", k())), a;
99
109
  }
100
- }), null), l(d, n($, {
110
+ }), null), l(d, n(y, {
101
111
  variant: "ghost-destructive",
102
112
  size: "icon",
103
113
  class: "h-6 w-6 -mr-1",
104
114
  onClick: () => e.onOpenChange(!1),
105
115
  "aria-label": "Close",
106
116
  get children() {
107
- return n(z, {
117
+ return n(P, {
108
118
  class: "w-3.5 h-3.5"
109
119
  });
110
120
  }
111
121
  }), null), d;
112
122
  }
113
- }), y), l(y, () => e.children), l(i, n(u, {
123
+ }), p), l(p, () => e.children), l(i, n(s, {
114
124
  get when() {
115
125
  return e.footer;
116
126
  },
117
127
  get children() {
118
- var d = P();
128
+ var d = Y();
119
129
  return l(d, () => e.footer), d;
120
130
  }
121
131
  }), null), r;
@@ -124,9 +134,9 @@ function G(e) {
124
134
  }
125
135
  });
126
136
  }
127
- function re(e) {
128
- const o = F();
129
- return n(G, {
137
+ function ae(e) {
138
+ const o = j();
139
+ return n(Q, {
130
140
  get open() {
131
141
  return e.open;
132
142
  },
@@ -140,7 +150,7 @@ function re(e) {
140
150
  return e.description;
141
151
  },
142
152
  get footer() {
143
- return [n($, {
153
+ return [n(y, {
144
154
  variant: "ghost",
145
155
  onClick: () => e.onOpenChange(!1),
146
156
  get disabled() {
@@ -149,7 +159,7 @@ function re(e) {
149
159
  get children() {
150
160
  return e.cancelText ?? o.config.strings.confirmDialog.cancel;
151
161
  }
152
- }), n($, {
162
+ }), n(y, {
153
163
  get variant() {
154
164
  return e.variant === "destructive" ? "destructive" : "primary";
155
165
  },
@@ -165,11 +175,11 @@ function re(e) {
165
175
  })];
166
176
  },
167
177
  get children() {
168
- return e.children ?? q();
178
+ return e.children ?? K();
169
179
  }
170
180
  });
171
181
  }
172
182
  export {
173
- re as ConfirmDialog,
174
- G as Dialog
183
+ ae as ConfirmDialog,
184
+ Q as Dialog
175
185
  };