@mkbabb/glass-ui 3.4.0 → 3.5.1

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.
Files changed (65) hide show
  1. package/dist/{DataTable-FfkaAg2z.js → DataTable-DyKc_26a.js} +144 -106
  2. package/dist/{NumberFieldContent-iOTQ5rGO.js → NumberFieldContent-jO-zGOHf.js} +1 -1
  3. package/dist/api/index.d.ts +1 -0
  4. package/dist/{button-Ckn3eDfB.js → button-i8Ek5vvg.js} +1 -1
  5. package/dist/button.js +1 -1
  6. package/dist/carousel.js +1 -1
  7. package/dist/components/custom/deck-progress/DeckProgress.vue.d.ts +27 -0
  8. package/dist/components/custom/deck-progress/index.d.ts +2 -0
  9. package/dist/components/custom/dock/composables/useLayerTransition.d.ts +11 -0
  10. package/dist/components/ui/data-table/composables/useDataTableResponsive.d.ts +28 -0
  11. package/dist/components/ui/data-table/composables/useDataTableRowIdentity.d.ts +33 -0
  12. package/dist/composables/dark/useGlobalDark.d.ts +17 -6
  13. package/dist/composables/dom/index.d.ts +3 -0
  14. package/dist/composables/dom/useBreakpoint.d.ts +38 -0
  15. package/dist/composables/dom/useIdleReady.d.ts +63 -0
  16. package/dist/composables/dom/useTokenColor.d.ts +13 -0
  17. package/dist/composables/dom/useViewportReady.d.ts +87 -0
  18. package/dist/composables/glass/index.d.ts +1 -1
  19. package/dist/composables/glass/useGlassRenderer.d.ts +10 -3
  20. package/dist/composables/motion/core/index.d.ts +1 -0
  21. package/dist/composables/motion/index.d.ts +1 -0
  22. package/dist/composables/motion/useAnimatedNumber.d.ts +8 -2
  23. package/dist/composables/motion/useAnimatedNumberMap.d.ts +29 -0
  24. package/dist/composables/motion/useCountup.d.ts +8 -2
  25. package/dist/composables/motion/useNumericTransition.d.ts +17 -6
  26. package/dist/composables/motion/useStagger.d.ts +50 -0
  27. package/dist/composables/motion/useViewTransition.d.ts +16 -1
  28. package/dist/confirm-dialog.js +1 -1
  29. package/dist/data-table.js +1 -1
  30. package/dist/dock.js +169 -158
  31. package/dist/dom.js +4 -4
  32. package/dist/glass-panel.js +14 -14
  33. package/dist/glass-ui.css +1 -1
  34. package/dist/glass-ui.js +134 -119
  35. package/dist/goo-blob.js +108 -89
  36. package/dist/index.d.ts +1 -0
  37. package/dist/labeled-field.js +1 -1
  38. package/dist/motion-core.js +88 -47
  39. package/dist/motion.js +29 -19
  40. package/dist/number-field.js +1 -1
  41. package/dist/search.js +1 -1
  42. package/dist/{slider-BOh8ycfZ.js → slider-CgNzRSh6.js} +1 -1
  43. package/dist/slider.js +1 -1
  44. package/dist/styles/components.css +1 -1
  45. package/dist/styles/dock.css +91 -36
  46. package/dist/styles/glass.css +44 -1
  47. package/dist/styles/instrument-chassis.css +10 -13
  48. package/dist/styles/instrument-rail.css +11 -12
  49. package/dist/styles/tokens.css +9 -7
  50. package/dist/styles/utilities.css +20 -0
  51. package/dist/styles/view-transition.css +24 -0
  52. package/dist/tabs.js +1 -1
  53. package/dist/timeline.js +1 -1
  54. package/dist/useViewTransition-CJnqg6wl.js +21 -0
  55. package/dist/useViewportReady-Dcvf0c4p.js +191 -0
  56. package/package.json +2 -1
  57. package/src/styles/dock.css +91 -36
  58. package/src/styles/glass.css +44 -1
  59. package/src/styles/instrument-chassis.css +10 -13
  60. package/src/styles/instrument-rail.css +11 -12
  61. package/src/styles/tokens.css +9 -7
  62. package/src/styles/utilities.css +20 -0
  63. package/src/styles/view-transition.css +24 -0
  64. package/dist/useClipboard-D8vFyRCa.js +0 -97
  65. package/dist/useViewTransition-D4ssvnXZ.js +0 -18
