@floegence/floe-webapp-core 0.50.6 → 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.
Files changed (46) hide show
  1. package/dist/components/chat/input/ChatInput.js +8 -8
  2. package/dist/components/ui/Button.js +16 -13
  3. package/dist/components/ui/Card.js +125 -119
  4. package/dist/components/ui/Checkbox.js +178 -132
  5. package/dist/components/ui/CommandPalette.js +10 -10
  6. package/dist/components/ui/Dialog.d.ts +7 -0
  7. package/dist/components/ui/Dialog.js +160 -114
  8. package/dist/components/ui/DirectoryInput.js +5 -5
  9. package/dist/components/ui/Dropdown.d.ts +2 -0
  10. package/dist/components/ui/Dropdown.js +183 -160
  11. package/dist/components/ui/FloatingWindow.js +211 -199
  12. package/dist/components/ui/HighlightBlock.js +8 -8
  13. package/dist/components/ui/Input.js +40 -40
  14. package/dist/components/ui/Pagination.js +90 -88
  15. package/dist/components/ui/ProcessingIndicator.js +1 -1
  16. package/dist/components/ui/Progress.js +99 -88
  17. package/dist/components/ui/QuoteBlock.js +9 -9
  18. package/dist/components/ui/Radio.js +151 -127
  19. package/dist/components/ui/SegmentedControl.js +26 -25
  20. package/dist/components/ui/Stepper.js +114 -112
  21. package/dist/components/ui/Switch.js +34 -33
  22. package/dist/components/ui/Tabs.js +153 -150
  23. package/dist/components/ui/Tag.js +24 -21
  24. package/dist/components/ui/Tooltip.js +10 -10
  25. package/dist/components/ui/floatingPresence.js +40 -30
  26. package/dist/components/workbench/WorkbenchHud.js +9 -9
  27. package/dist/components/workbench/WorkbenchLockButton.js +4 -4
  28. package/dist/components/workbench/WorkbenchWidget.js +46 -43
  29. package/dist/context/FloeConfigContext.d.ts +5 -1
  30. package/dist/context/FloeConfigContext.js +10 -9
  31. package/dist/context/ThemeContext.d.ts +3 -1
  32. package/dist/context/ThemeContext.js +78 -71
  33. package/dist/floe.css +32 -0
  34. package/dist/full.js +839 -836
  35. package/dist/hooks/useOverlayMask.js +95 -83
  36. package/dist/index.js +150 -147
  37. package/dist/input-focus.css +0 -1
  38. package/dist/styles/themes/index.d.ts +3 -0
  39. package/dist/styles/themes/index.js +40 -31
  40. package/dist/styles/tokens.d.ts +36 -0
  41. package/dist/styles/tokens.js +12 -5
  42. package/dist/styles.css +1 -1
  43. package/dist/surface.css +467 -0
  44. package/dist/themes.d.ts +1 -1
  45. package/dist/ui.css +9 -0
  46. package/package.json +1 -1
@@ -1,28 +1,29 @@
1
- import { setAttribute as v, insert as g, createComponent as l, Portal as W, use as E, spread as G, mergeProps as J, effect as T, className as D, template as P, memo as z, delegateEvents as te } from "solid-js/web";
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
2
  import { createSignal as _, createMemo as ne, createEffect as Q, onCleanup as re, Show as y, Index as V } from "solid-js";
