@floegence/floe-webapp-core 0.50.5 → 0.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/input/ChatInput.js +8 -8
- package/dist/components/ui/Button.js +16 -13
- package/dist/components/ui/Card.js +125 -119
- package/dist/components/ui/Checkbox.js +178 -132
- package/dist/components/ui/CommandPalette.js +10 -10
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/DirectoryInput.js +5 -5
- package/dist/components/ui/Dropdown.d.ts +2 -0
- package/dist/components/ui/Dropdown.js +119 -114
- package/dist/components/ui/FloatingWindow.js +211 -199
- package/dist/components/ui/HighlightBlock.js +8 -8
- package/dist/components/ui/Input.js +40 -40
- package/dist/components/ui/Pagination.js +90 -88
- package/dist/components/ui/ProcessingIndicator.js +1 -1
- package/dist/components/ui/Progress.js +99 -88
- package/dist/components/ui/QuoteBlock.js +9 -9
- package/dist/components/ui/Radio.js +151 -127
- package/dist/components/ui/SegmentedControl.js +26 -25
- package/dist/components/ui/Stepper.js +114 -112
- package/dist/components/ui/Switch.js +34 -33
- package/dist/components/ui/Tabs.js +153 -150
- package/dist/components/ui/Tag.js +24 -21
- package/dist/components/ui/Tooltip.js +10 -10
- package/dist/components/ui/floatingPresence.js +40 -30
- package/dist/components/workbench/WorkbenchHud.js +9 -9
- package/dist/components/workbench/WorkbenchLockButton.js +4 -4
- package/dist/components/workbench/WorkbenchWidget.js +46 -43
- package/dist/context/FloeConfigContext.d.ts +5 -1
- package/dist/context/FloeConfigContext.js +10 -9
- package/dist/context/ThemeContext.d.ts +3 -1
- package/dist/context/ThemeContext.js +78 -71
- package/dist/floe.css +2 -37
- package/dist/full.js +839 -836
- package/dist/index.js +150 -147
- package/dist/input-focus.css +36 -0
- package/dist/styles/themes/index.d.ts +3 -0
- package/dist/styles/themes/index.js +40 -31
- package/dist/styles/tokens.d.ts +36 -0
- package/dist/styles/tokens.js +12 -5
- package/dist/styles.css +1 -1
- package/dist/surface.css +467 -0
- package/dist/themes.d.ts +1 -1
- package/dist/ui.css +9 -0
- package/package.json +3 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { setAttribute as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { setAttribute as m, insert as v, createComponent as l, Portal as W, use as I, spread as G, mergeProps as J, effect as F, className as O, template as $, memo as z, delegateEvents as te } from "solid-js/web";
|
|
2
|
+
import { createSignal as j, createMemo as ne, createEffect as Q, onCleanup as re, Show as y, Index as V } from "solid-js";
|
|
3
3
|
import { cn as k } from "../../utils/cn.js";
|
|
4
4
|
import { deferNonBlocking as oe } from "../../utils/defer.js";
|
|
5
|
-
import { ChevronDown as ie, Check as
|
|
6
|
-
import { focusMenuItem as
|
|
5
|
+
import { ChevronDown as ie, Check as ae, ChevronRight as ue } from "../icons/index.js";
|
|
6
|
+
import { focusMenuItem as D, MENU_ITEM_SELECTOR as le, moveMenuFocus as U, calculateMenuPosition as de, calculateSubmenuPosition as ce } from "./menuUtils.js";
|
|
7
7
|
import { LOCAL_INTERACTION_SURFACE_ATTR as X } from "./localInteractionSurface.js";
|
|
8
8
|
import { createFloatingPresence as Y } from "./floatingPresence.js";
|
|
9
9
|
import { resolveSurfacePortalHost as se, projectSurfacePortalPosition as fe, resolveSurfacePortalBoundaryRect as me, isSurfacePortalMode as ge, resolveSurfacePortalMount as ve } from "./dialogSurfaceScope.js";
|
|
10
|
-
var
|
|
10
|
+
var B = /* @__PURE__ */ $("<div>"), he = /* @__PURE__ */ $("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), Z = /* @__PURE__ */ $('<div class="my-1 h-px bg-border"role=separator>'), be = /* @__PURE__ */ $('<button type=button role=menuitem><span class="w-3.5 h-3.5 flex items-center justify-center"></span><span class="flex-1 text-left">'), we = /* @__PURE__ */ $("<div class=relative>"), ye = /* @__PURE__ */ $('<span class="w-3.5 h-3.5 flex items-center justify-center">'), xe = /* @__PURE__ */ $("<span>");
|
|
11
11
|
let Se = 0, Me = 0;
|
|
12
12
|
function ke(e, f) {
|
|
13
13
|
switch (e) {
|
|
@@ -33,33 +33,33 @@ function ke(e, f) {
|
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const [f, c] =
|
|
36
|
+
function Pe(e) {
|
|
37
|
+
const [f, c] = j(!1), a = Y({
|
|
38
38
|
open: f,
|
|
39
39
|
exitDurationMs: 100
|
|
40
|
-
}), [
|
|
40
|
+
}), [q, P] = j({
|
|
41
41
|
x: -9999,
|
|
42
42
|
y: -9999
|
|
43
43
|
});
|
|
44
44
|
let x, w;
|
|
45
|
-
const
|
|
45
|
+
const h = `floe-dropdown-${Se += 1}`, C = `${h}-menu`, b = ne(() => a.mounted() ? se() : {
|
|
46
46
|
host: null,
|
|
47
47
|
boundaryHost: null,
|
|
48
48
|
mountHost: null,
|
|
49
49
|
mode: "global"
|
|
50
|
-
}),
|
|
51
|
-
mount: () => ve(
|
|
52
|
-
isSurfaceMode: () => ge(
|
|
53
|
-
boundaryRect: () => me(
|
|
54
|
-
projectPosition: (o) => fe(o,
|
|
50
|
+
}), g = {
|
|
51
|
+
mount: () => ve(b()),
|
|
52
|
+
isSurfaceMode: () => ge(b()),
|
|
53
|
+
boundaryRect: () => me(b()),
|
|
54
|
+
projectPosition: (o) => fe(o, b())
|
|
55
55
|
}, A = () => {
|
|
56
56
|
if (!x || !w) return;
|
|
57
|
-
const o = x.getBoundingClientRect(), r = w.getBoundingClientRect(), i = de(o, r, e.align ?? "start",
|
|
58
|
-
|
|
57
|
+
const o = x.getBoundingClientRect(), r = w.getBoundingClientRect(), i = de(o, r, e.align ?? "start", g.boundaryRect());
|
|
58
|
+
P(i);
|
|
59
59
|
};
|
|
60
60
|
Q(() => {
|
|
61
|
-
if (!
|
|
62
|
-
|
|
61
|
+
if (!a.mounted()) {
|
|
62
|
+
P({
|
|
63
63
|
x: -9999,
|
|
64
64
|
y: -9999
|
|
65
65
|
});
|
|
@@ -67,13 +67,13 @@ function $e(e) {
|
|
|
67
67
|
}
|
|
68
68
|
if (!f()) return;
|
|
69
69
|
const o = (i) => {
|
|
70
|
-
const
|
|
71
|
-
|
|
70
|
+
const t = i.target;
|
|
71
|
+
t && typeof t.closest == "function" && t.closest(`[data-floe-dropdown="${h}"]`) || c(!1);
|
|
72
72
|
}, r = (i) => {
|
|
73
73
|
i.key === "Escape" && (c(!1), requestAnimationFrame(() => x?.focus()));
|
|
74
74
|
};
|
|
75
75
|
document.addEventListener("pointerdown", o, !0), document.addEventListener("keydown", r), requestAnimationFrame(() => {
|
|
76
|
-
A(),
|
|
76
|
+
A(), D(w, e.value ? "selected" : "first");
|
|
77
77
|
}), re(() => {
|
|
78
78
|
document.removeEventListener("pointerdown", o, !0), document.removeEventListener("keydown", r);
|
|
79
79
|
});
|
|
@@ -81,11 +81,11 @@ function $e(e) {
|
|
|
81
81
|
const L = (o) => {
|
|
82
82
|
const r = e.onSelect;
|
|
83
83
|
o.keepOpen || c(!1), oe(() => r(o.id));
|
|
84
|
-
},
|
|
84
|
+
}, T = (o, r = "first") => {
|
|
85
85
|
e.disabled || (c(o), requestAnimationFrame(() => {
|
|
86
|
-
A(),
|
|
86
|
+
A(), D(w, r);
|
|
87
87
|
}));
|
|
88
|
-
},
|
|
88
|
+
}, p = (o) => {
|
|
89
89
|
if (e.disabled) return;
|
|
90
90
|
const r = ke(o.key, {
|
|
91
91
|
open: f(),
|
|
@@ -96,22 +96,22 @@ function $e(e) {
|
|
|
96
96
|
c(!1);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
T(!0, r.focusMode ?? "first");
|
|
100
100
|
}
|
|
101
|
-
},
|
|
102
|
-
const r = o.target, i = r?.closest('[role="menu"]'),
|
|
101
|
+
}, _ = (o) => {
|
|
102
|
+
const r = o.target, i = r?.closest('[role="menu"]'), t = r?.closest(le);
|
|
103
103
|
switch (o.key) {
|
|
104
104
|
case "ArrowDown":
|
|
105
|
-
o.preventDefault(), U(i,
|
|
105
|
+
o.preventDefault(), U(i, t, 1);
|
|
106
106
|
return;
|
|
107
107
|
case "ArrowUp":
|
|
108
|
-
o.preventDefault(), U(i,
|
|
108
|
+
o.preventDefault(), U(i, t, -1);
|
|
109
109
|
return;
|
|
110
110
|
case "Home":
|
|
111
|
-
o.preventDefault(),
|
|
111
|
+
o.preventDefault(), D(i, "first");
|
|
112
112
|
return;
|
|
113
113
|
case "End":
|
|
114
|
-
o.preventDefault(),
|
|
114
|
+
o.preventDefault(), D(i, "last");
|
|
115
115
|
return;
|
|
116
116
|
case "Tab":
|
|
117
117
|
c(!1);
|
|
@@ -121,51 +121,52 @@ function $e(e) {
|
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
return (() => {
|
|
124
|
-
var o =
|
|
125
|
-
|
|
124
|
+
var o = he(), r = o.firstChild;
|
|
125
|
+
m(o, "data-floe-dropdown", h), r.$$keydown = p, r.$$click = () => {
|
|
126
126
|
if (!e.disabled) {
|
|
127
127
|
if (f()) {
|
|
128
128
|
c(!1);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
T(!0, e.value ? "selected" : "first");
|
|
132
132
|
}
|
|
133
133
|
};
|
|
134
134
|
var i = x;
|
|
135
|
-
return typeof i == "function" ?
|
|
135
|
+
return typeof i == "function" ? I(i, r) : x = r, m(r, "aria-controls", C), v(r, () => e.trigger), v(o, l(y, {
|
|
136
136
|
get when() {
|
|
137
|
-
return
|
|
137
|
+
return a.mounted();
|
|
138
138
|
},
|
|
139
139
|
get children() {
|
|
140
140
|
return l(W, {
|
|
141
141
|
get mount() {
|
|
142
|
-
return
|
|
142
|
+
return g.mount();
|
|
143
143
|
},
|
|
144
144
|
get children() {
|
|
145
|
-
var
|
|
146
|
-
return typeof
|
|
145
|
+
var t = B(), n = w;
|
|
146
|
+
return typeof n == "function" ? I(n, t) : w = t, m(t, "data-floe-dropdown", h), G(t, J({
|
|
147
147
|
get class() {
|
|
148
|
-
return k(
|
|
148
|
+
return k(g.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu");
|
|
149
149
|
},
|
|
150
150
|
get "data-floating-presence"() {
|
|
151
|
-
return
|
|
151
|
+
return a.state();
|
|
152
152
|
},
|
|
153
153
|
get "aria-hidden"() {
|
|
154
|
-
return
|
|
154
|
+
return a.exiting() ? "true" : void 0;
|
|
155
155
|
}
|
|
156
156
|
}, () => ({
|
|
157
|
-
[X]:
|
|
157
|
+
[X]: g.isSurfaceMode() ? "true" : void 0
|
|
158
158
|
}), {
|
|
159
159
|
get style() {
|
|
160
160
|
return {
|
|
161
|
-
left: `${
|
|
162
|
-
top: `${
|
|
161
|
+
left: `${g.projectPosition(q()).x}px`,
|
|
162
|
+
top: `${g.projectPosition(q()).y}px`
|
|
163
163
|
};
|
|
164
164
|
},
|
|
165
165
|
role: "menu",
|
|
166
|
+
"data-floe-surface": "floating",
|
|
166
167
|
id: C,
|
|
167
|
-
onKeyDown:
|
|
168
|
-
}), !1, !0),
|
|
168
|
+
onKeyDown: _
|
|
169
|
+
}), !1, !0), v(t, l(V, {
|
|
169
170
|
get each() {
|
|
170
171
|
return e.items;
|
|
171
172
|
},
|
|
@@ -186,129 +187,131 @@ function $e(e) {
|
|
|
186
187
|
},
|
|
187
188
|
onSelect: L,
|
|
188
189
|
onCloseMenu: () => c(!1),
|
|
189
|
-
dropdownId:
|
|
190
|
-
portalLayout:
|
|
190
|
+
dropdownId: h,
|
|
191
|
+
portalLayout: g
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
194
|
})
|
|
194
|
-
})),
|
|
195
|
+
})), t;
|
|
195
196
|
}
|
|
196
197
|
});
|
|
197
198
|
}
|
|
198
|
-
}), null),
|
|
199
|
-
var
|
|
200
|
-
return
|
|
199
|
+
}), null), F((t) => {
|
|
200
|
+
var n = k("relative inline-block", e.class), d = k("cursor-pointer", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), s = e.disabled ? -1 : 0, S = f(), u = e.triggerAriaLabel, M = e.disabled ? "true" : void 0, R = e.triggerInputSurface ? "true" : void 0, E = e.triggerInputSurface ? "inset" : void 0;
|
|
201
|
+
return n !== t.e && O(o, t.e = n), d !== t.t && O(r, t.t = d), s !== t.a && m(r, "tabindex", t.a = s), S !== t.o && m(r, "aria-expanded", t.o = S), u !== t.i && m(r, "aria-label", t.i = u), M !== t.n && m(r, "aria-disabled", t.n = M), R !== t.s && m(r, "data-floe-input-surface", t.s = R), E !== t.h && m(r, "data-floe-surface", t.h = E), t;
|
|
201
202
|
}, {
|
|
202
203
|
e: void 0,
|
|
203
204
|
t: void 0,
|
|
204
205
|
a: void 0,
|
|
205
206
|
o: void 0,
|
|
206
207
|
i: void 0,
|
|
207
|
-
n: void 0
|
|
208
|
+
n: void 0,
|
|
209
|
+
s: void 0,
|
|
210
|
+
h: void 0
|
|
208
211
|
}), o;
|
|
209
212
|
})();
|
|
210
213
|
}
|
|
211
214
|
function ee(e) {
|
|
212
|
-
const [f, c] =
|
|
213
|
-
open: () => !!(f() &&
|
|
215
|
+
const [f, c] = j(!1), a = () => e.item.children && e.item.children.length > 0, P = Y({
|
|
216
|
+
open: () => !!(f() && a()),
|
|
214
217
|
exitDurationMs: 100
|
|
215
|
-
}), [x, w] =
|
|
218
|
+
}), [x, w] = j({
|
|
216
219
|
x: -9999,
|
|
217
220
|
y: -9999
|
|
218
221
|
});
|
|
219
|
-
let
|
|
222
|
+
let h, C, b, g;
|
|
220
223
|
const A = `floe-dropdown-item-${Me += 1}`;
|
|
221
224
|
Q(() => {
|
|
222
|
-
|
|
225
|
+
P.mounted() || w({
|
|
223
226
|
x: -9999,
|
|
224
227
|
y: -9999
|
|
225
228
|
});
|
|
226
229
|
});
|
|
227
230
|
const L = () => {
|
|
228
|
-
if (!
|
|
229
|
-
const i =
|
|
230
|
-
w(
|
|
231
|
-
},
|
|
232
|
-
|
|
231
|
+
if (!h || !b) return;
|
|
232
|
+
const i = h.getBoundingClientRect(), t = b.getBoundingClientRect(), n = ce(i, t, e.portalLayout.boundaryRect());
|
|
233
|
+
w(n);
|
|
234
|
+
}, T = () => {
|
|
235
|
+
a() && (clearTimeout(g), g = setTimeout(() => {
|
|
233
236
|
c(!0), requestAnimationFrame(L);
|
|
234
237
|
}, 100));
|
|
235
|
-
},
|
|
236
|
-
|
|
238
|
+
}, p = () => {
|
|
239
|
+
a() && (clearTimeout(g), g = void 0, !e.item.keepOpen && (g = setTimeout(() => {
|
|
237
240
|
c(!1);
|
|
238
241
|
}, 150)));
|
|
239
|
-
},
|
|
242
|
+
}, _ = (i) => {
|
|
240
243
|
if (!e.item.disabled) {
|
|
241
244
|
if (e.item.content && e.item.keepOpen) {
|
|
242
245
|
i.stopPropagation();
|
|
243
246
|
return;
|
|
244
247
|
}
|
|
245
|
-
|
|
248
|
+
a() ? (c((t) => !t), requestAnimationFrame(L)) : e.item.content || e.onSelect(e.item);
|
|
246
249
|
}
|
|
247
250
|
}, o = (i = "first") => {
|
|
248
|
-
|
|
249
|
-
L(),
|
|
251
|
+
a() && (c(!0), requestAnimationFrame(() => {
|
|
252
|
+
L(), D(b, i);
|
|
250
253
|
}));
|
|
251
254
|
}, r = () => {
|
|
252
255
|
c(!1), requestAnimationFrame(() => C?.focus());
|
|
253
256
|
};
|
|
254
257
|
return (() => {
|
|
255
258
|
var i = we();
|
|
256
|
-
i.addEventListener("mouseleave",
|
|
257
|
-
var
|
|
258
|
-
return typeof
|
|
259
|
+
i.addEventListener("mouseleave", p), i.addEventListener("mouseenter", T);
|
|
260
|
+
var t = h;
|
|
261
|
+
return typeof t == "function" ? I(t, i) : h = i, v(i, l(y, {
|
|
259
262
|
get when() {
|
|
260
263
|
return e.item.content;
|
|
261
264
|
},
|
|
262
265
|
get children() {
|
|
263
|
-
var
|
|
264
|
-
return
|
|
266
|
+
var n = B();
|
|
267
|
+
return n.$$click = _, v(n, e.item.content), F((d) => {
|
|
265
268
|
var s = k("w-full px-2 py-1.5", e.item.tone === "danger" && "text-destructive", e.item.disabled && "opacity-50 pointer-events-none"), S = e.item.tone ?? "default";
|
|
266
|
-
return s !== d.e &&
|
|
269
|
+
return s !== d.e && O(n, d.e = s), S !== d.t && m(n, "data-tone", d.t = S), d;
|
|
267
270
|
}, {
|
|
268
271
|
e: void 0,
|
|
269
272
|
t: void 0
|
|
270
|
-
}),
|
|
273
|
+
}), n;
|
|
271
274
|
}
|
|
272
|
-
}), null),
|
|
275
|
+
}), null), v(i, l(y, {
|
|
273
276
|
get when() {
|
|
274
277
|
return !e.item.content;
|
|
275
278
|
},
|
|
276
279
|
get children() {
|
|
277
|
-
var
|
|
278
|
-
|
|
279
|
-
e.item.disabled ||
|
|
280
|
-
},
|
|
280
|
+
var n = be(), d = n.firstChild, s = d.nextSibling;
|
|
281
|
+
n.$$keydown = (u) => {
|
|
282
|
+
e.item.disabled || a() && ((u.key === "ArrowRight" || u.key === "Enter" || u.key === " ") && (u.preventDefault(), o("first")), u.key === "ArrowLeft" && (u.preventDefault(), r()));
|
|
283
|
+
}, n.$$click = _;
|
|
281
284
|
var S = C;
|
|
282
|
-
return typeof S == "function" ?
|
|
285
|
+
return typeof S == "function" ? I(S, n) : C = n, m(n, "id", A), v(d, l(y, {
|
|
283
286
|
get when() {
|
|
284
|
-
return z(() => !!e.selected)() && !
|
|
287
|
+
return z(() => !!e.selected)() && !a();
|
|
285
288
|
},
|
|
286
289
|
get children() {
|
|
287
|
-
return l(
|
|
290
|
+
return l(ae, {
|
|
288
291
|
class: "w-3 h-3"
|
|
289
292
|
});
|
|
290
293
|
}
|
|
291
|
-
})),
|
|
294
|
+
})), v(n, l(y, {
|
|
292
295
|
get when() {
|
|
293
296
|
return e.item.icon;
|
|
294
297
|
},
|
|
295
298
|
keyed: !0,
|
|
296
|
-
children: (
|
|
299
|
+
children: (u) => (() => {
|
|
297
300
|
var M = ye();
|
|
298
|
-
return
|
|
301
|
+
return v(M, u), M;
|
|
299
302
|
})()
|
|
300
|
-
}), s),
|
|
303
|
+
}), s), v(s, () => e.item.label), v(n, l(y, {
|
|
301
304
|
get when() {
|
|
302
|
-
return
|
|
305
|
+
return a();
|
|
303
306
|
},
|
|
304
307
|
get children() {
|
|
305
|
-
return l(
|
|
308
|
+
return l(ue, {
|
|
306
309
|
class: "w-3 h-3 text-muted-foreground"
|
|
307
310
|
});
|
|
308
311
|
}
|
|
309
|
-
}), null),
|
|
310
|
-
var M = k("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.tone === "danger" && "text-destructive", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"),
|
|
311
|
-
return M !==
|
|
312
|
+
}), null), F((u) => {
|
|
313
|
+
var M = k("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.tone === "danger" && "text-destructive", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), R = e.item.disabled, E = a() ? "menu" : void 0, H = a() ? f() : void 0, K = e.selected && !a() ? "true" : void 0, N = e.item.tone ?? "default";
|
|
314
|
+
return M !== u.e && O(n, u.e = M), R !== u.t && (n.disabled = u.t = R), E !== u.a && m(n, "aria-haspopup", u.a = E), H !== u.o && m(n, "aria-expanded", u.o = H), K !== u.i && m(n, "data-floe-selected", u.i = K), N !== u.n && m(n, "data-tone", u.n = N), u;
|
|
312
315
|
}, {
|
|
313
316
|
e: void 0,
|
|
314
317
|
t: void 0,
|
|
@@ -316,11 +319,11 @@ function ee(e) {
|
|
|
316
319
|
o: void 0,
|
|
317
320
|
i: void 0,
|
|
318
321
|
n: void 0
|
|
319
|
-
}),
|
|
322
|
+
}), n;
|
|
320
323
|
}
|
|
321
|
-
}), null),
|
|
324
|
+
}), null), v(i, l(y, {
|
|
322
325
|
get when() {
|
|
323
|
-
return z(() =>
|
|
326
|
+
return z(() => !!P.mounted())() && a();
|
|
324
327
|
},
|
|
325
328
|
get children() {
|
|
326
329
|
return l(W, {
|
|
@@ -328,8 +331,8 @@ function ee(e) {
|
|
|
328
331
|
return e.portalLayout.mount();
|
|
329
332
|
},
|
|
330
333
|
get children() {
|
|
331
|
-
var
|
|
332
|
-
return typeof d == "function" ?
|
|
334
|
+
var n = B(), d = b;
|
|
335
|
+
return typeof d == "function" ? I(d, n) : b = n, G(n, J({
|
|
333
336
|
get class() {
|
|
334
337
|
return k(e.portalLayout.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu floe-floating-submenu");
|
|
335
338
|
},
|
|
@@ -337,10 +340,10 @@ function ee(e) {
|
|
|
337
340
|
return e.dropdownId;
|
|
338
341
|
},
|
|
339
342
|
get "data-floating-presence"() {
|
|
340
|
-
return
|
|
343
|
+
return P.state();
|
|
341
344
|
},
|
|
342
345
|
get "aria-hidden"() {
|
|
343
|
-
return
|
|
346
|
+
return P.exiting() ? "true" : void 0;
|
|
344
347
|
}
|
|
345
348
|
}, () => ({
|
|
346
349
|
[X]: e.portalLayout.isSurfaceMode() ? "true" : void 0
|
|
@@ -352,15 +355,16 @@ function ee(e) {
|
|
|
352
355
|
};
|
|
353
356
|
},
|
|
354
357
|
role: "menu",
|
|
358
|
+
"data-floe-surface": "floating",
|
|
355
359
|
"aria-labelledby": A,
|
|
356
360
|
onMouseEnter: () => {
|
|
357
|
-
clearTimeout(
|
|
361
|
+
clearTimeout(g);
|
|
358
362
|
},
|
|
359
|
-
onMouseLeave:
|
|
363
|
+
onMouseLeave: p,
|
|
360
364
|
onKeyDown: (s) => {
|
|
361
365
|
s.key !== "ArrowLeft" && s.key !== "Escape" || (s.preventDefault(), s.stopPropagation(), r());
|
|
362
366
|
}
|
|
363
|
-
}), !1, !0),
|
|
367
|
+
}), !1, !0), v(n, l(V, {
|
|
364
368
|
get each() {
|
|
365
369
|
return e.item.children;
|
|
366
370
|
},
|
|
@@ -392,26 +396,27 @@ function ee(e) {
|
|
|
392
396
|
});
|
|
393
397
|
}
|
|
394
398
|
})
|
|
395
|
-
})),
|
|
399
|
+
})), n;
|
|
396
400
|
}
|
|
397
401
|
});
|
|
398
402
|
}
|
|
399
403
|
}), null), i;
|
|
400
404
|
})();
|
|
401
405
|
}
|
|
402
|
-
function
|
|
403
|
-
const f = () => e.options.find((
|
|
404
|
-
id:
|
|
405
|
-
label:
|
|
406
|
+
function Te(e) {
|
|
407
|
+
const f = () => e.options.find((a) => a.value === e.value), c = () => e.options.map((a) => ({
|
|
408
|
+
id: a.value,
|
|
409
|
+
label: a.label
|
|
406
410
|
}));
|
|
407
|
-
return l(
|
|
411
|
+
return l(Pe, {
|
|
412
|
+
triggerInputSurface: !0,
|
|
408
413
|
get triggerClass() {
|
|
409
414
|
return k("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-xs shadow-sm", "transition-colors duration-100", e.class);
|
|
410
415
|
},
|
|
411
416
|
get trigger() {
|
|
412
417
|
return [(() => {
|
|
413
|
-
var
|
|
414
|
-
return
|
|
418
|
+
var a = xe();
|
|
419
|
+
return v(a, () => f()?.label ?? e.placeholder ?? "Select..."), F(() => O(a, k("truncate", !f() && "text-muted-foreground"))), a;
|
|
415
420
|
})(), l(ie, {
|
|
416
421
|
class: "w-3.5 h-3.5 text-muted-foreground"
|
|
417
422
|
})];
|
|
@@ -432,7 +437,7 @@ function Oe(e) {
|
|
|
432
437
|
}
|
|
433
438
|
te(["click", "keydown"]);
|
|
434
439
|
export {
|
|
435
|
-
|
|
436
|
-
|
|
440
|
+
Pe as Dropdown,
|
|
441
|
+
Te as Select,
|
|
437
442
|
ke as resolveDropdownTriggerKeyAction
|
|
438
443
|
};
|