@@ -1,5 +1,5 @@
1
1
  import { i as e, n as t, r as n, t as r } from "./vReveal-u2wSG2El.js";
2
- import { n as i, t as a } from "./useViewTransition-D4ssvnXZ.js";
2
+ import { n as i, t as a } from "./useViewTransition-CJnqg6wl.js";
3
3
  import { n as o, t as s } from "./useIntersectionPause-DAdVPVp4.js";
4
4
  import { n as c, t as l } from "./constants-DsCdlK9I.js";
5
5
  import { computed as u, getCurrentScope as d, onBeforeUnmount as f, onMounted as p, onScopeDispose as m, reactive as h, readonly as g, ref as _, unref as v, watch as y } from "vue";
@@ -36,9 +36,50 @@ function x(e = {}) {
36
36
  };
37
37
  }
38
38
  //#endregion
39
- //#region src/composables/motion/useScrollProgress.ts
40
- var S = n();
39
+ //#region src/composables/motion/useStagger.ts
40
+ function S() {
41
+ return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
42
+ }
41
43
  function C(e) {
44
+ let t = Math.max(0, Math.floor(e.items)), n = e.delayMs ?? 80, r = e.initialDelayMs ?? 0, i = e.immediate !== !1, a = e.respectReducedMotion !== !1, o = _(Array(t).fill(!1)), s = _(t === 0), c = /* @__PURE__ */ new Set();
45
+ function l() {
46
+ for (let e of c) clearTimeout(e);
47
+ c.clear();
48
+ }
49
+ function u() {
50
+ l(), o.value = Array(t).fill(!1), s.value = t === 0;
51
+ }
52
+ function d() {
53
+ o.value = Array(t).fill(!0), s.value = !0;
54
+ }
55
+ function f() {
56
+ if (u(), t === 0) {
57
+ s.value = !0;
58
+ return;
59
+ }
60
+ if (a && S()) {
61
+ d();
62
+ return;
63
+ }
64
+ for (let e = 0; e < t; e++) {
65
+ let i = e, a = setTimeout(() => {
66
+ let e = o.value.slice();
67
+ e[i] = !0, o.value = e, c.delete(a), i === t - 1 && (s.value = !0);
68
+ }, r + i * n);
69
+ c.add(a);
70
+ }
71
+ }
72
+ return i && f(), m(l), {
73
+ revealed: o,
74
+ start: f,
75
+ reset: u,
76
+ isComplete: s
77
+ };
78
+ }
79
+ //#endregion
80
+ //#region src/composables/motion/useScrollProgress.ts
81
+ var w = n();
82
+ function T(e) {
42
83
  let { offset: t = 0, trackExit: n = !1 } = e, r = _(0), i = 0, a = null;
43
84
  function o() {
44
85
  let i = v(e.target);
@@ -57,11 +98,11 @@ function C(e) {
57
98
  });
58
99
  }