3
- import { cn as k } from "../../utils/cn.js";
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 ue, ChevronRight as ae } from "../icons/index.js";
6
- import { focusMenuItem as R, 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 j = /* @__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>'), he = /* @__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">'), we = /* @__PURE__ */ P("<div class=relative>"), ye = /* @__PURE__ */ P('<span class="w-3.5 h-3.5 flex items-center justify-center">'), xe = /* @__PURE__ */ P("<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 {
@@ -34,107 +35,124 @@ function ke(e, f) {
34
35
  }
35
36
  }
36
37
  function $e(e) {
37
- const [f, c] = _(!1), u = Y({
38
- open: f,
38
+ const [c, d] = _(!1), o = Y({
39
+ open: c,
39
40
  exitDurationMs: 100
40
- }), [F, $] = _({
41
+ }), [B, k] = _({
41
42
  x: -9999,
42
43
  y: -9999
43
44
  });
44
- let x, w;
45
- const b = `floe-dropdown-${Se += 1}`, C = `${b}-menu`, h = ne(() => u.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
53
  }), m = {
51
- mount: () => ve(h()),
52
- isSurfaceMode: () => ge(h()),
53
- boundaryRect: () => me(h()),
54
- projectPosition: (o) => fe(o, h())
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", m.boundaryRect());
58
- $(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 (!u.mounted()) {
62
- $({
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 n = i.target;
71
- n && typeof n.closest == "function" && n.closest(`[data-floe-dropdown="${b}"]`) || 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(), R(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
- }, p = (o, r = "first") => {
85
- e.disabled || (c(o), requestAnimationFrame(() => {
86
- A(), R(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
- }, I = (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
- p(!0, r.focusMode ?? "first");
117
+ R(!0, n.focusMode ?? "first");
100
118
  }
101
- }, O = (o) => {
102
- const r = o.target, i = r?.closest('[role="menu"]'), n = 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, n, 1);
123
+ r.preventDefault(), U(i, t, 1);
106
124
  return;
107
125
  case "ArrowUp":
108
- o.preventDefault(), U(i, n, -1);
126
+ r.preventDefault(), U(i, t, -1);
109
127
  return;
110
128
  case "Home":
111
- o.preventDefault(), R(i, "first");
129
+ r.preventDefault(), I(i, "first");
112
130
  return;
113
131
  case "End":
114
- o.preventDefault(), R(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 = be(), r = o.firstChild;
125
- v(o, "data-floe-dropdown", b), r.$$keydown = I, 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
- p(!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" ? E(i, r) : x = r, v(r, "aria-controls", C), g(r, () => e.trigger), g(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 u.mounted();
155
+ return o.mounted();
138
156
  },
139
157
  get children() {
140
158
  return l(W, {
@@ -142,36 +160,37 @@ function $e(e) {
142
160
  return m.mount();
143
161
  },
144
162
  get children() {
145
- var n = j(), t = w;
146
- return typeof t == "function" ? E(t, n) : w = n, v(n, "data-floe-dropdown", b), G(n, 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(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");
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 u.state();
169
+ return o.state();
152
170
  },
153
171
  get "aria-hidden"() {
154
- return u.exiting() ? "true" : void 0;
172
+ return o.exiting() ? "true" : void 0;
155
173
  }
156
174
  }, () => ({
157
175
  [X]: m.isSurfaceMode() ? "true" : void 0
158
176
  }), {
159
177
  get style() {
160
178
  return {
161
- left: `${m.projectPosition(F()).x}px`,
162
- top: `${m.projectPosition(F()).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
- id: C,
167
- onKeyDown: O
168
- }), !1, !0), g(n, l(V, {
184
+ "data-floe-surface": "floating",
185
+ id: $,
186
+ onKeyDown: q
187
+ }), !1, !0), g(t, l(V, {
169
188
  get each() {
170
189
  return e.items;
171
190
  },
172
- children: (d) => l(y, {
191
+ children: (u) => l(y, {
173
192
  get when() {
174
- return !d().separator;
193
+ return !u().separator;
175
194
  },
176
195
  get fallback() {
177
196
  return Z();
@@ -179,112 +198,114 @@ function $e(e) {
179
198
  get children() {
180
199
  return l(ee, {
181
200
  get item() {
182
- return d();
201
+ return u();
183
202
  },
184
203
  get selected() {
185
- return e.value === d().id;
204
+ return e.value === u().id;
186
205
  },
187
- onSelect: L,
188
- onCloseMenu: () => c(!1),
189
- dropdownId: b,
206
+ onSelect: j,
207
+ onCloseMenu: () => d(!1),
208
+ dropdownId: v,
190
209
  portalLayout: m
191
210
  });
192
211
  }
193
212
  })
194
- })), n;
213
+ })), t;
195
214
  }
196
215
  });
197
216
  }
198
- }), null), T((n) => {
199
- var t = k("relative inline-block", e.class), d = k("cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), s = e.disabled ? -1 : 0, S = f(), a = e.triggerAriaLabel, M = e.disabled ? "true" : void 0;
200
- return t !== n.e && D(o, n.e = t), d !== n.t && D(r, n.t = d), s !== n.a && v(r, "tabindex", n.a = s), S !== n.o && v(r, "aria-expanded", n.o = S), a !== n.i && v(r, "aria-label", n.i = a), M !== n.n && v(r, "aria-disabled", n.n = M), n;
217
+ }), null), F((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;
201
220
  }, {
202
221
  e: void 0,
203
222
  t: void 0,
204
223
  a: void 0,
205
224
  o: void 0,
206
225
  i: void 0,
207
- n: void 0
208
- }), o;
226
+ n: void 0,
227
+ s: void 0,
228
+ h: void 0
229
+ }), r;
209
230
  })();
210
231
  }
211
232
  function ee(e) {
212
- const [f, c] = _(!1), u = () => e.item.children && e.item.children.length > 0, $ = Y({
213
- open: () => !!(f() && u()),
233
+ const [c, d] = _(!1), o = () => e.item.children && e.item.children.length > 0, k = Y({
234
+ open: () => !!(c() && o()),
214
235
  exitDurationMs: 100
215
- }), [x, w] = _({
236
+ }), [b, h] = _({
216
237
  x: -9999,
217
238
  y: -9999
218
239
  });
219
- let b, C, h, m;
220
- const A = `floe-dropdown-item-${Me += 1}`;
240
+ let v, $, w, m;
241
+ const A = `floe-dropdown-item-${ke += 1}`;
221
242
  Q(() => {
222
- $.mounted() || w({
243
+ k.mounted() || h({
223
244
  x: -9999,
224
245
  y: -9999
225
246
  });
226
247
  });
227
- const L = () => {
228
- if (!b || !h) return;
229
- const i = b.getBoundingClientRect(), n = h.getBoundingClientRect(), t = ce(i, n, e.portalLayout.boundaryRect());
230
- w(t);
231
- }, p = () => {
232
- u() && (clearTimeout(m), m = setTimeout(() => {
233
- 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);
234
255
  }, 100));
235
- }, I = () => {
236
- u() && (clearTimeout(m), m = void 0, !e.item.keepOpen && (m = setTimeout(() => {
237
- c(!1);
256
+ }, R = () => {
257
+ o() && (clearTimeout(m), m = void 0, !e.item.keepOpen && (m = setTimeout(() => {
258
+ d(!1);
238
259
  }, 150)));
239
- }, O = (i) => {
260
+ }, T = (n) => {
240
261
  if (!e.item.disabled) {
241
262
  if (e.item.content && e.item.keepOpen) {
242
- i.stopPropagation();
263
+ n.stopPropagation();
243
264
  return;
244
265
  }
245
- u() ? (c((n) => !n), requestAnimationFrame(L)) : e.item.content || e.onSelect(e.item);
266
+ o() ? (d((i) => !i), requestAnimationFrame(C)) : e.item.content || e.onSelect(e.item);
246
267
  }
247
- }, o = (i = "first") => {
248
- u() && (c(!0), requestAnimationFrame(() => {
249
- L(), R(h, i);
268
+ }, q = (n = "first") => {
269
+ o() && (d(!0), requestAnimationFrame(() => {
270
+ C(), I(w, n);
250
271
  }));
251
272
  }, r = () => {
252
- c(!1), requestAnimationFrame(() => C?.focus());
273
+ d(!1), requestAnimationFrame(() => $?.focus());
253
274
  };
254
275
  return (() => {
255
- var i = we();
256
- i.addEventListener("mouseleave", I), i.addEventListener("mouseenter", p);
257
- var n = b;
258
- return typeof n == "function" ? E(n, i) : b = i, g(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, {
259
280
  get when() {
260
281
  return e.item.content;
261
282
  },
262
283
  get children() {
263
- var t = j();
264
- return t.$$click = O, g(t, e.item.content), T((d) => {
265
- 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";
266
- return s !== d.e && D(t, d.e = s), S !== d.t && v(t, "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;
267
288
  }, {
268
289
  e: void 0,
269
290
  t: void 0
270
291
  }), t;
271
292
  }
272
- }), null), g(i, l(y, {
293
+ }), null), g(n, l(y, {
273
294
  get when() {
274
295
  return !e.item.content;
275
296
  },
276
297
  get children() {
277
- var t = he(), d = t.firstChild, s = d.nextSibling;
298
+ var t = we(), s = t.firstChild, u = s.nextSibling;
278
299
  t.$$keydown = (a) => {
279
- e.item.disabled || u() && ((a.key === "ArrowRight" || a.key === "Enter" || a.key === " ") && (a.preventDefault(), o("first")), a.key === "ArrowLeft" && (a.preventDefault(), r()));
280
- }, t.$$click = O;
281
- var S = C;
282
- return typeof S == "function" ? E(S, t) : C = t, v(t, "id", A), g(d, l(y, {
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, {
283
304
  get when() {
284
- return z(() => !!e.selected)() && !u();
305
+ return z(() => !!e.selected)() && !o();
285
306
  },
286
307
  get children() {
287
- return l(ue, {
308
+ return l(ie, {
288
309
  class: "w-3 h-3"
289
310
  });
290
311
  }
@@ -294,21 +315,21 @@ function ee(e) {
294
315
  },
295
316
  keyed: !0,
296
317
  children: (a) => (() => {
297
- var M = ye();
298
- return g(M, a), M;
318
+ var S = xe();
319
+ return g(S, a), S;
299
320
  })()
300
- }), s), g(s, () => e.item.label), g(t, l(y, {
321
+ }), u), g(u, () => e.item.label), g(t, l(y, {
301
322
  get when() {
302
- return u();
323
+ return o();
303
324
  },
304
325
  get children() {
305
- return l(ae, {
326
+ return l(ue, {
306
327
  class: "w-3 h-3 text-muted-foreground"
307
328
  });
308
329
  }
309
- }), null), T((a) => {
310
- 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"), q = e.item.disabled, B = u() ? "menu" : void 0, H = u() ? f() : void 0, K = e.selected && !u() ? "true" : void 0, N = e.item.tone ?? "default";
311
- return M !== a.e && D(t, a.e = M), q !== a.t && (t.disabled = a.t = q), B !== a.a && v(t, "aria-haspopup", a.a = B), H !== a.o && v(t, "aria-expanded", a.o = H), K !== a.i && v(t, "data-floe-selected", a.i = K), N !== a.n && v(t, "data-tone", a.n = N), a;
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;
312
333
  }, {
313
334
  e: void 0,
314
335
  t: void 0,
@@ -318,9 +339,9 @@ function ee(e) {
318
339
  n: void 0
319
340
  }), t;
320
341
  }
321
- }), null), g(i, l(y, {
342
+ }), null), g(n, l(y, {
322
343
  get when() {
323
- return z(() => !!$.mounted())() && u();
344
+ return z(() => !!k.mounted())() && o();
324
345
  },
325
346
  get children() {
326
347
  return l(W, {
@@ -328,45 +349,46 @@ function ee(e) {
328
349
  return e.portalLayout.mount();
329
350
  },
330
351
  get children() {
331
- var t = j(), d = h;
332
- return typeof d == "function" ? E(d, t) : h = t, G(t, J({
352
+ var t = H(), s = w;
353
+ return typeof s == "function" ? O(s, t) : w = t, G(t, J({
333
354
  get class() {
334
- 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");
335
356
  },
336
357
  get "data-floe-dropdown"() {
337
358
  return e.dropdownId;
338
359
  },
339
360
  get "data-floating-presence"() {
340
- return $.state();
361
+ return k.state();
341
362
  },
342
363
  get "aria-hidden"() {
343
- return $.exiting() ? "true" : void 0;
364
+ return k.exiting() ? "true" : void 0;
344
365
  }
345
366
  }, () => ({
346
367
  [X]: e.portalLayout.isSurfaceMode() ? "true" : void 0
347
368
  }), {
348
369
  get style() {
349
370
  return {
350
- left: `${e.portalLayout.projectPosition(x()).x}px`,
351
- top: `${e.portalLayout.projectPosition(x()).y}px`
371
+ left: `${e.portalLayout.projectPosition(b()).x}px`,
372
+ top: `${e.portalLayout.projectPosition(b()).y}px`
352
373
  };
353
374
  },
354
375
  role: "menu",
376
+ "data-floe-surface": "floating",
355
377
  "aria-labelledby": A,
356
378
  onMouseEnter: () => {
357
379
  clearTimeout(m);
358
380
  },
359
- onMouseLeave: I,
360
- onKeyDown: (s) => {
361
- 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());
362
384
  }
363
385
  }), !1, !0), g(t, l(V, {
364
386
  get each() {
365
387
  return e.item.children;
366
388
  },
367
- children: (s) => l(y, {
389
+ children: (u) => l(y, {
368
390
  get when() {
369
- return !s().separator;
391
+ return !u().separator;
370
392
  },
371
393
  get fallback() {
372
394
  return Z();
@@ -374,7 +396,7 @@ function ee(e) {
374
396
  get children() {
375
397
  return l(ee, {
376
398
  get item() {
377
- return s();
399
+ return u();
378
400
  },
379
401
  selected: !1,
380
402
  get onSelect() {
@@ -396,28 +418,29 @@ function ee(e) {
396
418
  }
397
419
  });
398
420
  }
399
- }), null), i;
421
+ }), null), n;
400
422
  })();
401
423
  }
402
- function Oe(e) {
403
- const f = () => e.options.find((u) => u.value === e.value), c = () => e.options.map((u) => ({
404
- id: u.value,
405
- label: u.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
406
428
  }));
407
429
  return l($e, {
430
+ triggerInputSurface: !0,
408
431
  get triggerClass() {
409
- 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);
410
433
  },
411
434
  get trigger() {
412
435
  return [(() => {
413
- var u = xe();
414
- return g(u, () => f()?.label ?? e.placeholder ?? "Select..."), T(() => D(u, k("truncate", !f() && "text-muted-foreground"))), u;
415
- })(), 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, {
416
439
  class: "w-3.5 h-3.5 text-muted-foreground"
417
440
  })];
418
441
  },
419
442
  get items() {
420
- return c();
443
+ return d();
421
444
  },
422
445
  get value() {
423
446
  return e.value;
@@ -433,6 +456,6 @@ function Oe(e) {
433
456
  te(["click", "keydown"]);
434
457
  export {
435
458
  $e as Dropdown,
436
- Oe as Select,
437
- ke as resolveDropdownTriggerKeyAction
459
+ Fe as Select,
460
+ Pe as resolveDropdownTriggerKeyAction
438
461
  };