@floegence/floe-webapp-core 0.86.69 → 0.86.71

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