59
100
  return p(() => {
60
- if (o(), S) return;
101
+ if (o(), w) return;
61
102
  window.addEventListener("scroll", s, { passive: !0 }), window.addEventListener("resize", s, { passive: !0 });
62
103
  let t = v(e.target);
63
104
  t && typeof ResizeObserver < "u" && (a = new ResizeObserver(s), a.observe(t));
64
- }), S || y(() => v(e.target), (e, t) => {
105
+ }), w || y(() => v(e.target), (e, t) => {
65
106
  t && a && a.unobserve(t), e && a && a.observe(e), s();
66
107
  }), f(() => {
67
108
  window.removeEventListener("scroll", s), window.removeEventListener("resize", s), i && cancelAnimationFrame(i), a?.disconnect(), a = null;
@@ -69,12 +110,12 @@ function C(e) {
69
110
  }
70
111
  //#endregion
71
112
  //#region src/composables/motion/useYieldToMain.ts
72
- function w() {
113
+ function E() {
73
114
  let e = globalThis.scheduler;
74
115
  return typeof e?.yield == "function" ? e.yield.bind(e) : null;
75
116
  }
76
- function T() {
77
- let e = w();
117
+ function D() {
118
+ let e = E();
78
119
  return e ? e() : typeof MessageChannel == "function" ? new Promise((e) => {
79
120
  let t = new MessageChannel();
80
121
  t.port1.onmessage = () => {
@@ -82,38 +123,38 @@ function T() {
82
123
  }, t.port2.postMessage(void 0);
83
124
  }) : new Promise((e) => setTimeout(e, 0));
84
125
  }
85
- function E() {
126
+ function O() {
86
127
  return {
87
- hasNativeYield: w() !== null,
88
- yield: T
128
+ hasNativeYield: E() !== null,
129
+ yield: D
89
130
  };
90
131
  }
91
132
  //#endregion
92
133
  //#region src/composables/motion/useRAFLoop.ts
93
- var D = "(prefers-reduced-motion: reduce)";
94
- function O() {
134
+ var k = "(prefers-reduced-motion: reduce)";
135
+ function A() {
95
136
  return typeof globalThis.requestAnimationFrame == "function" ? globalThis.requestAnimationFrame.bind(globalThis) : null;
96
137
  }
97
- function k() {
138
+ function j() {
98
139
  return typeof globalThis.cancelAnimationFrame == "function" ? globalThis.cancelAnimationFrame.bind(globalThis) : null;
99
140
  }
100
- function A() {
141
+ function M() {
101
142
  return typeof window > "u" ? null : window;
102
143
  }
103
- function j(e, t = {}) {
104
- let { immediate: n = !0, pauseWhenHidden: r = !0, respectReducedMotion: i = !0 } = t, a = _(!1), s = _(!1), c = _(!1), l = _(!1), f = _(!1), p = u(() => l.value && !a.value && (f.value || c.value || i && s.value || !O())), h = null, v = null, b = 0, x = 0, S = !1, C = null;
144
+ function N(e, t = {}) {
145
+ let { immediate: n = !0, pauseWhenHidden: r = !0, respectReducedMotion: i = !0 } = t, a = _(!1), s = _(!1), c = _(!1), l = _(!1), f = _(!1), p = u(() => l.value && !a.value && (f.value || c.value || i && s.value || !A())), h = null, v = null, b = 0, x = 0, S = !1, C = null;
105
146
  function w() {
106
- return !S && l.value && !f.value && !c.value && !(i && s.value) && !!O();
147
+ return !S && l.value && !f.value && !c.value && !(i && s.value) && !!A();
107
148
  }
108
- function E() {
109
- h !== null && (k()?.(h), h = null), a.value = !1, v = null;
149
+ function T() {
150
+ h !== null && (j()?.(h), h = null), a.value = !1, v = null;
110
151
  }
111
- function j() {
152
+ function E() {
112
153
  if (h !== null || !w()) return;
113
- let t = O();
154
+ let t = A();
114
155
  t && (a.value = !0, h = t((t) => {
115
156
  if (h = null, !w()) {
116
- E();
157
+ T();
117
158
  return;
118
159
  }
119
160
  let n = v === null ? 0 : Math.max(0, t - v);
@@ -122,38 +163,38 @@ function j(e, t = {}) {
122
163
  delta: n,
123
164
  elapsed: b,
124
165
  frame: x++
125
- }), w() ? j() : E();
166
+ }), w() ? E() : T();
126
167
  }));
127
168
  }
128
- function M() {
129
- w() ? j() : E();
169
+ function O() {
170
+ w() ? E() : T();
130
171
  }
131
172
  function N() {
132
173
  v = null, b = 0, x = 0;
133
174
  }
134
175
  function P() {
135
- S || (N(), l.value = !0, f.value = !1, M());
176
+ S || (N(), l.value = !0, f.value = !1, O());
136
177
  }
137
178
  function F() {
138
- l.value = !1, f.value = !1, N(), E();
179
+ l.value = !1, f.value = !1, N(), T();
139
180
  }
140
181
  function I() {
141
- l.value && (f.value = !0, M());
182
+ l.value && (f.value = !0, O());
142
183
  }
143
184
  function L() {
144
- S || (f.value = !1, M());
185
+ S || (f.value = !1, O());
145
186
  }
146
187
  if (r) {
147
188
  let { hidden: e } = o();
148
189
  c.value = e.value, y(e, (e) => {
149
- c.value = e, M();
190
+ c.value = e, O();
150
191
  }, { flush: "sync" });
151
192
  }
152
193
  if (i) {
153
- let e = A(), t = typeof e?.matchMedia == "function" ? e.matchMedia(D) : null;
194
+ let e = M(), t = typeof e?.matchMedia == "function" ? e.matchMedia(k) : null;
154
195
  if (t) {
155
196
  let e = (e) => {
156
- s.value = e.matches, M();
197
+ s.value = e.matches, O();
157
198
  };
158
199
  s.value = t.matches, typeof t.addEventListener == "function" ? (t.addEventListener("change", e), C = () => t.removeEventListener("change", e)) : typeof t.addListener == "function" && (t.addListener(e), C = () => t.removeListener?.(e));
159
200
  }
@@ -170,21 +211,21 @@ function j(e, t = {}) {
170
211
  pause: I,
171
212
  resume: L,
172
213
  dispose: R,
173
- yieldToMain: T
214
+ yieldToMain: D
174
215
  };
175
216
  }
176
217
  //#endregion
177
218
  //#region src/composables/motion/usePrioritizedTask.ts
178
- function M() {
219
+ function P() {
179
220
  if (!t()) return null;
180
221
  let e = globalThis.scheduler;
181
222
  return e?.postTask?.bind(e) ?? null;
182
223
  }
183
- function N() {
224
+ function F() {
184
225
  let e = /* @__PURE__ */ Error("The task was aborted.");
185
226
  return e.name = "AbortError", e;
186
227
  }
187
- function P(e) {
228
+ function I(e) {
188
229
  let t = e.filter((e) => e != null);
189
230
  if (t.length === 0) return;
190
231
  if (t.length === 1) return t[0];
@@ -199,20 +240,20 @@ function P(e) {
199
240
  }
200
241
  return n.signal;
201
242
  }
202
- function F(e, t = {}) {
203
- let { priority: n, signal: r, delay: i } = t, a = M();
243
+ function L(e, t = {}) {
244
+ let { priority: n, signal: r, delay: i } = t, a = P();
204
245
  return a ? a(e, {
205
246
  priority: n,
206
247
  signal: r,
207
248
  delay: i
208
249
  }) : new Promise((t, n) => {
209
250
  if (r?.aborted) {
210
- n(N());
251
+ n(F());
211
252
  return;
212
253
  }
213
254
  let a = () => {
214
255
  if (r?.aborted) {
215
- n(N());
256
+ n(F());
216
257
  return;
217
258
  }
218
259
  try {
@@ -229,20 +270,20 @@ function F(e, t = {}) {
229
270
  i && i > 0 ? setTimeout(o, i) : o();
230
271
  });
231
272
  }
232
- function I(e) {
273
+ function R(e) {
233
274
  let t = globalThis.TaskController;
234
275
  return typeof t == "function" ? new t(e ? { priority: e } : void 0) : null;
235
276
  }
236
- function L(e) {
237
- let t = I(e);
277
+ function z(e) {
278
+ let t = R(e);
238
279
  return {
239
- postTask: (n, r = {}) => F(n, {
280
+ postTask: (n, r = {}) => L(n, {
240
281
  priority: e,
241
282
  ...r,
242
- signal: P([t?.signal, r.signal])
283
+ signal: I([t?.signal, r.signal])
243
284
  }),
244
285
  abort: (e) => t?.abort(e)
245
286
  };
246
287
  }
247
288
  //#endregion
248
- export { l as DAMPING, c as SNAP_THRESHOLD, F as postTaskSafe, a as startViewTransition, i as supportsViewTransitions, s as useIntersectionPause, L as usePrioritizedTask, j as useRAFLoop, C as useScrollProgress, x as useStaggerReveal, E as useYieldToMain, r as vReveal, T as yieldToMain };
289
+ export { l as DAMPING, c as SNAP_THRESHOLD, L as postTaskSafe, a as startViewTransition, i as supportsViewTransitions, s as useIntersectionPause, z as usePrioritizedTask, N as useRAFLoop, T as useScrollProgress, C as useStagger, x as useStaggerReveal, O as useYieldToMain, r as vReveal, D as yieldToMain };
package/dist/motion.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { n as e, t } from "./useSpringMount-CnizvZGm.js";
2
2
  import { n, t as r } from "./constants-DsCdlK9I.js";
3
3
  import { t as i } from "./useAnimatedNumber-BF6r64lA.js";
4
- import { onBeforeUnmount as a, onScopeDispose as o, ref as s, shallowRef as c } from "vue";
5
- import { NumericAnimation as l } from "@mkbabb/keyframes.js";
4
+ import { computed as a, onBeforeUnmount as o, onScopeDispose as s, ref as c, shallowRef as l } from "vue";
5
+ import { NumericAnimation as u } from "@mkbabb/keyframes.js";
6
6
  //#region src/composables/motion/useSpringPress.ts
7
- function u(t = {}) {
8
- let n = s(0), r = e(n, {
7
+ function d(t = {}) {
8
+ let n = c(0), r = e(n, {
9
9
  response: t.response ?? .25,
10
10
  dampingFraction: t.dampingFraction ?? .7,
11
11
  initial: t.initial ?? 0,
@@ -35,10 +35,10 @@ function u(t = {}) {
35
35
  }
36
36
  //#endregion
37
37
  //#region src/composables/motion/useNumericTransition.ts
38
- function d(e) {
39
- let t = s(0), n = s(!1), { from: r, to: i, duration: o, timingFunction: u, onFrame: d } = e, f = c(new l([r, i], {
40
- duration: o,
41
- timingFunction: u
38
+ function f(e) {
39
+ let t = c(0), n = c(!1), { from: r, to: i, duration: a, timingFunction: s, onFrame: d } = e, f = l(new u([r, i], {
40
+ duration: a,
41
+ timingFunction: s
42
42
  }));
43
43
  async function p() {
44
44
  n.value && f.value.stop(), n.value = !0, t.value = 0;
@@ -61,7 +61,7 @@ function d(e) {
61
61
  function m() {
62
62
  f.value.stop(), n.value = !1;
63
63
  }
64
- return a(() => {
64
+ return o(() => {
65
65
  m();
66
66
  }), {
67
67
  start: p,
@@ -71,25 +71,35 @@ function d(e) {
71
71
  };
72
72
  }
73
73
  //#endregion
74
+ //#region src/composables/motion/useAnimatedNumberMap.ts
75
+ function p(e) {
76
+ let { keys: t, source: n, ...r } = e, o = {};
77
+ for (let e of t) {
78
+ let t = n(e), { current: s } = i(() => t.value, r);
79
+ o[e] = a(() => t.value === null ? null : s.value);
80
+ }
81
+ return o;
82
+ }
83
+ //#endregion
74
84
  //#region src/composables/motion/useCountup.ts
75
- function f() {
85
+ function m() {
76
86
  return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches;
77
87
  }
78
- function p(e, t) {
88
+ function h(e, t) {
79
89
  let { easeFn: n, skip: r } = t, i = /* @__PURE__ */ new Map();
80
90
  function a(e) {
81
91
  let t = i.get(e);
82
92
  t && (t.stop(), i.delete(e));
83
93
  }
84
- function s(e) {
94
+ function o(e) {
85
95
  e.querySelectorAll("[data-countup]").forEach((e) => {
86
96
  let t = parseFloat(e.getAttribute("data-countup") ?? "0") || 0, r = parseFloat(e.getAttribute("data-countup-dur") ?? "1200"), o = parseFloat(e.getAttribute("data-countup-delay") ?? "0");
87
- if (a(e), f()) {
97
+ if (a(e), m()) {
88
98
  e.textContent = String(t);
89
99
  return;
90
100
  }
91
101
  e.textContent = "0";
92
- let s = new l([{ v: 0 }, { v: t }], {
102
+ let s = new u([{ v: 0 }, { v: t }], {
93
103
  duration: r,
94
104
  timingFunction: n
95
105
  });
@@ -112,9 +122,9 @@ function p(e, t) {
112
122
  function c() {
113
123
  if (r?.()) return;
114
124
  let t = e.value?.querySelector("[data-state=\"active\"]");
115
- t && s(t);
125
+ t && o(t);
116
126
  }
117
- function u() {
127
+ function l() {
118
128
  document.querySelectorAll("[data-countup]").forEach((e) => {
119
129
  a(e), e.textContent = e.getAttribute("data-countup") ?? e.textContent;
120
130
  });
@@ -122,11 +132,11 @@ function p(e, t) {
122
132
  function d() {
123
133
  for (let e of [...i.keys()]) a(e);
124
134
  }
125
- return o(d), {
135
+ return s(d), {
126
136
  runActive: c,
127
- settle: u,
137
+ settle: l,
128
138
  cancel: d
129
139
  };
130
140
  }
131
141
  //#endregion
132
- export { r as DAMPING, n as SNAP_THRESHOLD, i as useAnimatedNumber, p as useCountup, d as useNumericTransition, e as useSpring, t as useSpringMount, u as useSpringPress };
142
+ export { r as DAMPING, n as SNAP_THRESHOLD, i as useAnimatedNumber, p as useAnimatedNumberMap, h as useCountup, f as useNumericTransition, e as useSpring, t as useSpringMount, d as useSpringPress };
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "./NumberFieldContent-iOTQ5rGO.js";
1
+ import { a as e, i as t, n, r, t as i } from "./NumberFieldContent-jO-zGOHf.js";
2
2
  export { e as NumberField, i as NumberFieldContent, n as NumberFieldDecrement, r as NumberFieldIncrement, t as NumberFieldInput };
package/dist/search.js CHANGED
@@ -3,7 +3,7 @@ import { n as t, t as n } from "./minimize-2-BP27-qBY.js";
3
3
  import { t as r } from "./search-DBG8qaRs.js";
4
4
  import { t as i } from "./x-C4pz9nbD.js";
5
5
  import { n as a } from "./badge-Cl6JZ1B7.js";
6
- import { n as o } from "./button-Ckn3eDfB.js";
6
+ import { n as o } from "./button-i8Ek5vvg.js";
7
7
  import { n as s, t as c } from "./DialogContent-IQ8_BRrC.js";
8
8
  import { t as l } from "./useTextHighlight-Dmtofpk2.js";
9
9
  import { n as u, r as d, t as f } from "./PopoverContent-B8WtJECb.js";
@@ -108,7 +108,7 @@ var w = /* @__PURE__ */ t(/* @__PURE__ */ l({
108
108
  "data-touch-active"
109
109
  ]));
110
110
  }
111
- }), [["__scopeId", "data-v-78e48602"]]), T = C("glass-slider focus-ring relative flex w-full touch-none select-none items-center transition-colors", {
111
+ }), [["__scopeId", "data-v-d91b5dad"]]), T = C("glass-slider focus-ring relative flex w-full touch-none select-none items-center transition-colors", {
112
112
  variants: {
113
113
  variant: {
114
114
  standard: "",
package/dist/slider.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./slider-BOh8ycfZ.js";
1
+ import { n as e, t } from "./slider-CgNzRSh6.js";
2
2
  export { e as Slider, t as sliderVariants };