@mkbabb/glass-ui 3.3.0 → 3.5.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/{DataTable-FfkaAg2z.js → DataTable-DyKc_26a.js} +144 -106
- package/dist/{NumberFieldContent-iOTQ5rGO.js → NumberFieldContent-jO-zGOHf.js} +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/{button-Ckn3eDfB.js → button-i8Ek5vvg.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/carousel.js +1 -1
- package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +27 -0
- package/dist/components/custom/deck-progress/index.d.ts +2 -0
- package/dist/components/custom/dock/composables/useLayerTransition.d.ts +11 -0
- package/dist/components/ui/data-table/composables/useDataTableResponsive.d.ts +28 -0
- package/dist/components/ui/data-table/composables/useDataTableRowIdentity.d.ts +33 -0
- package/dist/composables/dark/useGlobalDark.d.ts +17 -6
- package/dist/composables/dom/index.d.ts +3 -0
- package/dist/composables/dom/useBreakpoint.d.ts +38 -0
- package/dist/composables/dom/useIdleReady.d.ts +63 -0
- package/dist/composables/dom/useTokenColor.d.ts +13 -0
- package/dist/composables/dom/useViewportReady.d.ts +87 -0
- package/dist/composables/glass/index.d.ts +1 -1
- package/dist/composables/glass/useGlassRenderer.d.ts +10 -3
- package/dist/composables/motion/useAnimatedNumber.d.ts +8 -2
- package/dist/composables/motion/useCountup.d.ts +8 -2
- package/dist/composables/motion/useNumericTransition.d.ts +31 -9
- package/dist/composables/motion/useViewTransition.d.ts +16 -1
- package/dist/confirm-dialog.js +1 -1
- package/dist/data-table.js +1 -1
- package/dist/dock.js +169 -158
- package/dist/dom.js +4 -4
- package/dist/glass-panel.js +14 -14
- package/dist/glass-ui.css +1 -1
- package/dist/glass-ui.js +134 -119
- package/dist/goo-blob.js +108 -89
- package/dist/index.d.ts +1 -0
- package/dist/labeled-field.js +1 -1
- package/dist/motion-core.js +1 -1
- package/dist/number-field.js +1 -1
- package/dist/search.js +1 -1
- package/dist/{slider-BOh8ycfZ.js → slider-CgNzRSh6.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/styles/components.css +1 -1
- package/dist/styles/dock.css +112 -48
- package/dist/styles/glass.css +44 -1
- package/dist/styles/instrument-chassis.css +10 -13
- package/dist/styles/instrument-rail.css +11 -12
- package/dist/styles/tokens.css +9 -7
- package/dist/styles/utilities.css +20 -0
- package/dist/styles/view-transition.css +24 -0
- package/dist/tabs.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/useViewTransition-CJnqg6wl.js +21 -0
- package/dist/useViewportReady-Dcvf0c4p.js +191 -0
- package/package.json +5 -3
- package/src/styles/dock.css +112 -48
- package/src/styles/glass.css +44 -1
- package/src/styles/instrument-chassis.css +10 -13
- package/src/styles/instrument-rail.css +11 -12
- package/src/styles/tokens.css +9 -7
- package/src/styles/utilities.css +20 -0
- package/src/styles/view-transition.css +24 -0
- package/dist/useClipboard-D8vFyRCa.js +0 -97
- package/dist/useViewTransition-D4ssvnXZ.js +0 -18
package/dist/dock.js
CHANGED
|
@@ -5,11 +5,11 @@ import { t as r } from "./useTouchGate-CS5Csc2h.js";
|
|
|
5
5
|
import { n as i } from "./createContext-DBMGRlx4.js";
|
|
6
6
|
import { i as a, n as o, r as s, t as c } from "./dockContext-spUj_-E5.js";
|
|
7
7
|
import { i as l, n as u, r as d, t as f } from "./TabsIndicator-DA0x9gPr.js";
|
|
8
|
-
import { t as p } from "./useViewTransition-
|
|
9
|
-
import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createVNode as b, defineComponent as x, mergeModels as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeStyle as E, onBeforeUnmount as D, onMounted as O, onUnmounted as k, openBlock as A, readonly as j, ref as M, renderList as N, renderSlot as P, resolveDynamicComponent as F, toDisplayString as I, unref as L, useAttrs as R, useId as
|
|
10
|
-
import { DropdownMenuTrigger as
|
|
11
|
-
import { SpringProgress as
|
|
12
|
-
var
|
|
8
|
+
import { t as p } from "./useViewTransition-CJnqg6wl.js";
|
|
9
|
+
import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createVNode as b, defineComponent as x, mergeModels as S, mergeProps as C, nextTick as w, normalizeClass as T, normalizeStyle as E, onBeforeUnmount as D, onMounted as O, onUnmounted as k, openBlock as A, readonly as j, ref as M, renderList as N, renderSlot as P, resolveDynamicComponent as F, toDisplayString as I, unref as L, useAttrs as R, useId as ee, useModel as z, useTemplateRef as B, watch as V, withCtx as H } from "vue";
|
|
10
|
+
import { DropdownMenuTrigger as U, Primitive as W, SelectIcon as G, SelectTrigger as K, useForwardProps as q } from "reka-ui";
|
|
11
|
+
import { SpringProgress as te } from "@mkbabb/keyframes.js";
|
|
12
|
+
var J = t("pause", [["rect", {
|
|
13
13
|
x: "14",
|
|
14
14
|
y: "3",
|
|
15
15
|
width: "5",
|
|
@@ -23,20 +23,20 @@ var Y = t("pause", [["rect", {
|
|
|
23
23
|
height: "18",
|
|
24
24
|
rx: "1",
|
|
25
25
|
key: "1wsw3u"
|
|
26
|
-
}]]),
|
|
26
|
+
}]]), ne = t("play", [["path", {
|
|
27
27
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
28
28
|
key: "10ikf1"
|
|
29
29
|
}]]);
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/components/custom/dock/composables/isTeleportedTarget.ts
|
|
32
|
-
function
|
|
32
|
+
function Y(e, t) {
|
|
33
33
|
if (!(e instanceof Element)) return !1;
|
|
34
34
|
let n = e.closest("[data-glass-dock-portal]");
|
|
35
35
|
return n ? t ? n.getAttribute("data-glass-dock-owner") === t : !0 : !1;
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/components/custom/dock/composables/useDockState.ts
|
|
39
|
-
function
|
|
39
|
+
function re(e) {
|
|
40
40
|
let { collapseDelay: t = 2500, rootEl: n, alwaysExpanded: r = !1, isTransitioning: i, dockId: a, onStateChange: o } = e, s = () => typeof r == "boolean" ? r : r.value, c = s(), l = M(c ? "pinned" : "collapsed"), u = M(c), d = M(c), f = null, p = M(0), m = h(() => p.value > 0), g = null, _ = null, v = !1, y = l.value;
|
|
41
41
|
function b() {
|
|
42
42
|
s() && (l.value = "pinned"), u.value = l.value !== "collapsed", d.value = l.value === "pinned", o && y !== l.value && o(l.value, y), y = l.value;
|
|
@@ -83,7 +83,7 @@ function ne(e) {
|
|
|
83
83
|
if (p.value > 0) return;
|
|
84
84
|
if (e) {
|
|
85
85
|
let t = n.value;
|
|
86
|
-
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) ||
|
|
86
|
+
if (t && e.relatedTarget instanceof Node && t.contains(e.relatedTarget) || Y(e.relatedTarget, a)) return;
|
|
87
87
|
}
|
|
88
88
|
w();
|
|
89
89
|
}
|
|
@@ -94,7 +94,7 @@ function ne(e) {
|
|
|
94
94
|
function N(e) {
|
|
95
95
|
if (s() || l.value !== "hover" || p.value > 0) return;
|
|
96
96
|
let t = e.currentTarget;
|
|
97
|
-
e.relatedTarget && t.contains(e.relatedTarget) ||
|
|
97
|
+
e.relatedTarget && t.contains(e.relatedTarget) || Y(e.relatedTarget, a) || w();
|
|
98
98
|
}
|
|
99
99
|
function P() {
|
|
100
100
|
if (s()) {
|
|
@@ -114,15 +114,15 @@ function ne(e) {
|
|
|
114
114
|
function L(e) {
|
|
115
115
|
if (s() || i?.value) return;
|
|
116
116
|
let t = n.value;
|
|
117
|
-
!t || t.contains(e.target) ||
|
|
117
|
+
!t || t.contains(e.target) || Y(e.target, a) || E();
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return V(u, (e) => {
|
|
120
120
|
e ? (C(), _ = requestAnimationFrame(() => {
|
|
121
121
|
_ = null, u.value && (document.addEventListener("pointerdown", L, !0), g = () => {
|
|
122
122
|
document.removeEventListener("pointerdown", L, !0), g = null;
|
|
123
123
|
});
|
|
124
124
|
})) : C();
|
|
125
|
-
}), typeof r == "boolean" ? r && (l.value = "pinned", b()) :
|
|
125
|
+
}), typeof r == "boolean" ? r && (l.value = "pinned", b()) : V(r, (e) => {
|
|
126
126
|
if (e) {
|
|
127
127
|
x(), l.value = "pinned", b();
|
|
128
128
|
return;
|
|
@@ -148,107 +148,118 @@ function ne(e) {
|
|
|
148
148
|
}
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/components/custom/dock/composables/useLayerTransition.ts
|
|
151
|
-
var
|
|
152
|
-
response: .
|
|
153
|
-
dampingFraction: .
|
|
151
|
+
var X = {
|
|
152
|
+
response: .32,
|
|
153
|
+
dampingFraction: .7
|
|
154
154
|
};
|
|
155
|
-
function
|
|
156
|
-
let { containerEl: t, activeLayer: n, axis: r } = e,
|
|
157
|
-
function
|
|
158
|
-
|
|
155
|
+
function ie(e) {
|
|
156
|
+
let { containerEl: t, activeLayer: n, axis: r, directionTypes: i } = e, a = typeof document < "u" && "startViewTransition" in document, o = h(() => r?.value === "vertical" ? "height" : "width"), s = (e) => e.getBoundingClientRect()[o.value], c = M(n.value), l = M(null), u = 0, d = null, f = null, m = null;
|
|
157
|
+
function g() {
|
|
158
|
+
f &&= (f.dispose(), null), m = null;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function _(e) {
|
|
161
161
|
let t = e.trim();
|
|
162
162
|
return t ? t.endsWith("ms") ? Number.parseFloat(t) : t.endsWith("s") ? Number.parseFloat(t) * 1e3 : Number.parseFloat(t) || 0 : 0;
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
let t = getComputedStyle(e), n = t.transitionProperty.split(",").map((e) => e.trim()), r = t.transitionDuration.split(",").map(
|
|
164
|
+
function v(e) {
|
|
165
|
+
let t = getComputedStyle(e), n = t.transitionProperty.split(",").map((e) => e.trim()), r = t.transitionDuration.split(",").map(_), i = t.transitionDelay.split(",").map(_), a = r.map((e, t) => {
|
|
166
166
|
let r = n[t] ?? n[0] ?? "all";
|
|
167
|
-
return r !== "all" && r !==
|
|
167
|
+
return r !== "all" && r !== o.value ? 0 : e + (i[t] ?? i[0] ?? 0);
|
|
168
168
|
});
|
|
169
|
-
return Math.max(0, ...
|
|
169
|
+
return Math.max(0, ...a) + 50;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
171
|
+
function y() {
|
|
172
|
+
d &&= (clearTimeout(d), null);
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
e.style.setProperty(
|
|
176
|
-
}
|
|
177
|
-
function b(e) {
|
|
178
|
-
e.style.removeProperty(a.value);
|
|
174
|
+
function b(e, t) {
|
|
175
|
+
e.style.setProperty(o.value, t);
|
|
179
176
|
}
|
|
180
177
|
function x(e) {
|
|
181
|
-
e.style.
|
|
178
|
+
e.style.removeProperty(o.value);
|
|
182
179
|
}
|
|
183
180
|
function S(e) {
|
|
181
|
+
e.style.willChange = o.value;
|
|
182
|
+
}
|
|
183
|
+
function C(e) {
|
|
184
184
|
e.style.willChange = "auto";
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
function T(e) {
|
|
187
|
+
return e.closest(".glass-dock");
|
|
188
|
+
}
|
|
189
|
+
function E(e) {
|
|
190
|
+
T(e)?.setAttribute("data-morphing", "");
|
|
191
|
+
}
|
|
192
|
+
function D(e) {
|
|
193
|
+
T(e)?.removeAttribute("data-morphing");
|
|
194
|
+
}
|
|
195
|
+
V(n, (e, n) => {
|
|
187
196
|
if (e === n) return;
|
|
188
197
|
let r = t.value;
|
|
189
198
|
if (!r) {
|
|
190
|
-
|
|
199
|
+
c.value = e, l.value = null;
|
|
191
200
|
return;
|
|
192
201
|
}
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
let t = ++
|
|
196
|
-
|
|
202
|
+
if (a) {
|
|
203
|
+
y();
|
|
204
|
+
let t = ++u;
|
|
205
|
+
E(r);
|
|
206
|
+
let { finished: i } = p(() => {
|
|
207
|
+
l.value = n, c.value = e;
|
|
197
208
|
});
|
|
198
|
-
|
|
199
|
-
t ===
|
|
209
|
+
i.finally(() => {
|
|
210
|
+
t === u && (l.value = null, D(r));
|
|
200
211
|
});
|
|
201
212
|
return;
|
|
202
213
|
}
|
|
203
214
|
if (typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
204
|
-
|
|
215
|
+
y(), ++u, c.value = e, l.value = null;
|
|
205
216
|
return;
|
|
206
217
|
}
|
|
207
|
-
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
let t =
|
|
214
|
-
if (
|
|
215
|
-
r.style.transition = "",
|
|
218
|
+
y();
|
|
219
|
+
let i = ++u, o = f !== null && m === r && !f.settled ? f : null, h = o ? o.value : s(r);
|
|
220
|
+
o || (g(), b(r, `${h}px`)), w(() => {
|
|
221
|
+
i === u && r && requestAnimationFrame(() => {
|
|
222
|
+
if (i !== u) return;
|
|
223
|
+
l.value = n, c.value = e, r.style.transition = "none", x(r);
|
|
224
|
+
let t = s(r);
|
|
225
|
+
if (b(r, `${h}px`), r.offsetWidth, !o && Math.abs(t - h) < .5) {
|
|
226
|
+
r.style.transition = "", x(r), C(r), D(r), l.value = null;
|
|
216
227
|
return;
|
|
217
228
|
}
|
|
218
|
-
|
|
219
|
-
response:
|
|
220
|
-
dampingFraction:
|
|
221
|
-
initial:
|
|
229
|
+
S(r), E(r), o || (f = new te({
|
|
230
|
+
response: X.response,
|
|
231
|
+
dampingFraction: X.dampingFraction,
|
|
232
|
+
initial: h,
|
|
222
233
|
respectReducedMotion: !0
|
|
223
|
-
}),
|
|
224
|
-
let
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}),
|
|
228
|
-
|
|
229
|
-
},
|
|
234
|
+
}), m = r);
|
|
235
|
+
let a = f;
|
|
236
|
+
a.target = t, a.play((e) => {
|
|
237
|
+
i === u && (b(r, `${e}px`), a.settled && (r.style.transition = "", x(r), C(r), D(r), l.value = null, g()));
|
|
238
|
+
}), d = setTimeout(() => {
|
|
239
|
+
i === u && (r.style.transition = "", x(r), C(r), D(r), l.value = null, g());
|
|
240
|
+
}, v(r));
|
|
230
241
|
});
|
|
231
242
|
});
|
|
232
243
|
});
|
|
233
|
-
function
|
|
244
|
+
function O(e) {
|
|
234
245
|
let n = t.value;
|
|
235
|
-
n && e.target === n && e.propertyName ===
|
|
246
|
+
n && e.target === n && e.propertyName === o.value && (y(), g(), n.style.transition = "", x(n), C(n), D(n), l.value = null);
|
|
236
247
|
}
|
|
237
248
|
return k(() => {
|
|
238
|
-
|
|
249
|
+
y(), g();
|
|
239
250
|
}), {
|
|
240
|
-
onTransitionEnd:
|
|
241
|
-
currentLayer:
|
|
242
|
-
leavingLayer:
|
|
251
|
+
onTransitionEnd: O,
|
|
252
|
+
currentLayer: c,
|
|
253
|
+
leavingLayer: l
|
|
243
254
|
};
|
|
244
255
|
}
|
|
245
256
|
//#endregion
|
|
246
257
|
//#region src/components/custom/dock/GlassDock.vue?vue&type=script&setup=true&lang.ts
|
|
247
|
-
var
|
|
258
|
+
var ae = [
|
|
248
259
|
"data-density",
|
|
249
260
|
"data-held",
|
|
250
261
|
"data-container-name"
|
|
251
|
-
],
|
|
262
|
+
], oe = ["inert"], se = ["inert"], ce = /* @__PURE__ */ x({
|
|
252
263
|
__name: "GlassDock",
|
|
253
264
|
props: {
|
|
254
265
|
collapseDelay: { default: 2e3 },
|
|
@@ -278,7 +289,7 @@ var ie = [
|
|
|
278
289
|
"container-type": "inline-size",
|
|
279
290
|
"container-name": n.containerName
|
|
280
291
|
};
|
|
281
|
-
}), a =
|
|
292
|
+
}), a = B("dockEl"), s = B("layersEl"), c = h(() => n.variant), l = h(() => n.shape), u = h(() => n.variant === "rail" || n.variant === "instrument-strip" ? "vertical" : n.orientation), d = h(() => n.density), f = h(() => n.overflow === "scroll" ? u.value === "vertical" ? "dock-scroll-y" : "dock-scroll-x" : null), p = h(() => n.alwaysExpanded || u.value === "vertical"), m = h(() => n.fitContent || n.variant === "rail" || n.variant === "instrument-strip"), g = M(!1), _ = r(n.collapseDelay), b = `glass-dock-${ee()}`, x = null, S = 0, { expanded: C, isPinned: w, isHeld: k, onMouseEnter: j, onMouseLeave: N, onFocusIn: F, onFocusOut: I, onClickCollapsed: R, keepOpen: z, release: H, expand: U, collapse: W } = re({
|
|
282
293
|
collapseDelay: n.collapseDelay,
|
|
283
294
|
rootEl: a,
|
|
284
295
|
alwaysExpanded: p,
|
|
@@ -288,78 +299,78 @@ var ie = [
|
|
|
288
299
|
o({
|
|
289
300
|
id: b,
|
|
290
301
|
orientation: u,
|
|
291
|
-
keepOpen:
|
|
292
|
-
release:
|
|
302
|
+
keepOpen: z,
|
|
303
|
+
release: H,
|
|
293
304
|
held: k
|
|
294
305
|
});
|
|
295
|
-
let
|
|
306
|
+
let G = h(() => p.value || C.value), { onTransitionEnd: K } = ie({
|
|
296
307
|
containerEl: s,
|
|
297
|
-
activeLayer: h(() =>
|
|
308
|
+
activeLayer: h(() => G.value ? "full" : "summary"),
|
|
298
309
|
axis: h(() => "horizontal")
|
|
299
|
-
}),
|
|
310
|
+
}), q = typeof document < "u" && "startViewTransition" in document, te = h(() => q ? {
|
|
300
311
|
"view-transition-name": b.replace(/[^a-zA-Z0-9_-]/g, "-"),
|
|
301
312
|
"view-transition-class": "gl-dock-layer"
|
|
302
313
|
} : void 0);
|
|
303
|
-
function
|
|
314
|
+
function J(e) {
|
|
304
315
|
let t = e.trim();
|
|
305
316
|
return t ? t.endsWith("ms") ? Number.parseFloat(t) : t.endsWith("s") ? Number.parseFloat(t) * 1e3 : Number.parseFloat(t) || 0 : 0;
|
|
306
317
|
}
|
|
307
|
-
function
|
|
308
|
-
let t = getComputedStyle(e), n = t.transitionDuration.split(",").map(
|
|
318
|
+
function ne(e) {
|
|
319
|
+
let t = getComputedStyle(e), n = t.transitionDuration.split(",").map(J), r = t.transitionDelay.split(",").map(J);
|
|
309
320
|
return Math.max(0, ...n.map((e, t) => e + (r[t] ?? r[0] ?? 0)));
|
|
310
321
|
}
|
|
311
|
-
function
|
|
322
|
+
function Y() {
|
|
312
323
|
x &&= (clearTimeout(x), null);
|
|
313
324
|
}
|
|
314
|
-
let
|
|
325
|
+
let X = new Set([
|
|
315
326
|
"width",
|
|
316
327
|
"height",
|
|
317
328
|
"padding",
|
|
318
329
|
"transform"
|
|
319
330
|
]);
|
|
320
|
-
function
|
|
331
|
+
function ce() {
|
|
321
332
|
let e = a.value;
|
|
322
333
|
if (!e) return;
|
|
323
334
|
let t = ++S;
|
|
324
|
-
|
|
335
|
+
Y(), g.value = !0, x = setTimeout(() => {
|
|
325
336
|
t === S && (g.value = !1, x = null);
|
|
326
|
-
},
|
|
337
|
+
}, ne(e) + 50);
|
|
327
338
|
}
|
|
328
|
-
function
|
|
329
|
-
e.target === a.value &&
|
|
339
|
+
function Z(e) {
|
|
340
|
+
e.target === a.value && X.has(e.propertyName) && (Y(), S++, g.value = !1);
|
|
330
341
|
}
|
|
331
342
|
O(() => {
|
|
332
|
-
(n.alwaysExpanded || !n.startCollapsed) &&
|
|
343
|
+
(n.alwaysExpanded || !n.startCollapsed) && U();
|
|
333
344
|
});
|
|
334
|
-
function
|
|
345
|
+
function Q() {
|
|
335
346
|
return u.value === "horizontal" && !p.value;
|
|
336
347
|
}
|
|
337
|
-
function
|
|
338
|
-
if (
|
|
348
|
+
function le(e) {
|
|
349
|
+
if (!Q() || G.value) return;
|
|
339
350
|
let t = a.value, n = e.touches[0];
|
|
340
351
|
!t || !n || _.handleTouchStart(t, n.clientY);
|
|
341
352
|
}
|
|
342
|
-
function
|
|
343
|
-
|
|
353
|
+
function ue(e) {
|
|
354
|
+
Q() && _.handleScrollCheck(e);
|
|
344
355
|
}
|
|
345
|
-
function
|
|
346
|
-
if (
|
|
356
|
+
function de() {
|
|
357
|
+
if (!Q()) return;
|
|
347
358
|
let e = _.isActive.value;
|
|
348
|
-
_.handleTouchEnd(), !e && _.isActive.value && !
|
|
359
|
+
_.handleTouchEnd(), !e && _.isActive.value && !G.value && U();
|
|
349
360
|
}
|
|
350
|
-
return
|
|
351
|
-
!e && C.value && !w.value && !p.value &&
|
|
352
|
-
}),
|
|
353
|
-
|
|
354
|
-
}), D(
|
|
361
|
+
return V(_.isActive, (e) => {
|
|
362
|
+
!e && C.value && !w.value && !p.value && W();
|
|
363
|
+
}), V(G, (e) => {
|
|
364
|
+
ce(), e || _.deactivate();
|
|
365
|
+
}), D(Y), t({
|
|
355
366
|
expanded: C,
|
|
356
367
|
isPinned: w,
|
|
357
368
|
isHeld: k,
|
|
358
369
|
isTransitioning: g,
|
|
359
|
-
expand:
|
|
360
|
-
collapse:
|
|
361
|
-
keepOpen:
|
|
362
|
-
release:
|
|
370
|
+
expand: U,
|
|
371
|
+
collapse: W,
|
|
372
|
+
keepOpen: z,
|
|
373
|
+
release: H
|
|
363
374
|
}), (t, n) => (A(), v("div", {
|
|
364
375
|
ref_key: "dockEl",
|
|
365
376
|
ref: a,
|
|
@@ -369,8 +380,8 @@ var ie = [
|
|
|
369
380
|
`shape-${l.value}`,
|
|
370
381
|
f.value,
|
|
371
382
|
{
|
|
372
|
-
expanded:
|
|
373
|
-
collapsed: !
|
|
383
|
+
expanded: G.value,
|
|
384
|
+
collapsed: !G.value,
|
|
374
385
|
pinned: L(w),
|
|
375
386
|
"fit-content": m.value,
|
|
376
387
|
"always-expanded": p.value,
|
|
@@ -386,37 +397,37 @@ var ie = [
|
|
|
386
397
|
onMouseleave: n[3] ||= (e) => L(N)(e),
|
|
387
398
|
onFocusin: n[4] ||= (...e) => L(F) && L(F)(...e),
|
|
388
399
|
onFocusout: n[5] ||= (...e) => L(I) && L(I)(...e),
|
|
389
|
-
onTouchstart:
|
|
390
|
-
onTouchmove:
|
|
391
|
-
onTouchend:
|
|
392
|
-
onTransitionend:
|
|
393
|
-
onTransitioncancel:
|
|
400
|
+
onTouchstart: le,
|
|
401
|
+
onTouchmove: ue,
|
|
402
|
+
onTouchend: de,
|
|
403
|
+
onTransitionend: Z,
|
|
404
|
+
onTransitioncancel: Z
|
|
394
405
|
}, [u.value === "horizontal" ? (A(), v("div", {
|
|
395
406
|
key: 0,
|
|
396
407
|
ref_key: "layersEl",
|
|
397
408
|
ref: s,
|
|
398
409
|
class: "dock-layers",
|
|
399
|
-
style: E(
|
|
400
|
-
onTransitionend: n[1] ||= (...e) => L(
|
|
410
|
+
style: E(te.value),
|
|
411
|
+
onTransitionend: n[1] ||= (...e) => L(K) && L(K)(...e)
|
|
401
412
|
}, [y("div", {
|
|
402
|
-
class: T(["dock-layer dock-layer--full", { "layer-active":
|
|
413
|
+
class: T(["dock-layer dock-layer--full", { "layer-active": G.value }]),
|
|
403
414
|
inert: !L(C) || void 0
|
|
404
|
-
}, [P(t.$slots, "default")], 10,
|
|
405
|
-
class: T(["dock-layer dock-layer--summary", { "layer-active": !
|
|
415
|
+
}, [P(t.$slots, "default")], 10, oe), y("div", {
|
|
416
|
+
class: T(["dock-layer dock-layer--summary", { "layer-active": !G.value }]),
|
|
406
417
|
inert: L(C) || void 0,
|
|
407
418
|
onClick: n[0] ||= (...e) => L(R) && L(R)(...e)
|
|
408
|
-
}, [P(t.$slots, "collapsed")], 10,
|
|
419
|
+
}, [P(t.$slots, "collapsed")], 10, se)], 36)) : P(t.$slots, "default", { key: 1 })], 46, ae));
|
|
409
420
|
}
|
|
410
|
-
}),
|
|
411
|
-
|
|
412
|
-
function
|
|
413
|
-
|
|
421
|
+
}), Z = i("glass-ui:dock-layer-group", "[glass-ui:dock] <DockLayer> must be used inside <DockLayerGroup>");
|
|
422
|
+
Z.KEY;
|
|
423
|
+
function Q(e) {
|
|
424
|
+
Z.provide(e);
|
|
414
425
|
}
|
|
415
|
-
var
|
|
416
|
-
|
|
426
|
+
var le = Z.use;
|
|
427
|
+
Z.useOptional;
|
|
417
428
|
//#endregion
|
|
418
429
|
//#region src/components/custom/dock/DockLayerGroup.vue?vue&type=script&setup=true&lang.ts
|
|
419
|
-
var
|
|
430
|
+
var ue = { key: 1 }, de = { key: 2 }, fe = /* @__PURE__ */ x({
|
|
420
431
|
__name: "DockLayerGroup",
|
|
421
432
|
props: /* @__PURE__ */ S({
|
|
422
433
|
orientation: {},
|
|
@@ -431,22 +442,22 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
431
442
|
}),
|
|
432
443
|
emits: ["update:active"],
|
|
433
444
|
setup(e) {
|
|
434
|
-
let t = e, n =
|
|
445
|
+
let t = e, n = z(e, "active"), r = a(), i = M([]), o = B("containerEl");
|
|
435
446
|
function s(e) {
|
|
436
447
|
i.value.find((t) => t.id === e.id) || i.value.push(e);
|
|
437
448
|
}
|
|
438
449
|
function c(e) {
|
|
439
450
|
i.value = i.value.filter((t) => t.id !== e);
|
|
440
451
|
}
|
|
441
|
-
let p = h(() => t.orientation ?? r?.orientation.value ?? "horizontal"), { onTransitionEnd: x, currentLayer: S, leavingLayer: C } =
|
|
452
|
+
let p = h(() => t.orientation ?? r?.orientation.value ?? "horizontal"), { onTransitionEnd: x, currentLayer: S, leavingLayer: C } = ie({
|
|
442
453
|
containerEl: o,
|
|
443
454
|
activeLayer: n,
|
|
444
455
|
axis: p
|
|
445
|
-
}), w = typeof document < "u" && "startViewTransition" in document, D =
|
|
456
|
+
}), w = typeof document < "u" && "startViewTransition" in document, D = ee(), O = h(() => w ? {
|
|
446
457
|
"view-transition-name": `gl-dock-stack-${D.replace(/[^a-zA-Z0-9_-]/g, "-")}`,
|
|
447
458
|
"view-transition-class": "gl-dock-layer"
|
|
448
459
|
} : void 0);
|
|
449
|
-
|
|
460
|
+
Q({
|
|
450
461
|
register: s,
|
|
451
462
|
unregister: c,
|
|
452
463
|
currentLayerId: j(S),
|
|
@@ -456,10 +467,10 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
456
467
|
return typeof e == "object" && !!e;
|
|
457
468
|
}
|
|
458
469
|
let R = M(!1);
|
|
459
|
-
function
|
|
470
|
+
function V() {
|
|
460
471
|
R.value || (R.value = !0, r?.keepOpen());
|
|
461
472
|
}
|
|
462
|
-
function
|
|
473
|
+
function U(e) {
|
|
463
474
|
let t = e.relatedTarget, n = e.currentTarget;
|
|
464
475
|
t && n?.contains(t) || R.value && (R.value = !1, r?.release());
|
|
465
476
|
}
|
|
@@ -470,22 +481,22 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
470
481
|
orientation: "horizontal",
|
|
471
482
|
"as-child": !0
|
|
472
483
|
}, {
|
|
473
|
-
default:
|
|
484
|
+
default: H(() => [b(L(u), {
|
|
474
485
|
class: T(["dock-layer-rail", e.railPosition]),
|
|
475
|
-
onFocusin:
|
|
476
|
-
onFocusout:
|
|
486
|
+
onFocusin: V,
|
|
487
|
+
onFocusout: U
|
|
477
488
|
}, {
|
|
478
|
-
default:
|
|
489
|
+
default: H(() => [(A(!0), v(m, null, N(i.value, (e) => (A(), g(L(d), {
|
|
479
490
|
key: e.id,
|
|
480
491
|
value: e.id,
|
|
481
492
|
class: "dock-layer-tab",
|
|
482
493
|
title: e.label,
|
|
483
494
|
"aria-label": e.label ?? e.id
|
|
484
495
|
}, {
|
|
485
|
-
default:
|
|
496
|
+
default: H(() => [k(e.icon) ? (A(), g(F(e.icon), {
|
|
486
497
|
key: 0,
|
|
487
498
|
class: "size-4"
|
|
488
|
-
})) : typeof e.icon == "string" ? (A(), v("span",
|
|
499
|
+
})) : typeof e.icon == "string" ? (A(), v("span", ue, I(e.icon), 1)) : (A(), v("span", de, I((e.label ?? e.id).charAt(0)), 1))]),
|
|
489
500
|
_: 2
|
|
490
501
|
}, 1032, [
|
|
491
502
|
"value",
|
|
@@ -503,11 +514,11 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
503
514
|
onTransitionend: r[1] ||= (...e) => L(x) && L(x)(...e)
|
|
504
515
|
}, [P(t.$slots, "default")], 36)], 2));
|
|
505
516
|
}
|
|
506
|
-
}),
|
|
517
|
+
}), pe = [
|
|
507
518
|
"inert",
|
|
508
519
|
"aria-hidden",
|
|
509
520
|
"tabindex"
|
|
510
|
-
],
|
|
521
|
+
], me = /* @__PURE__ */ x({
|
|
511
522
|
__name: "DockLayer",
|
|
512
523
|
props: {
|
|
513
524
|
id: {},
|
|
@@ -515,7 +526,7 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
515
526
|
icon: {}
|
|
516
527
|
},
|
|
517
528
|
setup(e) {
|
|
518
|
-
let t = e, n =
|
|
529
|
+
let t = e, n = le();
|
|
519
530
|
O(() => {
|
|
520
531
|
n.register({
|
|
521
532
|
id: t.id,
|
|
@@ -525,8 +536,8 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
525
536
|
}), D(() => {
|
|
526
537
|
n.unregister(t.id);
|
|
527
538
|
});
|
|
528
|
-
let r = h(() => n.currentLayerId.value === t.id), i = h(() => n.leavingLayerId.value === t.id), a =
|
|
529
|
-
return
|
|
539
|
+
let r = h(() => n.currentLayerId.value === t.id), i = h(() => n.leavingLayerId.value === t.id), a = B("hostEl");
|
|
540
|
+
return V(r, async (e, t) => {
|
|
530
541
|
!e || t || typeof document < "u" && (() => {
|
|
531
542
|
let e = document.activeElement;
|
|
532
543
|
return !e || e === document.body ? !0 : !!e.closest("[inert]");
|
|
@@ -541,9 +552,9 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
541
552
|
inert: r.value ? void 0 : !0,
|
|
542
553
|
"aria-hidden": r.value ? void 0 : !0,
|
|
543
554
|
tabindex: r.value ? -1 : void 0
|
|
544
|
-
}, [P(e.$slots, "default")], 10,
|
|
555
|
+
}, [P(e.$slots, "default")], 10, pe));
|
|
545
556
|
}
|
|
546
|
-
}),
|
|
557
|
+
}), $ = /* @__PURE__ */ x({
|
|
547
558
|
__name: "DockIconButton",
|
|
548
559
|
props: {
|
|
549
560
|
compact: {
|
|
@@ -578,7 +589,7 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
578
589
|
};
|
|
579
590
|
}
|
|
580
591
|
let o = h(() => !n.asChild && n.as === "button" ? { type: n.type } : {});
|
|
581
|
-
return (e, n) => (A(), g(L(
|
|
592
|
+
return (e, n) => (A(), g(L(W), C({
|
|
582
593
|
as: t.as,
|
|
583
594
|
"as-child": t.asChild
|
|
584
595
|
}, o.value, {
|
|
@@ -586,7 +597,7 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
586
597
|
style: i.value,
|
|
587
598
|
onPointermove: a
|
|
588
599
|
}), {
|
|
589
|
-
default:
|
|
600
|
+
default: H(() => [P(e.$slots, "default")]),
|
|
590
601
|
_: 3
|
|
591
602
|
}, 16, [
|
|
592
603
|
"as",
|
|
@@ -611,18 +622,18 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
611
622
|
function a() {
|
|
612
623
|
r("update:paused", !n.paused);
|
|
613
624
|
}
|
|
614
|
-
return (t, n) => (A(), g(
|
|
625
|
+
return (t, n) => (A(), g($, {
|
|
615
626
|
type: "button",
|
|
616
627
|
"aria-pressed": e.paused,
|
|
617
628
|
"aria-label": i.value,
|
|
618
629
|
title: i.value,
|
|
619
630
|
onClick: a
|
|
620
631
|
}, {
|
|
621
|
-
default:
|
|
632
|
+
default: H(() => [e.paused ? (A(), g(L(ne), {
|
|
622
633
|
key: 0,
|
|
623
634
|
size: 18,
|
|
624
635
|
"aria-hidden": "true"
|
|
625
|
-
})) : (A(), g(L(
|
|
636
|
+
})) : (A(), g(L(J), {
|
|
626
637
|
key: 1,
|
|
627
638
|
size: 18,
|
|
628
639
|
"aria-hidden": "true"
|
|
@@ -652,12 +663,12 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
652
663
|
},
|
|
653
664
|
setup(t) {
|
|
654
665
|
let n = t, r = R(), i = h(() => r["data-tier"] === "primary"), a = h(() => e("dock-tab-button", i.value && "btn-audacious", n.class));
|
|
655
|
-
return (e, n) => (A(), g(L(
|
|
666
|
+
return (e, n) => (A(), g(L(W), {
|
|
656
667
|
as: t.as,
|
|
657
668
|
"as-child": t.asChild,
|
|
658
669
|
class: T(a.value)
|
|
659
670
|
}, {
|
|
660
|
-
default:
|
|
671
|
+
default: H(() => [P(e.$slots, "default")]),
|
|
661
672
|
_: 3
|
|
662
673
|
}, 8, [
|
|
663
674
|
"as",
|
|
@@ -681,13 +692,13 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
681
692
|
] }
|
|
682
693
|
},
|
|
683
694
|
setup(t) {
|
|
684
|
-
let r = t, i =
|
|
695
|
+
let r = t, i = q(h(() => {
|
|
685
696
|
let { class: e, ...t } = r;
|
|
686
697
|
return t;
|
|
687
698
|
}));
|
|
688
|
-
return (t, a) => (A(), g(L(
|
|
689
|
-
default:
|
|
690
|
-
default:
|
|
699
|
+
return (t, a) => (A(), g(L(K), C(L(i), { class: L(e)("dock-select-trigger", r.class) }), {
|
|
700
|
+
default: H(() => [P(t.$slots, "default"), b(L(G), { "as-child": "" }, {
|
|
701
|
+
default: H(() => [P(t.$slots, "icon", {}, () => [b(L(n), { class: "dock-select-trigger__chevron" })])]),
|
|
691
702
|
_: 3
|
|
692
703
|
})]),
|
|
693
704
|
_: 3
|
|
@@ -709,15 +720,15 @@ var le = { key: 1 }, ue = { key: 2 }, de = /* @__PURE__ */ x({
|
|
|
709
720
|
] }
|
|
710
721
|
},
|
|
711
722
|
setup(t) {
|
|
712
|
-
let n = t, r =
|
|
723
|
+
let n = t, r = q(h(() => {
|
|
713
724
|
let { class: e, ...t } = n;
|
|
714
725
|
return t;
|
|
715
726
|
}));
|
|
716
|
-
return (t, i) => (A(), g(L(
|
|
717
|
-
default:
|
|
727
|
+
return (t, i) => (A(), g(L(U), C(L(r), { class: L(e)("dock-dropdown-trigger", n.class) }), {
|
|
728
|
+
default: H(() => [P(t.$slots, "default")]),
|
|
718
729
|
_: 3
|
|
719
730
|
}, 16, ["class"]));
|
|
720
731
|
}
|
|
721
732
|
});
|
|
722
733
|
//#endregion
|
|
723
|
-
export { c as DOCK_CONTEXT_KEY, he as DockBackgroundToggle, ve as DockDropdownTrigger,
|
|
734
|
+
export { c as DOCK_CONTEXT_KEY, he as DockBackgroundToggle, ve as DockDropdownTrigger, $ as DockIconButton, me as DockLayer, fe as DockLayerGroup, _e as DockSelectTrigger, ge as DockTabButton, ce as GlassDock, o as provideDockContext, s as useDockContext, a as useOptionalDockContext };
|
package/dist/dom.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./useResizeObserver-DX-STszm.js";
|
|
2
2
|
import { t } from "./useTouchGate-CS5Csc2h.js";
|
|
3
|
-
import { n, r,
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
export {
|
|
3
|
+
import { a as n, i as r, n as i, o as a, r as o, t as s } from "./useViewportReady-Dcvf0c4p.js";
|
|
4
|
+
import { t as c } from "./useUserInvalidAria-DmvZ_6Dx.js";
|
|
5
|
+
import { t as l } from "./useTextHighlight-Dmtofpk2.js";
|
|
6
|
+
export { r as copyToClipboard, o as useBreakpoint, n as useClipboard, i as useIdleReady, e as useResizeObserver, l as useTextHighlight, a as useTokenColor, t as useTouchGate, c as useUserInvalidAria, s as useViewportReady };
|