@floegence/floe-webapp-core 0.86.62 → 0.86.64
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/app/FloeRegistryContributions.js +0 -3
- package/dist/components/icons/ActivityRailIcons.d.ts +30 -0
- package/dist/components/icons/ActivityRailIcons.js +68 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/layout/ActivityBar.js +55 -54
- package/dist/components/layout/DisplayModeSwitcher.d.ts +10 -0
- package/dist/components/layout/DisplayModeSwitcher.js +102 -33
- package/dist/components/layout/Shell.d.ts +0 -6
- package/dist/components/layout/Shell.js +212 -258
- package/dist/components/layout/ThemeToggle.d.ts +19 -0
- package/dist/components/layout/ThemeToggle.js +39 -0
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/ui/Button.js +22 -14
- package/dist/components/ui/Dialog.js +101 -95
- package/dist/components/ui/Tabs.js +172 -159
- package/dist/components/ui/dialogHeightMotion.d.ts +9 -0
- package/dist/components/ui/dialogHeightMotion.js +49 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/context/ComponentRegistry.d.ts +0 -8
- package/dist/context/ComponentRegistry.js +61 -67
- package/dist/context/FloeConfigContext.d.ts +0 -6
- package/dist/context/FloeConfigContext.js +9 -15
- package/dist/context/index.d.ts +1 -1
- package/dist/display-mode.css +2 -45
- package/dist/full.js +693 -683
- package/dist/icons.js +112 -102
- package/dist/layout.js +33 -35
- package/dist/styles.css +1 -1
- package/dist/surface.css +53 -1
- package/dist/ui.js +33 -31
- package/package.json +1 -1
- package/dist/components/layout/BottomBar.d.ts +0 -29
- package/dist/components/layout/BottomBar.js +0 -70
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { createComponent as v, spread as ue, mergeProps as fe, insert as f, effect as
|
|
2
|
-
import { splitProps as ve, Show as
|
|
1
|
+
import { createComponent as v, spread as ue, mergeProps as fe, insert as f, effect as x, className as B, setStyleProperty as le, memo as ae, use as ie, setAttribute as m, template as C, delegateEvents as ze } from "solid-js/web";
|
|
2
|
+
import { splitProps as ve, Show as I, createSignal as L, untrack as de, createEffect as K, onCleanup as ce } from "solid-js";
|
|
3
3
|
import { cn as h } from "../../utils/cn.js";
|
|
4
|
-
import { deferAfterPaint as
|
|
5
|
-
import { KeyedFor as
|
|
6
|
-
import { createUIFirstSelection as
|
|
4
|
+
import { deferAfterPaint as O } from "../../utils/defer.js";
|
|
5
|
+
import { KeyedFor as Re } from "./KeyedFor.js";
|
|
6
|
+
import { createUIFirstSelection as Te } from "../../utils/uiFirstSelection.js";
|
|
7
7
|
import { useViewActivation as Ee } from "../../context/ViewActivationContext.js";
|
|
8
8
|
import { X as He, Plus as Pe, ChevronRight as De } from "../icons/index.js";
|
|
9
|
-
var Me = /* @__PURE__ */
|
|
10
|
-
const
|
|
9
|
+
var Me = /* @__PURE__ */ C('<svg xmlns=http://www.w3.org/2000/svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path d="m15 18-6-6 6-6">'), Oe = /* @__PURE__ */ C('<button type=button data-floe-interactive=icon aria-label="Scroll left">'), We = /* @__PURE__ */ C("<div>"), Fe = /* @__PURE__ */ C('<button type=button data-floe-interactive=icon aria-label="Add new tab">'), _e = /* @__PURE__ */ C('<button type=button data-floe-interactive=icon aria-label="Scroll right">'), je = /* @__PURE__ */ C("<div><div role=tablist data-floe-surface=inset data-floe-surface-part=tab-rail aria-orientation=horizontal>"), qe = /* @__PURE__ */ C("<span class=flex-shrink-0>"), Ge = /* @__PURE__ */ C("<button type=button data-floe-interactive=icon>"), Ue = /* @__PURE__ */ C('<div role=tab data-floe-surface-part=tab data-floe-interactive=item><span class="truncate max-w-32">'), Xe = /* @__PURE__ */ C("<div role=tabpanel>");
|
|
10
|
+
const V = {
|
|
11
11
|
x: 0,
|
|
12
12
|
width: 0,
|
|
13
13
|
visible: !1
|
|
14
14
|
};
|
|
15
|
-
function Ke(i,
|
|
16
|
-
const
|
|
17
|
-
if (!
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
15
|
+
function Ke(i, t, b) {
|
|
16
|
+
const d = i.filter((k) => !k.disabled);
|
|
17
|
+
if (!d.length) return null;
|
|
18
|
+
const p = d.findIndex((k) => k.id === t);
|
|
19
|
+
if (p < 0) return null;
|
|
20
20
|
let g = null;
|
|
21
21
|
switch (b) {
|
|
22
22
|
case "ArrowRight":
|
|
23
23
|
case "ArrowDown":
|
|
24
|
-
g = (
|
|
24
|
+
g = (p + 1) % d.length;
|
|
25
25
|
break;
|
|
26
26
|
case "ArrowLeft":
|
|
27
27
|
case "ArrowUp":
|
|
28
|
-
g = (
|
|
28
|
+
g = (p - 1 + d.length) % d.length;
|
|
29
29
|
break;
|
|
30
30
|
case "Home":
|
|
31
31
|
g = 0;
|
|
32
32
|
break;
|
|
33
33
|
case "End":
|
|
34
|
-
g =
|
|
34
|
+
g = d.length - 1;
|
|
35
35
|
break;
|
|
36
36
|
default:
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
|
-
return
|
|
39
|
+
return d[g]?.id ?? null;
|
|
40
40
|
}
|
|
41
41
|
function Ve(i) {
|
|
42
42
|
return i === 1 || i === 2 || i === 3 || i === 4 ? i : 2;
|
|
@@ -85,81 +85,81 @@ function Je(i) {
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
const Qe = (i) => (() => {
|
|
88
|
-
var
|
|
89
|
-
return
|
|
88
|
+
var t = Me();
|
|
89
|
+
return x(() => m(t, "class", i.class)), t;
|
|
90
90
|
})();
|
|
91
91
|
function Ze(i) {
|
|
92
92
|
const {
|
|
93
|
-
container:
|
|
93
|
+
container: t,
|
|
94
94
|
tab: b
|
|
95
|
-
} = i,
|
|
96
|
-
if (
|
|
95
|
+
} = i, d = b.offsetParent, p = b.offsetWidth;
|
|
96
|
+
if (d === t && Number.isFinite(b.offsetLeft) && Number.isFinite(p))
|
|
97
97
|
return {
|
|
98
98
|
x: b.offsetLeft,
|
|
99
|
-
width:
|
|
100
|
-
visible:
|
|
99
|
+
width: p,
|
|
100
|
+
visible: p > 0
|
|
101
101
|
};
|
|
102
|
-
const g =
|
|
102
|
+
const g = t.getBoundingClientRect(), k = b.getBoundingClientRect(), z = t.offsetWidth || t.clientWidth, S = g.width > 0 && z > 0 ? g.width / z : 1, R = Number.isFinite(S) && S > 0 ? S : 1, T = k.width / R;
|
|
103
103
|
return {
|
|
104
|
-
x: (k.left - g.left +
|
|
105
|
-
width:
|
|
106
|
-
visible:
|
|
104
|
+
x: (k.left - g.left + t.scrollLeft) / R,
|
|
105
|
+
width: T,
|
|
106
|
+
visible: T > 0
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
const [
|
|
109
|
+
function dt(i) {
|
|
110
|
+
const [t, b] = ve(i, ["items", "activeId", "defaultActiveId", "onChange", "onActiveIdChange", "onClose", "onAdd", "showAdd", "closable", "size", "features", "slotClassNames", "ariaLabel", "class"]), d = () => t.features?.indicator?.mode ?? "activeBorder", p = () => Ve(t.features?.indicator?.thicknessPx), g = () => t.features?.indicator?.colorToken ?? "primary", k = () => t.features?.indicator?.animated ?? !0, z = () => t.features?.containerBorder ?? !0, S = () => t.features?.scrollButtons ?? "auto", R = () => t.features?.closeButton?.dangerHover ?? !0, T = () => t.features?.closeButton?.enabledByDefault ?? t.closable ?? !1, he = () => t.features?.addButton?.enabled ?? t.showAdd ?? !1, Y = () => Ye(p()), W = () => Je(g());
|
|
111
111
|
let u;
|
|
112
|
-
const
|
|
112
|
+
const J = (() => {
|
|
113
113
|
try {
|
|
114
114
|
return Ee();
|
|
115
115
|
} catch {
|
|
116
116
|
return null;
|
|
117
117
|
}
|
|
118
|
-
})(),
|
|
119
|
-
let
|
|
120
|
-
const [E,
|
|
118
|
+
})(), A = () => J ? J.active() : !0;
|
|
119
|
+
let F = !1;
|
|
120
|
+
const [E, _] = L(V), H = /* @__PURE__ */ new Map();
|
|
121
121
|
let j = !1;
|
|
122
|
-
const P = () =>
|
|
122
|
+
const P = () => d() === "slider", Q = (s) => {
|
|
123
123
|
if (!u || !P()) return !1;
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
124
|
+
const r = H.get(s);
|
|
125
|
+
if (!r) return !1;
|
|
126
126
|
const a = Ze({
|
|
127
127
|
container: u,
|
|
128
|
-
tab:
|
|
128
|
+
tab: r
|
|
129
129
|
});
|
|
130
|
-
return
|
|
130
|
+
return _(a), a.visible;
|
|
131
131
|
}, be = () => {
|
|
132
132
|
if (!P()) {
|
|
133
|
-
|
|
133
|
+
_(V);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
Q(q()) || _(V);
|
|
137
137
|
}, D = () => {
|
|
138
|
-
j || (j = !0,
|
|
139
|
-
j = !1,
|
|
140
|
-
|
|
138
|
+
j || (j = !0, O(() => {
|
|
139
|
+
j = !1, de(() => {
|
|
140
|
+
A() && be();
|
|
141
141
|
});
|
|
142
142
|
}));
|
|
143
|
-
},
|
|
144
|
-
committed: () =>
|
|
143
|
+
}, Z = () => t.activeId !== void 0, ge = () => t.onChange ?? t.onActiveIdChange, [me, we] = L(de(() => t.defaultActiveId ?? t.items[0]?.id ?? "")), ee = Te({
|
|
144
|
+
committed: () => Z() ? t.activeId : me(),
|
|
145
145
|
commit: (s) => {
|
|
146
|
-
|
|
146
|
+
Z() || we(s), ge()?.(s);
|
|
147
147
|
}
|
|
148
|
-
}), q =
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
}), q = ee.visual;
|
|
149
|
+
K(() => {
|
|
150
|
+
A() && (d(), q(), D());
|
|
151
151
|
});
|
|
152
|
-
const [
|
|
152
|
+
const [G, Ce] = L(!1), [U, pe] = L(!1), [ke, ye] = L(!1), te = () => S() === "auto" && ke(), xe = () => {
|
|
153
153
|
if (!u) return;
|
|
154
154
|
const {
|
|
155
155
|
scrollLeft: s,
|
|
156
|
-
scrollWidth:
|
|
156
|
+
scrollWidth: r,
|
|
157
157
|
clientWidth: a
|
|
158
|
-
} = u,
|
|
159
|
-
ye(
|
|
158
|
+
} = u, e = r > a;
|
|
159
|
+
ye(e), Ce(s > 0), pe(s + a < r - 1);
|
|
160
160
|
}, M = () => {
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
F || (F = !0, O(() => {
|
|
162
|
+
F = !1, A() && xe();
|
|
163
163
|
}));
|
|
164
164
|
}, Be = () => {
|
|
165
165
|
u && u.scrollBy({
|
|
@@ -172,148 +172,159 @@ function ct(i) {
|
|
|
172
172
|
behavior: "smooth"
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
|
-
|
|
176
|
-
if (!u || !
|
|
175
|
+
K(() => {
|
|
176
|
+
if (!u || !A()) return;
|
|
177
177
|
M(), D();
|
|
178
178
|
const s = () => M();
|
|
179
179
|
u.addEventListener("scroll", s);
|
|
180
|
-
const
|
|
180
|
+
const r = () => {
|
|
181
181
|
M(), D();
|
|
182
182
|
};
|
|
183
183
|
let a;
|
|
184
|
-
typeof ResizeObserver < "u" ? (a = new ResizeObserver(
|
|
185
|
-
u?.removeEventListener("scroll", s), a?.disconnect(), typeof window < "u" && window.removeEventListener("resize",
|
|
184
|
+
typeof ResizeObserver < "u" ? (a = new ResizeObserver(r), a.observe(u)) : typeof window < "u" && window.addEventListener("resize", r), ce(() => {
|
|
185
|
+
u?.removeEventListener("scroll", s), a?.disconnect(), typeof window < "u" && window.removeEventListener("resize", r);
|
|
186
186
|
});
|
|
187
|
-
}),
|
|
188
|
-
|
|
187
|
+
}), K(() => {
|
|
188
|
+
A() && (t.items.length, M(), D());
|
|
189
189
|
});
|
|
190
|
-
const
|
|
191
|
-
|
|
190
|
+
const X = (s, r) => {
|
|
191
|
+
r || (ee.request(s), P() && Q(s));
|
|
192
192
|
}, Se = (s) => {
|
|
193
|
-
const
|
|
194
|
-
if (!
|
|
195
|
-
|
|
196
|
-
const a = H.get(
|
|
193
|
+
const r = t.items.find((e) => e.id === s);
|
|
194
|
+
if (!r) return;
|
|
195
|
+
X(r.id, r.disabled);
|
|
196
|
+
const a = H.get(r.id);
|
|
197
197
|
a?.focus({
|
|
198
198
|
preventScroll: !0
|
|
199
199
|
}), a?.scrollIntoView({
|
|
200
200
|
block: "nearest",
|
|
201
201
|
inline: "nearest"
|
|
202
202
|
});
|
|
203
|
-
}, Ae = (s,
|
|
204
|
-
const a = Ke(
|
|
203
|
+
}, Ae = (s, r) => {
|
|
204
|
+
const a = Ke(t.items, r.id, s.key);
|
|
205
205
|
a && (s.preventDefault(), Se(a));
|
|
206
|
-
},
|
|
206
|
+
}, Ne = (s, r) => {
|
|
207
207
|
s.stopPropagation();
|
|
208
|
-
const a =
|
|
208
|
+
const a = t.onClose;
|
|
209
209
|
if (!a) return;
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
},
|
|
210
|
+
const e = r;
|
|
211
|
+
O(() => a(e));
|
|
212
|
+
}, $e = {
|
|
213
213
|
sm: "h-[var(--floe-control-height-sm)] px-[var(--floe-control-padding-sm)]",
|
|
214
214
|
md: "h-[var(--floe-control-height-md)] px-[var(--floe-control-padding-md)]"
|
|
215
|
-
}, Le = (s,
|
|
216
|
-
const a = h("inline-flex items-center gap-1.5 whitespace-nowrap", "text-[length:var(--floe-type-control)] leading-[var(--floe-line-control)]"),
|
|
217
|
-
const
|
|
218
|
-
return
|
|
215
|
+
}, Le = (s, r) => {
|
|
216
|
+
const a = h("inline-flex items-center gap-1.5 whitespace-nowrap", "text-[length:var(--floe-type-control)] leading-[var(--floe-line-control)]"), e = r ? "cursor-not-allowed opacity-50" : "cursor-pointer", o = (() => {
|
|
217
|
+
const c = d();
|
|
218
|
+
return c === "none" || c === "slider" && E().visible ? "border-transparent" : W().tabBorderClass;
|
|
219
219
|
})();
|
|
220
220
|
return h(
|
|
221
221
|
a,
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
e,
|
|
223
|
+
$e[t.size ?? "md"],
|
|
224
224
|
"rounded-control",
|
|
225
|
-
|
|
225
|
+
Y().tabBorderClass,
|
|
226
226
|
/* The selected face is painted by the surface layer (`data-floe-surface`
|
|
227
227
|
* plus `aria-selected`), which keeps the fill, hairline and first
|
|
228
228
|
* elevation step identical to every other selected control. */
|
|
229
|
-
s ? h(
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
s ? h(o, "text-foreground", t.slotClassNames?.tabActive) : h("border-transparent text-[var(--floe-ink-soft)]", t.slotClassNames?.tabInactive),
|
|
230
|
+
r && "opacity-50",
|
|
231
|
+
t.slotClassNames?.tab
|
|
232
232
|
);
|
|
233
233
|
};
|
|
234
234
|
return (() => {
|
|
235
|
-
var s = je(),
|
|
235
|
+
var s = je(), r = s.firstChild;
|
|
236
236
|
ue(s, fe({
|
|
237
237
|
get class() {
|
|
238
|
-
return h(
|
|
238
|
+
return h(
|
|
239
|
+
/* One strip, one baseline: the rail, the scroll buttons and the add
|
|
240
|
+
* button all take their height from the row, so nothing floats above
|
|
241
|
+
* the rule. The rail's fill is carried onto those trailing controls,
|
|
242
|
+
* otherwise the band stops short and leaves a notch beside the last
|
|
243
|
+
* control. */
|
|
244
|
+
"relative flex items-stretch",
|
|
245
|
+
t.size === "sm" ? "min-h-[var(--floe-control-height-sm)]" : "min-h-[var(--floe-control-height-md)]",
|
|
246
|
+
z() && "border-b border-[var(--floe-line)]",
|
|
247
|
+
t.slotClassNames?.root,
|
|
248
|
+
t.class
|
|
249
|
+
);
|
|
239
250
|
}
|
|
240
|
-
}, b), !1, !0), f(s, v(
|
|
251
|
+
}, b), !1, !0), f(s, v(I, {
|
|
241
252
|
get when() {
|
|
242
253
|
return te();
|
|
243
254
|
},
|
|
244
255
|
get children() {
|
|
245
|
-
var
|
|
246
|
-
return
|
|
256
|
+
var e = Oe();
|
|
257
|
+
return e.$$click = Be, f(e, v(Qe, {
|
|
247
258
|
class: "w-4 h-4"
|
|
248
|
-
})),
|
|
249
|
-
var
|
|
250
|
-
return
|
|
259
|
+
})), x((o) => {
|
|
260
|
+
var c = !G(), l = h("flex-shrink-0 flex items-center justify-center", "w-6 rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "transition-opacity duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", G() ? "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] opacity-100" : "opacity-0 pointer-events-none", t.slotClassNames?.scrollButton);
|
|
261
|
+
return c !== o.e && (e.disabled = o.e = c), l !== o.t && B(e, o.t = l), o;
|
|
251
262
|
}, {
|
|
252
263
|
e: void 0,
|
|
253
264
|
t: void 0
|
|
254
|
-
}),
|
|
265
|
+
}), e;
|
|
255
266
|
}
|
|
256
|
-
}),
|
|
267
|
+
}), r);
|
|
257
268
|
var a = u;
|
|
258
|
-
return typeof a == "function" ? ie(a,
|
|
269
|
+
return typeof a == "function" ? ie(a, r) : u = r, f(r, v(I, {
|
|
259
270
|
get when() {
|
|
260
|
-
return
|
|
271
|
+
return ae(() => !!P())() && E().visible;
|
|
261
272
|
},
|
|
262
273
|
get children() {
|
|
263
|
-
var
|
|
264
|
-
return
|
|
265
|
-
var
|
|
266
|
-
return
|
|
274
|
+
var e = We();
|
|
275
|
+
return x((o) => {
|
|
276
|
+
var c = h("pointer-events-none absolute bottom-0 left-0 z-10", Y().sliderHeightClass, W().sliderBgClass, k() ? "transition-[transform,width] duration-[var(--floe-duration-base)] ease-out motion-reduce:transition-none" : "transition-none", "will-change-transform", t.slotClassNames?.indicator), l = `translate3d(${E().x}px, 0, 0)`, y = `${E().width}px`;
|
|
277
|
+
return c !== o.e && B(e, o.e = c), l !== o.t && le(e, "transform", o.t = l), y !== o.a && le(e, "width", o.a = y), o;
|
|
267
278
|
}, {
|
|
268
279
|
e: void 0,
|
|
269
280
|
t: void 0,
|
|
270
281
|
a: void 0
|
|
271
|
-
}),
|
|
282
|
+
}), e;
|
|
272
283
|
}
|
|
273
|
-
}), null), f(
|
|
284
|
+
}), null), f(r, v(Re, {
|
|
274
285
|
get each() {
|
|
275
|
-
return
|
|
286
|
+
return t.items;
|
|
276
287
|
},
|
|
277
|
-
by: (
|
|
278
|
-
children: (
|
|
279
|
-
const
|
|
288
|
+
by: (e) => e.id,
|
|
289
|
+
children: (e) => {
|
|
290
|
+
const o = () => e().id === q(), c = () => e().closable ?? T();
|
|
280
291
|
return (() => {
|
|
281
|
-
var l = Ue(),
|
|
292
|
+
var l = Ue(), y = l.firstChild;
|
|
282
293
|
return l.$$keydown = (n) => {
|
|
283
294
|
if (n.key === "Enter" || n.key === " ") {
|
|
284
|
-
n.preventDefault(),
|
|
295
|
+
n.preventDefault(), X(e().id, e().disabled);
|
|
285
296
|
return;
|
|
286
297
|
}
|
|
287
|
-
Ae(n,
|
|
288
|
-
}, l.$$click = () =>
|
|
289
|
-
H.set(
|
|
290
|
-
}, l), f(l, v(
|
|
298
|
+
Ae(n, e());
|
|
299
|
+
}, l.$$click = () => X(e().id, e().disabled), ie((n) => {
|
|
300
|
+
H.set(e().id, n), ce(() => H.delete(e().id));
|
|
301
|
+
}, l), f(l, v(I, {
|
|
291
302
|
get when() {
|
|
292
|
-
return
|
|
303
|
+
return e().icon;
|
|
293
304
|
},
|
|
294
305
|
get children() {
|
|
295
306
|
var n = qe();
|
|
296
|
-
return f(n, () =>
|
|
307
|
+
return f(n, () => e().icon), n;
|
|
297
308
|
}
|
|
298
|
-
}),
|
|
309
|
+
}), y), f(y, () => e().label), f(l, v(I, {
|
|
299
310
|
get when() {
|
|
300
|
-
return
|
|
311
|
+
return ae(() => !!c())() && !e().disabled;
|
|
301
312
|
},
|
|
302
313
|
get children() {
|
|
303
314
|
var n = Ge();
|
|
304
|
-
return n.$$click = (
|
|
315
|
+
return n.$$click = (w) => Ne(w, e().id), f(n, v(He, {
|
|
305
316
|
class: "w-3 h-3"
|
|
306
|
-
})),
|
|
307
|
-
var
|
|
308
|
-
return
|
|
317
|
+
})), x((w) => {
|
|
318
|
+
var N = h("flex-shrink-0 flex items-center justify-center", "w-5 h-5 rounded-control cursor-pointer", "bg-transparent text-[var(--floe-ink-quiet)]", R() ? "hover:bg-error hover:text-error-foreground" : "hover:bg-[var(--floe-state-hover)]", "ml-1.5", t.slotClassNames?.closeButton), $ = `Close ${e().label}`;
|
|
319
|
+
return N !== w.e && B(n, w.e = N), $ !== w.t && m(n, "aria-label", w.t = $), w;
|
|
309
320
|
}, {
|
|
310
321
|
e: void 0,
|
|
311
322
|
t: void 0
|
|
312
323
|
}), n;
|
|
313
324
|
}
|
|
314
|
-
}), null),
|
|
315
|
-
var
|
|
316
|
-
return
|
|
325
|
+
}), null), x((n) => {
|
|
326
|
+
var w = Le(o(), e().disabled), N = e().domId, $ = e().panelId, re = o() ? "raised" : "flat", oe = o(), ne = e().disabled, se = e().disabled ? -1 : o() ? 0 : -1;
|
|
327
|
+
return w !== n.e && B(l, n.e = w), N !== n.t && m(l, "id", n.t = N), $ !== n.a && m(l, "aria-controls", n.a = $), re !== n.o && m(l, "data-floe-surface", n.o = re), oe !== n.i && m(l, "aria-selected", n.i = oe), ne !== n.n && m(l, "aria-disabled", n.n = ne), se !== n.s && m(l, "tabindex", n.s = se), n;
|
|
317
328
|
}, {
|
|
318
329
|
e: void 0,
|
|
319
330
|
t: void 0,
|
|
@@ -325,80 +336,82 @@ function ct(i) {
|
|
|
325
336
|
}), l;
|
|
326
337
|
})();
|
|
327
338
|
}
|
|
328
|
-
}), null), f(s, v(
|
|
339
|
+
}), null), f(s, v(I, {
|
|
329
340
|
get when() {
|
|
330
341
|
return he();
|
|
331
342
|
},
|
|
332
343
|
get children() {
|
|
333
|
-
var
|
|
334
|
-
return
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
}, f(
|
|
344
|
+
var e = Fe();
|
|
345
|
+
return e.$$click = () => {
|
|
346
|
+
const o = t.onAdd;
|
|
347
|
+
o && O(() => o());
|
|
348
|
+
}, f(e, v(Pe, {
|
|
338
349
|
get class() {
|
|
339
|
-
return
|
|
350
|
+
return t.size === "sm" ? "w-3.5 h-3.5" : "w-4 h-4";
|
|
340
351
|
}
|
|
341
|
-
})),
|
|
352
|
+
})), x(() => B(e, h("flex-shrink-0 flex items-center justify-center", "rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] hover:text-foreground", t.size === "sm" ? "w-7" : "w-8", t.slotClassNames?.addButton))), e;
|
|
342
353
|
}
|
|
343
|
-
}), null), f(s, v(
|
|
354
|
+
}), null), f(s, v(I, {
|
|
344
355
|
get when() {
|
|
345
356
|
return te();
|
|
346
357
|
},
|
|
347
358
|
get children() {
|
|
348
|
-
var
|
|
349
|
-
return
|
|
359
|
+
var e = _e();
|
|
360
|
+
return e.$$click = Ie, f(e, v(De, {
|
|
350
361
|
class: "w-4 h-4"
|
|
351
|
-
})),
|
|
352
|
-
var
|
|
353
|
-
return
|
|
362
|
+
})), x((o) => {
|
|
363
|
+
var c = !U(), l = h("flex-shrink-0 flex items-center justify-center", "w-6 rounded-control cursor-pointer bg-[var(--floe-well)] border border-[var(--floe-line)]", "transition-opacity duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", U() ? "text-[var(--floe-ink-quiet)] hover:bg-[var(--floe-state-hover)] opacity-100" : "opacity-0 pointer-events-none", t.slotClassNames?.scrollButton);
|
|
364
|
+
return c !== o.e && (e.disabled = o.e = c), l !== o.t && B(e, o.t = l), o;
|
|
354
365
|
}, {
|
|
355
366
|
e: void 0,
|
|
356
367
|
t: void 0
|
|
357
|
-
}),
|
|
368
|
+
}), e;
|
|
358
369
|
}
|
|
359
|
-
}), null),
|
|
360
|
-
var
|
|
370
|
+
}), null), x((e) => {
|
|
371
|
+
var o = h(
|
|
361
372
|
"relative flex-1 flex items-end gap-0.5 overflow-x-auto",
|
|
362
373
|
"scrollbar-none",
|
|
363
374
|
// Hide scrollbar for all browsers
|
|
364
375
|
"[&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",
|
|
365
|
-
|
|
366
|
-
),
|
|
367
|
-
return
|
|
376
|
+
t.slotClassNames?.scrollContainer
|
|
377
|
+
), c = G() ? "" : void 0, l = U() ? "" : void 0, y = t.ariaLabel;
|
|
378
|
+
return o !== e.e && B(r, e.e = o), c !== e.t && m(r, "data-floe-overflow-start", e.t = c), l !== e.a && m(r, "data-floe-overflow-end", e.a = l), y !== e.o && m(r, "aria-label", e.o = y), e;
|
|
368
379
|
}, {
|
|
369
380
|
e: void 0,
|
|
370
|
-
t: void 0
|
|
381
|
+
t: void 0,
|
|
382
|
+
a: void 0,
|
|
383
|
+
o: void 0
|
|
371
384
|
}), s;
|
|
372
385
|
})();
|
|
373
386
|
}
|
|
374
|
-
function
|
|
375
|
-
const [
|
|
376
|
-
return v(
|
|
387
|
+
function ct(i) {
|
|
388
|
+
const [t, b] = ve(i, ["active", "keepMounted", "labelledBy", "class", "children"]);
|
|
389
|
+
return v(I, {
|
|
377
390
|
get when() {
|
|
378
|
-
return
|
|
391
|
+
return t.keepMounted || t.active;
|
|
379
392
|
},
|
|
380
393
|
get children() {
|
|
381
|
-
var
|
|
382
|
-
return ue(
|
|
394
|
+
var d = Xe();
|
|
395
|
+
return ue(d, fe({
|
|
383
396
|
get "aria-labelledby"() {
|
|
384
|
-
return
|
|
397
|
+
return t.labelledBy;
|
|
385
398
|
},
|
|
386
399
|
get "aria-hidden"() {
|
|
387
|
-
return !
|
|
400
|
+
return !t.active && t.keepMounted ? "true" : void 0;
|
|
388
401
|
},
|
|
389
402
|
get tabIndex() {
|
|
390
|
-
return
|
|
403
|
+
return t.active ? 0 : -1;
|
|
391
404
|
},
|
|
392
405
|
get class() {
|
|
393
|
-
return h(!
|
|
406
|
+
return h(!t.active && t.keepMounted && "hidden", t.class);
|
|
394
407
|
}
|
|
395
|
-
}, b), !1, !0), f(
|
|
408
|
+
}, b), !1, !0), f(d, () => t.children), d;
|
|
396
409
|
}
|
|
397
410
|
});
|
|
398
411
|
}
|
|
399
|
-
|
|
412
|
+
ze(["click", "keydown"]);
|
|
400
413
|
export {
|
|
401
|
-
|
|
402
|
-
|
|
414
|
+
ct as TabPanel,
|
|
415
|
+
dt as Tabs,
|
|
403
416
|
Ke as resolveTabNavigationTargetId
|
|
404
417
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animate the panel from its previous height to whatever its content now needs.
|
|
3
|
+
* Returns a disposer. A panel that is entering, exiting, suspended, or hidden
|
|
4
|
+
* is left alone: its own opening motion already owns the box, and animating a
|
|
5
|
+
* height nobody can see only queues late frames.
|
|
6
|
+
*/
|
|
7
|
+
export declare function observeDialogHeight(element: HTMLElement, options?: {
|
|
8
|
+
isSettled?: () => boolean;
|
|
9
|
+
}): () => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function g() {
|
|
2
|
+
const e = globalThis.matchMedia;
|
|
3
|
+
return typeof e != "function" ? !1 : e.call(globalThis, "(prefers-reduced-motion: reduce)").matches;
|
|
4
|
+
}
|
|
5
|
+
function p(e, l = {}) {
|
|
6
|
+
const u = globalThis.ResizeObserver;
|
|
7
|
+
if (typeof u != "function") return () => {
|
|
8
|
+
};
|
|
9
|
+
const f = () => e.offsetHeight, d = () => typeof e.getAnimations == "function" && e.getAnimations().some((t) => t !== n && t.playState === "running");
|
|
10
|
+
let a = f(), n = null, c = !1, i = null;
|
|
11
|
+
const b = () => {
|
|
12
|
+
n = null, e.style.willChange = "", !c && i && i.observe(e, { box: "border-box" });
|
|
13
|
+
}, h = (t) => {
|
|
14
|
+
const r = a;
|
|
15
|
+
if (a = t, !Number.isFinite(r) || Math.abs(r - t) < 0.5 || g()) return;
|
|
16
|
+
i?.unobserve(e);
|
|
17
|
+
const o = e.animate(
|
|
18
|
+
[{ height: `${r}px` }, { height: `${t}px` }],
|
|
19
|
+
{
|
|
20
|
+
duration: 220,
|
|
21
|
+
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
22
|
+
fill: "none"
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
n = o, e.style.willChange = "height", o.addEventListener("finish", () => {
|
|
26
|
+
if (c) return;
|
|
27
|
+
b();
|
|
28
|
+
const s = f();
|
|
29
|
+
Math.abs(s - a) >= 0.5 && h(s);
|
|
30
|
+
}), o.oncancel = () => {
|
|
31
|
+
c || b();
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
return i = new u((t) => {
|
|
35
|
+
const r = t[t.length - 1];
|
|
36
|
+
if (!r || n) return;
|
|
37
|
+
const o = Array.isArray(r.borderBoxSize) ? r.borderBoxSize[0] : r.borderBoxSize, s = o ? o.blockSize : r.contentRect.height;
|
|
38
|
+
if (l.isSettled && !l.isSettled() || d()) {
|
|
39
|
+
a = s;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
h(s);
|
|
43
|
+
}), i.observe(e, { box: "border-box" }), () => {
|
|
44
|
+
c = !0, i.disconnect(), n?.cancel(), n = null, e.style.willChange = "";
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
p as observeDialogHeight
|
|
49
|
+
};
|
|
@@ -11,6 +11,7 @@ export { FloatingWindow, type FloatingWindowProps } from './FloatingWindow';
|
|
|
11
11
|
export { SurfaceFloatingPanel, type SurfaceFloatingPanelProps, type SurfaceFloatingPanelHandleProps, } from './SurfaceFloatingPanel';
|
|
12
12
|
export type { SurfaceFloatingPanelBoundaryInsets, SurfaceFloatingPanelPosition, } from './surfaceFloatingPanelGeometry';
|
|
13
13
|
export { createFloatingPresence, type FloatingPresence, type FloatingPresenceOptions, type FloatingPresenceState, } from './floatingPresence';
|
|
14
|
+
export { observeDialogHeight } from './dialogHeightMotion';
|
|
14
15
|
export { MENU_ITEM_SELECTOR, focusMenuItem, getMenuItems, handleMenuKeyboardNavigation, moveMenuFocus, type MenuDismissReason, type MenuFocusMode, type MenuItemNavigationOptions, type MenuKeyboardNavigationOptions, } from './menuUtils';
|
|
15
16
|
export { resolveFloatingWindowViewport, type FloatingWindowRect, type FloatingWindowViewport, type FloatingWindowViewportInsets, } from './floatingWindowGeometry';
|
|
16
17
|
export { Dropdown, Select, type DropdownProps, type DropdownItem, type SelectProps, } from './Dropdown';
|
|
@@ -40,12 +40,6 @@ export interface CommandContribution<TProtocol = unknown> {
|
|
|
40
40
|
category?: string;
|
|
41
41
|
execute: (ctx: ComponentContext<TProtocol>) => void | Promise<void>;
|
|
42
42
|
}
|
|
43
|
-
export interface StatusBarContribution {
|
|
44
|
-
id: string;
|
|
45
|
-
position: 'left' | 'right';
|
|
46
|
-
order?: number;
|
|
47
|
-
component: Component;
|
|
48
|
-
}
|
|
49
43
|
export type SidebarCollapseBehavior = 'toggle' | 'preserve';
|
|
50
44
|
export interface FloeComponent<TProtocol = unknown> {
|
|
51
45
|
id: string;
|
|
@@ -84,7 +78,6 @@ export interface FloeComponent<TProtocol = unknown> {
|
|
|
84
78
|
collapseBehavior?: SidebarCollapseBehavior;
|
|
85
79
|
};
|
|
86
80
|
commands?: CommandContribution<TProtocol>[];
|
|
87
|
-
statusBar?: StatusBarContribution[];
|
|
88
81
|
onMount?: (context: ComponentContext<TProtocol>) => void | Promise<void>;
|
|
89
82
|
onUnmount?: () => void | Promise<void>;
|
|
90
83
|
}
|
|
@@ -103,7 +96,6 @@ export interface ComponentRegistryValue<TProtocol = unknown> {
|
|
|
103
96
|
order: number;
|
|
104
97
|
}>>;
|
|
105
98
|
allCommands: Accessor<CommandContribution<TProtocol>[]>;
|
|
106
|
-
statusBarItems: Accessor<StatusBarContribution[]>;
|
|
107
99
|
getComponent: (id: string) => FloeComponent<TProtocol> | undefined;
|
|
108
100
|
}
|
|
109
101
|
export declare function useComponentContextFactory<TProtocol = unknown>(): (componentId: string, extra?: Pick<ComponentContext<TProtocol>, "protocol">) => ComponentContext<TProtocol>;
|