@floegence/floe-webapp-core 0.36.69 → 0.36.70

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