@floegence/floe-webapp-core 0.86.76 → 0.87.1

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