@floegence/floe-webapp-core 0.86.1 → 0.86.5

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,4 +1,4 @@
1
- import { type JSX } from 'solid-js';
1
+ import { type Accessor, type JSX } from 'solid-js';
2
2
  export interface DropdownItem {
3
3
  id: string;
4
4
  label: string;
@@ -20,7 +20,7 @@ export interface DropdownProps {
20
20
  triggerAriaLabel?: string;
21
21
  /** Treat the existing trigger boundary as a field (used by Select). */
22
22
  triggerInputSurface?: boolean;
23
- items: DropdownItem[];
23
+ items: DropdownItem[] | Accessor<DropdownItem[]>;
24
24
  value?: string;
25
25
  onSelect: (id: string) => void;
26
26
  align?: 'start' | 'center' | 'end';
@@ -1,14 +1,14 @@
1
- import { setAttribute as f, insert as g, createComponent as l, Portal as W, use as O, spread as G, mergeProps as J, effect as F, className as D, template as P, memo as z, delegateEvents as te } from "solid-js/web";
2
- import { createSignal as _, createMemo as ne, createEffect as Q, onCleanup as re, Show as y, Index as V } from "solid-js";
3
- import { cn as k } from "../../utils/cn.js";
1
+ import { setAttribute as d, insert as f, createComponent as l, Portal as W, use as D, spread as G, mergeProps as J, effect as B, className as p, template as P, memo as z, delegateEvents as te } from "solid-js/web";
2
+ import { createSignal as j, createMemo as ne, createEffect as Q, onCleanup as re, Show as y, Index as V } from "solid-js";
3
+ import { cn as S } from "../../utils/cn.js";
4
4
  import { deferNonBlocking as oe } from "../../utils/defer.js";
5
5
  import { ChevronDown as ae, Check as ie, ChevronRight as ue } from "../icons/index.js";
6
- import { focusMenuItem as I, MENU_ITEM_SELECTOR as le, moveMenuFocus as U, calculateMenuPosition as se, calculateSubmenuPosition as de } from "./menuUtils.js";
6
+ import { focusMenuItem as O, MENU_ITEM_SELECTOR as le, moveMenuFocus as U, calculateMenuPosition as se, calculateSubmenuPosition as ce } from "./menuUtils.js";
7
7
  import { LOCAL_INTERACTION_SURFACE_ATTR as X } from "./localInteractionSurface.js";
8
8
  import { createFloatingPresence as Y } from "./floatingPresence.js";
9
- import { useOverlayMask as ce } from "../../hooks/useOverlayMask.js";
9
+ import { useOverlayMask as de } from "../../hooks/useOverlayMask.js";
10
10
  import { resolveSurfacePortalHost as fe, projectSurfacePortalPosition as me, resolveSurfacePortalBoundaryRect as ge, isSurfacePortalMode as ve, resolveSurfacePortalMount as be } from "./dialogSurfaceScope.js";
11
- var H = /* @__PURE__ */ P("<div>"), he = /* @__PURE__ */ P("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), Z = /* @__PURE__ */ P('<div class="my-1 h-px bg-border"role=separator>'), we = /* @__PURE__ */ P('<button type=button role=menuitem><span class="w-3.5 h-3.5 flex items-center justify-center"></span><span class="flex-1 text-left">'), ye = /* @__PURE__ */ P("<div class=relative>"), xe = /* @__PURE__ */ P('<span class="w-3.5 h-3.5 flex items-center justify-center">'), Se = /* @__PURE__ */ P("<span>");
11
+ var K = /* @__PURE__ */ P("<div>"), he = /* @__PURE__ */ P("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), Z = /* @__PURE__ */ P('<div class="my-1 h-px bg-border"role=separator>'), we = /* @__PURE__ */ P('<button type=button role=menuitem><span class="w-3.5 h-3.5 flex items-center justify-center"></span><span class="flex-1 text-left">'), ye = /* @__PURE__ */ P("<div class=relative>"), xe = /* @__PURE__ */ P('<span class="w-3.5 h-3.5 flex items-center justify-center">'), Se = /* @__PURE__ */ P("<span>");
12
12
  let ke = 0, Me = 0;
13
13
  function Pe(e, c) {
14
14
  switch (e) {
@@ -35,34 +35,34 @@ function Pe(e, c) {
35
35
  }
36
36
  }
37
37
  function $e(e) {
38
- const [c, d] = _(!1), o = Y({
38
+ const [c, s] = j(!1), a = Y({
39
39
  open: c
40
- }), [B, M] = _({
40
+ }), [q, k] = j({
41
41
  x: -9999,
42
42
  y: -9999
43
43
  });
44
- let v, h;
45
- const b = `floe-dropdown-${ke += 1}`, $ = `${b}-menu`, w = ne(() => o.mounted() ? fe({
46
- owner: v
44
+ let g, h;
45
+ const v = `floe-dropdown-${ke += 1}`, $ = `${v}-menu`, M = () => typeof e.items == "function" ? e.items() : e.items, b = ne(() => a.mounted() ? fe({
46
+ owner: g
47
47
  }) : {
48
48
  host: null,
49
49
  boundaryHost: null,
50
50
  mountHost: null,
51
51
  mode: "global"
52
- }), m = {
53
- mount: () => be(w()),
54
- isSurfaceMode: () => ve(w()),
55
- boundaryRect: () => ge(w()),
56
- projectPosition: (r) => me(r, w())
57
- }, A = () => {
58
- d(!1), requestAnimationFrame(() => v?.focus());
52
+ }), w = {
53
+ mount: () => be(b()),
54
+ isSurfaceMode: () => ve(b()),
55
+ boundaryRect: () => ge(b()),
56
+ projectPosition: (t) => me(t, b())
57
+ }, C = () => {
58
+ s(!1), requestAnimationFrame(() => g?.focus());
59
59
  };
60
- ce({
61
- open: o.mounted,
60
+ de({
61
+ open: a.mounted,
62
62
  root: () => h,
63
- containsTarget: (r) => !!(r instanceof Element ? r : document.activeElement)?.closest(`[data-floe-dropdown="${b}"]`),
64
- onClose: A,
65
- onEscapeOutside: A,
63
+ containsTarget: (t) => !!(t instanceof Element ? t : document.activeElement)?.closest(`[data-floe-dropdown="${v}"]`),
64
+ onClose: C,
65
+ onEscapeOutside: C,
66
66
  lockBodyScroll: !1,
67
67
  trapFocus: !1,
68
68
  autoFocus: !1,
@@ -71,127 +71,127 @@ function $e(e) {
71
71
  closeOnEscape: "inside",
72
72
  escapeKeyPhase: "bubble"
73
73
  });
74
- const C = () => {
75
- if (!v || !h) return;
76
- const r = v.getBoundingClientRect(), n = h.getBoundingClientRect(), i = se(r, n, e.align ?? "start", m.boundaryRect());
77
- M(i);
74
+ const T = () => {
75
+ if (!g || !h) return;
76
+ const t = g.getBoundingClientRect(), o = h.getBoundingClientRect(), n = se(t, o, e.align ?? "start", w.boundaryRect());
77
+ k(n);
78
78
  };
79
79
  Q(() => {
80
- if (!o.mounted()) {
81
- M({
80
+ if (!a.mounted()) {
81
+ k({
82
82
  x: -9999,
83
83
  y: -9999
84
84
  });
85
85
  return;
86
86
  }
87
87
  if (!c()) return;
88
- const r = (n) => {
89
- const i = n.target;
90
- i && typeof i.closest == "function" && i.closest(`[data-floe-dropdown="${b}"]`) || d(!1);
88
+ const t = (o) => {
89
+ const n = o.target;
90
+ n && typeof n.closest == "function" && n.closest(`[data-floe-dropdown="${v}"]`) || s(!1);
91
91
  };
92
- document.addEventListener("pointerdown", r, !0), requestAnimationFrame(() => {
93
- C(), I(h, e.value ? "selected" : "first");
92
+ document.addEventListener("pointerdown", t, !0), requestAnimationFrame(() => {
93
+ T(), O(h, e.value ? "selected" : "first");
94
94
  }), re(() => {
95
- document.removeEventListener("pointerdown", r, !0);
95
+ document.removeEventListener("pointerdown", t, !0);
96
96
  });
97
97
  });
98
- const j = (r) => {
99
- const n = e.onSelect;
100
- r.keepOpen || (d(!1), v?.focus({
98
+ const F = (t) => {
99
+ const o = e.onSelect;
100
+ t.keepOpen || (s(!1), g?.focus({
101
101
  preventScroll: !0
102
- })), oe(() => n(r.id));
103
- }, R = (r, n = "first") => {
104
- e.disabled || (d(r), requestAnimationFrame(() => {
105
- C(), I(h, n);
102
+ })), oe(() => o(t.id));
103
+ }, A = (t, o = "first") => {
104
+ e.disabled || (s(t), requestAnimationFrame(() => {
105
+ T(), O(h, o);
106
106
  }));
107
- }, T = (r) => {
107
+ }, H = (t) => {
108
108
  if (e.disabled) return;
109
- const n = Pe(r.key, {
109
+ const o = Pe(t.key, {
110
110
  open: c(),
111
111
  hasSelection: !!e.value
112
112
  });
113
- if (n) {
114
- if (r.preventDefault(), !n.nextOpen) {
115
- d(!1);
113
+ if (o) {
114
+ if (t.preventDefault(), !o.nextOpen) {
115
+ s(!1);
116
116
  return;
117
117
  }
118
- R(!0, n.focusMode ?? "first");
118
+ A(!0, o.focusMode ?? "first");
119
119
  }
120
- }, q = (r) => {
121
- const n = r.target, i = n?.closest('[role="menu"]'), t = n?.closest(le);
122
- switch (r.key) {
120
+ }, _ = (t) => {
121
+ const o = t.target, n = o?.closest('[role="menu"]'), r = o?.closest(le);
122
+ switch (t.key) {
123
123
  case "ArrowDown":
124
- r.preventDefault(), U(i, t, 1);
124
+ t.preventDefault(), U(n, r, 1);
125
125
  return;
126
126
  case "ArrowUp":
127
- r.preventDefault(), U(i, t, -1);
127
+ t.preventDefault(), U(n, r, -1);
128
128
  return;
129
129
  case "Home":
130
- r.preventDefault(), I(i, "first");
130
+ t.preventDefault(), O(n, "first");
131
131
  return;
132
132
  case "End":
133
- r.preventDefault(), I(i, "last");
133
+ t.preventDefault(), O(n, "last");
134
134
  return;
135
135
  case "Tab":
136
- r.preventDefault(), d(!1), v?.focus();
136
+ t.preventDefault(), s(!1), g?.focus();
137
137
  return;
138
138
  default:
139
139
  return;
140
140
  }
141
141
  };
142
142
  return (() => {
143
- var r = he(), n = r.firstChild;
144
- f(r, "data-floe-dropdown", b), n.$$keydown = T, n.$$click = () => {
143
+ var t = he(), o = t.firstChild;
144
+ d(t, "data-floe-dropdown", v), o.$$keydown = H, o.$$click = () => {
145
145
  if (!e.disabled) {
146
146
  if (c()) {
147
- d(!1);
147
+ s(!1);
148
148
  return;
149
149
  }
150
- R(!0, e.value ? "selected" : "first");
150
+ A(!0, e.value ? "selected" : "first");
151
151
  }
152
152
  };
153
- var i = v;
154
- return typeof i == "function" ? O(i, n) : v = n, f(n, "aria-controls", $), g(n, () => e.trigger), g(r, l(y, {
153
+ var n = g;
154
+ return typeof n == "function" ? D(n, o) : g = o, d(o, "aria-controls", $), f(o, () => e.trigger), f(t, l(y, {
155
155
  get when() {
156
- return o.mounted();
156
+ return a.mounted();
157
157
  },
158
158
  get children() {
159
159
  return l(W, {
160
160
  get mount() {
161
- return m.mount();
161
+ return w.mount();
162
162
  },
163
163
  get children() {
164
- var t = H(), s = h;
165
- return typeof s == "function" ? O(s, t) : h = t, f(t, "data-floe-dropdown", b), G(t, J({
164
+ var r = K(), u = h;
165
+ return typeof u == "function" ? D(u, r) : h = r, d(r, "data-floe-dropdown", v), G(r, J({
166
166
  get class() {
167
- return k(m.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu");
167
+ return S(w.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu");
168
168
  },
169
169
  get "data-floating-presence"() {
170
- return o.state();
170
+ return a.state();
171
171
  },
172
172
  get "aria-hidden"() {
173
- return o.exiting() ? "true" : void 0;
173
+ return a.exiting() ? "true" : void 0;
174
174
  }
175
175
  }, () => ({
176
- [X]: m.isSurfaceMode() ? "true" : void 0
176
+ [X]: w.isSurfaceMode() ? "true" : void 0
177
177
  }), {
178
178
  get style() {
179
179
  return {
180
- left: `${m.projectPosition(B()).x}px`,
181
- top: `${m.projectPosition(B()).y}px`
180
+ left: `${w.projectPosition(q()).x}px`,
181
+ top: `${w.projectPosition(q()).y}px`
182
182
  };
183
183
  },
184
184
  role: "menu",
185
185
  "data-floe-surface": "floating",
186
186
  id: $,
187
- onKeyDown: q
188
- }), !1, !0), g(t, l(V, {
187
+ onKeyDown: _
188
+ }), !1, !0), f(r, l(V, {
189
189
  get each() {
190
- return e.items;
190
+ return M();
191
191
  },
192
- children: (u) => l(y, {
192
+ children: (m) => l(y, {
193
193
  get when() {
194
- return !u().separator;
194
+ return !m().separator;
195
195
  },
196
196
  get fallback() {
197
197
  return Z();
@@ -199,25 +199,25 @@ function $e(e) {
199
199
  get children() {
200
200
  return l(ee, {
201
201
  get item() {
202
- return u();
202
+ return m();
203
203
  },
204
204
  get selected() {
205
- return e.value === u().id;
205
+ return e.value === m().id;
206
206
  },
207
- onSelect: j,
208
- onCloseMenu: () => d(!1),
209
- dropdownId: b,
210
- portalLayout: m
207
+ onSelect: F,
208
+ onCloseMenu: () => s(!1),
209
+ dropdownId: v,
210
+ portalLayout: w
211
211
  });
212
212
  }
213
213
  })
214
- })), t;
214
+ })), r;
215
215
  }
216
216
  });
217
217
  }
218
- }), null), F((t) => {
219
- var s = k("relative inline-block", e.class), u = k("cursor-pointer", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), x = e.disabled ? -1 : 0, a = c(), S = e.triggerAriaLabel, E = e.disabled ? "true" : void 0, p = e.triggerInputSurface ? "true" : void 0, L = e.triggerInputSurface ? "inset" : void 0;
220
- return s !== t.e && D(r, t.e = s), u !== t.t && D(n, t.t = u), x !== t.a && f(n, "tabindex", t.a = x), a !== t.o && f(n, "aria-expanded", t.o = a), S !== t.i && f(n, "aria-label", t.i = S), E !== t.n && f(n, "aria-disabled", t.n = E), p !== t.s && f(n, "data-floe-input-surface", t.s = p), L !== t.h && f(n, "data-floe-surface", t.h = L), t;
218
+ }), null), B((r) => {
219
+ var u = S("relative inline-block", e.class), m = S("cursor-pointer", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), i = e.disabled ? -1 : 0, x = c(), R = e.triggerAriaLabel, E = e.disabled ? "true" : void 0, L = e.triggerInputSurface ? "true" : void 0, I = e.triggerInputSurface ? "inset" : void 0;
220
+ return u !== r.e && p(t, r.e = u), m !== r.t && p(o, r.t = m), i !== r.a && d(o, "tabindex", r.a = i), x !== r.o && d(o, "aria-expanded", r.o = x), R !== r.i && d(o, "aria-label", r.i = R), E !== r.n && d(o, "aria-disabled", r.n = E), L !== r.s && d(o, "data-floe-input-surface", r.s = L), I !== r.h && d(o, "data-floe-surface", r.h = I), r;
221
221
  }, {
222
222
  e: void 0,
223
223
  t: void 0,
@@ -227,109 +227,109 @@ function $e(e) {
227
227
  n: void 0,
228
228
  s: void 0,
229
229
  h: void 0
230
- }), r;
230
+ }), t;
231
231
  })();
232
232
  }
233
233
  function ee(e) {
234
- const [c, d] = _(!1), o = () => e.item.children && e.item.children.length > 0, M = Y({
235
- open: () => !!(c() && o())
236
- }), [v, h] = _({
234
+ const [c, s] = j(!1), a = () => e.item.children && e.item.children.length > 0, k = Y({
235
+ open: () => !!(c() && a())
236
+ }), [g, h] = j({
237
237
  x: -9999,
238
238
  y: -9999
239
239
  });
240
- let b, $, w, m;
241
- const A = `floe-dropdown-item-${Me += 1}`;
240
+ let v, $, M, b;
241
+ const w = `floe-dropdown-item-${Me += 1}`;
242
242
  Q(() => {
243
- M.mounted() || h({
243
+ k.mounted() || h({
244
244
  x: -9999,
245
245
  y: -9999
246
246
  });
247
247
  });
248
248
  const C = () => {
249
- if (!b || !w) return;
250
- const n = b.getBoundingClientRect(), i = w.getBoundingClientRect(), t = de(n, i, e.portalLayout.boundaryRect());
251
- h(t);
252
- }, j = () => {
253
- o() && (clearTimeout(m), m = setTimeout(() => {
254
- d(!0), requestAnimationFrame(C);
249
+ if (!v || !M) return;
250
+ const t = v.getBoundingClientRect(), o = M.getBoundingClientRect(), n = ce(t, o, e.portalLayout.boundaryRect());
251
+ h(n);
252
+ }, T = () => {
253
+ a() && (clearTimeout(b), b = setTimeout(() => {
254
+ s(!0), requestAnimationFrame(C);
255
255
  }, 100));
256
- }, R = () => {
257
- o() && (clearTimeout(m), m = void 0, !e.item.keepOpen && (m = setTimeout(() => {
258
- d(!1);
256
+ }, F = () => {
257
+ a() && (clearTimeout(b), b = void 0, !e.item.keepOpen && (b = setTimeout(() => {
258
+ s(!1);
259
259
  }, 150)));
260
- }, T = (n) => {
260
+ }, A = (t) => {
261
261
  if (!e.item.disabled) {
262
262
  if (e.item.content && e.item.keepOpen) {
263
- n.stopPropagation();
263
+ t.stopPropagation();
264
264
  return;
265
265
  }
266
- o() ? (d((i) => !i), requestAnimationFrame(C)) : e.item.content || e.onSelect(e.item);
266
+ a() ? (s((o) => !o), requestAnimationFrame(C)) : e.item.content || e.onSelect(e.item);
267
267
  }
268
- }, q = (n = "first") => {
269
- o() && (d(!0), requestAnimationFrame(() => {
270
- C(), I(w, n);
268
+ }, H = (t = "first") => {
269
+ a() && (s(!0), requestAnimationFrame(() => {
270
+ C(), O(M, t);
271
271
  }));
272
- }, r = () => {
273
- d(!1), requestAnimationFrame(() => $?.focus());
272
+ }, _ = () => {
273
+ s(!1), requestAnimationFrame(() => $?.focus());
274
274
  };
275
275
  return (() => {
276
- var n = ye();
277
- n.addEventListener("mouseleave", R), n.addEventListener("mouseenter", j);
278
- var i = b;
279
- return typeof i == "function" ? O(i, n) : b = n, g(n, l(y, {
276
+ var t = ye();
277
+ t.addEventListener("mouseleave", F), t.addEventListener("mouseenter", T);
278
+ var o = v;
279
+ return typeof o == "function" ? D(o, t) : v = t, f(t, l(y, {
280
280
  get when() {
281
281
  return e.item.content;
282
282
  },
283
283
  get children() {
284
- var t = H();
285
- return t.$$click = T, g(t, e.item.content), F((s) => {
286
- var u = k("w-full px-2 py-1.5", e.item.tone === "danger" && "text-destructive", e.item.disabled && "opacity-50 pointer-events-none"), x = e.item.tone ?? "default";
287
- return u !== s.e && D(t, s.e = u), x !== s.t && f(t, "data-tone", s.t = x), s;
284
+ var n = K();
285
+ return n.$$click = A, f(n, e.item.content), B((r) => {
286
+ var u = S("w-full px-2 py-1.5", e.item.tone === "danger" && "text-destructive", e.item.disabled && "opacity-50 pointer-events-none"), m = e.item.tone ?? "default";
287
+ return u !== r.e && p(n, r.e = u), m !== r.t && d(n, "data-tone", r.t = m), r;
288
288
  }, {
289
289
  e: void 0,
290
290
  t: void 0
291
- }), t;
291
+ }), n;
292
292
  }
293
- }), null), g(n, l(y, {
293
+ }), null), f(t, l(y, {
294
294
  get when() {
295
295
  return !e.item.content;
296
296
  },
297
297
  get children() {
298
- var t = we(), s = t.firstChild, u = s.nextSibling;
299
- t.$$keydown = (a) => {
300
- e.item.disabled || o() && ((a.key === "ArrowRight" || a.key === "Enter" || a.key === " ") && (a.preventDefault(), q("first")), a.key === "ArrowLeft" && (a.preventDefault(), r()));
301
- }, t.$$click = T;
302
- var x = $;
303
- return typeof x == "function" ? O(x, t) : $ = t, f(t, "id", A), g(s, l(y, {
298
+ var n = we(), r = n.firstChild, u = r.nextSibling;
299
+ n.$$keydown = (i) => {
300
+ e.item.disabled || a() && ((i.key === "ArrowRight" || i.key === "Enter" || i.key === " ") && (i.preventDefault(), H("first")), i.key === "ArrowLeft" && (i.preventDefault(), _()));
301
+ }, n.$$click = A;
302
+ var m = $;
303
+ return typeof m == "function" ? D(m, n) : $ = n, d(n, "id", w), f(r, l(y, {
304
304
  get when() {
305
- return z(() => !!e.selected)() && !o();
305
+ return z(() => !!e.selected)() && !a();
306
306
  },
307
307
  get children() {
308
308
  return l(ie, {
309
309
  class: "w-3 h-3"
310
310
  });
311
311
  }
312
- })), g(t, l(y, {
312
+ })), f(n, l(y, {
313
313
  get when() {
314
314
  return e.item.icon;
315
315
  },
316
316
  keyed: !0,
317
- children: (a) => (() => {
318
- var S = xe();
319
- return g(S, a), S;
317
+ children: (i) => (() => {
318
+ var x = xe();
319
+ return f(x, i), x;
320
320
  })()
321
- }), u), g(u, () => e.item.label), g(t, l(y, {
321
+ }), u), f(u, () => e.item.label), f(n, l(y, {
322
322
  get when() {
323
- return o();
323
+ return a();
324
324
  },
325
325
  get children() {
326
326
  return l(ue, {
327
327
  class: "w-3 h-3 text-muted-foreground"
328
328
  });
329
329
  }
330
- }), null), F((a) => {
331
- var S = k("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.tone === "danger" && "text-destructive", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), E = e.item.disabled, p = o() ? "menu" : void 0, L = o() ? c() : void 0, K = e.selected && !o() ? "true" : void 0, N = e.item.tone ?? "default";
332
- return S !== a.e && D(t, a.e = S), E !== a.t && (t.disabled = a.t = E), p !== a.a && f(t, "aria-haspopup", a.a = p), L !== a.o && f(t, "aria-expanded", a.o = L), K !== a.i && f(t, "data-floe-selected", a.i = K), N !== a.n && f(t, "data-tone", a.n = N), a;
330
+ }), null), B((i) => {
331
+ var x = S("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.tone === "danger" && "text-destructive", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), R = e.item.disabled, E = a() ? "menu" : void 0, L = a() ? c() : void 0, I = e.selected && !a() ? "true" : void 0, N = e.item.tone ?? "default";
332
+ return x !== i.e && p(n, i.e = x), R !== i.t && (n.disabled = i.t = R), E !== i.a && d(n, "aria-haspopup", i.a = E), L !== i.o && d(n, "aria-expanded", i.o = L), I !== i.i && d(n, "data-floe-selected", i.i = I), N !== i.n && d(n, "data-tone", i.n = N), i;
333
333
  }, {
334
334
  e: void 0,
335
335
  t: void 0,
@@ -337,11 +337,11 @@ function ee(e) {
337
337
  o: void 0,
338
338
  i: void 0,
339
339
  n: void 0
340
- }), t;
340
+ }), n;
341
341
  }
342
- }), null), g(n, l(y, {
342
+ }), null), f(t, l(y, {
343
343
  get when() {
344
- return z(() => !!M.mounted())() && o();
344
+ return z(() => !!k.mounted())() && a();
345
345
  },
346
346
  get children() {
347
347
  return l(W, {
@@ -349,40 +349,40 @@ function ee(e) {
349
349
  return e.portalLayout.mount();
350
350
  },
351
351
  get children() {
352
- var t = H(), s = w;
353
- return typeof s == "function" ? O(s, t) : w = t, G(t, J({
352
+ var n = K(), r = M;
353
+ return typeof r == "function" ? D(r, n) : M = n, G(n, J({
354
354
  get class() {
355
- return k(e.portalLayout.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu floe-floating-submenu");
355
+ return S(e.portalLayout.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu floe-floating-submenu");
356
356
  },
357
357
  get "data-floe-dropdown"() {
358
358
  return e.dropdownId;
359
359
  },
360
360
  get "data-floating-presence"() {
361
- return M.state();
361
+ return k.state();
362
362
  },
363
363
  get "aria-hidden"() {
364
- return M.exiting() ? "true" : void 0;
364
+ return k.exiting() ? "true" : void 0;
365
365
  }
366
366
  }, () => ({
367
367
  [X]: e.portalLayout.isSurfaceMode() ? "true" : void 0
368
368
  }), {
369
369
  get style() {
370
370
  return {
371
- left: `${e.portalLayout.projectPosition(v()).x}px`,
372
- top: `${e.portalLayout.projectPosition(v()).y}px`
371
+ left: `${e.portalLayout.projectPosition(g()).x}px`,
372
+ top: `${e.portalLayout.projectPosition(g()).y}px`
373
373
  };
374
374
  },
375
375
  role: "menu",
376
376
  "data-floe-surface": "floating",
377
- "aria-labelledby": A,
377
+ "aria-labelledby": w,
378
378
  onMouseEnter: () => {
379
- clearTimeout(m);
379
+ clearTimeout(b);
380
380
  },
381
- onMouseLeave: R,
381
+ onMouseLeave: F,
382
382
  onKeyDown: (u) => {
383
- u.key !== "ArrowLeft" && u.key !== "Escape" || (u.preventDefault(), u.stopPropagation(), r());
383
+ u.key !== "ArrowLeft" && u.key !== "Escape" || (u.preventDefault(), u.stopPropagation(), _());
384
384
  }
385
- }), !1, !0), g(t, l(V, {
385
+ }), !1, !0), f(n, l(V, {
386
386
  get each() {
387
387
  return e.item.children;
388
388
  },
@@ -414,33 +414,33 @@ function ee(e) {
414
414
  });
415
415
  }
416
416
  })
417
- })), t;
417
+ })), n;
418
418
  }
419
419
  });
420
420
  }
421
- }), null), n;
421
+ }), null), t;
422
422
  })();
423
423
  }
424
424
  function Fe(e) {
425
- const c = () => e.options.find((o) => o.value === e.value), d = () => e.options.map((o) => ({
426
- id: o.value,
427
- label: o.label
425
+ const c = () => e.options.find((a) => a.value === e.value), s = () => e.options.map((a) => ({
426
+ id: a.value,
427
+ label: a.label
428
428
  }));
429
429
  return l($e, {
430
430
  triggerInputSurface: !0,
431
431
  get triggerClass() {
432
- return k("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-[length:var(--floe-type-control)] shadow-sm", "transition-colors duration-100", e.class);
432
+ return S("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-[length:var(--floe-type-control)] shadow-sm", "transition-colors duration-100", e.class);
433
433
  },
434
434
  get trigger() {
435
435
  return [(() => {
436
- var o = Se();
437
- return g(o, () => c()?.label ?? e.placeholder ?? "Select..."), F(() => D(o, k("truncate", !c() && "text-muted-foreground"))), o;
436
+ var a = Se();
437
+ return f(a, () => c()?.label ?? e.placeholder ?? "Select..."), B(() => p(a, S("truncate", !c() && "text-muted-foreground"))), a;
438
438
  })(), l(ae, {
439
439
  class: "w-3.5 h-3.5 text-muted-foreground"
440
440
  })];
441
441
  },
442
442
  get items() {
443
- return d();
443
+ return s();
444
444
  },
445
445
  get value() {
446
446
  return e.value;
@@ -1,10 +1,10 @@
1
- import { createComponent as l, Portal as Ke, spread as Pe, mergeProps as Re, memo as W, insert as c, effect as f, setAttribute as et, addEventListener as p, className as w, template as a, use as Ae, delegateEvents as tt } from "solid-js/web";
1
+ import { createComponent as l, Portal as Ke, spread as Ie, mergeProps as Re, memo as W, insert as c, effect as f, setAttribute as et, addEventListener as p, className as w, template as a, use as Ce, delegateEvents as tt } from "solid-js/web";
2
2
  import { createSignal as g, createUniqueId as nt, onCleanup as F, onMount as it, createEffect as z, untrack as q, Show as m, batch as ne } from "solid-js";
3
- import { cn as Y } from "../../utils/cn.js";
3
+ import { cn as X } from "../../utils/cn.js";
4
4
  import { useOptionalLayout as ot } from "../../context/LayoutContext.js";
5
5
  import { useResolvedFloeConfig as rt } from "../../context/FloeConfigContext.js";
6
6
  import { useMediaQuery as lt } from "../../hooks/useMediaQuery.js";
7
- import { Button as Ce } from "./Button.js";
7
+ import { Button as Ae } from "./Button.js";
8
8
  import { Restore as at, Maximize as st, X as dt } from "../icons/index.js";
9
9
  import { startHotInteraction as ct } from "../../utils/hotInteraction.js";
10
10
  import { startPointerSession as ut } from "./pointerSession.js";
@@ -13,34 +13,34 @@ import { observeViewport as wt } from "../../viewport.js";
13
13
  import { createFloatingPresence as gt } from "./floatingPresence.js";
14
14
  import { LOCAL_INTERACTION_SURFACE_ATTR as Ee } from "./localInteractionSurface.js";
15
15
  import { resolveFloatingBoundary as mt } from "./surfaceFloatingBoundary.js";
16
- import { SURFACE_PORTAL_LAYER_ATTR as vt, resolveSurfacePortalHost as xt, SURFACE_FLOATING_LAYER_ATTR as yt } from "./dialogSurfaceScope.js";
17
- var bt = /* @__PURE__ */ a("<span hidden>"), pt = /* @__PURE__ */ a('<span data-floe-floating-window-title-icon=true aria-hidden=true class="flex size-4 shrink-0 items-center justify-center">'), zt = /* @__PURE__ */ a('<h2 class="flex min-w-0 items-center gap-2 text-xs leading-none font-medium select-none"><span class="min-w-0 truncate">'), $t = /* @__PURE__ */ a('<div data-floe-floating-window-header-actions=true class="flex shrink-0 cursor-default items-center gap-1"><span aria-hidden=true class="mx-2 h-4 w-px shrink-0 bg-border">'), _t = /* @__PURE__ */ a('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), St = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), It = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), Pt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), Rt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), At = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), Ct = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), Et = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), Ft = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), kt = /* @__PURE__ */ a('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="min-h-0 flex-1 overflow-auto overscroll-contain p-3">');
18
- function Qt(n) {
19
- const oe = () => n.resizable ?? !0, N = () => n.maximizable ?? !0, re = () => n.draggable ?? !0, le = () => n.minSize ?? {
16
+ import { SURFACE_PORTAL_LAYER_ATTR as vt, resolveSurfacePortalHost as xt } from "./dialogSurfaceScope.js";
17
+ var yt = /* @__PURE__ */ a("<span hidden>"), bt = /* @__PURE__ */ a('<span data-floe-floating-window-title-icon=true aria-hidden=true class="flex size-4 shrink-0 items-center justify-center">'), pt = /* @__PURE__ */ a('<h2 class="flex min-w-0 items-center gap-2 text-xs leading-none font-medium select-none"><span class="min-w-0 truncate">'), zt = /* @__PURE__ */ a('<div data-floe-floating-window-header-actions=true class="flex shrink-0 cursor-default items-center gap-1"><span aria-hidden=true class="mx-2 h-4 w-px shrink-0 bg-border">'), $t = /* @__PURE__ */ a('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), _t = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), St = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), Pt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), It = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), Rt = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), Ct = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), At = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), Et = /* @__PURE__ */ a("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), Ft = /* @__PURE__ */ a('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="min-h-0 flex-1 overflow-auto overscroll-contain p-3">');
18
+ function Gt(n) {
19
+ const oe = () => n.resizable ?? !0, Y = () => n.maximizable ?? !0, re = () => n.draggable ?? !0, le = () => n.minSize ?? {
20
20
  width: 200,
21
21
  height: 150
22
22
  }, ae = () => n.maxSize ?? {
23
23
  width: 1 / 0,
24
24
  height: 1 / 0
25
25
  };
26
- let X;
27
- const [k, Fe] = g(), [A, ke] = g({
26
+ let H;
27
+ const [k, Fe] = g(), [C, ke] = g({
28
28
  x: 0,
29
29
  y: 0,
30
30
  width: 0,
31
31
  height: 0
32
32
  }, {
33
33
  equals: (e, t) => e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height
34
- }), [H, Le] = g(!0), h = () => !!(n.compactBelow && A().width < n.compactBelow), S = () => n.viewportInsets, I = () => k()?.fixedScale ?? 1, U = (e) => ({
35
- x: (e.x + (k()?.fixedOffset.left ?? 0)) / I(),
36
- y: (e.y + (k()?.fixedOffset.top ?? 0)) / I()
37
- }), Me = () => n.zIndex ?? 100, Te = nt(), Oe = ot(), Be = rt(), L = Oe?.isMobile ?? lt(() => Be.config.layout.mobileQuery), se = 16, de = () => `floating-window-${Te}-title`, [V, De] = g(n.defaultPosition ?? {
34
+ }), [N, Me] = g(!0), h = () => !!(n.compactBelow && C().width < n.compactBelow), S = () => n.viewportInsets, P = () => k()?.fixedScale ?? 1, V = (e) => ({
35
+ x: (e.x + (k()?.fixedOffset.left ?? 0)) / P(),
36
+ y: (e.y + (k()?.fixedOffset.top ?? 0)) / P()
37
+ }), Oe = () => n.zIndex ?? 100, Le = nt(), Be = ot(), De = rt(), M = Be?.isMobile ?? lt(() => De.config.layout.mobileQuery), se = 16, de = () => `floating-window-${Le}-title`, [j, Te] = g(n.defaultPosition ?? {
38
38
  x: 0,
39
39
  y: 0
40
- }), [j, We] = g(n.defaultSize ?? {
40
+ }), [U, We] = g(n.defaultSize ?? {
41
41
  width: 400,
42
42
  height: 300
43
- }), [d, ce] = g(!1), [M, ue] = g(!1), [T, fe] = g(!1), [qe, G] = g(!1), P = gt({
43
+ }), [d, ce] = g(!1), [O, ue] = g(!1), [L, fe] = g(!1), [qe, G] = g(!1), I = gt({
44
44
  open: () => n.open
45
45
  });
46
46
  let he = {
@@ -59,10 +59,10 @@ function Qt(n) {
59
59
  y: 0,
60
60
  width: 0,
61
61
  height: 0
62
- }, ve = "se", s, u = null, O, v = null, C = {
62
+ }, ve = "se", s, u = null, B, v = null, A = {
63
63
  x: 0,
64
64
  y: 0
65
- }, R = null, B = null, Q = !1, $ = {
65
+ }, R = null, D = null, Q = !1, $ = {
66
66
  x: n.defaultPosition?.x ?? 0,
67
67
  y: n.defaultPosition?.y ?? 0,
68
68
  width: n.defaultSize?.width ?? 400,
@@ -74,12 +74,12 @@ function Qt(n) {
74
74
  x = {
75
75
  ...e
76
76
  };
77
- const t = ie(A(), S());
77
+ const t = ie(C(), S());
78
78
  _ = {
79
79
  x: t.width > e.width ? (e.x - t.x) / (t.width - e.width) : _?.x ?? 0.5,
80
80
  y: t.height > e.height ? (e.y - t.y) / (t.height - e.height) : _?.y ?? 0.5
81
81
  };
82
- }, Ye = {
82
+ }, Xe = {
83
83
  n: "ns-resize",
84
84
  s: "ns-resize",
85
85
  e: "ew-resize",
@@ -90,20 +90,20 @@ function Qt(n) {
90
90
  sw: "nesw-resize"
91
91
  }, Z = (e, t) => {
92
92
  if (!e) {
93
- B?.(), B = null;
93
+ D?.(), D = null;
94
94
  return;
95
95
  }
96
- B?.(), B = ct({
96
+ D?.(), D = ct({
97
97
  kind: v === "resize" ? "resize" : "drag",
98
98
  cursor: t,
99
99
  lockUserSelect: !0
100
100
  });
101
101
  }, ye = (e) => {
102
102
  if ($ = e, !s) return;
103
- const t = U(e);
104
- s.style.transform = `translate3d(${t.x}px, ${t.y}px, 0)`, s.style.width = `${e.width / I()}px`, s.style.height = `${e.height / I()}px`;
105
- }, Ne = () => {
106
- const e = V(), t = j();
103
+ const t = V(e);
104
+ s.style.transform = `translate3d(${t.x}px, ${t.y}px, 0)`, s.style.width = `${e.width / P()}px`, s.style.height = `${e.height / P()}px`;
105
+ }, Ye = () => {
106
+ const e = j(), t = U();
107
107
  return {
108
108
  x: e.x,
109
109
  y: e.y,
@@ -111,27 +111,27 @@ function Qt(n) {
111
111
  height: t.height
112
112
  };
113
113
  }, J = (e) => {
114
- $ = e, De((t) => t.x === e.x && t.y === e.y ? t : {
114
+ $ = e, Te((t) => t.x === e.x && t.y === e.y ? t : {
115
115
  x: e.x,
116
116
  y: e.y
117
117
  }), We((t) => t.width === e.width && t.height === e.height ? t : {
118
118
  width: e.width,
119
119
  height: e.height
120
120
  });
121
- }, Xe = () => {
121
+ }, He = () => {
122
122
  try {
123
123
  s?.focus({
124
124
  preventScroll: !0
125
125
  });
126
126
  } catch {
127
127
  }
128
- }, He = (e) => {
128
+ }, Ne = (e) => {
129
129
  const t = e instanceof Element ? e : null;
130
130
  return t ? t.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
131
- }, K = (e) => !!s && e instanceof Node && s.contains(e), Ue = (e) => {
132
- const o = (e instanceof Element ? e : null)?.closest('[role="menu"]')?.closest(`[${yt}="true"]`);
131
+ }, K = (e) => !!s && e instanceof Node && s.contains(e), Ve = (e) => {
132
+ const o = (e instanceof Element ? e : null)?.closest('[role="menu"], [role="dialog"]')?.closest('[data-floe-surface-floating-layer="true"], [data-floe-dropdown]');
133
133
  return !!(o && s?.contains(o));
134
- }, Ve = () => {
134
+ }, je = () => {
135
135
  if (!s) return null;
136
136
  const e = s.getBoundingClientRect();
137
137
  return {
@@ -143,7 +143,7 @@ function Qt(n) {
143
143
  }, be = () => {
144
144
  n.open && (u === null || v === null || typeof window > "u" || ye(ht({
145
145
  mode: v,
146
- pointer: C,
146
+ pointer: A,
147
147
  dragStartPos: he,
148
148
  dragStartRect: we,
149
149
  resizeStartPos: ge,
@@ -151,14 +151,14 @@ function Qt(n) {
151
151
  resizeHandle: ve,
152
152
  minSize: le(),
153
153
  maxSize: ae(),
154
- viewport: A(),
154
+ viewport: C(),
155
155
  viewportInsets: S(),
156
- mobile: L(),
156
+ mobile: M(),
157
157
  mobilePadding: se
158
158
  })));
159
159
  }, E = (e) => {
160
160
  if (typeof window > "u") return;
161
- const t = A();
161
+ const t = C();
162
162
  if (d() || h()) {
163
163
  J(ie(t, S()));
164
164
  return;
@@ -169,7 +169,7 @@ function Qt(n) {
169
169
  maxSize: ae(),
170
170
  viewport: t,
171
171
  viewportInsets: S(),
172
- mobile: n.boundary === void 0 && L(),
172
+ mobile: n.boundary === void 0 && M(),
173
173
  mobilePadding: se,
174
174
  center: e?.center ?? !1
175
175
  });
@@ -190,7 +190,7 @@ function Qt(n) {
190
190
  }
191
191
  }, pe = (e) => {
192
192
  R !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(R), R = null), e && be();
193
- const t = e ? Ve() ?? $ : null;
193
+ const t = e ? je() ?? $ : null;
194
194
  ne(() => {
195
195
  if (t) {
196
196
  J(t);
@@ -201,9 +201,9 @@ function Qt(n) {
201
201
  xe(t), v === "drag" && Object.assign(x, r);
202
202
  }
203
203
  u = null, v = null, ue(!1), fe(!1);
204
- }), Z(!1, ""), O = void 0;
204
+ }), Z(!1, ""), B = void 0;
205
205
  }, ee = (e = !1) => {
206
- O ? O.stop({
206
+ B ? B.stop({
207
207
  commit: e
208
208
  }) : pe(e);
209
209
  };
@@ -213,10 +213,10 @@ function Qt(n) {
213
213
  boundaryHost: null,
214
214
  mode: "global"
215
215
  } : xt({
216
- owner: X
216
+ owner: H
217
217
  }), o = mt(r, n.boundary, t?.safeArea);
218
218
  ne(() => {
219
- Le(!!(o && o.width > 16 && o.height > 16)), ke(o ? {
219
+ Me(!!(o && o.width > 16 && o.height > 16)), ke(o ? {
220
220
  x: o.left,
221
221
  y: o.top,
222
222
  width: o.width,
@@ -245,7 +245,7 @@ function Qt(n) {
245
245
  });
246
246
  }), z(() => {
247
247
  if (!n.open) return;
248
- L();
248
+ M();
249
249
  const e = !Q && !n.defaultPosition, t = () => {
250
250
  E({
251
251
  center: e
@@ -257,11 +257,11 @@ function Qt(n) {
257
257
  }
258
258
  requestAnimationFrame(t);
259
259
  }), z(() => {
260
- S(), A(), h(), !(!n.open || !Q || u !== null) && q(() => E({
260
+ S(), C(), h(), !(!n.open || !Q || u !== null) && q(() => E({
261
261
  center: !1
262
262
  }));
263
263
  }), z(() => {
264
- N() || !d() || q(() => {
264
+ Y() || !d() || q(() => {
265
265
  ce(!1), E({
266
266
  center: !1
267
267
  });
@@ -271,7 +271,7 @@ function Qt(n) {
271
271
  const e = (t) => {
272
272
  if (t.key !== "Escape") return;
273
273
  const r = typeof document < "u" ? document.activeElement : null;
274
- !K(t.target) && !K(r) || Ue(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), n.onOpenChange(!1));
274
+ !K(t.target) && !K(r) || Ve(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), n.onOpenChange(!1));
275
275
  };
276
276
  document.addEventListener("keydown", e, !0), F(() => document.removeEventListener("keydown", e, !0));
277
277
  }), z(() => {
@@ -294,16 +294,16 @@ function Qt(n) {
294
294
  });
295
295
  }), z(() => {
296
296
  if (!n.open) return;
297
- const e = Ne();
297
+ const e = Ye();
298
298
  u === null ? ye(e) : $ = e;
299
299
  });
300
- const je = (e) => {
300
+ const Ue = (e) => {
301
301
  !re() || d() || h() || u !== null || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"], [data-floe-floating-window-header-actions]') || (e.preventDefault(), u = e.pointerId, v = "drag", ue(!0), he = {
302
302
  x: e.clientX,
303
303
  y: e.clientY
304
304
  }, we = {
305
305
  ...$
306
- }, C = {
306
+ }, A = {
307
307
  x: e.clientX,
308
308
  y: e.clientY
309
309
  }, Z(!0, "grabbing"), $e(e));
@@ -313,14 +313,14 @@ function Qt(n) {
313
313
  y: t.clientY
314
314
  }, me = {
315
315
  ...$
316
- }, C = {
316
+ }, A = {
317
317
  x: t.clientX,
318
318
  y: t.clientY
319
- }, Z(!0, Ye[e]), $e(t));
319
+ }, Z(!0, Xe[e]), $e(t));
320
320
  }, ze = () => {
321
321
  R = null, be();
322
322
  }, Ge = (e) => {
323
- if (!(u === null || e.pointerId !== u) && v !== null && (C = {
323
+ if (!(u === null || e.pointerId !== u) && v !== null && (A = {
324
324
  x: e.clientX,
325
325
  y: e.clientY
326
326
  }, R === null)) {
@@ -331,7 +331,7 @@ function Qt(n) {
331
331
  R = requestAnimationFrame(ze);
332
332
  }
333
333
  }, $e = (e) => {
334
- O = ut({
334
+ B = ut({
335
335
  pointerEvent: e,
336
336
  captureEl: s,
337
337
  onMove: Ge,
@@ -340,19 +340,19 @@ function Qt(n) {
340
340
  reason: r,
341
341
  snapshot: o
342
342
  }) => {
343
- C = {
343
+ A = {
344
344
  x: o.latestClientX,
345
345
  y: o.latestClientY
346
346
  }, pe(t || r === "pointer_cancel");
347
347
  }
348
348
  });
349
349
  }, _e = () => {
350
- !N() || h() || (u !== null && ee(!0), ce(!d()), E());
350
+ !Y() || h() || (u !== null && ee(!0), ce(!d()), E());
351
351
  }, Qe = (e) => {
352
352
  e.target?.closest("button, [data-floe-floating-window-header-actions]") || _e();
353
353
  }, Ze = (e) => {
354
- He(e.target) && Xe();
355
- }, b = (e) => Y("absolute z-10", {
354
+ Ne(e.target) && He();
355
+ }, b = (e) => X("absolute z-10", {
356
356
  n: "cursor-ns-resize top-0 left-2 right-2 h-1",
357
357
  s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
358
358
  e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
@@ -363,25 +363,25 @@ function Qt(n) {
363
363
  sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
364
364
  }[e]);
365
365
  return [(() => {
366
- var e = bt(), t = X;
367
- return typeof t == "function" ? Ae(t, e) : X = e, e;
366
+ var e = yt(), t = H;
367
+ return typeof t == "function" ? Ce(t, e) : H = e, e;
368
368
  })(), l(m, {
369
369
  get when() {
370
- return P.mounted();
370
+ return I.mounted();
371
371
  },
372
372
  get children() {
373
373
  return l(Ke, {
374
374
  get children() {
375
- var e = kt(), t = e.firstChild, r = t.firstChild, o = r.firstChild, te = o.nextSibling, Je = r.nextSibling, Se = s;
376
- return typeof Se == "function" ? Ae(Se, e) : s = e, Pe(e, Re({
375
+ var e = Ft(), t = e.firstChild, r = t.firstChild, o = r.firstChild, te = o.nextSibling, Je = r.nextSibling, Se = s;
376
+ return typeof Se == "function" ? Ce(Se, e) : s = e, Ie(e, Re({
377
377
  get "data-floating-presence"() {
378
- return P.state();
378
+ return I.state();
379
379
  },
380
380
  get "aria-hidden"() {
381
- return P.exiting() || !H() ? "true" : void 0;
381
+ return I.exiting() || !N() ? "true" : void 0;
382
382
  },
383
383
  get inert() {
384
- return P.exiting() || !H();
384
+ return I.exiting() || !N();
385
385
  },
386
386
  get "data-floe-floating-window-compact"() {
387
387
  return h() ? "true" : void 0;
@@ -390,16 +390,16 @@ function Qt(n) {
390
390
  [Ee]: "true"
391
391
  }, {
392
392
  get class() {
393
- return Y("fixed left-0 top-0 z-[100] flex flex-col", (M() || T()) && "select-none", P.exiting() && "pointer-events-none");
393
+ return X("fixed left-0 top-0 z-[100] flex flex-col", (O() || L()) && "select-none", I.exiting() && "pointer-events-none");
394
394
  },
395
395
  get style() {
396
396
  return {
397
- visibility: H() ? void 0 : "hidden",
398
- width: `${j().width / I()}px`,
399
- height: `${j().height / I()}px`,
400
- transform: `translate3d(${U(V()).x}px, ${U(V()).y}px, 0)`,
401
- "z-index": Me(),
402
- "will-change": M() ? "transform" : T() ? "transform, width, height" : void 0
397
+ visibility: N() ? void 0 : "hidden",
398
+ width: `${U().width / P()}px`,
399
+ height: `${U().height / P()}px`,
400
+ transform: `translate3d(${V(j()).x}px, ${V(j()).y}px, 0)`,
401
+ "z-index": Oe(),
402
+ "will-change": O() ? "transform" : L() ? "transform, width, height" : void 0
403
403
  };
404
404
  },
405
405
  role: "dialog",
@@ -408,13 +408,13 @@ function Qt(n) {
408
408
  },
409
409
  tabIndex: -1,
410
410
  onPointerDown: Ze
411
- }), !1, !0), Pe(t, Re({
411
+ }), !1, !0), Ie(t, Re({
412
412
  [vt]: "true"
413
413
  }, {
414
414
  "data-floe-floating-window-surface": "true",
415
415
  "data-floe-surface": "floating",
416
416
  get "data-floe-surface-interacting"() {
417
- return M() || T() ? "true" : void 0;
417
+ return O() || L() ? "true" : void 0;
418
418
  },
419
419
  get "data-floe-floating-window-state"() {
420
420
  return qe() ? "active" : "inactive";
@@ -423,7 +423,7 @@ function Qt(n) {
423
423
  [Ee]: "true"
424
424
  }, {
425
425
  get class() {
426
- return Y("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (M() || T()) && "floe-floating-presence--suspended", d() && "rounded-none", n.class);
426
+ return X("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (O() || L()) && "floe-floating-presence--suspended", d() && "rounded-none", n.class);
427
427
  },
428
428
  get style() {
429
429
  return {
@@ -431,38 +431,38 @@ function Qt(n) {
431
431
  };
432
432
  },
433
433
  get "data-floating-presence"() {
434
- return P.state();
434
+ return I.state();
435
435
  }
436
- }), !1, !0), r.$$dblclick = Qe, r.$$pointerdown = je, c(o, l(m, {
436
+ }), !1, !0), r.$$dblclick = Qe, r.$$pointerdown = Ue, c(o, l(m, {
437
437
  get when() {
438
438
  return n.title;
439
439
  },
440
440
  get children() {
441
- var i = zt(), D = i.firstChild;
441
+ var i = pt(), T = i.firstChild;
442
442
  return c(i, l(m, {
443
443
  get when() {
444
444
  return n.titleIcon;
445
445
  },
446
446
  get children() {
447
- var Ie = pt();
448
- return c(Ie, () => n.titleIcon), Ie;
447
+ var Pe = bt();
448
+ return c(Pe, () => n.titleIcon), Pe;
449
449
  }
450
- }), D), c(D, () => n.title), f(() => et(i, "id", de())), i;
450
+ }), T), c(T, () => n.title), f(() => et(i, "id", de())), i;
451
451
  }
452
452
  })), c(r, l(m, {
453
453
  get when() {
454
454
  return n.headerActions;
455
455
  },
456
456
  get children() {
457
- var i = $t(), D = i.firstChild;
458
- return c(i, () => n.headerActions, D), i;
457
+ var i = zt(), T = i.firstChild;
458
+ return c(i, () => n.headerActions, T), i;
459
459
  }
460
460
  }), te), c(te, l(m, {
461
461
  get when() {
462
- return W(() => !!N())() && !h();
462
+ return W(() => !!Y())() && !h();
463
463
  },
464
464
  get children() {
465
- return l(Ce, {
465
+ return l(Ae, {
466
466
  variant: "ghost",
467
467
  size: "icon",
468
468
  "data-floe-floating-window-control": "maximize",
@@ -492,7 +492,7 @@ function Qt(n) {
492
492
  }
493
493
  });
494
494
  }
495
- }), null), c(te, l(Ce, {
495
+ }), null), c(te, l(Ae, {
496
496
  variant: "ghost-destructive",
497
497
  size: "icon",
498
498
  "data-floe-floating-window-control": "close",
@@ -513,7 +513,7 @@ function Qt(n) {
513
513
  return n.footer;
514
514
  },
515
515
  get children() {
516
- var i = _t();
516
+ var i = $t();
517
517
  return c(i, () => n.footer), i;
518
518
  }
519
519
  }), null), c(t, l(m, {
@@ -522,39 +522,39 @@ function Qt(n) {
522
522
  },
523
523
  get children() {
524
524
  return [(() => {
525
- var i = St();
525
+ var i = _t();
526
526
  return p(i, "pointerdown", y("n"), !0), f(() => w(i, b("n"))), i;
527
527
  })(), (() => {
528
- var i = It();
528
+ var i = St();
529
529
  return p(i, "pointerdown", y("s"), !0), f(() => w(i, b("s"))), i;
530
530
  })(), l(m, {
531
531
  get when() {
532
- return !L();
532
+ return !M();
533
533
  },
534
534
  get children() {
535
535
  return [(() => {
536
536
  var i = Pt();
537
537
  return p(i, "pointerdown", y("e"), !0), f(() => w(i, b("e"))), i;
538
538
  })(), (() => {
539
- var i = Rt();
539
+ var i = It();
540
540
  return p(i, "pointerdown", y("w"), !0), f(() => w(i, b("w"))), i;
541
541
  })(), (() => {
542
- var i = At();
542
+ var i = Rt();
543
543
  return p(i, "pointerdown", y("ne"), !0), f(() => w(i, b("ne"))), i;
544
544
  })(), (() => {
545
545
  var i = Ct();
546
546
  return p(i, "pointerdown", y("nw"), !0), f(() => w(i, b("nw"))), i;
547
547
  })(), (() => {
548
- var i = Et();
548
+ var i = At();
549
549
  return p(i, "pointerdown", y("se"), !0), f(() => w(i, b("se"))), i;
550
550
  })(), (() => {
551
- var i = Ft();
551
+ var i = Et();
552
552
  return p(i, "pointerdown", y("sw"), !0), f(() => w(i, b("sw"))), i;
553
553
  })()];
554
554
  }
555
555
  })];
556
556
  }
557
- }), null), f(() => w(r, Y("flex shrink-0 items-center justify-between h-8", "border-b", d() ? "rounded-none" : "rounded-t-md", re() && !d() && !h() && "cursor-move"))), e;
557
+ }), null), f(() => w(r, X("flex shrink-0 items-center justify-between h-8", "border-b", d() ? "rounded-none" : "rounded-t-md", re() && !d() && !h() && "cursor-move"))), e;
558
558
  }
559
559
  });
560
560
  }
@@ -562,5 +562,5 @@ function Qt(n) {
562
562
  }
563
563
  tt(["pointerdown", "dblclick"]);
564
564
  export {
565
- Qt as FloatingWindow
565
+ Gt as FloatingWindow
566
566
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.86.1",
3
+ "version": "0.86.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",