@floegence/floe-webapp-core 0.90.6 → 0.90.8

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,8 +1,8 @@
1
- import { createComponent as n, insert as a, effect as f, className as g, setAttribute as m, spread as A, mergeProps as B, template as v, use as N, memo as G } from "solid-js/web";
1
+ import { createComponent as l, insert as a, effect as f, className as h, setAttribute as m, spread as A, mergeProps as B, template as v, use as N, memo as G } from "solid-js/web";
2
2
  import { splitProps as P, createUniqueId as U, Switch as V, Match as j, Show as b, For as J, useContext as K, createEffect as Q, createContext as R } from "solid-js";
3
3
  import { useFormControl as T } from "./formFieldContext.js";
4
4
  import { cn as d } from "../../utils/cn.js";
5
- var W = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M2 6l3 3 5-6">'), X = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round><path d="M2 6h8">'), Y = /* @__PURE__ */ v("<div role=group>"), Z = /* @__PURE__ */ v("<div data-floe-surface=inset data-floe-surface-part=indicator data-floe-choice-kind=checkbox aria-hidden=true>"), ee = /* @__PURE__ */ v("<input>"), $ = /* @__PURE__ */ v("<span>"), re = /* @__PURE__ */ v('<div class="flex flex-col">'), te = /* @__PURE__ */ v('<label data-floe-checkbox-target><div class="relative flex items-center justify-center pt-0.5">'), ne = /* @__PURE__ */ v("<label data-floe-surface-part=choice><span class=font-medium>"), oe = /* @__PURE__ */ v('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-[var(--floe-accent-ink)]"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"clip-rule=evenodd>'), le = /* @__PURE__ */ v('<label data-floe-surface-part=choice><div class="flex items-start gap-3"><div class="flex items-center justify-center pt-0.5"></div><div class="flex flex-col flex-1 min-w-0">'), ae = /* @__PURE__ */ v('<div class="absolute top-1.5 right-1.5"><div class="w-4 h-4 rounded-full bg-primary flex items-center justify-center">'), ie = /* @__PURE__ */ v("<label data-floe-surface-part=choice>"), se = /* @__PURE__ */ v("<div>");
5
+ var W = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="M2 6l3 3 5-6">'), X = /* @__PURE__ */ v('<svg viewBox="0 0 12 12"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round><path d="M2 6h8">'), Y = /* @__PURE__ */ v("<div role=group>"), Z = /* @__PURE__ */ v("<div data-floe-surface=inset data-floe-surface-part=indicator data-floe-choice-kind=checkbox aria-hidden=true>"), ee = /* @__PURE__ */ v("<input>"), $ = /* @__PURE__ */ v("<span>"), re = /* @__PURE__ */ v('<div class="flex flex-col">'), te = /* @__PURE__ */ v("<label data-floe-checkbox-target><div>"), ne = /* @__PURE__ */ v("<label data-floe-surface-part=choice><span class=font-medium>"), oe = /* @__PURE__ */ v('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-[var(--floe-accent-ink)]"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"clip-rule=evenodd>'), le = /* @__PURE__ */ v('<label data-floe-surface-part=choice><div class="flex items-start gap-3"><div class="flex items-center justify-center pt-0.5"></div><div class="flex flex-col flex-1 min-w-0">'), ae = /* @__PURE__ */ v('<div class="absolute top-1.5 right-1.5"><div class="w-4 h-4 rounded-full bg-primary flex items-center justify-center">'), ie = /* @__PURE__ */ v("<label data-floe-surface-part=choice>"), se = /* @__PURE__ */ v("<div>");
6
6
  const E = R();
