@floegence/floe-webapp-core 0.86.4 → 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;
@@ -34,13 +34,13 @@ function Gt(n) {
34
34
  }), [N, Me] = g(!0), h = () => !!(n.compactBelow && C().width < n.compactBelow), S = () => n.viewportInsets, P = () => k()?.fixedScale ?? 1, V = (e) => ({
35
35
  x: (e.x + (k()?.fixedOffset.left ?? 0)) / P(),
36
36
  y: (e.y + (k()?.fixedOffset.top ?? 0)) / P()
37
- }), Le = () => n.zIndex ?? 100, Oe = nt(), Be = ot(), De = rt(), M = Be?.isMobile ?? lt(() => De.config.layout.mobileQuery), se = 16, de = () => `floating-window-${Oe}-title`, [j, Te] = g(n.defaultPosition ?? {
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
40
  }), [U, We] = g(n.defaultSize ?? {
41
41
  width: 400,
42
42
  height: 300
43
- }), [d, ce] = g(!1), [L, ue] = g(!1), [O, fe] = g(!1), [qe, G] = g(!1), I = 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 = {
@@ -129,7 +129,7 @@ function Gt(n) {
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
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"]');
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
134
  }, je = () => {
135
135
  if (!s) return null;
@@ -390,7 +390,7 @@ function Gt(n) {
390
390
  [Ee]: "true"
391
391
  }, {
392
392
  get class() {
393
- return X("fixed left-0 top-0 z-[100] flex flex-col", (L() || O()) && "select-none", I.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 {
@@ -398,8 +398,8 @@ function Gt(n) {
398
398
  width: `${U().width / P()}px`,
399
399
  height: `${U().height / P()}px`,
400
400
  transform: `translate3d(${V(j()).x}px, ${V(j()).y}px, 0)`,
401
- "z-index": Le(),
402
- "will-change": L() ? "transform" : O() ? "transform, width, height" : void 0
401
+ "z-index": Oe(),
402
+ "will-change": O() ? "transform" : L() ? "transform, width, height" : void 0
403
403
  };
404
404
  },
405
405
  role: "dialog",
@@ -414,7 +414,7 @@ function Gt(n) {
414
414
  "data-floe-floating-window-surface": "true",
415
415
  "data-floe-surface": "floating",
416
416
  get "data-floe-surface-interacting"() {
417
- return L() || O() ? "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 Gt(n) {
423
423
  [Ee]: "true"
424
424
  }, {
425
425
  get 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", (L() || O()) && "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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.86.4",
3
+ "version": "0.86.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",