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