@floegence/floe-webapp-core 0.36.12 → 0.36.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,27 @@
1
- import { setAttribute as m, insert as f, createComponent as l, Portal as U, use as L, effect as D, className as M, setStyleProperty as q, template as E, memo as K, delegateEvents as J } from "solid-js/web";
2
- import { createSignal as F, createEffect as Q, onCleanup as V, Show as $, Index as z } from "solid-js";
3
- import { cn as C } from "../../utils/cn.js";
4
- import { deferNonBlocking as X } from "../../utils/defer.js";
5
- import { ChevronDown as Y, Check as Z, ChevronRight as ee } from "../icons/index.js";
6
- import { focusMenuItem as O, MENU_ITEM_SELECTOR as te, moveMenuFocus as N, calculateMenuPosition as ne, calculateSubmenuPosition as re } from "./menuUtils.js";
7
- var H = /* @__PURE__ */ E("<div role=menu>"), oe = /* @__PURE__ */ E("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), W = /* @__PURE__ */ E('<div class="my-1 h-px bg-border"role=separator>'), ie = /* @__PURE__ */ E("<div>"), ae = /* @__PURE__ */ E('<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">'), le = /* @__PURE__ */ E("<div class=relative>"), ue = /* @__PURE__ */ E('<span class="w-3.5 h-3.5 flex items-center justify-center">'), de = /* @__PURE__ */ E("<span>");
8
- let se = 0, ce = 0;
9
- function fe(e, s) {
1
+ import { setAttribute as v, insert as f, createComponent as a, Portal as N, use as R, spread as z, mergeProps as U, effect as I, className as E, template as $, memo as H, delegateEvents as V } from "solid-js/web";
2
+ import { createSignal as O, createMemo as X, createEffect as Y, onCleanup as Z, Show as y, Index as W } from "solid-js";
3
+ import { cn as S } from "../../utils/cn.js";
4
+ import { deferNonBlocking as ee } from "../../utils/defer.js";
5
+ import { ChevronDown as te, Check as ne, ChevronRight as re } from "../icons/index.js";
6
+ import { focusMenuItem as P, MENU_ITEM_SELECTOR as oe, moveMenuFocus as K, calculateMenuPosition as ie, calculateSubmenuPosition as ue } from "./menuUtils.js";
7
+ import { LOCAL_INTERACTION_SURFACE_ATTR as G } from "./localInteractionSurface.js";
8
+ import { resolveSurfacePortalHost as ae, projectSurfacePortalPosition as le, resolveSurfacePortalBoundaryRect as de, isSurfacePortalMode as ce, resolveSurfacePortalMount as se } from "./dialogSurfaceScope.js";
9
+ var F = /* @__PURE__ */ $("<div>"), fe = /* @__PURE__ */ $("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), J = /* @__PURE__ */ $('<div class="my-1 h-px bg-border"role=separator>'), me = /* @__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">'), ge = /* @__PURE__ */ $("<div class=relative>"), ve = /* @__PURE__ */ $('<span class="w-3.5 h-3.5 flex items-center justify-center">'), be = /* @__PURE__ */ $("<span>");
10
+ let he = 0, we = 0;
11
+ function ye(e, d) {
10
12
  switch (e) {
11
13
  case "Enter":
12
14
  case " ":
13
- return s.open ? {
15
+ return d.open ? {
14
16
  nextOpen: !1
15
17
  } : {
16
18
  nextOpen: !0,
17
- focusMode: s.hasSelection ? "selected" : "first"
19
+ focusMode: d.hasSelection ? "selected" : "first"
18
20
  };
19
21
  case "ArrowDown":
20
22
  return {
21
23
  nextOpen: !0,
22
- focusMode: s.hasSelection ? "selected" : "first"
24
+ focusMode: d.hasSelection ? "selected" : "first"
23
25
  };
24
26
  case "ArrowUp":
25
27
  return {
@@ -30,140 +32,161 @@ function fe(e, s) {
30
32
  return null;
31
33
  }
32
34
  }
33
- function me(e) {
34
- const [s, u] = F(!1), [c, P] = F({
35
+ function xe(e) {
36
+ const [d, c] = O(!1), [s, A] = O({
35
37
  x: -9999,
36
38
  y: -9999
37
39
  });
38
- let y, x;
39
- const h = `floe-dropdown-${se += 1}`, k = `${h}-menu`, R = () => {
40
- if (!y || !x) return;
41
- const o = y.getBoundingClientRect(), r = x.getBoundingClientRect(), d = ne(o, r, e.align ?? "start");
42
- P(d);
40
+ let b, h;
41
+ const m = `floe-dropdown-${he += 1}`, w = `${m}-menu`, k = X(() => d() ? ae() : {
42
+ host: null,
43
+ boundaryHost: null,
44
+ mountHost: null,
45
+ mode: "global"
46
+ }), u = {
47
+ mount: () => se(k()),
48
+ isSurfaceMode: () => ce(k()),
49
+ boundaryRect: () => de(k()),
50
+ projectPosition: (r) => le(r, k())
51
+ }, M = () => {
52
+ if (!b || !h) return;
53
+ const r = b.getBoundingClientRect(), n = h.getBoundingClientRect(), i = ie(r, n, e.align ?? "start", u.boundaryRect());
54
+ A(i);
43
55
  };
44
- Q(() => {
45
- if (!s()) {
46
- P({
56
+ Y(() => {
57
+ if (!d()) {
58
+ A({
47
59
  x: -9999,
48
60
  y: -9999
49
61
  });
50
62
  return;
51
63
  }
52
- const o = (d) => {
53
- const n = d.target;
54
- n && typeof n.closest == "function" && n.closest(`[data-floe-dropdown="${h}"]`) || u(!1);
55
- }, r = (d) => {
56
- d.key === "Escape" && (u(!1), requestAnimationFrame(() => y?.focus()));
64
+ const r = (i) => {
65
+ const t = i.target;
66
+ t && typeof t.closest == "function" && t.closest(`[data-floe-dropdown="${m}"]`) || c(!1);
67
+ }, n = (i) => {
68
+ i.key === "Escape" && (c(!1), requestAnimationFrame(() => b?.focus()));
57
69
  };
58
- document.addEventListener("mousedown", o), document.addEventListener("keydown", r), requestAnimationFrame(() => {
59
- R(), O(x, e.value ? "selected" : "first");
60
- }), V(() => {
61
- document.removeEventListener("mousedown", o), document.removeEventListener("keydown", r);
70
+ document.addEventListener("pointerdown", r, !0), document.addEventListener("keydown", n), requestAnimationFrame(() => {
71
+ M(), P(h, e.value ? "selected" : "first");
72
+ }), Z(() => {
73
+ document.removeEventListener("pointerdown", r, !0), document.removeEventListener("keydown", n);
62
74
  });
63
75
  });
64
- const v = (o) => {
65
- const r = e.onSelect;
66
- o.keepOpen || u(!1), X(() => r(o.id));
67
- }, A = (o, r = "first") => {
68
- e.disabled || (u(o), requestAnimationFrame(() => {
69
- R(), O(x, r);
76
+ const _ = (r) => {
77
+ const n = e.onSelect;
78
+ r.keepOpen || c(!1), ee(() => n(r.id));
79
+ }, p = (r, n = "first") => {
80
+ e.disabled || (c(r), requestAnimationFrame(() => {
81
+ M(), P(h, n);
70
82
  }));
71
- }, _ = (o) => {
83
+ }, D = (r) => {
72
84
  if (e.disabled) return;
73
- const r = fe(o.key, {
74
- open: s(),
85
+ const n = ye(r.key, {
86
+ open: d(),
75
87
  hasSelection: !!e.value
76
88
  });
77
- if (r) {
78
- if (o.preventDefault(), !r.nextOpen) {
79
- u(!1);
89
+ if (n) {
90
+ if (r.preventDefault(), !n.nextOpen) {
91
+ c(!1);
80
92
  return;
81
93
  }
82
- A(!0, r.focusMode ?? "first");
94
+ p(!0, n.focusMode ?? "first");
83
95
  }
84
- }, T = (o) => {
85
- const r = o.target, d = r?.closest('[role="menu"]'), n = r?.closest(te);
86
- switch (o.key) {
96
+ }, T = (r) => {
97
+ const n = r.target, i = n?.closest('[role="menu"]'), t = n?.closest(oe);
98
+ switch (r.key) {
87
99
  case "ArrowDown":
88
- o.preventDefault(), N(d, n, 1);
100
+ r.preventDefault(), K(i, t, 1);
89
101
  return;
90
102
  case "ArrowUp":
91
- o.preventDefault(), N(d, n, -1);
103
+ r.preventDefault(), K(i, t, -1);
92
104
  return;
93
105
  case "Home":
94
- o.preventDefault(), O(d, "first");
106
+ r.preventDefault(), P(i, "first");
95
107
  return;
96
108
  case "End":
97
- o.preventDefault(), O(d, "last");
109
+ r.preventDefault(), P(i, "last");
98
110
  return;
99
111
  case "Tab":
100
- u(!1);
112
+ c(!1);
101
113
  return;
102
114
  default:
103
115
  return;
104
116
  }
105
117
  };
106
118
  return (() => {
107
- var o = oe(), r = o.firstChild;
108
- m(o, "data-floe-dropdown", h), r.$$keydown = _, r.$$click = () => {
119
+ var r = fe(), n = r.firstChild;
120
+ v(r, "data-floe-dropdown", m), n.$$keydown = D, n.$$click = () => {
109
121
  if (!e.disabled) {
110
- if (s()) {
111
- u(!1);
122
+ if (d()) {
123
+ c(!1);
112
124
  return;
113
125
  }
114
- A(!0, e.value ? "selected" : "first");
126
+ p(!0, e.value ? "selected" : "first");
115
127
  }
116
128
  };
117
- var d = y;
118
- return typeof d == "function" ? L(d, r) : y = r, m(r, "aria-controls", k), f(r, () => e.trigger), f(o, l($, {
129
+ var i = b;
130
+ return typeof i == "function" ? R(i, n) : b = n, v(n, "aria-controls", w), f(n, () => e.trigger), f(r, a(y, {
119
131
  get when() {
120
- return s();
132
+ return d();
121
133
  },
122
134
  get children() {
123
- return l(U, {
135
+ return a(N, {
136
+ get mount() {
137
+ return u.mount();
138
+ },
124
139
  get children() {
125
- var n = H();
126
- n.$$keydown = T;
127
- var g = x;
128
- return typeof g == "function" ? L(g, n) : x = n, m(n, "data-floe-dropdown", h), m(n, "id", k), f(n, l(z, {
140
+ var t = F(), g = h;
141
+ return typeof g == "function" ? R(g, t) : h = t, v(t, "data-floe-dropdown", m), z(t, U({
142
+ get class() {
143
+ return S(u.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", "animate-in fade-in slide-in-from-top-2");
144
+ }
145
+ }, () => ({
146
+ [G]: u.isSurfaceMode() ? "true" : void 0
147
+ }), {
148
+ get style() {
149
+ return {
150
+ left: `${u.projectPosition(s()).x}px`,
151
+ top: `${u.projectPosition(s()).y}px`
152
+ };
153
+ },
154
+ role: "menu",
155
+ id: w,
156
+ onKeyDown: T
157
+ }), !1, !0), f(t, a(W, {
129
158
  get each() {
130
159
  return e.items;
131
160
  },
132
- children: (t) => l($, {
161
+ children: (l) => a(y, {
133
162
  get when() {
134
- return !t().separator;
163
+ return !l().separator;
135
164
  },
136
165
  get fallback() {
137
- return W();
166
+ return J();
138
167
  },
139
168
  get children() {
140
- return l(G, {
169
+ return a(Q, {
141
170
  get item() {
142
- return t();
171
+ return l();
143
172
  },
144
173
  get selected() {
145
- return e.value === t().id;
174
+ return e.value === l().id;
146
175
  },
147
- onSelect: v,
148
- onCloseMenu: () => u(!1),
149
- dropdownId: h
176
+ onSelect: _,
177
+ onCloseMenu: () => c(!1),
178
+ dropdownId: m,
179
+ portalLayout: u
150
180
  });
151
181
  }
152
182
  })
153
- })), D((t) => {
154
- var w = C("fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "animate-in fade-in slide-in-from-top-2"), i = `${c().x}px`, b = `${c().y}px`;
155
- return w !== t.e && M(n, t.e = w), i !== t.t && q(n, "left", t.t = i), b !== t.a && q(n, "top", t.a = b), t;
156
- }, {
157
- e: void 0,
158
- t: void 0,
159
- a: void 0
160
- }), n;
183
+ })), t;
161
184
  }
162
185
  });
163
186
  }
164
- }), null), D((n) => {
165
- var g = C("relative inline-block", e.class), t = C("cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), w = e.disabled ? -1 : 0, i = s(), b = e.triggerAriaLabel, a = e.disabled ? "true" : void 0;
166
- return g !== n.e && M(o, n.e = g), t !== n.t && M(r, n.t = t), w !== n.a && m(r, "tabindex", n.a = w), i !== n.o && m(r, "aria-expanded", n.o = i), b !== n.i && m(r, "aria-label", n.i = b), a !== n.n && m(r, "aria-disabled", n.n = a), n;
187
+ }), null), I((t) => {
188
+ var g = S("relative inline-block", e.class), l = S("cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), C = e.disabled ? -1 : 0, o = d(), x = e.triggerAriaLabel, L = e.disabled ? "true" : void 0;
189
+ return g !== t.e && E(r, t.e = g), l !== t.t && E(n, t.t = l), C !== t.a && v(n, "tabindex", t.a = C), o !== t.o && v(n, "aria-expanded", t.o = o), x !== t.i && v(n, "aria-label", t.i = x), L !== t.n && v(n, "aria-disabled", t.n = L), t;
167
190
  }, {
168
191
  e: void 0,
169
192
  t: void 0,
@@ -171,94 +194,94 @@ function me(e) {
171
194
  o: void 0,
172
195
  i: void 0,
173
196
  n: void 0
174
- }), o;
197
+ }), r;
175
198
  })();
176
199
  }
177
- function G(e) {
178
- const [s, u] = F(!1), [c, P] = F({
200
+ function Q(e) {
201
+ const [d, c] = O(!1), [s, A] = O({
179
202
  x: -9999,
180
203
  y: -9999
181
204
  });
182
- let y, x, h, k;
183
- const R = `floe-dropdown-item-${ce += 1}`, v = () => e.item.children && e.item.children.length > 0, A = () => {
184
- if (!y || !h) return;
185
- const n = y.getBoundingClientRect(), g = h.getBoundingClientRect(), t = re(n, g);
186
- P(t);
205
+ let b, h, m, w;
206
+ const k = `floe-dropdown-item-${we += 1}`, u = () => e.item.children && e.item.children.length > 0, M = () => {
207
+ if (!b || !m) return;
208
+ const n = b.getBoundingClientRect(), i = m.getBoundingClientRect(), t = ue(n, i, e.portalLayout.boundaryRect());
209
+ A(t);
187
210
  }, _ = () => {
188
- v() && (clearTimeout(k), k = setTimeout(() => {
189
- u(!0), requestAnimationFrame(A);
211
+ u() && (clearTimeout(w), w = setTimeout(() => {
212
+ c(!0), requestAnimationFrame(M);
190
213
  }, 100));
191
- }, T = () => {
192
- v() && (clearTimeout(k), k = void 0, !e.item.keepOpen && (k = setTimeout(() => {
193
- u(!1);
214
+ }, p = () => {
215
+ u() && (clearTimeout(w), w = void 0, !e.item.keepOpen && (w = setTimeout(() => {
216
+ c(!1);
194
217
  }, 150)));
195
- }, o = (n) => {
218
+ }, D = (n) => {
196
219
  if (!e.item.disabled) {
197
220
  if (e.item.content && e.item.keepOpen) {
198
221
  n.stopPropagation();
199
222
  return;
200
223
  }
201
- v() ? (u((g) => !g), requestAnimationFrame(A)) : e.item.content || e.onSelect(e.item);
224
+ u() ? (c((i) => !i), requestAnimationFrame(M)) : e.item.content || e.onSelect(e.item);
202
225
  }
203
- }, r = (n = "first") => {
204
- v() && (u(!0), requestAnimationFrame(() => {
205
- A(), O(h, n);
226
+ }, T = (n = "first") => {
227
+ u() && (c(!0), requestAnimationFrame(() => {
228
+ M(), P(m, n);
206
229
  }));
207
- }, d = () => {
208
- u(!1), requestAnimationFrame(() => x?.focus());
230
+ }, r = () => {
231
+ c(!1), requestAnimationFrame(() => h?.focus());
209
232
  };
210
233
  return (() => {
211
- var n = le();
212
- n.addEventListener("mouseleave", T), n.addEventListener("mouseenter", _);
213
- var g = y;
214
- return typeof g == "function" ? L(g, n) : y = n, f(n, l($, {
234
+ var n = ge();
235
+ n.addEventListener("mouseleave", p), n.addEventListener("mouseenter", _);
236
+ var i = b;
237
+ return typeof i == "function" ? R(i, n) : b = n, f(n, a(y, {
215
238
  get when() {
216
239
  return e.item.content;
217
240
  },
218
241
  get children() {
219
- var t = ie();
220
- return t.$$click = o, f(t, e.item.content), D(() => M(t, C("w-full px-2 py-1.5", e.item.disabled && "opacity-50 pointer-events-none"))), t;
242
+ var t = F();
243
+ return t.$$click = D, f(t, e.item.content), I(() => E(t, S("w-full px-2 py-1.5", e.item.disabled && "opacity-50 pointer-events-none"))), t;
221
244
  }
222
- }), null), f(n, l($, {
245
+ }), null), f(n, a(y, {
223
246
  get when() {
224
247
  return !e.item.content;
225
248
  },
226
249
  get children() {
227
- var t = ae(), w = t.firstChild, i = w.nextSibling;
228
- t.$$keydown = (a) => {
229
- e.item.disabled || v() && ((a.key === "ArrowRight" || a.key === "Enter" || a.key === " ") && (a.preventDefault(), r("first")), a.key === "ArrowLeft" && (a.preventDefault(), d()));
230
- }, t.$$click = o;
231
- var b = x;
232
- return typeof b == "function" ? L(b, t) : x = t, m(t, "id", R), f(w, l($, {
250
+ var t = me(), g = t.firstChild, l = g.nextSibling;
251
+ t.$$keydown = (o) => {
252
+ e.item.disabled || u() && ((o.key === "ArrowRight" || o.key === "Enter" || o.key === " ") && (o.preventDefault(), T("first")), o.key === "ArrowLeft" && (o.preventDefault(), r()));
253
+ }, t.$$click = D;
254
+ var C = h;
255
+ return typeof C == "function" ? R(C, t) : h = t, v(t, "id", k), f(g, a(y, {
233
256
  get when() {
234
- return K(() => !!e.selected)() && !v();
257
+ return H(() => !!e.selected)() && !u();
235
258
  },
236
259
  get children() {
237
- return l(Z, {
260
+ return a(ne, {
238
261
  class: "w-3 h-3"
239
262
  });
240
263
  }
241
- })), f(t, l($, {
264
+ })), f(t, a(y, {
242
265
  get when() {
243
266
  return e.item.icon;
244
267
  },
245
268
  keyed: !0,
246
- children: (a) => (() => {
247
- var S = ue();
248
- return f(S, a), S;
269
+ children: (o) => (() => {
270
+ var x = ve();
271
+ return f(x, o), x;
249
272
  })()
250
- }), i), f(i, () => e.item.label), f(t, l($, {
273
+ }), l), f(l, () => e.item.label), f(t, a(y, {
251
274
  get when() {
252
- return v();
275
+ return u();
253
276
  },
254
277
  get children() {
255
- return l(ee, {
278
+ return a(re, {
256
279
  class: "w-3 h-3 text-muted-foreground"
257
280
  });
258
281
  }
259
- }), null), D((a) => {
260
- var S = C("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.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), I = e.item.disabled, B = v() ? "menu" : void 0, p = v() ? s() : void 0, j = e.selected && !v() ? "true" : void 0;
261
- return S !== a.e && M(t, a.e = S), I !== a.t && (t.disabled = a.t = I), B !== a.a && m(t, "aria-haspopup", a.a = B), p !== a.o && m(t, "aria-expanded", a.o = p), j !== a.i && m(t, "data-floe-selected", a.i = j), a;
282
+ }), null), I((o) => {
283
+ 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.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), L = e.item.disabled, j = u() ? "menu" : void 0, q = u() ? d() : void 0, B = e.selected && !u() ? "true" : void 0;
284
+ return x !== o.e && E(t, o.e = x), L !== o.t && (t.disabled = o.t = L), j !== o.a && v(t, "aria-haspopup", o.a = j), q !== o.o && v(t, "aria-expanded", o.o = q), B !== o.i && v(t, "data-floe-selected", o.i = B), o;
262
285
  }, {
263
286
  e: void 0,
264
287
  t: void 0,
@@ -267,35 +290,57 @@ function G(e) {
267
290
  i: void 0
268
291
  }), t;
269
292
  }
270
- }), null), f(n, l($, {
293
+ }), null), f(n, a(y, {
271
294
  get when() {
272
- return K(() => !!s())() && v();
295
+ return H(() => !!d())() && u();
273
296
  },
274
297
  get children() {
275
- return l(U, {
298
+ return a(N, {
299
+ get mount() {
300
+ return e.portalLayout.mount();
301
+ },
276
302
  get children() {
277
- var t = H();
278
- t.$$keydown = (i) => {
279
- i.key !== "ArrowLeft" && i.key !== "Escape" || (i.preventDefault(), i.stopPropagation(), d());
280
- }, t.addEventListener("mouseleave", T), t.addEventListener("mouseenter", () => {
281
- clearTimeout(k);
282
- });
283
- var w = h;
284
- return typeof w == "function" ? L(w, t) : h = t, m(t, "aria-labelledby", R), f(t, l(z, {
303
+ var t = F(), g = m;
304
+ return typeof g == "function" ? R(g, t) : m = t, z(t, U({
305
+ get class() {
306
+ 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", "animate-in fade-in slide-in-from-left-1");
307
+ },
308
+ get "data-floe-dropdown"() {
309
+ return e.dropdownId;
310
+ }
311
+ }, () => ({
312
+ [G]: e.portalLayout.isSurfaceMode() ? "true" : void 0
313
+ }), {
314
+ get style() {
315
+ return {
316
+ left: `${e.portalLayout.projectPosition(s()).x}px`,
317
+ top: `${e.portalLayout.projectPosition(s()).y}px`
318
+ };
319
+ },
320
+ role: "menu",
321
+ "aria-labelledby": k,
322
+ onMouseEnter: () => {
323
+ clearTimeout(w);
324
+ },
325
+ onMouseLeave: p,
326
+ onKeyDown: (l) => {
327
+ l.key !== "ArrowLeft" && l.key !== "Escape" || (l.preventDefault(), l.stopPropagation(), r());
328
+ }
329
+ }), !1, !0), f(t, a(W, {
285
330
  get each() {
286
331
  return e.item.children;
287
332
  },
288
- children: (i) => l($, {
333
+ children: (l) => a(y, {
289
334
  get when() {
290
- return !i().separator;
335
+ return !l().separator;
291
336
  },
292
337
  get fallback() {
293
- return W();
338
+ return J();
294
339
  },
295
340
  get children() {
296
- return l(G, {
341
+ return a(Q, {
297
342
  get item() {
298
- return i();
343
+ return l();
299
344
  },
300
345
  selected: !1,
301
346
  get onSelect() {
@@ -306,44 +351,39 @@ function G(e) {
306
351
  },
307
352
  get dropdownId() {
308
353
  return e.dropdownId;
354
+ },
355
+ get portalLayout() {
356
+ return e.portalLayout;
309
357
  }
310
358
  });
311
359
  }
312
360
  })
313
- })), D((i) => {
314
- var b = C("fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "animate-in fade-in slide-in-from-left-1"), a = e.dropdownId, S = `${c().x}px`, I = `${c().y}px`;
315
- return b !== i.e && M(t, i.e = b), a !== i.t && m(t, "data-floe-dropdown", i.t = a), S !== i.a && q(t, "left", i.a = S), I !== i.o && q(t, "top", i.o = I), i;
316
- }, {
317
- e: void 0,
318
- t: void 0,
319
- a: void 0,
320
- o: void 0
321
- }), t;
361
+ })), t;
322
362
  }
323
363
  });
324
364
  }
325
365
  }), null), n;
326
366
  })();
327
367
  }
328
- function xe(e) {
329
- const s = () => e.options.find((c) => c.value === e.value), u = () => e.options.map((c) => ({
330
- id: c.value,
331
- label: c.label
368
+ function Re(e) {
369
+ const d = () => e.options.find((s) => s.value === e.value), c = () => e.options.map((s) => ({
370
+ id: s.value,
371
+ label: s.label
332
372
  }));
333
- return l(me, {
373
+ return a(xe, {
334
374
  get triggerClass() {
335
- return C("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);
375
+ return S("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);
336
376
  },
337
377
  get trigger() {
338
378
  return [(() => {
339
- var c = de();
340
- return f(c, () => s()?.label ?? e.placeholder ?? "Select..."), D(() => M(c, C("truncate", !s() && "text-muted-foreground"))), c;
341
- })(), l(Y, {
379
+ var s = be();
380
+ return f(s, () => d()?.label ?? e.placeholder ?? "Select..."), I(() => E(s, S("truncate", !d() && "text-muted-foreground"))), s;
381
+ })(), a(te, {
342
382
  class: "w-3.5 h-3.5 text-muted-foreground"
343
383
  })];
344
384
  },
345
385
  get items() {
346
- return u();
386
+ return c();
347
387
  },
348
388
  get value() {
349
389
  return e.value;
@@ -356,9 +396,9 @@ function xe(e) {
356
396
  }
357
397
  });
358
398
  }
359
- J(["click", "keydown"]);
399
+ V(["click", "keydown"]);
360
400
  export {
361
- me as Dropdown,
362
- xe as Select,
363
- fe as resolveDropdownTriggerKeyAction
401
+ xe as Dropdown,
402
+ Re as Select,
403
+ ye as resolveDropdownTriggerKeyAction
364
404
  };