@floegence/floe-webapp-core 0.90.4 → 0.90.7

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,74 +1,93 @@
1
- import { createComponent as c, mergeProps as A, insert as s, spread as Z, memo as S, effect as E, setAttribute as y, className as ie, template as h, use as oe, delegateEvents as ue } from "solid-js/web";
2
- import { createUniqueId as de, createSignal as T, createMemo as se, createEffect as K, untrack as ce, onCleanup as p, onMount as fe, Show as x, For as M } from "solid-js";
3
- import { cn as ee } from "../../utils/cn.js";
4
- import { useFloeLocale as ve } from "../../context/LocaleContext.js";
5
- import { useOverlayMask as ge } from "../../hooks/useOverlayMask.js";
6
- import { SurfaceFloatingLayer as me } from "./SurfaceFloatingLayer.js";
7
- import { calculateMenuPosition as he } from "./menuUtils.js";
8
- import { useFormControl as be, joinAriaIds as ye } from "./formFieldContext.js";
9
- import { createControllableValue as F } from "./controllable.js";
10
- import { ChevronDown as we, Check as Ce } from "../icons/index.js";
11
- import { resolveSurfacePortalBoundaryRect as ke, resolveSurfacePortalHost as xe } from "./dialogSurfaceScope.js";
12
- var Ve = /* @__PURE__ */ h("<input>"), Le = /* @__PURE__ */ h("<option value>"), $e = /* @__PURE__ */ h('<div role=status class="px-2 py-2 text-caption">'), Oe = /* @__PURE__ */ h("<button type=button>"), Ee = /* @__PURE__ */ h('<div role=alert class="p-2 text-error">'), De = /* @__PURE__ */ h('<div role=listbox class="max-h-64 overflow-y-auto"data-floe-local-interaction-surface=true>'), _e = /* @__PURE__ */ h('<div role=status class="p-2 text-caption">'), Pe = /* @__PURE__ */ h('<div class="relative min-w-0"><select tabindex=-1 aria-hidden=true class="sr-only pointer-events-none">'), qe = /* @__PURE__ */ h("<button><span class=truncate>"), Ae = /* @__PURE__ */ h("<option selected>"), Se = /* @__PURE__ */ h("<option>"), Te = /* @__PURE__ */ h('<div role=option><span class="h-3.5 w-3.5 shrink-0">');
13
- function H(e) {
14
- const u = ve(), f = be(), g = de(), j = () => e.id ?? f.id ?? "select-" + g, D = "options-" + g, _ = () => e.disabled ?? f.disabled, P = () => e.readOnly ?? f.readOnly, [v, te] = F({
1
+ import { createComponent as c, mergeProps as R, insert as o, spread as te, memo as K, effect as P, use as le, setAttribute as m, className as ve, template as w, delegateEvents as ge } from "solid-js/web";
2
+ import { createUniqueId as me, createSignal as B, createMemo as he, createEffect as N, untrack as be, onCleanup as ae, onMount as ye, Show as V, For as Q } from "solid-js";
3
+ import { cn as re } from "../../utils/cn.js";
4
+ import { useFloeLocale as we } from "../../context/LocaleContext.js";
5
+ import { useOverlayMask as Ce } from "../../hooks/useOverlayMask.js";
6
+ import { SurfaceFloatingLayer as xe } from "./SurfaceFloatingLayer.js";
7
+ import { createFloatingPresence as ke } from "./floatingPresence.js";
8
+ import { calculateMenuPosition as Ve } from "./menuUtils.js";
9
+ import { useFormControl as Le, joinAriaIds as Oe } from "./formFieldContext.js";
10
+ import { createControllableValue as M } from "./controllable.js";
11
+ import { ChevronDown as $e, Check as Ee } from "../icons/index.js";
12
+ import { resolveSurfacePortalBoundaryRect as De, resolveSurfacePortalHost as Pe } from "./dialogSurfaceScope.js";
13
+ var Se = /* @__PURE__ */ w("<input>"), _e = /* @__PURE__ */ w("<option value>"), qe = /* @__PURE__ */ w('<div role=status class="px-2 py-2 text-caption">'), Ae = /* @__PURE__ */ w("<button type=button>"), Fe = /* @__PURE__ */ w('<div role=alert class="p-2 text-error">'), Te = /* @__PURE__ */ w('<div role=status class="p-2 text-caption">'), Be = /* @__PURE__ */ w('<div class="floe-floating-presence floe-floating-menu rounded-panel border border-[var(--floe-line)] bg-popover text-popover-foreground shadow-[var(--floe-elevation-float)] p-1"data-floe-surface=floating><div role=listbox class="max-h-64 overflow-y-auto"data-floe-local-interaction-surface=true>'), Re = /* @__PURE__ */ w('<div class="relative min-w-0"><select tabindex=-1 aria-hidden=true class="sr-only pointer-events-none">'), Ie = /* @__PURE__ */ w("<button><span class=truncate>"), Ke = /* @__PURE__ */ w("<option selected>"), Me = /* @__PURE__ */ w("<option>"), He = /* @__PURE__ */ w('<div role=option><span class="h-3.5 w-3.5 shrink-0">');
14
+ function U(e) {
15
+ const u = we(), g = Le(), b = me(), W = () => e.id ?? g.id ?? "select-" + b, S = "options-" + b, _ = () => e.disabled ?? g.disabled, q = () => e.readOnly ?? g.readOnly, [h, ne] = M({
15
16
  value: () => e.open,
16
17
  defaultValue: e.defaultOpen ?? !1,
17
18
  onChange: (t) => e.onOpenChange?.(t)
18
- }), [B, z] = T(""), [V, $] = T(-1), [le, ae] = T({
19
+ }), [H, G] = B(""), [L, E] = B(-1), [ie, oe] = B({
19
20
  x: 0,
20
21
  y: 0
21
- }), [re, ne] = T(200);
22
- let w, L, k, I = "", N = 0;
23
- const b = se(() => {
24
- if (!e.searchable || e.filter === !1 || !B()) return e.options;
25
- const t = B().toLocaleLowerCase(u.locale);
26
- return e.options.filter((r) => [r.label, ...r.keywords ?? []].some((n) => n.toLocaleLowerCase(u.locale).includes(t)));
27
- }), Q = () => e.values.map((t) => e.options.find((r) => r.value === t)?.label ?? t).join(", "), m = (t) => {
28
- t && (_() || P()) || (te(t), t || z(""));
29
- }, R = (t) => {
30
- _() || P() || t.disabled || (e.onValuesChange(e.multiple ? e.values.includes(t.value) ? e.values.filter((r) => r !== t.value) : [...e.values, t.value] : [t.value]), e.multiple || m(!1), w?.focus({
22
+ }), [ue, de] = B(200);
23
+ let x, O, k, I;
24
+ const D = ke({
25
+ open: h,
26
+ element: () => k
27
+ }), [se, ce] = B("bottom");
28
+ let j = "", J = 0;
29
+ const C = he(() => {
30
+ if (!e.searchable || e.filter === !1 || !H()) return e.options;
31
+ const t = H().toLocaleLowerCase(u.locale);
32
+ return e.options.filter((a) => [a.label, ...a.keywords ?? []].some((i) => i.toLocaleLowerCase(u.locale).includes(t)));
33
+ }), X = () => e.values.map((t) => e.options.find((a) => a.value === t)?.label ?? t).join(", "), y = (t) => {
34
+ t && (_() || q()) || (ne(t), t || G(""));
35
+ }, z = (t) => {
36
+ _() || q() || t.disabled || (e.onValuesChange(e.multiple ? e.values.includes(t.value) ? e.values.filter((a) => a !== t.value) : [...e.values, t.value] : [t.value]), e.multiple || y(!1), x?.focus({
31
37
  preventScroll: !0
32
38
  }));
33
- }, U = (t, r) => {
34
- const n = b().map((o, i) => o.disabled ? -1 : i).filter((o) => o >= 0);
35
- if (!n.length) {
36
- $(-1);
39
+ }, Y = (t, a) => {
40
+ const i = C().map((v, r) => v.disabled ? -1 : r).filter((v) => v >= 0);
41
+ if (!i.length) {
42
+ E(-1);
37
43
  return;
38
44
  }
39
- const l = n.indexOf(V()), a = r === "first" ? 0 : r === "last" ? n.length - 1 : l < 0 ? t < 0 ? n.length - 1 : 0 : (l + t + n.length) % n.length;
40
- $(n[a]), k?.querySelector('[id="' + D + "-" + n[a] + '"]')?.scrollIntoView({
45
+ const l = i.indexOf(L()), n = a === "first" ? 0 : a === "last" ? i.length - 1 : l < 0 ? t < 0 ? i.length - 1 : 0 : (l + t + i.length) % i.length;
46
+ E(i[n]), k?.querySelector('[id="' + S + "-" + i[n] + '"]')?.scrollIntoView({
41
47
  block: "nearest"
42
48
  });
43
- }, O = () => {
44
- if (!w || !k) return;
45
- const t = w.getBoundingClientRect();
46
- ne(t.width);
47
- const r = ke(xe({
48
- owner: w
49
- }));
50
- ae(he(t, k.getBoundingClientRect(), u.direction === "rtl" ? "end" : "start", r));
49
+ }, fe = () => {
50
+ if (!x || !k) return;
51
+ const t = x.getBoundingClientRect();
52
+ de(t.width);
53
+ const a = De(Pe({
54
+ owner: x
55
+ })), i = Ve(
56
+ t,
57
+ // The position layer is never transformed; motion belongs to its child.
58
+ I?.getBoundingClientRect() ?? k.getBoundingClientRect(),
59
+ u.direction === "rtl" ? "end" : "start",
60
+ a
61
+ );
62
+ ce(i.y < t.top ? "top" : "bottom"), oe(i);
51
63
  };
52
- K(() => {
53
- if (!v()) return;
54
- const t = ce(V);
55
- if (t < 0 || !b()[t] || b()[t].disabled) {
56
- const r = b().findIndex((n) => !n.disabled && e.values.includes(n.value));
57
- $(r >= 0 ? r : b().findIndex((n) => !n.disabled));
64
+ N(() => {
65
+ if (!h()) return;
66
+ const t = be(L);
67
+ if (t < 0 || !C()[t] || C()[t].disabled) {
68
+ const a = C().findIndex((i) => !i.disabled && e.values.includes(i.value));
69
+ E(a >= 0 ? a : C().findIndex((i) => !i.disabled));
58
70
  }
59
- }), K(() => {
60
- if (!v() || typeof window > "u") return;
61
- const t = requestAnimationFrame(O), r = new ResizeObserver(O);
62
- w && r.observe(w), k && r.observe(k), window.addEventListener("resize", O), window.addEventListener("scroll", O, !0), p(() => {
63
- cancelAnimationFrame(t), r.disconnect(), window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0);
71
+ }), N(() => {
72
+ if (!D.mounted() || D.exiting() || typeof window > "u") return;
73
+ let t = 0;
74
+ const a = () => {
75
+ t || (t = requestAnimationFrame(() => {
76
+ t = 0, fe();
77
+ }));
78
+ };
79
+ a();
80
+ const i = new ResizeObserver(a);
81
+ x && i.observe(x), I && i.observe(I), window.addEventListener("resize", a), window.addEventListener("scroll", a, !0), ae(() => {
82
+ cancelAnimationFrame(t), i.disconnect(), window.removeEventListener("resize", a), window.removeEventListener("scroll", a, !0);
64
83
  });
65
- }), ge({
66
- open: v,
84
+ }), Ce({
85
+ open: h,
67
86
  root: () => k,
68
- containsTarget: (t) => t instanceof Node && !!(k?.contains(t) || w?.contains(t)),
69
- onClose: () => m(!1),
70
- onInteractOutside: () => m(!1),
71
- onEscapeOutside: () => m(!1),
87
+ containsTarget: (t) => t instanceof Node && !!(k?.contains(t) || x?.contains(t)),
88
+ onClose: () => y(!1),
89
+ onInteractOutside: () => y(!1),
90
+ onEscapeOutside: () => y(!1),
72
91
  lockBodyScroll: !1,
73
92
  trapFocus: !1,
74
93
  autoFocus: !1,
@@ -76,42 +95,42 @@ function H(e) {
76
95
  blockHotkeys: !1,
77
96
  closeOnEscape: "inside",
78
97
  escapeKeyPhase: "bubble"
79
- }), fe(() => {
80
- const t = L?.form;
81
- let r;
82
- const n = (l) => {
83
- clearTimeout(r), r = setTimeout(() => {
84
- if (!l.defaultPrevented && (e.onValuesChange([...e.resetValues]), m(!1), L))
85
- for (const a of L.options) a.selected = e.values.includes(a.value);
98
+ }), ye(() => {
99
+ const t = O?.form;
100
+ let a;
101
+ const i = (l) => {
102
+ clearTimeout(a), a = setTimeout(() => {
103
+ if (!l.defaultPrevented && (e.onValuesChange([...e.resetValues]), y(!1), O))
104
+ for (const n of O.options) n.selected = e.values.includes(n.value);
86
105
  });
87
106
  };
88
- t?.addEventListener("reset", n), p(() => {
89
- clearTimeout(r), t?.removeEventListener("reset", n);
107
+ t?.addEventListener("reset", i), ae(() => {
108
+ clearTimeout(a), t?.removeEventListener("reset", i);
90
109
  });
91
- }), K(() => {
110
+ }), N(() => {
92
111
  const t = e.values;
93
- if (e.options, L) for (const r of L.options) r.selected = t.includes(r.value);
112
+ if (e.options, O) for (const a of O.options) a.selected = t.includes(a.value);
94
113
  });
95
- const W = {
114
+ const Z = {
96
115
  get id() {
97
- return j();
116
+ return W();
98
117
  },
99
118
  get disabled() {
100
119
  return _();
101
120
  },
102
121
  get "aria-readonly"() {
103
- return P();
122
+ return q();
104
123
  },
105
124
  role: "combobox",
106
125
  "aria-haspopup": "listbox",
107
126
  get "aria-expanded"() {
108
- return v();
127
+ return h();
109
128
  },
110
129
  get "aria-controls"() {
111
- return v() ? D : void 0;
130
+ return h() ? S : void 0;
112
131
  },
113
132
  get "aria-activedescendant"() {
114
- return v() && b()[V()] ? D + "-" + V() : void 0;
133
+ return h() && C()[L()] ? S + "-" + L() : void 0;
115
134
  },
116
135
  get "aria-label"() {
117
136
  return e.ariaLabel;
@@ -120,232 +139,232 @@ function H(e) {
120
139
  return e.ariaLabelledBy;
121
140
  },
122
141
  get "aria-describedby"() {
123
- return ye(f["aria-describedby"], e.ariaDescribedBy);
142
+ return Oe(g["aria-describedby"], e.ariaDescribedBy);
124
143
  },
125
144
  get "aria-invalid"() {
126
- return e.invalid || f["aria-invalid"];
145
+ return e.invalid || g["aria-invalid"];
127
146
  },
128
147
  get "aria-required"() {
129
- return e.required ?? f.required;
148
+ return e.required ?? g.required;
130
149
  },
131
150
  "data-floe-input-surface": "true",
132
151
  "data-floe-control": "select",
133
152
  "data-floe-dropdown-trigger": "",
134
153
  "data-floe-surface": "inset",
135
154
  get class() {
136
- return ee("floe-field flex w-full min-w-0 items-center justify-between gap-2 h-[var(--floe-control-height-md)] px-2.5 text-[length:var(--floe-type-control)]", e.class);
155
+ return re("floe-field flex w-full min-w-0 items-center justify-between gap-2 h-[var(--floe-control-height-md)] px-2.5 text-[length:var(--floe-type-control)]", e.class);
137
156
  },
138
157
  onKeyDown: (t) => {
139
- if (!(_() || P() || t.isComposing)) {
140
- if (t.key === "Escape" && v()) {
141
- t.preventDefault(), t.stopPropagation(), m(!1);
158
+ if (!(_() || q() || t.isComposing)) {
159
+ if (t.key === "Escape" && h()) {
160
+ t.preventDefault(), t.stopPropagation(), y(!1);
142
161
  return;
143
162
  }
144
163
  if (t.key === "Tab") {
145
- m(!1);
164
+ y(!1);
146
165
  return;
147
166
  }
148
167
  if (t.key === "ArrowDown" || t.key === "ArrowUp") {
149
168
  t.preventDefault();
150
- const r = v();
151
- m(!0), r && U(t.key === "ArrowDown" ? 1 : -1);
169
+ const a = h();
170
+ y(!0), a && Y(t.key === "ArrowDown" ? 1 : -1);
152
171
  return;
153
172
  }
154
- if (v() && (t.key === "Home" || t.key === "End") && !e.searchable) {
155
- t.preventDefault(), U(0, t.key === "Home" ? "first" : "last");
173
+ if (h() && (t.key === "Home" || t.key === "End") && !e.searchable) {
174
+ t.preventDefault(), Y(0, t.key === "Home" ? "first" : "last");
156
175
  return;
157
176
  }
158
177
  if (t.key === "Enter" || !e.searchable && t.key === " ") {
159
- t.preventDefault(), v() && b()[V()] ? R(b()[V()]) : m(!0);
178
+ t.preventDefault(), h() && C()[L()] ? z(C()[L()]) : y(!0);
160
179
  return;
161
180
  }
162
181
  if (!e.searchable && t.key.length === 1 && !t.ctrlKey && !t.metaKey && !t.altKey) {
163
- const r = Date.now();
164
- I = r - N > 700 ? t.key : I + t.key, N = r;
165
- const n = e.options.find((l) => !l.disabled && l.label.toLocaleLowerCase(u.locale).startsWith(I.toLocaleLowerCase(u.locale)));
166
- n && (t.preventDefault(), v() ? $(b().indexOf(n)) : R(n));
182
+ const a = Date.now();
183
+ j = a - J > 700 ? t.key : j + t.key, J = a;
184
+ const i = e.options.find((l) => !l.disabled && l.label.toLocaleLowerCase(u.locale).startsWith(j.toLocaleLowerCase(u.locale)));
185
+ i && (t.preventDefault(), h() ? E(C().indexOf(i)) : z(i));
167
186
  }
168
187
  }
169
188
  },
170
189
  ref: (t) => {
171
- w = t, e.ref?.(t);
190
+ x = t, e.ref?.(t);
172
191
  }
173
192
  };
174
193
  return (() => {
175
- var t = Pe(), r = t.firstChild;
176
- s(t, c(x, {
194
+ var t = Re(), a = t.firstChild;
195
+ o(t, c(V, {
177
196
  get when() {
178
197
  return e.searchable;
179
198
  },
180
199
  get fallback() {
181
200
  return (() => {
182
- var l = qe(), a = l.firstChild;
183
- return Z(l, A(W, {
201
+ var l = Ie(), n = l.firstChild;
202
+ return te(l, R(Z, {
184
203
  type: "button",
185
- onClick: () => m(!v())
186
- }), !1, !0), s(a, () => Q() || e.placeholder || u.t("selectPlaceholder")), s(l, c(we, {
204
+ onClick: () => y(!h())
205
+ }), !1, !0), o(n, () => X() || e.placeholder || u.t("selectPlaceholder")), o(l, c($e, {
187
206
  class: "h-3.5 w-3.5 shrink-0"
188
207
  }), null), l;
189
208
  })();
190
209
  },
191
210
  get children() {
192
- var l = Ve();
193
- return Z(l, A(W, {
211
+ var l = Se();
212
+ return te(l, R(Z, {
194
213
  type: "text",
195
214
  autocomplete: "off",
196
215
  get readOnly() {
197
- return P();
216
+ return q();
198
217
  },
199
218
  "aria-autocomplete": "list",
200
219
  get placeholder() {
201
220
  return e.placeholder ?? u.t("searchPlaceholder");
202
221
  },
203
222
  get value() {
204
- return S(() => !!v())() ? B() : Q();
223
+ return K(() => !!h())() ? H() : X();
205
224
  },
206
- onClick: () => m(!0),
207
- onInput: (a) => {
208
- z(a.currentTarget.value), $(-1), m(!0), e.onQueryChange?.(a.currentTarget.value);
225
+ onClick: () => y(!0),
226
+ onInput: (n) => {
227
+ G(n.currentTarget.value), E(-1), y(!0), e.onQueryChange?.(n.currentTarget.value);
209
228
  }
210
229
  }), !1, !1), l;
211
230
  }
212
- }), r), r.addEventListener("change", (l) => e.onValuesChange(Array.from(l.currentTarget.selectedOptions, (a) => a.value))), r.addEventListener("invalid", (l) => {
213
- l.preventDefault(), w?.focus();
231
+ }), a), a.addEventListener("change", (l) => e.onValuesChange(Array.from(l.currentTarget.selectedOptions, (n) => n.value))), a.addEventListener("invalid", (l) => {
232
+ l.preventDefault(), x?.focus();
214
233
  });
215
- var n = L;
216
- return typeof n == "function" ? oe(n, r) : L = r, s(r, c(x, {
234
+ var i = O;
235
+ return typeof i == "function" ? le(i, a) : O = a, o(a, c(V, {
217
236
  get when() {
218
- return S(() => !e.multiple)() && !e.options.some((l) => l.value === "");
237
+ return K(() => !e.multiple)() && !e.options.some((l) => l.value === "");
219
238
  },
220
239
  get children() {
221
- var l = Le();
222
- return E(() => l.selected = !e.values.length || e.values[0] === ""), l;
240
+ var l = _e();
241
+ return P(() => l.selected = !e.values.length || e.values[0] === ""), l;
223
242
  }
224
- }), null), s(r, c(M, {
243
+ }), null), o(a, c(Q, {
225
244
  get each() {
226
- return e.values.filter((l) => l !== "" && !e.options.some((a) => a.value === l));
245
+ return e.values.filter((l) => l !== "" && !e.options.some((n) => n.value === l));
227
246
  },
228
247
  children: (l) => (() => {
229
- var a = Ae();
230
- return a.value = l, s(a, l), a;
248
+ var n = Ke();
249
+ return n.value = l, o(n, l), n;
231
250
  })()
232
- }), null), s(r, c(M, {
251
+ }), null), o(a, c(Q, {
233
252
  get each() {
234
253
  return e.options;
235
254
  },
236
255
  children: (l) => (() => {
237
- var a = Se();
238
- return s(a, () => l.label), E((o) => {
239
- var i = e.values.includes(l.value), C = l.disabled;
240
- return i !== o.e && (a.selected = o.e = i), C !== o.t && (a.disabled = o.t = C), o;
256
+ var n = Me();
257
+ return o(n, () => l.label), P((v) => {
258
+ var r = e.values.includes(l.value), f = l.disabled;
259
+ return r !== v.e && (n.selected = v.e = r), f !== v.t && (n.disabled = v.t = f), v;
241
260
  }, {
242
261
  e: void 0,
243
262
  t: void 0
244
- }), E(() => a.value = l.value), a;
263
+ }), P(() => n.value = l.value), n;
245
264
  })()
246
- }), null), s(t, c(x, {
265
+ }), null), o(t, c(V, {
247
266
  get when() {
248
- return v();
267
+ return D.mounted();
249
268
  },
250
269
  get children() {
251
- return c(me, {
252
- owner: w,
270
+ return c(xe, {
271
+ owner: x,
253
272
  get position() {
254
- return le();
273
+ return ie();
255
274
  },
256
275
  layerRef: (l) => {
257
- k = l;
276
+ I = l;
258
277
  },
259
278
  get dir() {
260
279
  return u.direction;
261
280
  },
262
- class: "rounded-panel border border-[var(--floe-line)] bg-popover text-popover-foreground shadow-[var(--floe-elevation-float)] p-1",
263
281
  get style() {
264
282
  return {
265
- width: re() + "px",
283
+ width: ue() + "px",
266
284
  "max-width": "calc(100vw - 24px)"
267
285
  };
268
286
  },
269
- "data-floe-surface": "floating",
270
287
  get children() {
271
- return [c(x, {
288
+ var l = Be(), n = l.firstChild, v = k;
289
+ return typeof v == "function" ? le(v, l) : k = l, o(l, c(V, {
272
290
  get when() {
273
291
  return e.loading;
274
292
  },
275
293
  get children() {
276
- var l = $e();
277
- return s(l, () => u.t("loading")), l;
294
+ var r = qe();
295
+ return o(r, () => u.t("loading")), r;
278
296
  }
279
- }), c(x, {
297
+ }), n), o(l, c(V, {
280
298
  get when() {
281
299
  return e.error;
282
300
  },
283
301
  get children() {
284
- var l = Ee();
285
- return s(l, () => e.error, null), s(l, c(x, {
302
+ var r = Fe();
303
+ return o(r, () => e.error, null), o(r, c(V, {
286
304
  get when() {
287
305
  return e.onRetry;
288
306
  },
289
307
  get children() {
290
- var a = Oe();
291
- return a.$$click = () => e.onRetry?.(), s(a, () => u.t("retry")), a;
308
+ var f = Ae();
309
+ return f.$$click = () => e.onRetry?.(), o(f, () => u.t("retry")), f;
292
310
  }
293
- }), null), l;
311
+ }), null), r;
294
312
  }
295
- }), (() => {
296
- var l = De();
297
- return y(l, "id", D), s(l, c(M, {
298
- get each() {
299
- return b();
300
- },
301
- children: (a, o) => (() => {
302
- var i = Te(), C = i.firstChild;
303
- return i.$$click = () => R(a), i.$$pointermove = () => !a.disabled && $(o()), i.$$pointerdown = (d) => d.preventDefault(), s(C, c(x, {
304
- get when() {
305
- return e.values.includes(a.value);
306
- },
307
- get children() {
308
- return c(Ce, {
309
- class: "h-3.5 w-3.5"
310
- });
311
- }
312
- })), s(i, (() => {
313
- var d = S(() => !!e.renderOption);
314
- return () => d() ? e.renderOption(a) : a.label;
315
- })(), null), E((d) => {
316
- var q = D + "-" + o(), G = e.values.includes(a.value), J = a.disabled || void 0, X = e.values.includes(a.value) ? "true" : void 0, Y = ee("flex min-h-[var(--floe-row-height)] items-center gap-2 rounded-sm px-2 text-[length:var(--floe-type-control)]", V() === o() && "bg-accent text-accent-foreground", a.disabled ? "opacity-50" : "cursor-pointer");
317
- return q !== d.e && y(i, "id", d.e = q), G !== d.t && y(i, "aria-selected", d.t = G), J !== d.a && y(i, "aria-disabled", d.a = J), X !== d.o && y(i, "data-floe-selected", d.o = X), Y !== d.i && ie(i, d.i = Y), d;
318
- }, {
319
- e: void 0,
320
- t: void 0,
321
- a: void 0,
322
- o: void 0,
323
- i: void 0
324
- }), i;
325
- })()
326
- })), E((a) => {
327
- var o = e.ariaLabel, i = e.ariaLabelledBy ?? (e.ariaLabel ? void 0 : j()), C = e.multiple || void 0;
328
- return o !== a.e && y(l, "aria-label", a.e = o), i !== a.t && y(l, "aria-labelledby", a.t = i), C !== a.a && y(l, "aria-multiselectable", a.a = C), a;
329
- }, {
330
- e: void 0,
331
- t: void 0,
332
- a: void 0
333
- }), l;
334
- })(), c(x, {
313
+ }), n), m(n, "id", S), o(n, c(Q, {
314
+ get each() {
315
+ return C();
316
+ },
317
+ children: (r, f) => (() => {
318
+ var s = He(), $ = s.firstChild;
319
+ return s.$$click = () => z(r), s.$$pointermove = () => !r.disabled && E(f()), s.$$pointerdown = (d) => d.preventDefault(), o($, c(V, {
320
+ get when() {
321
+ return e.values.includes(r.value);
322
+ },
323
+ get children() {
324
+ return c(Ee, {
325
+ class: "h-3.5 w-3.5"
326
+ });
327
+ }
328
+ })), o(s, (() => {
329
+ var d = K(() => !!e.renderOption);
330
+ return () => d() ? e.renderOption(r) : r.label;
331
+ })(), null), P((d) => {
332
+ var A = S + "-" + f(), F = e.values.includes(r.value), T = r.disabled || void 0, p = e.values.includes(r.value) ? "true" : void 0, ee = re("flex min-h-[var(--floe-row-height)] items-center gap-2 rounded-sm px-2 text-[length:var(--floe-type-control)]", L() === f() && "bg-accent text-accent-foreground", r.disabled ? "opacity-50" : "cursor-pointer");
333
+ return A !== d.e && m(s, "id", d.e = A), F !== d.t && m(s, "aria-selected", d.t = F), T !== d.a && m(s, "aria-disabled", d.a = T), p !== d.o && m(s, "data-floe-selected", d.o = p), ee !== d.i && ve(s, d.i = ee), d;
334
+ }, {
335
+ e: void 0,
336
+ t: void 0,
337
+ a: void 0,
338
+ o: void 0,
339
+ i: void 0
340
+ }), s;
341
+ })()
342
+ })), o(l, c(V, {
335
343
  get when() {
336
- return S(() => !b().length && !e.loading)() && !e.error;
344
+ return K(() => !C().length && !e.loading)() && !e.error;
337
345
  },
338
346
  get children() {
339
- var l = _e();
340
- return s(l, () => u.t("noResults")), l;
347
+ var r = Te();
348
+ return o(r, () => u.t("noResults")), r;
341
349
  }
342
- })];
350
+ }), null), P((r) => {
351
+ var f = D.state(), s = se(), $ = D.exiting(), d = D.exiting() ? "true" : void 0, A = e.ariaLabel, F = e.ariaLabelledBy ?? (e.ariaLabel ? void 0 : W()), T = e.multiple || void 0;
352
+ return f !== r.e && m(l, "data-floating-presence", r.e = f), s !== r.t && m(l, "data-floating-side", r.t = s), $ !== r.a && (l.inert = r.a = $), d !== r.o && m(l, "aria-hidden", r.o = d), A !== r.i && m(n, "aria-label", r.i = A), F !== r.n && m(n, "aria-labelledby", r.n = F), T !== r.s && m(n, "aria-multiselectable", r.s = T), r;
353
+ }, {
354
+ e: void 0,
355
+ t: void 0,
356
+ a: void 0,
357
+ o: void 0,
358
+ i: void 0,
359
+ n: void 0,
360
+ s: void 0
361
+ }), l;
343
362
  }
344
363
  });
345
364
  }
346
- }), null), E((l) => {
347
- var a = u.direction, o = e.name ?? f.name, i = e.form, C = e.required ?? f.required, d = _(), q = e.multiple;
348
- return a !== l.e && y(t, "dir", l.e = a), o !== l.t && y(r, "name", l.t = o), i !== l.a && y(r, "form", l.a = i), C !== l.o && (r.required = l.o = C), d !== l.i && (r.disabled = l.i = d), q !== l.n && (r.multiple = l.n = q), l;
365
+ }), null), P((l) => {
366
+ var n = u.direction, v = e.name ?? g.name, r = e.form, f = e.required ?? g.required, s = _(), $ = e.multiple;
367
+ return n !== l.e && m(t, "dir", l.e = n), v !== l.t && m(a, "name", l.t = v), r !== l.a && m(a, "form", l.a = r), f !== l.o && (a.required = l.o = f), s !== l.i && (a.disabled = l.i = s), $ !== l.n && (a.multiple = l.n = $), l;
349
368
  }, {
350
369
  e: void 0,
351
370
  t: void 0,
@@ -356,29 +375,29 @@ function H(e) {
356
375
  }), t;
357
376
  })();
358
377
  }
359
- function We(e) {
360
- const [u, f] = F({
378
+ function tt(e) {
379
+ const [u, g] = M({
361
380
  value: () => e.value,
362
381
  defaultValue: e.defaultValue ?? "",
363
- onChange: (g) => e.onChange?.(g)
382
+ onChange: (b) => e.onChange?.(b)
364
383
  });
365
- return c(H, A(e, {
384
+ return c(U, R(e, {
366
385
  get values() {
367
386
  return [u()];
368
387
  },
369
388
  get resetValues() {
370
389
  return [e.defaultValue ?? ""];
371
390
  },
372
- onValuesChange: (g) => f(g[0] ?? "")
391
+ onValuesChange: (b) => g(b[0] ?? "")
373
392
  }));
374
393
  }
375
- function Ge(e) {
376
- const [u, f] = F({
394
+ function lt(e) {
395
+ const [u, g] = M({
377
396
  value: () => e.value,
378
397
  defaultValue: e.defaultValue ?? "",
379
- onChange: (g) => e.onChange?.(g)
398
+ onChange: (b) => e.onChange?.(b)
380
399
  });
381
- return c(H, A(e, {
400
+ return c(U, R(e, {
382
401
  searchable: !0,
383
402
  get values() {
384
403
  return [u()];
@@ -386,16 +405,16 @@ function Ge(e) {
386
405
  get resetValues() {
387
406
  return [e.defaultValue ?? ""];
388
407
  },
389
- onValuesChange: (g) => f(g[0] ?? "")
408
+ onValuesChange: (b) => g(b[0] ?? "")
390
409
  }));
391
410
  }
392
- function Je(e) {
393
- const [u, f] = F({
411
+ function at(e) {
412
+ const [u, g] = M({
394
413
  value: () => e.value,
395
414
  defaultValue: e.defaultValue ?? [],
396
- onChange: (g) => e.onChange?.(g)
415
+ onChange: (b) => e.onChange?.(b)
397
416
  });
398
- return c(H, A(e, {
417
+ return c(U, R(e, {
399
418
  multiple: !0,
400
419
  get values() {
401
420
  return u();
@@ -403,12 +422,12 @@ function Je(e) {
403
422
  get resetValues() {
404
423
  return e.defaultValue ?? [];
405
424
  },
406
- onValuesChange: f
425
+ onValuesChange: g
407
426
  }));
408
427
  }
409
- ue(["click", "pointerdown", "pointermove"]);
428
+ ge(["click", "pointerdown", "pointermove"]);
410
429
  export {
411
- Ge as Combobox,
412
- Je as MultiSelect,
413
- We as Select
430
+ lt as Combobox,
431
+ at as MultiSelect,
432
+ tt as Select
414
433
  };