@floegence/floe-webapp-core 0.51.0 → 0.52.0

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,28 +1,29 @@
1
- import { setAttribute as m, insert as v, createComponent as l, Portal as W, use as I, spread as G, mergeProps as J, effect as F, className as O, template as $, 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 k } from "../../utils/cn.js";
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 p, 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 M } from "../../utils/cn.js";
4
4
  import { deferNonBlocking as oe } from "../../utils/defer.js";
5
- import { ChevronDown as ie, Check as ae, ChevronRight as ue } from "../icons/index.js";
6
- import { focusMenuItem as D, MENU_ITEM_SELECTOR as le, moveMenuFocus as U, calculateMenuPosition as de, calculateSubmenuPosition as ce } from "./menuUtils.js";
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";
7
7
  import { LOCAL_INTERACTION_SURFACE_ATTR as X } from "./localInteractionSurface.js";
8
8
  import { createFloatingPresence as Y } from "./floatingPresence.js";
9
- import { resolveSurfacePortalHost as se, projectSurfacePortalPosition as fe, resolveSurfacePortalBoundaryRect as me, isSurfacePortalMode as ge, resolveSurfacePortalMount as ve } from "./dialogSurfaceScope.js";
10
- var B = /* @__PURE__ */ $("<div>"), he = /* @__PURE__ */ $("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), Z = /* @__PURE__ */ $('<div class="my-1 h-px bg-border"role=separator>'), be = /* @__PURE__ */ $('<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">'), we = /* @__PURE__ */ $("<div class=relative>"), ye = /* @__PURE__ */ $('<span class="w-3.5 h-3.5 flex items-center justify-center">'), xe = /* @__PURE__ */ $("<span>");
11
- let Se = 0, Me = 0;
12
- function ke(e, f) {
9
+ import { useOverlayMask as ce } from "../../hooks/useOverlayMask.js";
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>");
12
+ let Me = 0, ke = 0;
13
+ function Pe(e, c) {
13
14
  switch (e) {
14
15
  case "Enter":
15
16
  case " ":
16
- return f.open ? {
17
+ return c.open ? {
17
18
  nextOpen: !1
18
19
  } : {
19
20
  nextOpen: !0,
20
- focusMode: f.hasSelection ? "selected" : "first"
21
+ focusMode: c.hasSelection ? "selected" : "first"
21
22
  };
22
23
  case "ArrowDown":
23
24
  return {
24
25
  nextOpen: !0,
25
- focusMode: f.hasSelection ? "selected" : "first"
26
+ focusMode: c.hasSelection ? "selected" : "first"
26
27
  };
27
28
  case "ArrowUp":
28
29
  return {
@@ -33,146 +34,163 @@ function ke(e, f) {
33
34
  return null;
34
35
  }
35
36
  }
36
- function Pe(e) {
37
- const [f, c] = j(!1), a = Y({
38
- open: f,
37
+ function $e(e) {
38
+ const [c, d] = _(!1), o = Y({
39
+ open: c,
39
40
  exitDurationMs: 100
40
- }), [q, P] = j({
41
+ }), [B, k] = _({
41
42
  x: -9999,
42
43
  y: -9999
43
44
  });
44
- let x, w;
45
- const h = `floe-dropdown-${Se += 1}`, C = `${h}-menu`, b = ne(() => a.mounted() ? se() : {
45
+ let b, h;
46
+ const v = `floe-dropdown-${Me += 1}`, $ = `${v}-menu`, w = ne(() => o.mounted() ? fe({
47
+ owner: b
48
+ }) : {
46
49
  host: null,
47
50
  boundaryHost: null,
48
51
  mountHost: null,
49
52
  mode: "global"
50
- }), g = {
51
- mount: () => ve(b()),
52
- isSurfaceMode: () => ge(b()),
53
- boundaryRect: () => me(b()),
54
- projectPosition: (o) => fe(o, b())
53
+ }), m = {
54
+ mount: () => be(w()),
55
+ isSurfaceMode: () => ve(w()),
56
+ boundaryRect: () => ge(w()),
57
+ projectPosition: (r) => me(r, w())
55
58
  }, A = () => {
56
- if (!x || !w) return;
57
- const o = x.getBoundingClientRect(), r = w.getBoundingClientRect(), i = de(o, r, e.align ?? "start", g.boundaryRect());
58
- P(i);
59
+ d(!1), requestAnimationFrame(() => b?.focus());
60
+ };
61
+ ce({
62
+ open: o.mounted,
63
+ root: () => h,
64
+ containsTarget: (r) => !!(r instanceof Element ? r : document.activeElement)?.closest(`[data-floe-dropdown="${v}"]`),
65
+ onClose: A,
66
+ onEscapeOutside: A,
67
+ lockBodyScroll: !1,
68
+ trapFocus: !1,
69
+ autoFocus: !1,
70
+ restoreFocus: !1,
71
+ blockHotkeys: !1,
72
+ closeOnEscape: "inside",
73
+ escapeKeyPhase: "bubble"
74
+ });
75
+ const C = () => {
76
+ if (!b || !h) return;
77
+ const r = b.getBoundingClientRect(), n = h.getBoundingClientRect(), i = se(r, n, e.align ?? "start", m.boundaryRect());
78
+ k(i);
59
79
  };
60
80
  Q(() => {
61
- if (!a.mounted()) {
62
- P({
81
+ if (!o.mounted()) {
82
+ k({
63
83
  x: -9999,
64
84
  y: -9999
65
85
  });
66
86
  return;
67
87
  }
68
- if (!f()) return;
69
- const o = (i) => {
70
- const t = i.target;
71
- t && typeof t.closest == "function" && t.closest(`[data-floe-dropdown="${h}"]`) || c(!1);
72
- }, r = (i) => {
73
- i.key === "Escape" && (c(!1), requestAnimationFrame(() => x?.focus()));
88
+ if (!c()) return;
89
+ const r = (n) => {
90
+ const i = n.target;
91
+ i && typeof i.closest == "function" && i.closest(`[data-floe-dropdown="${v}"]`) || d(!1);
74
92
  };
75
- document.addEventListener("pointerdown", o, !0), document.addEventListener("keydown", r), requestAnimationFrame(() => {
76
- A(), D(w, e.value ? "selected" : "first");
93
+ document.addEventListener("pointerdown", r, !0), requestAnimationFrame(() => {
94
+ C(), I(h, e.value ? "selected" : "first");
77
95
  }), re(() => {
78
- document.removeEventListener("pointerdown", o, !0), document.removeEventListener("keydown", r);
96
+ document.removeEventListener("pointerdown", r, !0);
79
97
  });
80
98
  });
81
- const L = (o) => {
82
- const r = e.onSelect;
83
- o.keepOpen || c(!1), oe(() => r(o.id));
84
- }, T = (o, r = "first") => {
85
- e.disabled || (c(o), requestAnimationFrame(() => {
86
- A(), D(w, r);
99
+ const j = (r) => {
100
+ const n = e.onSelect;
101
+ r.keepOpen || d(!1), oe(() => n(r.id));
102
+ }, R = (r, n = "first") => {
103
+ e.disabled || (d(r), requestAnimationFrame(() => {
104
+ C(), I(h, n);
87
105
  }));
88
- }, p = (o) => {
106
+ }, T = (r) => {
89
107
  if (e.disabled) return;
90
- const r = ke(o.key, {
91
- open: f(),
108
+ const n = Pe(r.key, {
109
+ open: c(),
92
110
  hasSelection: !!e.value
93
111
  });
94
- if (r) {
95
- if (o.preventDefault(), !r.nextOpen) {
96
- c(!1);
112
+ if (n) {
113
+ if (r.preventDefault(), !n.nextOpen) {
114
+ d(!1);
97
115
  return;
98
116
  }
99
- T(!0, r.focusMode ?? "first");
117
+ R(!0, n.focusMode ?? "first");
100
118
  }
101
- }, _ = (o) => {
102
- const r = o.target, i = r?.closest('[role="menu"]'), t = r?.closest(le);
103
- switch (o.key) {
119
+ }, q = (r) => {
120
+ const n = r.target, i = n?.closest('[role="menu"]'), t = n?.closest(le);
121
+ switch (r.key) {
104
122
  case "ArrowDown":
105
- o.preventDefault(), U(i, t, 1);
123
+ r.preventDefault(), U(i, t, 1);
106
124
  return;
107
125
  case "ArrowUp":
108
- o.preventDefault(), U(i, t, -1);
126
+ r.preventDefault(), U(i, t, -1);
109
127
  return;
110
128
  case "Home":
111
- o.preventDefault(), D(i, "first");
129
+ r.preventDefault(), I(i, "first");
112
130
  return;
113
131
  case "End":
114
- o.preventDefault(), D(i, "last");
132
+ r.preventDefault(), I(i, "last");
115
133
  return;
116
134
  case "Tab":
117
- c(!1);
135
+ r.preventDefault(), d(!1), b?.focus();
118
136
  return;
119
137
  default:
120
138
  return;
121
139
  }
122
140
  };
123
141
  return (() => {
124
- var o = he(), r = o.firstChild;
125
- m(o, "data-floe-dropdown", h), r.$$keydown = p, r.$$click = () => {
142
+ var r = he(), n = r.firstChild;
143
+ f(r, "data-floe-dropdown", v), n.$$keydown = T, n.$$click = () => {
126
144
  if (!e.disabled) {
127
- if (f()) {
128
- c(!1);
145
+ if (c()) {
146
+ d(!1);
129
147
  return;
130
148
  }
131
- T(!0, e.value ? "selected" : "first");
149
+ R(!0, e.value ? "selected" : "first");
132
150
  }
133
151
  };
134
- var i = x;
135
- return typeof i == "function" ? I(i, r) : x = r, m(r, "aria-controls", C), v(r, () => e.trigger), v(o, l(y, {
152
+ var i = b;
153
+ return typeof i == "function" ? O(i, n) : b = n, f(n, "aria-controls", $), g(n, () => e.trigger), g(r, l(y, {
136
154
  get when() {
137
- return a.mounted();
155
+ return o.mounted();
138
156
  },
139
157
  get children() {
140
158
  return l(W, {
141
159
  get mount() {
142
- return g.mount();
160
+ return m.mount();
143
161
  },
144
162
  get children() {
145
- var t = B(), n = w;
146
- return typeof n == "function" ? I(n, t) : w = t, m(t, "data-floe-dropdown", h), G(t, J({
163
+ var t = H(), s = h;
164
+ return typeof s == "function" ? O(s, t) : h = t, f(t, "data-floe-dropdown", v), G(t, J({
147
165
  get class() {
148
- return k(g.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");
166
+ return M(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");
149
167
  },
150
168
  get "data-floating-presence"() {
151
- return a.state();
169
+ return o.state();
152
170
  },
153
171
  get "aria-hidden"() {
154
- return a.exiting() ? "true" : void 0;
172
+ return o.exiting() ? "true" : void 0;
155
173
  }
156
174
  }, () => ({
157
- [X]: g.isSurfaceMode() ? "true" : void 0
175
+ [X]: m.isSurfaceMode() ? "true" : void 0
158
176
  }), {
159
177
  get style() {
160
178
  return {
161
- left: `${g.projectPosition(q()).x}px`,
162
- top: `${g.projectPosition(q()).y}px`
179
+ left: `${m.projectPosition(B()).x}px`,
180
+ top: `${m.projectPosition(B()).y}px`
163
181
  };
164
182
  },
165
183
  role: "menu",
166
184
  "data-floe-surface": "floating",
167
- id: C,
168
- onKeyDown: _
169
- }), !1, !0), v(t, l(V, {
185
+ id: $,
186
+ onKeyDown: q
187
+ }), !1, !0), g(t, l(V, {
170
188
  get each() {
171
189
  return e.items;
172
190
  },
173
- children: (d) => l(y, {
191
+ children: (u) => l(y, {
174
192
  get when() {
175
- return !d().separator;
193
+ return !u().separator;
176
194
  },
177
195
  get fallback() {
178
196
  return Z();
@@ -180,15 +198,15 @@ function Pe(e) {
180
198
  get children() {
181
199
  return l(ee, {
182
200
  get item() {
183
- return d();
201
+ return u();
184
202
  },
185
203
  get selected() {
186
- return e.value === d().id;
204
+ return e.value === u().id;
187
205
  },
188
- onSelect: L,
189
- onCloseMenu: () => c(!1),
190
- dropdownId: h,
191
- portalLayout: g
206
+ onSelect: j,
207
+ onCloseMenu: () => d(!1),
208
+ dropdownId: v,
209
+ portalLayout: m
192
210
  });
193
211
  }
194
212
  })
@@ -197,8 +215,8 @@ function Pe(e) {
197
215
  });
198
216
  }
199
217
  }), null), F((t) => {
200
- var n = k("relative inline-block", e.class), d = k("cursor-pointer", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), s = e.disabled ? -1 : 0, S = f(), u = e.triggerAriaLabel, M = e.disabled ? "true" : void 0, R = e.triggerInputSurface ? "true" : void 0, E = e.triggerInputSurface ? "inset" : void 0;
201
- return n !== t.e && O(o, t.e = n), d !== t.t && O(r, t.t = d), s !== t.a && m(r, "tabindex", t.a = s), S !== t.o && m(r, "aria-expanded", t.o = S), u !== t.i && m(r, "aria-label", t.i = u), M !== t.n && m(r, "aria-disabled", t.n = M), R !== t.s && m(r, "data-floe-input-surface", t.s = R), E !== t.h && m(r, "data-floe-surface", t.h = E), t;
218
+ var s = M("relative inline-block", e.class), u = M("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, D = e.triggerInputSurface ? "true" : void 0, L = e.triggerInputSurface ? "inset" : void 0;
219
+ return s !== t.e && p(r, t.e = s), u !== t.t && p(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), D !== t.s && f(n, "data-floe-input-surface", t.s = D), L !== t.h && f(n, "data-floe-surface", t.h = L), t;
202
220
  }, {
203
221
  e: void 0,
204
222
  t: void 0,
@@ -208,110 +226,110 @@ function Pe(e) {
208
226
  n: void 0,
209
227
  s: void 0,
210
228
  h: void 0
211
- }), o;
229
+ }), r;
212
230
  })();
213
231
  }
214
232
  function ee(e) {
215
- const [f, c] = j(!1), a = () => e.item.children && e.item.children.length > 0, P = Y({
216
- open: () => !!(f() && a()),
233
+ const [c, d] = _(!1), o = () => e.item.children && e.item.children.length > 0, k = Y({
234
+ open: () => !!(c() && o()),
217
235
  exitDurationMs: 100
218
- }), [x, w] = j({
236
+ }), [b, h] = _({
219
237
  x: -9999,
220
238
  y: -9999
221
239
  });
222
- let h, C, b, g;
223
- const A = `floe-dropdown-item-${Me += 1}`;
240
+ let v, $, w, m;
241
+ const A = `floe-dropdown-item-${ke += 1}`;
224
242
  Q(() => {
225
- P.mounted() || w({
243
+ k.mounted() || h({
226
244
  x: -9999,
227
245
  y: -9999
228
246
  });
229
247
  });
230
- const L = () => {
231
- if (!h || !b) return;
232
- const i = h.getBoundingClientRect(), t = b.getBoundingClientRect(), n = ce(i, t, e.portalLayout.boundaryRect());
233
- w(n);
234
- }, T = () => {
235
- a() && (clearTimeout(g), g = setTimeout(() => {
236
- c(!0), requestAnimationFrame(L);
248
+ const C = () => {
249
+ if (!v || !w) return;
250
+ const n = v.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);
237
255
  }, 100));
238
- }, p = () => {
239
- a() && (clearTimeout(g), g = void 0, !e.item.keepOpen && (g = setTimeout(() => {
240
- c(!1);
256
+ }, R = () => {
257
+ o() && (clearTimeout(m), m = void 0, !e.item.keepOpen && (m = setTimeout(() => {
258
+ d(!1);
241
259
  }, 150)));
242
- }, _ = (i) => {
260
+ }, T = (n) => {
243
261
  if (!e.item.disabled) {
244
262
  if (e.item.content && e.item.keepOpen) {
245
- i.stopPropagation();
263
+ n.stopPropagation();
246
264
  return;
247
265
  }
248
- a() ? (c((t) => !t), requestAnimationFrame(L)) : e.item.content || e.onSelect(e.item);
266
+ o() ? (d((i) => !i), requestAnimationFrame(C)) : e.item.content || e.onSelect(e.item);
249
267
  }
250
- }, o = (i = "first") => {
251
- a() && (c(!0), requestAnimationFrame(() => {
252
- L(), D(b, i);
268
+ }, q = (n = "first") => {
269
+ o() && (d(!0), requestAnimationFrame(() => {
270
+ C(), I(w, n);
253
271
  }));
254
272
  }, r = () => {
255
- c(!1), requestAnimationFrame(() => C?.focus());
273
+ d(!1), requestAnimationFrame(() => $?.focus());
256
274
  };
257
275
  return (() => {
258
- var i = we();
259
- i.addEventListener("mouseleave", p), i.addEventListener("mouseenter", T);
260
- var t = h;
261
- return typeof t == "function" ? I(t, i) : h = i, v(i, l(y, {
276
+ var n = ye();
277
+ n.addEventListener("mouseleave", R), n.addEventListener("mouseenter", j);
278
+ var i = v;
279
+ return typeof i == "function" ? O(i, n) : v = n, g(n, l(y, {
262
280
  get when() {
263
281
  return e.item.content;
264
282
  },
265
283
  get children() {
266
- var n = B();
267
- return n.$$click = _, v(n, e.item.content), F((d) => {
268
- var s = k("w-full px-2 py-1.5", e.item.tone === "danger" && "text-destructive", e.item.disabled && "opacity-50 pointer-events-none"), S = e.item.tone ?? "default";
269
- return s !== d.e && O(n, d.e = s), S !== d.t && m(n, "data-tone", d.t = S), d;
284
+ var t = H();
285
+ return t.$$click = T, g(t, e.item.content), F((s) => {
286
+ var u = M("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 && p(t, s.e = u), x !== s.t && f(t, "data-tone", s.t = x), s;
270
288
  }, {
271
289
  e: void 0,
272
290
  t: void 0
273
- }), n;
291
+ }), t;
274
292
  }
275
- }), null), v(i, l(y, {
293
+ }), null), g(n, l(y, {
276
294
  get when() {
277
295
  return !e.item.content;
278
296
  },
279
297
  get children() {
280
- var n = be(), d = n.firstChild, s = d.nextSibling;
281
- n.$$keydown = (u) => {
282
- e.item.disabled || a() && ((u.key === "ArrowRight" || u.key === "Enter" || u.key === " ") && (u.preventDefault(), o("first")), u.key === "ArrowLeft" && (u.preventDefault(), r()));
283
- }, n.$$click = _;
284
- var S = C;
285
- return typeof S == "function" ? I(S, n) : C = n, m(n, "id", A), v(d, l(y, {
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, {
286
304
  get when() {
287
- return z(() => !!e.selected)() && !a();
305
+ return z(() => !!e.selected)() && !o();
288
306
  },
289
307
  get children() {
290
- return l(ae, {
308
+ return l(ie, {
291
309
  class: "w-3 h-3"
292
310
  });
293
311
  }
294
- })), v(n, l(y, {
312
+ })), g(t, l(y, {
295
313
  get when() {
296
314
  return e.item.icon;
297
315
  },
298
316
  keyed: !0,
299
- children: (u) => (() => {
300
- var M = ye();
301
- return v(M, u), M;
317
+ children: (a) => (() => {
318
+ var S = xe();
319
+ return g(S, a), S;
302
320
  })()
303
- }), s), v(s, () => e.item.label), v(n, l(y, {
321
+ }), u), g(u, () => e.item.label), g(t, l(y, {
304
322
  get when() {
305
- return a();
323
+ return o();
306
324
  },
307
325
  get children() {
308
326
  return l(ue, {
309
327
  class: "w-3 h-3 text-muted-foreground"
310
328
  });
311
329
  }
312
- }), null), F((u) => {
313
- var M = 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"), R = e.item.disabled, E = a() ? "menu" : void 0, H = a() ? f() : void 0, K = e.selected && !a() ? "true" : void 0, N = e.item.tone ?? "default";
314
- return M !== u.e && O(n, u.e = M), R !== u.t && (n.disabled = u.t = R), E !== u.a && m(n, "aria-haspopup", u.a = E), H !== u.o && m(n, "aria-expanded", u.o = H), K !== u.i && m(n, "data-floe-selected", u.i = K), N !== u.n && m(n, "data-tone", u.n = N), u;
330
+ }), null), F((a) => {
331
+ var S = M("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, D = 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 && p(t, a.e = S), E !== a.t && (t.disabled = a.t = E), D !== a.a && f(t, "aria-haspopup", a.a = D), 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;
315
333
  }, {
316
334
  e: void 0,
317
335
  t: void 0,
@@ -319,11 +337,11 @@ function ee(e) {
319
337
  o: void 0,
320
338
  i: void 0,
321
339
  n: void 0
322
- }), n;
340
+ }), t;
323
341
  }
324
- }), null), v(i, l(y, {
342
+ }), null), g(n, l(y, {
325
343
  get when() {
326
- return z(() => !!P.mounted())() && a();
344
+ return z(() => !!k.mounted())() && o();
327
345
  },
328
346
  get children() {
329
347
  return l(W, {
@@ -331,46 +349,46 @@ function ee(e) {
331
349
  return e.portalLayout.mount();
332
350
  },
333
351
  get children() {
334
- var n = B(), d = b;
335
- return typeof d == "function" ? I(d, n) : b = n, G(n, J({
352
+ var t = H(), s = w;
353
+ return typeof s == "function" ? O(s, t) : w = t, G(t, J({
336
354
  get class() {
337
- 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 M(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");
338
356
  },
339
357
  get "data-floe-dropdown"() {
340
358
  return e.dropdownId;
341
359
  },
342
360
  get "data-floating-presence"() {
343
- return P.state();
361
+ return k.state();
344
362
  },
345
363
  get "aria-hidden"() {
346
- return P.exiting() ? "true" : void 0;
364
+ return k.exiting() ? "true" : void 0;
347
365
  }
348
366
  }, () => ({
349
367
  [X]: e.portalLayout.isSurfaceMode() ? "true" : void 0
350
368
  }), {
351
369
  get style() {
352
370
  return {
353
- left: `${e.portalLayout.projectPosition(x()).x}px`,
354
- top: `${e.portalLayout.projectPosition(x()).y}px`
371
+ left: `${e.portalLayout.projectPosition(b()).x}px`,
372
+ top: `${e.portalLayout.projectPosition(b()).y}px`
355
373
  };
356
374
  },
357
375
  role: "menu",
358
376
  "data-floe-surface": "floating",
359
377
  "aria-labelledby": A,
360
378
  onMouseEnter: () => {
361
- clearTimeout(g);
379
+ clearTimeout(m);
362
380
  },
363
- onMouseLeave: p,
364
- onKeyDown: (s) => {
365
- s.key !== "ArrowLeft" && s.key !== "Escape" || (s.preventDefault(), s.stopPropagation(), r());
381
+ onMouseLeave: R,
382
+ onKeyDown: (u) => {
383
+ u.key !== "ArrowLeft" && u.key !== "Escape" || (u.preventDefault(), u.stopPropagation(), r());
366
384
  }
367
- }), !1, !0), v(n, l(V, {
385
+ }), !1, !0), g(t, l(V, {
368
386
  get each() {
369
387
  return e.item.children;
370
388
  },
371
- children: (s) => l(y, {
389
+ children: (u) => l(y, {
372
390
  get when() {
373
- return !s().separator;
391
+ return !u().separator;
374
392
  },
375
393
  get fallback() {
376
394
  return Z();
@@ -378,7 +396,7 @@ function ee(e) {
378
396
  get children() {
379
397
  return l(ee, {
380
398
  get item() {
381
- return s();
399
+ return u();
382
400
  },
383
401
  selected: !1,
384
402
  get onSelect() {
@@ -396,33 +414,33 @@ function ee(e) {
396
414
  });
397
415
  }
398
416
  })
399
- })), n;
417
+ })), t;
400
418
  }
401
419
  });
402
420
  }
403
- }), null), i;
421
+ }), null), n;
404
422
  })();
405
423
  }
406
- function Te(e) {
407
- const f = () => e.options.find((a) => a.value === e.value), c = () => e.options.map((a) => ({
408
- id: a.value,
409
- label: a.label
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
410
428
  }));
411
- return l(Pe, {
429
+ return l($e, {
412
430
  triggerInputSurface: !0,
413
431
  get triggerClass() {
414
- return k("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-xs shadow-sm", "transition-colors duration-100", e.class);
432
+ return M("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-xs shadow-sm", "transition-colors duration-100", e.class);
415
433
  },
416
434
  get trigger() {
417
435
  return [(() => {
418
- var a = xe();
419
- return v(a, () => f()?.label ?? e.placeholder ?? "Select..."), F(() => O(a, k("truncate", !f() && "text-muted-foreground"))), a;
420
- })(), l(ie, {
436
+ var o = Se();
437
+ return g(o, () => c()?.label ?? e.placeholder ?? "Select..."), F(() => p(o, M("truncate", !c() && "text-muted-foreground"))), o;
438
+ })(), l(ae, {
421
439
  class: "w-3.5 h-3.5 text-muted-foreground"
422
440
  })];
423
441
  },
424
442
  get items() {
425
- return c();
443
+ return d();
426
444
  },
427
445
  get value() {
428
446
  return e.value;
@@ -437,7 +455,7 @@ function Te(e) {
437
455
  }
438
456
  te(["click", "keydown"]);
439
457
  export {
440
- Pe as Dropdown,
441
- Te as Select,
442
- ke as resolveDropdownTriggerKeyAction
458
+ $e as Dropdown,
459
+ Fe as Select,
460
+ Pe as resolveDropdownTriggerKeyAction
443
461
  };