7
7
  function ce() {
8
8
  return K(E);
@@ -63,22 +63,22 @@ function fe(p) {
63
63
  function ve(p) {
64
64
  const [s, x] = P(p, ["value", "onChange", "size", "orientation", "variant", "disabled", "class", "children"]), e = () => s.variant ?? "default", M = {
65
65
  value: () => s.value ?? [],
66
- onChange: (h, y) => {
67
- const u = s.value ?? [], w = y ? [...u, h] : u.filter((k) => k !== h);
66
+ onChange: (g, y) => {
67
+ const u = s.value ?? [], w = y ? [...u, g] : u.filter((k) => k !== g);
68
68
  s.onChange?.(w);
69
69
  },
70
70
  size: () => s.size ?? "md",
71
71
  variant: e,
72
72
  disabled: () => s.disabled ?? !1
73
73
  }, S = () => {
74
- const h = e(), y = s.orientation === "horizontal";
75
- return h === "button" ? d("inline-flex rounded-group border border-[var(--floe-line)] overflow-hidden", y ? "flex-row" : "flex-col") : h === "card" || h === "tile" ? d("grid gap-2", y ? "grid-flow-col auto-cols-fr" : "grid-cols-1") : d("flex", y ? "flex-row flex-wrap gap-4" : "flex-col gap-2");
74
+ const g = e(), y = s.orientation === "horizontal";
75
+ return g === "button" ? d("inline-flex rounded-group border border-[var(--floe-line)] overflow-hidden", y ? "flex-row" : "flex-col") : g === "card" || g === "tile" ? d("grid gap-2", y ? "grid-flow-col auto-cols-fr" : "grid-cols-1") : d("flex", y ? "flex-row flex-wrap gap-4" : "flex-col gap-2");
76
76
  };
77
- return n(E.Provider, {
77
+ return l(E.Provider, {
78
78
  value: M,
79
79
  get children() {
80
- var h = Y();
81
- return A(h, B({
80
+ var g = Y();
81
+ return A(g, B({
82
82
  get "data-floe-surface"() {
83
83
  return e() === "button" ? "inset" : void 0;
84
84
  },
@@ -88,40 +88,40 @@ function ve(p) {
88
88
  get class() {
89
89
  return d(S(), s.class);
90
90
  }
91
- }, x), !1, !0), a(h, () => s.children), h;
91
+ }, x), !1, !0), a(g, () => s.children), g;
92
92
  }
93
93
  });
94
94
  }
95
95
  function he(p) {
96
- const s = T(), x = ce(), [e, M] = P(p, ["value", "checked", "onChange", "label", "description", "icon", "size", "variant", "indeterminate", "ref", "class", "disabled", "id"]), S = U(), h = () => e.id ?? (x ? S : s.id) ?? S, y = () => x !== void 0, u = () => e.size ?? x?.size() ?? "md", w = () => e.variant ?? x?.variant() ?? "default", k = () => e.disabled ?? (x?.disabled() || s.disabled || !1), c = () => y() && e.value ? x.value().includes(e.value) : e.checked ?? !1, H = () => {
96
+ const s = T(), x = ce(), [e, M] = P(p, ["value", "checked", "onChange", "label", "description", "icon", "size", "variant", "indeterminate", "ref", "class", "disabled", "id"]), S = U(), g = () => e.id ?? (x ? S : s.id) ?? S, y = () => x !== void 0, u = () => e.size ?? x?.size() ?? "md", w = () => e.variant ?? x?.variant() ?? "default", k = () => e.disabled ?? (x?.disabled() || s.disabled || !1), c = () => y() && e.value ? x.value().includes(e.value) : e.checked ?? !1, H = () => {
97
97
  k() || (y() && e.value ? x.onChange(e.value, !c()) : e.onChange?.(!c()));
98
98
  }, q = () => (() => {
99
99
  var t = Z();
100
- return a(t, n(b, {
100
+ return a(t, l(b, {
101
101
  get when() {
102
102
  return e.indeterminate;
103
103
  },
104
104
  get children() {
105
- return n(fe, {
105
+ return l(fe, {
106
106
  get class() {
107
107
  return d(C[u()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
108
108
  }
109
109
  });
110
110
  }
111
- }), null), a(t, n(b, {
111
+ }), null), a(t, l(b, {
112
112
  get when() {
113
113
  return G(() => !e.indeterminate)() && c();
114
114
  },
115
115
  get children() {
116
- return n(O, {
116
+ return l(O, {
117
117
  get class() {
118
118
  return d(C[u()].icon, "transition-transform duration-[var(--floe-duration-fast)]");
119
119
  }
120
120
  });
121
121
  }
122
122
  }), null), f((r) => {
123
- var o = c() || e.indeterminate ? "true" : void 0, l = d("rounded-xs border transition-[background-color,border-color,color,transform] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "flex items-center justify-center", C[u()].box, c() || e.indeterminate ? "border-primary bg-primary text-primary-foreground" : "border-[var(--floe-control-edge)] bg-transparent hover:border-[var(--floe-control-edge-hover)]", k() && "cursor-not-allowed");
124
- return o !== r.e && m(t, "data-floe-selected", r.e = o), l !== r.t && g(t, r.t = l), r;
123
+ var n = c() || e.indeterminate ? "true" : void 0, o = d("rounded-xs border transition-[background-color,border-color,color,transform] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "flex items-center justify-center", C[u()].box, c() || e.indeterminate ? "border-primary bg-primary text-primary-foreground" : "border-[var(--floe-control-edge)] bg-transparent hover:border-[var(--floe-control-edge-hover)]", k() && "cursor-not-allowed");
124
+ return n !== r.e && m(t, "data-floe-selected", r.e = n), o !== r.t && h(t, r.t = o), r;
125
125
  }, {
126
126
  e: void 0,
127
127
  t: void 0
@@ -131,14 +131,14 @@ function he(p) {
131
131
  return Q(() => {
132
132
  r && (r.indeterminate = e.indeterminate ?? !1);
133
133
  }), (() => {
134
- var o = ee();
135
- return N((l) => {
136
- r = l, typeof e.ref == "function" && e.ref(l);
137
- }, o), A(o, B(s, {
134
+ var n = ee();
135
+ return N((o) => {
136
+ r = o, typeof e.ref == "function" && e.ref(o);
137
+ }, n), A(n, B(s, {
138
138
  "data-floe-choice-input": "",
139
139
  type: "checkbox",
140
140
  get id() {
141
- return h();
141
+ return g();
142
142
  },
143
143
  get value() {
144
144
  return e.value;
@@ -152,61 +152,67 @@ function he(p) {
152
152
  get disabled() {
153
153
  return k();
154
154
  },
155
- onClick: (l) => {
156
- (p.readOnly ?? s.readOnly) && l.preventDefault();
155
+ onClick: (o) => {
156
+ (p.readOnly ?? s.readOnly) && o.preventDefault();
157
157
  },
158
158
  onChange: H,
159
159
  get class() {
160
160
  return t.class ?? "sr-only peer";
161
161
  }
162
- }, M), !1, !1), o;
162
+ }, M), !1, !1), n;
163
163
  })();
164
164
  };
165
- return n(V, {
165
+ return l(V, {
166
166
  get children() {
167
- return [n(j, {
167
+ return [l(j, {
168
168
  get when() {
169
169
  return w() === "default";
170
170
  },
171
171
  get children() {
172
172
  var t = te(), r = t.firstChild;
173
- return a(r, n(I, {}), null), a(r, n(q, {}), null), a(t, n(b, {
173
+ return a(r, l(I, {}), null), a(r, l(q, {}), null), a(t, l(b, {
174
174
  get when() {
175
175
  return e.label || e.description;
176
176
  },
177
177
  get children() {
178
- var o = re();
179
- return a(o, n(b, {
178
+ var n = re();
179
+ return a(n, l(b, {
180
180
  get when() {
181
181
  return e.label;
182
182
  },
183
183
  get children() {
184
- var l = $();
185
- return a(l, () => e.label), f(() => g(l, d("text-foreground", C[u()].label))), l;
184
+ var o = $();
185
+ return a(o, () => e.label), f(() => h(o, d("text-foreground", C[u()].label))), o;
186
186
  }
187
- }), null), a(o, n(b, {
187
+ }), null), a(n, l(b, {
188
188
  get when() {
189
189
  return e.description;
190
190
  },
191
191
  get children() {
192
- var l = $();
193
- return a(l, () => e.description), f(() => g(l, d("text-[var(--floe-ink-soft)]", C[u()].description))), l;
192
+ var o = $();
193
+ return a(o, () => e.description), f(() => h(o, d("text-[var(--floe-ink-soft)]", C[u()].description))), o;
194
194
  }
195
- }), null), o;
195
+ }), null), n;
196
196
  }
197
- }), null), f(() => g(t, d("inline-flex items-start gap-2 cursor-pointer select-none", k() && "opacity-50 cursor-not-allowed", e.class))), t;
197
+ }), null), f((n) => {
198
+ var o = d("inline-flex gap-2 cursor-pointer select-none", e.description ? "items-start" : "items-center", k() && "opacity-50 cursor-not-allowed", e.class), i = d("relative flex items-center justify-center", e.description && "pt-0.5");
199
+ return o !== n.e && h(t, n.e = o), i !== n.t && h(r, n.t = i), n;
200
+ }, {
201
+ e: void 0,
202
+ t: void 0
203
+ }), t;
198
204
  }
199
- }), n(j, {
205
+ }), l(j, {
200
206
  get when() {
201
207
  return w() === "button";
202
208
  },
203
209
  get children() {
204
210
  var t = ne(), r = t.firstChild;
205
- return a(t, n(I, {
211
+ return a(t, l(I, {
206
212
  class: "sr-only"
207
- }), r), a(r, () => e.label), f((o) => {
208
- var l = c() ? "inset" : "raised", i = c() ? "true" : void 0, _ = w(), z = d("cursor-pointer select-none transition-colors duration-[var(--floe-duration-fast)]", "border-r border-[var(--floe-line)] last:border-r-0", de[u()], c() ? "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--primary)]" : "bg-transparent text-[var(--floe-ink-soft)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", k() && "opacity-50 cursor-not-allowed", e.class);
209
- return l !== o.e && m(t, "data-floe-surface", o.e = l), i !== o.t && m(t, "data-floe-selected", o.t = i), _ !== o.a && m(t, "data-floe-choice-variant", o.a = _), z !== o.o && g(t, o.o = z), o;
213
+ }), r), a(r, () => e.label), f((n) => {
214
+ var o = c() ? "inset" : "raised", i = c() ? "true" : void 0, _ = w(), z = d("cursor-pointer select-none transition-colors duration-[var(--floe-duration-fast)]", "border-r border-[var(--floe-line)] last:border-r-0", de[u()], c() ? "bg-[var(--primary)] text-[var(--primary-foreground)] border-[var(--primary)]" : "bg-transparent text-[var(--floe-ink-soft)] hover:bg-[var(--floe-state-hover)] hover:text-[var(--floe-ink)]", k() && "opacity-50 cursor-not-allowed", e.class);
215
+ return o !== n.e && m(t, "data-floe-surface", n.e = o), i !== n.t && m(t, "data-floe-selected", n.t = i), _ !== n.a && m(t, "data-floe-choice-variant", n.a = _), z !== n.o && h(t, n.o = z), n;
210
216
  }, {
211
217
  e: void 0,
212
218
  t: void 0,
@@ -214,31 +220,31 @@ function he(p) {
214
220
  o: void 0
215
221
  }), t;
216
222
  }
217
- }), n(j, {
223
+ }), l(j, {
218
224
  get when() {
219
225
  return w() === "card";
220
226
  },
221
227
  get children() {
222
- var t = le(), r = t.firstChild, o = r.firstChild, l = o.nextSibling;
223
- return a(t, n(I, {
228
+ var t = le(), r = t.firstChild, n = r.firstChild, o = n.nextSibling;
229
+ return a(t, l(I, {
224
230
  class: "sr-only"
225
- }), r), a(o, n(q, {})), a(l, n(b, {
231
+ }), r), a(n, l(q, {})), a(o, l(b, {
226
232
  get when() {
227
233
  return e.label;
228
234
  },
229
235
  get children() {
230
236
  var i = $();
231
- return a(i, () => e.label), f(() => g(i, d("font-medium text-foreground", C[u()].label))), i;
237
+ return a(i, () => e.label), f(() => h(i, d("font-medium text-foreground", C[u()].label))), i;
232
238
  }
233
- }), null), a(l, n(b, {
239
+ }), null), a(o, l(b, {
234
240
  get when() {
235
241
  return e.description;
236
242
  },
237
243
  get children() {
238
244
  var i = $();
239
- return a(i, () => e.description), f(() => g(i, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), i;
245
+ return a(i, () => e.description), f(() => h(i, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), i;
240
246
  }
241
- }), null), a(t, n(b, {
247
+ }), null), a(t, l(b, {
242
248
  get when() {
243
249
  return c();
244
250
  },
@@ -247,7 +253,7 @@ function he(p) {
247
253
  }
248
254
  }), null), f((i) => {
249
255
  var _ = c() ? "inset" : "raised", z = c() ? "true" : void 0, D = w(), F = d("relative cursor-pointer select-none rounded-group border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", ue[u()], c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
250
- return _ !== i.e && m(t, "data-floe-surface", i.e = _), z !== i.t && m(t, "data-floe-selected", i.t = z), D !== i.a && m(t, "data-floe-choice-variant", i.a = D), F !== i.o && g(t, i.o = F), i;
256
+ return _ !== i.e && m(t, "data-floe-surface", i.e = _), z !== i.t && m(t, "data-floe-selected", i.t = z), D !== i.a && m(t, "data-floe-choice-variant", i.a = D), F !== i.o && h(t, i.o = F), i;
251
257
  }, {
252
258
  e: void 0,
253
259
  t: void 0,
@@ -255,58 +261,58 @@ function he(p) {
255
261
  o: void 0
256
262
  }), t;
257
263
  }
258
- }), n(j, {
264
+ }), l(j, {
259
265
  get when() {
260
266
  return w() === "tile";
261
267
  },
262
268
  get children() {
263
269
  var t = ie();
264
- return a(t, n(I, {
270
+ return a(t, l(I, {
265
271
  class: "sr-only"
266
- }), null), a(t, n(b, {
272
+ }), null), a(t, l(b, {
267
273
  get when() {
268
274
  return e.icon;
269
275
  },
270
276
  children: (r) => {
271
- const o = r();
277
+ const n = r();
272
278
  return (() => {
273
- var l = se();
274
- return a(l, n(o, {
279
+ var o = se();
280
+ return a(o, l(n, {
275
281
  get class() {
276
282
  return L[u()].icon;
277
283
  }
278
- })), f(() => g(l, d("mb-2 transition-colors duration-[var(--floe-duration-fast)]", c() ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-quiet)]"))), l;
284
+ })), f(() => h(o, d("mb-2 transition-colors duration-[var(--floe-duration-fast)]", c() ? "text-[var(--floe-accent-ink)]" : "text-[var(--floe-ink-quiet)]"))), o;
279
285
  })();
280
286
  }
281
- }), null), a(t, n(b, {
287
+ }), null), a(t, l(b, {
282
288
  get when() {
283
289
  return e.label;
284
290
  },
285
291
  get children() {
286
292
  var r = $();
287
- return a(r, () => e.label), f(() => g(r, d("font-medium transition-colors duration-[var(--floe-duration-fast)]", C[u()].label, c() ? "text-[var(--floe-ink)]" : "text-[var(--floe-ink-soft)]"))), r;
293
+ return a(r, () => e.label), f(() => h(r, d("font-medium transition-colors duration-[var(--floe-duration-fast)]", C[u()].label, c() ? "text-[var(--floe-ink)]" : "text-[var(--floe-ink-soft)]"))), r;
288
294
  }
289
- }), null), a(t, n(b, {
295
+ }), null), a(t, l(b, {
290
296
  get when() {
291
297
  return e.description;
292
298
  },
293
299
  get children() {
294
300
  var r = $();
295
- return a(r, () => e.description), f(() => g(r, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), r;
301
+ return a(r, () => e.description), f(() => h(r, d("text-[var(--floe-ink-soft)] mt-0.5", C[u()].description))), r;
296
302
  }
297
- }), null), a(t, n(b, {
303
+ }), null), a(t, l(b, {
298
304
  get when() {
299
305
  return c();
300
306
  },
301
307
  get children() {
302
- var r = ae(), o = r.firstChild;
303
- return a(o, n(O, {
308
+ var r = ae(), n = r.firstChild;
309
+ return a(n, l(O, {
304
310
  class: "w-2.5 h-2.5 text-primary-foreground"
305
311
  })), r;
306
312
  }
307
313
  }), null), f((r) => {
308
- var o = c() ? "inset" : "raised", l = c() ? "true" : void 0, i = w(), _ = d("relative flex flex-col items-center justify-center cursor-pointer select-none", "rounded-control border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] text-center", L[u()].container, c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
309
- return o !== r.e && m(t, "data-floe-surface", r.e = o), l !== r.t && m(t, "data-floe-selected", r.t = l), i !== r.a && m(t, "data-floe-choice-variant", r.a = i), _ !== r.o && g(t, r.o = _), r;
314
+ var n = c() ? "inset" : "raised", o = c() ? "true" : void 0, i = w(), _ = d("relative flex flex-col items-center justify-center cursor-pointer select-none", "rounded-control border transition-[background-color,border-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)] text-center", L[u()].container, c() ? "border-[var(--floe-accent-line)] bg-[var(--floe-state-selected)]" : "border-[var(--floe-line)] bg-transparent hover:border-[var(--floe-line-strong)] hover:bg-[var(--floe-state-hover)]", k() && "opacity-50 cursor-not-allowed", e.class);
315
+ return n !== r.e && m(t, "data-floe-surface", r.e = n), o !== r.t && m(t, "data-floe-selected", r.t = o), i !== r.a && m(t, "data-floe-choice-variant", r.a = i), _ !== r.o && h(t, r.o = _), r;
310
316
  }, {
311
317
  e: void 0,
312
318
  t: void 0,
@@ -320,13 +326,13 @@ function he(p) {
320
326
  }
321
327
  function pe(p) {
322
328
  const [s, x] = P(p, ["options"]);
323
- return n(ve, B(x, {
329
+ return l(ve, B(x, {
324
330
  get children() {
325
- return n(J, {
331
+ return l(J, {
326
332
  get each() {
327
333
  return s.options;
328
334
  },
329
- children: (e) => n(he, {
335
+ children: (e) => l(he, {
330
336
  get value() {
331
337
  return e.value;
332
338
  },
@@ -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
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.90.6",
3
+ "version": "0.90.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",